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:48:07 -07:00 committed by Stephen Williams
parent b9af189229
commit f5acd8d135
3 changed files with 5 additions and 4 deletions

View File

@ -229,7 +229,7 @@ static void show_lpm_arithmetic_pins(ivl_lpm_t net)
{
ivl_nexus_t nex;
nex = ivl_lpm_q(net);
fprintf(out, " Q: %p\n", ivl_lpm_q(net));
fprintf(out, " Q: %p\n", nex);
nex = ivl_lpm_data(net, 0);
fprintf(out, " DataA: %p\n", nex);
@ -247,7 +247,7 @@ static void show_lpm_abs(ivl_lpm_t net)
ivl_lpm_basename(net), width);
nex = ivl_lpm_q(net);
fprintf(out, " Q: %p\n", ivl_lpm_q(net));
fprintf(out, " Q: %p\n", nex);
nex = ivl_lpm_data(net, 0);
fprintf(out, " D: %p\n", nex);
@ -690,6 +690,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

@ -567,6 +567,7 @@ static PLI_INT32 sys_urandom_range_compiletf(ICARUS_VPI_CONST 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(ICARUS_VPI_CONST 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) {