|
1 | 1 |
|
2 | | -_checkInt(int i, int min, int max, String type, String name) { |
| 2 | +void _checkInt(int i, int min, int max, String type, String name) { |
3 | 3 | if (i < min || i > max) { |
4 | 4 | throw ArgumentError.value(i, name, "must be a $type"); |
5 | 5 | } |
6 | 6 | } |
7 | 7 |
|
8 | | -checkUint8(int i, [String name = "i"]) |
| 8 | +void checkUint8(int i, [String name = "i"]) |
9 | 9 | => _checkInt(i, 0, 0xff, "uint8", name); |
10 | 10 |
|
11 | | -checkUint16(int i, [String name = "i"]) |
| 11 | +void checkUint16(int i, [String name = "i"]) |
12 | 12 | => _checkInt(i, 0, 0xffff, "uint16", name); |
13 | 13 |
|
14 | | -checkUint32(int i, [String name = "i"]) |
| 14 | +void checkUint32(int i, [String name = "i"]) |
15 | 15 | => _checkInt(i, 0, 0xffffffff, "uint32", name); |
16 | 16 |
|
17 | | -checkInt32(int i, [String name = "i"]) |
| 17 | +void checkInt32(int i, [String name = "i"]) |
18 | 18 | => _checkInt(i, -0x80000000, 0x7fffffff, "int32", name); |
19 | 19 |
|
20 | 20 | final BigInt maxUint64 = (BigInt.from(1) << 64) - BigInt.one; |
21 | 21 |
|
22 | | -checkUint64(BigInt i, [String name = "i"]) { |
| 22 | +void checkUint64(BigInt i, [String name = "i"]) { |
23 | 23 | if (i.isNegative || i > maxUint64) { |
24 | 24 | throw ArgumentError.value(i, name, "must be a uint64"); |
25 | 25 | } |
|
0 commit comments