History

Cast parameter of '!' to _Bool

Daniel Glöckner committed 17 years ago

Commit 1b599ea1 parent 2d9b5e01 file · +5 −2Browse files

Unified · Split

tcc.c+5−2
@@ -7516,9 +7516,12 @@ static void unary(void) · 7515 unmodified lines
75167516 case '!':
75177517 next();
75187518 unary();
7519− if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST)
7519+ if ((vtop->r & (VT_VALMASK | VT_LVAL | VT_SYM)) == VT_CONST) {
7520+ CType boolean;
7521+ boolean.t = VT_BOOL;
7522+ gen_cast(&boolean);
75207523 vtop->c.i = !vtop->c.i;
7521− else if ((vtop->r & VT_VALMASK) == VT_CMP)
7524+ } else if ((vtop->r & VT_VALMASK) == VT_CMP)
75227525 vtop->c.i = vtop->c.i ^ 1;
75237526 else {
75247527 save_regs(1);

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