Source-Changes-HG archive

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

[src/trunk]: src/sbin/gpt handle constness better



details:   https://anonhg.NetBSD.org/src/rev/a783ac5f381d
branches:  trunk
changeset: 803953:a783ac5f381d
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Nov 17 07:15:28 2014 +0000

description:
handle constness better

diffstat:

 sbin/gpt/gpt.c |  7 +++----
 sbin/gpt/gpt.h |  2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diffs (43 lines):

diff -r 90879fecc9c7 -r a783ac5f381d sbin/gpt/gpt.c
--- a/sbin/gpt/gpt.c    Mon Nov 17 07:13:42 2014 +0000
+++ b/sbin/gpt/gpt.c    Mon Nov 17 07:15:28 2014 +0000
@@ -35,7 +35,7 @@
 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
 #endif
 #ifdef __RCSID
-__RCSID("$NetBSD: gpt.c,v 1.38 2014/11/17 07:13:42 mlelstv Exp $");
+__RCSID("$NetBSD: gpt.c,v 1.39 2014/11/17 07:15:28 mlelstv Exp $");
 #endif
 
 #include <sys/param.h>
@@ -65,7 +65,7 @@
 
 char   device_path[MAXPATHLEN];
 const char *device_arg;
-char   *device_name;
+const char *device_name;
 
 off_t  mediasz;
 
@@ -563,8 +563,7 @@
 
        mode = readonly ? O_RDONLY : O_RDWR|O_EXCL;
 
-       device_arg = dev;
-       device_name = __UNCONST(device_arg);
+       device_arg = device_name = dev;
        fd = opendisk(dev, mode, device_path, sizeof(device_path), 0);
        if (fd == -1)
                return -1;
diff -r 90879fecc9c7 -r a783ac5f381d sbin/gpt/gpt.h
--- a/sbin/gpt/gpt.h    Mon Nov 17 07:13:42 2014 +0000
+++ b/sbin/gpt/gpt.h    Mon Nov 17 07:15:28 2014 +0000
@@ -61,7 +61,7 @@
 };
 
 extern const char *device_arg;
-extern char *device_name;
+extern const char *device_name;
 extern off_t mediasz;
 extern u_int parts;
 extern u_int secsz;



Home | Main Index | Thread Index | Old Index