diff --git a/src/script_opt/CPP/Exprs.cc b/src/script_opt/CPP/Exprs.cc index 625f953928..04c817b20f 100644 --- a/src/script_opt/CPP/Exprs.cc +++ b/src/script_opt/CPP/Exprs.cc @@ -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()); diff --git a/src/script_opt/CPP/Stmts.cc b/src/script_opt/CPP/Stmts.cc index 6c530a47e1..f8443d091f 100644 --- a/src/script_opt/CPP/Stmts.cc +++ b/src/script_opt/CPP/Stmts.cc @@ -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));