Fix warnings about uninitialized variables.

This commit is contained in:
steve 2005-09-19 20:18:20 +00:00
parent 2729d6cd2e
commit d22d88923d
1 changed files with 11 additions and 5 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: eval_expr.c,v 1.123 2005/09/17 04:01:32 steve Exp $" #ident "$Id: eval_expr.c,v 1.124 2005/09/19 20:18:20 steve Exp $"
#endif #endif
# include "vvp_priv.h" # include "vvp_priv.h"
@ -1319,6 +1319,9 @@ static struct vector_info draw_number_expr(ivl_expr_t exp, unsigned wid)
case 'z': case 'z':
res.base = 3; res.base = 3;
break; break;
default:
assert(0);
res.base = 0;
} }
return res; return res;
} }
@ -1696,13 +1699,14 @@ static struct vector_info draw_select_expr(ivl_expr_t exp, unsigned wid,
int alloc_exclusive = (stuff_ok_flag&STUFF_OK_RO)? 0 : 1; int alloc_exclusive = (stuff_ok_flag&STUFF_OK_RO)? 0 : 1;
res.wid = wid;
/* First look for the self expression in the lookaside, and /* First look for the self expression in the lookaside, and
allocate that if possible. If I find it, then immediatly allocate that if possible. If I find it, then immediatly
return that. */ return that. */
if ( (res.base = allocate_vector_exp(exp, wid, alloc_exclusive)) != 0) { if ( (res.base = allocate_vector_exp(exp, wid, alloc_exclusive)) != 0) {
fprintf(vvp_out, "; Reuse base=%u wid=%u from lookaside.\n", fprintf(vvp_out, "; Reuse base=%u wid=%u from lookaside.\n",
res.base, wid); res.base, wid);
res.wid = wid;
return res; return res;
} }
@ -1734,7 +1738,6 @@ static struct vector_info draw_select_expr(ivl_expr_t exp, unsigned wid,
if (shiv.base == 0) { if (shiv.base == 0) {
assert(subv.wid >= wid); assert(subv.wid >= wid);
res.base = subv.base; res.base = subv.base;
res.wid = wid;
return res; return res;
} }
@ -1753,7 +1756,6 @@ static struct vector_info draw_select_expr(ivl_expr_t exp, unsigned wid,
fprintf(vvp_out, " %%shiftr/i0 %u, %u;\n", subv.base, subv.wid); fprintf(vvp_out, " %%shiftr/i0 %u, %u;\n", subv.base, subv.wid);
assert(subv.wid >= wid);
if (subv.wid > wid) { if (subv.wid > wid) {
res.base = subv.base; res.base = subv.base;
res.wid = wid; res.wid = wid;
@ -1762,7 +1764,8 @@ static struct vector_info draw_select_expr(ivl_expr_t exp, unsigned wid,
subv.wid -= wid; subv.wid -= wid;
clr_vector(subv); clr_vector(subv);
} else if (subv.wid == wid) { } else {
assert(subv.wid == wid);
res = subv; res = subv;
} }
@ -2165,6 +2168,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp, int stuff_ok_flag)
/* /*
* $Log: eval_expr.c,v $ * $Log: eval_expr.c,v $
* Revision 1.124 2005/09/19 20:18:20 steve
* Fix warnings about uninitialized variables.
*
* Revision 1.123 2005/09/17 04:01:32 steve * Revision 1.123 2005/09/17 04:01:32 steve
* Improve loading of part selects when easy. * Improve loading of part selects when easy.
* *