summaryrefslogtreecommitdiff
path: root/lib/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compile.c')
-rw-r--r--lib/compile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/compile.c b/lib/compile.c
index e92a2f6..b0cd818 100644
--- a/lib/compile.c
+++ b/lib/compile.c
@@ -399,6 +399,7 @@ static void pushValues(compilecontext* ctx, bool forward, ...)
{
va_list ap;
size_t len;
+ int temp;
#define VAL_BUF 20
byte buff[VAL_BUF];
@@ -416,10 +417,12 @@ static void pushValues(compilecontext* ctx, bool forward, ...)
switch(len)
{
case 1:
- buff[cur] = va_arg(ap, byte);
+ temp = va_arg(ap, unsigned int);
+ buff[cur] = (byte)temp;
break;
case 2:
- *((unsigned short*)(buff + cur)) = va_arg(ap, unsigned short);
+ temp = va_arg(ap, unsigned int);
+ *((unsigned short*)(buff + cur)) = (unsigned short)temp;
break;
case 4:
*((unsigned int*)(buff + cur)) = va_arg(ap, unsigned int);