Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sushi de-lint



details:   https://anonhg.NetBSD.org/src/rev/020beafd41a4
branches:  trunk
changeset: 501990:020beafd41a4
user:      garbled <garbled%NetBSD.org@localhost>
date:      Wed Jan 10 03:05:48 2001 +0000

description:
de-lint

diffstat:

 usr.sbin/sushi/blabel.c   |   9 ++++---
 usr.sbin/sushi/formtree.h |   4 +--
 usr.sbin/sushi/handlers.c |   2 +-
 usr.sbin/sushi/handlers.h |   2 +-
 usr.sbin/sushi/run.c      |  17 ++++++++-----
 usr.sbin/sushi/scandir.c  |   4 +-
 usr.sbin/sushi/scanform.c |  57 +++++++++++++++++++++++++++++-----------------
 usr.sbin/sushi/sushi.c    |  17 ++++++-------
 8 files changed, 64 insertions(+), 48 deletions(-)

diffs (truncated from 437 to 300 lines):

diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/blabel.c
--- a/usr.sbin/sushi/blabel.c   Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/blabel.c   Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: blabel.c,v 1.5 2001/01/09 21:38:53 garbled Exp $       */
+/*      $NetBSD: blabel.c,v 1.6 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -123,8 +123,8 @@
 static void
 do_cancel(EObjectType cdktype, void *object, void *clientdata, chtype key)
 {
-       CDKSCROLL *scroll = (CDKSCROLL *)object;
-       scroll->exitType = vESCAPE_HIT;
+       CDKSCROLL *scrollp = (CDKSCROLL *)object;
+       scrollp->exitType = vESCAPE_HIT;
 }
 
 /*ARGSUSED*/
@@ -154,7 +154,7 @@
 
        getyx(stdscr, origy, origx);
 
-       dumpimg = malloc(ws.ws_row * ws.ws_col);
+       dumpimg = malloc((size_t)(ws.ws_row * ws.ws_col));
        if (dumpimg == NULL)
                bailout("malloc: %s", strerror(errno));
 
@@ -170,6 +170,7 @@
                fprintf(file, "\n");
        }
        fclose(file);
+       move(origy, origx);
 }
 
 /*ARGSUSED*/
diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/formtree.h
--- a/usr.sbin/sushi/formtree.h Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/formtree.h Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: formtree.h,v 1.1 2001/01/05 01:28:35 garbled Exp $       */
+/*      $NetBSD: formtree.h,v 1.2 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -82,8 +82,6 @@
 #define FASTBAIL (COMMAND+1)
 #define TREE_ISEMPTY(cqf)      (CIRCLEQ_FIRST(cqf) == (void *)cqf)
 
-int scan_form __P((struct cqForm *, char *, char *));
-void scan_formindex __P((struct cqForm *, char *,  char *));
 int handle_preform __P((char *, char *));
 int handle_form __P((char *, char *, char **));
 int form_entries __P((struct cqForm *));
diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/handlers.c
--- a/usr.sbin/sushi/handlers.c Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/handlers.c Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: handlers.c,v 1.2 2001/01/09 21:38:53 garbled Exp $       */
+/*      $NetBSD: handlers.c,v 1.3 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/handlers.h
--- a/usr.sbin/sushi/handlers.h Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/handlers.h Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: handlers.h,v 1.3 2001/01/09 21:38:53 garbled Exp $       */
+/*      $NetBSD: handlers.h,v 1.4 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/run.c
--- a/usr.sbin/sushi/run.c      Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/run.c      Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: run.c,v 1.1 2001/01/05 01:28:37 garbled Exp $       */
+/*      $NetBSD: run.c,v 1.2 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -86,12 +86,13 @@
        int display;
 {
        int xcor,ycor;
-       int n, i, j, x, y;
+       int i, j, x, y;
        int selectfailed, multiloop, cols;
        int status, master, slave;
        fd_set active_fd_set, read_fd_set;
        int dataflow[2];
        pid_t child, subchild, pid;
+       ssize_t n;
        char ibuf[MAXBUF], obuf[MAXBUF];
        char *command, *p, *argzero, **origargs;
        struct termios rtt;
@@ -133,6 +134,8 @@
 #endif
                refresh();
                bailout("fork: %s", strerror(errno));
+               /* NOTREACHED */
+               break;
        case 0:
                (void)close(STDIN_FILENO);
                subchild = fork();
@@ -142,7 +145,7 @@
                                n = read(master, obuf, sizeof(obuf));
                                if (n <= 0)
                                        break;
-                               write(dataflow[1], obuf, n);
+                               write(dataflow[1], obuf, (size_t)n);
                        } /* while spinning */
                        _exit(EXIT_SUCCESS);
                } /* subchild, child forks */
@@ -214,7 +217,7 @@
                                if (n)
                                        multiloop=0;
                                if (i == STDIN_FILENO)
-                                       (void)write(master, ibuf, n);
+                                       (void)write(master, ibuf, (size_t)n);
                                for (j=0; j < n; j++) {
                                        if (display) {
                                                cols++;
@@ -361,13 +364,13 @@
 
        win.ws_row -= 5;
 
-       wmove(statuswin, 0, 11 - strlen(catgets(catalog, 3, 2, "Status")));
+       wmove(statuswin, 0, 11 - (int)strlen(catgets(catalog, 3, 2, "Status")));
        waddstr(statuswin, catgets(catalog, 3, 2, "Status"));
        waddstr(statuswin, ": ");
        wstandout(statuswin);
        waddstr(statuswin, catgets(catalog, 3, 3, "Running"));
        wstandend(statuswin);
-       wmove(statuswin, 1, 11 - strlen(catgets(catalog, 3, 4, "Command")));
+       wmove(statuswin, 1, 11 - (int)strlen(catgets(catalog, 3, 4, "Command")));
        waddstr(statuswin, catgets(catalog, 3, 4, "Command"));
        waddstr(statuswin, ": ");
        wstandout(statuswin);
@@ -380,7 +383,7 @@
        waddstr(statuswin, command);
        wstandend(statuswin);
        mvwaddstr(statuswin, 0,
-           win.ws_col-12-strlen(catgets(catalog, 3, 5, "Lines")),
+           win.ws_col - 12 - (int)strlen(catgets(catalog, 3, 5, "Lines")),
            catgets(catalog, 3, 5, "Lines"));
        waddstr(statuswin, " (   0/   0)");
        wstandout(statuswin);
diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/scandir.c
--- a/usr.sbin/sushi/scandir.c  Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/scandir.c  Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scandir.c,v 1.2 2001/01/06 15:04:05 veego Exp $       */
+/*      $NetBSD: scandir.c,v 1.3 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
        struct stat dirstat;
 
        while (*++t && !isspace((unsigned char)*t));
-       snprintf(filename, t-row+1, "%s", row);
+       snprintf(filename, (size_t)(t-row+1), "%s", row);
        snprintf(nextpath, sizeof(nextpath), "%s/%s", basedir, filename);
 
        if (strcmp(filename, "BLANK") && stat(nextpath, &dirstat) < 0) {
diff -r 1e3b9d3c283e -r 020beafd41a4 usr.sbin/sushi/scanform.c
--- a/usr.sbin/sushi/scanform.c Wed Jan 10 03:03:02 2001 +0000
+++ b/usr.sbin/sushi/scanform.c Wed Jan 10 03:05:48 2001 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scanform.c,v 1.3 2001/01/09 19:32:35 garbled Exp $       */
+/*      $NetBSD: scanform.c,v 1.4 2001/01/10 03:05:48 garbled Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -69,6 +69,8 @@
 extern nl_catd catalog;
 extern char *lang_id;
 
+static void scan_formindex(struct cqForm *cqf, char *row);
+
 static void
 form_status(FORM *form)
 {
@@ -84,8 +86,8 @@
        wrefresh(stdscr);
 }
 
-int
-scan_form(struct cqForm *cqf, char *basedir, char *path)
+static int
+scan_form(struct cqForm *cqf, char *path)
 {
        FILE *filep;
        int lcnt;
@@ -115,7 +117,7 @@
                                continue;
                        *t = '\0';
 
-                       scan_formindex(cqf, basedir, p);
+                       scan_formindex(cqf, p);
                }
 
                fclose(filep);
@@ -142,11 +144,8 @@
        CIRCLEQ_INSERT_TAIL(cqf, fte, cqFormEntries);
 }
 
-void
-scan_formindex(cqf, basedir, row)
-       struct cqForm *cqf;
-       char *basedir;
-       char *row;
+static void
+scan_formindex(struct cqForm *cqf, char *row)
 {
        char *t = row;
        char *x;
@@ -205,7 +204,7 @@
                bailout("%s: %s",
                    catgets(catalog, 1, 11, "invalid data type"), x);
 
-       snprintf(data, t-row+1, "%s", row);
+       snprintf(data, (size_t)(t-row+1), "%s", row);
 
        while (*++t && isspace((unsigned char)*t));
        if (strlen(t) > 50)
@@ -371,7 +370,7 @@
 static int 
 my_driver(FORM * form, int c, char *path)
 {
-       WINDOW *subwin;
+       WINDOW *subwindow;
        CDKSCROLL *plist;
        CDKSELECTION *slist;
        CDKENTRY *entry;
@@ -404,35 +403,43 @@
                set_field_buffer(curfield, 0, tmp);
                destroyCDKEntry(entry);
                return(FALSE);
+               /* NOTREACHED */
                break;
        case COMMAND:
                /* for now, ignore this.. it's messy */
                return(FALSE);
+               /* NOTREACHED */
                break;
        case RESET:
                return(2); /* hrmmm... */
+               /* NOTREACHED */
                break;
        case REFRESH:
                touchwin(stdscr);
                wrefresh(stdscr);
                return(FALSE);
+               /* NOTREACHED */
                break;
        case SHELL:
                endwin();
                system("/bin/sh");
                wrefresh(stdscr);
                return(FALSE);
+               /* NOTREACHED */
                break;
        case DUMPSCREEN:
                do_scrdump(NULL, NULL, NULL, NULL);
                return(FALSE);
+               /* NOTREACHED */
                break;
        case SHOWHELP:
-               simple_lang_handler(path, HELPFILE, handle_help);
-               subwin = form_win(form);
-               touchwin(subwin);
-               wrefresh(subwin);
+               if (simple_lang_handler(path, HELPFILE, handle_help) == -2)
+                       nohelp();
+               subwindow = form_win(form);
+               touchwin(subwindow);
+               wrefresh(subwindow);
                return(FALSE);
+               /* NOTREACHED */
                break;
        case GENLIST:
                /* pull the grand popup list */
@@ -482,7 +489,8 @@
                                set_field_buffer(curfield, 0, list[i]);
                        destroyCDKScroll(plist);
                }
-               return FALSE;
+               return(FALSE);
+               /* NOTREACHED */
                break;
        case QUIT:
                /* do something useful */
@@ -492,9 +500,11 @@
                        else
                                return(2); /* special meaning */
                }
+               /* NOTREACHED */



Home | Main Index | Thread Index | Old Index