Fixes 2 kinds of warnings.

1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
This commit is contained in:
kai 2011-11-23 19:01:04 +01:00
parent 7753acf176
commit a5b3dd29b5
13 changed files with 44 additions and 44 deletions

View file

@ -1134,7 +1134,7 @@ DValue* DtoDeclarationExp(Dsymbol* declaration)
// choose the right set in case this is a conditional declaration
Array *d = a->include(NULL, NULL);
if (d)
for (int i=0; i < d->dim; ++i)
for (unsigned i=0; i < d->dim; ++i)
{
DtoDeclarationExp((Dsymbol*)d->data[i]);
}
@ -1143,7 +1143,7 @@ DValue* DtoDeclarationExp(Dsymbol* declaration)
else if (TemplateMixin* m = declaration->isTemplateMixin())
{
Logger::println("TemplateMixin");
for (int i=0; i < m->members->dim; ++i)
for (unsigned i=0; i < m->members->dim; ++i)
{
Dsymbol* mdsym = (Dsymbol*)m->members->data[i];
DtoDeclarationExp(mdsym);
@ -1159,7 +1159,7 @@ DValue* DtoDeclarationExp(Dsymbol* declaration)
}
assert(tupled->objects);
for (int i=0; i < tupled->objects->dim; ++i)
for (unsigned i=0; i < tupled->objects->dim; ++i)
{
DsymbolExp* exp = (DsymbolExp*)tupled->objects->data[i];
DtoDeclarationExp(exp->s);
@ -1637,7 +1637,7 @@ bool hasUnalignedFields(Type* t)
// go through all the fields and try to find something unaligned
ts->unaligned = 2;
for (int i = 0; i < sym->fields.dim; i++)
for (unsigned i = 0; i < sym->fields.dim; i++)
{
VarDeclaration* f = (VarDeclaration*)sym->fields.data[i];
unsigned a = f->type->alignsize() - 1;