From: Peter Johnson Date: Sun, 2 Dec 2001 22:39:06 +0000 (-0000) Subject: Fix a few LCLint errors. X-Git-Tag: v0.1.0~150 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c42294ab0a65b1588bb3cca802478fde5860898e;p=yasm Fix a few LCLint errors. svn path=/trunk/yasm/; revision=380 --- diff --git a/frontends/yasm/yasm.c b/frontends/yasm/yasm.c index a1e105ef..53445b92 100644 --- a/frontends/yasm/yasm.c +++ b/frontends/yasm/yasm.c @@ -90,7 +90,7 @@ static const char *help_tail = "\n"; /* main function */ -/*@-globstate@*/ +/*@-globstate -unrecog@*/ int main(int argc, char *argv[]) { @@ -150,7 +150,9 @@ main(int argc, char *argv[]) exttail = strrchr(obj_filename, '.'); if (!exttail) exttail = strrchr(obj_filename, '\0'); + /*@-nullpass@*/ sprintf(exttail, ".%s", cur_objfmt->extension); + /*@=nullpass@*/ /* open the built filename */ obj = fopen(obj_filename, "wb"); @@ -223,7 +225,7 @@ main(int argc, char *argv[]) BitVector_Shutdown(); return EXIT_SUCCESS; } -/*@=globstate@*/ +/*@=globstate =unrecog@*/ /* * Command line options handlers diff --git a/modules/parsers/nasm/bison.y.in b/modules/parsers/nasm/bison.y.in index 26eaeb9d..d235ee0b 100644 --- a/modules/parsers/nasm/bison.y.in +++ b/modules/parsers/nasm/bison.y.in @@ -152,8 +152,8 @@ input: /* empty */ line: '\n' { $$ = (bytecode *)NULL; } | lineexp '\n' | LINE INTNUM '+' INTNUM FILENAME '\n' { - line_number = intnum_get_uint($2); - line_number_inc = intnum_get_uint($4); + line_number = (unsigned int)intnum_get_uint($2); + line_number_inc = (unsigned int)intnum_get_uint($4); line_number -= line_number_inc; /* as we'll add it back in */ switch_filename($5); intnum_delete($2); diff --git a/modules/parsers/nasm/nasm-bison.y b/modules/parsers/nasm/nasm-bison.y index 26eaeb9d..d235ee0b 100644 --- a/modules/parsers/nasm/nasm-bison.y +++ b/modules/parsers/nasm/nasm-bison.y @@ -152,8 +152,8 @@ input: /* empty */ line: '\n' { $$ = (bytecode *)NULL; } | lineexp '\n' | LINE INTNUM '+' INTNUM FILENAME '\n' { - line_number = intnum_get_uint($2); - line_number_inc = intnum_get_uint($4); + line_number = (unsigned int)intnum_get_uint($2); + line_number_inc = (unsigned int)intnum_get_uint($4); line_number -= line_number_inc; /* as we'll add it back in */ switch_filename($5); intnum_delete($2); diff --git a/src/main.c b/src/main.c index a1e105ef..53445b92 100644 --- a/src/main.c +++ b/src/main.c @@ -90,7 +90,7 @@ static const char *help_tail = "\n"; /* main function */ -/*@-globstate@*/ +/*@-globstate -unrecog@*/ int main(int argc, char *argv[]) { @@ -150,7 +150,9 @@ main(int argc, char *argv[]) exttail = strrchr(obj_filename, '.'); if (!exttail) exttail = strrchr(obj_filename, '\0'); + /*@-nullpass@*/ sprintf(exttail, ".%s", cur_objfmt->extension); + /*@=nullpass@*/ /* open the built filename */ obj = fopen(obj_filename, "wb"); @@ -223,7 +225,7 @@ main(int argc, char *argv[]) BitVector_Shutdown(); return EXIT_SUCCESS; } -/*@=globstate@*/ +/*@=globstate =unrecog@*/ /* * Command line options handlers diff --git a/src/parsers/nasm/bison.y.in b/src/parsers/nasm/bison.y.in index 26eaeb9d..d235ee0b 100644 --- a/src/parsers/nasm/bison.y.in +++ b/src/parsers/nasm/bison.y.in @@ -152,8 +152,8 @@ input: /* empty */ line: '\n' { $$ = (bytecode *)NULL; } | lineexp '\n' | LINE INTNUM '+' INTNUM FILENAME '\n' { - line_number = intnum_get_uint($2); - line_number_inc = intnum_get_uint($4); + line_number = (unsigned int)intnum_get_uint($2); + line_number_inc = (unsigned int)intnum_get_uint($4); line_number -= line_number_inc; /* as we'll add it back in */ switch_filename($5); intnum_delete($2); diff --git a/src/parsers/nasm/nasm-bison.y b/src/parsers/nasm/nasm-bison.y index 26eaeb9d..d235ee0b 100644 --- a/src/parsers/nasm/nasm-bison.y +++ b/src/parsers/nasm/nasm-bison.y @@ -152,8 +152,8 @@ input: /* empty */ line: '\n' { $$ = (bytecode *)NULL; } | lineexp '\n' | LINE INTNUM '+' INTNUM FILENAME '\n' { - line_number = intnum_get_uint($2); - line_number_inc = intnum_get_uint($4); + line_number = (unsigned int)intnum_get_uint($2); + line_number_inc = (unsigned int)intnum_get_uint($4); line_number -= line_number_inc; /* as we'll add it back in */ switch_filename($5); intnum_delete($2);