source: CIVL/include/headers/limits.h@ 1aaefd4

main test-branch
Last change on this file since 1aaefd4 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[aad342c]1/*
2 An instance of limits.h using minimal values. See C11 5.2.4.2.1.
3 There is also a choice involving the char type:
4
5 "If the value of an object of type char is treated as a signed integer
6 when used in an expression, the value of CHAR_MIN shall be the same as
7 that of SCHAR_MIN and the value of CHAR_MAX shall be the same as that
8 of SCHAR_MAX. Otherwise, the value of CHAR_MIN shall be 0 and the
9 value of CHAR_MAX shall be the same as that of UCHAR_MAX.20) The value
10 UCHAR_MAX shall equal 2CHAR_BIT − 1."
11
12 This instance chooses to make char a signed integer type.
13*/
14
15#ifndef _LIMITS_
16#define _LIMITS_
17
18// number of bits for smallest object that is not a bit-field (byte)
19#define CHAR_BIT 8
20
21// minimum value for an object of type signed char
22#define SCHAR_MIN -127 //−(2^7−1)
23
24//maximum value for an object of type signed char
25#define SCHAR_MAX +127 //2^7−1
26
27// maximum value for an object of type unsigned char
28#define UCHAR_MAX 255 //2^8−1
29
30// minimum value for an object of type char
31#define CHAR_MIN -127
32
33//maximum value for an object of type char
34#define CHAR_MAX +127
35
36// maximum number of bytes in a multibyte character, for any supported locale
37#define MB_LEN_MAX 1
38
39// minimum value for an object of type short int
40#define SHRT_MIN -32767 //−(2^15−1)
41
42// maximum value for an object of type short int
43#define SHRT_MAX +32767 //2^15−1
44
45// maximum value for an object of type unsigned short int
46#define USHRT_MAX 65535 //2^16−1
47
48// minimum value for an object of type int
49#define INT_MIN -32767 //−(2^15−1)
50
51// maximum value for an object of type int
52#define INT_MAX +32767 //2^15−1
53
54// maximum value for an object of type unsigned int
55#define UINT_MAX 65535 //2^16−1
56
57// minimum value for an object of type long int
58#define LONG_MIN -2147483647 //−(2^31−1)
59
60// maximum value for an object of type long int
61#define LONG_MAX +2147483647 //2^31−1
62
63// maximum value for an object of type unsigned long int
64#define ULONG_MAX 4294967295 //2^32−1
65
66// minimum value for an object of type long long int
67#define LLONG_MIN -9223372036854775807 //−(2^63−1)
68
69// maximum value for an object of type long long int
70#define LLONG_MAX +9223372036854775807 //2^63−1
71
72// maximum value for an object of type unsigned long long int
73#define ULLONG_MAX 18446744073709551615 //2^64−1
74#endif
Note: See TracBrowser for help on using the repository browser.