From: Dmitry V. Levin Date: Wed, 13 Dec 2017 04:05:01 +0000 (-0500) Subject: Fix compilation warnings in digest_encode.c X-Git-Tag: v1.43.8~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa04febc93fa3b871dc1e0e6deffedb9af42a58b;p=thirdparty%2Fe2fsprogs.git Fix compilation warnings in digest_encode.c Fix -Wpointer-sign and -Wunused-variable compilation warnings in digest_encode.c Signed-off-by: Dmitry V. Levin Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/digest_encode.c b/lib/ext2fs/digest_encode.c index d90b3006b..075963ffc 100644 --- a/lib/ext2fs/digest_encode.c +++ b/lib/ext2fs/digest_encode.c @@ -78,7 +78,7 @@ int ext2fs_digest_decode(const char *src, int len, char *dst) static const struct { unsigned char d[32]; unsigned int len; - const unsigned char *ed; + const char *ed; } tests[] = { { { 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, @@ -126,9 +126,9 @@ static const struct { int main(int argc, char **argv) { - int i, ret, len, len2; + int i, ret, len; int errors = 0; - unsigned char tmp[1024], tmp2[1024]; + char tmp[1024], tmp2[1024]; if (argc == 3 && !strcmp(argv[1], "encode")) { memset(tmp, 0, sizeof(tmp)); @@ -145,7 +145,8 @@ int main(int argc, char **argv) } for (i = 0; i < (int)(sizeof(tests) / sizeof(tests[0])); i++) { memset(tmp, 0, sizeof(tmp)); - ret = ext2fs_digest_encode(tests[i].d, tests[i].len, tmp); + ret = ext2fs_digest_encode((const char *) tests[i].d, + tests[i].len, tmp); len = strlen(tmp); printf("Test Digest %d (returned %d): ", i, ret); if (ret != len) {