Rename LCC constexpr function to constantexpr, avoiding C23 keyword clash

This commit is contained in:
Tim Angus 2025-03-08 13:00:48 +00:00
parent 3fb9006e64
commit c9697a0104
4 changed files with 5 additions and 5 deletions

View file

@ -645,7 +645,7 @@ extern int process(char *);
extern int findfunc(char *, char *);
extern int findcount(char *, int, int);
extern Tree constexpr(int);
extern Tree constantexpr(int);
extern int intexpr(int, int);
extern Tree simplify(int, Type, Tree, Tree);
extern int ispow2(unsigned long u);

View file

@ -192,7 +192,7 @@ static int initstruct(int len, Type ty, int lev) {
return n;
}
/* initializer - constexpr | { constexpr ( , constexpr )* [ , ] } */
/* initializer - constantexpr | { constantexpr ( , constantexpr )* [ , ] } */
Type initializer(Type ty, int lev) {
int n = 0;
Tree e;

View file

@ -182,7 +182,7 @@ static int subi(long x, long y, long min, long max, int needconst) {
static int subd(double x, double y, double min, double max, int needconst) {
return addd(x, -y, min, max, needconst);
}
Tree constexpr(int tok) {
Tree constantexpr(int tok) {
Tree p;
needconst++;
@ -192,7 +192,7 @@ Tree constexpr(int tok) {
}
int intexpr(int tok, int n) {
Tree p = constexpr(tok);
Tree p = constantexpr(tok);
needconst++;
if (p->op == CNST+I || p->op == CNST+U)

View file

@ -119,7 +119,7 @@ void statement(int loop, Swtch swp, int lev) {
static char stop[] = { IF, ID, 0 };
Tree p;
t = gettok();
p = constexpr(0);
p = constantexpr(0);
if (generic(p->op) == CNST && isint(p->type)) {
if (swp) {
needconst++;