[Rprotobuf-commits] r611 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Dec 27 22:36:08 CET 2013
Author: murray
Date: 2013-12-27 22:36:08 +0100 (Fri, 27 Dec 2013)
New Revision: 611
Modified:
pkg/src/rprotobuf.cpp
Log:
Correct a typo and use the RCPP macros rather than rolling our own
try/catch.
Modified: pkg/src/rprotobuf.cpp
===================================================================
--- pkg/src/rprotobuf.cpp 2013-12-27 21:33:42 UTC (rev 610)
+++ pkg/src/rprotobuf.cpp 2013-12-27 21:36:08 UTC (rev 611)
@@ -199,7 +199,7 @@
/**
*
* @param m potentially a message
- * @param target the exxpected type
+ * @param target the expected type
*
* @return TRUE if m is a a message of the given type
*/
@@ -222,8 +222,8 @@
GPB::FieldDescriptor* getFieldDescriptor(GPB::Message* message, SEXP name){
- try {
GPB::FieldDescriptor* field_desc = (GPB::FieldDescriptor*)0;
+ BEGIN_RCPP
const GPB::Descriptor* desc = message->GetDescriptor() ;
std::string error_message = "could not get FieldDescriptor for field";
switch( TYPEOF(name) ){
@@ -259,9 +259,8 @@
Rcpp::stop(error_message.c_str());
}
return field_desc ;
- } catch(std::exception &ex) {
- forward_exception_to_r(ex);
- }
+ VOID_END_RCPP
+ return field_desc ;
}
RPB_FUNCTION_VOID_1( check_libprotobuf_version, int minversion ){
More information about the Rprotobuf-commits
mailing list