Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hpc ANSIfy, KNF.



details:   https://anonhg.NetBSD.org/src/rev/ccdde2590714
branches:  trunk
changeset: 515509:ccdde2590714
user:      uch <uch%NetBSD.org@localhost>
date:      Thu Sep 27 16:31:23 2001 +0000

description:
ANSIfy, KNF.

diffstat:

 sys/arch/hpc/hpc/config_hook.c             |  33 +++------
 sys/arch/hpc/hpc/config_hook.h             |  16 ++--
 sys/arch/hpc/hpc/disksubr.c                |  33 +++------
 sys/arch/hpc/hpc/platid.c                  |  13 ++-
 sys/arch/hpc/hpc/platid_gen/platid_gen.c   |  99 ++++++++++++-----------------
 sys/arch/hpc/hpc/platid_gen/platid_gen.h   |  10 +-
 sys/arch/hpc/stand/include/machine/cdefs.h |   6 +-
 7 files changed, 91 insertions(+), 119 deletions(-)

diffs (truncated from 554 to 300 lines):

diff -r 7493479bf46a -r ccdde2590714 sys/arch/hpc/hpc/config_hook.c
--- a/sys/arch/hpc/hpc/config_hook.c    Thu Sep 27 16:30:35 2001 +0000
+++ b/sys/arch/hpc/hpc/config_hook.c    Thu Sep 27 16:31:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config_hook.c,v 1.1 2001/01/28 02:52:17 uch Exp $      */
+/*     $NetBSD: config_hook.c,v 1.2 2001/09/27 16:31:23 uch Exp $      */
 
 /*-
  * Copyright (c) 1999-2001
@@ -48,7 +48,7 @@
        int hr_type;
        long hr_id;
        enum config_hook_mode hr_mode;
-       int (*hr_func) __P((void *, int, long, void *));
+       int (*hr_func)(void *, int, long, void *);
 };
 
 LIST_HEAD(hook_list, hook_rec);
@@ -65,12 +65,8 @@
 }
 
 config_hook_tag
-config_hook(type, id, mode, func, ctx)
-       int type;
-       long id;
-       enum config_hook_mode mode;
-       int (*func) __P((void*, int, long, void*));
-       void *ctx;
+config_hook(int type, long id, enum config_hook_mode mode,
+    int (*func)(void *, int, long, void *), void *ctx)
 {
        struct hook_rec *hr, *prev_hr;
        int s;
@@ -85,12 +81,12 @@
         */
        prev_hr = NULL;
        for (hr = LIST_FIRST(&hook_lists[type]); hr != NULL;
-            hr = LIST_NEXT(hr, hr_link)) {
+           hr = LIST_NEXT(hr, hr_link)) {
                if (hr->hr_id == id) {
                        if (hr->hr_mode != mode) {
                                panic("config_hook: incompatible mode on "
-                                     "type=%d/id=%ld != %d",
-                                     type, id, hr->hr_mode);
+                                   "type=%d/id=%ld != %d",
+                                   type, id, hr->hr_mode);
                        }
                        prev_hr = hr;
                }
@@ -102,7 +98,7 @@
        case CONFIG_HOOK_REPLACE:
                if (prev_hr != NULL) {
                        printf("config_hook: type=%d/id=%ld is replaced",
-                              type, id);
+                           type, id);
                        s = splhigh();
                        LIST_REMOVE(prev_hr, hr_link);
                        prev_hr->hr_link.le_next = NULL;
@@ -112,7 +108,7 @@
        case CONFIG_HOOK_EXCLUSIVE:
                if (prev_hr != NULL) {
                        panic("config_hook: type=%d/id=%ld is already "
-                             "hooked(%p)", type, id, prev_hr);
+                           "hooked(%p)", type, id, prev_hr);
                }
                break;
        default:
@@ -137,8 +133,7 @@
 }
 
 void
-config_unhook(hrx)
-       config_hook_tag hrx;
+config_unhook(config_hook_tag hrx)
 {
        int s;
        struct hook_rec *hr = (struct hook_rec*)hrx;
@@ -153,10 +148,7 @@
 }
 
 int
-config_hook_call(type, id, msg)
-       int type;
-       long id;
-       void *msg;
+config_hook_call(int type, long id, void *msg)
 {
        int res;
        struct hook_rec *hr;
@@ -168,10 +160,11 @@
 
        res = -1;
        for (hr = LIST_FIRST(&hook_lists[type]); hr != NULL;
-            hr = LIST_NEXT(hr, hr_link)) {
+           hr = LIST_NEXT(hr, hr_link)) {
                if (hr->hr_id == id) {
                        res = (*hr->hr_func)(hr->hr_ctx, type, id, msg);
                }
        }
+
        return (res);
 }
diff -r 7493479bf46a -r ccdde2590714 sys/arch/hpc/hpc/config_hook.h
--- a/sys/arch/hpc/hpc/config_hook.h    Thu Sep 27 16:30:35 2001 +0000
+++ b/sys/arch/hpc/hpc/config_hook.h    Thu Sep 27 16:31:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: config_hook.h,v 1.3 2001/07/19 11:38:01 sato Exp $     */
+/*     $NetBSD: config_hook.h,v 1.4 2001/09/27 16:31:23 uch Exp $      */
 
 /*-
  * Copyright (c) 1999-2001
@@ -45,12 +45,11 @@
 
 typedef void *config_hook_tag;
 
-void   config_hook_init __P((void));
-config_hook_tag        config_hook __P((int type, long id, enum config_hook_mode mode,
-                                int (*func) __P((void*, int, long, void*)), 
-                                void *ctx));
-void   config_unhook __P((config_hook_tag));
-int    config_hook_call __P((int type, long id, void *msg));
+void   config_hook_init(void);
+config_hook_tag config_hook(int, long, enum config_hook_mode,
+    int (*func)(void *, int, long, void *), void *);
+void   config_unhook(config_hook_tag);
+int    config_hook_call(int, long, void *);
 
 /*
  * hook types and IDs
@@ -310,7 +309,8 @@
 #define CONFIG_HOOK_BATT_NO_SYSTEM_BATTERY     14
 
 #define CONFIG_HOOK_MAXVALUE   14      /* max value, check in this file */
-#define CONFIG_HOOK_VALUEP(p)  ((int)(p)>= 0 && (int)(p)<= CONFIG_HOOK_MAXVALUE)
+#define CONFIG_HOOK_VALUEP(p)                                          \
+       ((int)(p) >=  0 && (int)(p) <= CONFIG_HOOK_MAXVALUE)
 #define CONFIG_HOOK_PTRP(p)    (!CONFIG_HOOK_VALUEP(p))
 
 #endif /* _CONFIG_HOOK_H_ */
diff -r 7493479bf46a -r ccdde2590714 sys/arch/hpc/hpc/disksubr.c
--- a/sys/arch/hpc/hpc/disksubr.c       Thu Sep 27 16:30:35 2001 +0000
+++ b/sys/arch/hpc/hpc/disksubr.c       Thu Sep 27 16:31:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disksubr.c,v 1.1 2001/02/21 16:34:00 uch Exp $ */
+/*     $NetBSD: disksubr.c,v 1.2 2001/09/27 16:31:23 uch Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -52,7 +52,7 @@
 #define NO_MBR_SIGNATURE ((struct mbr_partition *) -1)
 
 static struct mbr_partition *
-mbr_findslice __P((struct mbr_partition* dp, struct buf *bp));
+mbr_findslice(struct mbr_partition* dp, struct buf *bp);
 
 /* 
  * Scan MBR for  NetBSD partittion.  Return NO_MBR_SIGNATURE if no MBR found
@@ -61,9 +61,7 @@
  */
 static
 struct mbr_partition *
-mbr_findslice(dp, bp)
-       struct mbr_partition *dp;
-       struct buf *bp;
+mbr_findslice(struct mbr_partition *dp, struct buf *bp)
 {
        struct mbr_partition *ourdp = NULL;
        u_int16_t *mbrmagicp;
@@ -124,11 +122,8 @@
  * Returns null on success and an error string on failure.
  */
 char *
-readdisklabel(dev, strat, lp, osdep)
-       dev_t dev;
-       void (*strat) __P((struct buf *));
-       struct disklabel *lp;
-       struct cpu_disklabel *osdep;
+readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
+    struct cpu_disklabel *osdep)
 {
        struct mbr_partition *dp;
        struct partition *pp;
@@ -319,10 +314,8 @@
  * before setting it.
  */
 int
-setdisklabel(olp, nlp, openmask, osdep)
-       struct disklabel *olp, *nlp;
-       u_long openmask;
-       struct cpu_disklabel *osdep;
+setdisklabel(struct disklabel *olp, struct disklabel *nlp, u_long openmask,
+    struct cpu_disklabel *osdep)
 {
        int i;
        struct partition *opp, *npp;
@@ -375,11 +368,8 @@
  * Write disk label back to device after modification.
  */
 int
-writedisklabel(dev, strat, lp, osdep)
-       dev_t dev;
-       void (*strat) __P((struct buf *));
-       struct disklabel *lp;
-       struct cpu_disklabel *osdep;
+writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
+    struct cpu_disklabel *osdep)
 {
        struct mbr_partition *dp;
        struct buf *bp;
@@ -466,10 +456,7 @@
  * if needed, and signal errors or early completion.
  */
 int
-bounds_check_with_label(bp, lp, wlabel)
-       struct buf *bp;
-       struct disklabel *lp;
-       int wlabel;
+bounds_check_with_label(struct buf *bp, struct disklabel *lp, int wlabel)
 {
        struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
        int labelsector = lp->d_partitions[2].p_offset + LABELSECTOR;
diff -r 7493479bf46a -r ccdde2590714 sys/arch/hpc/hpc/platid.c
--- a/sys/arch/hpc/hpc/platid.c Thu Sep 27 16:30:35 2001 +0000
+++ b/sys/arch/hpc/hpc/platid.c Thu Sep 27 16:31:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: platid.c,v 1.2 2001/09/24 14:29:31 takemura Exp $      */
+/*     $NetBSD: platid.c,v 1.3 2001/09/27 16:31:23 uch Exp $   */
 
 /*-
  * Copyright (c) 1999-2001
@@ -47,6 +47,7 @@
 void
 platid_ntoh(platid_t *pid)
 {
+
        pid->dw.dw0 = ntohl(pid->dw.dw0);
        pid->dw.dw1 = ntohl(pid->dw.dw1);
 }
@@ -54,6 +55,7 @@
 void
 platid_hton(platid_t *pid)
 {
+
        pid->dw.dw0 = htonl(pid->dw.dw0);
        pid->dw.dw1 = htonl(pid->dw.dw1);
 }
@@ -63,6 +65,7 @@
 {
        int i;
        unsigned char* p = (unsigned char*)pxx;
+
        printf("%14s: ", name);
 
        for (i = 0; i < 8; i++) {
@@ -74,7 +77,8 @@
 int
 platid_match(platid_t *platid, platid_mask_t *mask)
 {
-       return platid_match_sub(platid, mask, 0);
+
+       return (platid_match_sub(platid, mask, 0));
 }
 
 int
@@ -127,8 +131,9 @@
        while (datap->mask != NULL && !platid_match(platid, datap->mask))
                datap++;
        if (datap->mask == NULL && datap->data == NULL)
-               return NULL;
-       return datap;
+               return (NULL);
+
+       return (datap);
 }
 
 void *
diff -r 7493479bf46a -r ccdde2590714 sys/arch/hpc/hpc/platid_gen/platid_gen.c
--- a/sys/arch/hpc/hpc/platid_gen/platid_gen.c  Thu Sep 27 16:30:35 2001 +0000
+++ b/sys/arch/hpc/hpc/platid_gen/platid_gen.c  Thu Sep 27 16:31:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: platid_gen.c,v 1.3 2001/04/20 10:15:03 sato Exp $      */
+/*     $NetBSD: platid_gen.c,v 1.4 2001/09/27 16:31:24 uch Exp $       */
 
 /*-
  * Copyright (c) 1999
@@ -64,15 +64,15 @@
 /*
  * function prototypes
  */
-void   gen_list __P((node_t*));
-void   gen_output __P((void));
-void   gen_header __P((void));
-void   gen_mask_h __P((void));
-void   gen_mask_c __P((void));
-void   gen_name_c __P((void));
-void   gen_comment __P((FILE *fp));
-void   enter __P((void));
-void   leave __P((void));
+void   gen_list(node_t *);
+void   gen_output(void);



Home | Main Index | Thread Index | Old Index