replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX
authorCampbell Barton <ideasman42@gmail.com>
Sat, 26 Nov 2011 04:07:38 +0000 (04:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 26 Nov 2011 04:07:38 +0000 (04:07 +0000)
39 files changed:
source/blender/blenfont/intern/blf_dir.c
source/blender/blenkernel/BKE_material.h
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/movieclip.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/text.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/readfile.h
source/blender/blenloader/intern/writefile.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_opengl.c
source/blender/editors/screen/screendump.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/util/ed_util.c
source/blender/imbuf/intern/IMB_indexer.h
source/blender/imbuf/intern/indexer.c
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/rna_image_api.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_tracking.c
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/python/intern/bpy_interface.c
source/blender/windowmanager/intern/wm_files.c
source/creator/creator.c
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp

index 4da67f5..b82393f 100644 (file)
@@ -129,7 +129,7 @@ void BLF_dir_free(char **dirs, int count)
 char *blf_dir_search(const char *file)
 {
        DirBLF *dir;
-       char full_path[FILE_MAXDIR+FILE_MAXFILE];
+       char full_path[FILE_MAX];
        char *s= NULL;
 
        for(dir=global_font_dir.first; dir; dir= dir->next) {
index 316bc2d..0079ecb 100644 (file)
@@ -91,7 +91,7 @@ void end_render_materials(struct Main *);
 
 int material_in_material(struct Material *parmat, struct Material *mat);
 
-void ramp_blend(int type, float r_col[3], const float fac, const float col[3]);
+void   ramp_blend(int type, float r_col[3], const float fac, const float col[3]);
 
 /* copy/paste */
 void clear_matcopybuf(void);
index 0e8d598..a864461 100644 (file)
@@ -451,7 +451,7 @@ int blender_test_break(void)
 #define MAXUNDONAME    64
 typedef struct UndoElem {
        struct UndoElem *next, *prev;
-       char str[FILE_MAXDIR+FILE_MAXFILE];
+       char str[FILE_MAX];
        char name[MAXUNDONAME];
        MemFile memfile;
        uintptr_t undosize;
@@ -536,7 +536,7 @@ void BKE_write_undo(bContext *C, const char *name)
        /* disk save version */
        if(UNDO_DISK) {
                static int counter= 0;
-               char filepath[FILE_MAXDIR+FILE_MAXFILE];
+               char filepath[FILE_MAX];
                char numstr[32];
                int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on undo */
 
@@ -702,7 +702,7 @@ void BKE_undo_save_quit(void)
        UndoElem *uel;
        MemFileChunk *chunk;
        int file;
-       char str[FILE_MAXDIR+FILE_MAXFILE];
+       char str[FILE_MAX];
        
        if( (U.uiflag & USER_GLOBALUNDO)==0) return;
        
index 12a2fe2..382e1d7 100644 (file)
@@ -895,7 +895,7 @@ void BKE_movieclip_update_scopes(MovieClip *clip, MovieClipUser *user, MovieClip
 
 static void movieclip_build_proxy_ibuf(MovieClip *clip, ImBuf *ibuf, int cfra, int proxy_render_size, int undistorted)
 {
-       char name[FILE_MAXFILE+FILE_MAXDIR];
+       char name[FILE_MAX];
        int quality, rectx, recty;
        int size= size= rendersize_to_number(proxy_render_size);
        ImBuf *scaleibuf;
index ea1dbec..7be8aef 100644 (file)
@@ -168,7 +168,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
 {
        PackedFile *pf = NULL;
        int file, filelen;
-       char name[FILE_MAXDIR+FILE_MAXFILE];
+       char name[FILE_MAX];
        void *data;
        
        /* render result has no filename and can be ignored
@@ -245,7 +245,7 @@ void packAll(Main *bmain, ReportList *reports)
 
 static char *find_new_name(char *name)
 {
-       char tempname[FILE_MAXDIR + FILE_MAXFILE];
+       char tempname[FILE_MAX];
        char *newname;
        size_t len;
        
@@ -268,8 +268,8 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
 {
        int file, number, remove_tmp = FALSE;
        int ret_value = RET_OK;
-       char name[FILE_MAXDIR + FILE_MAXFILE];
-       char tempname[FILE_MAXDIR + FILE_MAXFILE];
+       char name[FILE_MAX];
+       char tempname[FILE_MAX];
 /*     void *data; */
        
        if (guimode) {} //XXX  waitcursor(1);
@@ -337,7 +337,7 @@ int checkPackedFile(const char *filename, PackedFile *pf)
        struct stat st;
        int ret_val, i, len, file;
        char buf[4096];
-       char name[FILE_MAXDIR + FILE_MAXFILE];
+       char name[FILE_MAX];
        
        BLI_strncpy(name, filename, sizeof(name));
        BLI_path_abs(name, G.main->name);
@@ -394,8 +394,8 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na
        char *newname = NULL;
        const char *temp = NULL;
        
-       // char newabs[FILE_MAXDIR + FILE_MAXFILE];
-       // char newlocal[FILE_MAXDIR + FILE_MAXFILE];
+       // char newabs[FILE_MAX];
+       // char newlocal[FILE_MAX];
        
        if (pf != NULL) {
                switch (how) {
@@ -445,7 +445,7 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na
 
 int unpackVFont(ReportList *reports, VFont *vfont, int how)
 {
-       char localname[FILE_MAXDIR + FILE_MAXFILE], fi[FILE_MAXFILE];
+       char localname[FILE_MAX], fi[FILE_MAXFILE];
        char *newname;
        int ret_value = RET_ERROR;
        
index 2cf8903..5445c99 100644 (file)
@@ -1033,7 +1033,7 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
 */
 
 #define MAX_PTCACHE_PATH FILE_MAX
-#define MAX_PTCACHE_FILE ((FILE_MAXDIR+FILE_MAXFILE)*2)
+#define MAX_PTCACHE_FILE ((FILE_MAX)*2)
 
 static int ptcache_path(PTCacheID *pid, char *filename)
 {
@@ -1127,7 +1127,7 @@ static PTCacheFile *ptcache_file_open(PTCacheID *pid, int mode, int cfra)
 {
        PTCacheFile *pf;
        FILE *fp = NULL;
-       char filename[(FILE_MAXDIR+FILE_MAXFILE)*2];
+       char filename[(FILE_MAX)*2];
 
 #ifndef DURIAN_POINTCACHE_LIB_OK
        /* don't allow writing for linked objects */
index 880bdbf..2495555 100644 (file)
@@ -652,7 +652,7 @@ void calc_sequence(Scene *scene, Sequence *seq)
 /* note: caller should run calc_sequence(scene, seq) after */
 void reload_sequence_new_file(Scene *scene, Sequence * seq, int lock_range)
 {
-       char str[FILE_MAXDIR+FILE_MAXFILE];
+       char str[FILE_MAX];
        int prev_startdisp=0, prev_enddisp=0;
        /* note: dont rename the strip, will break animation curves */
 
@@ -1156,7 +1156,7 @@ static IMB_Proxy_Size seq_rendersize_to_proxysize(int size)
 
 static void seq_open_anim_file(Sequence * seq)
 {
-       char name[FILE_MAXDIR+FILE_MAXFILE];
+       char name[FILE_MAX];
        StripProxy * proxy;
 
        if(seq->anim != NULL) {
@@ -2057,7 +2057,7 @@ static ImBuf * seq_render_scene_strip_impl(
 static ImBuf * seq_render_strip(SeqRenderData context, Sequence * seq, float cfra)
 {
        ImBuf * ibuf = NULL;
-       char name[FILE_MAXDIR+FILE_MAXFILE];
+       char name[FILE_MAX];
        int use_preprocess = input_have_to_preprocess(context, seq, cfra);
        float nr = give_stripelem_index(seq, cfra);
        /* all effects are handled similarly with the exception of speed effect */
index 5735a95..28d6889 100644 (file)
@@ -237,12 +237,12 @@ int reopen_text(Text *text)
        int i, llen, len;
        unsigned char *buffer;
        TextLine *tmp;
-       char str[FILE_MAXDIR+FILE_MAXFILE];
+       char str[FILE_MAX];
        struct stat st;
 
        if (!text || !text->name) return 0;
        
-       BLI_strncpy(str, text->name, FILE_MAXDIR+FILE_MAXFILE);
+       BLI_strncpy(str, text->name, FILE_MAX);
        BLI_path_abs(str, G.main->name);
        
        fp= fopen(str, "r");
@@ -334,10 +334,10 @@ Text *add_text(const char *file, const char *relpath)
        unsigned char *buffer;
        TextLine *tmp;
        Text *ta;
-       char str[FILE_MAXDIR+FILE_MAXFILE];
+       char str[FILE_MAX];
        struct stat st;
 
-       BLI_strncpy(str, file, FILE_MAXDIR+FILE_MAXFILE);
+       BLI_strncpy(str, file, FILE_MAX);
        if (relpath) /* can be NULL (bg mode) */
                BLI_path_abs(str, relpath);
        
index 8261a01..e79d850 100644 (file)
@@ -426,8 +426,8 @@ void BLI_cleanup_file(const char *relabase, char *dir)
 void BLI_path_rel(char *file, const char *relfile)
 {
        char * lslash;
-       char temp[FILE_MAXDIR+FILE_MAXFILE];
-       char res[FILE_MAXDIR+FILE_MAXFILE];
+       char temp[FILE_MAX];
+       char res[FILE_MAX];
        
        /* if file is already relative, bail out */
        if(file[0]=='/' && file[1]=='/') return;
@@ -445,9 +445,9 @@ void BLI_path_rel(char *file, const char *relfile)
                if (relfile[0] != '\\' && relfile[0] != '/') {
                        ptemp++;
                }
-               BLI_strncpy(ptemp, relfile, FILE_MAXDIR + FILE_MAXFILE-3);
+               BLI_strncpy(ptemp, relfile, FILE_MAX-3);
        } else {
-               BLI_strncpy(temp, relfile, FILE_MAXDIR + FILE_MAXFILE);
+               BLI_strncpy(temp, relfile, FILE_MAX);
        }
 
        if (BLI_strnlen(file, 3) > 2) {
@@ -539,7 +539,7 @@ int BLI_has_parent(char *path)
 int BLI_parent_dir(char *path)
 {
        static char parent_dir[]= {'.', '.', SEP, '\0'}; /* "../" or "..\\" */
-       char tmp[FILE_MAXDIR+FILE_MAXFILE+4];
+       char tmp[FILE_MAX+4];
        BLI_strncpy(tmp, path, sizeof(tmp)-4);
        BLI_add_slash(tmp);
        strcat(tmp, parent_dir);
@@ -744,7 +744,7 @@ int BLI_path_cwd(char *path)
 #endif
        
        if (wasrelative==1) {
-               char cwd[FILE_MAXDIR + FILE_MAXFILE]= "";
+               char cwd[FILE_MAX]= "";
                BLI_current_working_dir(cwd, sizeof(cwd)); /* incase the full path to the blend isnt used */
                
                if (cwd[0] == '\0') {
@@ -757,8 +757,8 @@ int BLI_path_cwd(char *path)
                        * blend file which isnt a feature we want to use in this case since were dealing
                        * with a path from the command line, rather than from inside Blender */
                        
-                       char origpath[FILE_MAXDIR + FILE_MAXFILE];
-                       BLI_strncpy(origpath, path, FILE_MAXDIR + FILE_MAXFILE);
+                       char origpath[FILE_MAX];
+                       BLI_strncpy(origpath, path, FILE_MAX);
                        
                        BLI_make_file_string(NULL, path, cwd, origpath); 
                }
@@ -1256,7 +1256,7 @@ void BLI_make_exist(char *dir)
 
 void BLI_make_existing_file(const char *name)
 {
-       char di[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE];
+       char di[FILE_MAX], fi[FILE_MAXFILE];
 
        BLI_strncpy(di, name, sizeof(di));
        BLI_splitdirstring(di, fi);
@@ -1705,8 +1705,8 @@ static int add_win32_extension(char *name)
        type = BLI_exists(name);
        if ((type == 0) || S_ISDIR(type)) {
 #ifdef _WIN32
-               char filename[FILE_MAXDIR+FILE_MAXFILE];
-               char ext[FILE_MAXDIR+FILE_MAXFILE];
+               char filename[FILE_MAX];
+               char ext[FILE_MAX];
                const char *extensions = getenv("PATHEXT");
                if (extensions) {
                        char *temp;
@@ -1752,7 +1752,7 @@ static int add_win32_extension(char *name)
 */
 static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name)
 {
-       char filename[FILE_MAXDIR+FILE_MAXFILE];
+       char filename[FILE_MAX];
        const char *path = NULL, *temp;
 
 #ifdef _WIN32
index 86095e6..1ef254d 100644 (file)
@@ -442,18 +442,18 @@ int BLI_exists(const char *name)
        /*  in Windows stat doesn't recognize dir ending on a slash 
                To not break code where the ending slash is expected we
                don't mess with the argument name directly here - elubie */
-       char tmp[FILE_MAXDIR+FILE_MAXFILE];
+       char tmp[FILE_MAX];
        int len, res;
-       BLI_strncpy(tmp, name, FILE_MAXDIR+FILE_MAXFILE);
+       BLI_strncpy(tmp, name, FILE_MAX);
        len = strlen(tmp);
        if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0';
        res = _stat(tmp, &st);
        if (res == -1) return(0);
 #elif defined(__MINGW32__)
        struct _stati64 st;
-       char tmp[FILE_MAXDIR+FILE_MAXFILE];
+       char tmp[FILE_MAX];
        int len, res;
-       BLI_strncpy(tmp, name, FILE_MAXDIR+FILE_MAXFILE);
+       BLI_strncpy(tmp, name, FILE_MAX);
        len = strlen(tmp);
        if (len > 3 && ( tmp[len-1]=='\\' || tmp[len-1]=='/') ) tmp[len-1] = '\0';
        res = _stati64(tmp, &st);
index d3e989c..1b5bb60 100644 (file)
 #define WIN32_SKIP_HKEY_PROTECTION             // need to use HKEY
 #include "BLI_winstuff.h"
 
- /* FILE_MAXDIR + FILE_MAXFILE */
+ /* FILE_MAX */
 
 int BLI_getInstallationDir( char * str ) {
        char dir[FILE_MAXDIR];
        int a;
        
-       GetModuleFileName(NULL,str,FILE_MAXDIR+FILE_MAXFILE);
+       GetModuleFileName(NULL,str,FILE_MAX);
        BLI_split_dir_part(str, dir, sizeof(dir)); /* shouldn't be relative */
        a = strlen(dir);
        if(dir[a-1] == '\\') dir[a-1]=0;
index 61f0989..e698238 100644 (file)
@@ -500,7 +500,7 @@ static Main *blo_find_main(FileData *fd, ListBase *mainlist, const char *filepat
 {
        Main *m;
        Library *lib;
-       char name1[FILE_MAXDIR+FILE_MAXFILE];
+       char name1[FILE_MAX];
        
        BLI_strncpy(name1, filepath, sizeof(name1));
        cleanup_path(relabase, name1);
index 358a765..c7a5355 100644 (file)
@@ -59,7 +59,7 @@ typedef struct FileData {
        gzFile gzfiledes;
 
        // now only in use for library appending
-       char relabase[FILE_MAXDIR+FILE_MAXFILE];
+       char relabase[FILE_MAX];
        
        // variables needed for reading from stream
        char headerdone;
index c5e5995..ad5eda0 100644 (file)
@@ -2697,7 +2697,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil
 /* return: success(0), failure(1) */
 static int do_history(const char *name, ReportList *reports)
 {
-       char tempname1[FILE_MAXDIR+FILE_MAXFILE], tempname2[FILE_MAXDIR+FILE_MAXFILE];
+       char tempname1[FILE_MAX], tempname2[FILE_MAX];
        int hisnr= U.versions;
        
        if(U.versions==0) return 0;
@@ -2731,8 +2731,8 @@ static int do_history(const char *name, ReportList *reports)
 /* return: success (1) */
 int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportList *reports, int *thumb)
 {
-       char userfilename[FILE_MAXDIR+FILE_MAXFILE];
-       char tempname[FILE_MAXDIR+FILE_MAXFILE+1];
+       char userfilename[FILE_MAX];
+       char tempname[FILE_MAX+1];
        int file, err, write_user_block;
 
        /* open temporary file, so we preserve the original in case we crash */
@@ -2746,8 +2746,8 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
 
        /* remapping of relative paths to new file location */
        if(write_flags & G_FILE_RELATIVE_REMAP) {
-               char dir1[FILE_MAXDIR+FILE_MAXFILE];
-               char dir2[FILE_MAXDIR+FILE_MAXFILE];
+               char dir1[FILE_MAX];
+               char dir2[FILE_MAX];
                BLI_split_dir_part(filepath, dir1, sizeof(dir1));
                BLI_split_dir_part(mainvar->name, dir2, sizeof(dir2));
 
@@ -2798,7 +2798,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
 
        if(write_flags & G_FILE_COMPRESS) {
                /* compressed files have the same ending as regular files... only from 2.4!!! */
-               char gzname[FILE_MAXDIR+FILE_MAXFILE+4];
+               char gzname[FILE_MAX+4];
                int ret;
 
                /* first write compressed to separate @.gz */
index 86961cd..a10de9a 100644 (file)
@@ -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;
 }
 
index a0b0d34..cd3243b 100644 (file)
@@ -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;
index 1b7308d..a7d8c68 100644 (file)
@@ -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");
index 9dd4503..cc60f4a 100644 (file)
@@ -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];
index a68286b..3a2d9f1 100644 (file)
@@ -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;
index 48970df..7d0ec86 100644 (file)
@@ -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);
index 4867552..c713317 100644 (file)
@@ -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);
 }
index deed7ad..288ff76 100644 (file)
@@ -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;
index 6b3477d..9a952d2 100644 (file)
@@ -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);
                }
                
index ddfa2fd..2b59a02 100644 (file)
@@ -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];
 
index e36cdd3..16ee32d 100644 (file)
@@ -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;
index 7dae02a..5dfb9cf 100644 (file)
@@ -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)
index fef4286..1a1022a 100644 (file)
@@ -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);
index 9ce587a..62608cb 100644 (file)
@@ -72,8 +72,8 @@ struct anim_index_builder;
 
 typedef struct anim_index_builder {
        FILE * fp;
-       char name[FILE_MAXDIR + FILE_MAXFILE];
-       char temp_name[FILE_MAXDIR + FILE_MAXFILE];
+       char name[FILE_MAX];
+       char temp_name[FILE_MAX];
 
        void * private_data;
 
index 9993df6..4088cf8 100644 (file)
@@ -457,7 +457,7 @@ static struct proxy_output_ctx * alloc_proxy_output_ffmpeg(
        struct proxy_output_ctx * rv = MEM_callocN(
                sizeof(struct proxy_output_ctx), "alloc_proxy_output");
        
-       char fname[FILE_MAXDIR+FILE_MAXFILE];
+       char fname[FILE_MAX];
 
        // JPEG requires this
        width = round_up(width, 8);
@@ -626,8 +626,8 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx,
                                     int rollback)
 {
        int i;
-       char fname[FILE_MAXDIR+FILE_MAXFILE];
-       char fname_tmp[FILE_MAXDIR+FILE_MAXFILE];
+       char fname[FILE_MAX];
+       char fname_tmp[FILE_MAX];
 
        if (!ctx) {
                return;
@@ -782,7 +782,7 @@ static int index_rebuild_ffmpeg(struct anim * anim,
 
        for (i = 0; i < num_indexers; i++) {
                if (tcs_in_use & tc_types[i]) {
-                       char fname[FILE_MAXDIR+FILE_MAXFILE];
+                       char fname[FILE_MAX];
 
                        get_tc_filename(anim, tc_types[i], fname);
 
@@ -941,8 +941,8 @@ static void index_rebuild_fallback(struct anim * anim,
        int cnt = IMB_anim_get_duration(anim, IMB_TC_NONE);
        int i, pos;
        AviMovie * proxy_ctx[IMB_PROXY_MAX_SLOT];
-       char fname[FILE_MAXDIR+FILE_MAXFILE];
-       char fname_tmp[FILE_MAXDIR+FILE_MAXFILE];
+       char fname[FILE_MAX];
+       char fname_tmp[FILE_MAX];
        
        memset(proxy_ctx, 0, sizeof(proxy_ctx));
 
@@ -957,7 +957,7 @@ static void index_rebuild_fallback(struct anim * anim,
 
        for (i = 0; i < IMB_PROXY_MAX_SLOT; i++) {
                if (proxy_sizes_in_use & proxy_sizes[i]) {
-                       char fname[FILE_MAXDIR+FILE_MAXFILE];
+                       char fname[FILE_MAX];
 
                        get_proxy_filename(anim, proxy_sizes[i], fname, TRUE);
                        BLI_make_existing_file(fname);
@@ -1086,7 +1086,7 @@ void IMB_anim_set_index_dir(struct anim * anim, const char * dir)
 struct anim * IMB_anim_open_proxy(
        struct anim * anim, IMB_Proxy_Size preview_size)
 {
-       char fname[FILE_MAXDIR+FILE_MAXFILE];
+       char fname[FILE_MAX];
        int i = IMB_proxy_size_to_array_index(preview_size);
 
        if (anim->proxy_anim[i]) {
@@ -1109,7 +1109,7 @@ struct anim * IMB_anim_open_proxy(
 struct anim_index * IMB_anim_open_index(
        struct anim * anim, IMB_Timecode_Type tc)
 {
-       char fname[FILE_MAXDIR+FILE_MAXFILE];
+       char fname[FILE_MAX];
        int i = IMB_timecode_to_array_index(tc);
 
        if (anim->curr_idx[i]) {
index ebd51d1..6489342 100644 (file)
@@ -148,9 +148,9 @@ static char **types, *typedata;             /* at address types[a] is string a */
 static short *typelens;                                /* at typelens[a] is de length of type a */
 static short *alphalens;                       /* contains sizes as they are calculated on the DEC Alpha (64 bits), infact any 64bit system */
 static short **structs, *structdata;/* at sp= structs[a] is the first address of a struct definition
-                                                                      sp[0] is type number
-                                                                  sp[1] is amount of elements
-                                                                  sp[2] sp[3] is typenr,  namenr (etc) */
+                                       sp[0] is type number
+                                       sp[1] is amount of elements
+                                       sp[2] sp[3] is typenr,  namenr (etc) */
 /**
  * Variable to control debug output of makesdna.
  * debugSDNA:
index 91aa9da..b28adea 100644 (file)
@@ -103,7 +103,7 @@ static void rna_Image_save(Image *image, ReportList *reports)
 {
        ImBuf *ibuf= BKE_image_get_ibuf(image, NULL);
        if(ibuf) {
-               char filename[FILE_MAXDIR + FILE_MAXFILE];
+               char filename[FILE_MAX];
                BLI_strncpy(filename, image->name, sizeof(filename));
                BLI_path_abs(filename, G.main->name);
 
index f568f6d..1809a53 100644 (file)
@@ -1329,7 +1329,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
        func= RNA_def_function(srna, "load", "rna_Main_texts_load");
        RNA_def_function_flag(func, FUNC_USE_REPORTS);
        RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
-       parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock");
+       parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        /* return type */
        parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock");
@@ -1515,7 +1515,7 @@ void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
        func= RNA_def_function(srna, "load", "rna_Main_movieclip_load");
        RNA_def_function_flag(func, FUNC_USE_REPORTS);
        RNA_def_function_ui_description(func, "Add a new movie clip to the main database from a file");
-       parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock");
+       parm= RNA_def_string_file_path(func, "filepath", "Path", FILE_MAX, "", "path for the datablock");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        /* return type */
        parm= RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip datablock");
index 269860e..eb35120 100644 (file)
@@ -702,7 +702,7 @@ static void rna_def_trackingStabilization(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Scale Influence", "Influence of stabilization algorithm on footage scale");
        RNA_def_property_update(prop, NC_MOVIECLIP|ND_DISPLAY, "rna_tracking_flushUpdate");
 
-       /* use_stabilize_rotation */
+       /* use_stabilize_rotation */
        prop= RNA_def_property(srna, "use_stabilize_rotation", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", TRACKING_STABILIZE_ROTATION);
        RNA_def_property_ui_text(prop, "Stabilize Rotation", "Stabilize horizon line on the shot");
index 7222265..8696bd1 100644 (file)
@@ -447,7 +447,7 @@ static DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, Fluidsim
 {
        int displaymode = 0;
        int curFrame = framenr - 1 /*scene->r.sfra*/; /* start with 0 at start frame */
-       char targetFile[FILE_MAXFILE+FILE_MAXDIR];
+       char targetFile[FILE_MAX];
        FluidsimSettings *fss = fluidmd->fss;
        DerivedMesh *dm = NULL;
        MFace *mface;
index 7dee2ce..b7ead49 100644 (file)
@@ -200,7 +200,7 @@ void BPY_python_start(int argc, const char **argv)
        PyThreadState *py_tstate= NULL;
 
        /* not essential but nice to set our name */
-       static wchar_t program_path_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */
+       static wchar_t program_path_wchar[FILE_MAX]; /* python holds a reference */
        BLI_strncpy_wchar_from_utf8(program_path_wchar, BLI_program_path(), sizeof(program_path_wchar) / sizeof(wchar_t));
        Py_SetProgramName(program_path_wchar);
 
index 1a7031c..1df7f32 100644 (file)
@@ -464,7 +464,7 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
 int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory)
 {
        ListBase wmbase;
-       char tstr[FILE_MAXDIR+FILE_MAXFILE];
+       char tstr[FILE_MAX];
        int success= 0;
        
        free_ttfont(); /* still weird... what does it here? */
@@ -597,7 +597,7 @@ void WM_read_history(void)
 static void write_history(void)
 {
        struct RecentFile *recent, *next_recent;
-       char name[FILE_MAXDIR+FILE_MAXFILE];
+       char name[FILE_MAX];
        char *user_config_dir;
        FILE *fp;
        int i;
@@ -810,7 +810,7 @@ int WM_write_homefile(bContext *C, wmOperator *op)
 {
        wmWindowManager *wm= CTX_wm_manager(C);
        wmWindow *win= CTX_wm_window(C);
-       char filepath[FILE_MAXDIR+FILE_MAXFILE];
+       char filepath[FILE_MAX];
        int fileflags;
 
        /* check current window and close it if temp */
@@ -922,7 +922,7 @@ void wm_autosave_delete(void)
        wm_autosave_location(filename);
 
        if(BLI_exists(filename)) {
-               char str[FILE_MAXDIR+FILE_MAXFILE];
+               char str[FILE_MAX];
                BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend");
 
                /* if global undo; remove tempsave, otherwise rename */
index 67deb59..094277a 100644 (file)
@@ -863,7 +863,7 @@ static int run_python(int argc, const char **argv, void *data)
        /* workaround for scripts not getting a bpy.context.scene, causes internal errors elsewhere */
        if (argc > 1) {
                /* Make the path absolute because its needed for relative linked blends to be found */
-               char filename[FILE_MAXDIR + FILE_MAXFILE];
+               char filename[FILE_MAX];
                BLI_strncpy(filename, argv[1], sizeof(filename));
                BLI_path_cwd(filename);
 
@@ -924,7 +924,7 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
        bContext *C = data;
 
        /* Make the path absolute because its needed for relative linked blends to be found */
-       char filename[FILE_MAXDIR + FILE_MAXFILE];
+       char filename[FILE_MAX];
        BLI_strncpy(filename, argv[0], sizeof(filename));
        BLI_path_cwd(filename);
 
index d6fb05f..e84df92 100644 (file)
@@ -270,12 +270,12 @@ static void get_filename(int argc, char **argv, char *filename)
 
        if (argc > 1) {
                if (BLI_exists(argv[argc-1])) {
-                       BLI_strncpy(filename, argv[argc-1], FILE_MAXDIR + FILE_MAXFILE);
+                       BLI_strncpy(filename, argv[argc-1], FILE_MAX);
                }
                if (::strncmp(argv[argc-1], "-psn_", 5)==0) {
                        static char firstfilebuf[512];
                        if (GHOST_HACK_getFirstFile(firstfilebuf)) {
-                               BLI_strncpy(filename, firstfilebuf, FILE_MAXDIR + FILE_MAXFILE);
+                               BLI_strncpy(filename, firstfilebuf, FILE_MAX);
                        }
                }                        
        }
@@ -289,7 +289,7 @@ static void get_filename(int argc, char **argv, char *filename)
                //::printf("looking for file: %s\n", filename);
                
                if (BLI_exists(gamefile))
-                       BLI_strncpy(filename, gamefile, FILE_MAXDIR + FILE_MAXFILE);
+                       BLI_strncpy(filename, gamefile, FILE_MAX);
 
                delete [] gamefile;
        }
@@ -298,7 +298,7 @@ static void get_filename(int argc, char **argv, char *filename)
        filename[0] = '\0';
 
        if(argc > 1)
-               BLI_strncpy(filename, argv[argc-1], FILE_MAXDIR + FILE_MAXFILE);
+               BLI_strncpy(filename, argv[argc-1], FILE_MAX);
 #endif // !_APPLE
 }
 
@@ -737,8 +737,8 @@ int main(int argc, char** argv)
                                STR_String exitstring = "";
                                GPG_Application app(system);
                                bool firstTimeRunning = true;
-                               char filename[FILE_MAXDIR + FILE_MAXFILE];
-                               char pathname[FILE_MAXDIR + FILE_MAXFILE];
+                               char filename[FILE_MAX];
+                               char pathname[FILE_MAX];
                                char *titlename;
 
                                get_filename(argc_py_clamped, argv, filename);
index 02e6ebe..d9822d1 100644 (file)
@@ -147,8 +147,8 @@ extern "C" {
 #ifdef WITH_PYTHON
 
 static RAS_ICanvas* gp_Canvas = NULL;
-static char gp_GamePythonPath[FILE_MAXDIR + FILE_MAXFILE] = "";
-static char gp_GamePythonPathOrig[FILE_MAXDIR + FILE_MAXFILE] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
+static char gp_GamePythonPath[FILE_MAX] = "";
+static char gp_GamePythonPathOrig[FILE_MAX] = ""; // not super happy about this, but we need to remember the first loaded file for the global/dict load save
 
 static SCA_PythonKeyboard* gp_PythonKeyboard = NULL;
 static SCA_PythonMouse* gp_PythonMouse = NULL;
@@ -237,13 +237,13 @@ The function also converts the directory separator to the local file system form
 
 static PyObject* gPyExpandPath(PyObject*, PyObject* args)
 {
-       char expanded[FILE_MAXDIR + FILE_MAXFILE];
+       char expanded[FILE_MAX];
        char* filename;
        
        if (!PyArg_ParseTuple(args,"s:ExpandPath",&filename))
                return NULL;
 
-       BLI_strncpy(expanded, filename, FILE_MAXDIR + FILE_MAXFILE);
+       BLI_strncpy(expanded, filename, FILE_MAX);
        BLI_path_abs(expanded, gp_GamePythonPath);
        return PyUnicode_DecodeFSDefault(expanded);
 }
@@ -496,7 +496,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
        list = PyList_New(0);
        
        if (searchpath) {
-               BLI_strncpy(cpath, searchpath, FILE_MAXDIR + FILE_MAXFILE);
+               BLI_strncpy(cpath, searchpath, FILE_MAX);
                BLI_path_abs(cpath, gp_GamePythonPath);
        } else {
                /* Get the dir only */
@@ -1728,7 +1728,7 @@ static void backupPySysObjects(void)
 static void initPySysObjects__append(PyObject *sys_path, const char *filename)
 {
        PyObject *item;
-       char expanded[FILE_MAXDIR + FILE_MAXFILE];
+       char expanded[FILE_MAX];
        
        BLI_split_dir_part(filename, expanded, sizeof(expanded)); /* get the dir part of filename only */
        BLI_path_abs(expanded, gp_GamePythonPath); /* filename from lib->filename is (always?) absolute, so this may not be needed but it wont hurt */