Declare local functions as static Warned-by: gcc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
diff --git a/test/md5.c b/test/md5.c
index 345c257..c635c77 100644
--- a/test/md5.c
+++ b/test/md5.c
@@ -36,7 +36,7 @@
DEF_TEST_DIGEST(MD5, MD5)
-void
+static void
test_MD5_aladdin(const char *hash_str_ref, const char *data)
{
uint8_t hash_bin_ref[MD5_DIGEST_LENGTH];
@@ -46,12 +46,12 @@ test_MD5_aladdin(const char *hash_str_ref, const char *data)
hex2bin(hash_bin_ref, hash_str_ref, MD5_DIGEST_LENGTH);
md5_init(&pms);
- md5_append(&pms, data, strlen(data));
+ md5_append(&pms, (const uint8_t *)data, strlen(data));
md5_finish(&pms, hash_bin_got);
assert(memcmp(hash_bin_ref, hash_bin_got, MD5_DIGEST_LENGTH) == 0);
}
-void
+static void
test_MD5_all(const char *hash_str_ref, const char *data)
{
test_MD5(hash_str_ref, data);
diff --git a/test/test.h b/test/test.h
index fb3780d..e937ea3 100644
--- a/test/test.h
+++ b/test/test.h
@@ -52,7 +52,7 @@ hex2bin(uint8_t *bin, const char *str, size_t bin_len)
}
#define DEF_TEST_DIGEST(name, type) \
-void \
+static void \
test_##name(const char *hash_str_ref, const char *data) \
{ \
uint8_t hash_bin_ref[name##_DIGEST_LENGTH]; \