mirror of
https://github.com/mirror/tinycc.git
synced 2025-03-12 09:00:09 +08:00
Extend type_to_str
to also print storage-class specifiers.
This commit is contained in:
parent
182367e232
commit
328b06a3fc
12
tccgen.c
12
tccgen.c
@ -2678,7 +2678,7 @@ static void type_to_str(char *buf, int buf_size,
|
|||||||
char buf1[256];
|
char buf1[256];
|
||||||
const char *tstr;
|
const char *tstr;
|
||||||
|
|
||||||
t = type->t & VT_TYPE;
|
t = type->t;
|
||||||
bt = t & VT_BTYPE;
|
bt = t & VT_BTYPE;
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
if (t & VT_CONSTANT)
|
if (t & VT_CONSTANT)
|
||||||
@ -2689,6 +2689,16 @@ static void type_to_str(char *buf, int buf_size,
|
|||||||
pstrcat(buf, buf_size, "unsigned ");
|
pstrcat(buf, buf_size, "unsigned ");
|
||||||
else if (t & VT_DEFSIGN)
|
else if (t & VT_DEFSIGN)
|
||||||
pstrcat(buf, buf_size, "signed ");
|
pstrcat(buf, buf_size, "signed ");
|
||||||
|
if (t & VT_EXTERN)
|
||||||
|
pstrcat(buf, buf_size, "extern ");
|
||||||
|
if (t & VT_STATIC)
|
||||||
|
pstrcat(buf, buf_size, "static ");
|
||||||
|
if (t & VT_TYPEDEF)
|
||||||
|
pstrcat(buf, buf_size, "typedef ");
|
||||||
|
if (t & VT_INLINE)
|
||||||
|
pstrcat(buf, buf_size, "inline ");
|
||||||
|
buf_size -= strlen(buf);
|
||||||
|
buf += strlen(buf);
|
||||||
switch(bt) {
|
switch(bt) {
|
||||||
case VT_VOID:
|
case VT_VOID:
|
||||||
tstr = "void";
|
tstr = "void";
|
||||||
|
Loading…
Reference in New Issue
Block a user