]> Shamusworld >> Repos - rmac/blobdiff - macro.c
Fixed subtle bug in expr().
[rmac] / macro.c
diff --git a/macro.c b/macro.c
index 3f3e81b82fe185d51606ee620711a57e224ab0ae..6e9fd864af4eb370c0ba8f03b00ee4b774d7becf 100644 (file)
--- a/macro.c
+++ b/macro.c
@@ -17,8 +17,6 @@
 #include "token.h"
 
 
-//static void SetupDefaultMacros(void);
-
 LONG curuniq;                                                          // Current macro's unique number
 //TOKEN ** argp;                                                               // Free spot in argptrs[]
 int macnum;                                                                    // Unique number for macro definition
@@ -44,7 +42,6 @@ void InitMacro(void)
        macnum = 1;
 //     argp = NULL;
        argp = 0;
-//     SetupDefaultMacros();
 }
 
 
@@ -84,7 +81,6 @@ of another (nested macros). Need to fix that somehow.
        DEBUG printf("%d (nargs = %d)\n", argp, imacro->im_nargs);
 
        fpop();
-//     mjump_align = 0;
        return 0;
 }
 
@@ -337,7 +333,7 @@ int lncatch(int (* lnfunc)(), char * dirlist)
 
        for(;;)
        {
-               if (tokln() == TKEOF)
+               if (TokenizeLine() == TKEOF)
                {
                        errors("encountered end-of-file looking for '%s'", dirlist);
                        fatal("cannot continue");
@@ -354,19 +350,11 @@ int lncatch(int (* lnfunc)(), char * dirlist)
                        if ((tok[2] == ':' || tok[2] == DCOLON))
                        {
                                if (tok[3] == SYMBOL)                   // label: symbol
-#if 0
-                                       p = (char *)tok[4];
-#else
                                        p = string[tok[4]];
-#endif
                        }
                        else
                        {
-#if 0
-                               p = (char *)tok[1];                             // symbol 
-#else
                                p = string[tok[1]];                             // Symbol
-#endif
                        }
                }
 
@@ -451,14 +439,6 @@ int InvokeMacro(SYM * mac, WORD siz)
 //     argp = 0;
        DEBUG printf("InvokeMacro: argp: %d -> ", argp);
 
-#if 0
-       if ((!strcmp(mac->sname, "mjump") || !strcmp(mac->sname, "mpad")) && !in_main)
-       {
-               error("macro cannot be used outside of .gpumain");
-               return ERROR;
-       }
-#endif
-
        INOBJ * inobj = a_inobj(SRC_IMACRO);            // Alloc and init IMACRO 
        IMACRO * imacro = inobj->inobj.imacro;
        imacro->im_siz = siz;
@@ -625,49 +605,3 @@ alleviate this problem.]
        return OK;
 }
 
-
-#if 0
-//
-// Setup inbuilt macros (SubQMod)
-//
-static void SetupDefaultMacros(void)
-{
-       curmac = NewSymbol("mjump", MACRO, 0);
-       curmac->svalue = 0;
-       curmac->sattr = (WORD)(macnum++);
-       argno = 0;
-       defmac2("cc");
-       defmac2("addr");
-       defmac2("jreg");
-//     curmln = NULL;
-       curmac->lineList = NULL;
-       defmac1("  nop", -1);
-       defmac1("  movei #\\addr,\\jreg", -1);
-       defmac1("  jump  \\cc,(\\jreg)", -1);
-       defmac1("  nop", -1);
-       defmac1("  nop", -1);
-
-       curmac = NewSymbol("mjr", MACRO, 0);
-       curmac->svalue = 0;
-       curmac->sattr = (WORD)(macnum++);
-       argno = 0;
-       defmac2("cc");
-       defmac2("addr");
-//     curmln = NULL;
-       curmac->lineList = NULL;
-       defmac1("  jr    \\cc,\\addr", -1);
-       defmac1("  nop", -1);
-       defmac1("  nop", -1);
-
-       curmac = NewSymbol("mpad", MACRO, 0);
-       curmac->svalue = 0;
-       curmac->sattr = (WORD)(macnum++);
-       argno = 0;
-       defmac2("size");
-//     curmln = NULL;
-       curmac->lineList = NULL;
-       defmac1("  .rept (\\size/2)", -1);
-       defmac1("     nop", -1);
-       defmac1("  .endr", -1);
-}
-#endif