[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43409] trunk/blender/source/blender: use FILE_MAX instead of 240 or comment where define cant be used.

Campbell Barton ideasman42 at gmail.com
Mon Jan 16 06:52:46 CET 2012


Revision: 43409
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43409
Author:   campbellbarton
Date:     2012-01-16 05:52:33 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
use FILE_MAX instead of 240 or comment where define cant be used.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/BKE_main.h
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/interface/interface_ops.c
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/makesdna/DNA_brush_types.h
    trunk/blender/source/blender/makesdna/DNA_dynamicpaint_types.h
    trunk/blender/source/blender/makesdna/DNA_image_types.h
    trunk/blender/source/blender/makesdna/DNA_movieclip_types.h
    trunk/blender/source/blender/makesdna/DNA_object_force.h
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/makesdna/DNA_sound_types.h
    trunk/blender/source/blender/makesdna/DNA_texture_types.h
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/makesrna/intern/rna_fluidsim.c
    trunk/blender/source/blender/makesrna/intern/rna_main.c
    trunk/blender/source/blender/windowmanager/intern/wm_dragdrop.c

Modified: trunk/blender/source/blender/blenkernel/BKE_main.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_main.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/blenkernel/BKE_main.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -50,7 +50,7 @@
 
 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 */

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-01-16 05:52:33 UTC (rev 43409)
@@ -14437,7 +14437,7 @@
 					/* 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);

Modified: trunk/blender/source/blender/editors/interface/interface_ops.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_ops.c	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/editors/interface/interface_ops.c	2012-01-16 05:52:33 UTC (rev 43409)
@@ -494,7 +494,7 @@
 } uiEditSourceStore;
 
 struct uiEditSourceButStore {
-	char py_dbg_fn[240];
+	char py_dbg_fn[FILE_MAX];
 	int py_dbg_ln;
 } uiEditSourceButStore;
 
@@ -584,7 +584,7 @@
 /* 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;

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c	2012-01-16 05:52:33 UTC (rev 43409)
@@ -858,8 +858,10 @@
 		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);
 	

Modified: trunk/blender/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_brush_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_brush_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -59,7 +59,7 @@
 
 	struct ImBuf *icon_imbuf;
 	PreviewImage *preview;
-	char icon_filepath[240];
+	char icon_filepath[240]; /* 240 = FILE_MAX */
 
 	float normal_weight;
 

Modified: trunk/blender/source/blender/makesdna/DNA_dynamicpaint_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_dynamicpaint_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_dynamicpaint_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -125,7 +125,7 @@
 	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 */
 

Modified: trunk/blender/source/blender/makesdna/DNA_image_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_image_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_image_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -69,7 +69,7 @@
 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 */

Modified: trunk/blender/source/blender/makesdna/DNA_movieclip_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_movieclip_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_movieclip_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -64,7 +64,7 @@
 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 */

Modified: trunk/blender/source/blender/makesdna/DNA_object_force.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_object_force.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_object_force.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -195,7 +195,7 @@
 	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;

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -471,7 +471,7 @@
 	float bake_maxdist, bake_biasdist, bake_pad;
 
 	/* path to render output */
-	char pic[240];
+	char pic[240]; /* 240 = FILE_MAX */
 
 	/* stamps flags. */
 	int stamp;

Modified: trunk/blender/source/blender/makesdna/DNA_sound_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_sound_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_sound_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -49,7 +49,7 @@
 	/**
 	 * The path to the sound file.
 	 */
-	char name[240];
+	char name[240];  /* 240 = FILE_MAX */
 
 	/**
 	 * The packed file.

Modified: trunk/blender/source/blender/makesdna/DNA_texture_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_texture_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_texture_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -200,7 +200,7 @@
 	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;

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h	2012-01-16 05:52:33 UTC (rev 43409)
@@ -318,16 +318,16 @@
 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 */

Modified: trunk/blender/source/blender/makesrna/intern/rna_fluidsim.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_fluidsim.c	2012-01-16 05:27:11 UTC (rev 43408)
+++ trunk/blender/source/blender/makesrna/intern/rna_fluidsim.c	2012-01-16 05:52:33 UTC (rev 43409)
@@ -304,7 +304,7 @@
 	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 @@
 	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 @@
 	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);

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list