Squash some gcc 4.3.3 warnings.

This patch clears all the gcc 4.3.3 warning that can be fixed.
The remaining warning is dictated by older versions of the
1364 standard.
(cherry picked from commit 6d5d06cae4)
This commit is contained in:
Cary R 2009-09-09 17:27:45 -07:00 committed by Stephen Williams
parent 7ad50f4454
commit 6aaf2f84a8
4 changed files with 11 additions and 11 deletions

View File

@ -53,6 +53,8 @@ PLI_INT32 tf_igetp(PLI_INT32 n, void *obj)
{
value.format = vpiStringVal;
vpi_get_value(arg_h, &value);
/* The following may generate a compilation warning, but this
* functionality is required by some versions of the standard. */
rtn = (int) value.value.str; /* Oh my */
} else {
value.format = vpiIntVal;

View File

@ -217,7 +217,7 @@ static int get_vpi_taskfunc_signal_arg(struct args_info *result,
(ivl_expr_width(bexpr) < 8*sizeof(int))) {
fprintf(stderr, "%s:%u: tgt-vvp warning: V0.9 may give "
"incorrect results for a select with a "
"signed index less than %d bits.\n",
"signed index less than %zu bits.\n",
ivl_expr_file(expr),
ivl_expr_lineno(expr),
8*sizeof(int));

View File

@ -214,7 +214,6 @@ static PLI_INT32 sys_fclose_calltf(PLI_BYTE8*name)
vpiHandle fd = vpi_scan(argv);
s_vpi_value val;
PLI_UINT32 fd_mcd;
char *str = ""; /* This prevents the compiler from complaining. */
errno = 0;
vpi_free_object(argv);
@ -225,7 +224,7 @@ static PLI_INT32 sys_fclose_calltf(PLI_BYTE8*name)
fd_mcd = val.value.integer;
if ((! IS_MCD(fd_mcd) && vpi_get_file(fd_mcd) == NULL) ||
( IS_MCD(fd_mcd) && vpi_mcd_printf(fd_mcd, str) == EOF) ||
( IS_MCD(fd_mcd) && vpi_mcd_printf(fd_mcd, "%s", "") == EOF) ||
(! fd_mcd)) {
vpi_printf("WARNING: %s:%d: ", vpi_get_str(vpiFile, callh),
(int)vpi_get(vpiLineNo, callh));
@ -254,7 +253,6 @@ static PLI_INT32 sys_fflush_calltf(PLI_BYTE8*name)
s_vpi_value val;
PLI_UINT32 fd_mcd;
FILE *fp;
char *str = ""; /* This prevents the compiler from complaining. */
errno = 0;
/* If we have no argument then flush all the streams. */
@ -274,7 +272,7 @@ static PLI_INT32 sys_fflush_calltf(PLI_BYTE8*name)
if (fd_mcd == 0) return 0;
if ((! IS_MCD(fd_mcd) && vpi_get_file(fd_mcd) == NULL) ||
( IS_MCD(fd_mcd) && vpi_mcd_printf(fd_mcd, str) == EOF) ||
( IS_MCD(fd_mcd) && vpi_mcd_printf(fd_mcd, "%s", "") == EOF) ||
(! fd_mcd)) {
vpi_printf("WARNING: %s:%d: ", vpi_get_str(vpiFile, callh),
(int)vpi_get(vpiLineNo, callh));

View File

@ -1143,8 +1143,8 @@ vvp_vector4_t& vvp_vector4_t::operator |= (const vvp_vector4_t&that)
if (size_ <= BITS_PER_WORD) {
unsigned long tmp = abits_val_ | bbits_val_ |
that.abits_val_ | that.bbits_val_;
bbits_val_ = (~abits_val_ | bbits_val_) & that.bbits_val_ |
(~that.abits_val_ | that.bbits_val_) & bbits_val_;
bbits_val_ = ((~abits_val_ | bbits_val_) & that.bbits_val_) |
((~that.abits_val_ | that.bbits_val_) & bbits_val_);
abits_val_ = tmp;
} else {
@ -1152,10 +1152,10 @@ vvp_vector4_t& vvp_vector4_t::operator |= (const vvp_vector4_t&that)
for (unsigned idx = 0; idx < words ; idx += 1) {
unsigned long tmp = abits_ptr_[idx] | bbits_ptr_[idx] |
that.abits_ptr_[idx] | that.bbits_ptr_[idx];
bbits_ptr_[idx] = (~abits_ptr_[idx] | bbits_ptr_[idx]) &
that.bbits_ptr_[idx] |
(~that.abits_ptr_[idx] |
that.bbits_ptr_[idx]) & bbits_ptr_[idx];
bbits_ptr_[idx] = ((~abits_ptr_[idx] | bbits_ptr_[idx]) &
that.bbits_ptr_[idx]) |
((~that.abits_ptr_[idx] |
that.bbits_ptr_[idx]) & bbits_ptr_[idx]);
abits_ptr_[idx] = tmp;
}
}