[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52818] branches/soc-2008-mxcurioni/source /blender: Fix for a number of compiler warnings as well as a bug hidden by the warnings .

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Sat Dec 8 23:24:43 CET 2012


Revision: 52818
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52818
Author:   kjym3
Date:     2012-12-08 22:24:41 +0000 (Sat, 08 Dec 2012)
Log Message:
-----------
Fix for a number of compiler warnings as well as a bug hidden by the warnings.
Patch contribution by Bastien Montagne, thanks!

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_linestyle.h
    branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c
    branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
    branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c
    branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_channels_defines.c
    branches/soc-2008-mxcurioni/source/blender/editors/render/render_shading.c
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/FitCurve.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/Grid.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/Noise.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BPy_Id.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Director.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVec3f.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/scene_graph/NodeCamera.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/AdvancedStrokeShaders.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/Operators.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/stroke/StrokeRep.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/system/PseudoNoise.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMap.cpp
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewMapIO.cpp
    branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c

Modified: branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_linestyle.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_linestyle.h	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/blenkernel/BKE_linestyle.h	2012-12-08 22:24:41 UTC (rev 52818)
@@ -42,7 +42,7 @@
 struct Main;
 struct Object;
 
-FreestyleLineStyle *FRS_new_linestyle(char *name, struct Main *main);
+FreestyleLineStyle *FRS_new_linestyle(const char *name, struct Main *main);
 void FRS_free_linestyle(FreestyleLineStyle *linestyle);
 FreestyleLineStyle *FRS_copy_linestyle(FreestyleLineStyle *linestyle);
 

Modified: branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/blenkernel/intern/linestyle.c	2012-12-08 22:24:41 UTC (rev 52818)
@@ -48,7 +48,7 @@
 
 #include "BLI_blenlib.h"
 
-static char *modifier_name[LS_MODIFIER_NUM] = {
+static const char *modifier_name[LS_MODIFIER_NUM] = {
 	NULL,
 	"Along Stroke",
 	"Distance from Camera",
@@ -95,7 +95,7 @@
 	linestyle->caps = LS_CAPS_BUTT;
 }
 
-FreestyleLineStyle *FRS_new_linestyle(char *name, struct Main *main)
+FreestyleLineStyle *FRS_new_linestyle(const char *name, struct Main *main)
 {
 	FreestyleLineStyle *linestyle;
 

Modified: branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/blenloader/intern/readfile.c	2012-12-08 22:24:41 UTC (rev 52818)
@@ -6550,7 +6550,7 @@
 	}
 }
 
-static void direct_link_linestyle_geometry_modifier(FileData *fd, LineStyleModifier *modifier)
+static void direct_link_linestyle_geometry_modifier(FileData *UNUSED(fd), LineStyleModifier *UNUSED(modifier))
 {
 }
 

Modified: branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/blenloader/intern/writefile.c	2012-12-08 22:24:41 UTC (rev 52818)
@@ -2876,7 +2876,7 @@
 static void write_linestyle_color_modifiers(WriteData *wd, ListBase *modifiers)
 {
 	LineStyleModifier *m;
-	char *struct_name;
+	const char *struct_name;
 
 	for (m = modifiers->first; m; m = m->next) {
 		switch (m->type) {
@@ -2918,7 +2918,7 @@
 static void write_linestyle_alpha_modifiers(WriteData *wd, ListBase *modifiers)
 {
 	LineStyleModifier *m;
-	char *struct_name;
+	const char *struct_name;
 
 	for (m = modifiers->first; m; m = m->next) {
 		switch (m->type) {
@@ -2960,7 +2960,7 @@
 static void write_linestyle_thickness_modifiers(WriteData *wd, ListBase *modifiers)
 {
 	LineStyleModifier *m;
-	char *struct_name;
+	const char *struct_name;
 
 	for (m = modifiers->first; m; m = m->next) {
 		switch (m->type) {
@@ -3005,7 +3005,7 @@
 static void write_linestyle_geometry_modifiers(WriteData *wd, ListBase *modifiers)
 {
 	LineStyleModifier *m;
-	char *struct_name;
+	const char *struct_name;
 
 	for (m = modifiers->first; m; m = m->next) {
 		switch (m->type) {

Modified: branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_channels_defines.c	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/editors/animation/anim_channels_defines.c	2012-12-08 22:24:41 UTC (rev 52818)
@@ -2014,13 +2014,13 @@
 /* LineStyle Expander  ------------------------------------------- */
 
 // TODO: just get this from RNA?
-static int acf_dslinestyle_icon(bAnimListElem *ale)
+static int acf_dslinestyle_icon(bAnimListElem *UNUSED(ale))
 {
 	return ICON_BRUSH_DATA; /* FIXME */
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dslinestyle_setting_flag(bAnimContext *ac, int setting, short *neg)
+static int acf_dslinestyle_setting_flag(bAnimContext *UNUSED(ac), int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;

Modified: branches/soc-2008-mxcurioni/source/blender/editors/render/render_shading.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/editors/render/render_shading.c	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/editors/render/render_shading.c	2012-12-08 22:24:41 UTC (rev 52818)
@@ -703,7 +703,7 @@
 	return FRS_get_active_lineset(&srl->freestyleConfig) != NULL;
 }
 
-static int freestyle_lineset_copy_exec(bContext *C, wmOperator *op)
+static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Scene *scene= CTX_data_scene(C);
 	SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
@@ -730,7 +730,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
-static int freestyle_lineset_paste_exec(bContext *C, wmOperator *op)
+static int freestyle_lineset_paste_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	Scene *scene= CTX_data_scene(C);
 	SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp	2012-12-08 22:24:41 UTC (rev 52818)
@@ -630,7 +630,7 @@
 				cleanVertices[detri.viP+2] += 1e-5 * detri.v.z();
 			}
 		}
-		printf("Warning: Object %s contains %d degenerate triangle%s (strokes may be incorrect)\n",
+		printf("Warning: Object %s contains %lu degenerated triangle%s (strokes may be incorrect)\n",
 			name, detriList.size(), (detriList.size() > 1) ? "s" : "");
 	}
 

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp	2012-12-08 22:24:41 UTC (rev 52818)
@@ -56,8 +56,8 @@
 	freestyle_scene->r.ysch= re->recty; // old_scene->r.ysch
 	freestyle_scene->r.xasp= 1.f; // old_scene->r.xasp;
 	freestyle_scene->r.yasp= 1.f; // old_scene->r.yasp;
-	freestyle_scene->r.xparts= old_scene->r.xparts;
-	freestyle_scene->r.yparts= old_scene->r.yparts;
+	freestyle_scene->r.tilex= old_scene->r.tilex;
+	freestyle_scene->r.tiley= old_scene->r.tiley;
 	freestyle_scene->r.size= 100; // old_scene->r.size
 	freestyle_scene->r.maximsize= old_scene->r.maximsize;
 	freestyle_scene->r.ocres = old_scene->r.ocres;

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/FitCurve.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/FitCurve.cpp	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/FitCurve.cpp	2012-12-08 22:24:41 UTC (rev 52818)
@@ -55,17 +55,17 @@
 #define MAXPOINTS	1000		/* The most points you can have */
 
 /* returns squared length of input vector */	
-double V2SquaredLength(Vector2 *a) 
+static double V2SquaredLength(Vector2 *a) 
 {	return(((*a)[0] * (*a)[0])+((*a)[1] * (*a)[1]));
 }
 	
 /* returns length of input vector */
-double V2Length(Vector2 *a) 
+static double V2Length(Vector2 *a) 
 {
 	return(sqrt(V2SquaredLength(a)));
 }
 
-Vector2 *V2Scale(Vector2 *v, double newlen) 
+static Vector2 *V2Scale(Vector2 *v, double newlen) 
 {
   double len = V2Length(v);
 	if (len != 0.0) { (*v)[0] *= newlen/len;   (*v)[1] *= newlen/len; }
@@ -73,13 +73,13 @@
 }
 
 /* return the dot product of vectors a and b */
-double V2Dot(Vector2 *a, Vector2 *b) 
+static double V2Dot(Vector2 *a, Vector2 *b) 
 {
 	return(((*a)[0]*(*b)[0])+((*a)[1]*(*b)[1]));
 }
 
 /* return the distance between two points */
-double V2DistanceBetween2Points(Vector2 *a, Vector2 *b)
+static double V2DistanceBetween2Points(Vector2 *a, Vector2 *b)
 {
 double dx = (*a)[0] - (*b)[0];
 double dy = (*a)[1] - (*b)[1];
@@ -87,14 +87,14 @@
 }
 
 /* return vector sum c = a+b */
-Vector2 *V2Add(Vector2 *a, Vector2 *b, Vector2 *c)
+static Vector2 *V2Add(Vector2 *a, Vector2 *b, Vector2 *c)
 {
 	(*c)[0] = (*a)[0]+(*b)[0];  (*c)[1] = (*a)[1]+(*b)[1];
 	return(c);
 } 
 
 /* normalizes the input vector and returns it */
-Vector2 *V2Normalize(Vector2 *v) 
+static Vector2 *V2Normalize(Vector2 *v) 
 {
 double len = V2Length(v);
 	if (len != 0.0) { (*v)[0] /= len;  (*v)[1] /= len; }
@@ -102,7 +102,7 @@
 }
 
 /* negates the input vector and returns it */
-Vector2 *V2Negate(Vector2 *v) 
+static Vector2 *V2Negate(Vector2 *v) 
 {
 	(*v)[0] = -(*v)[0];  (*v)[1] = -(*v)[1];
 	return(v);

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/Grid.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/Grid.cpp	2012-12-08 13:15:04 UTC (rev 52817)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/Grid.cpp	2012-12-08 22:24:41 UTC (rev 52818)
@@ -30,7 +30,7 @@
     occluders_.push_back(occ);
 }
 
-bool inBox(const Vec3r& inter, const Vec3r& box_min, const Vec3r& box_max){
+static bool inBox(const Vec3r& inter, const Vec3r& box_min, const Vec3r& box_max){
     if(((inter.x()>=box_min.x()) && (inter.x() <box_max.x()))
         && ((inter.y()>=box_min.y()) && (inter.y() <box_max.y()))
         && ((inter.z()>=box_min.z()) && (inter.z() <box_max.z()))

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/geometry/Noise.cpp

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list