Skip to content

Commit 2b38bc3

Browse files
committed
white-space only changes
1 parent 7069b28 commit 2b38bc3

File tree

1 file changed

+97
-95
lines changed

1 file changed

+97
-95
lines changed

src/Module.cpp

Lines changed: 97 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Module.cpp: Rcpp R/C++ interface class library -- Rcpp modules
44
//
5-
// Copyright (C) 2010 - 2013 Dirk Eddelbuettel and Romain Francois
5+
// Copyright (C) 2010 - 2015 Dirk Eddelbuettel and Romain Francois
66
//
77
// This file is part of Rcpp.
88
//
@@ -24,208 +24,210 @@
2424
#include <Rcpp.h>
2525
#include "internal.h"
2626

27-
typedef Rcpp::XPtr<Rcpp::Module> XP_Module ;
28-
typedef Rcpp::XPtr<Rcpp::class_Base> XP_Class ;
29-
typedef Rcpp::XPtr<Rcpp::CppFunctionBase> XP_Function ;
27+
typedef Rcpp::XPtr<Rcpp::Module> XP_Module;
28+
typedef Rcpp::XPtr<Rcpp::class_Base> XP_Class;
29+
typedef Rcpp::XPtr<Rcpp::CppFunctionBase> XP_Function;
3030

31-
RCPP_FUN_1( bool, Class__has_default_constructor, XP_Class cl ){
32-
return cl->has_default_constructor() ;
31+
RCPP_FUN_1(bool, Class__has_default_constructor, XP_Class cl) {
32+
return cl->has_default_constructor();
3333
}
34-
RCPP_FUN_2( SEXP, Module__get_function, XP_Module module, std::string fun ){
35-
return module->get_function( fun ) ;
34+
RCPP_FUN_2(SEXP, Module__get_function, XP_Module module, std::string fun) {
35+
return module->get_function(fun);
3636
}
37-
RCPP_FUN_2( bool, Class__has_method, XP_Class cl, std::string m){
38-
return cl->has_method(m) ;
37+
RCPP_FUN_2(bool, Class__has_method, XP_Class cl, std::string m) {
38+
return cl->has_method(m);
3939
}
40-
RCPP_FUN_2( bool, Class__has_property, XP_Class cl, std::string m){
41-
return cl->has_property(m) ;
40+
RCPP_FUN_2(bool, Class__has_property, XP_Class cl, std::string m) {
41+
return cl->has_property(m);
4242
}
43-
RCPP_FUN_1( std::string, Class__name, XP_Class cl){
44-
return cl->name ;
43+
RCPP_FUN_1(std::string, Class__name, XP_Class cl) {
44+
return cl->name;
4545
}
46-
RCPP_FUN_2( bool, Module__has_function, XP_Module module, std::string met ){
47-
return module->has_function( met ) ;
46+
RCPP_FUN_2(bool, Module__has_function, XP_Module module, std::string met) {
47+
return module->has_function(met);
4848
}
49-
RCPP_FUN_2( bool, Module__has_class, XP_Module module, std::string cl ){
50-
return module->has_class( cl ) ;
49+
RCPP_FUN_2(bool, Module__has_class, XP_Module module, std::string cl) {
50+
return module->has_class(cl);
5151
}
52-
RCPP_FUN_2( Rcpp::CppClass, Module__get_class, XP_Module module, std::string cl ){
53-
return module->get_class( cl ) ;
52+
RCPP_FUN_2(Rcpp::CppClass, Module__get_class, XP_Module module, std::string cl) {
53+
return module->get_class(cl);
5454
}
55-
RCPP_FUN_1( bool, CppObject__needs_init, SEXP xp ){
56-
return EXTPTR_PTR(xp) == 0 ;
55+
RCPP_FUN_1(bool, CppObject__needs_init, SEXP xp) {
56+
return EXTPTR_PTR(xp) == 0;
5757
}
58-
RCPP_FUN_1( Rcpp::CharacterVector, CppClass__methods, XP_Class cl){
59-
return cl->method_names() ;
58+
RCPP_FUN_1(Rcpp::CharacterVector, CppClass__methods, XP_Class cl) {
59+
return cl->method_names();
6060
}
61-
RCPP_FUN_1( Rcpp::CharacterVector, CppClass__properties, XP_Class cl){
62-
return cl->property_names() ;
61+
RCPP_FUN_1(Rcpp::CharacterVector, CppClass__properties, XP_Class cl) {
62+
return cl->property_names();
6363
}
64-
RCPP_FUN_1( Rcpp::List, CppClass__property_classes, XP_Class cl){
65-
return cl->property_classes() ;
64+
RCPP_FUN_1(Rcpp::List, CppClass__property_classes, XP_Class cl) {
65+
return cl->property_classes();
6666
}
6767

68-
RCPP_FUN_1( Rcpp::IntegerVector, CppClass__methods_arity, XP_Class cl){
69-
return cl->methods_arity() ;
68+
RCPP_FUN_1(Rcpp::IntegerVector, CppClass__methods_arity, XP_Class cl) {
69+
return cl->methods_arity();
7070
}
71-
RCPP_FUN_1( Rcpp::LogicalVector, CppClass__methods_voidness, XP_Class cl){
72-
return cl->methods_voidness() ;
71+
RCPP_FUN_1(Rcpp::LogicalVector, CppClass__methods_voidness, XP_Class cl) {
72+
return cl->methods_voidness();
7373
}
7474

7575

76-
RCPP_FUN_2( bool, CppClass__property_is_readonly, XP_Class cl, std::string p){
77-
return cl->property_is_readonly(p) ;
76+
RCPP_FUN_2(bool, CppClass__property_is_readonly, XP_Class cl, std::string p) {
77+
return cl->property_is_readonly(p);
7878
}
79-
RCPP_FUN_2( std::string, CppClass__property_class, XP_Class cl, std::string p){
80-
return cl->property_class(p) ;
79+
RCPP_FUN_2(std::string, CppClass__property_class, XP_Class cl, std::string p) {
80+
return cl->property_class(p);
8181
}
8282

83-
RCPP_FUN_1( Rcpp::IntegerVector, Module__functions_arity, XP_Module module ){
84-
return module-> functions_arity() ;
83+
RCPP_FUN_1(Rcpp::IntegerVector, Module__functions_arity, XP_Module module) {
84+
return module-> functions_arity();
8585
}
86-
RCPP_FUN_1( Rcpp::CharacterVector, Module__functions_names, XP_Module module ){
87-
return module-> functions_names() ;
86+
RCPP_FUN_1(Rcpp::CharacterVector, Module__functions_names, XP_Module module) {
87+
return module-> functions_names();
8888
}
89-
RCPP_FUN_1( std::string, Module__name, XP_Module module ){
89+
RCPP_FUN_1(std::string, Module__name, XP_Module module) {
9090
return module->name;
9191
}
92-
RCPP_FUN_1( Rcpp::List, Module__classes_info, XP_Module module ){
93-
return module->classes_info() ;
92+
RCPP_FUN_1(Rcpp::List, Module__classes_info, XP_Module module) {
93+
return module->classes_info();
9494
}
95-
RCPP_FUN_1( Rcpp::CharacterVector, Module__complete, XP_Module module ){
96-
return module->complete() ;
95+
RCPP_FUN_1(Rcpp::CharacterVector, Module__complete, XP_Module module) {
96+
return module->complete();
9797
}
98-
RCPP_FUN_1( Rcpp::CharacterVector, CppClass__complete, XP_Class cl){
98+
RCPP_FUN_1(Rcpp::CharacterVector, CppClass__complete, XP_Class cl) {
9999
return cl->complete();
100100
}
101101

102102
// these operate directly on the external pointers, rather than
103103
// looking up the property in the map
104-
RCPP_FUN_3(SEXP, CppField__get, XP_Class cl, SEXP field_xp, SEXP obj){
105-
return cl->getProperty( field_xp, obj ) ;
104+
RCPP_FUN_3(SEXP, CppField__get, XP_Class cl, SEXP field_xp, SEXP obj) {
105+
return cl->getProperty(field_xp, obj);
106106
}
107-
RCPP_FUN_4(SEXP, CppField__set, XP_Class cl, SEXP field_xp, SEXP obj, SEXP value){
108-
cl->setProperty( field_xp, obj, value ) ;
109-
return R_NilValue ;
107+
RCPP_FUN_4(SEXP, CppField__set, XP_Class cl, SEXP field_xp, SEXP obj, SEXP value) {
108+
cl->setProperty(field_xp, obj, value);
109+
return R_NilValue;
110110
}
111-
RCPP_FUN_2(SEXP, CppObject__finalize, XP_Class cl, SEXP obj){
112-
cl->run_finalizer( obj ) ;
113-
return R_NilValue ;
111+
RCPP_FUN_2(SEXP, CppObject__finalize, XP_Class cl, SEXP obj) {
112+
cl->run_finalizer(obj);
113+
return R_NilValue;
114114
}
115115

116116
// .External functions
117-
SEXP InternalFunction_invoke( SEXP args ){
117+
SEXP InternalFunction_invoke(SEXP args) {
118118
BEGIN_RCPP
119-
SEXP p = CDR(args) ;
120-
XP_Function fun( CAR(p) ) ; p = CDR(p) ;
119+
SEXP p = CDR(args);
120+
XP_Function fun(CAR(p)); p = CDR(p);
121121
UNPACK_EXTERNAL_ARGS(cargs,p)
122-
return fun->operator()( cargs ) ;
122+
return fun->operator()(cargs);
123123
END_RCPP
124124
}
125125

126-
SEXP Module__invoke( SEXP args){
126+
SEXP Module__invoke(SEXP args) {
127127
BEGIN_RCPP
128-
SEXP p = CDR(args) ;
129-
XP_Module module( CAR(p) ) ; p = CDR(p) ;
130-
std::string fun = Rcpp::as<std::string>( CAR(p) ) ; p = CDR(p) ;
128+
SEXP p = CDR(args);
129+
XP_Module module(CAR(p)); p = CDR(p);
130+
std::string fun = Rcpp::as<std::string>(CAR(p)); p = CDR(p);
131131

132132
UNPACK_EXTERNAL_ARGS(cargs,p)
133-
return module->invoke( fun, cargs, nargs ) ;
133+
return module->invoke(fun, cargs, nargs);
134134
END_RCPP
135135
}
136136

137-
SEXP class__newInstance(SEXP args){
138-
SEXP p = CDR(args) ;
137+
SEXP class__newInstance(SEXP args) {
138+
SEXP p = CDR(args);
139139

140-
XP_Module module( CAR(p) ) ; p = CDR(p) ;
141-
XP_Class clazz( CAR(p) ) ; p = CDR(p);
140+
XP_Module module(CAR(p)); p = CDR(p);
141+
XP_Class clazz(CAR(p)); p = CDR(p);
142142
UNPACK_EXTERNAL_ARGS(cargs,p)
143-
return clazz->newInstance(cargs, nargs ) ;
143+
return clazz->newInstance(cargs, nargs);
144144
}
145145

146146
// relies on being set in .onLoad()
147147
SEXP rcpp_dummy_pointer = R_NilValue;
148148

149-
#define CHECK_DUMMY_OBJ(p) if(p == rcpp_dummy_pointer) forward_exception_to_r( Rcpp::not_initialized())
149+
#define CHECK_DUMMY_OBJ(p) if (p == rcpp_dummy_pointer) forward_exception_to_r(Rcpp::not_initialized())
150150

151151

152152
SEXP class__dummyInstance(SEXP args) {
153153
SEXP p;
154154

155-
if(args == R_NilValue)
155+
if (args == R_NilValue) {
156156
return rcpp_dummy_pointer;
157+
}
157158
p = CDR(args);
158159

159-
if(p != R_NilValue)
160+
if (p != R_NilValue) {
160161
rcpp_dummy_pointer = CAR(p);
162+
}
161163
return rcpp_dummy_pointer;
162164
}
163165

164-
SEXP CppMethod__invoke(SEXP args){
165-
SEXP p = CDR(args) ;
166+
SEXP CppMethod__invoke(SEXP args) {
167+
SEXP p = CDR(args);
166168

167169
// the external pointer to the class
168-
XP_Class clazz( CAR(p) ) ; p = CDR(p);
170+
XP_Class clazz(CAR(p)); p = CDR(p);
169171

170172
// the external pointer to the method
171-
SEXP met = CAR(p) ; p = CDR(p) ;
173+
SEXP met = CAR(p); p = CDR(p);
172174

173175
// the external pointer to the object
174-
SEXP obj = CAR(p); p = CDR(p) ;
176+
SEXP obj = CAR(p); p = CDR(p);
175177
CHECK_DUMMY_OBJ(obj);
176178

177179
// additional arguments, processed the same way as .Call does
178180
UNPACK_EXTERNAL_ARGS(cargs,p)
179181

180-
return clazz->invoke( met, obj, cargs, nargs ) ;
182+
return clazz->invoke(met, obj, cargs, nargs);
181183
}
182184

183-
SEXP CppMethod__invoke_void(SEXP args){
184-
SEXP p = CDR(args) ;
185+
SEXP CppMethod__invoke_void(SEXP args) {
186+
SEXP p = CDR(args);
185187

186188
// the external pointer to the class
187-
XP_Class clazz( CAR(p) ) ; p = CDR(p);
189+
XP_Class clazz(CAR(p)); p = CDR(p);
188190

189191
// the external pointer to the method
190-
SEXP met = CAR(p) ; p = CDR(p) ;
192+
SEXP met = CAR(p); p = CDR(p);
191193

192194
// the external pointer to the object
193-
SEXP obj = CAR(p); p = CDR(p) ;
195+
SEXP obj = CAR(p); p = CDR(p);
194196
CHECK_DUMMY_OBJ(obj);
195197

196198
// additional arguments, processed the same way as .Call does
197199
UNPACK_EXTERNAL_ARGS(cargs,p)
198-
clazz->invoke_void( met, obj, cargs, nargs ) ;
199-
return R_NilValue ;
200+
clazz->invoke_void(met, obj, cargs, nargs);
201+
return R_NilValue;
200202
}
201203

202-
SEXP CppMethod__invoke_notvoid(SEXP args){
203-
SEXP p = CDR(args) ;
204+
SEXP CppMethod__invoke_notvoid(SEXP args) {
205+
SEXP p = CDR(args);
204206

205207
// the external pointer to the class
206-
XP_Class clazz( CAR(p) ) ; p = CDR(p);
208+
XP_Class clazz(CAR(p)); p = CDR(p);
207209

208210
// the external pointer to the method
209-
SEXP met = CAR(p) ; p = CDR(p) ;
211+
SEXP met = CAR(p); p = CDR(p);
210212

211213
// the external pointer to the object
212-
SEXP obj = CAR(p); p = CDR(p) ;
214+
SEXP obj = CAR(p); p = CDR(p);
213215
CHECK_DUMMY_OBJ(obj);
214216

215217
// additional arguments, processed the same way as .Call does
216218
UNPACK_EXTERNAL_ARGS(cargs,p)
217219

218-
return clazz->invoke_notvoid( met, obj, cargs, nargs ) ;
220+
return clazz->invoke_notvoid(met, obj, cargs, nargs);
219221
}
220222

221223
namespace Rcpp{
222-
static Module* current_scope ;
224+
static Module* current_scope ;
223225
}
224226

225-
Rcpp::Module* getCurrentScope(){
226-
return Rcpp::current_scope ;
227+
Rcpp::Module* getCurrentScope() {
228+
return Rcpp::current_scope;
227229
}
228-
void setCurrentScope( Rcpp::Module* scope ){
229-
Rcpp::current_scope = scope ;
230+
void setCurrentScope(Rcpp::Module* scope) {
231+
Rcpp::current_scope = scope;
230232
}
231233

0 commit comments

Comments
 (0)