Add some casts in main directory to remove warnings.

The Cygwin compiler is a bit picky. This patch adds some casts
to remove compilation warnings. In the past I have had warnings
off because of problems with the STL, but for this directory we
mas as well remove the warnings we can. It also does not
recognize that an assert(0) or assert(false) ends a routine so
it complains about no return at end of function or variables
not being defined.
This commit is contained in:
Cary R 2009-12-10 13:58:50 -08:00 committed by Stephen Williams
parent 1f375ef16a
commit 81d4cbc4bd
6 changed files with 11 additions and 0 deletions

View File

@ -3111,6 +3111,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
break;
default:
pr = NULL;
assert(0);
}

View File

@ -381,6 +381,7 @@ NetEConst* NetEBComp::eval_leeq_real_(NetExpr*le, NetExpr*ri, bool eq_flag)
break;
default:
lv = 0.0;
cerr << get_fileline() << ": internal error: "
<< "Unexpected expression type? " << le->expr_type() << endl;
assert(0);
@ -401,6 +402,7 @@ NetEConst* NetEBComp::eval_leeq_real_(NetExpr*le, NetExpr*ri, bool eq_flag)
break;
default:
rv = 0.0;
cerr << get_fileline() << ": internal error: "
<< "Unexpected expression type? " << ri->expr_type() << endl;
assert(0);
@ -585,6 +587,7 @@ NetEConst* NetEBComp::eval_eqeq_real_(NetExpr*le, NetExpr*ri, bool ne_flag)
break;
default:
lv = 0.0;
cerr << get_fileline() << ": internal error: "
<< "Unexpected expression type? " << le->expr_type() << endl;
assert(0);
@ -605,6 +608,7 @@ NetEConst* NetEBComp::eval_eqeq_real_(NetExpr*le, NetExpr*ri, bool ne_flag)
break;
default:
rv = 0.0;
cerr << get_fileline() << ": internal error: "
<< "Unexpected expression type? " << ri->expr_type() << endl;
assert(0);

View File

@ -200,6 +200,7 @@ NetNet* NetEBBits::synthesize(Design*des, NetScope*scope, NetExpr*root)
gate = new NetLogic(scope, oname, 3, NetLogic::XNOR, width);
break;
default:
gate = NULL;
assert(0);
}
@ -863,6 +864,7 @@ NetNet* NetEUBits::synthesize(Design*des, NetScope*scope, NetExpr*root)
gate = new NetLogic(scope, oname, 2, NetLogic::NOT, width);
break;
default:
gate = NULL;
assert(0);
}

View File

@ -2608,6 +2608,7 @@ static DelayType get_loop_delay_type(const NetExpr*expr, const NetProc*proc)
/* This should never happen since delay_type_from_expr() only
* returns three different values. */
default:
result = NO_DELAY;
assert(0);
}

View File

@ -448,6 +448,7 @@ const char *human_readable_op(const char op, bool unary)
case 'p': type = "**"; break; // Power
default:
type = "???";
assert(0);
}
return type;

View File

@ -545,6 +545,8 @@ extern "C" unsigned long ivl_expr_uvalue(ivl_expr_t net)
assert(0);
}
assert(0);
return 0;
}
extern "C" ivl_variable_type_t ivl_expr_value(ivl_expr_t net)