From c1f6a951f97f3f96509fd03998197c4bb21ed0c2 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 17 Aug 2021 17:56:55 -0400 Subject: [PATCH] libe2p: fix missing-prototypes and sign-compare -Wall warnings Signed-off-by: Theodore Ts'o --- lib/e2p/e2p.h | 2 +- lib/e2p/errcode.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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; } -- 1.8.3.1