[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44204] trunk/blender: patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes

Campbell Barton ideasman42 at gmail.com
Fri Feb 17 20:21:48 CET 2012


Revision: 44204
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44204
Author:   campbellbarton
Date:     2012-02-17 19:21:47 +0000 (Fri, 17 Feb 2012)
Log Message:
-----------
patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes

made some small edits
- removed changes to AVI reading since the data types are apart of the format spec.
- absf -> abs for a double value in render code.

Modified Paths:
--------------
    trunk/blender/build_files/cmake/Modules/FindOpenEXR.cmake
    trunk/blender/intern/audaspace/intern/AUD_ConverterFunctions.cpp
    trunk/blender/intern/audaspace/intern/AUD_JOSResampleReader.cpp
    trunk/blender/source/blender/blenkernel/BKE_image.h
    trunk/blender/source/blender/blenkernel/intern/pointcache.c
    trunk/blender/source/blender/blenlib/BLI_utildefines.h
    trunk/blender/source/blender/blenlib/intern/math_color_inline.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/editors/mesh/editmesh_lib.c
    trunk/blender/source/blender/python/intern/bpy_app.c
    trunk/blender/source/blender/render/intern/source/shadeoutput.c

Modified: trunk/blender/build_files/cmake/Modules/FindOpenEXR.cmake
===================================================================
--- trunk/blender/build_files/cmake/Modules/FindOpenEXR.cmake	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/build_files/cmake/Modules/FindOpenEXR.cmake	2012-02-17 19:21:47 UTC (rev 44204)
@@ -8,7 +8,7 @@
 #                    This can also be an environment variable.
 #  OPENEXR_FOUND, If false, do not try to use OpenEXR.
 #
-# For indervidual library access these advanced settings are available
+# For individual library access these advanced settings are available
 #  OPENEXR_HALF_LIBRARY, Path to Half library
 #  OPENEXR_IEX_LIBRARY, Path to Half library
 #  OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library

Modified: trunk/blender/intern/audaspace/intern/AUD_ConverterFunctions.cpp
===================================================================
--- trunk/blender/intern/audaspace/intern/AUD_ConverterFunctions.cpp	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/intern/audaspace/intern/AUD_ConverterFunctions.cpp	2012-02-17 19:21:47 UTC (rev 44204)
@@ -31,11 +31,11 @@
 #include "AUD_Buffer.h"
 
 #define AUD_U8_0		0x80
-#define AUD_S16_MAX		0x7FFF
-#define AUD_S16_MIN		0x8000
+#define AUD_S16_MAX		((int16_t)0x7FFF)
+#define AUD_S16_MIN		((int16_t)0x8000)
 #define AUD_S16_FLT		32767.0f
-#define AUD_S32_MAX		0x7FFFFFFF
-#define AUD_S32_MIN		0x80000000
+#define AUD_S32_MAX		((int32_t)0x7FFFFFFF)
+#define AUD_S32_MIN		((int32_t)0x80000000)
 #define AUD_S32_FLT		2147483647.0f
 #define AUD_FLT_MAX		1.0f
 #define AUD_FLT_MIN		-1.0f

Modified: trunk/blender/intern/audaspace/intern/AUD_JOSResampleReader.cpp
===================================================================
--- trunk/blender/intern/audaspace/intern/AUD_JOSResampleReader.cpp	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/intern/audaspace/intern/AUD_JOSResampleReader.cpp	2012-02-17 19:21:47 UTC (rev 44204)
@@ -200,7 +200,7 @@
 				left\
 			}\
 \
-			P = -P;\
+			P = 0 - P;\
 \
 			end = (int_to_fp(m_len) - P) / P_increment - 1;\
 			if(m_cache_valid - m_n - 2 < end)\

Modified: trunk/blender/source/blender/blenkernel/BKE_image.h
===================================================================
--- trunk/blender/source/blender/blenkernel/BKE_image.h	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/blenkernel/BKE_image.h	2012-02-17 19:21:47 UTC (rev 44204)
@@ -54,10 +54,10 @@
 int		BKE_write_ibuf_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
 int		BKE_write_ibuf(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
 int     BKE_write_ibuf_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy);
-void	BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, char imtype, const short use_ext, const short use_frames);
+void	BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames);
 int		BKE_add_image_extension(char *string, const char imtype);
 char	BKE_ftype_to_imtype(const int ftype);
-int		BKE_imtype_to_ftype(char imtype);
+int		BKE_imtype_to_ftype(const char imtype);
 
 int		BKE_imtype_is_movie(const char imtype);
 int		BKE_imtype_supports_zbuf(const char imtype);

Modified: trunk/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/pointcache.c	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/blenkernel/intern/pointcache.c	2012-02-17 19:21:47 UTC (rev 44204)
@@ -2285,7 +2285,7 @@
 	/* float offset; unused for now */
 	float time, nexttime;
 
-	/* TODO: this has to be sorter out once bsystem_time gets redone, */
+	/* TODO: this has to be sorted out once bsystem_time gets redone, */
 	/*       now caches can handle interpolating etc. too - jahka */
 
 	/* time handling for point cache:

Modified: trunk/blender/source/blender/blenlib/BLI_utildefines.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/blenlib/BLI_utildefines.h	2012-02-17 19:21:47 UTC (rev 44204)
@@ -225,10 +225,13 @@
 #define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
 
 /* Macro to convert a value to string in the preprocessor
- * STRINGIFY_ARG: gives the defined name in the string
- * STRINGIFY: gives the defined value. */
-#define STRINGIFY_ARG(x) #x
-#define STRINGIFY(x) STRINGIFY_ARG(x)
+ * STRINGIFY_ARG: gives the argument as a string
+ * STRINGIFY_APPEND: appends any argument 'b' onto the string argument 'a',
+ *   used by STRINGIFY because some preprocessors warn about zero arguments
+ * STRINGIFY: gives the argument's value as a string */
+#define STRINGIFY_ARG(x) "" #x
+#define STRINGIFY_APPEND(a, b) "" a #b
+#define STRINGIFY(x) STRINGIFY_APPEND("", x)
 
 /* useful for debugging */
 #define AT __FILE__ ":" STRINGIFY(__LINE__)

Modified: trunk/blender/source/blender/blenlib/intern/math_color_inline.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/math_color_inline.c	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/blenlib/intern/math_color_inline.c	2012-02-17 19:21:47 UTC (rev 44204)
@@ -163,7 +163,7 @@
 
 	for(i=0; i<3; ++i) {
 		t = linear[i] * inv_alpha;
-		srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
+		srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
 	}
 
 	srgb[3] = FTOUSHORT(linear[3]);

Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c	2012-02-17 19:21:47 UTC (rev 44204)
@@ -3838,7 +3838,7 @@
 	
 	if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
 		TFace *tf= mesh->tface;
-		unsigned int i;
+		int i;
 
 		for (i=0; i< (mesh->totface); i++, tf++) {
 			SWITCH_INT(tf->col[0]);
@@ -7497,15 +7497,16 @@
 
 void do_versions_image_settings_2_60(Scene *sce)
 {
-	/* note: rd->subimtype is moved into indervidual settings now and no longer
+	/* note: rd->subimtype is moved into individual settings now and no longer
 	 * exists */
 	RenderData *rd= &sce->r;
 	ImageFormatData *imf= &sce->r.im_format;
 
-	imf->imtype= rd->imtype;
-	imf->planes= rd->planes;
-	imf->compress= rd->quality;
-	imf->quality= rd->quality;
+	/* we know no data loss happens here, the old values were in char range */
+	imf->imtype=   (char)rd->imtype;
+	imf->planes=   (char)rd->planes;
+	imf->compress= (char)rd->quality;
+	imf->quality=  (char)rd->quality;
 
 	/* default, was stored in multiple places, may override later */
 	imf->depth= R_IMF_CHAN_DEPTH_8;

Modified: trunk/blender/source/blender/editors/mesh/editmesh_lib.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/editmesh_lib.c	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/editors/mesh/editmesh_lib.c	2012-02-17 19:21:47 UTC (rev 44204)
@@ -2410,7 +2410,7 @@
 
 	vmap->totalUVs = totuv;
 
-	for(efa = em->faces.first; efa; a++, efa = efa->next) {
+	for(efa = em->faces.first; efa; efa = efa->next) {
 		if(!selected || ((!efa->h) && (efa->f & SELECT))) {
 			nverts = (efa->v4)? 4: 3;
 

Modified: trunk/blender/source/blender/python/intern/bpy_app.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_app.c	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/python/intern/bpy_app.c	2012-02-17 19:21:47 UTC (rev 44204)
@@ -94,9 +94,6 @@
 	(sizeof(app_info_fields) / sizeof(PyStructSequence_Field)) - 1
 };
 
-#define DO_EXPAND(VAL)  VAL ## 1
-#define EXPAND(VAL)     DO_EXPAND(VAL)
-
 static PyObject *make_app_info(void)
 {
 	PyObject *app_info;
@@ -119,11 +116,7 @@
 	SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)",
 	                                BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
 
-#if defined(BLENDER_VERSION_CHAR) && EXPAND(BLENDER_VERSION_CHAR) != 1
 	SetStrItem(STRINGIFY(BLENDER_VERSION_CHAR));
-#else
-	SetStrItem("");
-#endif
 	SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE));
 	SetStrItem(BLI_program_path());
 	SetObjItem(PyBool_FromLong(G.background));

Modified: trunk/blender/source/blender/render/intern/source/shadeoutput.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/shadeoutput.c	2012-02-17 18:59:41 UTC (rev 44203)
+++ trunk/blender/source/blender/render/intern/source/shadeoutput.c	2012-02-17 19:21:47 UTC (rev 44204)
@@ -206,7 +206,7 @@
 		maxz*= lar->sh_zfac;
 		maxy= lar->imat[0][1]*p1[0]+lar->imat[1][1]*p1[1]+lar->imat[2][1]*p1[2];
 
-		if( fabsf(nray[2]) < FLT_EPSILON ) use_yco= 1;
+		if( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1;
 	}
 	
 	/* scale z to make sure volume is normalized */	




More information about the Bf-blender-cvs mailing list