]> mj.ucw.cz Git - libucw.git/blobdiff - lib/profile.h
When writing, the data needn't start at the beginning of the buffer.
[libucw.git] / lib / profile.h
index 1332d21e33292825818a3a8274181ba72b31a242..1d38251969485491a5c2d4c3d67dd20884901dc0 100644 (file)
@@ -2,6 +2,9 @@
  *     Sherlock Library -- Poor Man's Profiler
  *
  *     (c) 2001 Martin Mares <mj@ucw.cz>
  *     Sherlock Library -- Poor Man's Profiler
  *
  *     (c) 2001 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 /*
  */
 
 /*
@@ -120,7 +123,7 @@ typedef struct prof_ktsc prof_t;
 static inline void prof_start(prof_t *c) { prof_switch(NULL, c); }
 static inline void prof_stop(prof_t *c) { prof_switch(c, NULL); }
 #endif
 static inline void prof_start(prof_t *c) { prof_switch(NULL, c); }
 static inline void prof_stop(prof_t *c) { prof_switch(c, NULL); }
 #endif
-#define PROF_STR(c) ({ static byte _x[PROF_STR_SIZE]; prof_format(_x, &(C)); _x })
+#define PROF_STR(C) ({ static byte _x[PROF_STR_SIZE]; prof_format(_x, &(C)); _x; })
 
 #else
 
 
 #else
 
@@ -132,5 +135,6 @@ static inline void prof_stop(prof_t *c UNUSED) { }
 static inline void prof_switch(prof_t *c UNUSED, prof_t *d UNUSED) { }
 static inline void prof_format(char *b, prof_t *c UNUSED) { b[0]='?'; b[1]=0; }
 #define PROF_STR_SIZE 2
 static inline void prof_switch(prof_t *c UNUSED, prof_t *d UNUSED) { }
 static inline void prof_format(char *b, prof_t *c UNUSED) { b[0]='?'; b[1]=0; }
 #define PROF_STR_SIZE 2
+#define PROF_STR(C) "?"
 
 #endif
 
 #endif