Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/config Use int64_t to store numeric values, so that...



details:   https://anonhg.NetBSD.org/src/rev/dda576fd9c6a
branches:  trunk
changeset: 555475:dda576fd9c6a
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Tue Nov 18 18:47:36 2003 +0000

description:
Use int64_t to store numeric values, so that values larger than 2^32
may be specified in options.

diffstat:

 usr.sbin/config/gram.y |  6 +++---
 usr.sbin/config/scan.l |  8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r 3e39349f1708 -r dda576fd9c6a usr.sbin/config/gram.y
--- a/usr.sbin/config/gram.y    Tue Nov 18 18:26:18 2003 +0000
+++ b/usr.sbin/config/gram.y    Tue Nov 18 18:47:36 2003 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: gram.y,v 1.44 2003/08/07 11:25:15 agc Exp $    */
+/*     $NetBSD: gram.y,v 1.45 2003/11/18 18:47:36 fvdl Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -51,7 +51,7 @@
 #include "defs.h"
 #include "sem.h"
 
-#define        FORMAT(n) ((n) > -10 && (n) < 10 ? "%d" : "0x%x")
+#define        FORMAT(n) ((n) > -10 && (n) < 10 ? "%lld" : "0x%llx")
 
 #define        stop(s) error(s), exit(1)
 
@@ -94,7 +94,7 @@
        struct  deva *deva;
        struct  nvlist *list;
        const char *str;
-       int     val;
+       int64_t val;
 }
 
 %token AND AT ATTACH BUILD CINCLUDE COMPILE_WITH CONFIG DEFFS DEFINE DEFOPT 
diff -r 3e39349f1708 -r dda576fd9c6a usr.sbin/config/scan.l
--- a/usr.sbin/config/scan.l    Tue Nov 18 18:26:18 2003 +0000
+++ b/usr.sbin/config/scan.l    Tue Nov 18 18:47:36 2003 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: scan.l,v 1.40 2003/09/08 17:50:12 cl Exp $     */
+/*     $NetBSD: scan.l,v 1.41 2003/11/18 18:47:36 fvdl Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -148,15 +148,15 @@
                return QSTRING;
        }
 0[0-7]*        {
-               yylval.val = strtol(yytext, NULL, 8);
+               yylval.val = strtoll(yytext, NULL, 8);
                return NUMBER;
        }
 0[xX][0-9a-fA-F]+ {
-               yylval.val = strtoul(yytext + 2, NULL, 16);
+               yylval.val = strtoull(yytext + 2, NULL, 16);
                return NUMBER;
        }
 [1-9][0-9]* {
-               yylval.val = strtol(yytext, NULL, 10);
+               yylval.val = strtoll(yytext, NULL, 10);
                return NUMBER;
        }
 \n[ \t] {



Home | Main Index | Thread Index | Old Index