Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/sort make function merge() static in msort.c



details:   https://anonhg.NetBSD.org/src/rev/5585725eefb5
branches:  trunk
changeset: 540827:5585725eefb5
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Dec 25 21:19:15 2002 +0000

description:
make function merge() static in msort.c
cosmetic change to how local variable is incremented (moved to for(;;))

diffstat:

 usr.bin/sort/msort.c |  10 +++++-----
 usr.bin/sort/sort.h  |   3 +--
 2 files changed, 6 insertions(+), 7 deletions(-)

diffs (69 lines):

diff -r c35dc407aba2 -r 5585725eefb5 usr.bin/sort/msort.c
--- a/usr.bin/sort/msort.c      Wed Dec 25 19:13:53 2002 +0000
+++ b/usr.bin/sort/msort.c      Wed Dec 25 21:19:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msort.c,v 1.10 2001/02/19 20:50:17 jdolecek Exp $      */
+/*     $NetBSD: msort.c,v 1.11 2002/12/25 21:19:15 jdolecek Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -40,7 +40,7 @@
 #include "fsort.h"
 
 #ifndef lint
-__RCSID("$NetBSD: msort.c,v 1.10 2001/02/19 20:50:17 jdolecek Exp $");
+__RCSID("$NetBSD: msort.c,v 1.11 2002/12/25 21:19:15 jdolecek Exp $");
 __SCCSID("@(#)msort.c  8.1 (Berkeley) 6/6/93");
 #endif /* not lint */
 
@@ -61,6 +61,7 @@
 
 static int cmp __P((RECHEADER *, RECHEADER *));
 static int insert __P((struct mfile **, struct mfile **, int, int));
+static void merge(int, int, get_func_t, FILE *, put_func_t, struct field *);
 
 void
 fmerge(binno, top, filelist, nfiles, get, outfp, fput, ftbl)
@@ -133,7 +134,7 @@
        }
 }
 
-void
+static void
 merge(infl0, nfiles, get, outfp, put, ftbl)
        int infl0, nfiles;
        get_func_t get;
@@ -163,7 +164,7 @@
                bufs_sz[i] = DEFLLEN;
        }
 
-       for (i = j = 0; i < nfiles; i++) {
+       for (i = j = 0; i < nfiles; i++, j++) {
                cfile = (struct mfile *) bufs[j];
                cfile->flno = infl0 + j;
                cfile->end = (u_char *) bufs[j] + bufs_sz[j];
@@ -193,7 +194,6 @@
                        else
                                flist[0] = cfile;
                }
-               j++;
        }
 
        cfile = (struct mfile *) bufs[nf];
diff -r c35dc407aba2 -r 5585725eefb5 usr.bin/sort/sort.h
--- a/usr.bin/sort/sort.h       Wed Dec 25 19:13:53 2002 +0000
+++ b/usr.bin/sort/sort.h       Wed Dec 25 21:19:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sort.h,v 1.14 2002/12/24 15:02:46 jdolecek Exp $       */
+/*     $NetBSD: sort.h,v 1.15 2002/12/25 21:19:15 jdolecek Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -166,7 +166,6 @@
            int, RECHEADER *, u_char *, struct field *);
 int     makeline(int, int, struct filelist *,
            int, RECHEADER *, u_char *, struct field *);
-void    merge(int, int, get_func_t, FILE *, put_func_t, struct field *);
 void    num_init(void);
 void    onepass(const u_char **, int, long, long *, u_char *, FILE *);
 int     optval(int, int);



Home | Main Index | Thread Index | Old Index