summaryrefslogtreecommitdiff
path: root/src/trace.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2008-06-07 05:30:58 +0000
committerMike Buland <eichlan@xagasoft.com>2008-06-07 05:30:58 +0000
commit555ba77568b6faf18ebaed06cd08615deab2d8e3 (patch)
treedb4586b7849b1fbdc045c36b386dac0345b82d99 /src/trace.h
parentdc95fa94c1a8bb7249034d6fd2e61f80df48b317 (diff)
downloadlibbu++-555ba77568b6faf18ebaed06cd08615deab2d8e3.tar.gz
libbu++-555ba77568b6faf18ebaed06cd08615deab2d8e3.tar.bz2
libbu++-555ba77568b6faf18ebaed06cd08615deab2d8e3.tar.xz
libbu++-555ba77568b6faf18ebaed06cd08615deab2d8e3.zip
This is a testing version. Nothing should be broken, but I won't gurantee it.
I wouldn't update to this just yet, if you have problems, back off a rev. I'm trying to update the code to work on both 32bit, and 64bit systems, and hopefully anything else that comes along. Currently some of the archive code is broken, testing must be done on both archetectures.
Diffstat (limited to 'src/trace.h')
-rw-r--r--src/trace.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/trace.h b/src/trace.h
index e115d66..7a1f368 100644
--- a/src/trace.h
+++ b/src/trace.h
@@ -10,6 +10,7 @@
10 10
11#include <stdio.h> 11#include <stdio.h>
12#include <stdint.h> 12#include <stdint.h>
13#include <stddef.h>
13 14
14namespace Bu 15namespace Bu
15{ 16{
@@ -27,7 +28,7 @@ namespace Bu
27 { \ 28 { \
28 if( *n == ',' || *n == ')' ) \ 29 if( *n == ',' || *n == ')' ) \
29 { \ 30 { \
30 fwrite( s, (int)n-(int)s, 1, stdout ); \ 31 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout ); \
31 fwrite("=", 1, 1, stdout); \ 32 fwrite("=", 1, 1, stdout); \
32 __tracer_format( vv ); \ 33 __tracer_format( vv ); \
33 s = n; \ 34 s = n; \
@@ -42,7 +43,7 @@ namespace Bu
42 const char *s = pf; 43 const char *s = pf;
43 const char *n = pf; 44 const char *n = pf;
44 looper( v1 ); 45 looper( v1 );
45 fwrite( s, (int)n-(int)s, 1, stdout ); 46 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
46 fwrite( "\n", 1, 1, stdout ); 47 fwrite( "\n", 1, 1, stdout );
47 } 48 }
48 49
@@ -54,7 +55,7 @@ namespace Bu
54 const char *n = pf; 55 const char *n = pf;
55 looper( v1 ); 56 looper( v1 );
56 looper( v2 ); 57 looper( v2 );
57 fwrite( s, (int)n-(int)s, 1, stdout ); 58 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
58 fwrite( "\n", 1, 1, stdout ); 59 fwrite( "\n", 1, 1, stdout );
59 } 60 }
60 61
@@ -67,7 +68,7 @@ namespace Bu
67 looper( v1 ); 68 looper( v1 );
68 looper( v2 ); 69 looper( v2 );
69 looper( v3 ); 70 looper( v3 );
70 fwrite( s, (int)n-(int)s, 1, stdout ); 71 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
71 fwrite( "\n", 1, 1, stdout ); 72 fwrite( "\n", 1, 1, stdout );
72 } 73 }
73 74
@@ -81,7 +82,7 @@ namespace Bu
81 looper( v2 ); 82 looper( v2 );
82 looper( v3 ); 83 looper( v3 );
83 looper( v4 ); 84 looper( v4 );
84 fwrite( s, (int)n-(int)s, 1, stdout ); 85 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
85 fwrite( "\n", 1, 1, stdout ); 86 fwrite( "\n", 1, 1, stdout );
86 } 87 }
87 88
@@ -96,7 +97,7 @@ namespace Bu
96 looper( v3 ); 97 looper( v3 );
97 looper( v4 ); 98 looper( v4 );
98 looper( v5 ); 99 looper( v5 );
99 fwrite( s, (int)n-(int)s, 1, stdout ); 100 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
100 fwrite( "\n", 1, 1, stdout ); 101 fwrite( "\n", 1, 1, stdout );
101 } 102 }
102 103
@@ -114,7 +115,7 @@ namespace Bu
114 looper( v4 ); 115 looper( v4 );
115 looper( v5 ); 116 looper( v5 );
116 looper( v6 ); 117 looper( v6 );
117 fwrite( s, (int)n-(int)s, 1, stdout ); 118 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
118 fwrite( "\n", 1, 1, stdout ); 119 fwrite( "\n", 1, 1, stdout );
119 } 120 }
120 121
@@ -133,7 +134,7 @@ namespace Bu
133 looper( v5 ); 134 looper( v5 );
134 looper( v6 ); 135 looper( v6 );
135 looper( v7 ); 136 looper( v7 );
136 fwrite( s, (int)n-(int)s, 1, stdout ); 137 fwrite( s, (ptrdiff_t)n-(ptrdiff_t)s, 1, stdout );
137 fwrite( "\n", 1, 1, stdout ); 138 fwrite( "\n", 1, 1, stdout );
138 } 139 }
139#undef looper 140#undef looper
@@ -148,8 +149,8 @@ namespace Bu
148 template<> void __tracer_format<uint64_t>( const uint64_t &v ); 149 template<> void __tracer_format<uint64_t>( const uint64_t &v );
149 template<> void __tracer_format<bool>( const bool &v ); 150 template<> void __tracer_format<bool>( const bool &v );
150 template<> void __tracer_format<char>( const char &v ); 151 template<> void __tracer_format<char>( const char &v );
151 template<> void __tracer_format<long>( const long &v ); 152 //template<> void __tracer_format<long>( const long &v );
152 template<> void __tracer_format<unsigned long>( const unsigned long &v ); 153 //template<> void __tracer_format<unsigned long>( const unsigned long &v );
153 template<> void __tracer_format<float>( const float &v ); 154 template<> void __tracer_format<float>( const float &v );
154 template<> void __tracer_format<double>( const double &v ); 155 template<> void __tracer_format<double>( const double &v );
155 template<> void __tracer_format<void *>( void * const &v ); 156 template<> void __tracer_format<void *>( void * const &v );