clang-format: Set IndentCaseBlocks to false

This commit is contained in:
Tim Wojtulewicz 2021-09-24 15:40:37 -07:00
parent 02206f3215
commit 4423574d26
58 changed files with 4729 additions and 4766 deletions

View file

@ -127,17 +127,17 @@ bool CPPCompile::AddConstant(const ValPtr& vp)
case TYPE_ADDR:
case TYPE_SUBNET:
{
auto prefix = (tag == TYPE_ADDR) ? "Addr" : "SubNet";
{
auto prefix = (tag == TYPE_ADDR) ? "Addr" : "SubNet";
Emit("%sValPtr %s;", prefix, const_name);
Emit("%sValPtr %s;", prefix, const_name);
ODesc d;
v->Describe(&d);
ODesc d;
v->Describe(&d);
AddInit(v, const_name,
string("make_intrusive<") + prefix + "Val>(\"" + d.Description() + "\")");
}
AddInit(v, const_name,
string("make_intrusive<") + prefix + "Val>(\"" + d.Description() + "\")");
}
break;
case TYPE_FUNC:
@ -151,15 +151,15 @@ bool CPPCompile::AddConstant(const ValPtr& vp)
break;
case TYPE_FILE:
{
Emit("FileValPtr %s;", const_name);
{
Emit("FileValPtr %s;", const_name);
auto f = cast_intrusive<FileVal>(vp)->Get();
auto f = cast_intrusive<FileVal>(vp)->Get();
AddInit(v, const_name,
string("make_intrusive<FileVal>(") + "make_intrusive<File>(\"" + f->Name() +
"\", \"w\"))");
}
AddInit(v, const_name,
string("make_intrusive<FileVal>(") + "make_intrusive<File>(\"" + f->Name() +
"\", \"w\"))");
}
break;
default:

View file

@ -79,17 +79,17 @@ bool CPPCompile::IsSimpleInitExpr(const ExprPtr& e) const
return true;
case EXPR_RECORD_COERCE:
{ // look for coercion of empty record
auto op = e->GetOp1();
{ // look for coercion of empty record
auto op = e->GetOp1();
if ( op->Tag() != EXPR_RECORD_CONSTRUCTOR )
return false;
if ( op->Tag() != EXPR_RECORD_CONSTRUCTOR )
return false;
auto rc = static_cast<const RecordConstructorExpr*>(op.get());
const auto& exprs = rc->Op()->AsListExpr()->Exprs();
auto rc = static_cast<const RecordConstructorExpr*>(op.get());
const auto& exprs = rc->Op()->AsListExpr()->Exprs();
return exprs.length() == 0;
}
return exprs.length() == 0;
}
default:
return false;
@ -235,16 +235,16 @@ void CPPCompile::GenPreInit(const Type* t)
break;
case TYPE_RECORD:
{
string name;
{
string name;
if ( t->GetName() != "" )
name = string("\"") + t->GetName() + string("\"");
else
name = "nullptr";
if ( t->GetName() != "" )
name = string("\"") + t->GetName() + string("\"");
else
name = "nullptr";
pre_init = string("get_record_type__CPP(") + name + ")";
}
pre_init = string("get_record_type__CPP(") + name + ")";
}
break;
case TYPE_LIST:

View file

@ -66,16 +66,16 @@ static VectorTypePtr base_vector_type__CPP(const VectorTypePtr& vt)
switch ( vt->Yield()->InternalType() ) \
{ \
case TYPE_INTERNAL_INT: \
{ \
VEC_OP1_KERNEL(AsInt, IntVal, op) \
break; \
} \
{ \
VEC_OP1_KERNEL(AsInt, IntVal, op) \
break; \
} \
\
case TYPE_INTERNAL_UNSIGNED: \
{ \
VEC_OP1_KERNEL(AsCount, CountVal, op) \
break; \
} \
{ \
VEC_OP1_KERNEL(AsCount, CountVal, op) \
break; \
} \
\
double_kernel \
\
@ -126,19 +126,19 @@ VEC_OP1(comp, ~, )
switch ( vt->Yield()->InternalType() ) \
{ \
case TYPE_INTERNAL_INT: \
{ \
if ( vt->Yield()->Tag() == TYPE_BOOL ) \
VEC_OP2_KERNEL(AsBool, BoolVal, op) \
else \
VEC_OP2_KERNEL(AsInt, IntVal, op) \
break; \
} \
{ \
if ( vt->Yield()->Tag() == TYPE_BOOL ) \
VEC_OP2_KERNEL(AsBool, BoolVal, op) \
else \
VEC_OP2_KERNEL(AsInt, IntVal, op) \
break; \
} \
\
case TYPE_INTERNAL_UNSIGNED: \
{ \
VEC_OP2_KERNEL(AsCount, CountVal, op) \
break; \
} \
{ \
VEC_OP2_KERNEL(AsCount, CountVal, op) \
break; \
} \
\
double_kernel \
\
@ -184,22 +184,22 @@ VEC_OP2(oror, ||, )
switch ( vt->Yield()->InternalType() ) \
{ \
case TYPE_INTERNAL_INT: \
{ \
VEC_OP2_KERNEL(AsInt, BoolVal, op) \
break; \
} \
{ \
VEC_OP2_KERNEL(AsInt, BoolVal, op) \
break; \
} \
\
case TYPE_INTERNAL_UNSIGNED: \
{ \
VEC_OP2_KERNEL(AsCount, BoolVal, op) \
break; \
} \
{ \
VEC_OP2_KERNEL(AsCount, BoolVal, op) \
break; \
} \
\
case TYPE_INTERNAL_DOUBLE: \
{ \
VEC_OP2_KERNEL(AsDouble, BoolVal, op) \
break; \
} \
{ \
VEC_OP2_KERNEL(AsDouble, BoolVal, op) \
break; \
} \
\
default: \
break; \

View file

@ -18,15 +18,15 @@ void CPPCompile::GenStmt(const Stmt* s)
break;
case STMT_LIST:
{
// These always occur in contexts surrounded by {}'s,
// so no need to add them explicitly.
auto sl = s->AsStmtList();
const auto& stmts = sl->Stmts();
{
// These always occur in contexts surrounded by {}'s,
// so no need to add them explicitly.
auto sl = s->AsStmtList();
const auto& stmts = sl->Stmts();
for ( const auto& stmt : stmts )
GenStmt(stmt);
}
for ( const auto& stmt : stmts )
GenStmt(stmt);
}
break;
case STMT_EXPR:
@ -82,10 +82,10 @@ void CPPCompile::GenStmt(const Stmt* s)
break;
case STMT_PRINT:
{
auto el = static_cast<const ExprListStmt*>(s)->ExprList();
Emit("do_print_stmt({%s});", GenExpr(el, GEN_VAL_PTR));
}
{
auto el = static_cast<const ExprListStmt*>(s)->ExprList();
Emit("do_print_stmt({%s});", GenExpr(el, GEN_VAL_PTR));
}
break;
case STMT_FALLTHROUGH:

View file

@ -466,19 +466,19 @@ void CPPCompile::RegisterType(const TypePtr& tp)
break;
case TYPE_TYPE:
{
const auto& tt = t->AsTypeType()->GetType();
NoteNonRecordInitDependency(t, tt);
RegisterType(tt);
}
{
const auto& tt = t->AsTypeType()->GetType();
NoteNonRecordInitDependency(t, tt);
RegisterType(tt);
}
break;
case TYPE_VECTOR:
{
const auto& yield = t->AsVectorType()->Yield();
NoteNonRecordInitDependency(t, yield);
RegisterType(yield);
}
{
const auto& yield = t->AsVectorType()->Yield();
NoteNonRecordInitDependency(t, yield);
RegisterType(yield);
}
break;
case TYPE_LIST: