[cfe-commits] r62565 - /cfe/trunk/test/Analysis/CFNumber.c

Daniel Dunbar daniel at zuster.org
Mon Jan 19 17:27:09 PST 2009


Author: ddunbar
Date: Mon Jan 19 19:27:09 2009
New Revision: 62565

URL: http://llvm.org/viewvc/llvm-project?rev=62565&view=rev
Log:
Make test independent of stdint.h

Modified:
    cfe/trunk/test/Analysis/CFNumber.c

Modified: cfe/trunk/test/Analysis/CFNumber.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/CFNumber.c?rev=62565&r1=62564&r2=62565&view=diff

==============================================================================
--- cfe/trunk/test/Analysis/CFNumber.c (original)
+++ cfe/trunk/test/Analysis/CFNumber.c Mon Jan 19 19:27:09 2009
@@ -15,18 +15,14 @@
 typedef const struct __CFNumber * CFNumberRef;
 extern CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType theType, const void *valuePtr);
 
-#include <stdint.h>
-
-CFNumberRef f1() {
-  uint8_t x = 1;
+CFNumberRef f1(unsigned char x) {
   return CFNumberCreate(0, kCFNumberSInt16Type, &x);  // expected-warning{{An 8 bit integer is used to initialize a CFNumber object that represents a 16 bit integer. 8 bits of the CFNumber value will be garbage.}}
 }
 
-CFNumberRef f2() {
-  uint16_t x = 1;
+CFNumberRef f2(unsigned short x) {
   return CFNumberCreate(0, kCFNumberSInt8Type, &x); // expected-warning{{A 16 bit integer is used to initialize a CFNumber object that represents an 8 bit integer. 8 bits of the input integer will be lost.}}
 }
 
 CFNumberRef f3(unsigned i) {
   return CFNumberCreate(0, kCFNumberLongType, &i); // expected-warning{{A 32 bit integer is used to initialize a CFNumber object that represents a 64 bit integer.}}
-}
\ No newline at end of file
+}





More information about the cfe-commits mailing list