[Rcpp-commits] r3581 - pkg/Rcpp/inst/unitTests/testRcppClass/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Apr 19 23:24:23 CEST 2012
Author: edd
Date: 2012-04-19 23:24:22 +0200 (Thu, 19 Apr 2012)
New Revision: 3581
Modified:
pkg/Rcpp/inst/unitTests/testRcppClass/src/Num.cpp
pkg/Rcpp/inst/unitTests/testRcppClass/src/rcpp_module.cpp
Log:
minor whitespace tweaks
added emacs formatting header line
Modified: pkg/Rcpp/inst/unitTests/testRcppClass/src/Num.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/testRcppClass/src/Num.cpp 2012-04-19 20:59:28 UTC (rev 3580)
+++ pkg/Rcpp/inst/unitTests/testRcppClass/src/Num.cpp 2012-04-19 21:24:22 UTC (rev 3581)
@@ -1,3 +1,5 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
+
#include "rcpp_hello_world.h"
class Num{
@@ -15,16 +17,16 @@
};
RCPP_MODULE(NumEx){
- using namespace Rcpp ;
+ using namespace Rcpp ;
- class_<Num>( "Num" )
+ class_<Num>( "Num" )
- .default_constructor()
+ .default_constructor()
- // read and write property
- .property( "x", &Num::getX, &Num::setX )
+ // read and write property
+ .property( "x", &Num::getX, &Num::setX )
- // read-only property
- .property( "y", &Num::getY )
+ // read-only property
+ .property( "y", &Num::getY )
;
}
Modified: pkg/Rcpp/inst/unitTests/testRcppClass/src/rcpp_module.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/testRcppClass/src/rcpp_module.cpp 2012-04-19 20:59:28 UTC (rev 3580)
+++ pkg/Rcpp/inst/unitTests/testRcppClass/src/rcpp_module.cpp 2012-04-19 21:24:22 UTC (rev 3581)
@@ -1,23 +1,25 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
+
#include <Rcpp.h>
int bar( int x){
- return x*2 ;
+ return x*2 ;
}
double foo( int x, double y){
- return x * y ;
+ return x * y ;
}
void bla( ){
- Rprintf( "hello\\n" ) ;
+ Rprintf( "hello\\n" ) ;
}
void bla1( int x){
- Rprintf( "hello (x = %d)\\n", x ) ;
+ Rprintf( "hello (x = %d)\\n", x ) ;
}
void bla2( int x, double y){
- Rprintf( "hello (x = %d, y = %5.2f)\\n", x, y ) ;
+ Rprintf( "hello (x = %d, y = %5.2f)\\n", x, y ) ;
}
class World {
@@ -33,21 +35,19 @@
RCPP_MODULE(yada){
- using namespace Rcpp ;
+ using namespace Rcpp ;
- function( "bar" , &bar ) ;
- function( "foo" , &foo ) ;
- function( "bla" , &bla ) ;
- function( "bla1" , &bla1 ) ;
- function( "bla2" , &bla2 ) ;
+ function( "bar" , &bar ) ;
+ function( "foo" , &foo ) ;
+ function( "bla" , &bla ) ;
+ function( "bla1" , &bla1 ) ;
+ function( "bla2" , &bla2 ) ;
- class_<World>( "World" )
+ class_<World>( "World" )
- .default_constructor()
+ .default_constructor()
- .method( "greet", &World::greet )
- .method( "set", &World::set )
+ .method( "greet", &World::greet )
+ .method( "set", &World::set )
;
}
-
-
More information about the Rcpp-commits
mailing list