Skip to content

Commit c9697a0

Browse files
committed
Rename LCC constexpr function to constantexpr, avoiding C23 keyword clash
1 parent 3fb9006 commit c9697a0

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

code/tools/lcc/src/c.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ extern int process(char *);
645645
extern int findfunc(char *, char *);
646646
extern int findcount(char *, int, int);
647647

648-
extern Tree constexpr(int);
648+
extern Tree constantexpr(int);
649649
extern int intexpr(int, int);
650650
extern Tree simplify(int, Type, Tree, Tree);
651651
extern int ispow2(unsigned long u);

code/tools/lcc/src/init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int initstruct(int len, Type ty, int lev) {
192192
return n;
193193
}
194194

195-
/* initializer - constexpr | { constexpr ( , constexpr )* [ , ] } */
195+
/* initializer - constantexpr | { constantexpr ( , constantexpr )* [ , ] } */
196196
Type initializer(Type ty, int lev) {
197197
int n = 0;
198198
Tree e;

code/tools/lcc/src/simp.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int subi(long x, long y, long min, long max, int needconst) {
182182
static int subd(double x, double y, double min, double max, int needconst) {
183183
return addd(x, -y, min, max, needconst);
184184
}
185-
Tree constexpr(int tok) {
185+
Tree constantexpr(int tok) {
186186
Tree p;
187187

188188
needconst++;
@@ -192,7 +192,7 @@ Tree constexpr(int tok) {
192192
}
193193

194194
int intexpr(int tok, int n) {
195-
Tree p = constexpr(tok);
195+
Tree p = constantexpr(tok);
196196

197197
needconst++;
198198
if (p->op == CNST+I || p->op == CNST+U)

code/tools/lcc/src/stmt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void statement(int loop, Swtch swp, int lev) {
119119
static char stop[] = { IF, ID, 0 };
120120
Tree p;
121121
t = gettok();
122-
p = constexpr(0);
122+
p = constantexpr(0);
123123
if (generic(p->op) == CNST && isint(p->type)) {
124124
if (swp) {
125125
needconst++;

0 commit comments

Comments
 (0)