Skip to content

Commit e934fa2

Browse files
committed
drop the Generic typedef
1 parent f773771 commit e934fa2

44 files changed

Lines changed: 156 additions & 168 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmake/schema_scanner/schemaScanner.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ void printSchemaFilenames( Schema sch ){
244244
int ecount = 0, tcount = 0;
245245

246246
DictionaryEntry de;
247-
Generic x;
247+
void *x;
248248
filenames_t fn;
249249
DICTdo_init( sch->symbol_table, &de );
250250
while( 0 != ( x = DICTdo( &de ) ) ) {

include/express/alg.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ extern SC_EXPRESS_EXPORT struct freelist_head WHERE_fl;
120120
/******************************/
121121

122122
#define ALG_new() (struct Algorithm *)MEM_new(&ALG_fl);
123-
#define ALG_destroy(x) MEM_destroy(&ALG_fl,(Freelist *)(Generic)x)
123+
#define ALG_destroy(x) MEM_destroy(&ALG_fl,(Freelist *)x)
124124
#define FUNC_new() (struct Function_ *)MEM_new(&FUNC_fl)
125-
#define FUNC_destroy(x) MEM_destroy(&FUNC_fl,(Freelist *)(Generic)x)
125+
#define FUNC_destroy(x) MEM_destroy(&FUNC_fl,(Freelist *)x)
126126
#define RULE_new() (struct Rule_ *)MEM_new(&RULE_fl)
127-
#define RULE_destroy(x) MEM_destroy(&RULE_fl,(Freelist *)(Generic)x)
127+
#define RULE_destroy(x) MEM_destroy(&RULE_fl,(Freelist *)x)
128128
#define PROC_new() (struct Procedure_ *)MEM_new(&PROC_fl)
129-
#define PROC_destroy(x) MEM_destroy(&PROC_fl,(Freelist *)(Generic)x)
129+
#define PROC_destroy(x) MEM_destroy(&PROC_fl,(Freelist *)x)
130130
#define WHERE_new() (struct Where_ *)MEM_new(&WHERE_fl)
131-
#define WHERE_destroy(x) MEM_destroy(&WHERE_fl,(Freelist *)(Generic)x)
131+
#define WHERE_destroy(x) MEM_destroy(&WHERE_fl,(Freelist *)x)
132132

133133
#define ALGput_name(algorithm, name) SCOPEput_name(algorithm,name)
134134
#define ALGget_name(algorithm) SCOPEget_name(algorithm)

include/express/basic.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,6 @@
8585
# include <sc_stdbool.h>
8686
#endif
8787

88-
/************************/
89-
/* Generic pointer type */
90-
/************************/
91-
92-
#ifdef __STDC__
93-
typedef void * Generic;
94-
#else
95-
typedef char * Generic;
96-
#endif /* */
97-
9888

9989
/**************************/
10090
/* function pointer types */

include/express/caseitem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extern SC_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
8484
/***********************/
8585

8686
#define CASE_IT_new() (struct Case_Item_ *)MEM_new(&CASE_IT_fl)
87-
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)(Generic)x)
87+
#define CASE_IT_destroy(x) MEM_destroy(&CASE_IT_fl,(Freelist *)x)
8888

8989
extern SC_EXPRESS_EXPORT Case_Item CASE_ITcreate( Linked_List, struct Statement_ * );
9090
extern SC_EXPRESS_EXPORT void CASE_ITinitialize( void );

include/express/dict.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ extern SC_EXPRESS_EXPORT char DICT_type; /**< set as a side-effect of DICT look
9999

100100
extern SC_EXPRESS_EXPORT void DICTinitialize( void );
101101
extern SC_EXPRESS_EXPORT void DICTcleanup( void );
102-
extern SC_EXPRESS_EXPORT int DICTdefine( Dictionary, char *, Generic, Symbol *, char );
103-
extern SC_EXPRESS_EXPORT int DICT_define( Dictionary, char *, Generic, Symbol *, char );
102+
extern SC_EXPRESS_EXPORT int DICTdefine( Dictionary, char *, void *, Symbol *, char );
103+
extern SC_EXPRESS_EXPORT int DICT_define( Dictionary, char *, void *, Symbol *, char );
104104
extern SC_EXPRESS_EXPORT void DICTundefine( Dictionary, char * );
105-
extern SC_EXPRESS_EXPORT Generic DICTlookup( Dictionary, char * );
106-
extern SC_EXPRESS_EXPORT Generic DICTlookup_symbol( Dictionary, char *, Symbol ** );
107-
extern SC_EXPRESS_EXPORT Generic DICTdo( DictionaryEntry * );
105+
extern SC_EXPRESS_EXPORT void * DICTlookup( Dictionary, char * );
106+
extern SC_EXPRESS_EXPORT void * DICTlookup_symbol( Dictionary, char *, Symbol ** );
107+
extern SC_EXPRESS_EXPORT void * DICTdo( DictionaryEntry * );
108108
extern SC_EXPRESS_EXPORT void DICTprint( Dictionary );
109109

110110
#endif /*DICTIONARY_H*/

include/express/entity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ extern SC_EXPRESS_EXPORT bool ENTITYhas_immediate_supertype( Entity, Entity
151151
extern SC_EXPRESS_EXPORT Variable ENTITYget_named_attribute( Entity, char * );
152152
extern SC_EXPRESS_EXPORT Linked_List ENTITYget_all_attributes( Entity );
153153
extern SC_EXPRESS_EXPORT bool ENTITYhas_supertype( Entity, Entity );
154-
extern SC_EXPRESS_EXPORT void ENTITYadd_instance( Entity, Generic );
154+
extern SC_EXPRESS_EXPORT void ENTITYadd_instance( Entity, void *);
155155
extern SC_EXPRESS_EXPORT int ENTITYget_initial_offset( Entity );
156156
extern SC_EXPRESS_EXPORT int ENTITYdeclares_variable( Entity, struct Variable_ * );
157157

include/express/error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ extern SC_EXPRESS_EXPORT void ( *ERRORusage_function )( void );
111111
/******************************/
112112

113113
#define ERROR_OPT_new() (struct Error_Warning_ *)MEM_new(&ERROR_OPT_fl)
114-
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)(Generic)x)
114+
#define ERROR_OPT_destroy(x) MEM_destroy(&ERROR_OPT_fl,(Freelist *)x)
115115

116116
/***********************/
117117
/* function prototypes */

include/express/expbasic.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ typedef enum { Lfalse, Lunknown, Ltrue } Logical;
4646
/* typedef ... Binary; done below because String not defined yet */
4747

4848
#ifndef _CLIENTDATA
49-
# ifdef __STDC__
5049
typedef void * ClientData;
51-
# else
52-
typedef int * ClientData;
53-
# endif /* __STDC__ */
5450
#define _CLIENTDATA
5551
#endif
5652

include/express/expr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ extern SC_EXPRESS_EXPORT struct freelist_head QUAL_ATTR_fl;
208208
/******************************/
209209

210210
#define EXP_new() (struct Expression_ *)MEM_new(&EXP_fl)
211-
#define EXP_destroy(x) MEM_destroy(&EXP_fl,(Freelist *)(Generic)x)
211+
#define EXP_destroy(x) MEM_destroy(&EXP_fl,(Freelist *)x)
212212
#define OP_new() (struct Op_Subexpression *)MEM_new(&OP_fl)
213-
#define OP_destroy(x) MEM_destroy(&OP_fl,(Freelist *)(Generic)x)
213+
#define OP_destroy(x) MEM_destroy(&OP_fl,(Freelist *)x)
214214
#define QUERY_new() (struct Query_ *)MEM_new(&QUERY_fl)
215-
#define QUERY_destroy(x) MEM_destroy(&QUERY_fl,(Freelist *)(Generic)x)
215+
#define QUERY_destroy(x) MEM_destroy(&QUERY_fl,(Freelist *)x)
216216
#define QUAL_ATTR_new() (struct Qualified_Attr *)MEM_new(&QUAL_ATTR_fl)
217-
#define QUAL_ATTR_destroy(x) MEM_destroy(&QUAL_ATTR_fl,(Freelist *)(Generic)x)
217+
#define QUAL_ATTR_destroy(x) MEM_destroy(&QUAL_ATTR_fl,(Freelist *)x)
218218

219219
#define EXPget_name(e) ((e)->symbol.name)
220220
#define ENUMget_name(e) ((e)->symbol.name)

include/express/hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ This change only seems to have affected hash.h and hash.c
184184
#define MOD(x,y) ((x) & ((y)-1))
185185

186186
#define HASH_Table_new() (struct Hash_Table_ *)MEM_new(&HASH_Table_fl)
187-
#define HASH_Table_destroy(x) MEM_destroy(&HASH_Table_fl,(Freelist *)(Generic)x)
187+
#define HASH_Table_destroy(x) MEM_destroy(&HASH_Table_fl,(Freelist *)x)
188188
#define HASH_Element_new() (struct Element_ *)MEM_new(&HASH_Element_fl)
189189
#define HASH_Element_destroy(x) MEM_destroy(&HASH_Element_fl,(Freelist *)(char *)x)
190190

0 commit comments

Comments
 (0)