Module Name: src
Committed By: lukem
Date: Sun Apr 26 01:51:07 UTC 2009
Modified Files:
src/usr.sbin/eeprom: defs.h main.c
Log Message:
Fix WARNS=4 issues (-Wextra -Wcast-qual).
Resolves PR bin/41282
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/eeprom/defs.h
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/eeprom/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/eeprom/defs.h
diff -u src/usr.sbin/eeprom/defs.h:1.11 src/usr.sbin/eeprom/defs.h:1.12
--- src/usr.sbin/eeprom/defs.h:1.11 Mon Apr 28 20:24:15 2008
+++ src/usr.sbin/eeprom/defs.h Sun Apr 26 01:51:07 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.11 2008/04/28 20:24:15 martin Exp $ */
+/* $NetBSD: defs.h,v 1.12 2009/04/26 01:51:07 lukem Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
* `just print' or don't know how to deal with.
*/
struct extabent {
- char *ex_keyword; /* keyword for this entry */
+ const char *ex_keyword; /* keyword for this entry */
void (*ex_handler) (struct extabent *,
struct opiocdesc *, char *);
/* handler function for this entry */
@@ -92,7 +92,7 @@
#ifdef USE_OPENFIRM
struct extabent {
- char *ex_keyword; /* keyword for this entry */
+ const char *ex_keyword; /* keyword for this entry */
void (*ex_handler) (struct extabent *,
struct ofiocdesc *, char *);
/* handler function for this entry */
@@ -101,7 +101,7 @@
#ifdef USE_PREPNVRAM
struct extabent {
- char *ex_keyword; /* keyword for this entry */
+ const char *ex_keyword; /* keyword for this entry */
void (*ex_handler) (struct extabent *,
struct pnviocdesc *, char *);
/* handler function for this entry */
Index: src/usr.sbin/eeprom/main.c
diff -u src/usr.sbin/eeprom/main.c:1.19 src/usr.sbin/eeprom/main.c:1.20
--- src/usr.sbin/eeprom/main.c:1.19 Mon Jul 21 13:36:58 2008
+++ src/usr.sbin/eeprom/main.c Sun Apr 26 01:51:07 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.19 2008/07/21 13:36:58 lukem Exp $ */
+/* $NetBSD: main.c,v 1.20 2009/04/26 01:51:07 lukem Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1996\
The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: main.c,v 1.19 2008/07/21 13:36:58 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.20 2009/04/26 01:51:07 lukem Exp $");
#endif
#include <sys/param.h>
@@ -65,10 +65,10 @@
static void dump_prom (void);
static void usage (void);
-char *path_eeprom = _PATH_EEPROM;
-char *path_openprom = _PATH_OPENPROM;
-char *path_openfirm = _PATH_OPENFIRM;
-char *path_prepnvram = _PATH_PREPNVRAM;
+const char *path_eeprom = _PATH_EEPROM;
+const char *path_openprom = _PATH_OPENPROM;
+const char *path_openfirm = _PATH_OPENFIRM;
+const char *path_prepnvram = _PATH_PREPNVRAM;
int fix_checksum = 0;
int ignore_checksum = 0;
int update_checksums = 0;
@@ -91,7 +91,7 @@
int ch, do_stdin = 0;
char *cp, line[BUFSIZE];
#if defined(USE_OPENPROM) || defined(USE_OPENFIRM) || defined(USE_PREPNVRAM)
- char *optstring = "-cf:iv";
+ const char *optstring = "-cf:iv";
#else
char *optstring = "-cf:i";
#endif /* USE_OPENPROM */
@@ -201,9 +201,12 @@
#ifdef USE_OPENPROM
if (use_openprom)
op_action(keyword, arg);
- else
+ else {
#endif /* USE_OPENPROM */
ee_action(keyword, arg);
+#ifdef USE_OPENPROM
+ }
+#endif /* USE_OPENPROM */
#endif /* USE_OPENFIRM */
#endif /* USE_PREPNVRAM */
}
@@ -227,9 +230,12 @@
* We have a special dump routine for this.
*/
op_dump();
- else
+ else {
#endif /* USE_OPENPROM */
ee_dump();
+#ifdef USE_OPENPROM
+ }
+#endif /* USE_OPENPROM */
#endif /* USE_OPENFIRM */
#endif /* USE_PREPNVRAM */
}