From: Theodore Ts'o Date: Tue, 17 Aug 2021 21:56:55 +0000 (-0400) Subject: libe2p: fix missing-prototypes and sign-compare -Wall warnings X-Git-Tag: v1.46.4~5 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c1f6a951f97f3f96509fd03998197c4bb21ed0c2;p=tools%2Fe2fsprogs.git libe2p: fix missing-prototypes and sign-compare -Wall warnings Signed-off-by: Theodore Ts'o --- diff --git a/lib/e2p/e2p.h b/lib/e2p/e2p.h index 65702a7..5f4793e 100644 --- a/lib/e2p/e2p.h +++ b/lib/e2p/e2p.h @@ -89,4 +89,4 @@ const char *e2p_encoding2str(int encoding); int e2p_get_encoding_flags(int encoding); int e2p_str2encoding_flags(int encoding, char *param, __u16 *flags); -const char *e2p_errcode2str(int err); +const char *e2p_errcode2str(unsigned int err); diff --git a/lib/e2p/errcode.c b/lib/e2p/errcode.c index 7e42655..1627c9d 100644 --- a/lib/e2p/errcode.c +++ b/lib/e2p/errcode.c @@ -7,6 +7,8 @@ #include #include +#include "e2p.h" + static const char *err_string[] = { "", "UNKNOWN", /* 1 */ @@ -32,14 +34,14 @@ static const char *err_string[] = { (sizeof(array) / sizeof(array[0])) /* Return the name of an encoding or NULL */ -const char *e2p_errcode2str(int err) +const char *e2p_errcode2str(unsigned int err) { static char buf[32]; if (err < ARRAY_SIZE(err_string)) return err_string[err]; - sprintf(buf, "UNKNOWN_ERRCODE_%d", err); + sprintf(buf, "UNKNOWN_ERRCODE_%u", err); return buf; }