[Rprotobuf-commits] r672 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 31 13:44:31 CET 2013


Author: murray
Date: 2013-12-31 13:44:31 +0100 (Tue, 31 Dec 2013)
New Revision: 672

Modified:
   pkg/src/Rcppsupport.h
   pkg/src/extensions.cpp
   pkg/src/wrapper_Descriptor.cpp
   pkg/src/wrapper_FileDescriptor.cpp
Log:
Minor build fixes to make last change compile properly.



Modified: pkg/src/Rcppsupport.h
===================================================================
--- pkg/src/Rcppsupport.h	2013-12-31 12:31:11 UTC (rev 671)
+++ pkg/src/Rcppsupport.h	2013-12-31 12:44:31 UTC (rev 672)
@@ -33,7 +33,7 @@
 class Int64AsStringRepeatedFieldImporter {
 public:
     // Probably want to convert to strings here.
-    typedef string r_import_type;
+    typedef std::string r_import_type;
     Int64AsStringRepeatedFieldImporter(const GPB::Reflection* ref_ ,
                                        const GPB::Message& message_,
                                        const GPB::FieldDescriptor* field_)
@@ -41,8 +41,8 @@
     inline int size() const {
         return ref->FieldSize(message, field);
     }
-    inline string get(int i) const {
-        stringstream stream;
+    inline std::string get(int i) const {
+        std::stringstream stream;
         int64 val = ref->GetRepeatedInt64(message, field, i);
         stream << val;
         return stream.str();
@@ -56,7 +56,7 @@
 class UInt64AsStringRepeatedFieldImporter {
 public:
     // Probably want to convert to strings here.
-    typedef string r_import_type;
+    typedef std::string r_import_type;
     UInt64AsStringRepeatedFieldImporter(const GPB::Reflection* ref_,
                                         const GPB::Message& message_,
                                         const GPB::FieldDescriptor* field_)
@@ -64,8 +64,8 @@
     inline int size() const {
         return ref->FieldSize(message, field) ;
     }
-    inline string get(int i) const {
-        stringstream stream;
+    inline std::string get(int i) const {
+        std::stringstream stream;
         uint64 val = ref->GetRepeatedUInt64(message, field, i);
         stream << val;
         return stream.str();

Modified: pkg/src/extensions.cpp
===================================================================
--- pkg/src/extensions.cpp	2013-12-31 12:31:11 UTC (rev 671)
+++ pkg/src/extensions.cpp	2013-12-31 12:44:31 UTC (rev 672)
@@ -27,7 +27,7 @@
 RcppExport SEXP getExtension(SEXP pointer, SEXP sfielddesc) {
     /* grab the Message pointer */
     Rcpp::XPtr<GPB::Message> message(pointer);
-    const Reflection* ref = message->GetReflection();
+    const GPB::Reflection* ref = message->GetReflection();
     const GPB::FieldDescriptor* field_desc = GET_FIELD_DESCRIPTOR_POINTER_FROM_S4(sfielddesc);
 
     // extractFieldAsSEXP returns a default (e.g. 0) even when

Modified: pkg/src/wrapper_Descriptor.cpp
===================================================================
--- pkg/src/wrapper_Descriptor.cpp	2013-12-31 12:31:11 UTC (rev 671)
+++ pkg/src/wrapper_Descriptor.cpp	2013-12-31 12:44:31 UTC (rev 672)
@@ -55,17 +55,17 @@
     Rcpp::CharacterVector names(n);
     Rcpp::List res(n);
     int cnt = 0;
-    for (i = 0; i < nfields; cnt++, i++) {
+    for (int i = 0; i < nfields; cnt++, i++) {
         const GPB::FieldDescriptor* fd = desc->field(i);
         res[cnt] = S4_FieldDescriptor(fd);
         names[cnt] = fd->name();
     }
-    for (i = 0; i < ntypes; cnt++, i++) {
+    for (int i = 0; i < ntypes; cnt++, i++) {
         const GPB::Descriptor* d = desc->nested_type(i);
         res[cnt] = S4_Descriptor(d);
         names[cnt] = d->name();
     }
-    for (i = 0; i < nenums; cnt++, i++) {
+    for (int i = 0; i < nenums; cnt++, i++) {
         const GPB::EnumDescriptor* ed = desc->enum_type(i);
         res[cnt] = S4_EnumDescriptor(ed);
         names[cnt] = ed->name();

Modified: pkg/src/wrapper_FileDescriptor.cpp
===================================================================
--- pkg/src/wrapper_FileDescriptor.cpp	2013-12-31 12:31:11 UTC (rev 671)
+++ pkg/src/wrapper_FileDescriptor.cpp	2013-12-31 12:44:31 UTC (rev 672)
@@ -64,19 +64,19 @@
     Rcpp::CharacterVector names(n);
     Rcpp::List res(n);
     int count = 0;
-    for (i = 0; i < ntypes; count++, i++) {
+    for (int i = 0; i < ntypes; count++, i++) {
         res[count] = S4_Descriptor(desc->message_type(i));
         names[count] = desc->message_type(i)->name();
     }
-    for (i = 0; i < nenums; count++, i++) {
+    for (int i = 0; i < nenums; count++, i++) {
         res[count] = S4_EnumDescriptor(desc->enum_type(i));
         names[count] = desc->enum_type(i)->name();
     }
-    for (i = 0; i < nserv; count++, i++) {
+    for (int i = 0; i < nserv; count++, i++) {
         res[count] = S4_ServiceDescriptor(desc->service(i));
         names[count] = desc->service(i)->name();
     }
-    for (i = 0; i < nexts; count++, i++) {
+    for (int i = 0; i < nexts; count++, i++) {
         res[count] = S4_FieldDescriptor(desc->extension(i));
         // always use full names for extensions
         names[count] = desc->extension(i)->full_name();



More information about the Rprotobuf-commits mailing list