]> Shamusworld >> Repos - rmac/blobdiff - direct.c
Fixed subtle bug in expr().
[rmac] / direct.c
index 1d77c1c7b441e797b3a022ebf41209e7ea9315bc..7673d29c18eb0089d848148b427b0ef5fd1992f0 100644 (file)
--- a/direct.c
+++ b/direct.c
 #define DEF_KW
 #include "kwtab.h"
 
+
 TOKEN exprbuf[128];                    // Expression buffer 
 SYM * symbolPtr[1000000];      // Symbol pointers table
+static long unused;                    // For supressing 'write' warnings
+
 
 // Directive handler table
 int (*dirtab[])() = {
@@ -80,6 +83,8 @@ int (*dirtab[])() = {
        d_ccundef,                      // 51 .ccundef
        d_print,                        // 52 .print
        d_cstruct,                      // 53 .cstruct
+       d_jpad,                         // 54 .jpad (deprecated)
+       d_nojpad,                       // 55 .nojpad (deprecated)
 };
 
 
@@ -134,7 +139,7 @@ int d_print(void)
                        printf("%s", prntstr);
 
                        if (list_fd) 
-                               write(list_fd, prntstr, (LONG)strlen(prntstr));
+                               unused = write(list_fd, prntstr, (LONG)strlen(prntstr));
 
                        tok += 2;
                        break;
@@ -184,7 +189,7 @@ int d_print(void)
                                printf("%s", prntstr);
 
                                if (list_fd) 
-                                       write(list_fd, prntstr, (LONG)strlen(prntstr));
+                                       unused = write(list_fd, prntstr, (LONG)strlen(prntstr));
 
                                formatting = 0;
                                wordlong = 0;
@@ -222,7 +227,8 @@ int d_ccundef(void)
 
        if (*tok != SYMBOL)
        {
-               error(syntax_error);
+//             error(syntax_error);
+               error("syntax error; expected symbol");
                return ERROR;
        }
 
@@ -265,7 +271,8 @@ int d_equrundef(void)
                // Check we are dealing with a symbol
                if (*tok != SYMBOL)
                {
-                       error(syntax_error);
+//                     error(syntax_error);
+                       error("syntax error; expected symbol");
                        return ERROR;
                }
 
@@ -312,7 +319,8 @@ int d_incbin(void)
 
        if (*tok != STRING)
        {
-               error(syntax_error);
+//             error(syntax_error);
+               error("syntax error; string missing");
                return ERROR;
        }
 
@@ -1554,3 +1562,17 @@ int d_undmac(void)
        return 0;
 }
 
+
+int d_jpad(void)
+{
+       warn("JPAD directive is deprecated/non-functional");
+       return OK;
+}
+
+
+int d_nojpad(void)
+{
+       warn("NOJPAD directive is deprecated/non-functional");
+       return OK;
+}
+