History

tccgen.c: Improvements to type_to_str (only used for error messages).

1. Handle array types. 2. Print the type qualifiers of pointers.

Edmund Grimley Evans committed 10 years ago

Commit 58a34d21 parent ba99a701 file · +9 −0Browse files

Unified · Split

tccgen.c+9−0
@@ -2427,7 +2427,16 @@ static void type_to_str(char *buf, int buf_size, · 2426 unmodified lines
24272427 goto no_var;
24282428 case VT_PTR:
24292429 s = type->ref;
2430+ if (t & VT_ARRAY) {
2431+ snprintf(buf1, sizeof(buf1), "%s[%ld]", varstr ? varstr : "", s->c);
2432+ type_to_str(buf, buf_size, &s->type, buf1);
2433+ goto no_var;
2434+ }
24302435 pstrcpy(buf1, sizeof(buf1), "*");
2436+ if (t & VT_CONSTANT)
2437+ pstrcat(buf1, buf_size, "const ");
2438+ if (t & VT_VOLATILE)
2439+ pstrcat(buf1, buf_size, "volatile ");
24312440 if (varstr)
24322441 pstrcat(buf1, sizeof(buf1), varstr);
24332442 type_to_str(buf, buf_size, &s->type, buf1);

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