From 1a7eb3454eb887d9639c435ac0a6f1bd50c9b2bf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 8 Sep 2012 08:59:47 +0000 Subject: style cleanup --- intern/ghost/intern/GHOST_C-api.cpp | 5 +- intern/ghost/test/multitest/EventToBuf.c | 45 +++---- intern/ghost/test/multitest/MultiTest.c | 24 ++-- source/blender/blenkernel/intern/text.c | 3 +- source/blender/blenkernel/intern/writeffmpeg.c | 39 ++++--- source/blender/bmesh/intern/bmesh_core.c | 12 +- source/blender/bmesh/intern/bmesh_operators.c | 12 +- .../blender/editors/interface/interface_handlers.c | 42 ++++--- source/blender/editors/interface/interface_utils.c | 6 +- source/blender/editors/space_info/info_stats.c | 9 +- source/blender/editors/space_node/node_edit.c | 9 +- .../editors/space_node/node_relationships.c | 3 +- source/blender/editors/transform/transform.c | 12 +- source/blender/makesrna/intern/makesrna.c | 129 ++++++++++++++------- source/blender/makesrna/intern/rna_access.c | 57 ++++++--- source/blender/makesrna/intern/rna_define.c | 126 +++++++++++++------- source/blender/makesrna/intern/rna_object_api.c | 6 +- .../composite/nodes/node_composite_channelMatte.c | 9 +- .../blender/windowmanager/intern/wm_event_system.c | 28 +++-- source/blender/windowmanager/intern/wm_window.c | 9 +- 20 files changed, 381 insertions(+), 204 deletions(-) diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index bb6c90cd431..0a4325930d5 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -529,7 +529,10 @@ char *GHOST_GetTitle(GHOST_WindowHandle windowhandle) char *ctitle = (char *) malloc(title.Length() + 1); - if (ctitle == NULL) return NULL; + if (ctitle == NULL) { + return NULL; + } + strcpy(ctitle, title.Ptr()); return ctitle; diff --git a/intern/ghost/test/multitest/EventToBuf.c b/intern/ghost/test/multitest/EventToBuf.c index 034fbe04447..0eb37a58be2 100644 --- a/intern/ghost/test/multitest/EventToBuf.c +++ b/intern/ghost/test/multitest/EventToBuf.c @@ -203,33 +203,36 @@ void event_to_buf(GHOST_EventHandle evt, char buf[128]) void *data= GHOST_GetEventData(evt); char *pos= buf; - pos+= sprintf(pos, "event: %6.2f, %16s", time, eventtype_to_string(type)); + pos += sprintf(pos, "event: %6.2f, %16s", time, eventtype_to_string(type)); if (win) { char *s= GHOST_GetTitle(win); - pos+= sprintf(pos, " - win: %s", s); + pos += sprintf(pos, " - win: %s", s); free(s); } else { pos+= sprintf(pos, " - sys evt"); } switch (type) { - case GHOST_kEventCursorMove: { - GHOST_TEventCursorData *cd= data; - pos+= sprintf(pos, " - pos: (%d, %d)", cd->x, cd->y); - break; - } - case GHOST_kEventButtonDown: - case GHOST_kEventButtonUp: { - GHOST_TEventButtonData *bd= data; - pos+= sprintf(pos, " - but: %d", bd->button); - break; - } - - case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { - GHOST_TEventKeyData *kd= data; - pos+= sprintf(pos, " - key: %s (%d)", keytype_to_string(kd->key), kd->key); - if (kd->ascii) pos+= sprintf(pos, " ascii: '%c' (%d)", kd->ascii, kd->ascii); - break; - } + case GHOST_kEventCursorMove: + { + GHOST_TEventCursorData *cd= data; + pos += sprintf(pos, " - pos: (%d, %d)", cd->x, cd->y); + break; + } + case GHOST_kEventButtonDown: + case GHOST_kEventButtonUp: + { + GHOST_TEventButtonData *bd= data; + pos += sprintf(pos, " - but: %d", bd->button); + break; + } + + case GHOST_kEventKeyDown: + case GHOST_kEventKeyUp: + { + GHOST_TEventKeyData *kd= data; + pos += sprintf(pos, " - key: %s (%d)", keytype_to_string(kd->key), kd->key); + if (kd->ascii) pos+= sprintf(pos, " ascii: '%c' (%d)", kd->ascii, kd->ascii); + break; + } } } diff --git a/intern/ghost/test/multitest/MultiTest.c b/intern/ghost/test/multitest/MultiTest.c index da1c56d0a3a..5d207dafaaf 100644 --- a/intern/ghost/test/multitest/MultiTest.c +++ b/intern/ghost/test/multitest/MultiTest.c @@ -267,7 +267,8 @@ static void mainwindow_handle(void *priv, GHOST_EventHandle evt) mainwindow_log(mw, buf); switch (type) { - case GHOST_kEventCursorMove: { + case GHOST_kEventCursorMove: + { GHOST_TEventCursorData *cd = GHOST_GetEventData(evt); int x, y; GHOST_ScreenToClient(mw->win, cd->x, cd->y, &x, &y); @@ -275,13 +276,15 @@ static void mainwindow_handle(void *priv, GHOST_EventHandle evt) break; } case GHOST_kEventButtonDown: - case GHOST_kEventButtonUp: { + case GHOST_kEventButtonUp: + { GHOST_TEventButtonData *bd = GHOST_GetEventData(evt); mainwindow_do_button(mw, bd->button, (type == GHOST_kEventButtonDown)); break; } case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { + case GHOST_kEventKeyUp: + { GHOST_TEventKeyData *kd = GHOST_GetEventData(evt); mainwindow_do_key(mw, kd->key, (type == GHOST_kEventKeyDown)); break; @@ -541,7 +544,8 @@ static void loggerwindow_handle(void *priv, GHOST_EventHandle evt) GHOST_TEventType type = GHOST_GetEventType(evt); switch (type) { - case GHOST_kEventCursorMove: { + case GHOST_kEventCursorMove: + { GHOST_TEventCursorData *cd = GHOST_GetEventData(evt); int x, y; GHOST_ScreenToClient(lw->win, cd->x, cd->y, &x, &y); @@ -549,13 +553,15 @@ static void loggerwindow_handle(void *priv, GHOST_EventHandle evt) break; } case GHOST_kEventButtonDown: - case GHOST_kEventButtonUp: { + case GHOST_kEventButtonUp: + { GHOST_TEventButtonData *bd = GHOST_GetEventData(evt); loggerwindow_do_button(lw, bd->button, (type == GHOST_kEventButtonDown)); break; } case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { + case GHOST_kEventKeyUp: + { GHOST_TEventKeyData *kd = GHOST_GetEventData(evt); loggerwindow_do_key(lw, kd->key, (type == GHOST_kEventKeyDown)); break; @@ -743,13 +749,15 @@ static void extrawindow_handle(void *priv, GHOST_EventHandle evt) switch (type) { case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { + case GHOST_kEventKeyUp: + { GHOST_TEventKeyData *kd = GHOST_GetEventData(evt); extrawindow_do_key(ew, kd->key, (type == GHOST_kEventKeyDown)); break; } - case GHOST_kEventCursorMove: { + case GHOST_kEventCursorMove: + { extrawindow_spin_cursor(ew, GHOST_GetEventTime(evt)); break; } diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 7de5f97588b..787def5c20b 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1684,7 +1684,8 @@ void txt_print_undo(Text *text) printf("%c%c%c", text->undo_buf[i], text->undo_buf[i + 1], text->undo_buf[i + 2]); i += 3; break; - case UNDO_INSERT_4: case UNDO_BS_4: case UNDO_DEL_4: { + case UNDO_INSERT_4: case UNDO_BS_4: case UNDO_DEL_4: + { unsigned int uc; char c[BLI_UTF8_MAX + 1]; size_t c_len; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index cd07ac3b9ed..bd25ff8c6e6 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -177,58 +177,71 @@ static AVFrame *alloc_picture(int pix_fmt, int width, int height) static const char **get_file_extensions(int format) { switch (format) { - case FFMPEG_DV: { + case FFMPEG_DV: + { static const char *rv[] = { ".dv", NULL }; return rv; } - case FFMPEG_MPEG1: { + case FFMPEG_MPEG1: + { static const char *rv[] = { ".mpg", ".mpeg", NULL }; return rv; } - case FFMPEG_MPEG2: { + case FFMPEG_MPEG2: + { static const char *rv[] = { ".dvd", ".vob", ".mpg", ".mpeg", NULL }; return rv; } - case FFMPEG_MPEG4: { + case FFMPEG_MPEG4: + { static const char *rv[] = { ".mp4", ".mpg", ".mpeg", NULL }; return rv; } - case FFMPEG_AVI: { + case FFMPEG_AVI: + { static const char *rv[] = { ".avi", NULL }; return rv; } - case FFMPEG_MOV: { + case FFMPEG_MOV: + { static const char *rv[] = { ".mov", NULL }; return rv; } - case FFMPEG_H264: { + case FFMPEG_H264: + { /* FIXME: avi for now... */ static const char *rv[] = { ".avi", NULL }; return rv; } - case FFMPEG_XVID: { + case FFMPEG_XVID: + { /* FIXME: avi for now... */ static const char *rv[] = { ".avi", NULL }; return rv; } - case FFMPEG_FLV: { + case FFMPEG_FLV: + { static const char *rv[] = { ".flv", NULL }; return rv; } - case FFMPEG_MKV: { + case FFMPEG_MKV: + { static const char *rv[] = { ".mkv", NULL }; return rv; } - case FFMPEG_OGG: { + case FFMPEG_OGG: + { static const char *rv[] = { ".ogg", ".ogv", NULL }; return rv; } - case FFMPEG_MP3: { + case FFMPEG_MP3: + { static const char *rv[] = { ".mp3", NULL }; return rv; } - case FFMPEG_WAV: { + case FFMPEG_WAV: + { static const char *rv[] = { ".wav", NULL }; return rv; } diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 48bacce9b25..76aa8d55b5e 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -358,14 +358,16 @@ int bmesh_elem_check(void *element, const char htype) return 2; switch (htype) { - case BM_VERT: { + case BM_VERT: + { BMVert *v = element; if (v->e && v->e->head.htype != BM_EDGE) { err |= 4; } break; } - case BM_EDGE: { + case BM_EDGE: + { BMEdge *e = element; if (e->l && e->l->head.htype != BM_LOOP) err |= 8; @@ -384,7 +386,8 @@ int bmesh_elem_check(void *element, const char htype) err |= 128; break; } - case BM_LOOP: { + case BM_LOOP: + { BMLoop *l = element, *l2; int i; @@ -424,7 +427,8 @@ int bmesh_elem_check(void *element, const char htype) break; } - case BM_FACE: { + case BM_FACE: + { BMFace *f = element; BMLoop *l_iter; BMLoop *l_first; diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 0f2dc7041fa..53b95c97c8b 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -1417,7 +1417,8 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, v case '=': case '%': break; - case 'm': { + case 'm': + { int size, c; c = NEXT_CHAR(fmt); @@ -1431,12 +1432,14 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, v state = 1; break; } - case 'v': { + case 'v': + { BMO_slot_vec_set(op, slot_name, va_arg(vlist, float *)); state = 1; break; } - case 'e': { + case 'e': + { BMHeader *ele = va_arg(vlist, void *); BMOpSlot *slot = BMO_slot_get(op, slot_name); @@ -1447,7 +1450,8 @@ int BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, v state = 1; break; } - case 's': { + case 's': + { BMOperator *op2 = va_arg(vlist, void *); const char *slot_name2 = va_arg(vlist, char *); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 54b391bca6b..dcd652a6590 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1791,8 +1791,8 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle button_activate_state(C, but, BUTTON_STATE_EXIT); retval = WM_UI_HANDLER_BREAK; break; - case LEFTMOUSE: { - + case LEFTMOUSE: + { /* exit on LMB only on RELEASE for searchbox, to mimic other popups, and allow multiple menu levels */ if (data->searchbox) inbox = ui_searchbox_inside(data->searchbox, event->x, event->y); @@ -1958,7 +1958,8 @@ static void ui_do_but_textedit_select(bContext *C, uiBlock *block, uiBut *but, u int mx, my, retval = WM_UI_HANDLER_CONTINUE; switch (event->type) { - case MOUSEMOVE: { + case MOUSEMOVE: + { mx = event->x; my = event->y; ui_window_to_block(data->region, block, &mx, &my); @@ -5704,7 +5705,8 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) } break; - case TIMER: { + case TIMER: + { /* handle tooltip timer */ if (event->customdata == data->tooltiptimer) { WM_event_remove_timer(data->wm, data->window, data->tooltiptimer); @@ -5781,9 +5783,11 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) } else if (data->state == BUTTON_STATE_WAIT_FLASH) { switch (event->type) { - case TIMER: { - if (event->customdata == data->flashtimer) + case TIMER: + { + if (event->customdata == data->flashtimer) { button_activate_state(C, but, BUTTON_STATE_EXIT); + } } } @@ -5793,21 +5797,25 @@ static int ui_handle_button_event(bContext *C, wmEvent *event, uiBut *but) /* check for exit because of mouse-over another button */ switch (event->type) { case MOUSEMOVE: - - if (data->menu && data->menu->region) - if (ui_mouse_inside_region(data->menu->region, event->x, event->y)) + { + uiBut *bt; + + if (data->menu && data->menu->region) { + if (ui_mouse_inside_region(data->menu->region, event->x, event->y)) { break; - - { - uiBut *bt = ui_but_find_mouse_over(ar, event->x, event->y); + } + } - if (bt && bt->active != data) { - if (but->type != COL) /* exception */ - data->cancel = 1; - button_activate_state(C, but, BUTTON_STATE_EXIT); + bt = ui_but_find_mouse_over(ar, event->x, event->y); + + if (bt && bt->active != data) { + if (but->type != COL) { /* exception */ + data->cancel = 1; } - break; + button_activate_state(C, but, BUTTON_STATE_EXIT); } + break; + } } ui_do_button(C, block, but, event); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 8ff8e0824d6..faaf09e83b6 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -102,7 +102,8 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind else but = uiDefButR_prop(block, TEX, 0, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; - case PROP_POINTER: { + case PROP_POINTER: + { PointerRNA pptr; pptr = RNA_property_pointer_get(ptr, prop); @@ -115,7 +116,8 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind but = uiDefIconTextButR_prop(block, IDPOIN, 0, icon, name, x1, y1, x2, y2, ptr, prop, index, 0, 0, -1, -1, NULL); break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { char text[256]; BLI_snprintf(text, sizeof(text), IFACE_("%d items"), RNA_property_collection_length(ptr, prop)); but = uiDefBut(block, LABEL, 0, text, x1, y1, x2, y2, NULL, 0, 0, 0, 0, NULL); diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index 7870e64228a..4ffa99319c4 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -70,7 +70,8 @@ typedef struct SceneStats { static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) { switch (ob->type) { - case OB_MESH: { + case OB_MESH: + { /* we assume derivedmesh is already built, this strictly does stats now. */ DerivedMesh *dm = ob->derivedFinal; int totvert, totedge, totface; @@ -101,7 +102,8 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) break; case OB_SURF: case OB_CURVE: - case OB_FONT: { + case OB_FONT: + { int tot = 0, totf = 0; stats->totcurve += totob; @@ -121,7 +123,8 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) } break; } - case OB_MBALL: { + case OB_MBALL: + { int tot = 0, totf = 0; BKE_displist_count(&ob->disp, &tot, &totf); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index fbae8b17ebf..90ad1452356 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -309,7 +309,8 @@ void ED_node_shader_default(Scene *scene, ID *id) ntree = ntreeAddTree("Shader Nodetree", NTREE_SHADER, 0); switch (GS(id->name)) { - case ID_MA: { + case ID_MA: + { Material *ma = (Material *)id; ma->nodetree = ntree; @@ -326,7 +327,8 @@ void ED_node_shader_default(Scene *scene, ID *id) strength = 0.0f; break; } - case ID_WO: { + case ID_WO: + { World *wo = (World *)id; wo->nodetree = ntree; @@ -337,7 +339,8 @@ void ED_node_shader_default(Scene *scene, ID *id) strength = 1.0f; break; } - case ID_LA: { + case ID_LA: + { Lamp *la = (Lamp *)id; la->nodetree = ntree; diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index 12c221b9273..fec7366ee73 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -560,7 +560,8 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) case LEFTMOUSE: case RIGHTMOUSE: - case MIDDLEMOUSE: { + case MIDDLEMOUSE: + { for (linkdata = nldrag->links.first; linkdata; linkdata = linkdata->next) { link = linkdata->data; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 68cc1c8e9b6..a21f8fd5f34 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -5363,7 +5363,8 @@ int handleEventEdgeSlide(struct TransInfo *t, struct wmEvent *event) return 1; } break; - case FKEY: { + case FKEY: + { if (event->val == KM_PRESS) { if (sld->is_proportional == FALSE) { sld->flipped_vtx = !sld->flipped_vtx; @@ -5372,13 +5373,16 @@ int handleEventEdgeSlide(struct TransInfo *t, struct wmEvent *event) } break; } - case EVT_MODAL_MAP: { + case EVT_MODAL_MAP: + { switch (event->val) { - case TFM_MODAL_EDGESLIDE_DOWN: { + case TFM_MODAL_EDGESLIDE_DOWN: + { sld->curr_sv_index = ((sld->curr_sv_index - 1) + sld->totsv) % sld->totsv; break; } - case TFM_MODAL_EDGESLIDE_UP: { + case TFM_MODAL_EDGESLIDE_UP: + { sld->curr_sv_index = (sld->curr_sv_index + 1) % sld->totsv; break; } diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index d2ff8d13124..ef3c7f42e96 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -532,7 +532,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "get"); switch (prop->type) { - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; fprintf(f, "void %s(PointerRNA *ptr, char *value)\n", func); fprintf(f, "{\n"); @@ -565,7 +566,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, "}\n\n"); break; } - case PROP_POINTER: { + case PROP_POINTER: + { fprintf(f, "PointerRNA %s(PointerRNA *ptr)\n", func); fprintf(f, "{\n"); if (manualfunc) { @@ -584,7 +586,8 @@ static char *rna_def_property_get_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, "}\n\n"); break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; fprintf(f, "static PointerRNA %s(CollectionPropertyIterator *iter)\n", func); @@ -785,7 +788,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr func = rna_alloc_function_name(srna->identifier, rna_safe_id(prop->identifier), "set"); switch (prop->type) { - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; fprintf(f, "void %s(PointerRNA *ptr, const char *value)\n", func); fprintf(f, "{\n"); @@ -817,7 +821,8 @@ static char *rna_def_property_set_func(FILE *f, StructRNA *srna, PropertyRNA *pr fprintf(f, "}\n\n"); break; } - case PROP_POINTER: { + case PROP_POINTER: + { fprintf(f, "void %s(PointerRNA *ptr, PointerRNA value)\n", func); fprintf(f, "{\n"); if (manualfunc) { @@ -1275,7 +1280,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) prop = dp->prop; switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (!prop->arraydimension) { @@ -1291,7 +1297,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) } break; } - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (!prop->arraydimension) { @@ -1310,7 +1317,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) } break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (!prop->arraydimension) { @@ -1329,14 +1337,16 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) } break; } - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; eprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)eprop->get); eprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)eprop->set); break; } - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)sprop->get); @@ -1344,7 +1354,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) sprop->set = (void *)rna_def_property_set_func(f, srna, prop, dp, (const char *)sprop->set); break; } - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; pprop->get = (void *)rna_def_property_get_func(f, srna, prop, dp, (const char *)pprop->get); @@ -1356,7 +1367,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) } break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; const char *nextfunc = (const char *)cprop->next; @@ -1421,7 +1433,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR switch (prop->type) { case PROP_BOOLEAN: - case PROP_INT: { + case PROP_INT: + { if (!prop->arraydimension) { fprintf(f, "int %sget(PointerRNA *ptr);\n", func); /*fprintf(f, "void %sset(PointerRNA *ptr, int value);\n", func); */ @@ -1436,7 +1449,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR } break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { if (!prop->arraydimension) { fprintf(f, "float %sget(PointerRNA *ptr);\n", func); /*fprintf(f, "void %sset(PointerRNA *ptr, float value);\n", func); */ @@ -1451,7 +1465,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR } break; } - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; int i; @@ -1471,7 +1486,8 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR break; } - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (sprop->maxlength) { @@ -1484,12 +1500,14 @@ static void rna_def_property_funcs_header(FILE *f, StructRNA *srna, PropertyDefR break; } - case PROP_POINTER: { + case PROP_POINTER: + { fprintf(f, "PointerRNA %sget(PointerRNA *ptr);\n", func); /*fprintf(f, "void %sset(PointerRNA *ptr, PointerRNA value);\n", func); */ break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { fprintf(f, "void %sbegin(CollectionPropertyIterator *iter, PointerRNA *ptr);\n", func); fprintf(f, "void %snext(CollectionPropertyIterator *iter);\n", func); fprintf(f, "void %send(CollectionPropertyIterator *iter);\n", func); @@ -1520,28 +1538,32 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property fprintf(f, "\t/* */\n"); switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { if (!prop->arraydimension) fprintf(f, "\tinline bool %s(void);", rna_safe_id(prop->identifier)); else if (prop->totarraylength) fprintf(f, "\tinline Array %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } - case PROP_INT: { + case PROP_INT: + { if (!prop->arraydimension) fprintf(f, "\tinline int %s(void);", rna_safe_id(prop->identifier)); else if (prop->totarraylength) fprintf(f, "\tinline Array %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { if (!prop->arraydimension) fprintf(f, "\tinline float %s(void);", rna_safe_id(prop->identifier)); else if (prop->totarraylength) fprintf(f, "\tinline Array %s(void);", prop->totarraylength, rna_safe_id(prop->identifier)); break; } - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; int i; @@ -1559,11 +1581,13 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property fprintf(f, "\tinline %s_enum %s(void);", rna_safe_id(prop->identifier), rna_safe_id(prop->identifier)); break; } - case PROP_STRING: { + case PROP_STRING: + { fprintf(f, "\tinline std::string %s(void);", rna_safe_id(prop->identifier)); break; } - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop; if (pprop->type) @@ -1572,7 +1596,8 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property fprintf(f, "\tinline %s %s(void);", "UnknownType", rna_safe_id(prop->identifier)); break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop; if (cprop->item_type) @@ -1598,7 +1623,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe return; switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { if (!prop->arraydimension) fprintf(f, "\tBOOLEAN_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else if (prop->totarraylength) @@ -1606,7 +1632,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe rna_safe_id(prop->identifier)); break; } - case PROP_INT: { + case PROP_INT: + { if (!prop->arraydimension) fprintf(f, "\tINT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else if (prop->totarraylength) @@ -1614,7 +1641,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe rna_safe_id(prop->identifier)); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { if (!prop->arraydimension) fprintf(f, "\tFLOAT_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); else if (prop->totarraylength) @@ -1622,17 +1650,20 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe rna_safe_id(prop->identifier)); break; } - case PROP_ENUM: { + case PROP_ENUM: + { fprintf(f, "\tENUM_PROPERTY(%s_enum, %s, %s)", rna_safe_id(prop->identifier), srna->identifier, rna_safe_id(prop->identifier)); break; } - case PROP_STRING: { + case PROP_STRING: + { fprintf(f, "\tSTRING_PROPERTY(%s, %s)", srna->identifier, rna_safe_id(prop->identifier)); break; } - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)dp->prop; if (pprop->type) @@ -1643,7 +1674,8 @@ static void rna_def_property_funcs_impl_cpp(FILE *f, StructRNA *srna, PropertyDe rna_safe_id(prop->identifier)); break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { #if 0 CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)dp->prop; @@ -2218,7 +2250,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } switch (prop->type) { - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; int i, defaultfound = 0, totflag = 0; @@ -2270,7 +2303,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } break; } - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; unsigned int i; @@ -2291,7 +2325,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } break; } - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; unsigned int i; @@ -2312,7 +2347,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; unsigned int i; @@ -2380,7 +2416,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "},\n"); switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, %s, %d, ", rna_function_string(bprop->get), @@ -2393,7 +2430,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr else fprintf(f, "NULL\n"); break; } - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, %s, %s,\n\t", rna_function_string(iprop->get), @@ -2412,7 +2450,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr else fprintf(f, "NULL\n"); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, %s, %s, ", rna_function_string(fprop->get), @@ -2432,7 +2471,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr else fprintf(f, "NULL\n"); break; } - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, %d, ", rna_function_string(sprop->get), @@ -2442,7 +2482,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, sprop->defaultvalue); fprintf(f, "\n"); break; } - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, NULL, ", rna_function_string(eprop->get), @@ -2455,7 +2496,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr fprintf(f, "%d, %d\n", eprop->totitem, eprop->defaultvalue); break; } - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), rna_function_string(pprop->set), @@ -2465,7 +2507,8 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr else fprintf(f, "NULL\n"); break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; fprintf(f, "\t%s, %s, %s, %s, %s, %s, %s, %s, ", rna_function_string(cprop->begin), diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index ec4da311686..d36c0bbaf4a 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3192,19 +3192,22 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro /* handle conversions */ if (set) { switch (itemtype) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { int b; RAW_GET(int, b, in, a); RNA_property_boolean_set(&itemptr, iprop, b); break; } - case PROP_INT: { + case PROP_INT: + { int i; RAW_GET(int, i, in, a); RNA_property_int_set(&itemptr, iprop, i); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { float f; RAW_GET(float, f, in, a); RNA_property_float_set(&itemptr, iprop, f); @@ -3216,17 +3219,20 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } else { switch (itemtype) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { int b = RNA_property_boolean_get(&itemptr, iprop); RAW_SET(int, in, a, b); break; } - case PROP_INT: { + case PROP_INT: + { int i = RNA_property_int_get(&itemptr, iprop); RAW_SET(int, in, a, i); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { float f = RNA_property_float_get(&itemptr, iprop); RAW_SET(float, in, a, f); break; @@ -3251,19 +3257,22 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro /* handle conversions */ if (set) { switch (itemtype) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { for (j = 0; j < itemlen; j++, a++) RAW_GET(int, ((int *)tmparray)[j], in, a); RNA_property_boolean_set_array(&itemptr, iprop, tmparray); break; } - case PROP_INT: { + case PROP_INT: + { for (j = 0; j < itemlen; j++, a++) RAW_GET(int, ((int *)tmparray)[j], in, a); RNA_property_int_set_array(&itemptr, iprop, tmparray); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { for (j = 0; j < itemlen; j++, a++) RAW_GET(float, ((float *)tmparray)[j], in, a); RNA_property_float_set_array(&itemptr, iprop, tmparray); @@ -3275,19 +3284,22 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } else { switch (itemtype) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { RNA_property_boolean_get_array(&itemptr, iprop, tmparray); for (j = 0; j < itemlen; j++, a++) RAW_SET(int, in, a, ((int *)tmparray)[j]); break; } - case PROP_INT: { + case PROP_INT: + { RNA_property_int_get_array(&itemptr, iprop, tmparray); for (j = 0; j < itemlen; j++, a++) RAW_SET(int, in, a, ((int *)tmparray)[j]); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { RNA_property_float_get_array(&itemptr, iprop, tmparray); for (j = 0; j < itemlen; j++, a++) RAW_SET(float, in, a, ((float *)tmparray)[j]); @@ -3301,17 +3313,20 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro else { if (set) { switch (itemtype) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { RNA_property_boolean_set_array(&itemptr, iprop, &((int *)in.array)[a]); a += itemlen; break; } - case PROP_INT: { + case PROP_INT: + { RNA_property_int_set_array(&itemptr, iprop, &((int *)in.array)[a]); a += itemlen; break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { RNA_property_float_set_array(&itemptr, iprop, &((float *)in.array)[a]); a += itemlen; break; @@ -3322,17 +3337,20 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } else { switch (itemtype) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { RNA_property_boolean_get_array(&itemptr, iprop, &((int *)in.array)[a]); a += itemlen; break; } - case PROP_INT: { + case PROP_INT: + { RNA_property_int_get_array(&itemptr, iprop, &((int *)in.array)[a]); a += itemlen; break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { RNA_property_float_get_array(&itemptr, iprop, &((float *)in.array)[a]); a += itemlen; break; @@ -4924,7 +4942,8 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *UNUSE case PROP_ENUM: memcpy(data, &((EnumPropertyRNA *)parm)->defaultvalue, size); break; - case PROP_STRING: { + case PROP_STRING: + { const char *defvalue = ((StringPropertyRNA *)parm)->defaultvalue; if (defvalue && defvalue[0]) { /* causes bug [#29988], possibly this is only correct for thick wrapped diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 0320c0d7142..45092d09ce1 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -926,7 +926,8 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier } } break; - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->hardmin = (subtype == PROP_UNSIGNED) ? 0 : INT_MIN; @@ -937,7 +938,8 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier iprop->step = 1; break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->hardmin = (subtype == PROP_UNSIGNED) ? 0.0f : -FLT_MAX; @@ -959,7 +961,8 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier fprop->precision = 3; break; } - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->defaultvalue = ""; @@ -1009,19 +1012,22 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier RNA_def_property_boolean_sdna(prop, NULL, identifier, 0); DefRNA.silent = 0; break; - case PROP_INT: { + case PROP_INT: + { DefRNA.silent = 1; RNA_def_property_int_sdna(prop, NULL, identifier); DefRNA.silent = 0; break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { DefRNA.silent = 1; RNA_def_property_float_sdna(prop, NULL, identifier); DefRNA.silent = 0; break; } - case PROP_STRING: { + case PROP_STRING: + { DefRNA.silent = 1; RNA_def_property_string_sdna(prop, NULL, identifier); DefRNA.silent = 0; @@ -1173,14 +1179,16 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->softmin = (int)min; iprop->softmax = (int)max; iprop->step = (int)step; break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->softmin = (float)min; fprop->softmax = (float)max; @@ -1201,7 +1209,8 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->hardmin = (int)min; iprop->hardmax = (int)max; @@ -1209,7 +1218,8 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) iprop->softmax = MIN2((int)max, iprop->hardmax); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->hardmin = (float)min; fprop->hardmax = (float)max; @@ -1234,12 +1244,14 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type) } switch (prop->type) { - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; pprop->type = (StructRNA *)type; break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; cprop->item_type = (StructRNA *)type; break; @@ -1262,7 +1274,8 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) } switch (prop->type) { - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; pprop->type = type; @@ -1271,7 +1284,8 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) break; } - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; cprop->item_type = type; break; @@ -1290,7 +1304,8 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item int i, defaultfound = 0; switch (prop->type) { - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; eprop->item = (EnumPropertyItem *)item; eprop->totitem = 0; @@ -1325,7 +1340,8 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->maxlength = maxlength; break; @@ -1342,7 +1358,8 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; bprop->defaultvalue = value; break; @@ -1359,7 +1376,8 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; bprop->defaultarray = array; break; @@ -1376,7 +1394,8 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->defaultvalue = value; break; @@ -1393,7 +1412,8 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; iprop->defaultarray = array; break; @@ -1410,7 +1430,8 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->defaultvalue = value; break; @@ -1427,7 +1448,8 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; fprop->defaultarray = array; /* WARNING, this array must not come from the stack and lost */ break; @@ -1444,7 +1466,8 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value) StructRNA *srna = DefRNA.laststruct; switch (prop->type) { - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; sprop->defaultvalue = value; break; @@ -1462,7 +1485,8 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) int i, defaultfound = 0; switch (prop->type) { - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; eprop->defaultvalue = value; @@ -1945,7 +1969,8 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch } switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (prop->arraydimension) { @@ -1975,7 +2000,8 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char * } switch (prop->type) { - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (prop->arraydimension) { @@ -2006,7 +2032,8 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char } switch (prop->type) { - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (prop->arraydimension) { @@ -2037,7 +2064,8 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char } switch (prop->type) { - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; if (get) eprop->get = (PropEnumGetFunc)get; @@ -2062,7 +2090,8 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha } switch (prop->type) { - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (get) sprop->get = (PropStringGetFunc)get; @@ -2088,7 +2117,8 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch } switch (prop->type) { - case PROP_POINTER: { + case PROP_POINTER: + { PointerPropertyRNA *pprop = (PointerPropertyRNA *)prop; if (get) pprop->get = (PropPointerGetFunc)get; @@ -2116,7 +2146,8 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con } switch (prop->type) { - case PROP_COLLECTION: { + case PROP_COLLECTION: + { CollectionPropertyRNA *cprop = (CollectionPropertyRNA *)prop; if (begin) cprop->begin = (PropCollectionBeginFunc)begin; @@ -2742,7 +2773,8 @@ int rna_parameter_size(PropertyRNA *parm) } else return sizeof(char *); - case PROP_POINTER: { + case PROP_POINTER: + { #ifdef RNA_RUNTIME if (parm->flag & PROP_RNAPTR) return sizeof(PointerRNA); @@ -2889,7 +2921,8 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA if (prop->description) prop->description = BLI_strdup(prop->description); switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (bprop->defaultarray) { @@ -2899,7 +2932,8 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA } break; } - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (iprop->defaultarray) { @@ -2909,7 +2943,8 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA } break; } - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; if (eprop->item) { @@ -2928,7 +2963,8 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA } break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (fprop->defaultarray) { @@ -2938,7 +2974,8 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA } break; } - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (sprop->defaultvalue) sprop->defaultvalue = BLI_strdup(sprop->defaultvalue); @@ -2966,25 +3003,29 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) MEM_freeN(prop->py_data); switch (prop->type) { - case PROP_BOOLEAN: { + case PROP_BOOLEAN: + { BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop; if (bprop->defaultarray) MEM_freeN((void *)bprop->defaultarray); break; } - case PROP_INT: { + case PROP_INT: + { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; if (iprop->defaultarray) MEM_freeN((void *)iprop->defaultarray); break; } - case PROP_FLOAT: { + case PROP_FLOAT: + { FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop; if (fprop->defaultarray) MEM_freeN((void *)fprop->defaultarray); break; } - case PROP_ENUM: { + case PROP_ENUM: + { EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop; for (a = 0; a < eprop->totitem; a++) { @@ -2999,7 +3040,8 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) if (eprop->item) MEM_freeN((void *)eprop->item); break; } - case PROP_STRING: { + case PROP_STRING: + { StringPropertyRNA *sprop = (StringPropertyRNA *)prop; if (sprop->defaultvalue) MEM_freeN((void *)sprop->defaultvalue); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 7ab359661c5..5bf1cc281ad 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -84,7 +84,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ switch (ob->type) { case OB_FONT: case OB_CURVE: - case OB_SURF: { + case OB_SURF: + { ListBase dispbase = {NULL, NULL}; DerivedMesh *derivedFinal = NULL; int uv_from_orco; @@ -163,7 +164,8 @@ Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int apply_ break; } - case OB_MBALL: { + case OB_MBALL: + { /* metaballs don't have modifiers, so just convert to mesh */ Object *basis_ob = BKE_mball_basis_find(sce, ob); /* todo, re-generatre for render-res */ diff --git a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c index cda6fa85d74..06b77de463b 100644 --- a/source/blender/nodes/composite/nodes/node_composite_channelMatte.c +++ b/source/blender/nodes/composite/nodes/node_composite_channelMatte.c @@ -82,15 +82,18 @@ static void do_channel_matte(bNode *node, float *out, float *in) } case 1: { /* Alpha=G-MAX(R, B) */ switch (node->custom2) { - case 1: { + case 1: + { alpha=in[0]-MAX2(in[1], in[2]); break; } - case 2: { + case 2: + { alpha=in[1]-MAX2(in[0], in[2]); break; } - case 3: { + case 3: + { alpha=in[2]-MAX2(in[0], in[1]); break; } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index dee9d036891..17f17baba0e 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2708,7 +2708,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U switch (type) { /* mouse move */ - case GHOST_kEventCursorMove: { + case GHOST_kEventCursorMove: + { if (win->active) { GHOST_TEventCursorData *cd = customdata; wmEvent *lastevent = win->queue.last; @@ -2751,7 +2752,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } break; } - case GHOST_kEventTrackpad: { + case GHOST_kEventTrackpad: + { GHOST_TEventTrackpadData *pd = customdata; switch (pd->subtype) { case GHOST_kTrackpadEventMagnify: @@ -2783,7 +2785,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } /* mouse button */ case GHOST_kEventButtonDown: - case GHOST_kEventButtonUp: { + case GHOST_kEventButtonUp: + { GHOST_TEventButtonData *bd = customdata; event.val = (type == GHOST_kEventButtonDown) ? KM_PRESS : KM_RELEASE; @@ -2831,7 +2834,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U } /* keyboard */ case GHOST_kEventKeyDown: - case GHOST_kEventKeyUp: { + case GHOST_kEventKeyUp: + { GHOST_TEventKeyData *kd = customdata; event.type = convert_key(kd->key); event.ascii = kd->ascii; @@ -2915,7 +2919,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventWheel: { + case GHOST_kEventWheel: + { GHOST_TEventWheelData *wheelData = customdata; if (wheelData->z > 0) @@ -2928,7 +2933,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventTimer: { + case GHOST_kEventTimer: + { event.type = TIMER; event.custom = EVT_DATA_TIMER; event.customdata = customdata; @@ -2937,7 +2943,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventNDOFMotion: { + case GHOST_kEventNDOFMotion: + { event.type = NDOF_MOTION; attach_ndof_data(&event, customdata); wm_event_add(win, &event); @@ -2947,7 +2954,8 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U break; } - case GHOST_kEventNDOFButton: { + case GHOST_kEventNDOFButton: + { GHOST_TEventNDOFButtonData *e = customdata; event.type = NDOF_BUTTON_NONE + e->button; @@ -2973,12 +2981,12 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U case GHOST_kNumEventTypes: break; - case GHOST_kEventWindowDeactivate: { + case GHOST_kEventWindowDeactivate: + { event.type = WINDEACTIVATE; wm_event_add(win, &event); break; - } } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b83b93454e6..59c8235faf0 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -724,11 +724,13 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr break; } - case GHOST_kEventWindowClose: { + case GHOST_kEventWindowClose: + { wm_window_close(C, wm, win); break; } - case GHOST_kEventWindowUpdate: { + case GHOST_kEventWindowUpdate: + { if (G.debug & G_DEBUG_EVENTS) { printf("%s: ghost redraw %d\n", __func__, win->winid); } @@ -739,7 +741,8 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr break; } case GHOST_kEventWindowSize: - case GHOST_kEventWindowMove: { + case GHOST_kEventWindowMove: + { GHOST_TWindowState state; state = GHOST_GetWindowState(win->ghostwin); win->windowstate = state; -- cgit v1.2.3