@@ -33,54 +33,52 @@ namespace Rcpp {
3333 Rstreambuf (){}
3434
3535 protected:
36- virtual std::streamsize xsputn (const char *s, std::streamsize n );
36+ virtual std::streamsize xsputn (const char *s, std::streamsize n);
3737
38- virtual int overflow (int c = traits_type::eof() );
38+ virtual int overflow (int c = traits_type::eof());
3939
40- virtual int sync () ;
40+ virtual int sync ();
4141 };
4242
4343 template <bool OUTPUT>
4444 class Rostream : public std ::ostream {
45- typedef Rstreambuf<OUTPUT> Buffer ;
46- Buffer buf ;
45+ typedef Rstreambuf<OUTPUT> Buffer;
46+ Buffer buf;
4747 public:
48- Rostream () :
49- std::ostream ( &buf )
50- {}
48+ Rostream () : std::ostream( &buf ) {}
5149 };
5250 // #nocov start
53- template <> inline std::streamsize Rstreambuf<true >::xsputn(const char *s, std::streamsize num ) {
54- Rprintf ( " %.*s" , num, s ) ;
55- return num ;
51+ template <> inline std::streamsize Rstreambuf<true >::xsputn(const char *s, std::streamsize num) {
52+ Rprintf (" %.*s" , num, s) ;
53+ return num;
5654 }
57- template <> inline std::streamsize Rstreambuf<false >::xsputn(const char *s, std::streamsize num ) {
58- REprintf ( " %.*s" , num, s ) ;
59- return num ;
55+ template <> inline std::streamsize Rstreambuf<false >::xsputn(const char *s, std::streamsize num) {
56+ REprintf (" %.*s" , num, s) ;
57+ return num;
6058 }
6159
62- template <> inline int Rstreambuf<true >::overflow(int c ) {
60+ template <> inline int Rstreambuf<true >::overflow(int c) {
6361 if (c != traits_type::eof ()) {
6462 char_type ch = traits_type::to_char_type (c);
6563 return xsputn (&ch, 1 ) == 1 ? c : traits_type::eof ();
6664 }
6765 return c;
6866 }
69- template <> inline int Rstreambuf<false >::overflow(int c ) {
67+ template <> inline int Rstreambuf<false >::overflow(int c) {
7068 if (c != traits_type::eof ()) {
7169 char_type ch = traits_type::to_char_type (c);
7270 return xsputn (&ch, 1 ) == 1 ? c : traits_type::eof ();
7371 }
7472 return c;
7573 }
7674
77- template <> inline int Rstreambuf<true >::sync(){
78- ::R_FlushConsole () ;
79- return 0 ;
75+ template <> inline int Rstreambuf<true >::sync() {
76+ ::R_FlushConsole ();
77+ return 0 ;
8078 }
81- template <> inline int Rstreambuf<false >::sync(){
82- ::R_FlushConsole () ;
83- return 0 ;
79+ template <> inline int Rstreambuf<false >::sync() {
80+ ::R_FlushConsole ();
81+ return 0 ;
8482 } // #nocov end
8583 static Rostream<true > Rcout;
8684 static Rostream<false > Rcerr;
0 commit comments