From ea467d32283c6242d731be8da0ace1e5468e00ff Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Jan 2012 05:52:33 +0000 Subject: use FILE_MAX instead of 240 or comment where define cant be used. --- source/blender/blenkernel/BKE_main.h | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/interface/interface_ops.c | 4 ++-- source/blender/editors/space_image/image_ops.c | 4 +++- source/blender/makesdna/DNA_brush_types.h | 2 +- source/blender/makesdna/DNA_dynamicpaint_types.h | 2 +- source/blender/makesdna/DNA_image_types.h | 2 +- source/blender/makesdna/DNA_movieclip_types.h | 2 +- source/blender/makesdna/DNA_object_force.h | 2 +- source/blender/makesdna/DNA_scene_types.h | 2 +- source/blender/makesdna/DNA_sound_types.h | 2 +- source/blender/makesdna/DNA_texture_types.h | 2 +- source/blender/makesdna/DNA_userdef_types.h | 8 ++++---- source/blender/makesrna/intern/rna_fluidsim.c | 6 +++--- source/blender/makesrna/intern/rna_main.c | 4 +++- source/blender/windowmanager/intern/wm_dragdrop.c | 2 +- 16 files changed, 26 insertions(+), 22 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 28eb59ebdb6..51bcd18fab6 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -50,7 +50,7 @@ struct Library; typedef struct Main { struct Main *next, *prev; - char name[240]; + char name[240]; /* 240 = FILE_MAX */ short versionfile, subversionfile; short minversionfile, minsubversionfile; int revision; /* svn revision of binary that saved file */ diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6a54817e861..0c05655b8d7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -14437,7 +14437,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) /* allow typing in a new lib path */ if(G.rt==-666) { while(fd==NULL) { - char newlib_path[240] = { 0 }; + char newlib_path[FILE_MAX] = { 0 }; printf("Missing library...'\n"); printf(" current file: %s\n", G.main->name); printf(" absolute lib: %s\n", mainptr->curlib->filepath); diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index b50df29918d..40cf0213203 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -494,7 +494,7 @@ struct uiEditSourceStore { } uiEditSourceStore; struct uiEditSourceButStore { - char py_dbg_fn[240]; + char py_dbg_fn[FILE_MAX]; int py_dbg_ln; } uiEditSourceButStore; @@ -584,7 +584,7 @@ void UI_editsource_active_but_test(uiBut *but) /* editsource operator component */ static int editsource_text_edit(bContext *C, wmOperator *op, - char filepath[240], int line) + char filepath[FILE_MAX], int line) { struct Main *bmain= CTX_data_main(C); Text *text; diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 06674513868..e7a139fe465 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -858,7 +858,9 @@ static int image_replace_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; RNA_string_get(op->ptr, "filepath", str); - BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); /* we cant do much if the str is longer then 240 :/ */ + + /* we cant do much if the str is longer then FILE_MAX :/ */ + BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); /* XXX unpackImage frees image buffers */ ED_preview_kill_jobs(C); diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 6e7385d683d..f21c589d825 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -59,7 +59,7 @@ typedef struct Brush { struct ImBuf *icon_imbuf; PreviewImage *preview; - char icon_filepath[240]; + char icon_filepath[240]; /* 240 = FILE_MAX */ float normal_weight; diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h index cee8e5cd8d7..0bf4ffb76ee 100644 --- a/source/blender/makesdna/DNA_dynamicpaint_types.h +++ b/source/blender/makesdna/DNA_dynamicpaint_types.h @@ -125,7 +125,7 @@ typedef struct DynamicPaintSurface { int pad_; char uvlayer_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ - char image_output_path[240]; + char image_output_path[240]; /* 240 = FILE_MAX */ char output_name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ char output_name2[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ /* some surfaces have 2 outputs */ diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h index a1b0ab06ecd..110ac59edc9 100644 --- a/source/blender/makesdna/DNA_image_types.h +++ b/source/blender/makesdna/DNA_image_types.h @@ -69,7 +69,7 @@ typedef struct ImageUser { typedef struct Image { ID id; - char name[240]; /* file path */ + char name[240]; /* file path, 240 = FILE_MAX */ ListBase ibufs; /* not written in file */ struct GPUTexture *gputexture; /* not written in file */ diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h index 5d2f2f5978f..c08a5e95e92 100644 --- a/source/blender/makesdna/DNA_movieclip_types.h +++ b/source/blender/makesdna/DNA_movieclip_types.h @@ -64,7 +64,7 @@ typedef struct MovieClipProxy { typedef struct MovieClip { ID id; - char name[240]; /* file path */ + char name[240]; /* file path, 240 = FILE_MAX */ int source; /* sequence or movie */ int lastframe; /* last accessed frame number */ diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 28c28bbf329..41f79546b15 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -195,7 +195,7 @@ typedef struct PointCache { char name[64]; char prev_name[64]; char info[64]; - char path[240]; /* file path */ + char path[240]; /* file path, 240 = FILE_MAX */ char *cached_frames; /* array of length endframe-startframe+1 with flags to indicate cached frames */ /* can be later used for other per frame flags too if needed */ struct ListBase mem_cache; diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 684f2a54b81..2ac08d5e9f2 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -471,7 +471,7 @@ typedef struct RenderData { float bake_maxdist, bake_biasdist, bake_pad; /* path to render output */ - char pic[240]; + char pic[240]; /* 240 = FILE_MAX */ /* stamps flags. */ int stamp; diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index f530730a544..82185c811a1 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -49,7 +49,7 @@ typedef struct bSound { /** * The path to the sound file. */ - char name[240]; + char name[240]; /* 240 = FILE_MAX */ /** * The packed file. diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index e711124d39c..1cc84669e3b 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -200,7 +200,7 @@ typedef struct VoxelData { struct Object *object; /* for rendering smoke sims */ float int_multiplier; int still_frame; - char source_path[240]; + char source_path[240]; /* 240 = FILE_MAX */ /* temporary data */ float *dataset; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index fc418069c5c..2fa785e4156 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -318,16 +318,16 @@ typedef struct SolidLight { typedef struct UserDef { int flag, dupflag; int savetime; - char tempdir[160]; // FILE_MAXDIR length + char tempdir[160]; /* FILE_MAXDIR length */ char fontdir[160]; - char renderdir[240]; // FILE_MAX length + char renderdir[240]; /* FILE_MAX length */ char textudir[160]; char plugtexdir[160]; char plugseqdir[160]; char pythondir[160]; char sounddir[160]; - char image_editor[240]; // FILE_MAX length - char anim_player[240]; // FILE_MAX length + char image_editor[240]; /* 240 = FILE_MAX */ + char anim_player[240]; /* 240 = FILE_MAX */ int anim_player_preset; short v2d_min_gridsize; /* minimum spacing between gridlines in View2D grids */ diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 428f56b5130..f853e7b8dd9 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -304,7 +304,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_fluid_find_enframe"); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_maxlength(prop, 240); + RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in"); RNA_def_property_update(prop, 0, "rna_fluid_update"); @@ -381,7 +381,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0, 5); - RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation timesĀ !)"); + RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles into the surface generation - WARNING: can lead to longer computation times !)"); prop= RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0); @@ -554,7 +554,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Alpha Influence", "Amount of particle alpha change, inverse of size influence: 0=off (all same alpha), 1=full (large particles get lower alphas, smaller ones higher values)"); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_maxlength(prop, 240); + RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from"); RNA_def_property_update(prop, 0, "rna_fluid_update"); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index be03da6839d..dc1faa29be2 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -32,6 +32,8 @@ #include "rna_internal.h" +#include "BKE_utildefines.h" + #ifdef RNA_RUNTIME #include "BKE_main.h" @@ -323,7 +325,7 @@ void RNA_def_main(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_BLENDER); prop= RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_maxlength(prop, 240); + RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_funcs(prop, "rna_Main_filepath_get", "rna_Main_filepath_length", "rna_Main_filepath_set"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Filename", "Path to the .blend file"); diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c index 94f6eb19e2c..299266154dd 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.c +++ b/source/blender/windowmanager/intern/wm_dragdrop.c @@ -248,7 +248,7 @@ void wm_drags_check_ops(bContext *C, wmEvent *event) /* ************** draw ***************** */ -static void wm_drop_operator_draw(char *name, int x, int y) +static void wm_drop_operator_draw(const char *name, int x, int y) { int width= UI_GetStringWidth(name); -- cgit v1.2.3