Whamcloud - gitweb
libe2p: fix missing-prototypes and sign-compare -Wall warnings
authorTheodore Ts'o <tytso@mit.edu>
Tue, 17 Aug 2021 21:56:55 +0000 (17:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 19 Aug 2021 02:39:24 +0000 (22:39 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/e2p/e2p.h
lib/e2p/errcode.c

index 65702a7..5f4793e 100644 (file)
@@ -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);
index 7e42655..1627c9d 100644 (file)
@@ -7,6 +7,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#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;
 }