[Rprotobuf-commits] r420 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 10 20:12:00 CEST 2011


Author: edd
Date: 2011-04-10 20:11:59 +0200 (Sun, 10 Apr 2011)
New Revision: 420

Modified:
   pkg/src/extractors.cpp
   pkg/src/mutators.cpp
Log:
add default cases -- with possibly suboptimal messages


Modified: pkg/src/extractors.cpp
===================================================================
--- pkg/src/extractors.cpp	2011-04-10 17:48:32 UTC (rev 419)
+++ pkg/src/extractors.cpp	2011-04-10 18:11:59 UTC (rev 420)
@@ -100,7 +100,9 @@
 			} else {
 				throwException( "unknown field type with CPP_TYPE STRING", "ConversionException" ) ;
 			}
-
+			
+		default:
+			throwException("Unsupported type", "ConversionException");
     	}
     	
     } else {
@@ -139,8 +141,12 @@
     		
    		case CPPTYPE_MESSAGE:
 			return S4_Message( CLONE( &ref->GetMessage( *message, fieldDesc ) ) ) ;
-    			break ;
+			break ;
+
+		default:
+			throwException("Unsupported type", "ConversionException");
     	}
+
     }
     return R_NilValue ; /* -Wall */
 }

Modified: pkg/src/mutators.cpp
===================================================================
--- pkg/src/mutators.cpp	2011-04-10 17:48:32 UTC (rev 419)
+++ pkg/src/mutators.cpp	2011-04-10 18:11:59 UTC (rev 420)
@@ -1001,6 +1001,8 @@
 HANDLE_SINGLE_FIELD( CPPTYPE_FLOAT, Float, float) ;
 HANDLE_SINGLE_FIELD( CPPTYPE_BOOL, Bool, bool) ;
 #undef HANDLE_SINGLE_FIELD
+		default:
+			throwException("Unsupported type", "ConversionException");
 // }}}  
      		
 			// {{{ string



More information about the Rprotobuf-commits mailing list