Did my commit for the last patch for the .loc directory from the wrong place and
[oota-llvm.git] / include / llvm / Support / AlignOf.h
index 108c59f0eb40de7b5087a697600b206441747fcd..6a7a1a6bd223b4abbd07d35811528e24d5334580 100644 (file)
@@ -16,7 +16,7 @@
 #define LLVM_SUPPORT_ALIGNOF_H
 
 namespace llvm {
-  
+
 template <typename T>
 struct AlignmentCalcImpl {
   char x;
@@ -24,7 +24,7 @@ struct AlignmentCalcImpl {
 private:
   AlignmentCalcImpl() {} // Never instantiate.
 };
-  
+
 /// AlignOf - A templated class that contains an enum value representing
 ///  the alignment of the template argument.  For example,
 ///  AlignOf<int>::Alignment represents the alignment of type "int".  The
@@ -34,15 +34,16 @@ private:
 ///  compile-time constant (e.g., for template instantiation).
 template <typename T>
 struct AlignOf {
-  enum { Alignment = sizeof(AlignmentCalcImpl<T>) - sizeof(T) };
+  enum { Alignment =
+         static_cast<unsigned int>(sizeof(AlignmentCalcImpl<T>) - sizeof(T)) };
 
   enum { Alignment_GreaterEqual_2Bytes = Alignment >= 2 ? 1 : 0 };
   enum { Alignment_GreaterEqual_4Bytes = Alignment >= 4 ? 1 : 0 };
   enum { Alignment_GreaterEqual_8Bytes = Alignment >= 8 ? 1 : 0 };
   enum { Alignment_GreaterEqual_16Bytes = Alignment >= 16 ? 1 : 0 };
-  
+
   enum { Alignment_LessEqual_2Bytes = Alignment <= 2 ? 1 : 0 };
-  enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 }; 
+  enum { Alignment_LessEqual_4Bytes = Alignment <= 4 ? 1 : 0 };
   enum { Alignment_LessEqual_8Bytes = Alignment <= 8 ? 1 : 0 };
   enum { Alignment_LessEqual_16Bytes = Alignment <= 16 ? 1 : 0 };
 
@@ -54,6 +55,6 @@ struct AlignOf {
 ///  alignof<int>() returns the alignment of an int.
 template <typename T>
 static inline unsigned alignof() { return AlignOf<T>::Alignment; }
-  
+
 } // end namespace llvm
 #endif