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
+3 -3
View File
@@ -447,7 +447,7 @@ LLValue* DtoGEPi(LLValue* ptr, unsigned i0, unsigned i1, const char* var, llvm::
LLConstant* DtoGEPi(LLConstant* ptr, unsigned i0, unsigned i1)
{
LLValue* v[2] = { DtoConstUint(i0), DtoConstUint(i1) };
return llvm::ConstantExpr::getGetElementPtr(ptr, v, 2);
return llvm::ConstantExpr::getGetElementPtr(ptr, v, true);
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -596,7 +596,7 @@ LLConstant* DtoConstString(const char* str)
LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) };
return DtoConstSlice(
DtoConstSize_t(s.size()),
llvm::ConstantExpr::getGetElementPtr(gvar,idxs,2),
llvm::ConstantExpr::getGetElementPtr(gvar, idxs, true),
Type::tchar->arrayOf()
);
}
@@ -608,7 +608,7 @@ LLConstant* DtoConstStringPtr(const char* str, const char* section)
*gIR->module, init->getType(), true,llvm::GlobalValue::InternalLinkage, init, ".str");
if (section) gvar->setSection(section);
LLConstant* idxs[2] = { DtoConstUint(0), DtoConstUint(0) };
return llvm::ConstantExpr::getGetElementPtr(gvar,idxs,2);
return llvm::ConstantExpr::getGetElementPtr(gvar, idxs, true);
}
//////////////////////////////////////////////////////////////////////////////////////////