style cleanup: changes from recent commits
authorCampbell Barton <ideasman42@gmail.com>
Thu, 13 Dec 2012 01:00:21 +0000 (01:00 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 13 Dec 2012 01:00:21 +0000 (01:00 +0000)
12 files changed:
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/blender.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/view2d.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/nodes/shader/nodes/node_shader_material.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_window.c

index 89f2291..4058809 100644 (file)
@@ -1480,7 +1480,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
 
                                /* blender internal needs this to be set to dupligroup to render
                                 * groups correctly, but we don't want this hack for cycles */
-                               if(dupli_type_hack && GS(id->name) == ID_GR)
+                               if (dupli_type_hack && GS(id->name) == ID_GR)
                                        dupli_type = OB_DUPLIGROUP;
 
                                /* to give ipos in object correct offset */
index 7ee3bdd..6e2cfc4 100644 (file)
@@ -895,7 +895,7 @@ int BKE_copybuffer_save(char *filename, ReportList *reports)
                ID *id, *nextid;
                ListBase *lb1 = lbarray[a], *lb2 = fromarray[a];
                
-               for (id = lb2->first; id; id= nextid) {
+               for (id = lb2->first; id; id = nextid) {
                        nextid = id->next;
                        if (id->flag & LIB_DOIT) {
                                BLI_remlink(lb2, id);
index e93ecc7..b976bca 100644 (file)
@@ -1495,7 +1495,7 @@ static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCre
        h = UI_UNIT_Y;
 
        if (layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */
-               w -= UI_UNIT_Y/2;
+               w -= UI_UNIT_Y / 2;
 
        if (name[0] && icon)
                but = uiDefIconTextMenuBut(block, func, arg, icon, name, 0, 0, w, h, tip);
index 0e3c323..ae14471 100644 (file)
@@ -186,7 +186,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem)
                uiDefBut(block, LABEL, 0, "", 10, 15, w, h, NULL, 0, 0, 0, 0, NULL);
                
                but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 0, w, UI_UNIT_Y,
-                                                        template.prv_rows, template.prv_cols, "");
+                                    template.prv_rows, template.prv_cols, "");
                uiButSetSearchFunc(but, id_search_cb, &template, id_search_call_cb, idptr.data);
        }
        /* list view */
@@ -1590,7 +1590,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
        hist->height = (hist->height <= UI_UNIT_Y) ? UI_UNIT_Y : hist->height;
 
        bt = uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * hist->height,
-                                 hist, 0, 0, 0, 0, "");
+                     hist, 0, 0, 0, 0, "");
 
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
 
@@ -1629,7 +1629,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
        scopes->wavefrm_height = (scopes->wavefrm_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->wavefrm_height;
 
        bt = uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * scopes->wavefrm_height,
-                                 scopes, 0, 0, 0, 0, "");
+                     scopes, 0, 0, 0, 0, "");
        (void)bt;  /* UNUSED */
        
        MEM_freeN(cb);
@@ -1667,7 +1667,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
        scopes->vecscope_height = (scopes->vecscope_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->vecscope_height;
        
        bt = uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
-                                 UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
+                     UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
        uiButSetNFunc(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
        
        MEM_freeN(cb);
index 356b5a6..e2a20e5 100644 (file)
@@ -1649,7 +1649,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
                        /* clean rect behind slider, but not with transparent background */
                        UI_GetThemeColor4ubv(TH_BACK, col);
                        if (col[3] == 255) {
-                               glColor3ub(col[0], col[1],col[2]);
+                               glColor3ub(col[0], col[1], col[2]);
                                glRecti(v2d->hor.xmin, v2d->hor.ymin, v2d->hor.xmax, v2d->hor.ymax);
                        }
                        
@@ -1765,7 +1765,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
                        /* clean rect behind slider, but not with transparent background */
                        UI_GetThemeColor4ubv(TH_BACK, col);
                        if (col[3] == 255) {
-                               glColor3ub(col[0], col[1],col[2]);
+                               glColor3ub(col[0], col[1], col[2]);
                                glRecti(v2d->vert.xmin, v2d->vert.ymin, v2d->vert.xmax, v2d->vert.ymax);
                        }
                        
index 9a91e9d..bf44e6b 100644 (file)
@@ -263,7 +263,7 @@ int scredge_is_horizontal(ScrEdge *se)
 ScrEdge *screen_find_active_scredge(bScreen *sc, int mx, int my)
 {
        ScrEdge *se;
-       int safety = U.widget_unit/10;
+       int safety = U.widget_unit / 10;
        
        if (safety < 2) safety = 2;
        
index 5a99fc7..6ca3c93 100644 (file)
@@ -3600,13 +3600,14 @@ typedef struct RegionAlphaInfo {
 float ED_region_blend_factor(ARegion *ar)
 {
        /* check parent too */
-       if(ar->regiontimer == NULL && (ar->alignment & RGN_SPLIT_PREV) && ar->prev)
+       if (ar->regiontimer == NULL && (ar->alignment & RGN_SPLIT_PREV) && ar->prev) {
                ar = ar->prev;
-       
+       }
+
        if (ar->regiontimer) {
                RegionAlphaInfo *rgi = ar->regiontimer->customdata;
                float alpha;
-                       
+
                alpha = (float)ar->regiontimer->duration / TIMEOUT;
                /* makes sure the blend out works 100% - without area redraws */
                if (rgi->hidden) alpha = 0.9f - TIMESTEP - alpha;
@@ -3669,10 +3670,12 @@ void region_blend_start(bContext *C, ScrArea *sa, ARegion *ar)
        else
                WM_event_remove_handlers(C, &ar->handlers);
 
-       if(ar->next)
-               if (ar->next->alignment & RGN_SPLIT_PREV)
+       if (ar->next) {
+               if (ar->next->alignment & RGN_SPLIT_PREV) {
                        rgi->child_ar = ar->next;
-       
+               }
+       }
+
        /* new timer */
        ar->regiontimer = WM_event_add_timer(wm, win, TIMERREGION, TIMESTEP);
        ar->regiontimer->customdata = rgi;
index a5cbe88..1b0b0f0 100644 (file)
@@ -573,7 +573,7 @@ static int draw_name_offset(ARegion *ar)
                arn = arn->prev;
        
        /* check if a region overlaps with the current one */
-       for (; arn; arn= arn->next) {
+       for (; arn; arn = arn->next) {
                if (ar != arn)
                        if (ar->winrct.xmin == arn->winrct.xmin)
                                if (ar->winrct.ymin == arn->winrct.ymin)
index 2902bf1..a36f35c 100644 (file)
@@ -145,7 +145,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
                /* make alpha output give results even if transparency is only enabled on
                 * the material linked in this not and not on the parent material */
                mode = shi->mode;
-               if(shi->mat->mode & MA_TRANSP)
+               if (shi->mat->mode & MA_TRANSP)
                        shi->mode |= MA_TRANSP;
 
                shi->nodes= 1; /* temp hack to prevent trashadow recursion */
index ce08d7f..c1a9951 100644 (file)
@@ -147,7 +147,7 @@ struct wmEventHandler *WM_event_add_ui_handler(const struct bContext *C, ListBas
                        int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
                        void (*remove)(struct bContext *C, void *userdata), void *userdata);
 void           WM_event_remove_ui_handler(ListBase *handlers,
-                       int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
+                                       int (*func)(struct bContext *C, struct wmEvent *event, void *userdata),
                        void (*remove)(struct bContext *C, void *userdata), void *userdata, int postpone);
 void           WM_event_remove_area_handler(struct ListBase *handlers, void *area);
 
@@ -301,7 +301,7 @@ struct wmDrag               *WM_event_start_drag(struct bContext *C, int icon, int type, void
 void                           WM_event_drag_image(struct wmDrag *, struct ImBuf *, float scale, int sx, int sy);
 
 struct wmDropBox       *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(struct bContext *, struct wmDrag *, struct wmEvent *event),
-                                                 void (*copy)(struct wmDrag *, struct wmDropBox *));
+                                    void (*copy)(struct wmDrag *, struct wmDropBox *));
 ListBase       *WM_dropboxmap_find(const char *idname, int spaceid, int regionid);
 
                        /* Set a subwindow active in pixelspace view, with optional scissor subset */
index db80b0b..d8dd0ac 100644 (file)
@@ -1640,9 +1640,9 @@ static int wm_action_not_handled(int action)
 static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers)
 {
 #ifndef NDEBUG
-       const int do_debug_handler = (G.debug & G_DEBUG_HANDLERS)
+       const int do_debug_handler = (G.debug & G_DEBUG_HANDLERS) &&
                /* comment this out to flood the console! (if you really want to test) */
-               && !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
+               !ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)
                ;
 #endif
        wmWindowManager *wm = CTX_wm_manager(C);
index 3c56e8d..4dd7559 100644 (file)
@@ -311,7 +311,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
                if (G.save_over && G.main->name[0]) {
                        char str[sizeof(G.main->name) + 12];
                        BLI_snprintf(str, sizeof(str), "Blender%s [%s%s]", wm->file_saved ? "" : "*", G.main->name,
-                                                G.main->recovered ? " (Recovered)" : "");
+                                    G.main->recovered ? " (Recovered)" : "");
                        GHOST_SetTitle(win->ghostwin, str);
                }
                else