Skip to content

Commit acbd87b

Browse files
committed
Renamed GetUnqualTypeCode() to GetUnderlyingTypeCode() for consistency with GetUnderlyingType().
1 parent 88246f8 commit acbd87b

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

src/cc65/datatype.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ unsigned BitSizeOf (const Type* T)
216216
unsigned SizeOf (const Type* T)
217217
/* Compute size (in bytes) of object represented by type array */
218218
{
219-
switch (GetUnqualTypeCode (T)) {
219+
switch (GetUnderlyingTypeCode (T)) {
220220

221221
case T_VOID:
222222
/* A void variable is a cc65 extension.
@@ -368,7 +368,7 @@ static unsigned GetMinimalTypeSizeByBitWidth (unsigned BitWidth)
368368

369369

370370

371-
TypeCode GetUnqualTypeCode (const Type* Type)
371+
TypeCode GetUnderlyingTypeCode (const Type* Type)
372372
/* Get the type code of the unqualified underlying type of Type.
373373
** Return GetUnqualRawTypeCode (Type) if Type is not scalar.
374374
*/
@@ -725,7 +725,7 @@ const Type* ArithmeticConvert (const Type* lhst, const Type* rhst)
725725
const Type* GetSignedType (const Type* T)
726726
/* Get signed counterpart of the integral type */
727727
{
728-
switch (GetUnqualTypeCode (T) & T_MASK_RANK) {
728+
switch (GetUnderlyingTypeCode (T) & T_MASK_RANK) {
729729
case T_RANK_CHAR:
730730
return type_schar;
731731

@@ -739,7 +739,7 @@ const Type* GetSignedType (const Type* T)
739739
return type_long;
740740

741741
default:
742-
Internal ("Unknown type code: %lX", GetUnqualTypeCode (T));
742+
Internal ("Unknown type code: %lX", GetUnderlyingTypeCode (T));
743743
return T;
744744
}
745745
}
@@ -749,7 +749,7 @@ const Type* GetSignedType (const Type* T)
749749
const Type* GetUnsignedType (const Type* T)
750750
/* Get unsigned counterpart of the integral type */
751751
{
752-
switch (GetUnqualTypeCode (T) & T_MASK_RANK) {
752+
switch (GetUnderlyingTypeCode (T) & T_MASK_RANK) {
753753
case T_RANK_CHAR:
754754
return type_uchar;
755755

@@ -763,7 +763,7 @@ const Type* GetUnsignedType (const Type* T)
763763
return type_ulong;
764764

765765
default:
766-
Internal ("Unknown type code: %lX", GetUnqualTypeCode (T));
766+
Internal ("Unknown type code: %lX", GetUnderlyingTypeCode (T));
767767
return T;
768768
}
769769
}

src/cc65/datatype.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ INLINE TypeCode GetQualifier (const Type* T)
328328
# define GetQualifier(T) ((T)->C & T_MASK_QUAL)
329329
#endif
330330

331-
TypeCode GetUnqualTypeCode (const Type* Type);
331+
TypeCode GetUnderlyingTypeCode (const Type* Type);
332332
/* Get the type code of the unqualified underlying type of Type.
333333
** Return GetUnqualRawTypeCode (Type) if Type is not scalar.
334334
*/
@@ -359,30 +359,30 @@ INLINE TypeCode GetTypeClass (const Type* T)
359359
INLINE TypeCode GetTypeRank (const Type* T)
360360
/* Get the type rank of a type */
361361
{
362-
return (GetUnqualTypeCode (T) & T_MASK_RANK);
362+
return (GetUnderlyingTypeCode (T) & T_MASK_RANK);
363363
}
364364
#else
365-
# define GetTypeRank(T) (GetUnqualTypeCode (T) & T_MASK_RANK)
365+
# define GetTypeRank(T) (GetUnderlyingTypeCode (T) & T_MASK_RANK)
366366
#endif
367367

368368
#if defined(HAVE_INLINE)
369369
INLINE TypeCode GetSignedness (const Type* T)
370370
/* Get the signedness of a type */
371371
{
372-
return (GetUnqualTypeCode (T) & T_MASK_SIGN);
372+
return (GetUnderlyingTypeCode (T) & T_MASK_SIGN);
373373
}
374374
#else
375-
# define GetSignedness(T) (GetUnqualTypeCode (T) & T_MASK_SIGN)
375+
# define GetSignedness(T) (GetUnderlyingTypeCode (T) & T_MASK_SIGN)
376376
#endif
377377

378378
#if defined(HAVE_INLINE)
379379
INLINE TypeCode GetSizeModifier (const Type* T)
380380
/* Get the size modifier of a type */
381381
{
382-
return (GetUnqualTypeCode (T) & T_MASK_SIZE);
382+
return (GetUnderlyingTypeCode (T) & T_MASK_SIZE);
383383
}
384384
#else
385-
# define GetSizeModifier(T) (GetUnqualTypeCode (T) & T_MASK_SIZE)
385+
# define GetSizeModifier(T) (GetUnderlyingTypeCode (T) & T_MASK_SIZE)
386386
#endif
387387

388388
#if defined(HAVE_INLINE)

src/cc65/expr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ unsigned CG_TypeOf (const Type* T)
129129
{
130130
unsigned CG_Type;
131131

132-
switch (GetUnqualTypeCode (T)) {
132+
switch (GetUnderlyingTypeCode (T)) {
133133

134134
case T_SCHAR:
135135
return CF_CHAR;
@@ -188,7 +188,7 @@ unsigned CG_TypeOf (const Type* T)
188188
unsigned CG_CallFlags (const Type* T)
189189
/* Get the code generator flags for calling the function */
190190
{
191-
if (GetUnqualTypeCode (T) == T_FUNC) {
191+
if (GetUnderlyingTypeCode (T) == T_FUNC) {
192192
return (T->A.F->Flags & FD_VARIADIC) ? 0 : CF_FIXARGC;
193193
} else {
194194
Error ("Illegal function type %04lX", T->C);
@@ -291,7 +291,7 @@ static unsigned typeadjust (ExprDesc* lhs, const ExprDesc* rhs, int NoPush)
291291
void LimitExprValue (ExprDesc* Expr, int WarnOverflow)
292292
/* Limit the constant value of the expression to the range of its type */
293293
{
294-
switch (GetUnqualTypeCode (Expr->Type)) {
294+
switch (GetUnderlyingTypeCode (Expr->Type)) {
295295
case T_INT:
296296
case T_SHORT:
297297
if (WarnOverflow && ((Expr->IVal < -0x8000) || (Expr->IVal > 0x7FFF))) {

src/cc65/initdata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ static unsigned ParseVoidInit (Type* T)
679679
Size = 0;
680680
do {
681681
ExprDesc Expr = NoCodeConstExpr (hie1);
682-
switch (GetUnqualTypeCode (&Expr.Type[0])) {
682+
switch (GetUnderlyingTypeCode (&Expr.Type[0])) {
683683

684684
case T_SCHAR:
685685
case T_UCHAR:
@@ -747,7 +747,7 @@ static unsigned ParseVoidInit (Type* T)
747747
static unsigned ParseInitInternal (Type* T, int *Braces, int AllowFlexibleMembers)
748748
/* Parse initialization of variables. Return the number of data bytes. */
749749
{
750-
switch (GetUnqualTypeCode (T)) {
750+
switch (GetUnderlyingTypeCode (T)) {
751751

752752
case T_SCHAR:
753753
case T_UCHAR:

src/cc65/typecmp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ static void DoCompare (const Type* lhs, const Type* rhs, typecmp_t* Result)
259259
}
260260

261261
/* Get the ranks of the left and right hands */
262-
LeftRank = (GetUnqualTypeCode (lhs) & T_MASK_RANK);
263-
RightRank = (GetUnqualTypeCode (rhs) & T_MASK_RANK);
262+
LeftRank = (GetUnderlyingTypeCode (lhs) & T_MASK_RANK);
263+
RightRank = (GetUnderlyingTypeCode (rhs) & T_MASK_RANK);
264264

265265
/* Bit-fields are considered compatible if they have the same
266266
** signedness, bit-offset and bit-width.
@@ -344,10 +344,10 @@ static void DoCompare (const Type* lhs, const Type* rhs, typecmp_t* Result)
344344
case T_RANK_PTR:
345345
++Result->Indirections;
346346
if (Result->Indirections == 1) {
347-
if ((GetUnqualTypeCode (lhs + 1) & T_MASK_RANK) == T_RANK_VOID) {
347+
if ((GetUnderlyingTypeCode (lhs + 1) & T_MASK_RANK) == T_RANK_VOID) {
348348
Result->F |= TCF_VOID_PTR_ON_LEFT;
349349
}
350-
if ((GetUnqualTypeCode (rhs + 1) & T_MASK_RANK) == T_RANK_VOID) {
350+
if ((GetUnderlyingTypeCode (rhs + 1) & T_MASK_RANK) == T_RANK_VOID) {
351351
Result->F |= TCF_VOID_PTR_ON_RIGHT;
352352
}
353353
} else {

src/cc65/typeconv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ void TypeComposition (Type* lhs, const Type* rhs)
436436
}
437437

438438
/* Check for sanity */
439-
CHECK (GetUnqualTypeCode (lhs) == GetUnqualTypeCode (rhs));
439+
CHECK (GetUnderlyingTypeCode (lhs) == GetUnderlyingTypeCode (rhs));
440440

441441
/* Check for special type elements */
442442
if (IsTypeFunc (lhs)) {

0 commit comments

Comments
 (0)