[Rprotobuf-commits] r390 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 11 11:26:41 CEST 2010


Author: romain
Date: 2010-09-11 11:26:41 +0200 (Sat, 11 Sep 2010)
New Revision: 390

Modified:
   pkg/src/mutators.cpp
Log:
some more compilers errors

Modified: pkg/src/mutators.cpp
===================================================================
--- pkg/src/mutators.cpp	2010-09-11 09:17:43 UTC (rev 389)
+++ pkg/src/mutators.cpp	2010-09-11 09:26:41 UTC (rev 390)
@@ -240,9 +240,9 @@
     	case STRSXP:
     		{
     			int nenums = enum_desc->value_count() ;
-    			char* possibles [ nenums ] ;
+    			std::vector<std::string> possibles( nenums ) ;
     			for( int i=0; i< nenums; i++){
-    				possibles[i] = (char*)enum_desc->value(i)->name().c_str() ; 
+    				possibles[i] = enum_desc->value(i)->name() ; 
     			}
     			
     			/* loop around the numbers to see if they are in the possibles */
@@ -251,7 +251,7 @@
     				int ok = 0; 
     				/* FIXME: there is probably something more efficient */
     				for( int j=0; j<nenums; j++){
-    					if( !strcmp( val, possibles[j]) ){
+    					if( ! possibles[j].compare( val) ){
     						ok = 1; 
     						break ; 
     					}
@@ -406,7 +406,7 @@
     					case RAWSXP:
     						{
     							int nenums = enum_desc->value_count() ;
-    							int possibles [ nenums ] ;
+    							std::vector<int> possibles(nenums) ;
     							for( int i=0; i< nenums; i++){
     								possibles[i] = enum_desc->value(i)->number(); 
     							}
@@ -434,9 +434,9 @@
     					case STRSXP:
     						{
     							int nenums = enum_desc->value_count() ;
-    							char* possibles [ nenums ] ;
+    							std::vector<std::string> possibles(nenums) ;
     							for( int i=0; i< nenums; i++){
-    								possibles[i] = (char*)enum_desc->value(i)->name().c_str() ; 
+    								possibles[i] = enum_desc->value(i)->name() ; 
     							}
     							
     							/* loop around the numbers to see if they are in the possibles */
@@ -445,7 +445,7 @@
     								int ok = 0; 
     								/* FIXME: there is probably something more efficient */
     								for( int j=0; j<nenums; j++){
-    									if( !strcmp( val, possibles[j]) ){
+    									if( !possibles[j].compare(val) ){
     										ok = 1; 
     										break ; 
     									}



More information about the Rprotobuf-commits mailing list