Code Cleanup: style and redundant casts
authorCampbell Barton <ideasman42@gmail.com>
Thu, 16 Jan 2014 08:15:53 +0000 (19:15 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 16 Jan 2014 08:15:53 +0000 (19:15 +1100)
37 files changed:
source/blender/blenkernel/intern/suggestions.c
source/blender/blenlib/intern/scanfill.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/string.c
source/blender/blenlib/intern/winstuff_dir.c
source/blender/bmesh/operators/bmo_smooth_laplacian.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/compositor/intern/COM_Node.cpp
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/armature_naming.c
source/blender/editors/armature/pose_lib.c
source/blender/editors/interface/view2d.c
source/blender/editors/object/object_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_intern.h
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform_constraints.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/windowmanager/intern/wm_cursors.c
source/blender/windowmanager/intern/wm_dragdrop.c
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c

index 6f9736d..d46fa59 100644 (file)
@@ -52,7 +52,7 @@ static int txttl_cmp(const char *first, const char *second, int len)
 {
        int cmp, i;
        for (cmp = 0, i = 0; i < len; i++) {
-               if ( (cmp = toupper(first[i]) - toupper(second[i])) ) {
+               if ((cmp = toupper(first[i]) - toupper(second[i]))) {
                        break;
                }
        }
index c4cefad..d1eb725 100644 (file)
@@ -699,7 +699,7 @@ static unsigned int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int fl
 
                                                ed3 = sc1->edge_first;
                                                while (ed3) {
-                                                       if ( (ed3->v1 == v1 && ed3->v2 == v3) || (ed3->v1 == v3 && ed3->v2 == v1) ) {
+                                                       if ((ed3->v1 == v1 && ed3->v2 == v3) || (ed3->v1 == v3 && ed3->v2 == v1)) {
                                                                if (twoconnected || ed3->f == SF_EDGE_BOUNDARY) {
                                                                        BLI_remlink((ListBase *)&(sc1->edge_first), ed3);
                                                                        BLI_addtail(&sf_ctx->filledgebase, ed3);
index 6f03529..de40cab 100644 (file)
@@ -486,7 +486,7 @@ int BLI_exists(const char *name)
        unsigned int old_error_mode;
 
        len = wcslen(tmp_16);
-       if (len > 3 && (tmp_16[len - 1] == L'\\' || tmp_16[len - 1] == L'/') )
+       if (len > 3 && (tmp_16[len - 1] == L'\\' || tmp_16[len - 1] == L'/'))
                tmp_16[len - 1] = '\0';
 
        /* change error mode so user does not get a "no disk in drive" popup
index 0ce40f7..6b738fa 100644 (file)
@@ -513,17 +513,17 @@ int BLI_natstrcmp(const char *s1, const char *s2)
                c1 = tolower(s1[d1]);
                c2 = tolower(s2[d2]);
                
-               if (isdigit(c1) && isdigit(c2) ) {
+               if (isdigit(c1) && isdigit(c2)) {
                        int numcompare = left_number_strcmp(s1 + d1, s2 + d2, &tiebreaker);
                        
                        if (numcompare != 0)
                                return numcompare;
 
                        d1++;
-                       while (isdigit(s1[d1]) )
+                       while (isdigit(s1[d1]))
                                d1++;
                        d2++;
-                       while (isdigit(s2[d2]) )
+                       while (isdigit(s2[d2]))
                                d2++;
                        
                        c1 = tolower(s1[d1]);
index 4082681..90250de 100644 (file)
  * Windows-posix compatibility layer for opendir/readdir/closedir
  */
 
-/** \file blender/blenlib/intern/winstuff.c
+/** \file blender/blenlib/intern/winstuff_dir.c
  *  \ingroup bli
+ *
+ * Posix compatibility functions for windows dealing with DIR
+ * (opendir, readdir, closedir)
  */
 
 #if defined(WIN32) && !defined(FREE_WINDOWS)
 
+/* standalone for inclusion in binaries other then blender */
 #  ifdef USE_STANDALONE
 #    define MEM_mallocN(size, str) ((void)str, malloc(size))
 #    define MEM_callocN(size, str) ((void)str, calloc(size, 1))
index 16e70e8..c36c746 100644 (file)
@@ -362,7 +362,7 @@ static void fill_laplacian_matrix(LaplacianSystem *sys)
                }
        }
        BM_ITER_MESH (e, &eiter, sys->bm, BM_EDGES_OF_MESH) {
-               if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e) ) {
+               if (!BM_elem_flag_test(e, BM_ELEM_SELECT) && BM_edge_is_boundary(e)) {
                        v1 = e->v1->co;
                        v2 =  e->v2->co;
                        idv1 = BM_elem_index_get(e->v1);
index 836588c..d07d833 100644 (file)
@@ -2522,7 +2522,7 @@ static bool tri_corner_test(BevelParams *bp, BevVert *bv)
                totang += ang;
        }
        angdiff = fabsf(totang - 3.0f * (float)M_PI_2);
-       if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI/16.0f) ||
+       if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI / 16.0f) ||
            (angdiff > (float)M_PI_4))
        {
                return false;
index f59580a..b62e2d0 100644 (file)
@@ -39,7 +39,7 @@
 //#include <stdio.h>
 #include "COM_defines.h"
 
-Node::Node(bNode *editorNode, bool create_sockets): NodeBase()
+Node::Node(bNode *editorNode, bool create_sockets) : NodeBase()
 {
        setbNode(editorNode);
        
index 6566906..6010a64 100644 (file)
@@ -121,7 +121,7 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, FCurve *fcu, KeyframeEdi
                                }
                                
                                /* Only operate on this BezTriple if it fullfills the criteria of the validation func */
-                               if ( (ok = key_ok(ked, bezt)) ) {
+                               if ((ok = key_ok(ked, bezt))) {
                                        if (ked) ked->curflags = ok;
                                        
                                        /* Exit with return-code '1' if function returns positive
index 1b77c15..2fd30ed 100644 (file)
@@ -1984,7 +1984,7 @@ static short object_frame_has_keyframe(Object *ob, float frame, short filter)
        }
        
        /* try shapekey keyframes (if available, and allowed by filter) */
-       if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOSKEY) ) {
+       if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOSKEY)) {
                Key *key = BKE_key_from_object(ob);
                
                /* shapekeys can have keyframes ('Relative Shape Keys') 
@@ -2000,7 +2000,7 @@ static short object_frame_has_keyframe(Object *ob, float frame, short filter)
        }
 
        /* try materials */
-       if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOMAT) ) {
+       if (!(filter & ANIMFILTER_KEYS_LOCAL) && !(filter & ANIMFILTER_KEYS_NOMAT)) {
                /* if only active, then we can skip a lot of looping */
                if (filter & ANIMFILTER_KEYS_ACTIVE) {
                        Material *ma = give_current_material(ob, (ob->actcol + 1));
index a4b40f6..c214dc3 100644 (file)
@@ -113,8 +113,9 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *
                        
                        for (ct = targets.first; ct; ct = ct->next) {
                                if (ct->tar == ob) {
-                                       if (!strcmp(ct->subtarget, oldname) )
+                                       if (STREQ(ct->subtarget, oldname)) {
                                                BLI_strncpy(ct->subtarget, newname, MAXBONENAME);
+                                       }
                                }
                        }
                        
index 3a9dd3c..7a825b3 100644 (file)
@@ -920,7 +920,7 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, tPoseLib_PreviewData
                pchan = BKE_pose_channel_find_name(pose, agrp->name);
                
                if (pchan) {
-                       if ( (pld->selcount == 0) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) ) {
+                       if ((pld->selcount == 0) || ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED))) {
                                if (autokey) {
                                        /* add datasource override for the PoseChannel, to be used later */
                                        ANIM_relative_keyingset_add_source(&dsources, &pld->ob->id, &RNA_PoseBone, pchan); 
index 06f13c3..544d9a0 100644 (file)
@@ -823,17 +823,17 @@ void UI_view2d_curRect_reset(View2D *v2d)
        /* handle width - posx and negx flags are mutually exclusive, so watch out */
        if ((v2d->align & V2D_ALIGN_NO_POS_X) && !(v2d->align & V2D_ALIGN_NO_NEG_X)) {
                /* width is in negative-x half */
-               v2d->cur.xmin = (float)-width;
+               v2d->cur.xmin = -width;
                v2d->cur.xmax = 0.0f;
        }
        else if ((v2d->align & V2D_ALIGN_NO_NEG_X) && !(v2d->align & V2D_ALIGN_NO_POS_X)) {
                /* width is in positive-x half */
                v2d->cur.xmin = 0.0f;
-               v2d->cur.xmax = (float)width;
+               v2d->cur.xmax = width;
        }
        else {
                /* width is centered around (x == 0) */
-               const float dx = (float)width / 2.0f;
+               const float dx = width / 2.0f;
                
                v2d->cur.xmin = -dx;
                v2d->cur.xmax = dx;
@@ -842,17 +842,17 @@ void UI_view2d_curRect_reset(View2D *v2d)
        /* handle height - posx and negx flags are mutually exclusive, so watch out */
        if ((v2d->align & V2D_ALIGN_NO_POS_Y) && !(v2d->align & V2D_ALIGN_NO_NEG_Y)) {
                /* height is in negative-y half */
-               v2d->cur.ymin = (float)-height;
+               v2d->cur.ymin = -height;
                v2d->cur.ymax = 0.0f;
        }
        else if ((v2d->align & V2D_ALIGN_NO_NEG_Y) && !(v2d->align & V2D_ALIGN_NO_POS_Y)) {
                /* height is in positive-y half */
                v2d->cur.ymin = 0.0f;
-               v2d->cur.ymax = (float)height;
+               v2d->cur.ymax = height;
        }
        else {
                /* height is centered around (y == 0) */
-               const float dy = (float)height / 2.0f;
+               const float dy = height / 2.0f;
                
                v2d->cur.ymin = -dy;
                v2d->cur.ymax = dy;
index b80d4de..5488545 100644 (file)
@@ -455,7 +455,7 @@ void ED_object_editmode_enter(bContext *C, int flag)
        ob = base->object;
 
        /* this checks actual object->data, for cases when other scenes have it in editmode context */
-       if ( BKE_object_is_in_editmode(ob) )
+       if (BKE_object_is_in_editmode(ob))
                return;
        
        if (BKE_object_obdata_is_libdata(ob)) {
index af9eebe..eba8028 100644 (file)
@@ -165,7 +165,7 @@ int ED_operator_objectmode(bContext *C)
 
        if (scene == NULL || scene->id.lib)
                return 0;
-       if (CTX_data_edit_object(C) )
+       if (CTX_data_edit_object(C))
                return 0;
        
        /* add a check for ob->mode too? */
index 1809c6c..77cea89 100644 (file)
@@ -139,7 +139,7 @@ static void file_panel_system_bookmarks(const bContext *C, Panel *pa)
 {
        SpaceFile *sfile = CTX_wm_space_file(C);
 
-       if (sfile && !(U.uiflag & USER_HIDE_SYSTEM_BOOKMARKS) ) {
+       if (sfile && !(U.uiflag & USER_HIDE_SYSTEM_BOOKMARKS)) {
                file_panel_category(C, pa, FS_CATEGORY_SYSTEM_BOOKMARKS, &sfile->systemnr, ICON_BOOKMARKS, 0);
        }
 
@@ -165,7 +165,7 @@ static void file_panel_recent(const bContext *C, Panel *pa)
        uiLayout *row;
 
        if (sfile) {
-               if (!(U.uiflag & USER_HIDE_RECENT) ) {
+               if (!(U.uiflag & USER_HIDE_RECENT)) {
                        row = uiLayoutRow(pa->layout, FALSE);
                        uiItemO(row, IFACE_("Reset"), ICON_X, "file.reset_recent");
                        uiItemL(row, NULL, ICON_NONE);
index 8729604..748a0bd 100644 (file)
@@ -304,18 +304,18 @@ static int is_hidden_file(const char *filename, short hide_dot)
                if (filename[0] == '.' && filename[1] != '.' && filename[1] != 0) {
                        is_hidden = 1; /* ignore .file */
                }
-               else if (((filename[0] == '.') && (filename[1] == 0) )) {
+               else if (((filename[0] == '.') && (filename[1] == 0))) {
                        is_hidden = 1; /* ignore . */
                }
                else {
                        int len = strlen(filename);
-                       if ( (len > 0) && (filename[len - 1] == '~') ) {
+                       if ((len > 0) && (filename[len - 1] == '~')) {
                                is_hidden = 1;  /* ignore file~ */
                        }
                }
        }
        else {
-               if (((filename[0] == '.') && (filename[1] == 0) )) {
+               if (((filename[0] == '.') && (filename[1] == 0))) {
                        is_hidden = 1; /* ignore . */
                }
        }
@@ -370,7 +370,7 @@ void filelist_filter(FileList *filelist)
        /* How many files are left after filter ? */
        for (i = 0; i < filelist->numfiles; ++i) {
                struct direntry *file = &filelist->filelist[i];
-               if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) {
+               if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot)) {
                        num_filtered++;
                }
        }
@@ -384,7 +384,7 @@ void filelist_filter(FileList *filelist)
 
        for (i = 0, j = 0; i < filelist->numfiles; ++i) {
                struct direntry *file = &filelist->filelist[i];
-               if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot) ) {
+               if (filelist->filterf(file, filelist->dir, filelist->filter, filelist->hide_dot)) {
                        filelist->fidx[j++] = i;
                }
        }
@@ -629,7 +629,7 @@ ImBuf *filelist_getimage(struct FileList *filelist, int index)
 
        BLI_assert(G.background == FALSE);
 
-       if ( (index < 0) || (index >= filelist->numfiltered) ) {
+       if ((index < 0) || (index >= filelist->numfiltered)) {
                return NULL;
        }
        fidx = filelist->fidx[index];
@@ -646,7 +646,7 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index)
 
        BLI_assert(G.background == FALSE);
 
-       if ( (index < 0) || (index >= filelist->numfiltered) ) {
+       if ((index < 0) || (index >= filelist->numfiltered)) {
                return NULL;
        }
        fidx = filelist->fidx[index];
@@ -669,7 +669,7 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index)
        if (file->flags & BLENDERFILE) {
                ibuf = gSpecialFileImages[SPECIAL_IMG_BLENDFILE];
        }
-       else if ( (file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON) ) {
+       else if ((file->flags & MOVIEFILE) || (file->flags & MOVIEFILE_ICON)) {
                ibuf = gSpecialFileImages[SPECIAL_IMG_MOVIEFILE];
        }
        else if (file->flags & SOUNDFILE) {
@@ -698,7 +698,7 @@ struct direntry *filelist_file(struct FileList *filelist, int index)
 {
        int fidx = 0;
        
-       if ( (index < 0) || (index >= filelist->numfiltered) ) {
+       if ((index < 0) || (index >= filelist->numfiltered)) {
                return NULL;
        }
        fidx = filelist->fidx[index];
@@ -994,7 +994,7 @@ void filelist_select_file(struct FileList *filelist, int index, FileSelType sele
 void filelist_select(struct FileList *filelist, FileSelection *sel, FileSelType select, unsigned int flag, FileCheckType check)
 {
        /* select all valid files between first and last indicated */
-       if ( (sel->first >= 0) && (sel->first < filelist->numfiltered) && (sel->last >= 0) && (sel->last < filelist->numfiltered) ) {
+       if ((sel->first >= 0) && (sel->first < filelist->numfiltered) && (sel->last >= 0) && (sel->last < filelist->numfiltered)) {
                int current_file;
                for (current_file = sel->first; current_file <= sel->last; current_file++) {
                        filelist_select_file(filelist, current_file, select, flag, check);
@@ -1332,7 +1332,7 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float
        tj->stop = stop;
        tj->do_update = do_update;
 
-       while ( (*stop == 0) && (limg) ) {
+       while ((*stop == 0) && (limg)) {
                if (limg->flags & IMAGEFILE) {
                        limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE);
                }
@@ -1393,7 +1393,7 @@ void thumbnails_start(FileList *filelist, const bContext *C)
        tj->filelist = filelist;
        for (idx = 0; idx < filelist->numfiles; idx++) {
                if (!filelist->filelist[idx].image) {
-                       if ( (filelist->filelist[idx].flags & (IMAGEFILE | MOVIEFILE | BLENDERFILE | BLENDERFILE_BACKUP)) ) {
+                       if ((filelist->filelist[idx].flags & (IMAGEFILE | MOVIEFILE | BLENDERFILE | BLENDERFILE_BACKUP))) {
                                FileImage *limg = MEM_callocN(sizeof(FileImage), "loadimage");
                                BLI_strncpy(limg->path, filelist->filelist[idx].path, FILE_MAX);
                                limg->index = idx;
index e7c9843..8b98f7c 100644 (file)
@@ -237,7 +237,7 @@ static void draw_fcurve_vertices_handles(FCurve *fcu, SpaceIpo *sipo, View2D *v2
                 * Also, need to take into account whether the keyframe was selected
                 * if a Graph Editor option to only show handles of selected keys is on.
                 */
-               if (!sel_handle_only || BEZSELECTED(bezt) ) {
+               if (!sel_handle_only || BEZSELECTED(bezt)) {
                        if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) {
                                if ((bezt->f1 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/
                                        draw_fcurve_handle_control(bezt->vec[0][0], bezt->vec[0][1], xscale, yscale, hsize);
index 10f4e01..2f877e5 100644 (file)
@@ -1292,7 +1292,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
                        }
                }
                else {
-                       if (tree_element_type_active(NULL, scene, soops, te, tselem, 0, false) ) active = 2;
+                       if (tree_element_type_active(NULL, scene, soops, te, tselem, 0, false)) active = 2;
                        glColor4ub(220, 220, 255, alpha);
                }
                
index 3f0ad45..8afd560 100644 (file)
@@ -307,7 +307,7 @@ void OUTLINER_OT_item_rename(wmOperatorType *ot)
 
 /* Apply Settings ------------------------------- */
 
-static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
+static int outliner_count_levels(SpaceOops *soops, ListBase *lb, const int curlevel)
 {
        TreeElement *te;
        int level = curlevel, lev;
@@ -320,7 +320,7 @@ static int outliner_count_levels(SpaceOops *soops, ListBase *lb, int curlevel)
        return level;
 }
 
-int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, short curlevel)
+int outliner_has_one_flag(SpaceOops *soops, ListBase *lb, short flag, const int curlevel)
 {
        TreeElement *te;
        TreeStoreElem *tselem;
index 5aaf8b5..015d8d6 100644 (file)
@@ -177,7 +177,7 @@ void outliner_do_object_operation(struct bContext *C, struct Scene *scene, struc
 
 int common_restrict_check(struct bContext *C, struct Object *ob);
 
-int outliner_has_one_flag(struct SpaceOops *soops, ListBase *lb, short flag, short curlevel);
+bool outliner_has_one_flag(struct SpaceOops *soops, ListBase *lb, short flag, const int curlevel);
 void outliner_set_flag(struct SpaceOops *soops, ListBase *lb, short flag, short set);
 
 void object_toggle_visibility_cb(struct bContext *C, struct Scene *scene, TreeElement *te, struct TreeStoreElem *tsep, struct TreeStoreElem *tselem);
index a0af934..cdc7178 100644 (file)
@@ -1278,7 +1278,7 @@ static int do_outliner_operation_event(bContext *C, Scene *scene, ARegion *ar, S
                /* select object that's clicked on and popup context menu */
                if (!(tselem->flag & TSE_SELECTED)) {
                        
-                       if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1) )
+                       if (outliner_has_one_flag(soops, &soops->tree, TSE_SELECTED, 1))
                                outliner_set_flag(soops, &soops->tree, TSE_SELECTED, 0);
                        
                        tselem->flag |= TSE_SELECTED;
index 2952bdb..3253d34 100644 (file)
@@ -293,7 +293,7 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se
        for (seq = ed->seqbasep->first; seq; seq = seq->next) {
                if ((seq != test) &&
                    (test->machine == seq->machine) &&
-                   ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel == 0 && (seq->flag & SELECT) == 0)  ))
+                   ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel == 0 && (seq->flag & SELECT) == 0)))
                {
                        switch (lr) {
                                case SEQ_SIDE_LEFT:
index 7d51e0e..71a0c86 100644 (file)
@@ -1271,7 +1271,7 @@ static void drawlamp(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
 
                /* draw clip start, useful for wide cones where its not obvious where the start is */
                glTranslatef(0.0, 0.0, -x);  /* reverse translation above */
-               if (la->type == LA_SPOT && (la->mode & LA_SHAD_BUF) ) {
+               if (la->type == LA_SPOT && (la->mode & LA_SHAD_BUF)) {
                        float lvec_clip[3];
                        float vvec_clip[3];
                        float clipsta_fac = la->clipsta / -x;
index d43cfa9..2325280 100644 (file)
@@ -1295,7 +1295,8 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
                return;
        }
 
-       if (!(v3d->flag & V3D_INVALID_BACKBUF) ) return;
+       if (!(v3d->flag & V3D_INVALID_BACKBUF))
+               return;
 
 #if 0
        if (test) {
@@ -3326,8 +3327,9 @@ static void view3d_main_area_draw_objects(const bContext *C, ARegion *ar, const
        /* draw selected and editmode */
        for (base = scene->base.first; base; base = base->next) {
                if (v3d->lay & base->lay) {
-                       if (base->object == scene->obedit || (base->flag & SELECT) )
+                       if (base->object == scene->obedit || (base->flag & SELECT)) {
                                draw_object(scene, ar, v3d, base, 0);
+                       }
                }
        }
 
index 842f1f2..f95883f 100644 (file)
@@ -295,19 +295,19 @@ static void view3d_boxview_sync(ScrArea *sa, ARegion *ar)
                        if (rv3dtest->viewlock) {
                                rv3dtest->dist = rv3d->dist;
 
-                               if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM) ) {
+                               if (ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM)) {
                                        if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
                                                rv3dtest->ofs[0] = rv3d->ofs[0];
                                        else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
                                                rv3dtest->ofs[1] = rv3d->ofs[1];
                                }
-                               else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK) ) {
+                               else if (ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK)) {
                                        if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
                                                rv3dtest->ofs[0] = rv3d->ofs[0];
                                        else if (ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
                                                rv3dtest->ofs[2] = rv3d->ofs[2];
                                }
-                               else if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT) ) {
+                               else if (ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT)) {
                                        if (ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
                                                rv3dtest->ofs[1] = rv3d->ofs[1];
                                        if (ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
index 894145c..24f5163 100644 (file)
@@ -925,7 +925,7 @@ void postSelectConstraint(TransInfo *t)
 static void setNearestAxis2d(TransInfo *t)
 {
        /* no correction needed... just use whichever one is lower */
-       if (abs(t->mval[0] - t->con.imval[0]) < abs(t->mval[1] - t->con.imval[1]) ) {
+       if (abs(t->mval[0] - t->con.imval[0]) < abs(t->mval[1] - t->con.imval[1])) {
                t->con.mode |= CON_AXIS1;
                BLI_strncpy(t->con.text, IFACE_(" along Y axis"), sizeof(t->con.text));
        }
index 0ff94fb..85a2da1 100644 (file)
@@ -497,7 +497,7 @@ static void recalcData_nla(TransInfo *t)
                        pExceeded = ((strip->prev) && (strip->prev->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h1[0] < strip->prev->end));
                        nExceeded = ((strip->next) && (strip->next->type != NLASTRIP_TYPE_TRANSITION) && (tdn->h2[0] > strip->next->start));
                        
-                       if ((pExceeded && nExceeded) || (iter == 4) ) {
+                       if ((pExceeded && nExceeded) || (iter == 4)) {
                                /* both endpoints exceeded (or iteration ping-pong'd meaning that we need a compromise)
                                 *      - simply crop strip to fit within the bounds of the strips bounding it
                                 *      - if there were no neighbors, clear the transforms (make it default to the strip's current values)
index 529a815..b5bcd81 100644 (file)
@@ -2856,7 +2856,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op)
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset);
 
-                               if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION) ) {
+                               if (!pinned || (ts->uv_flag & UV_SYNC_SELECTION)) {
 
                                        /* UV_SYNC_SELECTION - can't do pinned selection */
                                        if (BLI_rctf_isect_pt_v(&rectf, luv->uv)) {
index 4c3bdd0..d82fe46 100644 (file)
@@ -2469,7 +2469,7 @@ static void rna_def_object(BlenderRNA *brna)
        RNA_def_property_flag(prop, PROP_NEVER_NULL);
        RNA_def_property_pointer_sdna(prop, NULL, "iuser");
        RNA_def_property_ui_text(prop, "Image User",
-                                                        "Parameters defining which layer, pass and frame of the image is displayed");
+                                "Parameters defining which layer, pass and frame of the image is displayed");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
 
        /* render */
index a73a7f4..d8fc879 100644 (file)
@@ -291,7 +291,7 @@ static void rna_Sequence_channel_set(PointerRNA *ptr, int value)
 
        seq->machine = value;
        
-       if (BKE_sequence_test_overlap(seqbase, seq) ) {
+       if (BKE_sequence_test_overlap(seqbase, seq)) {
                BKE_sequence_base_shuffle(seqbase, seq, scene);  /* XXX - BROKEN!, uses context seqbasep */
        }
        BKE_sequencer_sort(scene);
index 1d5dc29..50788f4 100644 (file)
@@ -140,7 +140,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
         *      - must have verts and therefore verts assigned to vgroups to do anything useful
         */
        if (!(ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP)) ||
-           (maxVerts == 0) || (ob->defbase.first == NULL) )
+           (maxVerts == 0) || (ob->defbase.first == NULL))
        {
                return dm;
        }
@@ -297,7 +297,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        /* vertices */
        for (hashIter = BLI_ghashIterator_new(vertHash);
             BLI_ghashIterator_done(hashIter) == false;
-            BLI_ghashIterator_step(hashIter) )
+            BLI_ghashIterator_step(hashIter))
        {
                MVert source;
                MVert *dest;
@@ -336,7 +336,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        /* faces */
        for (hashIter = BLI_ghashIterator_new(polyHash);
             BLI_ghashIterator_done(hashIter) == false;
-            BLI_ghashIterator_step(hashIter) )
+            BLI_ghashIterator_step(hashIter))
        {
                int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
                int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
index 39a9f74..31aefe4 100644 (file)
@@ -377,7 +377,7 @@ int ntreeCompositTagAnimated(bNodeTree *ntree)
                }
                /* here was tag render layer, but this is called after a render, so re-composites fail */
                else if (node->type == NODE_GROUP) {
-                       if (ntreeCompositTagAnimated((bNodeTree *)node->id) ) {
+                       if (ntreeCompositTagAnimated((bNodeTree *)node->id)) {
                                nodeUpdate(ntree, node);
                        }
                }
index e6fc2cf..09a8383 100644 (file)
@@ -146,7 +146,7 @@ void WM_cursor_set(wmWindow *win, int curs)
                if (curs == SYSCURSOR) {  /* System default Cursor */
                        GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
                }
-               else if ( (U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL) ) {
+               else if ((U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL)) {
                        window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
                }
                else {
index dad8e7b..12e23c3 100644 (file)
@@ -227,7 +227,7 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
        drag->opname[0] = 0;
        
        /* check buttons (XXX todo rna and value) */
-       if (UI_but_active_drop_name(C) ) {
+       if (UI_but_active_drop_name(C)) {
                BLI_strncpy(drag->opname, IFACE_("Paste name"), sizeof(drag->opname));
        }
        else {
index e4dfae2..f8488b6 100644 (file)
@@ -3040,7 +3040,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
                        
                        /* double click test */
                        if (wm_event_is_double_click(&event, evt)) {
-                               if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+                               if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
                                        printf("%s Send double click\n", __func__);
                                event.val = KM_DBL_CLICK;
                        }
@@ -3147,7 +3147,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
                        /* double click test */
                        /* if previous event was same type, and previous was release, and now it presses... */
                        if (wm_event_is_double_click(&event, evt)) {
-                               if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+                               if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
                                        printf("%s Send double click\n", __func__);
                                evt->val = event.val = KM_DBL_CLICK;
                        }
@@ -3216,7 +3216,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
                        attach_ndof_data(&event, customdata);
                        wm_event_add(win, &event);
 
-                       if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+                       if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
                                printf("%s sending NDOF_MOTION, prev = %d %d\n", __func__, event.x, event.y);
 
                        break;
index 9943747..fc36290 100644 (file)
@@ -2897,8 +2897,9 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
                return 0;
        
        /* XXX weak; border should be configured for this without reading event types */
-       if (RNA_struct_find_property(op->ptr, "gesture_mode") )
+       if (RNA_struct_find_property(op->ptr, "gesture_mode")) {
                RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
+       }
 
        retval = op->type->exec(C, op);
        OPERATOR_RETVAL_CHECK(retval);
@@ -2915,8 +2916,9 @@ static void wm_gesture_end(bContext *C, wmOperator *op)
 
        ED_area_tag_redraw(CTX_wm_area(C));
        
-       if (RNA_struct_find_property(op->ptr, "cursor") )
+       if (RNA_struct_find_property(op->ptr, "cursor")) {
                WM_cursor_modal_restore(CTX_wm_window(C));
+       }
 }
 
 int WM_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@@ -3194,8 +3196,9 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
        if (win->tweak == NULL) {
                if (CTX_wm_region(C)) {
                        if (event->val == KM_PRESS) {
-                               if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) )
+                               if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) {
                                        win->tweak = WM_gesture_new(C, event, WM_GESTURE_TWEAK);
+                               }
                        }
                }
        }
@@ -3220,8 +3223,9 @@ int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        
        wm_gesture_tag_redraw(C);
        
-       if (RNA_struct_find_property(op->ptr, "cursor") )
+       if (RNA_struct_find_property(op->ptr, "cursor")) {
                WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
+       }
        
        return OPERATOR_RUNNING_MODAL;
 }
@@ -3235,8 +3239,9 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        
        wm_gesture_tag_redraw(C);
        
-       if (RNA_struct_find_property(op->ptr, "cursor") )
+       if (RNA_struct_find_property(op->ptr, "cursor")) {
                WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
+       }
        
        return OPERATOR_RUNNING_MODAL;
 }
@@ -3448,8 +3453,9 @@ int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *e
        
        wm_gesture_tag_redraw(C);
        
-       if (RNA_struct_find_property(op->ptr, "cursor") )
+       if (RNA_struct_find_property(op->ptr, "cursor")) {
                WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
+       }
                
        return OPERATOR_RUNNING_MODAL;
 }