forked from Mirrors/tinycc
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.master
parent
59e18aee0e
commit
ea583f7b8a
3
tccgen.c
3
tccgen.c
|
@ -458,6 +458,7 @@ static void vseti(int r, int v)
|
||||||
|
|
||||||
ST_FUNC void vswap(void)
|
ST_FUNC void vswap(void)
|
||||||
{
|
{
|
||||||
|
unsigned long *vtopl;
|
||||||
/* cannot let cpu flags if other instruction are generated. Also
|
/* cannot let cpu flags if other instruction are generated. Also
|
||||||
avoid leaving VT_JMP anywhere except on the top of the stack
|
avoid leaving VT_JMP anywhere except on the top of the stack
|
||||||
because it would complicate the code generator. */
|
because it would complicate the code generator. */
|
||||||
|
@ -473,7 +474,7 @@ ST_FUNC void vswap(void)
|
||||||
* vswap is called often and exchanging vtop[0] vs vtop[-1] is hot on
|
* vswap is called often and exchanging vtop[0] vs vtop[-1] is hot on
|
||||||
* profile, so it is hand optimized
|
* profile, so it is hand optimized
|
||||||
*/
|
*/
|
||||||
unsigned long *vtopl = (unsigned long *)vtop;
|
vtopl = (unsigned long *) vtop;
|
||||||
# define VSIZEL (sizeof(*vtop) / sizeof(*vtopl))
|
# define VSIZEL (sizeof(*vtop) / sizeof(*vtopl))
|
||||||
|
|
||||||
_STATIC_ASSERT( VSIZEL*sizeof(*vtopl) == sizeof(*vtop) );
|
_STATIC_ASSERT( VSIZEL*sizeof(*vtopl) == sizeof(*vtop) );
|
||||||
|
|
Loading…
Reference in New Issue