diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-06-14 15:16:58 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-06-14 15:16:58 +0000 |
commit | 2a8a2d2aed7faaa88e91f54871120f114645382d (patch) | |
tree | 88c021cb39f7a013b6ab9eba2ab9eeb44e614051 | |
parent | 5f2c95f9116f24ecd64b6361b6e22ce983732997 (diff) | |
download | libbu++-2a8a2d2aed7faaa88e91f54871120f114645382d.tar.gz libbu++-2a8a2d2aed7faaa88e91f54871120f114645382d.tar.bz2 libbu++-2a8a2d2aed7faaa88e91f54871120f114645382d.tar.xz libbu++-2a8a2d2aed7faaa88e91f54871120f114645382d.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/tests/bzip2.cpp | 6 | ||||
-rw-r--r-- | src/trace.cpp | 63 | ||||
-rw-r--r-- | 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[] ) | |||
19 | char buf[1024]; | 19 | char buf[1024]; |
20 | size_t nRead; | 20 | size_t nRead; |
21 | 21 | ||
22 | Bu::File f( argv[0], Bu::File::Write ); | ||
23 | Bu::BZip2 bz2( f ); | ||
24 | |||
25 | Bu::File fin( argv[1], Bu::File::Read ); | 22 | Bu::File fin( argv[1], Bu::File::Read ); |
23 | |||
24 | Bu::File f( argv[2], Bu::File::WriteNew ); | ||
25 | Bu::BZip2 bz2( f ); | ||
26 | 26 | ||
27 | for(;;) | 27 | for(;;) |
28 | { | 28 | { |
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 ) | |||
12 | printf("trace: %s\n", pf ); | 12 | printf("trace: %s\n", pf ); |
13 | } | 13 | } |
14 | 14 | ||
15 | template<> void Bu::__tracer_format<int8_t>( const int8_t &v ) | ||
16 | { | ||
17 | printf("%hhd", v ); | ||
18 | } | ||
19 | |||
20 | template<> void Bu::__tracer_format<uint8_t>( const uint8_t &v ) | ||
21 | { | ||
22 | printf("%hhu", v ); | ||
23 | } | ||
24 | |||
25 | template<> void Bu::__tracer_format<int16_t>( const int16_t &v ) | ||
26 | { | ||
27 | printf("%hd", v ); | ||
28 | } | ||
29 | |||
30 | template<> void Bu::__tracer_format<uint16_t>( const uint16_t &v ) | ||
31 | { | ||
32 | printf("%hu", v ); | ||
33 | } | ||
34 | |||
35 | template<> void Bu::__tracer_format<int32_t>( const int32_t &v ) | ||
36 | { | ||
37 | printf("%d", v ); | ||
38 | } | ||
39 | |||
40 | template<> void Bu::__tracer_format<uint32_t>( const uint32_t &v ) | ||
41 | { | ||
42 | printf("%u", v ); | ||
43 | } | ||
44 | |||
45 | template<> void Bu::__tracer_format<int64_t>( const int64_t &v ) | ||
46 | { | ||
47 | printf("%lld", v ); | ||
48 | } | ||
49 | |||
50 | template<> void Bu::__tracer_format<uint64_t>( const uint64_t &v ) | ||
51 | { | ||
52 | printf("%llu", v ); | ||
53 | } | ||
54 | |||
55 | template<> void Bu::__tracer_format<bool>( const bool &v ) | ||
56 | { | ||
57 | if( v ) | ||
58 | printf("true"); | ||
59 | else | ||
60 | printf("false"); | ||
61 | } | ||
62 | |||
63 | template<> void Bu::__tracer_format<char>( const char &v ) | ||
64 | { | ||
65 | printf("%hhd", v ); | ||
66 | } | ||
67 | |||
68 | template<> void Bu::__tracer_format<long>( const long &v ) | ||
69 | { | ||
70 | printf("%ld", v ); | ||
71 | } | ||
72 | |||
73 | template<> void Bu::__tracer_format<unsigned long>( const unsigned long &v ) | ||
74 | { | ||
75 | printf("%lu", v ); | ||
76 | } | ||
77 | |||
78 | template<> void Bu::__tracer_format<float>( const float &v ) | 15 | template<> void Bu::__tracer_format<float>( const float &v ) |
79 | { | 16 | { |
80 | printf("%f", v ); | 17 | 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 @@ | |||
13 | #include <stddef.h> | 13 | #include <stddef.h> |
14 | #include <string.h> | 14 | #include <string.h> |
15 | 15 | ||
16 | #include <bu/sio.h> | ||
17 | |||
16 | namespace Bu | 18 | namespace Bu |
17 | { | 19 | { |
18 | /* template<typename t> void __tracer_format( t &v ) | 20 | /* template<typename t> void __tracer_format( t &v ) |
@@ -20,7 +22,10 @@ namespace Bu | |||
20 | __tracer_format( *const_cast<const t *>(&v) ); | 22 | __tracer_format( *const_cast<const t *>(&v) ); |
21 | } | 23 | } |
22 | */ | 24 | */ |
23 | template<typename t> void __tracer_format( const t &v ); | 25 | template<typename t> void __tracer_format( const t &v ) |
26 | { | ||
27 | Bu::sio << v; | ||
28 | } | ||
24 | 29 | ||
25 | void __tracer( const char *pf ); | 30 | void __tracer( const char *pf ); |
26 | 31 | ||
@@ -163,18 +168,6 @@ namespace Bu | |||
163 | } | 168 | } |
164 | #undef looper | 169 | #undef looper |
165 | 170 | ||
166 | template<> void __tracer_format<int8_t>( const int8_t &v ); | ||
167 | template<> void __tracer_format<uint8_t>( const uint8_t &v ); | ||
168 | template<> void __tracer_format<int16_t>( const int16_t &v ); | ||
169 | template<> void __tracer_format<uint16_t>( const uint16_t &v ); | ||
170 | template<> void __tracer_format<int32_t>( const int32_t &v ); | ||
171 | template<> void __tracer_format<uint32_t>( const uint32_t &v ); | ||
172 | template<> void __tracer_format<int64_t>( const int64_t &v ); | ||
173 | template<> void __tracer_format<uint64_t>( const uint64_t &v ); | ||
174 | template<> void __tracer_format<bool>( const bool &v ); | ||
175 | template<> void __tracer_format<char>( const char &v ); | ||
176 | template<> void __tracer_format<long>( const long &v ); | ||
177 | template<> void __tracer_format<unsigned long>( const unsigned long &v ); | ||
178 | template<> void __tracer_format<float>( const float &v ); | 171 | template<> void __tracer_format<float>( const float &v ); |
179 | template<> void __tracer_format<double>( const double &v ); | 172 | template<> void __tracer_format<double>( const double &v ); |
180 | template<> void __tracer_format<void *>( void * const &v ); | 173 | template<> void __tracer_format<void *>( void * const &v ); |