Debian Codegraph @

clang-tools-extra/test/clang-tidy/checkers/google/runtime-int.m

raw
1 // RUN: clang-tidy -checks=-*,google-runtime-int %s 2>&1 -- | count 0
2 // RUN: clang-tidy -checks=-*,google-runtime-int %s 2>&1 -- -x objective-c++ | count 0
3
4 typedef long NSInteger;
5 typedef unsigned long NSUInteger;
6
7 @interface NSString
8 @property(readonly) NSInteger integerValue;
9 @property(readonly) long long longLongValue;
10 @property(readonly) NSUInteger length;
11 @end
12
13 NSInteger Foo(NSString *s) {
14 return [s integerValue];
15 }
16
17 long long Bar(NSString *s) {
18 return [s longLongValue];
19 }
20
21 NSUInteger Baz(NSString *s) {
22 return [s length];
23 }
24
25 unsigned short NSSwapShort(unsigned short inv);
26
27 long DoSomeMath(long a, short b) {
28 short c = NSSwapShort(b);
29 long a2 = a * 5L;
30 return a2 + c;
31 }
32