Fix a few warning in editors/ module.

This commit is contained in:
Brecht Van Lommel 2010-03-30 11:38:06 +00:00
parent ccdd490957
commit 19fb497d13
8 changed files with 32 additions and 36 deletions

@ -61,6 +61,7 @@
#include "ED_util.h"
#include "ED_numinput.h"
#include "ED_object.h"
#include "ED_types.h"
/* ************* Marker API **************** */

@ -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);
}

@ -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);

@ -90,15 +90,9 @@
#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);
}
}

@ -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;
}
}

@ -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)
{

@ -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;
}

@ -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)