silence some "comparison between signed and unsigned integer expressions"
authorChris Lattner <sabre@nondot.org>
Thu, 17 May 2007 20:01:40 +0000 (20:01 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 May 2007 20:01:40 +0000 (20:01 +0000)
warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37177 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallVector.h

index 12127603058ea812471bdc46877deab21fdf4ef7..5fcb2b93065b513e94fdc9b8d28b3f9be2f9ca2e 100644 (file)
@@ -147,7 +147,7 @@ public:
       destroy_range(Begin+N, End);
       End = Begin+N;
     } else if (N > size()) {
-      if (Capacity-Begin < N)
+      if (unsigned(Capacity-Begin) < N)
         grow(N);
       construct_range(End, Begin+N, T());
       End = Begin+N;
@@ -159,7 +159,7 @@ public:
       destroy_range(Begin+N, End);
       End = Begin+N;
     } else if (N > size()) {
-      if (Capacity-Begin < N)
+      if (unsigned(Capacity-Begin) < N)
         grow(N);
       construct_range(End, Begin+N, NV);
       End = Begin+N;
@@ -189,7 +189,7 @@ public:
   
   void assign(unsigned NumElts, const T &Elt) {
     clear();
-    if (Capacity-Begin < NumElts)
+    if (unsigned(Capacity-Begin) < NumElts)
       grow(NumElts);
     End = Begin+NumElts;
     construct_range(Begin, End, Elt);