Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/memswitch Eliminate gcc warnings...



details:   https://anonhg.NetBSD.org/src/rev/38c5125b8466
branches:  trunk
changeset: 474003:38c5125b8466
user:      minoura <minoura%NetBSD.org@localhost>
date:      Fri Jun 25 14:27:55 1999 +0000

description:
Eliminate gcc warnings...

diffstat:

 usr.sbin/memswitch/memswitch.c |  11 ++++++-----
 usr.sbin/memswitch/methods.c   |   8 ++++----
 usr.sbin/memswitch/methods.h   |   4 ++--
 3 files changed, 12 insertions(+), 11 deletions(-)

diffs (97 lines):

diff -r 4ee67c3676c8 -r 38c5125b8466 usr.sbin/memswitch/memswitch.c
--- a/usr.sbin/memswitch/memswitch.c    Fri Jun 25 12:10:42 1999 +0000
+++ b/usr.sbin/memswitch/memswitch.c    Fri Jun 25 14:27:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memswitch.c,v 1.1.1.1 1999/06/21 15:56:03 minoura Exp $        */
+/*     $NetBSD: memswitch.c,v 1.2 1999/06/25 14:27:55 minoura Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -55,6 +55,7 @@
 int nflag = 0;
 u_int8_t *current_values = 0;
 u_int8_t *modified_values = 0;
+int main __P((int, char*[]));
 
 void
 usage(void)
@@ -210,7 +211,7 @@
                        l = i + 1;
                        class = alloca(l);
                        if (class == 0)
-                               err (1, NULL);
+                               err (1, "alloca");
                        strncpy (class, expr, i);
                        class[i] = 0;
                        break;
@@ -223,7 +224,7 @@
                if (expr[i] == '=') {
                        node = alloca(i - l + 1);
                        if (node == 0)
-                               err (1, NULL);
+                               err (1, "alloca");
                        strncpy (node, &(expr[l]), i - l);
                        node[i - l] = 0;
                        break;
@@ -287,7 +288,7 @@
                alloc_current_values();
        modified_values = malloc (256);
        if (modified_values == 0)
-               err (1, NULL);
+               err (1, "malloc");
        memcpy (modified_values, current_values, 256);
 }
 
@@ -300,7 +301,7 @@
 
        current_values = malloc (256);
        if (current_values == 0)
-               err (1, "Opening %s", _PATH_DEVSRAM);
+               err (1, "malloc");
 
        sramfd = open (_PATH_DEVSRAM, O_RDONLY);
        if (sramfd < 0)
diff -r 4ee67c3676c8 -r 38c5125b8466 usr.sbin/memswitch/methods.c
--- a/usr.sbin/memswitch/methods.c      Fri Jun 25 12:10:42 1999 +0000
+++ b/usr.sbin/memswitch/methods.c      Fri Jun 25 14:27:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: methods.c,v 1.1.1.1 1999/06/21 15:56:03 minoura Exp $  */
+/*     $NetBSD: methods.c,v 1.2 1999/06/25 14:27:55 minoura Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -42,13 +42,13 @@
 #include <sys/types.h>
 
 #include "memswitch.h"
-
+#include "methods.h"
 
 int
 atoi_ (p)
-       char **p;
+        const char **p;
 {
-       char *p1 = *p;
+       const char *p1 = *p;
        int v = 0;
        int first = 1;
 
diff -r 4ee67c3676c8 -r 38c5125b8466 usr.sbin/memswitch/methods.h
--- a/usr.sbin/memswitch/methods.h      Fri Jun 25 12:10:42 1999 +0000
+++ b/usr.sbin/memswitch/methods.h      Fri Jun 25 14:27:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: methods.h,v 1.1.1.1 1999/06/21 15:56:03 minoura Exp $  */
+/*     $NetBSD: methods.h,v 1.2 1999/06/25 14:27:55 minoura Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 
-int atoi_ __P((char*));
+int atoi_ __P((const char**));
 
 int fill_uchar __P((struct property*));
 int fill_ushort __P((struct property*));



Home | Main Index | Thread Index | Old Index