diff --git a/src/script_opt/CPP/DeclFunc.cc b/src/script_opt/CPP/DeclFunc.cc index 02674029ca..da7b3fa377 100644 --- a/src/script_opt/CPP/DeclFunc.cc +++ b/src/script_opt/CPP/DeclFunc.cc @@ -219,12 +219,12 @@ string CPPCompile::BindArgs(const FuncTypePtr& ft, const IDPList* lambda_ids) for ( auto i = 0; i < n; ++i ) { auto arg_i = string("f->GetElement(") + Fmt(i) + ")"; - const auto& ft = params->GetFieldType(i); + const auto& pt = params->GetFieldType(i); - if ( IsNativeType(ft) ) - res += arg_i + NativeAccessor(ft); + if ( IsNativeType(pt) ) + res += arg_i + NativeAccessor(pt); else - res += GenericValPtrToGT(arg_i, ft, GEN_VAL_PTR); + res += GenericValPtrToGT(arg_i, pt, GEN_VAL_PTR); res += ", "; } diff --git a/src/script_opt/CPP/Exprs.cc b/src/script_opt/CPP/Exprs.cc index b21d12b77d..8a6dc49de5 100644 --- a/src/script_opt/CPP/Exprs.cc +++ b/src/script_opt/CPP/Exprs.cc @@ -620,11 +620,11 @@ string CPPCompile::GenRecordConstructorExpr(const Expr* e) for ( auto i = 0; i < n; ++i ) { - const auto& e = exprs[i]; + const auto& expr = exprs[i]; - ASSERT(e->Tag() == EXPR_FIELD_ASSIGN); + ASSERT(expr->Tag() == EXPR_FIELD_ASSIGN); - vals += GenExpr(e->GetOp1(), GEN_VAL_PTR); + vals += GenExpr(expr->GetOp1(), GEN_VAL_PTR); if ( i < n - 1 ) vals += ", "; @@ -668,12 +668,12 @@ string CPPCompile::GenTableConstructorExpr(const Expr* e) for ( auto i = 0; i < n; ++i ) { - const auto& e = exprs[i]; + const auto& expr = exprs[i]; - ASSERT(e->Tag() == EXPR_ASSIGN); + ASSERT(expr->Tag() == EXPR_ASSIGN); - auto index = e->GetOp1(); - auto v = e->GetOp2(); + auto index = expr->GetOp1(); + auto v = expr->GetOp2(); if ( index->Tag() == EXPR_LIST ) // Multiple indices. diff --git a/src/script_opt/CPP/Types.cc b/src/script_opt/CPP/Types.cc index b4ef3555fc..38511b5c85 100644 --- a/src/script_opt/CPP/Types.cc +++ b/src/script_opt/CPP/Types.cc @@ -44,6 +44,7 @@ bool CPPCompile::IsNativeType(const TypePtr& t) const default: reporter->InternalError("bad type in CPPCompile::IsNativeType"); + return false; } } @@ -287,6 +288,7 @@ const char* CPPCompile::TypeTagName(TypeTag tag) const default: reporter->InternalError("bad type in CPPCompile::TypeTagName"); + return nullptr; } } @@ -318,6 +320,7 @@ const char* CPPCompile::TypeName(const TypePtr& t) default: reporter->InternalError("bad type in CPPCompile::TypeName"); + return nullptr; } } @@ -353,6 +356,7 @@ const char* CPPCompile::FullTypeName(const TypePtr& t) default: reporter->InternalError("bad type in CPPCompile::FullTypeName"); + return nullptr; } } @@ -365,6 +369,7 @@ const char* CPPCompile::TypeType(const TypePtr& t) default: reporter->InternalError("bad type in CPPCompile::TypeType"); + return nullptr; } } @@ -542,6 +547,7 @@ const char* CPPCompile::NativeAccessor(const TypePtr& t) default: reporter->InternalError("bad type in CPPCompile::NativeAccessor"); + return nullptr; } } @@ -572,6 +578,7 @@ const char* CPPCompile::IntrusiveVal(const TypePtr& t) default: reporter->InternalError("bad type in CPPCompile::IntrusiveVal"); + return nullptr; } }