Use int64_t to store numeric values, so that values larger than 2^32

may be specified in options.
This commit is contained in:
fvdl 2003-11-18 18:47:36 +00:00
parent 6a88e9174b
commit dc7e96bea0
2 changed files with 7 additions and 7 deletions

View File

@ -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 @@ static struct nvlist *mk_ns(const char *, struct nvlist *);
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

View File

@ -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 @@ with return WITH;
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] {