[Rprotobuf-yada] Build errors

Dirk Eddelbuettel edd at debian.org
Wed Nov 11 21:41:31 CET 2009


RemoveLast() and SwapElements() are not in 2.1.

What shall we do?  I can 'build' with these difference but that is obviously
not a fix.

Dirk



edd at ron:~/svn/rprotobuf> svn di 
Index: pkg/src/size.cpp
===================================================================
--- pkg/src/size.cpp	(revision 107)
+++ pkg/src/size.cpp	(working copy)
@@ -48,10 +48,13 @@
 		if( target == 0){
 			ref->ClearField( message, field_desc );
 		} else if( current > target ){
+#define GrossHack 1
+#if ! GrossHack
 			while( current != target ){
 				ref->RemoveLast( message, field_desc ) ;
 				current-- ;
 			}
+#endif
 		} else if( current == target ) {
 			/* nothing to do */
 		} else { /* current < target */
Index: pkg/src/mutators.cpp
===================================================================
--- pkg/src/mutators.cpp	(revision 107)
+++ pkg/src/mutators.cpp	(working copy)
@@ -304,7 +304,8 @@
     			}
 		}
 		// }}}
-		  
+#define GrossHack 1
+#if ! GrossHack
 		/* {{{ remove some items once if there are too many */
 		if( field_size > value_size ) {
 			/* we need to remove some */
@@ -314,7 +315,7 @@
 			}
 		}
 		// }}}
-		
+#endif 		
 		switch( field_desc->type() ){
 			// {{{ int32
     		case TYPE_INT32:
Index: pkg/src/swap.cpp
===================================================================
--- pkg/src/swap.cpp	(revision 107)
+++ pkg/src/swap.cpp	(working copy)
@@ -11,9 +11,12 @@
 			Rf_error( "swap can only be used with repeated fields" ) ; 
 		}
 		int n = LENGTH(left); /* we know that length(left) == length(right) */ 
+#define GrossHack 1
+#if ! GrossHack
 		for( int i=0; i<n; i++){
 			ref->SwapElements(m, field_desc, GET_int(left, i) , GET_int(right,i) ) ;
 		}
+#endif
 		return( R_NilValue ); 
 	}
 
-- 
Three out of two people have difficulties with fractions.


More information about the Rprotobuf-yada mailing list