History

Extend type_to_str

to also print storage-class specifiers.

Michael Matz committed 9 years ago

Commit 328b06a1 parent 182367e1 file · +11 −1Browse files

Unified · Split

tccgen.c+11−1
@@ -2678,7 +2678,7 @@ static void type_to_str(char *buf, int buf_size, · 2677 unmodified lines
26782678 char buf1[256];
26792679 const char *tstr;
26802680
2681− t = type->t & VT_TYPE;
2681+ t = type->t;
26822682 bt = t & VT_BTYPE;
26832683 buf[0] = '\0';
26842684 if (t & VT_CONSTANT)
@@ -2689,6 +2689,16 @@ static void type_to_str(char *buf, int buf_size, · 4 unmodified lines
26892689 pstrcat(buf, buf_size, "unsigned ");
26902690 else if (t & VT_DEFSIGN)
26912691 pstrcat(buf, buf_size, "signed ");
2692+ if (t & VT_EXTERN)
2693+ pstrcat(buf, buf_size, "extern ");
2694+ if (t & VT_STATIC)
2695+ pstrcat(buf, buf_size, "static ");
2696+ if (t & VT_TYPEDEF)
2697+ pstrcat(buf, buf_size, "typedef ");
2698+ if (t & VT_INLINE)
2699+ pstrcat(buf, buf_size, "inline ");
2700+ buf_size -= strlen(buf);
2701+ buf += strlen(buf);
26922702 switch(bt) {
26932703 case VT_VOID:
26942704 tstr = "void";

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t