Source-Changes-HG archive

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

[src/trunk]: src/bin/ls convert to new KNF



details:   https://anonhg.NetBSD.org/src/rev/c3f28e79cb3b
branches:  trunk
changeset: 495477:c3f28e79cb3b
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat Jul 29 03:46:14 2000 +0000

description:
convert to new KNF

diffstat:

 bin/ls/cmp.c        |  44 ++++++++++++++++++++++----------------------
 bin/ls/extern.h     |  38 +++++++++++++++++++-------------------
 bin/ls/ls.c         |  28 +++++++++++-----------------
 bin/ls/main.c       |  10 ++++------
 bin/ls/print.c      |  40 +++++++++++++++-------------------------
 bin/ls/stat_flags.c |  12 ++++--------
 bin/ls/stat_flags.h |   6 +++---
 bin/ls/util.c       |   9 ++++-----
 8 files changed, 82 insertions(+), 105 deletions(-)

diffs (truncated from 513 to 300 lines):

diff -r 20275b0bc183 -r c3f28e79cb3b bin/ls/cmp.c
--- a/bin/ls/cmp.c      Sat Jul 29 03:16:22 2000 +0000
+++ b/bin/ls/cmp.c      Sat Jul 29 03:46:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cmp.c,v 1.15 2000/07/23 20:50:44 mycroft Exp $ */
+/*     $NetBSD: cmp.c,v 1.16 2000/07/29 03:46:14 lukem Exp $   */
 
 /*
  * Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)cmp.c      8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: cmp.c,v 1.15 2000/07/23 20:50:44 mycroft Exp $");
+__RCSID("$NetBSD: cmp.c,v 1.16 2000/07/29 03:46:14 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -69,23 +69,23 @@
 #endif
 
 int
-namecmp(a, b)
-       const FTSENT *a, *b;
+namecmp(const FTSENT *a, const FTSENT *b)
 {
+
        return (strcmp(a->fts_name, b->fts_name));
 }
 
 int
-revnamecmp(a, b)
-       const FTSENT *a, *b;
+revnamecmp(const FTSENT *a, const FTSENT *b)
 {
+
        return (strcmp(b->fts_name, a->fts_name));
 }
 
 int
-modcmp(a, b)
-       const FTSENT *a, *b;
+modcmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_mtime > a->fts_statp->st_mtime)
                return (1);
        else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime)
@@ -99,9 +99,9 @@
 }
 
 int
-revmodcmp(a, b)
-       const FTSENT *a, *b;
+revmodcmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_mtime > a->fts_statp->st_mtime)
                return (-1);
        else if (b->fts_statp->st_mtime < a->fts_statp->st_mtime)
@@ -115,9 +115,9 @@
 }
 
 int
-acccmp(a, b)
-       const FTSENT *a, *b;
+acccmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_atime > a->fts_statp->st_atime)
                return (1);
        else if (b->fts_statp->st_atime < a->fts_statp->st_atime)
@@ -131,9 +131,9 @@
 }
 
 int
-revacccmp(a, b)
-       const FTSENT *a, *b;
+revacccmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_atime > a->fts_statp->st_atime)
                return (-1);
        else if (b->fts_statp->st_atime < a->fts_statp->st_atime)
@@ -147,9 +147,9 @@
 }
 
 int
-statcmp(a, b)
-       const FTSENT *a, *b;
+statcmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_ctime > a->fts_statp->st_ctime)
                return (1);
        else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime)
@@ -163,9 +163,9 @@
 }
 
 int
-revstatcmp(a, b)
-       const FTSENT *a, *b;
+revstatcmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_ctime > a->fts_statp->st_ctime)
                return (-1);
        else if (b->fts_statp->st_ctime < a->fts_statp->st_ctime)
@@ -179,9 +179,9 @@
 }
 
 int
-sizecmp(a, b)
-       const FTSENT *a, *b;
+sizecmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_size > a->fts_statp->st_size)
                return (1);
        if (b->fts_statp->st_size < a->fts_statp->st_size)
@@ -191,9 +191,9 @@
 }
 
 int
-revsizecmp(a, b)
-       const FTSENT *a, *b;
+revsizecmp(const FTSENT *a, const FTSENT *b)
 {
+
        if (b->fts_statp->st_size > a->fts_statp->st_size)
                return (-1);
        if (b->fts_statp->st_size < a->fts_statp->st_size)
diff -r 20275b0bc183 -r c3f28e79cb3b bin/ls/extern.h
--- a/bin/ls/extern.h   Sat Jul 29 03:16:22 2000 +0000
+++ b/bin/ls/extern.h   Sat Jul 29 03:46:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.12 2000/06/22 23:42:22 assar Exp $        */
+/*     $NetBSD: extern.h,v 1.13 2000/07/29 03:46:15 lukem Exp $        */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -35,25 +35,25 @@
  *     @(#)extern.h    8.1 (Berkeley) 5/31/93
  */
 
-int     acccmp __P((const FTSENT *, const FTSENT *));
-int     revacccmp __P((const FTSENT *, const FTSENT *));
-int     modcmp __P((const FTSENT *, const FTSENT *));
-int     revmodcmp __P((const FTSENT *, const FTSENT *));
-int     namecmp __P((const FTSENT *, const FTSENT *));
-int     revnamecmp __P((const FTSENT *, const FTSENT *));
-int     statcmp __P((const FTSENT *, const FTSENT *));
-int     revstatcmp __P((const FTSENT *, const FTSENT *));
-int     sizecmp __P((const FTSENT *, const FTSENT *));
-int     revsizecmp __P((const FTSENT *, const FTSENT *));
+int     acccmp(const FTSENT *, const FTSENT *);
+int     revacccmp(const FTSENT *, const FTSENT *);
+int     modcmp(const FTSENT *, const FTSENT *);
+int     revmodcmp(const FTSENT *, const FTSENT *);
+int     namecmp(const FTSENT *, const FTSENT *);
+int     revnamecmp(const FTSENT *, const FTSENT *);
+int     statcmp(const FTSENT *, const FTSENT *);
+int     revstatcmp(const FTSENT *, const FTSENT *);
+int     sizecmp(const FTSENT *, const FTSENT *);
+int     revsizecmp(const FTSENT *, const FTSENT *);
 
-int     ls_main __P((int, char *[]));
+int     ls_main(int, char *[]);
 
-int     printescaped __P((const char *));
-void    printacol __P((DISPLAY *));
-void    printcol __P((DISPLAY *));
-void    printlong __P((DISPLAY *));
-void    printscol __P((DISPLAY *));
-void    printstream __P((DISPLAY *));
-void    usage __P((void));
+int     printescaped(const char *);
+void    printacol(DISPLAY *);
+void    printcol(DISPLAY *);
+void    printlong(DISPLAY *);
+void    printscol(DISPLAY *);
+void    printstream(DISPLAY *);
+void    usage(void);
 
 #include "stat_flags.h"
diff -r 20275b0bc183 -r c3f28e79cb3b bin/ls/ls.c
--- a/bin/ls/ls.c       Sat Jul 29 03:16:22 2000 +0000
+++ b/bin/ls/ls.c       Sat Jul 29 03:46:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ls.c,v 1.42 2000/06/17 16:11:25 assar Exp $    */
+/*     $NetBSD: ls.c,v 1.43 2000/07/29 03:46:15 lukem Exp $    */
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)ls.c       8.7 (Berkeley) 8/5/94";
 #else
-__RCSID("$NetBSD: ls.c,v 1.42 2000/06/17 16:11:25 assar Exp $");
+__RCSID("$NetBSD: ls.c,v 1.43 2000/07/29 03:46:15 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,12 +70,12 @@
 #include "ls.h"
 #include "extern.h"
 
-static void     display __P((FTSENT *, FTSENT *));
-static int      mastercmp __P((const FTSENT **, const FTSENT **));
-static void     traverse __P((int, char **, int));
+static void     display(FTSENT *, FTSENT *);
+static int      mastercmp(const FTSENT **, const FTSENT **);
+static void     traverse(int, char **, int);
 
-static void (*printfcn) __P((DISPLAY *));
-static int (*sortfcn) __P((const FTSENT *, const FTSENT *));
+static void (*printfcn)(DISPLAY *);
+static int (*sortfcn)(const FTSENT *, const FTSENT *);
 
 #define        BY_NAME 0
 #define        BY_SIZE 1
@@ -110,9 +110,7 @@
 int f_whiteout;                        /* show whiteout entries */
 
 int
-ls_main(argc, argv)
-       int argc;
-       char *argv[];
+ls_main(int argc, char *argv[])
 {
        static char dot[] = ".", *dotav[] = { dot, NULL };
        struct winsize win;
@@ -342,9 +340,7 @@
  * a superset (may be exact set) of the files to be displayed.
  */
 static void
-traverse(argc, argv, options)
-       int argc, options;
-       char *argv[];
+traverse(int argc, char *argv[], int options)
 {
        FTS *ftsp;
        FTSENT *p, *chp;
@@ -408,8 +404,7 @@
  * points to the parent directory of the display list.
  */
 static void
-display(p, list)
-       FTSENT *p, *list;
+display(FTSENT *p, FTSENT *list)
 {
        struct stat *sp;
        DISPLAY d;
@@ -588,8 +583,7 @@
  * All other levels use the sort function.  Error entries remain unsorted.
  */
 static int
-mastercmp(a, b)
-       const FTSENT **a, **b;
+mastercmp(const FTSENT **a, const FTSENT **b)
 {
        int a_info, b_info;
 
diff -r 20275b0bc183 -r c3f28e79cb3b bin/ls/main.c
--- a/bin/ls/main.c     Sat Jul 29 03:16:22 2000 +0000
+++ b/bin/ls/main.c     Sat Jul 29 03:46:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.1 1999/05/17 12:16:03 lukem Exp $   */
+/*     $NetBSD: main.c,v 1.2 2000/07/29 03:46:15 lukem Exp $   */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.1 1999/05/17 12:16:03 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.2 2000/07/29 03:46:15 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -48,12 +48,10 @@
 #include "ls.h"
 #include "extern.h"
 
-int    main __P((int, char *[]));
+int    main(int, char *[]);
 
 int
-main(argc, argv)
-       int argc;
-       char *argv[];
+main(int argc, char *argv[])
 {
 
        return (ls_main(argc, argv));
diff -r 20275b0bc183 -r c3f28e79cb3b bin/ls/print.c
--- a/bin/ls/print.c    Sat Jul 29 03:16:22 2000 +0000
+++ b/bin/ls/print.c    Sat Jul 29 03:46:14 2000 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index