Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-26 08:07:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-26 08:07:38 +0400
commit6736576f6d576f9a06db14a76193c0c237e5cba1 (patch)
tree51bc0a37f1504dea826260340e80c085392d87aa /source/blender/editors
parentaf7288c407fbb4bb462f509d5782b660a29c4883 (diff)
replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface.c30
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/editors/interface/interface_icons.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c24
-rw-r--r--source/blender/editors/render/render_opengl.c2
-rw-r--r--source/blender/editors/screen/screendump.c4
-rw-r--r--source/blender/editors/space_console/space_console.c2
-rw-r--r--source/blender/editors/space_file/filelist.c6
-rw-r--r--source/blender/editors/space_file/fsmenu.c8
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c2
-rw-r--r--source/blender/editors/space_text/text_ops.c12
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/util/ed_util.c2
13 files changed, 49 insertions, 49 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 86961cd84dc..a10de9a8a42 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1027,7 +1027,7 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
- if(multisample_enabled)
+ if(multisample_enabled)
glEnable(GL_MULTISAMPLE_ARB);
ui_draw_links(block);
@@ -1037,25 +1037,25 @@ void uiDrawBlock(const bContext *C, uiBlock *block)
static void ui_is_but_sel(uiBut *but, double *value)
{
- short push=0, true=1;
+ short is_push=0, is_true=1;
- if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) true= 0;
+ if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) is_true= 0;
if( but->bit ) {
int lvalue;
UI_GET_BUT_VALUE_INIT(but, *value)
lvalue= (int)*value;
- if( BTST(lvalue, (but->bitnr)) ) push= true;
- else push= !true;
+ if( BTST(lvalue, (but->bitnr)) ) is_push= is_true;
+ else is_push= !is_true;
}
else {
switch(but->type) {
case BUT:
- push= 2;
+ is_push= 2;
break;
case HOTKEYEVT:
case KEYEVT:
- push= 2;
+ is_push= 2;
break;
case TOGBUT:
case TOG:
@@ -1065,36 +1065,36 @@ static void ui_is_but_sel(uiBut *but, double *value)
case ICONTOG:
case OPTION:
UI_GET_BUT_VALUE_INIT(but, *value)
- if(*value != (double)but->hardmin) push= 1;
+ if(*value != (double)but->hardmin) is_push= 1;
break;
case ICONTOGN:
case TOGN:
case OPTIONN:
UI_GET_BUT_VALUE_INIT(but, *value)
- if(*value==0.0) push= 1;
+ if(*value==0.0) is_push= 1;
break;
case ROW:
case LISTROW:
UI_GET_BUT_VALUE_INIT(but, *value)
/* support for rna enum buts */
if(but->rnaprop && (RNA_property_flag(but->rnaprop) & PROP_ENUM_FLAG)) {
- if((int)*value & (int)but->hardmax) push= 1;
+ if((int)*value & (int)but->hardmax) is_push= 1;
}
else {
- if(*value == (double)but->hardmax) push= 1;
+ if(*value == (double)but->hardmax) is_push= 1;
}
break;
case COL:
- push= 2;
+ is_push= 2;
break;
default:
- push= 2;
+ is_push= 2;
break;
}
}
- if(push==2);
- else if(push==1) but->flag |= UI_SELECT;
+ if(is_push==2);
+ else if(is_push==1) but->flag |= UI_SELECT;
else but->flag &= ~UI_SELECT;
}
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index a0b0d34ab44..cd3243bb9dc 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6097,7 +6097,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle
/* closing sublevels of pulldowns */
case LEFTARROWKEY:
if(event->val==KM_PRESS && (block->flag & UI_BLOCK_LOOP))
- if(BLI_countlist(&block->saferct) > 0)
+ if(block->saferct.first)
menu->menuretval= UI_RETURN_OUT;
retval= WM_UI_HANDLER_BREAK;
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 1b7308d328e..a7d8c688f43 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -509,7 +509,7 @@ static void init_internal_icons(void)
bTheme *btheme= UI_GetTheme();
ImBuf *bbuf= NULL;
int x, y, icontype;
- char iconfilestr[FILE_MAXDIR+FILE_MAXFILE];
+ char iconfilestr[FILE_MAX];
if ((btheme!=NULL) && btheme->tui.iconfile[0]) {
char *icondir= BLI_get_folder(BLENDER_DATAFILES, "icons");
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 9dd4503414a..cc60f4a52fd 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -637,7 +637,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
FluidsimSettings *domainSettings= fluidmd->fss;
FILE *fileCfg;
int dirExist = 0;
- char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings
+ char newSurfdataPath[FILE_MAX]; // modified output settings
const char *suffixConfig = FLUID_SUFFIX_CONFIG;
int outStringsChanged = 0;
@@ -667,15 +667,15 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
}
if(targetDir[0] == '\0' || (!dirExist)) {
- char blendDir[FILE_MAXDIR+FILE_MAXFILE];
- char blendFile[FILE_MAXDIR+FILE_MAXFILE];
+ char blendDir[FILE_MAX];
+ char blendFile[FILE_MAX];
// invalid dir, reset to current/previous
- BLI_strncpy(blendDir, G.main->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_strncpy(blendDir, G.main->name, FILE_MAX);
BLI_splitdirstring(blendDir, blendFile);
- BLI_replace_extension(blendFile, FILE_MAXDIR+FILE_MAXFILE, ""); /* strip .blend */
+ BLI_replace_extension(blendFile, FILE_MAX, ""); /* strip .blend */
- BLI_snprintf(newSurfdataPath, FILE_MAXDIR+FILE_MAXFILE ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
+ BLI_snprintf(newSurfdataPath, FILE_MAX ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name);
BLI_snprintf(debugStrBuffer, 256, "fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath);
elbeemDebugOut(debugStrBuffer);
@@ -685,7 +685,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF
// check if modified output dir is ok
#if 0
if(outStringsChanged) {
- char dispmsg[FILE_MAXDIR+FILE_MAXFILE+256];
+ char dispmsg[FILE_MAX+256];
int selection=0;
BLI_strncpy(dispmsg,"Output settings set to: '", sizeof(dispmsg));
strcat(dispmsg, newSurfdataPath);
@@ -810,9 +810,9 @@ static void fluidbake_free_data(FluidAnimChannels *channels, ListBase *fobjects,
/* copied from rna_fluidsim.c: fluidsim_find_lastframe() */
static void fluidsim_delete_until_lastframe(FluidsimSettings *fss, const char *relbase)
{
- char targetDir[FILE_MAXFILE+FILE_MAXDIR], targetFile[FILE_MAXFILE+FILE_MAXDIR];
- char targetDirVel[FILE_MAXFILE+FILE_MAXDIR], targetFileVel[FILE_MAXFILE+FILE_MAXDIR];
- char previewDir[FILE_MAXFILE+FILE_MAXDIR], previewFile[FILE_MAXFILE+FILE_MAXDIR];
+ char targetDir[FILE_MAX], targetFile[FILE_MAX];
+ char targetDirVel[FILE_MAX], targetFileVel[FILE_MAX];
+ char previewDir[FILE_MAX], previewFile[FILE_MAX];
int curFrame = 1, exists = 0;
BLI_join_dirfile(targetDir, sizeof(targetDir), fss->surfdataPath, OB_FLUIDSIM_SURF_FINAL_OBJ_FNAME);
@@ -859,8 +859,8 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
const char *suffixConfig = FLUID_SUFFIX_CONFIG;
const char *suffixSurface = FLUID_SUFFIX_SURFACE;
- char targetDir[FILE_MAXDIR+FILE_MAXFILE]; // store & modify output settings
- char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access
+ char targetDir[FILE_MAX]; // store & modify output settings
+ char targetFile[FILE_MAX]; // temp. store filename from targetDir for access
int outStringsChanged = 0; // modified? copy back before baking
float domainMat[4][4];
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index a68286b8e88..3a2d9f137d7 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -392,7 +392,7 @@ static int screen_opengl_render_anim_step(bContext *C, wmOperator *op)
Scene *scene= oglrender->scene;
ImBuf *ibuf;
void *lock;
- char name[FILE_MAXDIR+FILE_MAXFILE];
+ char name[FILE_MAX];
int ok= 0;
const short view_context= (oglrender->v3d != NULL);
Object *camera= NULL;
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 48970dffce0..7d0ec866456 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -160,7 +160,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
/* BKE_add_image_extension() checks for if extension was already set */
if(scene->r.scemode & R_EXTENSION)
- if(strlen(path)<FILE_MAXDIR+FILE_MAXFILE-5)
+ if(strlen(path)<FILE_MAX-5)
BKE_add_image_extension(path, scene->r.im_format.imtype);
ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0);
@@ -295,7 +295,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
}
else {
ImBuf *ibuf= IMB_allocImBuf(sj->dumpsx, sj->dumpsy, rd.im_format.planes, 0);
- char name[FILE_MAXDIR+FILE_MAXFILE];
+ char name[FILE_MAX];
int ok;
BKE_makepicstring(name, rd.pic, sj->bmain->name, cfra, rd.im_format.imtype, rd.scemode & R_EXTENSION, TRUE);
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 4867552cc52..c713317aa7e 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -192,7 +192,7 @@ static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(eve
static void path_drop_copy(wmDrag *drag, wmDropBox *drop)
{
- char pathname[FILE_MAXDIR+FILE_MAXFILE+2];
+ char pathname[FILE_MAX+2];
BLI_snprintf(pathname, sizeof(pathname), "\"%s\"", drag->path);
RNA_string_set(drop->ptr, "text", pathname);
}
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index deed7ad2a3a..288ff76d9ff 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -852,7 +852,7 @@ static void filelist_read_library(struct FileList* filelist)
file = filelist->filelist;
for(num=0; num<filelist->numfiles; num++, file++) {
if(BLO_has_bfile_extension(file->relname)) {
- char name[FILE_MAXDIR+FILE_MAXFILE];
+ char name[FILE_MAX];
BLI_strncpy(name, filelist->dir, sizeof(name));
strcat(name, file->relname);
@@ -988,7 +988,7 @@ void filelist_from_library(struct FileList* filelist)
LinkNode *l, *names, *previews;
struct ImBuf* ima;
int ok, i, nprevs, nnames, idcode;
- char filename[FILE_MAXDIR+FILE_MAXFILE];
+ char filename[FILE_MAX];
char dir[FILE_MAX], group[GROUP_MAX];
/* name test */
@@ -1179,7 +1179,7 @@ void filelist_from_main(struct FileList *filelist)
if(id->lib==NULL)
files->relname= BLI_strdup(id->name+2);
else {
- files->relname= MEM_mallocN(FILE_MAXDIR+FILE_MAXFILE+32, "filename for lib");
+ files->relname= MEM_mallocN(FILE_MAX+32, "filename for lib");
sprintf(files->relname, "%s | %s", id->lib->name, id->name+2);
}
files->type |= S_IFREG;
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 6b3477d1fe5..9a952d22274 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -326,13 +326,13 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
for (i=1; err!=nsvErr; i++)
{
FSRef dir;
- unsigned char path[FILE_MAXDIR+FILE_MAXFILE];
+ unsigned char path[FILE_MAX];
err = FSGetVolumeInfo(kFSInvalidVolumeRefNum, i, NULL, kFSVolInfoNone, NULL, NULL, &dir);
if (err != noErr)
continue;
- FSRefMakePath(&dir, path, FILE_MAXDIR+FILE_MAXFILE);
+ FSRefMakePath(&dir, path, FILE_MAX);
if (strcmp((char*)path, "/home") && strcmp((char*)path, "/net"))
{ /* /net and /home are meaningless on OSX, home folders are stored in /Users */
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
@@ -414,7 +414,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
FSRef dir;
FSVolumeRefNum volRefNum;
struct GetVolParmsInfoBuffer volParmsBuffer;
- unsigned char path[FILE_MAXDIR+FILE_MAXFILE];
+ unsigned char path[FILE_MAX];
err = FSGetVolumeInfo(kFSInvalidVolumeRefNum, i, &volRefNum, kFSVolInfoNone, NULL, NULL, &dir);
if (err != noErr)
@@ -425,7 +425,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu)
continue;
- FSRefMakePath(&dir, path, FILE_MAXDIR+FILE_MAXFILE);
+ FSRefMakePath(&dir, path, FILE_MAX);
fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, (char *)path, 1, 0);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index ddfa2fd915f..2b59a02deae 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -512,7 +512,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float y1, float y2, const unsigned char background_col[3])
{
rctf rect;
- char str[32 + FILE_MAXDIR+FILE_MAXFILE];
+ char str[32 + FILE_MAX];
const char *name= seq->name+2;
char col[4];
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index e36cdd32ab8..16ee32d10a2 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -449,9 +449,9 @@ static void txt_write_file(Text *text, ReportList *reports)
FILE *fp;
TextLine *tmp;
struct stat st;
- char filepath[FILE_MAXDIR+FILE_MAXFILE];
+ char filepath[FILE_MAX];
- BLI_strncpy(filepath, text->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_strncpy(filepath, text->name, FILE_MAX);
BLI_path_abs(filepath, G.main->name);
fp= fopen(filepath, "w");
@@ -3053,12 +3053,12 @@ int text_file_modified(Text *text)
{
struct stat st;
int result;
- char file[FILE_MAXDIR+FILE_MAXFILE];
+ char file[FILE_MAX];
if(!text || !text->name)
return 0;
- BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_strncpy(file, text->name, FILE_MAX);
BLI_path_abs(file, G.main->name);
if(!BLI_exists(file))
@@ -3082,11 +3082,11 @@ static void text_ignore_modified(Text *text)
{
struct stat st;
int result;
- char file[FILE_MAXDIR+FILE_MAXFILE];
+ char file[FILE_MAX];
if(!text || !text->name) return;
- BLI_strncpy(file, text->name, FILE_MAXDIR+FILE_MAXFILE);
+ BLI_strncpy(file, text->name, FILE_MAX);
BLI_path_abs(file, G.main->name);
if(!BLI_exists(file)) return;
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 7dae02aba39..5dfb9cfb5b6 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1329,7 +1329,7 @@ static void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d)
v3d->zbuf= FALSE;
glDisable(GL_DEPTH_TEST);
glEnable(GL_DITHER);
- if(multisample_enabled)
+ if(multisample_enabled)
glEnable(GL_MULTISAMPLE_ARB);
if(rv3d->rflag & RV3D_CLIPPING)
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index fef42866e29..1a1022a5c7f 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -164,7 +164,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha
PointerRNA props_ptr;
uiPopupMenu *pup;
uiLayout *layout;
- char line[FILE_MAXDIR + FILE_MAXFILE + 100];
+ char line[FILE_MAX + 100];
pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE);
layout= uiPupMenuLayout(pup);