V0.9: Remove some scan-build warnings.

One of these is a real bug, the others are just minor optimizations.
This commit is contained in:
Cary R 2011-10-20 15:58:02 -07:00 committed by Stephen Williams
parent 617243f298
commit 17344563a8
3 changed files with 5 additions and 4 deletions

View File

@ -225,7 +225,7 @@ static void show_lpm_arithmetic_pins(ivl_lpm_t net)
{
ivl_nexus_t nex;
nex = ivl_lpm_q(net, 0);
fprintf(out, " Q: %p\n", ivl_lpm_q(net, 0));
fprintf(out, " Q: %p\n", nex);
nex = ivl_lpm_data(net, 0);
fprintf(out, " DataA: %p\n", nex);
@ -243,7 +243,7 @@ static void show_lpm_abs(ivl_lpm_t net)
ivl_lpm_basename(net), width);
nex = ivl_lpm_q(net, 0);
fprintf(out, " Q: %p\n", ivl_lpm_q(net, 0));
fprintf(out, " Q: %p\n", nex);
nex = ivl_lpm_data(net, 0);
fprintf(out, " D: %p\n", nex);
@ -684,6 +684,7 @@ static void show_lpm_re(ivl_lpm_t net)
break;
case IVL_LPM_RE_NOR:
type = "NOR";
break;
case IVL_LPM_RE_XOR:
type = "XOR";
break;

View File

@ -554,6 +554,7 @@ static PLI_INT32 sys_urandom_range_compiletf(PLI_BYTE8 *name)
/* Check that there are at least two arguments. */
arg = vpi_scan(argv); /* This should never be zero. */
assert(arg);
arg = vpi_scan(argv);
if (arg == 0) {
vpi_printf("ERROR: %s requires two arguments.\n", name);

View File

@ -214,8 +214,7 @@ static PLI_INT32 simparam_str_calltf(PLI_BYTE8 *name_ext)
char path [MAX_STRING_RESULT];
char *ptr = getcwd(path, MAX_STRING_RESULT);
if (ptr == NULL) {
ptr = strcpy(path, "<error getting the cwd, "
"is it too long?>");
strcpy(path, "<error getting the cwd, is it too long?>");
}
retval = strdup(path);
} else if (strcmp(param, "module") == 0) {