From 34cd4a484e532cc463fd5a4bf59b88d13c5467c1 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 5 May 2008 18:30:58 +0000 Subject: Fix more -Wshorten-64-to-32 warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/StringMap.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/llvm/ADT/StringMap.h') diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 27ea5d3ea1..869a87fdce 100644 --- a/include/llvm/ADT/StringMap.h +++ b/include/llvm/ADT/StringMap.h @@ -153,13 +153,14 @@ public: static StringMapEntry *Create(const char *KeyStart, const char *KeyEnd, AllocatorTy &Allocator, InitType InitVal) { - unsigned KeyLength = KeyEnd-KeyStart; + unsigned KeyLength = static_cast(KeyEnd-KeyStart); // Okay, the item doesn't already exist, and 'Bucket' is the bucket to fill // in. Allocate a new item with space for the string at the end and a null // terminator. - unsigned AllocSize = sizeof(StringMapEntry)+KeyLength+1; + unsigned AllocSize = static_cast(sizeof(StringMapEntry))+ + KeyLength+1; unsigned Alignment = alignof(); StringMapEntry *NewItem = @@ -236,9 +237,9 @@ class StringMap : public StringMapImpl { AllocatorTy Allocator; typedef StringMapEntry MapEntryTy; public: - StringMap() : StringMapImpl(sizeof(MapEntryTy)) {} + StringMap() : StringMapImpl(static_cast(sizeof(MapEntryTy))) {} explicit StringMap(unsigned InitialSize) - : StringMapImpl(InitialSize, sizeof(MapEntryTy)) {} + : StringMapImpl(InitialSize, static_cast(sizeof(MapEntryTy))) {} AllocatorTy &getAllocator() { return Allocator; } const AllocatorTy &getAllocator() const { return Allocator; } -- cgit v1.2.3