code cleanup: quiet warnings
authorCampbell Barton <ideasman42@gmail.com>
Thu, 13 Dec 2012 00:47:47 +0000 (00:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 13 Dec 2012 00:47:47 +0000 (00:47 +0000)
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/intern/blender.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c

index ffdbc9cb9d835b51c6c9c645ff7e8680f3b78be0..622b5090f05097797d58074feb6398d4bf917fcf 100644 (file)
@@ -99,7 +99,7 @@ extern void BKE_reset_undo(void);
 extern char *BKE_undo_menu_string(void);
 extern void BKE_undo_number(struct bContext *C, int nr);
 extern const char *BKE_undo_get_name(int nr, int *active);
-extern int BKE_undo_save_file(const struct bContext *C, char *filename);
+extern int BKE_undo_save_file(const char *filename);
 extern struct Main *BKE_undo_get_main(struct Scene **scene);
 
        /* copybuffer */
index 8a29e5ea1a7fcc73c859107d0d202d99c94a9745..7ee3bddc82b41cd9a24bdb7684584ad95d29f319 100644 (file)
@@ -788,7 +788,7 @@ char *BKE_undo_menu_string(void)
 }
 
 /* saves .blend using undo buffer, returns 1 == success */
-int BKE_undo_save_file(const bContext *C, char *filename)
+int BKE_undo_save_file(const char *filename)
 {
        UndoElem *uel;
        MemFileChunk *chunk;
index 852ce02fa40e04ffe2c0fcc66477758f8374e05a..80270116a13e910951ad8560d1505691780c0cfb 100644 (file)
@@ -699,28 +699,28 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar)
        switch (az->edge) {
                case AE_TOP_TO_BOTTOMRIGHT:
                        if (ar->winrct.ymax == sa->totrct.ymin) add = 1; else add = 0;
-                       az->x1 = ar->winrct.xmax - 2.5 * AZONEPAD_TAB_PLUSW;
+                       az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
                        az->y1 = ar->winrct.ymax - add;
-                       az->x2 = ar->winrct.xmax - 1.5 * AZONEPAD_TAB_PLUSW;
+                       az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
                        az->y2 = ar->winrct.ymax - add + AZONEPAD_TAB_PLUSH;
                        break;
                case AE_BOTTOM_TO_TOPLEFT:
-                       az->x1 = ar->winrct.xmax - 2.5 * AZONEPAD_TAB_PLUSW;
+                       az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
                        az->y1 = ar->winrct.ymin - AZONEPAD_TAB_PLUSH;
-                       az->x2 = ar->winrct.xmax - 1.5 * AZONEPAD_TAB_PLUSW;
+                       az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
                        az->y2 = ar->winrct.ymin;
                        break;
                case AE_LEFT_TO_TOPRIGHT:
                        az->x1 = ar->winrct.xmin - AZONEPAD_TAB_PLUSH;
-                       az->y1 = ar->winrct.ymax - 2.5 * AZONEPAD_TAB_PLUSW;
+                       az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
                        az->x2 = ar->winrct.xmin;
-                       az->y2 = ar->winrct.ymax - 1.5 * AZONEPAD_TAB_PLUSW;
+                       az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
                        break;
                case AE_RIGHT_TO_TOPLEFT:
                        az->x1 = ar->winrct.xmax - 1;
-                       az->y1 = ar->winrct.ymax - 2.5 * AZONEPAD_TAB_PLUSW;
+                       az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
                        az->x2 = ar->winrct.xmax - 1 + AZONEPAD_TAB_PLUSH;
-                       az->y2 = ar->winrct.ymax - 1.5 * AZONEPAD_TAB_PLUSW;
+                       az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
                        break;
        }
        /* rect needed for mouse pointer test */
index 269cc672e34d167172438c689e082fe8824a8913..5a99fc7ae4c8f124139c5aa53c07ee522574aa87 100644 (file)
@@ -3595,7 +3595,7 @@ typedef struct RegionAlphaInfo {
 } RegionAlphaInfo;
 
 #define TIMEOUT                0.3f
-#define TIMESTEP       0.04
+#define TIMESTEP       0.04f
 
 float ED_region_blend_factor(ARegion *ar)
 {
@@ -3609,7 +3609,7 @@ float ED_region_blend_factor(ARegion *ar)
                        
                alpha = (float)ar->regiontimer->duration / TIMEOUT;
                /* makes sure the blend out works 100% - without area redraws */
-               if (rgi->hidden) alpha = 0.9 - TIMESTEP - alpha;
+               if (rgi->hidden) alpha = 0.9f - TIMESTEP - alpha;
                
                CLAMP(alpha, 0.0f, 1.0f);
                return alpha;
@@ -3697,7 +3697,7 @@ static int region_blend_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *eve
                ED_region_tag_redraw(rgi->child_ar);
        
        /* end timer? */
-       if (rgi->ar->regiontimer->duration > TIMEOUT) {
+       if (rgi->ar->regiontimer->duration > (double)TIMEOUT) {
                region_blend_end(C, rgi->ar, 0);
                return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
        }
index beabd44c2975fba16b2dd281d32ce93555ec19dd..0c89e3ecbcf20c170201540b81054ccd3e7f59b7 100644 (file)
@@ -871,8 +871,8 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View
                                                /* XXX firstly draw a little rect to help identify that it's different from the toggles */
                                                glBegin(GL_LINE_LOOP);
                                                glVertex2f((float)v2d->cur.xmax - offset - 1, y - 0.35f * U.widget_unit);
-                                               glVertex2f((float)v2d->cur.xmax - offset - 1, y + 0.45 * U.widget_unit);
-                                               glVertex2f((float)v2d->cur.xmax - 1, y +  0.45f * U.widget_unit);
+                                               glVertex2f((float)v2d->cur.xmax - offset - 1, y + 0.45f * U.widget_unit);
+                                               glVertex2f((float)v2d->cur.xmax - 1, y + 0.45f * U.widget_unit);
                                                glVertex2f((float)v2d->cur.xmax - 1, y - 0.35f * U.widget_unit);
                                                glEnd(); // GL_LINES
                                                
index 911902d275d46f01122a3151a6055bdad5d30de1..3823798194efe3a2f10432024ffe21f47a895f2e 100644 (file)
@@ -1432,7 +1432,10 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
                                        
                                        /* divider */
                                        UI_ThemeColorShade(TH_BACK, -40);
-                                       glRecti(tempx - 10.0 * ufac, *starty + 4.0f * ufac, tempx - 8.0f * ufac, *starty + UI_UNIT_Y - 4.0f * ufac);
+                                       glRecti(tempx   - 10.0f * ufac,
+                                               *starty +  4.0f * ufac,
+                                               tempx   -  8.0f * ufac,
+                                               *starty + UI_UNIT_Y - 4.0f * ufac);
                                        
                                        glEnable(GL_BLEND);
                                        glPixelTransferf(GL_ALPHA_SCALE, 0.5);
index 6c16c968a8124d306baa8622ecd64ac2263a1107..df463076919b6a43b8c7d5621339c8089dfaf71e 100644 (file)
@@ -1006,7 +1006,7 @@ void wm_autosave_timer(const bContext *C, wmWindowManager *wm, wmTimer *UNUSED(w
 
        if (U.uiflag & USER_GLOBALUNDO) {
                /* fast save of last undobuffer, now with UI */
-               BKE_undo_save_file(C, filepath);
+               BKE_undo_save_file(filepath);
        }
        else {
                /*  save as regular blend file */
index 563cb592d5a997fb8f95ef34e2aa3a1f4e3d3b5c..734941b8907e9f76ff06e035feff776885f04e8c 100644 (file)
@@ -385,7 +385,7 @@ void WM_exit_ext(bContext *C, const short do_python)
                                
                                BLI_make_file_string("/", filename, BLI_temporary_dir(), "quit.blend");
 
-                               if (BKE_undo_save_file(C, filename))
+                               if (BKE_undo_save_file(filename))
                                        printf("Saved session recovery to '%s'\n", filename);
                        }
                }