diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-23 06:52:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-23 06:52:27 +0400 |
commit | 304a32bf1f1e9a5b69c9ab938e80919c50a601ed (patch) | |
tree | 78ae0d2b9a4ea7daf29c8ded9dd1d90a1fa047d7 | |
parent | 8748840564150e62c537c14172528b2d12e43e9c (diff) |
style cleanup
10 files changed, 69 insertions, 61 deletions
diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp index 3f8c432a004..7def96d426e 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp @@ -47,8 +47,8 @@ void ExecutionSystemHelper::addbNodeTree(ExecutionSystem &system, int nodes_star const bNodeTree *basetree = system.getContext().getbNodeTree(); /* update viewers in the active edittree as well the base tree (for backdrop) */ - bool is_active_group = (parent_key.value == basetree->active_viewer_key.value - || tree == basetree); + bool is_active_group = ((parent_key.value == basetree->active_viewer_key.value) || + (tree == basetree)); /* add all nodes of the tree to the node list */ bNode *node = (bNode *)tree->nodes.first; diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp index fd201fcbc11..caf71040483 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp @@ -290,41 +290,41 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, unsign X = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss X buf"); Y = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss Y buf"); W = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss W buf"); - if (xy & 1) { // H - int offset; + if (xy & 1) { // H + int offset; for (y = 0; y < src_height; ++y) { - const int yx = y * src_width; - offset = yx*COM_NUMBER_OF_CHANNELS + chan; - for (x = 0; x < src_width; ++x) { - X[x] = buffer[offset]; - offset += COM_NUMBER_OF_CHANNELS; - } + const int yx = y * src_width; + offset = yx*COM_NUMBER_OF_CHANNELS + chan; + for (x = 0; x < src_width; ++x) { + X[x] = buffer[offset]; + offset += COM_NUMBER_OF_CHANNELS; + } YVV(src_width); - offset = yx*COM_NUMBER_OF_CHANNELS + chan; - for (x = 0; x < src_width; ++x) { - buffer[offset] = Y[x]; - offset += COM_NUMBER_OF_CHANNELS; - } - } + offset = yx*COM_NUMBER_OF_CHANNELS + chan; + for (x = 0; x < src_width; ++x) { + buffer[offset] = Y[x]; + offset += COM_NUMBER_OF_CHANNELS; + } + } } - if (xy & 2) { // V - int offset; - const int add = src_width * COM_NUMBER_OF_CHANNELS; - - for (x = 0; x < src_width; ++x) { - offset = x * COM_NUMBER_OF_CHANNELS + chan; - for (y = 0; y < src_height; ++y) { - X[y] = buffer[offset]; - offset += add; - } + if (xy & 2) { // V + int offset; + const int add = src_width * COM_NUMBER_OF_CHANNELS; + + for (x = 0; x < src_width; ++x) { + offset = x * COM_NUMBER_OF_CHANNELS + chan; + for (y = 0; y < src_height; ++y) { + X[y] = buffer[offset]; + offset += add; + } YVV(src_height); - offset = x * COM_NUMBER_OF_CHANNELS + chan; - for (y = 0; y < src_height; ++y) { - buffer[offset] = Y[y]; - offset += add; - } - } - } + offset = x * COM_NUMBER_OF_CHANNELS + chan; + for (y = 0; y < src_height; ++y) { + buffer[offset] = Y[y]; + offset += add; + } + } + } MEM_freeN(X); MEM_freeN(W); diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index de04a9f2379..33ca10420ec 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1107,7 +1107,6 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op) break; case ANIMCONT_SHAPEKEY: // DOUBLE CHECK ME... - default: /* some collection of actions */ if (adt->action) rearrange_action_channels(&ac, adt->action, mode); @@ -2455,7 +2454,7 @@ static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_in * Only do this if "Only Selected" dopesheet filter is not active, or else it * becomes too unpredictable/tricky to manage */ - if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL)==0) { + if ((ac->ads->filterflag & ADS_FILTER_ONLYSEL) == 0) { if ((ale->id) && (GS(ale->id->name) == ID_OB)) { ob = (Object *)ale->id; diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 24065321f8b..7b03a15a011 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -2032,7 +2032,8 @@ static void adduplicateflagNurb(Object *obedit, ListBase *newnurb, MEM_freeN(usel); if ((newu == 0 || newv == 0) || - (split && !isNurbselU(nu, &newv, SELECT) && !isNurbselV(nu, &newu, SELECT))) { + (split && !isNurbselU(nu, &newv, SELECT) && !isNurbselV(nu, &newu, SELECT))) + { if (G.debug & G_DEBUG) printf("Can't duplicate Nurb\n"); } @@ -6076,7 +6077,8 @@ static int curve_delete_segments(Object *obedit, const bool split) bezt2 = &nu->bezt[1]; if (BEZSELECTED_HIDDENHANDLES(cu, bezt1) && - BEZSELECTED_HIDDENHANDLES(cu, bezt2)) { + BEZSELECTED_HIDDENHANDLES(cu, bezt2)) + { nu1 = BKE_nurb_copy(nu, 1, 1); ED_curve_beztcpy(editnurb, nu1->bezt, bezt1, 1); BLI_addtail(&newnurb, nu1); @@ -6086,7 +6088,8 @@ static int curve_delete_segments(Object *obedit, const bool split) bezt2 = &nu->bezt[nu->pntsu - 2]; if (BEZSELECTED_HIDDENHANDLES(cu, bezt1) && - BEZSELECTED_HIDDENHANDLES(cu, bezt2)) { + BEZSELECTED_HIDDENHANDLES(cu, bezt2)) + { nu1 = BKE_nurb_copy(nu, 1, 1); ED_curve_beztcpy(editnurb, nu1->bezt, bezt1, 1); BLI_addtail(&newnurb, nu1); diff --git a/source/blender/editors/space_clip/clip_graph_draw.c b/source/blender/editors/space_clip/clip_graph_draw.c index 9beb8edd914..80b844464db 100644 --- a/source/blender/editors/space_clip/clip_graph_draw.c +++ b/source/blender/editors/space_clip/clip_graph_draw.c @@ -186,7 +186,7 @@ static void draw_tracks_curves(View2D *v2d, SpaceClip *sc) /* selected knot handles on top of curves */ userdata.sel = TRUE; clip_graph_tracking_values_iterate(sc, - (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) !=0, + (sc->flag & SC_SHOW_GRAPH_SEL_ONLY) != 0, (sc->flag & SC_SHOW_GRAPH_HIDDEN) != 0, &userdata, tracking_segment_knot_cb, NULL, NULL); } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 172488f2c57..0227230fb68 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -415,9 +415,9 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) if (result != kCFURLEnumeratorSuccess) continue; - CFURLGetFileSystemRepresentation(cfURL, false, (UInt8*)defPath, FILE_MAX); + CFURLGetFileSystemRepresentation(cfURL, false, (UInt8 *)defPath, FILE_MAX); fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)defPath, FS_INSERT_SORTED); - } + } CFRelease(volEnum); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index a0659d5ce62..ee64d680319 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -475,14 +475,14 @@ static void text_drop_copy(wmDrag *drag, wmDropBox *drop) static int text_drop_paste_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { if (drag->type == WM_DRAG_ID) - return TRUE; + return true; - return FALSE; + return false; } static void text_drop_paste(wmDrag *drag, wmDropBox *drop) { - RNA_string_set(drop->ptr, "text", ((ID*)drag->poin)->name + 2); + RNA_string_set(drop->ptr, "text", ((ID *)drag->poin)->name + 2); } /* this region dropbox definition */ diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 65d6a1d0ec2..5bfb8180bfc 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6591,8 +6591,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short if (ob->restrictflag & OB_RESTRICT_VIEW) { return; } - else if ((ob->restrictflag & OB_RESTRICT_RENDER) && render_override) - { + else if ((ob->restrictflag & OB_RESTRICT_RENDER) && render_override) { return; } } diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp index 1ee4ee00500..fe74b8f7cce 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp +++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp @@ -99,13 +99,16 @@ static ImBuf *imb_oiio_load_image(ImageInput *in, int width, int height, int com try { if (!in->read_image(TypeDesc::UINT8, - (uchar *)ibuf->rect + (height - 1) * scanlinesize, - AutoStride, - -scanlinesize, - AutoStride)) { + (uchar *)ibuf->rect + (height - 1) * scanlinesize, + AutoStride, + -scanlinesize, + AutoStride)) + { std::cerr << __func__ << ": ImageInput::read_image() failed:" << std::endl - << in->geterror() << std::endl; - if (ibuf) IMB_freeImBuf(ibuf); + << in->geterror() << std::endl; + + if (ibuf) + IMB_freeImBuf(ibuf); return NULL; } @@ -135,13 +138,16 @@ static ImBuf *imb_oiio_load_image_float(ImageInput *in, int width, int height, i try { if (!in->read_image(TypeDesc::FLOAT, - (uchar *)ibuf->rect_float + (height - 1) * scanlinesize, - AutoStride, - -scanlinesize, - AutoStride)) { + (uchar *)ibuf->rect_float + (height - 1) * scanlinesize, + AutoStride, + -scanlinesize, + AutoStride)) + { std::cerr << __func__ << ": ImageInput::read_image() failed:" << std::endl - << in->geterror() << std::endl; - if (ibuf) IMB_freeImBuf(ibuf); + << in->geterror() << std::endl; + + if (ibuf) + IMB_freeImBuf(ibuf); return NULL; } @@ -205,7 +211,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac in = ImageInput::create(filename); if (!in) { std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl - << OpenImageIO::geterror() << std::endl; + << OpenImageIO::geterror() << std::endl; return NULL; } @@ -214,7 +220,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac if (!in->open(filename, spec, config)) { std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl - << in->geterror() << std::endl; + << in->geterror() << std::endl; delete in; return NULL; } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 06719514483..ed27228f107 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -139,7 +139,8 @@ void WM_keymap_properties_reset(wmKeyMapItem *kmi, struct IDProperty *properties wm_keymap_item_properties_set(kmi); } -int WM_keymap_map_type_get(wmKeyMapItem *kmi) { +int WM_keymap_map_type_get(wmKeyMapItem *kmi) +{ if (ISTIMER(kmi->type)) { return KMI_TYPE_TIMER; } |