[Rprotobuf-commits] r612 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 27 23:23:44 CET 2013


Author: murray
Date: 2013-12-27 23:23:44 +0100 (Fri, 27 Dec 2013)
New Revision: 612

Modified:
   pkg/src/mutators.cpp
Log:
Add a better stop() message referencing the exact type and correct two
typos in comments.



Modified: pkg/src/mutators.cpp
===================================================================
--- pkg/src/mutators.cpp	2013-12-27 21:36:08 UTC (rev 611)
+++ pkg/src/mutators.cpp	2013-12-27 22:23:44 UTC (rev 612)
@@ -411,7 +411,9 @@
 					/* check that this is a message of the appropriate type */
 					if( !isMessage( value,
 									field_desc->message_type()->full_name().c_str() ) ){
-						Rcpp::stop("incorrect type");
+						string message = "Not a message of type '" +
+							field_desc->message_type()->full_name() + "'";
+						Rcpp::stop(message.c_str());
 					}
 					break ;
 				}
@@ -1127,7 +1129,7 @@
 				for( ; i<field_size; i++){
 					GPB::Message* mess = GET_MESSAGE_POINTER_FROM_S4( VECTOR_ELT( value, i) ) ; 
 					/* we already know it is of the correct type because of the 
-					   premptive chjeck above */
+					   premptive check above */
 					ref->MutableRepeatedMessage(message, field_desc, i )->CopyFrom( *mess ) ;
 				}
 			    		
@@ -1136,7 +1138,7 @@
 					for( ; i<value_size; i++){
 						GPB::Message* mess = GET_MESSAGE_POINTER_FROM_S4( VECTOR_ELT( value, i) ) ; 
 						/* we already know it is of the correct type
-						   because of the premptive chjeck above */
+						   because of the premptive check above */
 			    				
 						ref->AddMessage(message, field_desc)->CopyFrom( *mess ) ; 
 					}



More information about the Rprotobuf-commits mailing list