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:
parent
21730ab228
commit
59b2d23c64
|
|
@ -1590,6 +1590,7 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
|
||||||
case 'u':
|
case 'u':
|
||||||
case 'U':
|
case 'U':
|
||||||
*idx += 1;
|
*idx += 1;
|
||||||
|
size = 0; /* fallback value if errors */
|
||||||
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
|
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
|
||||||
prec != -1) {
|
prec != -1) {
|
||||||
vpi_printf("WARNING: invalid format %s%s.\n", info->name, fmtb);
|
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':
|
||||||
case 'Z':
|
case 'Z':
|
||||||
*idx += 1;
|
*idx += 1;
|
||||||
|
size = 0; /* fallback value if errors */
|
||||||
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
|
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
|
||||||
prec != -1) {
|
prec != -1) {
|
||||||
vpi_printf("WARNING: invalid format %s%s.\n", info->name, fmtb);
|
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;
|
vpiHandle scope;
|
||||||
if (!argv) {
|
if (!argv) {
|
||||||
vpiHandle parent = vpi_handle(vpiScope, sys);
|
vpiHandle parent = vpi_handle(vpiScope, sys);
|
||||||
|
scope = NULL; /* fallback value if parent is NULL */
|
||||||
while (parent) {
|
while (parent) {
|
||||||
scope = parent;
|
scope = parent;
|
||||||
parent = vpi_handle(vpiScope, scope);
|
parent = vpi_handle(vpiScope, scope);
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@ static PLI_INT32 sys_sdf_annotate_compiletf(PLI_BYTE8*name)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (vpi_get(vpiType,scope) != vpiModule) {
|
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);
|
" must be a module instance.\n", name);
|
||||||
vpi_control(vpiFinish, 1);
|
vpi_control(vpiFinish, 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,7 @@ PLI_INT32 sys_dumpvars_compiletf(PLI_BYTE8 *name)
|
||||||
" numeric.\n", name);
|
" numeric.\n", name);
|
||||||
|
|
||||||
/* The rest of the arguments are either a module or a variable. */
|
/* 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)) {
|
switch(vpi_get(vpiType, arg)) {
|
||||||
/* The module types. */
|
/* The module types. */
|
||||||
case vpiModule:
|
case vpiModule:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue