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
2427 goto no_var;2427 goto no_var;
2428 case VT_PTR:2428 case VT_PTR:
2429 s = type->ref;2429 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 }
2430 pstrcpy(buf1, sizeof(buf1), "*");2435 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 ");
2431 if (varstr)2440 if (varstr)
2432 pstrcat(buf1, sizeof(buf1), varstr);2441 pstrcat(buf1, sizeof(buf1), varstr);
2433 type_to_str(buf, buf_size, &s->type, buf1);2442 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