Unified · Split
| @@ -240,8 +240,8 @@ void string_test() · 239 unmodified lines | ||
| 240 | 240 | printf("wc=%C 0x%lx %C\n", L'a', L'\x1234', L'c'); |
| 241 | 241 | printf("wstring=%S\n", L"abc"); |
| 242 | 242 | printf("wstring=%S\n", L"abc" L"def" "ghi"); |
| 243 | − printf("'\\377'=%d '\xff'=%d\n", '\377', '\xff'); | |
| 244 | − printf("L'\\377'=%d L'\xff'=%d\n", L'\377', L'\xff'); | |
| 243 | + printf("'\\377'=%d '\\xff'=%d\n", '\377', '\xff'); | |
| 244 | + printf("L'\\377'=%d L'\\xff'=%d\n", L'\377', L'\xff'); | |
| 245 | 245 | ps("test\n"); |
| 246 | 246 | b = 32; |
| 247 | 247 | while ((b = b + 1) < 96) { |
| @@ -703,7 +703,7 @@ typedef struct Sym { · 455 unmodified lines | ||
| 703 | 703 | |
| 704 | 704 | void bool_test() |
| 705 | 705 | { |
| 706 | − int *s, a, b; | |
| 706 | + int *s, a, b, t, f; | |
| 707 | 707 | |
| 708 | 708 | a = 0; |
| 709 | 709 | s = (void*)0; |
| @@ -738,6 +738,25 @@ void bool_test() · 28 unmodified lines | ||
| 738 | 738 | a = (a + b) * ((a < b) ? |
| 739 | 739 | ((b - a) * (a - b)): a + b); |
| 740 | 740 | printf("a=%d\n", a); |
| 741 | + | |
| 742 | + /* test complex || or && expressions */ | |
| 743 | + t = 1; | |
| 744 | + f = 0; | |
| 745 | + a = 32; | |
| 746 | + printf("exp=%d\n", f == (32 <= a && a <= 3)); | |
| 747 | + printf("r=%d\n", (t || f) + (t && f)); | |
| 748 | + | |
| 749 | + /* test ? : cast */ | |
| 750 | + { | |
| 751 | + int aspect_on; | |
| 752 | + int aspect_native = 65536; | |
| 753 | + double bfu_aspect = 1.0; | |
| 754 | + int aspect; | |
| 755 | + for(aspect_on = 0; aspect_on < 2; aspect_on++) { | |
| 756 | + aspect=aspect_on?(aspect_native*bfu_aspect+0.5):65535UL; | |
| 757 | + printf("aspect=%d\n", aspect); | |
| 758 | + } | |
| 759 | + } | |
| 741 | 760 | } |
| 742 | 761 | |
| 743 | 762 | |