diff --git a/src/cc65/asmstmt.c b/src/cc65/asmstmt.c index 148d62d9c..9dd1f906a 100644 --- a/src/cc65/asmstmt.c +++ b/src/cc65/asmstmt.c @@ -135,7 +135,7 @@ static void ParseByteArg (StrBuf* T, unsigned Arg) ConsumeComma (); /* Evaluate the expression */ - ExprDesc Expr = StaticConstAbsIntExpr (hie1); + ExprDesc Expr = NoCodeConstAbsIntExpr (hie1); /* Check the range but allow negative values if the type is signed */ if (IsSignUnsigned (Expr.Type)) { @@ -168,7 +168,7 @@ static void ParseWordArg (StrBuf* T, unsigned Arg) ConsumeComma (); /* Evaluate the expression */ - ExprDesc Expr = StaticConstAbsIntExpr (hie1); + ExprDesc Expr = NoCodeConstAbsIntExpr (hie1); /* Check the range but allow negative values if the type is signed */ if (IsSignUnsigned (Expr.Type)) { @@ -201,7 +201,7 @@ static void ParseLongArg (StrBuf* T, unsigned Arg attribute ((unused))) ConsumeComma (); /* Evaluate the expression */ - ExprDesc Expr = StaticConstAbsIntExpr (hie1); + ExprDesc Expr = NoCodeConstAbsIntExpr (hie1); /* Convert into a hex number */ xsprintf (Buf, sizeof (Buf), "$%08lX", Expr.IVal & 0xFFFFFFFF); @@ -325,7 +325,7 @@ static void ParseStrArg (StrBuf* T, unsigned Arg attribute ((unused))) break; default: - Expr = StaticConstAbsIntExpr (hie1); + Expr = NoCodeConstAbsIntExpr (hie1); xsprintf (Buf, sizeof (Buf), "%ld", Expr.IVal); SB_AppendStr (T, Buf); break; diff --git a/src/cc65/declare.c b/src/cc65/declare.c index d1ac0e43f..b184c31a6 100644 --- a/src/cc65/declare.c +++ b/src/cc65/declare.c @@ -622,7 +622,7 @@ static SymEntry* ParseEnumDecl (const char* Name) if (CurTok.Tok == TOK_ASSIGN) { NextToken (); - ExprDesc Expr = StaticConstAbsIntExpr (hie1); + ExprDesc Expr = NoCodeConstAbsIntExpr (hie1); EnumVal = Expr.IVal; MemberType = Expr.Type; IsSigned = IsSignSigned (MemberType); @@ -772,7 +772,7 @@ static int ParseFieldWidth (Declaration* Decl) /* Read the width */ NextToken (); - ExprDesc Expr = StaticConstAbsIntExpr (hie1); + ExprDesc Expr = NoCodeConstAbsIntExpr (hie1); if (Expr.IVal < 0) { Error ("Negative width in bit-field"); @@ -1859,7 +1859,7 @@ static void Declarator (const DeclSpec* Spec, Declaration* D, declmode_t Mode) /* Read the size if it is given */ if (CurTok.Tok != TOK_RBRACK) { - ExprDesc Expr = StaticConstAbsIntExpr (hie1); + ExprDesc Expr = NoCodeConstAbsIntExpr (hie1); if (Expr.IVal <= 0) { if (D->Ident[0] != '\0') { Error ("Size of array '%s' is invalid", D->Ident); @@ -2220,7 +2220,7 @@ static ExprDesc ParseScalarInitInternal (Type* T) } /* Get the expression and convert it to the target type */ - ExprDesc ED = StaticConstExpr (hie1); + ExprDesc ED = NoCodeConstExpr (hie1); TypeConversion (&ED, T); /* Close eventually opening braces */ @@ -2253,7 +2253,7 @@ static unsigned ParsePointerInit (Type* T) unsigned BraceCount = OpeningCurlyBraces (0); /* Expression */ - ExprDesc ED = StaticConstExpr (hie1); + ExprDesc ED = NoCodeConstExpr (hie1); TypeConversion (&ED, T); /* Output the data */ @@ -2598,7 +2598,7 @@ static unsigned ParseVoidInit (Type* T) /* Allow an arbitrary list of values */ Size = 0; do { - ExprDesc Expr = StaticConstExpr (hie1); + ExprDesc Expr = NoCodeConstExpr (hie1); switch (GetUnderlyingTypeCode (&Expr.Type[0])) { case T_SCHAR: diff --git a/src/cc65/expr.c b/src/cc65/expr.c index d1ceb27c5..e627b6606 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -3150,14 +3150,14 @@ static void hieAndPP (ExprDesc* Expr) ** called recursively from the preprocessor. */ { - *Expr = StaticConstAbsIntExpr (hie2); + *Expr = NoCodeConstAbsIntExpr (hie2); while (CurTok.Tok == TOK_BOOL_AND) { /* Skip the && */ NextToken (); /* Get rhs */ - ExprDesc Expr2 = StaticConstAbsIntExpr (hie2); + ExprDesc Expr2 = NoCodeConstAbsIntExpr (hie2); /* Combine the two */ Expr->IVal = (Expr->IVal && Expr2.IVal); @@ -3171,14 +3171,14 @@ static void hieOrPP (ExprDesc *Expr) ** called recursively from the preprocessor. */ { - *Expr = StaticConstAbsIntExpr (hieAndPP); + *Expr = NoCodeConstAbsIntExpr (hieAndPP); while (CurTok.Tok == TOK_BOOL_OR) { /* Skip the && */ NextToken (); /* Get rhs */ - ExprDesc Expr2 = StaticConstAbsIntExpr (hieAndPP); + ExprDesc Expr2 = NoCodeConstAbsIntExpr (hieAndPP); /* Combine the two */ Expr->IVal = (Expr->IVal || Expr2.IVal); @@ -4047,11 +4047,11 @@ void BoolExpr (void (*Func) (ExprDesc*), ExprDesc* Expr) -ExprDesc StaticConstExpr (void (*Func) (ExprDesc*)) -/* Will evaluate an expression via the given function. If the result is not a -** static constant expression, a diagnostic will be printed, and the value is -** replaced by a constant one to make sure there are no internal errors that -** result from this input error. +ExprDesc NoCodeConstExpr (void (*Func) (ExprDesc*)) +/* Get an expression evaluated via the given function. If the result is not a +** constant expression without runtime code generated, a diagnostic will be +** printed, and the value is replaced by a constant one to make sure there are +** no internal errors that result from this input error. */ { ExprDesc Expr; @@ -4071,11 +4071,11 @@ ExprDesc StaticConstExpr (void (*Func) (ExprDesc*)) -ExprDesc StaticConstAbsIntExpr (void (*Func) (ExprDesc*)) -/* Will evaluate an expression via the given function. If the result is not a -** static constant numeric integer value, a diagnostic will be printed, and the -** value is replaced by a constant one to make sure there are no internal -** errors that result from this input error. +ExprDesc NoCodeConstAbsIntExpr (void (*Func) (ExprDesc*)) +/* Get an expression evaluated via the given function. If the result is not a +** constant numeric integer value without runtime code generated, a diagnostic +** will be printed, and the value is replaced by a constant one to make sure +** there are no internal errors that result from this input error. */ { ExprDesc Expr; diff --git a/src/cc65/expr.h b/src/cc65/expr.h index 8f7eb6f09..806a376bb 100644 --- a/src/cc65/expr.h +++ b/src/cc65/expr.h @@ -61,18 +61,18 @@ void BoolExpr (void (*Func) (ExprDesc*), ExprDesc* Expr); ** are no internal errors that result from this input error. */ -ExprDesc StaticConstExpr (void (*Func) (ExprDesc*)); +ExprDesc NoCodeConstExpr (void (*Func) (ExprDesc*)); /* Get an expression evaluated via the given function. If the result is not a -** static constant expression, a diagnostic will be printed, and the value is -** replaced by a constant one to make sure there are no internal errors that -** result from this input error. +** constant expression without runtime code generated, a diagnostic will be +** printed, and the value is replaced by a constant one to make sure there are +** no internal errors that result from this input error. */ -ExprDesc StaticConstAbsIntExpr (void (*Func) (ExprDesc*)); -/* Get an expression evaluate via the given function. If the result is not a -** static constant numeric integer value, a diagnostic will be printed, and the -** value is replaced by a constant one to make sure there are no internal -** errors that result from this input error. +ExprDesc NoCodeConstAbsIntExpr (void (*Func) (ExprDesc*)); +/* Get an expression evaluated via the given function. If the result is not a +** constant numeric integer value without runtime code generated, a diagnostic +** will be printed, and the value is replaced by a constant one to make sure +** there are no internal errors that result from this input error. */ void hie10 (ExprDesc* lval); diff --git a/src/cc65/preproc.c b/src/cc65/preproc.c index 2d2f316d7..cc160c1c3 100644 --- a/src/cc65/preproc.c +++ b/src/cc65/preproc.c @@ -1076,7 +1076,7 @@ static int DoIf (int Skip) NextToken (); /* Call the expression parser */ - ExprDesc Expr = StaticConstExpr (hie1); + ExprDesc Expr = NoCodeConstExpr (hie1); /* End preprocessing mode */ Preprocessing = 0; diff --git a/src/cc65/preproc.h b/src/cc65/preproc.h index 464b02337..1487179f4 100644 --- a/src/cc65/preproc.h +++ b/src/cc65/preproc.h @@ -44,7 +44,7 @@ -/* Set when the preprocessor calls StaticConstExpr() recursively */ +/* Set when the preprocessor calls NoCodeConstExpr() recursively */ extern unsigned char Preprocessing; diff --git a/src/cc65/staticassert.c b/src/cc65/staticassert.c index 3372c59a1..1bf8dd4c5 100644 --- a/src/cc65/staticassert.c +++ b/src/cc65/staticassert.c @@ -65,7 +65,7 @@ void ParseStaticAssert () } /* Parse assertion condition */ - Expr = StaticConstAbsIntExpr (hie1); + Expr = NoCodeConstAbsIntExpr (hie1); failed = !Expr.IVal; /* If there is a comma, we also have an error message. The message is optional because we diff --git a/src/cc65/swstmt.c b/src/cc65/swstmt.c index 559e168c3..3878f7b67 100644 --- a/src/cc65/swstmt.c +++ b/src/cc65/swstmt.c @@ -216,7 +216,7 @@ void CaseLabel (void) NextToken (); /* Read the selector expression */ - CaseExpr = StaticConstAbsIntExpr (hie1); + CaseExpr = NoCodeConstAbsIntExpr (hie1); Val = CaseExpr.IVal; /* Now check if we're inside a switch statement */