bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix compiler warnings in hurd/libshouldbeinlibc


From: Flavio Cruz
Subject: [PATCH] fix compiler warnings in hurd/libshouldbeinlibc
Date: Tue, 29 Dec 2015 22:48:16 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

---

libshouldbeinlibc: Fix compiler warnings.

* libshouldbeinlibc/portinfo.c: Fix format strings.
* libshouldbeinlibc/xportinfo.c: Likewise.
* libshouldbeinlibc/ugids-verify-auth.c (server_verify_make_auth): Drop the
const qualifier.

diff --git a/libshouldbeinlibc/portinfo.c b/libshouldbeinlibc/portinfo.c
index e6305c6..f3c540f 100644
--- a/libshouldbeinlibc/portinfo.c
+++ b/libshouldbeinlibc/portinfo.c
@@ -53,7 +53,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, 
task_t task,
        return err;
     }
 
-  fprintf (stream, hex_names ? "%#6zx: " : "%6zd: ", name);
+  fprintf (stream, hex_names ? "%#6lx: " : "%6lu: ", name);
 
   if (type & MACH_PORT_TYPE_RECEIVE)
     {
@@ -68,7 +68,7 @@ print_port_info (mach_port_t name, mach_port_type_t type, 
task_t task,
              fprintf (stream, " (");
              if (status.mps_pset != MACH_PORT_NULL)
                fprintf (stream,
-                        hex_names ? "port-set: %#zx, " : "port-set: %zd, ",
+                        hex_names ? "port-set: %#lx, " : "port-set: %lu, ",
                         status.mps_pset);
              fprintf (stream, "seqno: %zu", status.mps_seqno);
              if (status.mps_mscount)
@@ -119,9 +119,9 @@ print_port_info (mach_port_t name, mach_port_type_t type, 
task_t task,
                fprintf (stream, " (empty)");
              else
                {
-                 fprintf (stream, hex_names ? " (%#zx" : " (%zu", members[0]);
+                 fprintf (stream, hex_names ? " (%#lx" : " (%lu", members[0]);
                  for (i = 1; i < members_len; i++)
-                   fprintf (stream, hex_names ? ", %#zx" : ", %zu",
+                   fprintf (stream, hex_names ? ", %#lx" : ", %lu",
                             members[i]);
                  fprintf (stream, ")");
                  munmap ((caddr_t) members, members_len * sizeof *members);
diff --git a/libshouldbeinlibc/ugids-verify-auth.c 
b/libshouldbeinlibc/ugids-verify-auth.c
index 0e85b1b..3470d37 100644
--- a/libshouldbeinlibc/ugids-verify-auth.c
+++ b/libshouldbeinlibc/ugids-verify-auth.c
@@ -65,9 +65,10 @@ server_verify_make_auth (const char *password,
 {
   auth_t auth;
   struct svma_state *svma_state = hook;
-  error_t (*check) (io_t server, uid_t id, const char *passwd, auth_t *auth) =
+  /* Mig routines don't use 'const' for passwd.  */
+  error_t (*check) (io_t server, uid_t id, char *passwd, auth_t *auth) =
     is_group ? password_check_group : password_check_user;
-  error_t err = (*check) (svma_state->server, id, password, &auth);
+  error_t err = (*check) (svma_state->server, id, (char *) password, &auth);
 
   if (! err)
     /* PASSWORD checked out ok; the corresponding authentication is in AUTH. */
diff --git a/libshouldbeinlibc/xportinfo.c b/libshouldbeinlibc/xportinfo.c
index cce6fb6..47e6dd9 100644
--- a/libshouldbeinlibc/xportinfo.c
+++ b/libshouldbeinlibc/xportinfo.c
@@ -35,7 +35,7 @@ print_xlated_port_info (mach_port_t name, mach_port_type_t 
type,
   error_t err = port_name_xlator_xlate (x, name, type, &name, &type);
   if (! err)
     {
-      fprintf (stream, (show & PORTINFO_HEX_NAMES) ? "%#6zx => " : "%6zd => ",
+      fprintf (stream, (show & PORTINFO_HEX_NAMES) ? "%#6lx => " : "%6lu => ",
               old_name);
       err = print_port_info (name, type, x->to_task, show, stream);
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]