Removed two duplicate TYPEDEFs from a header.

The first one is replaced by an #include of the header that has its original TYPEDEF.
The second one is replaced by its base type.

That change allows pedantic C90-compliant compilers to accept the header.
This commit is contained in:
Greg King
2021-05-13 00:24:32 -04:00
parent af4c4f6aaf
commit e5813cfb1a
3 changed files with 14 additions and 16 deletions

View File

@@ -1447,7 +1447,7 @@ void AdjustEntryIndices (Collection* Indices, int Index, int Change)
} else if (Index <= *IndexPtr) { } else if (Index <= *IndexPtr) {
/* Has been removed */ /* Has been removed */
*IndexPtr = -1; *IndexPtr = -1;
//CollDelete (Indices, I); /*CollDelete (Indices, I);*/
--I; --I;
} }
} }

View File

@@ -1242,7 +1242,7 @@ const Type* GetBaseElementType (const Type* T)
SymEntry* GetESUSymEntry (const Type* T) struct SymEntry* GetESUSymEntry (const Type* T)
/* Return a SymEntry pointer from an enum/struct/union type */ /* Return a SymEntry pointer from an enum/struct/union type */
{ {
/* Only enums, structs or unions have a SymEntry attribute */ /* Only enums, structs or unions have a SymEntry attribute */
@@ -1254,7 +1254,7 @@ SymEntry* GetESUSymEntry (const Type* T)
void SetESUSymEntry (Type* T, SymEntry* S) void SetESUSymEntry (Type* T, struct SymEntry* S)
/* Set the SymEntry pointer for an enum/struct/union type */ /* Set the SymEntry pointer for an enum/struct/union type */
{ {
/* Only enums, structs or unions have a SymEntry attribute */ /* Only enums, structs or unions have a SymEntry attribute */

View File

@@ -45,6 +45,9 @@
#include "inline.h" #include "inline.h"
#include "mmodel.h" #include "mmodel.h"
/* cc65 */
#include "funcdesc.h"
/*****************************************************************************/ /*****************************************************************************/
@@ -53,8 +56,8 @@
typedef struct FuncDesc FuncDesc; struct StrBuf;
typedef struct SymEntry SymEntry; struct SymEntry;
@@ -162,12 +165,12 @@ typedef unsigned long TypeCode;
/* Type entry */ /* Type entry */
typedef struct Type Type; typedef struct Type Type;
struct Type { struct Type {
TypeCode C; /* Code for this entry */ TypeCode C; /* Code for this entry */
union { union {
FuncDesc* F; /* Function description pointer */ struct FuncDesc* F; /* Function description pointer */
SymEntry* S; /* Enum/struct/union tag symbol entry pointer */ struct SymEntry* S; /* Enum/struct/union tag symbol entry pointer */
long L; /* Numeric attribute value */ long L; /* Numeric attribute value */
unsigned long U; /* Dito, unsigned */ unsigned long U; /* Dito, unsigned */
} A; /* Type attribute if necessary */ } A; /* Type attribute if necessary */
}; };
@@ -221,11 +224,6 @@ extern const Type type_c_char_p[];
extern const Type type_void_p[]; extern const Type type_void_p[];
extern const Type type_c_void_p[]; extern const Type type_c_void_p[];
/* Forward for the SymEntry struct */
struct SymEntry;
/* Forward for the StrBuf struct */
struct StrBuf;
/*****************************************************************************/ /*****************************************************************************/
@@ -849,7 +847,7 @@ int IsVariadicFunc (const Type* T) attribute ((const));
*/ */
int IsFastcallFunc (const Type* T) attribute ((const)); int IsFastcallFunc (const Type* T) attribute ((const));
/* Return true if this is a function type or pointer to function type by /* Return true if this is a function type or pointer to function type with
** __fastcall__ calling convention. ** __fastcall__ calling convention.
** Check fails if the type is not a function or a pointer to function. ** Check fails if the type is not a function or a pointer to function.
*/ */