porting fixes from Justin

This commit is contained in:
Vern Paxson 2021-04-21 15:15:33 -07:00
parent 22d060d461
commit bbe5ab39f6
2 changed files with 2 additions and 2 deletions

View file

@ -721,7 +721,7 @@ std::string CPPCompile::GenVal(const ValPtr& v)
return GenEnum(t, v);
if ( tag == TYPE_PORT )
return Fmt(v->AsCount());
return Fmt(int(v->AsCount()));
if ( it == TYPE_INTERNAL_DOUBLE )
return Fmt(v->AsDouble());

View file

@ -267,7 +267,7 @@ void CPPCompile::GenSwitchStmt(const SwitchStmt* sw)
if ( is_int )
c_v_rep = Fmt(int(c_v->AsInt()));
else if ( is_uint )
c_v_rep = Fmt(c_v->AsCount());
c_v_rep = Fmt(p_hash_type(c_v->AsCount()));
else
c_v_rep = Fmt(p_hash(c_v));