Remove some casts of NULL to pointer types which had accumulated.
authorSascha Wildner <saw@online.de>
Sat, 22 Feb 2014 17:22:27 +0000 (18:22 +0100)
committerSascha Wildner <saw@online.de>
Sat, 22 Feb 2014 17:34:14 +0000 (18:34 +0100)
They were brought back from FreeBSD with various updates.

12 files changed:
lib/libc/stdio/vfscanf.c
lib/libc/stdlib/atof.c
lib/libc/stdlib/atoi.c
lib/libc/stdlib/atol.c
lib/libc/stdlib/atoll.c
lib/libutil/pw_util.c
lib/libutil/uucplock.c
sbin/shutdown/shutdown.c
sys/dev/netif/oce/oce_hw.c
usr.bin/column/column.c
usr.bin/xinstall/xinstall.c
usr.sbin/syslogd/syslogd.c

index 7a58faa..2664cac 100644 (file)
@@ -744,9 +744,9 @@ literal:
 
                                buf[nr] = '\0';
                                if ((flags & UNSIGNED) == 0)
-                                   res = strtoimax_l(buf, (char **)NULL, base, locale);
+                                   res = strtoimax_l(buf, NULL, base, locale);
                                else
-                                   res = strtoumax_l(buf, (char **)NULL, base, locale);
+                                   res = strtoumax_l(buf, NULL, base, locale);
                                if (flags & POINTER)
                                        *va_arg(ap, void **) =
                                                        (void *)(uintptr_t)res;
index 9a566e5..ea4a8d4 100644 (file)
@@ -42,5 +42,5 @@ atof(const char *ascii)
 double
 atof_l(const char *ascii, locale_t locale)
 {
-       return strtod_l(ascii, (char **)NULL, locale);
+       return strtod_l(ascii, NULL, locale);
 }
index 752322f..0c62087 100644 (file)
@@ -42,5 +42,5 @@ atoi(const char *str)
 int
 atoi_l(const char *str, locale_t locale)
 {
-       return (int)strtol_l(str, (char **)NULL, 10, locale);
+       return (int)strtol_l(str, NULL, 10, locale);
 }
index 7fc1a90..e46338c 100644 (file)
@@ -42,5 +42,5 @@ atol(const char *str)
 long
 atol_l(const char *str, locale_t locale)
 {
-       return strtol_l(str, (char **)NULL, 10, locale);
+       return strtol_l(str, NULL, 10, locale);
 }
index 9775c40..cd304e3 100644 (file)
@@ -41,5 +41,5 @@ atoll(const char *str)
 long long
 atoll_l(const char *str, locale_t locale)
 {
-       return strtoll_l(str, (char **)NULL, 10, locale);
+       return strtoll_l(str, NULL, 10, locale);
 }
index 1d4df24..9117f2e 100644 (file)
@@ -253,11 +253,11 @@ pw_mkdb(const char *user)
                /* child */
                if (user == NULL)
                        execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
-                           "-d", passwd_dir, tempname, (char *)NULL);
+                           "-d", passwd_dir, tempname, NULL);
                else
                        execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p",
                            "-d", passwd_dir, "-u", user, tempname,
-                           (char *)NULL);
+                           NULL);
                _exit(1);
                /* NOTREACHED */
        default:
@@ -309,7 +309,7 @@ pw_edit(int notsetuid)
                        (void)setuid(getuid());
                }
                errno = 0;
-               execlp(editor, basename(editor), tempname, (char *)NULL);
+               execlp(editor, basename(editor), tempname, NULL);
                _exit(errno);
        default:
                /* parent */
index 9a96e9b..800863c 100644 (file)
@@ -214,7 +214,7 @@ get_pid(int fd, int *err)
        bytes_read = read (fd, buf, sizeof (buf) - 1);
        if (bytes_read > 0) {
                buf[bytes_read] = '\0';
-               pid = (pid_t)strtol (buf, (char **) NULL, 10);
+               pid = (pid_t)strtol (buf, NULL, 10);
        } else {
                pid = -1;
                *err = bytes_read ? errno : EINVAL;
index 106213e..e41fd78 100644 (file)
@@ -29,7 +29,6 @@
  * @(#) Copyright (c) 1988, 1990, 1993 The Regents of the University of California.  All rights reserved.
  * @(#)shutdown.c      8.4 (Berkeley) 4/28/95
  * $FreeBSD: src/sbin/shutdown/shutdown.c,v 1.21.2.1 2001/07/30 10:38:08 dd Exp $
- * $DragonFly: src/sbin/shutdown/shutdown.c,v 1.6 2005/01/02 01:22:49 cpressey Exp $
  */
 
 #include <sys/param.h>
@@ -121,11 +120,11 @@ main(int argc, char **argv)
                ++p;
        if (strcmp(p, "poweroff") == 0) {
                if (getopt(argc, argv, "") != -1)
-                       usage((char *)NULL);
+                       usage(NULL);
                argc -= optind;
                argv += optind;
                if (argc != 0)
-                       usage((char *)NULL);
+                       usage(NULL);
                dopower = 1;
                offset = 0;
                (void)time(&shuttime);
index 4c2fed9..897668a 100644 (file)
@@ -164,30 +164,30 @@ oce_hw_pci_free(POCE_SOFTC sc)
                bus_release_resource(sc->dev,
                                     SYS_RES_MEMORY,
                                     PCIR_BAR(pci_cfg_barnum), sc->devcfg_res);
-               sc->devcfg_res = (struct resource *)NULL;
+               sc->devcfg_res = NULL;
                sc->devcfg_btag = (bus_space_tag_t) 0;
                sc->devcfg_bhandle = (bus_space_handle_t)0;
-               sc->devcfg_vhandle = (void *)NULL;
+               sc->devcfg_vhandle = NULL;
        }
 
        if (sc->csr_res != NULL) {
                bus_release_resource(sc->dev,
                                     SYS_RES_MEMORY,
                                     PCIR_BAR(OCE_PCI_CSR_BAR), sc->csr_res);
-               sc->csr_res = (struct resource *)NULL;
+               sc->csr_res = NULL;
                sc->csr_btag = (bus_space_tag_t)0;
                sc->csr_bhandle = (bus_space_handle_t)0;
-               sc->csr_vhandle = (void *)NULL;
+               sc->csr_vhandle = NULL;
        }
 
        if (sc->db_res != NULL) {
                bus_release_resource(sc->dev,
                                     SYS_RES_MEMORY,
                                     PCIR_BAR(OCE_PCI_DB_BAR), sc->db_res);
-               sc->db_res = (struct resource *)NULL;
+               sc->db_res = NULL;
                sc->db_btag = (bus_space_tag_t)0;
                sc->db_bhandle = (bus_space_handle_t)0;
-               sc->db_vhandle = (void *)NULL;
+               sc->db_vhandle = NULL;
        }
 }
 
index c50228e..fc1345d 100644 (file)
@@ -223,11 +223,11 @@ maketbl(void)
        wchar_t *last;
 
        if ((t = tbl = calloc(entries, sizeof(TBL))) == NULL)
-               err(1, (char *)NULL);
+               err(1, NULL);
        if ((cols = calloc((maxcols = DEFCOLS), sizeof(*cols))) == NULL)
-               err(1, (char *)NULL);
+               err(1, NULL);
        if ((lens = calloc(maxcols, sizeof(int))) == NULL)
-               err(1, (char *)NULL);
+               err(1, NULL);
        for (cnt = 0, lp = list; cnt < entries; ++cnt, ++lp, ++t) {
                for (coloff = 0, p = *lp;
                    (cols[coloff] = wcstok(p, separator, &last));
@@ -243,9 +243,9 @@ maketbl(void)
                                maxcols += DEFCOLS;
                        }
                if ((t->list = calloc(coloff, sizeof(*t->list))) == NULL)
-                       err(1, (char *)NULL);
+                       err(1, NULL);
                if ((t->len = calloc(coloff, sizeof(int))) == NULL)
-                       err(1, (char *)NULL);
+                       err(1, NULL);
                for (t->cols = coloff; --coloff >= 0;) {
                        t->list[coloff] = cols[coloff];
                        t->len[coloff] = width(cols[coloff]);
@@ -274,7 +274,7 @@ input(FILE *fp)
        if (!list)
                if ((list = calloc((maxentry = DEFNUM), sizeof(*list))) ==
                    NULL)
-                       err(1, (char *)NULL);
+                       err(1, NULL);
        while (fgetws(buf, MAXLINELEN, fp)) {
                for (p = buf; *p && iswspace(*p); ++p);
                if (!*p)
index a2505d2..24488bc 100644 (file)
@@ -803,7 +803,7 @@ strip(const char *to_name)
                stripbin = getenv("STRIPBIN");
                if (stripbin == NULL)
                        stripbin = "strip";
-               execlp(stripbin, stripbin, to_name, (char *)NULL);
+               execlp(stripbin, stripbin, to_name, NULL);
                err(EX_OSERR, "exec(%s)", stripbin);
        default:
                if (wait(&status) == -1 || status) {
index 7f77fbc..98ffb14 100644 (file)
@@ -1020,13 +1020,13 @@ logmsg(int pri, const char *msg, const char *from, int flags)
                         * in the future.
                         */
                        if (now > REPEATTIME(f)) {
-                               fprintlog(f, flags, (char *)NULL);
+                               fprintlog(f, flags, NULL);
                                BACKOFF(f);
                        }
                } else {
                        /* new line, save it */
                        if (f->f_prevcount)
-                               fprintlog(f, 0, (char *)NULL);
+                               fprintlog(f, 0, NULL);
                        f->f_repeatcount = 0;
                        f->f_prevpri = pri;
                        (void)strlcpy(f->f_lasttime, timestamp,
@@ -1036,7 +1036,7 @@ logmsg(int pri, const char *msg, const char *from, int flags)
                        if (msglen < MAXSVLINE) {
                                f->f_prevlen = msglen;
                                (void)strlcpy(f->f_prevline, msg, sizeof(f->f_prevline));
-                               fprintlog(f, flags, (char *)NULL);
+                               fprintlog(f, flags, NULL);
                        } else {
                                f->f_prevline[0] = 0;
                                f->f_prevlen = 0;
@@ -1381,7 +1381,7 @@ reapchild(int signo __unused)
        pid_t pid;
        struct filed *f;
 
-       while ((pid = wait3(&status, WNOHANG, (struct rusage *)NULL)) > 0) {
+       while ((pid = wait3(&status, WNOHANG, NULL)) > 0) {
                if (!Initialized)
                        /* Don't tell while we are initting. */
                        continue;
@@ -1557,7 +1557,7 @@ init(int signo)
        for (f = Files; f != NULL; f = next) {
                /* flush any pending output */
                if (f->f_prevcount)
-                       fprintlog(f, 0, (char *)NULL);
+                       fprintlog(f, 0, NULL);
 
                switch (f->f_type) {
                case F_FILE:
@@ -2047,7 +2047,7 @@ markit(void)
        struct filed *f;
        dq_t q, next;
 
-       now = time((time_t *)NULL);
+       now = time(NULL);
        MarkSeq += TIMERINTVL;
        if (MarkSeq >= MarkInterval) {
                logmsg(LOG_INFO, "-- MARK --",
@@ -2060,7 +2060,7 @@ markit(void)
                        dprintf("flush %s: repeated %d times, %d sec.\n",
                            TypeNames[f->f_type], f->f_prevcount,
                            repeatinterval[f->f_repeatcount]);
-                       fprintlog(f, 0, (char *)NULL);
+                       fprintlog(f, 0, NULL);
                        BACKOFF(f);
                }
        }