History

switch: fix label sorting

Pavlas, Zdenek committed 10 years ago

Commit da636951 parent c2ad11a2 files · +9 −2Browse files

Unified · Split

2 files
  1. tccgen.c +6 −2
  2. tests/tcctest.c +3 −0
tccgen.c+6−2
@@ -4881,8 +4881,12 @@ static void label_or_decl(int l) · 4880 unmodified lines
4881 decl(l);4881 decl(l);
4882}4882}
4883 4883
4884static int case_cmp(const void *a, const void *b)4884static int case_cmp(const void *pa, const void *pb)
4885{ return (*(struct case_t**) a)->v1 - (*(struct case_t**) b)->v1; }4885{
4886 int a = (*(struct case_t**) pa)->v1;
4887 int b = (*(struct case_t**) pb)->v1;
4888 return a < b ? -1 : a > b;
4889}
4886 4890
4887static void block(int *bsym, int *csym, int is_expr)4891static void block(int *bsym, int *csym, int is_expr)
4888{4892{
tests/tcctest.c+3−0
@@ -1554,6 +1554,9 @@ void switch_test() · 1553 unmodified lines
1554 case 3:1554 case 3:
1555 printf("b");1555 printf("b");
1556 break;1556 break;
1557 case 0xc33c6b9fU:
1558 case 0x7c9eeeb9U:
1559 break;
1557 }1560 }
1558 }1561 }
1559 printf("\n");1562 printf("\n");

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