Fix VS warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19383 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2005-01-08 19:48:40 +00:00
parent 4d0801b243
commit 22bc934720
2 changed files with 13 additions and 13 deletions

View File

@ -73,7 +73,7 @@ const Type *llvm::getStructOffsetType(const Type *Ty, unsigned &Offset,
"Offset not in composite!");
NextType = ATy->getElementType();
unsigned ChildSize = TD.getTypeSize(NextType);
unsigned ChildSize = (unsigned)TD.getTypeSize(NextType);
if (ConstantSInt::isValueValidForType(Type::IntTy, Offset/ChildSize))
Indices.push_back(ConstantSInt::get(Type::IntTy, Offset/ChildSize));
else
@ -84,10 +84,10 @@ const Type *llvm::getStructOffsetType(const Type *Ty, unsigned &Offset,
return Ty; // Return the leaf type
}
unsigned SubOffs = Offset - ThisOffset;
unsigned SubOffs = unsigned(Offset - ThisOffset);
const Type *LeafTy = getStructOffsetType(NextType, SubOffs,
Indices, TD, StopEarly);
Offset = ThisOffset + SubOffs;
Offset = unsigned(ThisOffset + SubOffs);
return LeafTy;
}