diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-09 13:24:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-09 13:24:15 +0400 |
commit | d20c129a9cef276dd7d54c3cd03a6e4cfb024cfa (patch) | |
tree | bceac66f3b03f347900beec56c6efa2adc98beb9 /source/blender/editors | |
parent | c2863e3f9b2a394ac943a8e0e982de8667e20b7e (diff) |
style cleanup: whitespace/operators
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 20 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_scopes.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 18 |
9 files changed, 44 insertions, 45 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 50274587219..be10e3c4c3f 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -422,7 +422,7 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu) while (a--) { BLI_ghash_remove(editnurb->keyindex, bezt, NULL, (GHashValFreeFP)MEM_freeN); - ++bezt; + bezt++; } } else { @@ -431,7 +431,7 @@ static void keyIndex_delNurb(EditNurb *editnurb, Nurb *nu) while (a--) { BLI_ghash_remove(editnurb->keyindex, bp, NULL, (GHashValFreeFP)MEM_freeN); - ++bp; + bp++; } } } @@ -752,11 +752,11 @@ static void calc_keyHandles(ListBase *nurb, float *key) } } else { - ++nextp; + nextp++; nextfp += 12; } - ++bezt; + bezt++; fp += 12; } } @@ -849,7 +849,7 @@ static void calc_shapeKeys(Object *obedit) ofs[i + 1][0] = bp->alfa - oldbp->alfa; } i += 2; - ++bp; + bp++; } } @@ -894,7 +894,7 @@ static void calc_shapeKeys(Object *obedit) } fp += 3; ++i; /* alphas */ - ++bezt; + bezt++; } } else { @@ -913,7 +913,7 @@ static void calc_shapeKeys(Object *obedit) } fp += 4; - ++bp; + bp++; i += 2; } } @@ -947,7 +947,7 @@ static void calc_shapeKeys(Object *obedit) if (apply_offset) { /* apply alfa offsets */ add_v3_v3(fp, ofs[i]); - ++i; + i++; } fp += 3; /* alphas */ @@ -962,7 +962,7 @@ static void calc_shapeKeys(Object *obedit) fp += 3; /* alphas */ } - ++bezt; + bezt++; } } else { @@ -987,7 +987,7 @@ static void calc_shapeKeys(Object *obedit) } fp += 4; - ++bp; + bp++; i += 2; } } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index d062ea549cb..c97ad9c62f9 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1436,7 +1436,7 @@ static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *UNUSED( { RNA_enum_item_add(&item, &totitem, input); } - ++input; + input++; } RNA_enum_item_end(&item, &totitem); diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 0c94bff8803..28ac674f079 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -391,8 +391,8 @@ void fsmenu_read_system(struct FSMenu* fsmenu) itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(pathesArray, i); err = LSSharedFileListItemResolve(itemRef, - kLSSharedFileListNoUserInteraction - | kLSSharedFileListDoNotMountVolumes, + kLSSharedFileListNoUserInteraction | + kLSSharedFileListDoNotMountVolumes, &cfURL, NULL); if (err != noErr) continue; @@ -440,8 +440,8 @@ void fsmenu_read_system(struct FSMenu* fsmenu) itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(pathesArray, i); err = LSSharedFileListItemResolve(itemRef, - kLSSharedFileListNoUserInteraction - | kLSSharedFileListDoNotMountVolumes, + kLSSharedFileListNoUserInteraction | + kLSSharedFileListDoNotMountVolumes, &cfURL, NULL); if (err != noErr) continue; diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index 2f5dff961fe..5debeaf79ae 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -275,8 +275,8 @@ static ImBuf *make_sep_waveform_view_from_ibuf_byte(ImBuf *ibuf) unsigned char *rgb = src + 4 * (ibuf->x * y + x); for (c = 0; c < 3; c++) { unsigned char *p = tgt; - p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1) - + c * sw + x / 3 + 1); + p += 4 * (w * ((rgb[c] * (h - 3)) / 255 + 1) + + c * sw + x / 3 + 1); scope_put_pixel_single(wtable, p, c); p += 4 * w; @@ -327,8 +327,8 @@ static ImBuf *make_sep_waveform_view_from_ibuf_float(ImBuf *ibuf) CLAMP(v, 0.0f, 1.0f); - p += 4 * (w * ((int) (v * (h - 3)) + 1) - + c * sw + x / 3 + 1); + p += 4 * (w * ((int) (v * (h - 3)) + 1) + + c * sw + x / 3 + 1); scope_put_pixel_single(wtable, p, c); p += 4 * w; @@ -581,8 +581,8 @@ static void vectorscope_put_cross(unsigned char r, unsigned char g, rgb[2] = (float)b / 255.0f; rgb_to_yuv_normalized(rgb, yuv); - p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) - + (int) ((yuv[1] * (w - 3) + 1))); + p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + + (int) ((yuv[1] * (w - 3) + 1))); if (r == 0 && g == 0 && b == 0) { r = 255; @@ -632,8 +632,8 @@ static ImBuf *make_vectorscope_view_from_ibuf_byte(ImBuf *ibuf) rgb[2] = (float)src1[2] / 255.0f; rgb_to_yuv_normalized(rgb, yuv); - p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) - + (int) ((yuv[1] * (w - 3) + 1))); + p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + + (int) ((yuv[1] * (w - 3) + 1))); scope_put_pixel(wtable, (unsigned char *)p); } } @@ -682,8 +682,8 @@ static ImBuf *make_vectorscope_view_from_ibuf_float(ImBuf *ibuf) rgb_to_yuv_normalized(rgb, yuv); - p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) - + (int) ((yuv[1] * (w - 3) + 1))); + p = tgt + 4 * (w * (int) ((yuv[2] * (h - 3) + 1)) + + (int) ((yuv[1] * (w - 3) + 1))); scope_put_pixel(wtable, (unsigned char *)p); } } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 3116d94df87..04408173928 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1156,7 +1156,7 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op) } else { new_line[j] = text_check_line[a]; - ++j; + j++; } } new_line[j] = '\0'; @@ -1208,12 +1208,12 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op) if (!number) { //found all number of space to equal a tab new_line[extra] = '\t'; a = a + (st->tabnumber - 1); - ++extra; + extra++; } else { //not adding a tab new_line[extra] = text_check_line[a]; - ++extra; + extra++; } } new_line[extra] = '\0'; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 7d6edbaa7e4..4a42fe9f981 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5500,7 +5500,7 @@ static void draw_editnurb(Object *ob, Nurb *nurb, int sel) } } - ++index; + index++; nu = nu->next; } } @@ -5529,7 +5529,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, tekenhandlesN_active(nu); tekenhandlesN(nu, 0, hide_handles); } - ++index; + index++; } draw_editnurb(ob, nurb, 0); draw_editnurb(ob, nurb, 1); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index c4309980b18..a68caeb0719 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -431,9 +431,10 @@ static int object_mode_icon(int mode) EnumPropertyItem *item = object_mode_items; while (item->name != NULL) { - if (item->value == mode) + if (item->value == mode) { return item->icon; - ++item; + } + item++; } return ICON_OBJECT_DATAMODE; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index e1be274663a..95ae0ac971f 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -567,9 +567,9 @@ void ED_view3d_calc_clipping(BoundBox *bb, float planes[4][4], bglMats *mats, co if (flip_sign) negate_v3(planes[val]); - planes[val][3] = -planes[val][0] * bb->vec[val][0] - - planes[val][1] * bb->vec[val][1] - - planes[val][2] * bb->vec[val][2]; + planes[val][3] = -planes[val][0] * bb->vec[val][0] - + planes[val][1] * bb->vec[val][1] - + planes[val][2] * bb->vec[val][2]; } } diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 0f0d1cc8344..b25c76fe193 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -229,8 +229,9 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], double *angle = mi->data; /* use doubles here, to make sure a "1.0" (no rotation) doesnt become 9.999999e-01, which gives 0.02 for acos */ - double deler = ((dx1*dx1+dy1*dy1)+(dx2*dx2+dy2*dy2)-(dx3*dx3+dy3*dy3)) - / (2.0 * ((A*B)?(A*B):1.0)); + double deler = (((dx1 * dx1 + dy1 * dy1) + + (dx2 * dx2 + dy2 * dy2) - + (dx3 * dx3 + dy3 * dy3)) / (2.0 * ((A * B) ? (A * B) : 1.0))); /* ((A*B)?(A*B):1.0) this takes care of potential divide by zero errors */ float dphi; @@ -290,15 +291,12 @@ void initMouseInput(TransInfo *UNUSED(t), MouseInput *mi, int center[2], int mva static void calcSpringFactor(MouseInput *mi) { - mi->factor = (float)sqrt( - ( - ((float)(mi->center[1] - mi->imval[1]))*((float)(mi->center[1] - mi->imval[1])) - + - ((float)(mi->center[0] - mi->imval[0]))*((float)(mi->center[0] - mi->imval[0])) - ) ); - - if (mi->factor==0.0f) + mi->factor = sqrtf(((float)(mi->center[1] - mi->imval[1])) * ((float)(mi->center[1] - mi->imval[1])) + + ((float)(mi->center[0] - mi->imval[0])) * ((float)(mi->center[0] - mi->imval[0]))); + + if (mi->factor == 0.0f) { mi->factor= 1.0f; /* prevent Inf */ + } } void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode) |