[Rprotobuf-commits] r653 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Dec 30 23:28:10 CET 2013
Author: murray
Date: 2013-12-30 23:28:10 +0100 (Mon, 30 Dec 2013)
New Revision: 653
Modified:
pkg/src/RWarningErrorCollector.h
pkg/src/S4_classes.h
pkg/src/rprotobuf.h
Log:
Increase to 100-char column limit to avoid line-breaking too many long
lines.
Modified: pkg/src/RWarningErrorCollector.h
===================================================================
--- pkg/src/RWarningErrorCollector.h 2013-12-30 22:23:44 UTC (rev 652)
+++ pkg/src/RWarningErrorCollector.h 2013-12-30 22:28:10 UTC (rev 653)
@@ -5,8 +5,7 @@
class RWarningErrorCollector : public GPB::compiler::MultiFileErrorCollector {
public:
// implements ErrorCollector ---------------------------------------
- void AddError(const std::string& filename, int line, int column,
- const std::string& message);
+ void AddError(const std::string& filename, int line, int column, const std::string& message);
};
} // namespace rprotobuf
Modified: pkg/src/S4_classes.h
===================================================================
--- pkg/src/S4_classes.h 2013-12-30 22:23:44 UTC (rev 652)
+++ pkg/src/S4_classes.h 2013-12-30 22:28:10 UTC (rev 653)
@@ -24,8 +24,7 @@
class S4_EnumValueDescriptor : public Rcpp::S4 {
public:
- S4_EnumValueDescriptor(const GPB::EnumValueDescriptor* d)
- : S4("EnumValueDescriptor") {
+ S4_EnumValueDescriptor(const GPB::EnumValueDescriptor* d) : S4("EnumValueDescriptor") {
if (d) {
slot("pointer") = Rcpp::XPtr<GPB::EnumValueDescriptor>(
@@ -37,9 +36,7 @@
}
}
- S4_EnumValueDescriptor(const S4_EnumValueDescriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_EnumValueDescriptor(const S4_EnumValueDescriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_EnumValueDescriptor& operator=(const S4_EnumValueDescriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -49,8 +46,7 @@
class S4_Descriptor : public Rcpp::S4 {
public:
S4_Descriptor(const GPB::Descriptor* d) : S4("Descriptor") {
- slot("pointer") =
- Rcpp::XPtr<GPB::Descriptor>(const_cast<GPB::Descriptor*>(d), false);
+ slot("pointer") = Rcpp::XPtr<GPB::Descriptor>(const_cast<GPB::Descriptor*>(d), false);
if (!d) {
slot("type") = Rcpp::StringVector(0);
} else {
@@ -58,9 +54,7 @@
}
}
- S4_Descriptor(const S4_Descriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_Descriptor(const S4_Descriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_Descriptor& operator=(const S4_Descriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -70,8 +64,8 @@
class S4_FileDescriptor : public Rcpp::S4 {
public:
S4_FileDescriptor(const GPB::FileDescriptor* d) : S4("FileDescriptor") {
- slot("pointer") = Rcpp::XPtr<GPB::FileDescriptor>(
- const_cast<GPB::FileDescriptor*>(d), false);
+ slot("pointer") =
+ Rcpp::XPtr<GPB::FileDescriptor>(const_cast<GPB::FileDescriptor*>(d), false);
if (!d) {
slot("package") = Rcpp::StringVector(0);
slot("filename") = Rcpp::StringVector(0);
@@ -81,9 +75,7 @@
}
}
- S4_FileDescriptor(const S4_FileDescriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_FileDescriptor(const S4_FileDescriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_FileDescriptor& operator=(const S4_FileDescriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -93,16 +85,14 @@
class S4_FieldDescriptor : public Rcpp::S4 {
public:
S4_FieldDescriptor(const GPB::FieldDescriptor* d) : S4("FieldDescriptor") {
- slot("pointer") = Rcpp::XPtr<GPB::FieldDescriptor>(
- const_cast<GPB::FieldDescriptor*>(d), false);
+ slot("pointer") =
+ Rcpp::XPtr<GPB::FieldDescriptor>(const_cast<GPB::FieldDescriptor*>(d), false);
slot("name") = d->name();
slot("full_name") = d->full_name();
slot("type") = d->containing_type()->full_name();
}
- S4_FieldDescriptor(const S4_FieldDescriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_FieldDescriptor(const S4_FieldDescriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_FieldDescriptor& operator=(const S4_FieldDescriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -111,15 +101,12 @@
class S4_ServiceDescriptor : public Rcpp::S4 {
public:
- S4_ServiceDescriptor(const GPB::ServiceDescriptor* d)
- : S4("ServiceDescriptor") {
- slot("pointer") = Rcpp::XPtr<GPB::ServiceDescriptor>(
- const_cast<GPB::ServiceDescriptor*>(d), false);
+ S4_ServiceDescriptor(const GPB::ServiceDescriptor* d) : S4("ServiceDescriptor") {
+ slot("pointer") =
+ Rcpp::XPtr<GPB::ServiceDescriptor>(const_cast<GPB::ServiceDescriptor*>(d), false);
}
- S4_ServiceDescriptor(const S4_ServiceDescriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_ServiceDescriptor(const S4_ServiceDescriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_ServiceDescriptor& operator=(const S4_ServiceDescriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -128,15 +115,12 @@
class S4_MethodDescriptor : public Rcpp::S4 {
public:
- S4_MethodDescriptor(const GPB::MethodDescriptor* d)
- : S4("MethodDescriptor") {
- slot("pointer") = Rcpp::XPtr<GPB::MethodDescriptor>(
- const_cast<GPB::MethodDescriptor*>(d), false);
+ S4_MethodDescriptor(const GPB::MethodDescriptor* d) : S4("MethodDescriptor") {
+ slot("pointer") =
+ Rcpp::XPtr<GPB::MethodDescriptor>(const_cast<GPB::MethodDescriptor*>(d), false);
}
- S4_MethodDescriptor(const S4_MethodDescriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_MethodDescriptor(const S4_MethodDescriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_MethodDescriptor& operator=(const S4_MethodDescriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -146,8 +130,8 @@
class S4_EnumDescriptor : public Rcpp::S4 {
public:
S4_EnumDescriptor(const GPB::EnumDescriptor* d) : S4("EnumDescriptor") {
- slot("pointer") = Rcpp::XPtr<GPB::EnumDescriptor>(
- const_cast<GPB::EnumDescriptor*>(d), false);
+ slot("pointer") =
+ Rcpp::XPtr<GPB::EnumDescriptor>(const_cast<GPB::EnumDescriptor*>(d), false);
slot("type") = Rcpp::StringVector(0);
if (d) {
slot("name") = d->name();
@@ -162,9 +146,7 @@
}
}
- S4_EnumDescriptor(const S4_EnumDescriptor& other) : S4() {
- setSEXP(other.asSexp());
- }
+ S4_EnumDescriptor(const S4_EnumDescriptor& other) : S4() { setSEXP(other.asSexp()); }
S4_EnumDescriptor& operator=(const S4_EnumDescriptor& other) {
setSEXP(other.asSexp());
return *this;
@@ -174,8 +156,7 @@
class S4_Message : public Rcpp::S4 {
public:
S4_Message(const GPB::Message* d) : S4("Message") {
- slot("pointer") =
- Rcpp::XPtr<GPB::Message>(const_cast<GPB::Message*>(d), true);
+ slot("pointer") = Rcpp::XPtr<GPB::Message>(const_cast<GPB::Message*>(d), true);
slot("type") = d->GetDescriptor()->full_name();
}
S4_Message(const S4_Message& other) : S4() { setSEXP(other.asSexp()); }
@@ -194,14 +175,12 @@
GPB::io::ArrayOutputStream* stream =
new GPB::io::ArrayOutputStream(payload.begin(), size, block_size);
- Rcpp::XPtr<ZeroCopyOutputStreamWrapper> wrapper(
- new ZeroCopyOutputStreamWrapper(stream), true, R_NilValue, payload);
+ Rcpp::XPtr<ZeroCopyOutputStreamWrapper> wrapper(new ZeroCopyOutputStreamWrapper(stream),
+ true, R_NilValue, payload);
slot("pointer") = wrapper;
}
- S4_ArrayOutputStream(const S4_ArrayOutputStream& other) {
- setSEXP(other.asSexp());
- }
+ S4_ArrayOutputStream(const S4_ArrayOutputStream& other) { setSEXP(other.asSexp()); }
S4_ArrayOutputStream& operator=(const S4_ArrayOutputStream& other) {
setSEXP(other.asSexp());
return *this;
@@ -210,10 +189,9 @@
class S4_ArrayInputStream : public Rcpp::S4 {
public:
- S4_ArrayInputStream(Rcpp::RawVector payload, int block_size)
- : S4("ArrayInputStream") {
- GPB::io::ArrayInputStream* stream = new GPB::io::ArrayInputStream(
- payload.begin(), payload.size(), block_size);
+ S4_ArrayInputStream(Rcpp::RawVector payload, int block_size) : S4("ArrayInputStream") {
+ GPB::io::ArrayInputStream* stream =
+ new GPB::io::ArrayInputStream(payload.begin(), payload.size(), block_size);
Rcpp::XPtr<rprotobuf::ZeroCopyInputStreamWrapper> wrapper(
new ZeroCopyInputStreamWrapper(stream), true, R_NilValue, payload);
slot("pointer") = wrapper;
Modified: pkg/src/rprotobuf.h
===================================================================
--- pkg/src/rprotobuf.h 2013-12-30 22:23:44 UTC (rev 652)
+++ pkg/src/rprotobuf.h 2013-12-30 22:28:10 UTC (rev 653)
@@ -93,21 +93,18 @@
#define GET_DESCRIPTOR_POINTER_FROM_S4(m) \
(GPB::Descriptor*) EXTPTR_PTR(GET_SLOT(m, Rf_install("pointer")))
-#define GET_FIELD_DESCRIPTOR_POINTER_FROM_XP(xp) \
- (GPB::FieldDescriptor*) EXTPTR_PTR(xp)
+#define GET_FIELD_DESCRIPTOR_POINTER_FROM_XP(xp) (GPB::FieldDescriptor*) EXTPTR_PTR(xp)
#define GET_FIELD_DESCRIPTOR_POINTER_FROM_S4(m) \
(GPB::FieldDescriptor*) EXTPTR_PTR(GET_SLOT(m, Rf_install("pointer")))
-#define GET_ENUM_VALUE_DESCRIPTOR_POINTER_FROM_XP(xp) \
- (GPB::EnumValueDescriptor*) EXTPTR_PTR(xp)
+#define GET_ENUM_VALUE_DESCRIPTOR_POINTER_FROM_XP(xp) (GPB::EnumValueDescriptor*) EXTPTR_PTR(xp)
#define GET_ENUM_VALUE_DESCRIPTOR_POINTER_FROM_S4(m) \
(GPB::EnumValueDescriptor*) EXTPTR_PTR(GET_SLOT(m, Rf_install("pointer")))
#define GET_METHOD(xp) (GPB::MethodDescriptor*) EXTPTR_PTR(xp)
#define COPYSTRING(s) s
-#define THROW_SOCKET_ERROR(message) \
- Rf_error("%s : %s", message, strerror(sockerrno))
+#define THROW_SOCKET_ERROR(message) Rf_error("%s : %s", message, strerror(sockerrno))
#define XPP EXTPTR_PTR
@@ -135,8 +132,7 @@
/* in extractors.cpp */
RcppExport SEXP getMessageField(SEXP, SEXP);
-RcppExport SEXP extractFieldAsSEXP(const Rcpp::XPtr<GPB::Message>&,
- const GPB::FieldDescriptor*);
+RcppExport SEXP extractFieldAsSEXP(const Rcpp::XPtr<GPB::Message>&, const GPB::FieldDescriptor*);
/* in lookup.cpp */
RcppExport SEXP newProtocolBufferLookup(SEXP);
@@ -247,14 +243,11 @@
#define GET_ZCIS(xp) ((ZeroCopyInputStreamWrapper*)XPP(xp))->get_stream()
#define GET_CIS(xp) ((ZeroCopyInputStreamWrapper*)XPP(xp))->get_coded_stream()
-#define GET_FIS(xp) \
- (GPB::io::FileInputStream*)((ZeroCopyInputStreamWrapper*)XPP(xp)) \
- ->get_stream()
+#define GET_FIS(xp) (GPB::io::FileInputStream*)((ZeroCopyInputStreamWrapper*)XPP(xp))->get_stream()
#define GET_ZCOS(xp) ((ZeroCopyOutputStreamWrapper*)XPP(xp))->get_stream()
#define GET_COS(xp) ((ZeroCopyOutputStreamWrapper*)XPP(xp))->get_coded_stream()
-#define GET_FOS(xp) \
- (GPB::io::FileOutputStream*)((ZeroCopyOutputStreamWrapper*)XPP(xp)) \
- ->get_stream()
+#define GET_FOS(xp) \
+ (GPB::io::FileOutputStream*)((ZeroCopyOutputStreamWrapper*)XPP(xp))->get_stream()
#endif
More information about the Rprotobuf-commits
mailing list