Skip to content

Commit 1e33e84

Browse files
committed
fix <inttypes.h> typo, correct <assert.h> line type, and use Clang builtin macros for (U)INT_(FAST/LEAST)N_WIDTH
1 parent e967bf8 commit 1e33e84

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/libc/include/assert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ __BEGIN_DECLS
1313

1414
struct __assert_loc {
1515
const char *__file;
16-
__UINT32_TYPE__ __line;
16+
__UINT_LEAST32_TYPE__ __line;
1717
const char *__function;
1818
const char *__assertion;
1919
};

src/libc/include/inttypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
#define PRIXMAX __UINTMAX_FMTX__
9898

9999
#define PRIdPTR __INTPTR_FMTd__
100-
#define PRIiPTR __ INTPTR_FMTi__
100+
#define PRIiPTR __INTPTR_FMTi__
101101
#define PRIoPTR __UINTPTR_FMTo__
102102
#define PRIuPTR __UINTPTR_FMTu__
103103
#define PRIxPTR __UINTPTR_FMTx__

src/libc/include/stdint.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ typedef __UINT8_TYPE__ uint8_t;
1515
typedef __INT_FAST8_TYPE__ int_fast8_t;
1616
#define INT_FAST8_MIN (~__INT_FAST8_MAX__)
1717
#define INT_FAST8_MAX __INT_FAST8_MAX__
18-
#define INT_FAST8_WIDTH __STDINT_WIDTH(INT_FAST8)
18+
#define INT_FAST8_WIDTH __INT_FAST8_WIDTH__
1919
typedef __UINT_FAST8_TYPE__ uint_fast8_t;
2020
#define UINT_FAST8_MAX __UINT_FAST8_MAX__
21-
#define UINT_FAST8_WIDTH __STDINT_WIDTH(UINT_FAST8)
21+
#define UINT_FAST8_WIDTH __INT_FAST8_WIDTH__
2222
typedef __INT_LEAST8_TYPE__ int_least8_t;
2323
#define INT_LEAST8_MIN (~__INT_LEAST8_MAX__)
2424
#define INT_LEAST8_MAX __INT_LEAST8_MAX__
25-
#define INT_LEAST8_WIDTH __STDINT_WIDTH(INT_LEAST8)
25+
#define INT_LEAST8_WIDTH __INT_LEAST8_WIDTH__
2626
typedef __UINT_LEAST8_TYPE__ uint_least8_t;
2727
#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
28-
#define UINT_LEAST8_WIDTH __STDINT_WIDTH(UINT_LEAST8)
28+
#define UINT_LEAST8_WIDTH __INT_LEAST8_WIDTH__
2929

3030
typedef __INT16_TYPE__ int16_t;
3131
#define INT16_MIN (~__INT16_MAX__)
@@ -39,17 +39,17 @@ typedef __UINT16_TYPE__ uint16_t;
3939
typedef __INT_FAST16_TYPE__ int_fast16_t;
4040
#define INT_FAST16_MIN (~__INT_FAST16_MAX__)
4141
#define INT_FAST16_MAX __INT_FAST16_MAX__
42-
#define INT_FAST16_WIDTH __STDINT_WIDTH(INT_FAST16)
42+
#define INT_FAST16_WIDTH __INT_FAST16_WIDTH__
4343
typedef __UINT_FAST16_TYPE__ uint_fast16_t;
4444
#define UINT_FAST16_MAX __UINT_FAST16_MAX__
45-
#define UINT_FAST16_WIDTH __STDINT_WIDTH(UINT_FAST16)
45+
#define UINT_FAST16_WIDTH __INT_FAST16_WIDTH__
4646
typedef __INT_LEAST16_TYPE__ int_least16_t;
4747
#define INT_LEAST16_MIN (~__INT_LEAST16_MAX__)
4848
#define INT_LEAST16_MAX __INT_LEAST16_MAX__
49-
#define INT_LEAST16_WIDTH __STDINT_WIDTH(INT_LEAST16)
49+
#define INT_LEAST16_WIDTH __INT_LEAST16_WIDTH__
5050
typedef __UINT_LEAST16_TYPE__ uint_least16_t;
5151
#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
52-
#define UINT_LEAST16_WIDTH __STDINT_WIDTH(UINT_LEAST16)
52+
#define UINT_LEAST16_WIDTH __INT_LEAST16_WIDTH__
5353

5454
#ifdef __INT24_TYPE__
5555
typedef __INT24_TYPE__ int24_t;
@@ -75,21 +75,21 @@ typedef __UINT32_TYPE__ uint32_t;
7575
typedef __INT_FAST32_TYPE__ int_fast32_t;
7676
#define INT_FAST32_MIN (~__INT_FAST32_MAX__)
7777
#define INT_FAST32_MAX __INT_FAST32_MAX__
78-
#define INT_FAST32_WIDTH __STDINT_WIDTH(INT_FAST32)
78+
#define INT_FAST32_WIDTH __INT_FAST32_WIDTH__
7979
typedef __UINT_FAST32_TYPE__ uint_fast32_t;
8080
#define UINT_FAST32_MAX __UINT_FAST32_MAX__
81-
#define UINT_FAST32_WIDTH __STDINT_WIDTH(UINT_FAST32)
81+
#define UINT_FAST32_WIDTH __INT_FAST32_WIDTH__
8282
typedef __INT_LEAST32_TYPE__ int_least32_t;
8383
#define INT_LEAST32_MIN (~__INT_LEAST32_MAX__)
8484
#define INT_LEAST32_MAX __INT_LEAST32_MAX__
85-
#define INT_LEAST32_WIDTH __STDINT_WIDTH(INT_LEAST32)
85+
#define INT_LEAST32_WIDTH __INT_LEAST32_WIDTH__
8686
typedef __UINT_LEAST32_TYPE__ uint_least32_t;
8787
#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
88-
#define UINT_LEAST32_WIDTH __STDINT_WIDTH(UINT_LEAST32)
88+
#define UINT_LEAST32_WIDTH __INT_LEAST32_WIDTH__
8989

9090
#ifdef __SIZEOF_INT48__
9191
#define __INT48_TYPE__ signed __int48
92-
#define __INT48_MAX__ ((__INT48_TYPE__)(__UINT48_MAX__>>1))
92+
#define __INT48_MAX__ ((__INT48_TYPE__)(__UINT48_MAX__>>1))
9393
typedef __INT48_TYPE__ int48_t;
9494
#define INT48_MIN (~__INT48_MAX__)
9595
#define INT48_MAX __INT48_MAX__
@@ -115,17 +115,17 @@ typedef __UINT64_TYPE__ uint64_t;
115115
typedef __INT_FAST64_TYPE__ int_fast64_t;
116116
#define INT_FAST64_MIN (~__INT_FAST64_MAX__)
117117
#define INT_FAST64_MAX __INT_FAST64_MAX__
118-
#define INT_FAST64_WIDTH __STDINT_WIDTH(INT_FAST64)
118+
#define INT_FAST64_WIDTH __INT_FAST64_WIDTH__
119119
typedef __UINT_FAST64_TYPE__ uint_fast64_t;
120120
#define UINT_FAST64_MAX __UINT_FAST64_MAX__
121-
#define UINT_FAST64_WIDTH __STDINT_WIDTH(UINT_FAST64)
121+
#define UINT_FAST64_WIDTH __INT_FAST64_WIDTH__
122122
typedef __INT_LEAST64_TYPE__ int_least64_t;
123123
#define INT_LEAST64_MIN (~__INT_LEAST64_MAX__)
124124
#define INT_LEAST64_MAX __INT_LEAST64_MAX__
125-
#define INT_LEAST64_WIDTH __STDINT_WIDTH(INT_LEAST64)
125+
#define INT_LEAST64_WIDTH __INT_LEAST64_WIDTH__
126126
typedef __UINT_LEAST64_TYPE__ uint_least64_t;
127127
#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
128-
#define UINT_LEAST64_WIDTH __STDINT_WIDTH(UINT_LEAST64)
128+
#define UINT_LEAST64_WIDTH __INT_LEAST64_WIDTH__
129129

130130
#ifdef __SIZEOF_INT128__
131131
#define __INT128_TYPE__ signed __int128

0 commit comments

Comments
 (0)