-Subproject commit b045c0c5e35a1558e6b77d99e0ed8ab86d6dc550
+Subproject commit aaaacebf1f04c364803f308c3b3e9670e216da09
/*
* Generate random C declarations for testing.
- * Copyright © 2012, 2022-2023 Nick Bowler
+ * Copyright © 2012, 2022-2024 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
GEN_NO_FUNCTION = 0x01,
GEN_NO_STORAGE = 0x02,
GEN_NO_VOID = 0x04,
- GEN_ONLY_REGISTER = 0x08,
+ GEN_ONLY_REGISTER = 0x08
};
struct test_rng;
}
END {
- print "static inline struct cdecl_declspec *"
- print "gen_raw_typespec_(unsigned type, struct cdecl_declspec *next)\n{"
- print "\tstruct cdecl_declspec *s = malloc_nofail(sizeof *s);"
- print "\t*s = (struct cdecl_declspec) { .next = next, .type = type };"
+ print "static inline struct cdecl_declspec *";
+ print "gen_raw_typespec_(unsigned type, struct cdecl_declspec *next)\n{";
+ print "\tstruct cdecl_declspec *s = malloc_nofail(sizeof *s);";
+ print "\ts->type = type;";
+ print "\ts->next = next;";
+ print "\ts->ident = 0;";
print "\treturn s;\n}\n"
print "static inline struct cdecl_declspec *"
enum {
MODE_CDECL,
- MODE_ENGLISH,
+ MODE_ENGLISH
};
static void print_usage(FILE *f)
unsigned flags = 0;
decl = malloc_nofail(sizeof *decl);
- *decl = (struct cdecl) { 0 };
+ decl->next = NULL;
decl->declarators = gen_declarators(rng);
if (decl->declarators->type != CDECL_DECL_FUNCTION)