Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/config output __arraycount instead of homegrown macro



details:   https://anonhg.NetBSD.org/src/rev/a5587c99080c
branches:  trunk
changeset: 753992:a5587c99080c
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Apr 15 12:35:57 2010 +0000

description:
output __arraycount instead of homegrown macro

diffstat:

 usr.bin/config/mkdevsw.c |  16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diffs (51 lines):

diff -r a5cbdc56cc79 -r a5587c99080c usr.bin/config/mkdevsw.c
--- a/usr.bin/config/mkdevsw.c  Thu Apr 15 10:40:53 2010 +0000
+++ b/usr.bin/config/mkdevsw.c  Thu Apr 15 12:35:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mkdevsw.c,v 1.7 2009/01/20 18:20:48 drochner Exp $     */
+/*     $NetBSD: mkdevsw.c,v 1.8 2010/04/15 12:35:57 pooka Exp $        */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -83,9 +83,7 @@
        autogen_comment(fp, "devsw.c");
 
        fputs("#include <sys/param.h>\n"
-                 "#include <sys/conf.h>\n"
-                 "\n#define\tDEVSW_ARRAY_SIZE(x)\t"
-                 "(sizeof((x))/sizeof((x)[0]))\n", fp);
+                 "#include <sys/conf.h>\n", fp);
 }
 
 /*
@@ -122,8 +120,8 @@
 
        fputs("};\n\nconst struct bdevsw **bdevsw = bdevsw0;\n", fp);
 
-       fputs("const int sys_bdevsws = DEVSW_ARRAY_SIZE(bdevsw0);\n"
-                 "int max_bdevsws = DEVSW_ARRAY_SIZE(bdevsw0);\n", fp);
+       fputs("const int sys_bdevsws = __arraycount(bdevsw0);\n"
+                 "int max_bdevsws = __arraycount(bdevsw0);\n", fp);
 
        fputs("\n/* device switch table for character device */\n", fp);
 
@@ -149,8 +147,8 @@
 
        fputs("};\n\nconst struct cdevsw **cdevsw = cdevsw0;\n", fp);
 
-       fputs("const int sys_cdevsws = DEVSW_ARRAY_SIZE(cdevsw0);\n"
-                 "int max_cdevsws = DEVSW_ARRAY_SIZE(cdevsw0);\n", fp);
+       fputs("const int sys_cdevsws = __arraycount(cdevsw0);\n"
+                 "int max_cdevsws = __arraycount(cdevsw0);\n", fp);
 }
 
 /*
@@ -169,7 +167,7 @@
        }
        fputs("};\n\n"
                  "struct devsw_conv *devsw_conv = devsw_conv0;\n"
-                 "int max_devsw_convs = DEVSW_ARRAY_SIZE(devsw_conv0);\n",
+                 "int max_devsw_convs = __arraycount(devsw_conv0);\n",
                  fp);
 }
 



Home | Main Index | Thread Index | Old Index