[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45014] trunk/blender/source/blender: compile fix: linux BLI_gzopen declare was conflicting.

Campbell Barton ideasman42 at gmail.com
Tue Mar 20 04:48:46 CET 2012


Revision: 45014
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45014
Author:   campbellbarton
Date:     2012-03-20 03:48:32 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
compile fix: linux BLI_gzopen declare was conflicting.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/deform.c
    trunk/blender/source/blender/blenlib/BLI_fileops.h
    trunk/blender/source/blender/blenlib/intern/fileops.c

Modified: trunk/blender/source/blender/blenkernel/intern/deform.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/deform.c	2012-03-20 03:13:25 UTC (rev 45013)
+++ trunk/blender/source/blender/blenkernel/intern/deform.c	2012-03-20 03:48:32 UTC (rev 45014)
@@ -262,23 +262,24 @@
 
 void defvert_flip_merged(MDeformVert *dvert, const int *flip_map, const int flip_map_len)
 {
-	MDeformWeight *dw, *copydw;
+	MDeformWeight *dw, *dw_cpy;
 	float weight;
 	int i, totweight = dvert->totweight;
 
 	/* copy weights */
-	for (dw= dvert->dw, i=0; i<totweight; dw++, i++) {
+	for (dw = dvert->dw, i=0; i < totweight; dw++, i++) {
 		if (dw->def_nr < flip_map_len) {
 			if (flip_map[dw->def_nr] >= 0) {
-				copydw= defvert_verify_index(dvert, flip_map[dw->def_nr]);
-				dw= &dvert->dw[i]; /* in case array got realloced */
+				/* error checkers complain of this but we'll never get NULL return */
+				dw_cpy = defvert_verify_index(dvert, flip_map[dw->def_nr]);
+				dw = &dvert->dw[i]; /* in case array got realloced */
 
 				/* distribute weights: if only one of the vertex groups was
-				   assigned this will halve the weights, otherwise it gets
-				   evened out. this keeps it proportional to other groups */
-				weight = 0.5f*(copydw->weight + dw->weight);
-				copydw->weight= weight;
-				dw->weight= weight;
+				 * assigned this will halve the weights, otherwise it gets
+				 * evened out. this keeps it proportional to other groups */
+				weight = 0.5f * (dw_cpy->weight + dw->weight);
+				dw_cpy->weight = weight;
+				dw->weight = weight;
 			}
 		}
 	}

Modified: trunk/blender/source/blender/blenlib/BLI_fileops.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_fileops.h	2012-03-20 03:13:25 UTC (rev 45013)
+++ trunk/blender/source/blender/blenlib/BLI_fileops.h	2012-03-20 03:48:32 UTC (rev 45014)
@@ -45,6 +45,8 @@
 /* for size_t (needed on windows) */
 #include <stddef.h>
 
+struct gzFile;
+
 /* Common */
 
 int    BLI_exists(const char *path);
@@ -68,8 +70,8 @@
 
 /* Files */
 
-FILE * BLI_fopen(const char * filename, const char * mode);
-void* BLI_gzopen(const char * filename, const char * mode);
+FILE  *BLI_fopen(const char *filename, const char *mode);
+void  *BLI_gzopen(const char *filename, const char *mode);
 int    BLI_open(const char *filename, int oflag, int pmode);
 
 int    BLI_file_is_writable(const char *file);

Modified: trunk/blender/source/blender/blenlib/intern/fileops.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/fileops.c	2012-03-20 03:13:25 UTC (rev 45013)
+++ trunk/blender/source/blender/blenlib/intern/fileops.c	2012-03-20 03:48:32 UTC (rev 45014)
@@ -202,12 +202,12 @@
 
 static char str[MAXPATHLEN+12];
 
-FILE * BLI_fopen(const char * filename, const char * mode)
+FILE *BLI_fopen(const char *filename, const char *mode)
 {
 	return ufopen(filename, mode);
 }
 
-gzFile BLI_gzopen(const char * filename, const char * mode)
+gzFile BLI_gzopen(const char *filename, const char *mode)
 {
 	gzFile gzfile;
 	int fi;
@@ -550,12 +550,12 @@
 	return recursiveOp_Callback_OK;
 }
 
-FILE * BLI_fopen(const char * filename, const char * mode)
+FILE *BLI_fopen(const char *filename, const char *mode)
 {
 	return fopen(filename, mode);
 }
 
-gzFile BLI_gzopen(const char * filename, const char * mode)
+void *BLI_gzopen(const char *filename, const char *mode)
 {
 	return gzopen(filename, mode);
 }




More information about the Bf-blender-cvs mailing list