chip away at compile-time warnings

1 x format string (real bug)
2 x uninitialized variable (potential bugs),
1 x parentheses around assignment used as truth value (shut up compiler)
This commit is contained in:
Larry Doolittle 2007-12-19 09:29:47 -08:00 committed by Stephen Williams
parent 21730ab228
commit 59b2d23c64
3 changed files with 6 additions and 3 deletions

View File

@ -1590,6 +1590,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
case 'u':
case 'U':
*idx += 1;
size = 0; /* fallback value if errors */
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
prec != -1) {
vpi_printf("WARNING: invalid format %s%s.\n", info->name, fmtb);
@ -1661,6 +1662,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
case 'z':
case 'Z':
*idx += 1;
size = 0; /* fallback value if errors */
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
prec != -1) {
vpi_printf("WARNING: invalid format %s%s.\n", info->name, fmtb);
@ -2161,6 +2163,7 @@ static PLI_INT32 sys_printtimescale_calltf(PLI_BYTE8*xx)
vpiHandle scope;
if (!argv) {
vpiHandle parent = vpi_handle(vpiScope, sys);
scope = NULL; /* fallback value if parent is NULL */
while (parent) {
scope = parent;
parent = vpi_handle(vpiScope, scope);
@ -2169,7 +2172,7 @@ static PLI_INT32 sys_printtimescale_calltf(PLI_BYTE8*xx)
scope = vpi_scan(argv);
vpi_free_object(argv);
}
vpi_printf("Time scale of (%s) is ", vpi_get_str(vpiFullName, scope));
vpi_printf("%s / ", pts_convert(vpi_get(vpiTimeUnit, scope)));
vpi_printf("%s\n", pts_convert(vpi_get(vpiTimePrecision, scope)));

View File

@ -239,7 +239,7 @@ static PLI_INT32 sys_sdf_annotate_compiletf(PLI_BYTE8*name)
return 0;
if (vpi_get(vpiType,scope) != vpiModule) {
vpi_printf("SDF ERROR: The second argument of %s",
vpi_printf("SDF ERROR: The second argument of %s"
" must be a module instance.\n", name);
vpi_control(vpiFinish, 1);
}

View File

@ -382,7 +382,7 @@ PLI_INT32 sys_dumpvars_compiletf(PLI_BYTE8 *name)
" numeric.\n", name);
/* The rest of the arguments are either a module or a variable. */
while (arg = vpi_scan(argv)) {
while ((arg=vpi_scan(argv)) != NULL) {
switch(vpi_get(vpiType, arg)) {
/* The module types. */
case vpiModule: