aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2020-09-09 20:32:37 +0100
committerTomasz Kramkowski <tk@the-tk.com>2020-09-09 20:32:41 +0100
commitaa28590647251cfd8f4f2b805a56c1b741aca565 (patch)
treebefb4fa7fbdc9994596a833536f920245f509476
parent4f347e7a16d8b0144c84e0a349f66fcd3b473f02 (diff)
downloadpack-aa28590647251cfd8f4f2b805a56c1b741aca565.tar.gz
pack-aa28590647251cfd8f4f2b805a56c1b741aca565.tar.xz
pack-aa28590647251cfd8f4f2b805a56c1b741aca565.zip
Make functions static
-rw-r--r--test_gen.c12
-rw-r--r--trace.c2
-rw-r--r--unpack.c2
-rw-r--r--unpack_test.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/test_gen.c b/test_gen.c
index f5ec5c0..d7c4cef 100644
--- a/test_gen.c
+++ b/test_gen.c
@@ -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;
diff --git a/trace.c b/trace.c
index b814d01..82c00f1 100644
--- a/trace.c
+++ b/trace.c
@@ -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;
diff --git a/unpack.c b/unpack.c
index b30fa6c..ba06a24 100644
--- a/unpack.c
+++ b/unpack.c
@@ -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__ }