Use CHAR_BIT instead of 8 for float and string
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Sep 2010 01:33:02 +0000 (21:33 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Sep 2010 01:33:02 +0000 (21:33 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/types/float.c
formats/ctf/types/string.c

index a26e94cc20760e9fd88088ac464655964a371df0..ce094747113f762c3f8785a9af913d7128de0882 100644 (file)
@@ -25,6 +25,7 @@
 #include <babeltrace/ctf/types.h>
 #include <glib.h>
 #include <float.h>     /* C99 floating point definitions */
+#include <limits.h>    /* C99 limits */
 #include <endian.h>
 
 /*
index 65018c74fb128e4d6a76ba4a72bd273c5e70eca1..9cfd0a094e723800c6301e16473227009642f01b 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <babeltrace/ctf/types.h>
+#include <limits.h>            /* C99 limits */
 #include <string.h>
 
 size_t string_copy(char *dest, const char *src)
@@ -31,5 +32,5 @@ size_t string_copy(char *dest, const char *src)
                goto end;
        strcpy(dest, src);
 end:
-       return len * 8;
+       return len * CHAR_BIT;
 }
This page took 0.024116 seconds and 4 git commands to generate.