Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 019a348 in mainline


Ignore:
Timestamp:
2010-11-26T01:21:47Z (11 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
04357767
Parents:
3ebba9a
Message:

use portable constant defines for integer ranges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/stdint.h

    r3ebba9a r019a348  
    3636#define KERN_STDINT_H_
    3737
    38 #define INT8_MIN  (0x80)
    39 #define INT8_MAX  (0x7F)
     38#define INT8_MIN  INT8_C(0x80)
     39#define INT8_MAX  INT8_C(0x7F)
    4040
    41 #define UINT8_MIN  (0u)
    42 #define UINT8_MAX  (0xFFu)
     41#define UINT8_MIN  UINT8_C(0)
     42#define UINT8_MAX  UINT8_C(0xFF)
    4343
    44 #define INT16_MIN  (0x8000)
    45 #define INT16_MAX  (0x7FFF)
     44#define INT16_MIN  INT16_C(0x8000)
     45#define INT16_MAX  INT16_C(0x7FFF)
    4646
    47 #define UINT16_MIN  (0u)
    48 #define UINT16_MAX  (0xFFFFu)
     47#define UINT16_MIN  UINT16_C(0)
     48#define UINT16_MAX  UINT16_C(0xFFFF)
    4949
    50 #define INT32_MIN  (0x80000000l)
    51 #define INT32_MAX  (0x7FFFFFFFl)
     50#define INT32_MIN  INT32_C(0x80000000)
     51#define INT32_MAX  INT32_C(0x7FFFFFFF)
    5252
    53 #define UINT32_MIN  (0ul)
    54 #define UINT32_MAX  (0xFFFFFFFFul)
     53#define UINT32_MIN  UINT32_C(0)
     54#define UINT32_MAX  UINT32_C(0xFFFFFFFF)
    5555
    56 #define INT64_MIN  (0x8000000000000000ll)
    57 #define INT64_MAX  (0x7FFFFFFFFFFFFFFFll)
     56#define INT64_MIN  INT64_C(0x8000000000000000)
     57#define INT64_MAX  INT64_C(0x7FFFFFFFFFFFFFFF)
    5858
    59 #define UINT64_MIN  (0ull)
    60 #define UINT64_MAX  (0xFFFFFFFFFFFFFFFFull)
     59#define UINT64_MIN  UINT64_C(0)
     60#define UINT64_MAX  UINT64_C(0xFFFFFFFFFFFFFFFF)
    6161
    6262#endif
Note: See TracChangeset for help on using the changeset viewer.