aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-01-13 23:31:02 +0100
committerThomas Preud'homme <robotux@celest.fr>2013-01-13 23:38:33 +0100
commitea583f7b8a0a55441fdd8923c66e3f4545ab864f (patch)
treea1495cbfbbfd6de41c03ed6c3001391ca7c56b33
parent59e18aee0e509a3ca75dbe6f909e18c1d17893d1 (diff)
downloadtinycc-ea583f7b8a0a55441fdd8923c66e3f4545ab864f.tar.gz
tinycc-ea583f7b8a0a55441fdd8923c66e3f4545ab864f.tar.bz2
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.
-rw-r--r--tccgen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tccgen.c b/tccgen.c
index 71555cd..e058811 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -458,6 +458,7 @@ static void vseti(int r, int v)
ST_FUNC void vswap(void)
{
+ unsigned long *vtopl;
/* cannot let cpu flags if other instruction are generated. Also
avoid leaving VT_JMP anywhere except on the top of the stack
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
* profile, so it is hand optimized
*/
- unsigned long *vtopl = (unsigned long *)vtop;
+ vtopl = (unsigned long *) vtop;
# define VSIZEL (sizeof(*vtop) / sizeof(*vtopl))
_STATIC_ASSERT( VSIZEL*sizeof(*vtopl) == sizeof(*vtop) );