]> Shamusworld >> Repos - rmac/blobdiff - macro.c
Added floating point support to expression evaluator, introduced FLOAT token, fixup...
[rmac] / macro.c
diff --git a/macro.c b/macro.c
index 38dfecd80ae7fb573144d759c2cfdbebb8c2300a..54d34c43687b3cae932b9c7b5387e55b36a9ce99 100644 (file)
--- a/macro.c
+++ b/macro.c
@@ -22,7 +22,7 @@ int macnum;                                   // Unique number for macro definition
 
 static LONG macuniq;           // Unique-per-macro number
 static SYM * curmac;           // Macro currently being defined
-static VALUE argno;                    // Formal argument count
+static uint32_t argno;                 // Formal argument count
 
 static LLIST * firstrpt;       // First .rept line
 static LLIST * nextrpt;                // Last .rept line
@@ -244,7 +244,7 @@ WARNING("!!! Casting (char *) as LONG !!!")
 //
 int HandleRept(void)
 {
-       VALUE eval;
+       uint64_t eval;
 
        // Evaluate repeat expression
        if (abs_expr(&eval) != OK)
@@ -264,7 +264,7 @@ int HandleRept(void)
                IREPT * irept = inobj->inobj.irept;
                irept->ir_firstln = firstrpt;
                irept->ir_nextln = NULL;
-               irept->ir_count = eval;
+               irept->ir_count = (uint32_t)eval;
        }
 
        return 0;
@@ -410,10 +410,14 @@ int InvokeMacro(SYM * mac, WORD siz)
                                for(int i=0; i<3; i++)
                                        *p++ = *tok++;
                        }
-                       else if (*tok == CONST)
+                       else if (*tok == CONST)         // Constants are 64-bits
                        {
-                               *p++ = *tok++;
-                               *p++ = *tok++;
+                               *p++ = *tok++;                  // Token
+                               uint64_t *p64 = (uint64_t *)p;
+                               uint64_t *tok64 = (uint64_t *)tok;
+                               *p64++ = *tok64++;
+                               tok = (TOKEN *)tok64;
+                               p = (uint32_t *)p64;
                        }
                        else if ((*tok == STRING) || (*tok == SYMBOL))
                        {