1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00

Fixed getting the basic raw type names.

This commit is contained in:
acqn 2020-08-13 08:24:40 +08:00 committed by Oliver Schmidt
parent 11cd3e5cbd
commit 15f28c3a8c
2 changed files with 23 additions and 3 deletions

View File

@ -235,7 +235,7 @@ const char* GetBasicTypeName (const Type* T)
default: break;
}
if (IsClassInt (T)) {
if (IsSignSigned (T)) {
if (IsRawSignSigned (T)) {
switch (GetRawType (T)) {
case T_TYPE_CHAR: return "signed char";
case T_TYPE_SHORT: return "short";
@ -245,7 +245,7 @@ const char* GetBasicTypeName (const Type* T)
default:
return "signed integer";
}
} else if (IsSignUnsigned (T)) {
} else if (IsRawSignUnsigned (T)) {
switch (GetRawType (T)) {
case T_TYPE_CHAR: return "unsigned char";
case T_TYPE_SHORT: return "unsigned short";

View File

@ -652,6 +652,16 @@ INLINE TypeCode GetSignedness (const Type* T)
# define GetSignedness(T) (GetUnderlyingTypeCode (T) & T_MASK_SIGN)
#endif
#if defined(HAVE_INLINE)
INLINE int IsRawSignUnsigned (const Type* T)
/* Return true if this is an unsigned raw type */
{
return (GetRawSignedness (T) == T_SIGN_UNSIGNED);
}
#else
# define IsRawSignUnsigned(T) (GetRawSignedness (T) == T_SIGN_UNSIGNED)
#endif
#if defined(HAVE_INLINE)
INLINE int IsSignUnsigned (const Type* T)
/* Return true if this is an unsigned type */
@ -662,6 +672,16 @@ INLINE int IsSignUnsigned (const Type* T)
# define IsSignUnsigned(T) (GetSignedness (T) == T_SIGN_UNSIGNED)
#endif
#if defined(HAVE_INLINE)
INLINE int IsRawSignSigned (const Type* T)
/* Return true if this is a signed raw type */
{
return (GetRawSignedness (T) == T_SIGN_SIGNED);
}
#else
# define IsRawSignSigned(T) (GetRawSignedness (T) == T_SIGN_SIGNED)
#endif
#if defined(HAVE_INLINE)
INLINE int IsSignSigned (const Type* T)
/* Return true if this is a signed type */
@ -673,7 +693,7 @@ INLINE int IsSignSigned (const Type* T)
#endif
#if defined(HAVE_INLINE)
INLINE TypeCode GetRawSizeModifier(const Type* T)
INLINE TypeCode GetRawSizeModifier (const Type* T)
/* Get the size modifier of a raw type */
{
return (T->C & T_MASK_SIZE);