diff options
-rw-r--r-- | test_gen.c | 12 | ||||
-rw-r--r-- | trace.c | 2 | ||||
-rw-r--r-- | unpack.c | 2 | ||||
-rw-r--r-- | unpack_test.c | 2 |
4 files changed, 9 insertions, 9 deletions
@@ -19,14 +19,14 @@ struct { { LITTLE, "<" }, }; -char cchar(char c) +static char cchar(char c) { if (c == '\0') return c; if (isalnum(c)) return c; return '_'; } -const char *cname(const char *s) +static const char *cname(const char *s) { static char ret[100]; for (int i = 0; i < 99; i++) { @@ -36,7 +36,7 @@ const char *cname(const char *s) return ret; } -const char *u2bytes(enum endian e, int n, uintmax_t v) +static const char *u2bytes(enum endian e, int n, uintmax_t v) { static char b[100]; char *p = b; @@ -52,7 +52,7 @@ const char *u2bytes(enum endian e, int n, uintmax_t v) return b; } -uintmax_t i2u(int n, intmax_t v) +static uintmax_t i2u(int n, intmax_t v) { if (v >= 0) return v; @@ -60,12 +60,12 @@ uintmax_t i2u(int n, intmax_t v) return (UINTMAX_MAX >> (sizeof (uintmax_t) * CHAR_BIT - n * 8)) + v + 1; } -const char *i2bytes(enum endian e, int n, intmax_t v) +static const char *i2bytes(enum endian e, int n, intmax_t v) { return u2bytes(e, n, i2u(n, v)); } -void generate_simple(FILE *out, char fmt, const char *type, intmax_t min, uintmax_t max, int size) +static void generate_simple(FILE *out, char fmt, const char *type, intmax_t min, uintmax_t max, int size) { unsigned char data[8]; char *prefix; @@ -10,7 +10,7 @@ enum pack_trace pack_trace = PACK_TRACE_OFF; -void trace(enum pack_trace level, const char *fmt, va_list va) +static void trace(enum pack_trace level, const char *fmt, va_list va) { char *type; @@ -15,7 +15,7 @@ enum endian { BIG, LITTLE }; -uintmax_t read_val(unsigned char *buf, size_t size, enum endian e) +static uintmax_t read_val(unsigned char *buf, size_t size, enum endian e) { uintmax_t val = 0; diff --git a/unpack_test.c b/unpack_test.c index f89cd62..d6e5a5e 100644 --- a/unpack_test.c +++ b/unpack_test.c @@ -16,7 +16,7 @@ struct test { char *desc; }; -#define TEST(name) bool test_##name(void) +#define TEST(name) static bool test_##name(void) #define TEST_ENTRY(name, description) { test_##name, description } #define TEST_ENTRY_END { NULL, NULL } #define DATA(...) (unsigned char []){ __VA_ARGS__ }, sizeof (unsigned char []){ __VA_ARGS__ } |