[Rprotobuf-commits] r691 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 3 10:32:00 CET 2014


Author: murray
Date: 2014-01-03 10:32:00 +0100 (Fri, 03 Jan 2014)
New Revision: 691

Modified:
   pkg/src/extractors.cpp
Log:
string->std::string and use RPB_DEBUG_BEGIN/END macros for brevity.



Modified: pkg/src/extractors.cpp
===================================================================
--- pkg/src/extractors.cpp	2014-01-03 09:31:22 UTC (rev 690)
+++ pkg/src/extractors.cpp	2014-01-03 09:32:00 UTC (rev 691)
@@ -38,8 +38,8 @@
         std::stringstream ss;
         if ((ss << value).fail()) {
             // This should not happen, its a bug in the code.
-            string message = string("Error converting int64 to string, unset ") +
-                             kIntStringOptionName + " option.";
+            std::string message = std::string("Error converting int64 to string, unset ") +
+                kIntStringOptionName + " option.";
             Rcpp::stop(message.c_str());
         }
         return Rcpp::CharacterVector(ss.str());
@@ -60,21 +60,16 @@
  */
 RcppExport SEXP getMessageField(SEXP pointer, SEXP name) {
 
-#ifdef RPB_DEBUG
-    Rprintf("<getMessageField>\n");
-
+    RPB_DEBUG_BEGIN("getMessageField")
     PRINT_DEBUG_INFO("pointer", pointer);
     PRINT_DEBUG_INFO("name", name);
-#endif
 
     /* grab the Message pointer */
     Rcpp::XPtr<GPB::Message> message(pointer);
 
     GPB::FieldDescriptor* field_desc = getFieldDescriptor(message, name);
 
-#ifdef RPB_DEBUG
-    Rprintf("</getMessageField>\n");
-#endif
+    RPB_DEBUG_END("getMessageField");
 
     return (extractFieldAsSEXP(message, field_desc));
 }



More information about the Rprotobuf-commits mailing list