History

Fix C99ism in vswap()

Declare vtopl in vswap at the beginning of the function before any assignments. Doing otherwise means C99 is assumed when compiling.

Thomas Preud'homme committed 13 years ago

Commit ea583f71 parent 59e18ae1 file · +2 −1Browse files

Unified · Split

tccgen.c+2−1
@@ -458,6 +458,7 @@ static void vseti(int r, int v) · 457 unmodified lines
458 458
459ST_FUNC void vswap(void)459ST_FUNC void vswap(void)
460{460{
461 unsigned long *vtopl;
461 /* cannot let cpu flags if other instruction are generated. Also462 /* cannot let cpu flags if other instruction are generated. Also
462 avoid leaving VT_JMP anywhere except on the top of the stack463 avoid leaving VT_JMP anywhere except on the top of the stack
463 because it would complicate the code generator. */464 because it would complicate the code generator. */
@@ -473,7 +474,7 @@ ST_FUNC void vswap(void) · 9 unmodified lines
473 * vswap is called often and exchanging vtop[0] vs vtop[-1] is hot on474 * vswap is called often and exchanging vtop[0] vs vtop[-1] is hot on
474 * profile, so it is hand optimized475 * profile, so it is hand optimized
475 */476 */
476 unsigned long *vtopl = (unsigned long *)vtop;477 vtopl = (unsigned long *) vtop;
477# define VSIZEL (sizeof(*vtop) / sizeof(*vtopl))478# define VSIZEL (sizeof(*vtop) / sizeof(*vtopl))
478 479
479 _STATIC_ASSERT( VSIZEL*sizeof(*vtopl) == sizeof(*vtop) );480 _STATIC_ASSERT( VSIZEL*sizeof(*vtopl) == sizeof(*vtop) );

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