Module Name:    src
Committed By:   lukem
Date:           Sun Apr 26 04:54:27 UTC 2009

Modified Files:
        src/usr.sbin/ofctl: ofctl.c

Log Message:
Fix WARNS=4 issues (-Wcast-qual -Wsign-compare)
Fixes PR bin/41283


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/usr.sbin/ofctl/ofctl.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/ofctl/ofctl.c
diff -u src/usr.sbin/ofctl/ofctl.c:1.9 src/usr.sbin/ofctl/ofctl.c:1.10
--- src/usr.sbin/ofctl/ofctl.c:1.9	Mon Jul 21 13:36:59 2008
+++ src/usr.sbin/ofctl/ofctl.c	Sun Apr 26 04:54:27 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofctl.c,v 1.9 2008/07/21 13:36:59 lukem Exp $	*/
+/*	$NetBSD: ofctl.c,v 1.10 2009/04/26 04:54:27 lukem Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2006, 2007\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: ofctl.c,v 1.9 2008/07/21 13:36:59 lukem Exp $");
+__RCSID("$NetBSD: ofctl.c,v 1.10 2009/04/26 04:54:27 lukem Exp $");
 #endif /* not lint */
 
 #include <stdio.h>
@@ -55,7 +55,7 @@
 
 static void oflist(int, const char *, int, void *, size_t);
 static void ofprop(int);
-static void ofgetprop(int, char *);
+static void ofgetprop(int, const char *);
 #if 0
 static int isstrprint(const char *, size_t, int);
 #endif
@@ -91,11 +91,11 @@
 int OF_child(int);
 int OF_peer(int);
 int OF_finddevice(const char *);
-int OF_getproplen(int, char *);
-int OF_getprop(int, char *, void *, size_t);
-int OF_nextprop(int, char *, void *);
+int OF_getproplen(int, const char *);
+int OF_getprop(int, const char *, void *, size_t);
+int OF_nextprop(int, const char *, void *);
 
-struct of_prop *of_tree_getprop(int, char *);
+struct of_prop *of_tree_getprop(int, const char *);
 
 static void
 of_tree_mkprop(struct of_node *node, prop_dictionary_t propdict,
@@ -401,7 +401,7 @@
 }
 
 struct of_prop *
-of_tree_getprop(int nodeid, char *name)
+of_tree_getprop(int nodeid, const char *name)
 {
 	struct of_node *node;
 	struct of_prop *prop;
@@ -431,14 +431,14 @@
 }
 
 int
-OF_getproplen(int nodeid, char *name)
+OF_getproplen(int nodeid, const char *name)
 {
 	struct of_prop *prop = of_tree_getprop(nodeid, name);
-	return (prop != NULL) ? prop->prop_length : -1;
+	return (prop != NULL) ? (int)prop->prop_length : -1;
 }
 
 int
-OF_getprop(int nodeid, char *name, void *buf, size_t len)
+OF_getprop(int nodeid, const char *name, void *buf, size_t len)
 {
 	struct of_prop *prop = of_tree_getprop(nodeid, name);
 	if (prop == NULL)
@@ -450,7 +450,7 @@
 }
 
 int
-OF_nextprop(int nodeid, char *name, void *nextname)
+OF_nextprop(int nodeid, const char *name, void *nextname)
 {
 	struct of_prop *prop = of_tree_getprop(nodeid, name);
 	if (prop == NULL)
@@ -897,7 +897,7 @@
 };
 
 static void
-ofgetprop(int node, char *name)
+ofgetprop(int node, const char *name)
 {
 	u_int8_t of_buf[4097];
 	int len;

Reply via email to