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; ivl_nexus_t nex;
nex = ivl_lpm_q(net, 0); 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); nex = ivl_lpm_data(net, 0);
fprintf(out, " DataA: %p\n", nex); fprintf(out, " DataA: %p\n", nex);
@ -243,7 +243,7 @@ static void show_lpm_abs(ivl_lpm_t net)
ivl_lpm_basename(net), width); ivl_lpm_basename(net), width);
nex = ivl_lpm_q(net, 0); 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); nex = ivl_lpm_data(net, 0);
fprintf(out, " D: %p\n", nex); fprintf(out, " D: %p\n", nex);
@ -684,6 +684,7 @@ static void show_lpm_re(ivl_lpm_t net)
break; break;
case IVL_LPM_RE_NOR: case IVL_LPM_RE_NOR:
type = "NOR"; type = "NOR";
break;
case IVL_LPM_RE_XOR: case IVL_LPM_RE_XOR:
type = "XOR"; type = "XOR";
break; 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. */ /* Check that there are at least two arguments. */
arg = vpi_scan(argv); /* This should never be zero. */ arg = vpi_scan(argv); /* This should never be zero. */
assert(arg);
arg = vpi_scan(argv); arg = vpi_scan(argv);
if (arg == 0) { if (arg == 0) {
vpi_printf("ERROR: %s requires two arguments.\n", name); 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 path [MAX_STRING_RESULT];
char *ptr = getcwd(path, MAX_STRING_RESULT); char *ptr = getcwd(path, MAX_STRING_RESULT);
if (ptr == NULL) { if (ptr == NULL) {
ptr = strcpy(path, "<error getting the cwd, " strcpy(path, "<error getting the cwd, is it too long?>");
"is it too long?>");
} }
retval = strdup(path); retval = strdup(path);
} else if (strcmp(param, "module") == 0) { } else if (strcmp(param, "module") == 0) {