mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-10 09:24:09 +02:00
Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find, e.g. by grep. Using const_cast also shuts up some compiler warnings.
This commit is contained in:
@@ -528,7 +528,7 @@ void AsmBlockStatement::toIR(IRState* p)
|
||||
// do asm statements
|
||||
for (unsigned i=0; i<statements->dim; i++)
|
||||
{
|
||||
Statement* s = (Statement*)statements->data[i];
|
||||
Statement* s = static_cast<Statement*>(statements->data[i]);
|
||||
if (s) {
|
||||
s->toIR(p);
|
||||
}
|
||||
@@ -800,7 +800,7 @@ Statement *AsmBlockStatement::syntaxCopy()
|
||||
a->setDim(statements->dim);
|
||||
for (size_t i = 0; i < statements->dim; i++)
|
||||
{
|
||||
Statement *s = (Statement *)statements->data[i];
|
||||
Statement *s = static_cast<Statement *>(statements->data[i]);
|
||||
if (s)
|
||||
s = s->syntaxCopy();
|
||||
a->data[i] = s;
|
||||
@@ -842,7 +842,7 @@ void AsmBlockStatement::toNakedIR(IRState *p)
|
||||
// do asm statements
|
||||
for (unsigned i=0; i<statements->dim; i++)
|
||||
{
|
||||
Statement* s = (Statement*)statements->data[i];
|
||||
Statement* s = static_cast<Statement*>(statements->data[i]);
|
||||
if (s) s->toNakedIR(p);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user