[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15097] trunk/blender/source/blender: A few compiler warning fixes.

Joshua Leung aligorith at gmail.com
Tue Jun 3 12:04:42 CEST 2008


Revision: 15097
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15097
Author:   aligorith
Date:     2008-06-03 12:04:42 +0200 (Tue, 03 Jun 2008)

Log Message:
-----------
A few compiler warning fixes. Those in BME_customdata.c were more serious.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/BME_Customdata.c
    trunk/blender/source/blender/src/editmesh_tools.c

Modified: trunk/blender/source/blender/blenkernel/intern/BME_Customdata.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/BME_Customdata.c	2008-06-03 10:00:09 UTC (rev 15096)
+++ trunk/blender/source/blender/blenkernel/intern/BME_Customdata.c	2008-06-03 10:04:42 UTC (rev 15097)
@@ -39,6 +39,7 @@
 #include "BKE_bmeshCustomData.h"
 #include "bmesh_private.h"
 #include <string.h>
+#include "MEM_guardedalloc.h"
 
 /********************* Layer type information **********************/
 typedef struct BME_LayerTypeInfo {
@@ -88,7 +89,7 @@
 			if(init->layout[i]){
 				info = BME_layerType_getInfo(i);
 				for(j=0; j < init->layout[i]; j++){
-					if(j=0) data->layers[j+i].active = init->active[i];
+					if(j==0) data->layers[j+i].active = init->active[i];
 					data->layers[j+i].type = i;
 					data->layers[j+i].offset = offset;	
 					strcpy(data->layers[j+i].name, &(init->nametemplate[j+i]));
@@ -134,50 +135,50 @@
 		*block = NULL;
 }
 
-void BME_CD_copy_data(const BME_CustomData *source, BME_CustomData *dest,
-                            void *src_block, void **dest_block)
-{
-	const BME_LayerTypeInfo *typeInfo;
-	int dest_i, src_i;
-
-	if (!*dest_block) /*for addXXXlist functions!*/
-		BME_CD_alloc_block(dest, dest_block);
-	
-	/* copies a layer at a time */
-	dest_i = 0;
-	for(src_i = 0; src_i < source->totlayer; ++src_i) {
-
-		/* find the first dest layer with type >= the source type
-		 * (this should work because layers are ordered by type)
-		 */
-		while(dest_i < dest->totlayer
-		      && dest->layers[dest_i].type < source->layers[src_i].type)
-			++dest_i;
-
-		/* if there are no more dest layers, we're done */
-		if(dest_i >= dest->totlayer) return;
-
-		/* if we found a matching layer, copy the data */
-		if(dest->layers[dest_i].type == source->layers[src_i].type &&
-			strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) {
-			char *src_data = (char*)src_block + source->layers[src_i].offset;
-			char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset;
-
-			typeInfo = BME_layerType_getInfo(source->layers[src_i].type);
-
-			if(typeInfo->copy)
-				typeInfo->copy(src_data, dest_data, 1);
-			else
-				memcpy(dest_data, src_data, typeInfo->size);
-
-			/* if there are multiple source & dest layers of the same type,
-			 * we don't want to copy all source layers to the same dest, so
-			 * increment dest_i
-			 */
-			++dest_i;
-		}
-	}
-}
+void BME_CD_copy_data(const BME_CustomData *source, BME_CustomData *dest,
+                            void *src_block, void **dest_block)
+{
+	const BME_LayerTypeInfo *typeInfo;
+	int dest_i, src_i;
+
+	if (!*dest_block) /*for addXXXlist functions!*/
+		BME_CD_alloc_block(dest, dest_block);
+	
+	/* copies a layer at a time */
+	dest_i = 0;
+	for(src_i = 0; src_i < source->totlayer; ++src_i) {
+
+		/* find the first dest layer with type >= the source type
+		 * (this should work because layers are ordered by type)
+		 */
+		while(dest_i < dest->totlayer
+		      && dest->layers[dest_i].type < source->layers[src_i].type)
+			++dest_i;
+
+		/* if there are no more dest layers, we're done */
+		if(dest_i >= dest->totlayer) return;
+
+		/* if we found a matching layer, copy the data */
+		if(dest->layers[dest_i].type == source->layers[src_i].type &&
+			strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) {
+			char *src_data = (char*)src_block + source->layers[src_i].offset;
+			char *dest_data = (char*)*dest_block + dest->layers[dest_i].offset;
+
+			typeInfo = BME_layerType_getInfo(source->layers[src_i].type);
+
+			if(typeInfo->copy)
+				typeInfo->copy(src_data, dest_data, 1);
+			else
+				memcpy(dest_data, src_data, typeInfo->size);
+
+			/* if there are multiple source & dest layers of the same type,
+			 * we don't want to copy all source layers to the same dest, so
+			 * increment dest_i
+			 */
+			++dest_i;
+		}
+	}
+}
 void BME_CD_set_default(BME_CustomData *data, void **block)
 {
 	const BME_LayerTypeInfo *typeInfo;

Modified: trunk/blender/source/blender/src/editmesh_tools.c
===================================================================
--- trunk/blender/source/blender/src/editmesh_tools.c	2008-06-03 10:00:09 UTC (rev 15096)
+++ trunk/blender/source/blender/src/editmesh_tools.c	2008-06-03 10:04:42 UTC (rev 15097)
@@ -4480,11 +4480,6 @@
 }
 
 void bevel_menu() {
-	int vlayers[BME_CD_NUMTYPES] = {0,0,0,0};
-	int elayers[BME_CD_NUMTYPES] = {0,0,0,0};
-	int llayers[BME_CD_NUMTYPES] = {0,0,0,0};
-	int players[BME_CD_NUMTYPES] = {0,0,0,0};
-
 	BME_Mesh *bm;
 	BME_TransData_Head *td;
 	TransInfo *t;





More information about the Bf-blender-cvs mailing list