From 2a8a2d2aed7faaa88e91f54871120f114645382d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 14 Jun 2011 15:16:58 +0000 Subject: With any luck, that'll fix the cross-compiling trace code. Now we just need to hope that the formatter code is not going to have the same problem. --- src/tests/bzip2.cpp | 6 ++--- src/trace.cpp | 63 ----------------------------------------------------- src/trace.h | 19 +++++----------- 3 files changed, 9 insertions(+), 79 deletions(-) diff --git a/src/tests/bzip2.cpp b/src/tests/bzip2.cpp index 603e937..4de06d2 100644 --- a/src/tests/bzip2.cpp +++ b/src/tests/bzip2.cpp @@ -19,10 +19,10 @@ int main( int argc, char *argv[] ) char buf[1024]; size_t nRead; - Bu::File f( argv[0], Bu::File::Write ); - Bu::BZip2 bz2( f ); - Bu::File fin( argv[1], Bu::File::Read ); + + Bu::File f( argv[2], Bu::File::WriteNew ); + Bu::BZip2 bz2( f ); for(;;) { diff --git a/src/trace.cpp b/src/trace.cpp index 906ce54..03181e9 100644 --- a/src/trace.cpp +++ b/src/trace.cpp @@ -12,69 +12,6 @@ void Bu::__tracer( const char *pf ) printf("trace: %s\n", pf ); } -template<> void Bu::__tracer_format( const int8_t &v ) -{ - printf("%hhd", v ); -} - -template<> void Bu::__tracer_format( const uint8_t &v ) -{ - printf("%hhu", v ); -} - -template<> void Bu::__tracer_format( const int16_t &v ) -{ - printf("%hd", v ); -} - -template<> void Bu::__tracer_format( const uint16_t &v ) -{ - printf("%hu", v ); -} - -template<> void Bu::__tracer_format( const int32_t &v ) -{ - printf("%d", v ); -} - -template<> void Bu::__tracer_format( const uint32_t &v ) -{ - printf("%u", v ); -} - -template<> void Bu::__tracer_format( const int64_t &v ) -{ - printf("%lld", v ); -} - -template<> void Bu::__tracer_format( const uint64_t &v ) -{ - printf("%llu", v ); -} - -template<> void Bu::__tracer_format( const bool &v ) -{ - if( v ) - printf("true"); - else - printf("false"); -} - -template<> void Bu::__tracer_format( const char &v ) -{ - printf("%hhd", v ); -} - -template<> void Bu::__tracer_format( const long &v ) -{ - printf("%ld", v ); -} - -template<> void Bu::__tracer_format( const unsigned long &v ) -{ - printf("%lu", v ); -} - template<> void Bu::__tracer_format( const float &v ) { printf("%f", v ); diff --git a/src/trace.h b/src/trace.h index 0ebd831..51dfb8e 100644 --- a/src/trace.h +++ b/src/trace.h @@ -13,6 +13,8 @@ #include #include +#include + namespace Bu { /* template void __tracer_format( t &v ) @@ -20,7 +22,10 @@ namespace Bu __tracer_format( *const_cast(&v) ); } */ - template void __tracer_format( const t &v ); + template void __tracer_format( const t &v ) + { + Bu::sio << v; + } void __tracer( const char *pf ); @@ -163,18 +168,6 @@ namespace Bu } #undef looper - template<> void __tracer_format( const int8_t &v ); - template<> void __tracer_format( const uint8_t &v ); - template<> void __tracer_format( const int16_t &v ); - template<> void __tracer_format( const uint16_t &v ); - template<> void __tracer_format( const int32_t &v ); - template<> void __tracer_format( const uint32_t &v ); - template<> void __tracer_format( const int64_t &v ); - template<> void __tracer_format( const uint64_t &v ); - template<> void __tracer_format( const bool &v ); - template<> void __tracer_format( const char &v ); - template<> void __tracer_format( const long &v ); - template<> void __tracer_format( const unsigned long &v ); template<> void __tracer_format( const float &v ); template<> void __tracer_format( const double &v ); template<> void __tracer_format( void * const &v ); -- cgit v1.2.3