Fix a few warning in editors/ module.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 30 Mar 2010 11:38:06 +0000 (11:38 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 30 Mar 2010 11:38:06 +0000 (11:38 +0000)
source/blender/editors/animation/anim_markers.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/transform/transform_generics.c
source/blender/makesdna/DNA_space_types.h

index a9f0f827ee534bb47d1477d3f106a680e16e0770..d1c1fa64ad29a6338bb88a612399965fbf2adcbe 100644 (file)
@@ -61,6 +61,7 @@
 #include "ED_util.h"
 #include "ED_numinput.h"
 #include "ED_object.h"
+#include "ED_types.h"
 
 /* ************* Marker API **************** */
 
index f3179c05158452310ec348f75d69930601c5be9a..bfc17261fa60c4274fb5c17cd12cb908718d8d82 100644 (file)
@@ -542,10 +542,10 @@ void file_draw_list(const bContext *C, ARegion *ar)
 
                if (!(file->flags & EDITING)) {
                        if (params->active_file == i) {
-                               if (file->flags & ACTIVE) colorid= TH_HILITE;
+                               if (file->flags & ACTIVEFILE) colorid= TH_HILITE;
                                else colorid = TH_BACK;
                                draw_tile(sx, sy-1, layout->tile_w+4, sfile->layout->tile_h+layout->tile_border_y, colorid,20);
-                       } else if (file->flags & ACTIVE) {
+                       } else if (file->flags & ACTIVEFILE) {
                                colorid = TH_HILITE;
                                draw_tile(sx, sy-1, layout->tile_w+4, sfile->layout->tile_h+layout->tile_border_y, colorid,0);
                        } 
index 074e8b6c81bb04cc3998129ce670cb8b1f7e2a32..f1d3702160f6fabdd0de0487f8b72ba0dbdd6f84 100644 (file)
@@ -59,7 +59,7 @@
 #include <stdio.h>
 
 /* for events */
-#define NOTACTIVE                      0
+#define NOTACTIVEFILE                  0
 #define ACTIVATE                       1
 #define INACTIVATE                     2
 
@@ -86,8 +86,8 @@ static void file_deselect_all(SpaceFile* sfile)
 
        for ( i=0; i < numfiles; ++i) {
                struct direntry* file = filelist_file(sfile->files, i);
-               if (file && (file->flags & ACTIVE)) {
-                       file->flags &= ~ACTIVE;
+               if (file && (file->flags & ACTIVEFILE)) {
+                       file->flags &= ~ACTIVEFILE;
                }
        }
 }
@@ -135,7 +135,7 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh
 
        int numfiles = filelist_numfiles(sfile->files);
        
-       params->selstate = NOTACTIVE;
+       params->selstate = NOTACTIVEFILE;
        first_file = find_file_mouse(sfile, ar, 1, rect->xmin, rect->ymax);
        last_file = find_file_mouse(sfile, ar, 1, rect->xmax, rect->ymin);
        
@@ -147,15 +147,15 @@ static FileSelect file_select(bContext* C, const rcti* rect, short selecting, sh
                        struct direntry* file = filelist_file(sfile->files, act_file);
                        
                        if (toggle_one) {
-                               if (file->flags & ACTIVE) {
-                                       file->flags &= ~ACTIVE;
+                               if (file->flags & ACTIVEFILE) {
+                                       file->flags &= ~ACTIVEFILE;
                                        selecting=0;
                                } else
-                                       file->flags |= ACTIVE;
+                                       file->flags |= ACTIVEFILE;
                        } else if (selecting) 
-                               file->flags |= ACTIVE;
+                               file->flags |= ACTIVEFILE;
                        else
-                               file->flags &= ~ACTIVE;
+                               file->flags &= ~ACTIVEFILE;
                }
        }
 
@@ -296,8 +296,8 @@ static int file_select_all_exec(bContext *C, wmOperator *op)
        /* if any file is selected, deselect all first */
        for ( i=0; i < numfiles; ++i) {
                struct direntry* file = filelist_file(sfile->files, i);
-               if (file && (file->flags & ACTIVE)) {
-                       file->flags &= ~ACTIVE;
+               if (file && (file->flags & ACTIVEFILE)) {
+                       file->flags &= ~ACTIVEFILE;
                        select = 0;
                        ED_area_tag_redraw(sa);
                }
@@ -307,7 +307,7 @@ static int file_select_all_exec(bContext *C, wmOperator *op)
                for ( i=0; i < numfiles; ++i) {
                        struct direntry* file = filelist_file(sfile->files, i);
                        if(file && !S_ISDIR(file->type)) {
-                               file->flags |= ACTIVE;
+                               file->flags |= ACTIVEFILE;
                                ED_area_tag_redraw(sa);
                        }
                }
@@ -543,7 +543,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
                        
                        for (i=0; i<filelist_numfiles(sfile->files); i++) {
                                file = filelist_file(sfile->files, i);
-                               if(file->flags & ACTIVE) {
+                               if(file->flags & ACTIVEFILE) {
                                        active=1;
                                }
                        }
@@ -571,7 +571,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
                        if(RNA_struct_find_property(op->ptr, "files")) {
                                for (i=0; i<numfiles; i++) {
                                        file = filelist_file(sfile->files, i);
-                                       if(file->flags & ACTIVE) {
+                                       if(file->flags & ACTIVEFILE) {
                                                if ((file->type & S_IFDIR)==0) {
                                                        RNA_collection_add(op->ptr, "files", &itemptr);
                                                        RNA_string_set(&itemptr, "name", file->relname);
@@ -583,7 +583,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
                        if(RNA_struct_find_property(op->ptr, "dirs")) {
                                for (i=0; i<numfiles; i++) {
                                        file = filelist_file(sfile->files, i);
-                                       if(file->flags & ACTIVE) {
+                                       if(file->flags & ACTIVEFILE) {
                                                if ((file->type & S_IFDIR)) {
                                                        RNA_collection_add(op->ptr, "dirs", &itemptr);
                                                        RNA_string_set(&itemptr, "name", file->relname);
index 0cc58b281b96f44dfd9eacfb349838270ba3f674..dc818bb9172a780b900c00f8aee2f286f3dfce3c 100644 (file)
 
 #include "filelist.h"
 
-/* Elubie: VERY, really very ugly and evil! Remove asap!!! */
-/* for state of file */
-#define ACTIVE                         2
-
 /* max length of library group name within filesel */
 #define GROUP_MAX 32
 
-static void *exec_loadimages(void *list_v);
-
 struct FileList;
 
 typedef struct FileImage {
@@ -977,15 +971,15 @@ void filelist_swapselect(struct FileList* filelist)
        
        file= filelist->filelist;
        for(num=0; num<filelist->numfiles; num++, file++) {
-               if(file->flags & ACTIVE) {
+               if(file->flags & ACTIVEFILE) {
                        act= 1;
                        break;
                }
        }
        file= filelist->filelist+2;
        for(num=2; num<filelist->numfiles; num++, file++) {
-               if(act) file->flags &= ~ACTIVE;
-               else file->flags |= ACTIVE;
+               if(act) file->flags &= ~ACTIVEFILE;
+               else file->flags |= ACTIVEFILE;
        }
 }
 
@@ -1223,10 +1217,10 @@ void filelist_from_main(struct FileList *filelist)
 #if 0                          // XXXXX TODO show the selection status of the objects
                                        if(!filelist->has_func) { /* F4 DATA BROWSE */
                                                if(idcode==ID_OB) {
-                                                       if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVE;
+                                                       if( ((Object *)id)->flag & SELECT) files->flags |= ACTIVEFILE;
                                                }
                                                else if(idcode==ID_SCE) {
-                                                       if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVE;
+                                                       if( ((Scene *)id)->r.scemode & R_BG_RENDER) files->flags |= ACTIVEFILE;
                                                }                                       
                                        }
 #endif
@@ -1367,4 +1361,4 @@ void thumbnails_start(struct FileList* filelist, const struct bContext* C)
 void thumbnails_stop(struct FileList* filelist, const struct bContext* C)
 {
        WM_jobs_kill(CTX_wm_manager(C), filelist);
-}
\ No newline at end of file
+}
index 5d1a765f45700ba52d238aa62ebe57681993980f..7aed890e9ba64875b33cfa904aecd505171c07ec 100644 (file)
@@ -425,7 +425,7 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern)
                for (i = 0; i < n; i++) {
                        file = filelist_file(sfile->files, i);
                        if (fnmatch(pattern, file->relname, 0) == 0) {
-                               file->flags |= ACTIVE;
+                               file->flags |= ACTIVEFILE;
                                match = 1;
                        }
                }
index 8d10da4e8a1ae616bcd5e7c3c2bcb0c03d916fdd..c81f4d7d122af1faccfe18b21966b8b3de77a0a6 100644 (file)
@@ -110,10 +110,10 @@ static int simaUVSel_Check() {return 0;}
 static void image_editvertex_buts(const bContext *C, uiBlock *block);
 
 
+#if 0
 static void do_image_panel_events(bContext *C, void *arg, int event)
 {
        SpaceImage *sima= CTX_wm_space_image(C);
-       ARegion *ar= CTX_wm_region(C);
        
        switch(event) {
                case B_REDR:
@@ -126,6 +126,7 @@ static void do_image_panel_events(bContext *C, void *arg, int event)
        /* all events now */
        WM_event_add_notifier(C, NC_IMAGE, sima->image);
 }
+#endif
 
 static void image_info(Image *ima, ImBuf *ibuf, char *str)
 {
@@ -947,6 +948,7 @@ void uiTemplateImageLayers(uiLayout *layout, bContext *C, Image *ima, ImageUser
        }
 }
 
+#if 0
 static int image_panel_uv_poll(const bContext *C, PanelType *pt)
 {
        Object *obedit= CTX_data_edit_object(C);
@@ -955,7 +957,6 @@ static int image_panel_uv_poll(const bContext *C, PanelType *pt)
 
 static void image_panel_uv(const bContext *C, Panel *pa)
 {
-       ARegion *ar= CTX_wm_region(C);
        uiBlock *block;
        
        block= uiLayoutAbsoluteBlock(pa->layout);
@@ -963,6 +964,7 @@ static void image_panel_uv(const bContext *C, Panel *pa)
 
        image_editvertex_buts(C, block);
 }      
+#endif
 
 void image_buttons_register(ARegionType *art)
 {
index 1fd189e8b5262be358ae4bb3076f3dc3d68f8aec..0e47034d88161971d8e7f81206f25f0c01b7068f 100644 (file)
@@ -1221,9 +1221,8 @@ void calculateCenterCursor(TransInfo *t)
 
 void calculateCenterCursor2D(TransInfo *t)
 {
-       View2D *v2d= t->view;
        float aspx=1.0, aspy=1.0;
-       float *cursor;
+       float *cursor= NULL;
        
        if(t->spacetype==SPACE_IMAGE) {
                SpaceImage *sima= (SpaceImage *)t->sa->spacedata.first;
@@ -1232,7 +1231,7 @@ void calculateCenterCursor2D(TransInfo *t)
                cursor = sima->cursor;
        }
        
-       if (v2d) {
+       if (cursor) {
                t->center[0] = cursor[0] * aspx;
                t->center[1] = cursor[1] * aspy;
        }
index d74ba77bf91e078e27cd8f5babdadc2bf184d5ce..00ade3156c5d1370b8ff3ec632f2271f4e363181 100644 (file)
@@ -671,7 +671,7 @@ enum FileSortTypeE {
 
 /* files in filesel list: 2=ACTIVE  */
 #define EDITING                                (1<<0)
-#define ACTIVE                         (1<<1)
+#define ACTIVEFILE                     (1<<1)
 #define BLENDERFILE                    (1<<2)
 #define PSXFILE                                (1<<3)
 #define IMAGEFILE                      (1<<4)