diff options
| author | 2025-12-11 20:28:26 +0100 | |
|---|---|---|
| committer | 2025-12-11 20:28:26 +0100 | |
| commit | 8f14da7ea9032f31cb35e43ac7159274c10dc541 (patch) | |
| tree | 92a3760c562544eeb068050e548d88b532a168f4 /type.h | |
| parent | 31f6b60f650a72d7727d386cef160f4baae70f38 (diff) | |
c: accept C99 `[static N]` style array decls, changes to fn quals
Function parameters qualifiers don't matter outside of function
definition. `int (const int)` should be compatible with `int(int)` etc.
So no need to store them in the typedata.
Diffstat (limited to 'type.h')
| -rw-r--r-- | type.h | 29 |
1 files changed, 2 insertions, 27 deletions
@@ -87,19 +87,8 @@ struct typedata { ushort id; union { union type child; - struct { /* functions */ - const uchar *quals; /* packed N x 2bit array (NULL if no param has quals) */ - const union type *param; - }; + const union type *param; /* functions */ struct { /* aggregates */ - /* struct fieldmap { - union { - struct field *fs; - int *is; - }; - const char **k; - uint ; - } *fmap; */ struct namedfield *fld; }; struct { /* enum */ @@ -131,26 +120,12 @@ struct typedata { extern struct typedata typedata[]; extern const char *ttypenames[/*id*/]; -#define tdqualsiz(nmemb) ((nmemb)/4 + ((nmemb)%4 != 0)) -static inline int -tdgetqual(const uchar *pqual, uint idx) -{ - return pqual ? pqual[idx/4] >> 2*(idx%4) & 3 : 0; -} -static inline void -tdsetqual(uchar *pqual, uint idx, int qual) -{ - assert(pqual); - pqual[idx/4] &= ~(3 << (2*(idx%4))); - pqual[idx/4] |= (qual&3) << (2*(idx%4)); -} - bool isincomplete(union type); uint typesize(union type); uint typealign(union type); union type mkptrtype(union type, int qual); union type mkarrtype(union type t, int qual, uint n); -union type mkfntype(union type ret, uint n, const union type *, const uchar *qual, bool kandr, bool variadic); +union type mkfntype(union type ret, uint n, const union type *, bool kandr, bool variadic); union type mktagtype(const char *name, struct typedata *td); bool getfield(struct fielddata *res, union type, const char *); union type completetype(const char *name, int id, struct typedata *td); |