History

Rewrote '?' for constants

The condition is now cast to _Bool and it now works with return types bigger than 32 bit.

Daniel Glöckner committed 17 years ago

Commit deb41071 parent 1b599ea1 file · +10 −7Browse files

Unified · Split

tcc.c+10−7
@@ -7980,23 +7980,26 @@ static void expr_eq(void) · 7979 unmodified lines
7980 CType type, type1, type2;7980 CType type, type1, type2;
7981 7981
7982 if (const_wanted) {7982 if (const_wanted) {
7983 int c1, c;
7984 expr_lor_const();7983 expr_lor_const();
7985 if (tok == '?') {7984 if (tok == '?') {
7985 CType boolean;
7986 int c;
7987 boolean.t = VT_BOOL;
7988 vdup();
7989 gen_cast(&boolean);
7986 c = vtop->c.i;7990 c = vtop->c.i;
7987 vpop();7991 vpop();
7988 next();7992 next();
7989 if (tok == ':' && gnu_ext) {7993 if (tok != ':' || !gnu_ext) {
7990 c1 = c;
7991 } else {
7992 gexpr();
7993 c1 = vtop->c.i;
7994 vpop();7994 vpop();
7995 gexpr();
7995 }7996 }
7997 if (!c)
7998 vpop();
7996 skip(':');7999 skip(':');
7997 expr_eq();8000 expr_eq();
7998 if (c)8001 if (c)
7999 vtop->c.i = c1;8002 vpop();
8000 }8003 }
8001 } else {8004 } else {
8002 expr_lor();8005 expr_lor();

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