]> granicus.if.org Git - nethack/commitdiff
USE_OLDARGS update (1 of 2)
authorPatR <rankin@nethack.org>
Thu, 3 Aug 2017 01:23:42 +0000 (18:23 -0700)
committerPatR <rankin@nethack.org>
Thu, 3 Aug 2017 01:23:42 +0000 (18:23 -0700)
Files modified:
    include/tradstdc.h, sp_lev.h, system.h
    util/lev_main.c

Silence a bunch of warnings generated by recent gcc which weren't there
with whatever version I had when 3.6.0 was being readied for release.
For lev_main, there were two basic types:  not enough arguments in calls
to lc_pline, lc_warning, and lc_error (since we weren't passing dummy
arguments as is done for add_opvars), and conversion from 'int' or
narrower to 'char *' (from -Wint-to-pointer-cast, which either wasn't
there yet in the older gcc, or wasn't included in -Wall back then).
[Note that for any configuration decrepit enough to actually need
USE_OLDARGS, such conversions will either work fine or else nethack
simply won't be viable.]

src/pline.c generates a bunch of warnings (for USE_OLDARGS).  The fix
for that will be (2 of 2).

To test, instead of mucking about with CFLAGS or sys/unix/hints, I've
been temporarily adding unconditional
|#undef USE_STDARG
|#undef USE_VARARGS
|#define USE_OLDARGS
to the end of config1.h and then doing my normal build--which is why
-Wall (or possibly -W) is drawing -Wint-to-pointer-cast warnings.

include/sp_lev.h
include/system.h
include/tradstdc.h
util/lev_main.c

index 97af34dd6f54c0b536ce57377ab44acd67ae2e92..9befcd6694c675a7f47ccd19e18e4e4c705b6c2b 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 sp_lev.h        $NHDT-Date: 1470212260 2016/08/03 08:17:40 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.17 $ */
+/* NetHack 3.6 sp_lev.h        $NHDT-Date: 1501723399 2017/08/03 01:23:19 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.20 $ */
 /* Copyright (c) 1989 by Jean-Christophe Collet                          */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -484,61 +484,51 @@ struct lc_breakdef {
 #ifdef SPEC_LEV
 /* compiling lev_comp rather than nethack */
 #ifdef USE_OLDARGS
-#undef VA_ARGS
-#undef VA_DECL
-#undef VA_DECL2
-#undef VA_SHIFT
+#ifndef VA_TYPE
+typedef const char *vA;
+#define VA_TYPE
+#endif
+#undef VA_ARGS  /* redefine with the maximum number actually used */
+#undef VA_SHIFT /* ditto */
 #define VA_ARGS                                                         \
     arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, \
         arg12, arg13, arg14
-#define VA_DECL(typ1, var1)                                             \
-    (var1, VA_ARGS) typ1 var1;                                          \
-    char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8, *arg9, \
-        *arg10, *arg11, *arg12, *arg13, *arg14;                         \
-    {
-#define VA_DECL2(typ1, var1, typ2, var2)                                \
-    (var1, var2, VA_ARGS) typ1 var1;                                    \
-    typ2 var2;                                                          \
-    char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8, *arg9, \
-        *arg10, *arg11, *arg12, *arg13, *arg14;                         \
-    {
-/* unlike in the core, lev_comp's VA_SHIFT is completely safe,
-   because callers always pass all these arguments */
+/* Unlike in the core, lev_comp's VA_SHIFT should be completely safe,
+   because callers always pass all these arguments. */
 #define VA_SHIFT()                                                       \
     (arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6,    \
      arg6 = arg7, arg7 = arg8, arg8 = arg9, arg9 = arg10, arg10 = arg11, \
      arg11 = arg12, arg12 = arg13, arg13 = arg14, arg14 = 0)
 /* standard NULL may be either (void *)0 or plain 0, both of
    which would need to be explicitly cast to (char *) here */
-typedef char *Va;
 #define VA_PASS1(a1)                                                         \
-    (Va) a1, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS2(a1, a2)                                              \
-    (Va) a1, (Va) a2, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS3(a1, a2, a3)                                           \
-    (Va) a1, (Va) a2, (Va) a3, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) a3, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS4(a1, a2, a3, a4)                                        \
-    (Va) a1, (Va) a2, (Va) a3, (Va) a4, (Va) 0, (Va) 0, (Va) 0, (Va) 0, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS5(a1, a2, a3, a4, a5)                                     \
-    (Va) a1, (Va) a2, (Va) a3, (Va) a4, (Va) a5, (Va) 0, (Va) 0, (Va) 0, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) 0, (vA) 0, (vA) 0, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS7(a1, a2, a3, a4, a5, a6, a7)                               \
-    (Va) a1, (Va) a2, (Va) a3, (Va) a4, (Va) a5, (Va) a6, (Va) a7, (Va) 0, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) 0, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS8(a1, a2, a3, a4, a5, a6, a7, a8)                            \
-    (Va) a1, (Va) a2, (Va) a3, (Va) a4, (Va) a5, (Va) a6, (Va) a7, (Va) a8, \
-        (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) a8, \
+        (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS9(a1, a2, a3, a4, a5, a6, a7, a8, a9)                        \
-    (Va) a1, (Va) a2, (Va) a3, (Va) a4, (Va) a5, (Va) a6, (Va) a7, (Va) a8, \
-        (Va) a9, (Va) 0, (Va) 0, (Va) 0, (Va) 0, (Va) 0
+    (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) a8, \
+        (vA) a9, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0
 #define VA_PASS14(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13,   \
                   a14)                                                      \
-    (Va) a1, (Va) a2, (Va) a3, (Va) a4, (Va) a5, (Va) a6, (Va) a7, (Va) a8, \
-        (Va) a9, (Va) a10, (Va) a11, (Va) a12, (Va) a13, (Va) a14
+    (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) a8, \
+        (vA) a9, (vA) a10, (vA) a11, (vA) a12, (vA) a13, (vA) a14
 #else /*!USE_OLDARGS*/
 /* USE_STDARG and USE_VARARGS don't need to pass dummy arguments
    or cast real ones */
index 21ccf8b721899484055e1df0e53abd0054b1b125..f7a3d26060823d48d4aa934d53a2c3cf8560d151 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 system.h        $NHDT-Date: 1449269772 2015/12/04 22:56:12 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.12 $ */
+/* NetHack 3.6 system.h        $NHDT-Date: 1501723401 2017/08/03 01:23:21 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.13 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -489,8 +489,17 @@ E int FDECL(vprintf, (const char *, va_list));
 #endif
 #endif
 #else
+#ifdef vprintf
+#undef vprintf
+#endif
 #define vprintf printf
+#ifdef vfprintf
+#undef vfprintf
+#endif
 #define vfprintf fprintf
+#ifdef vsprintf
+#undef vsprintf
+#endif
 #define vsprintf sprintf
 #endif
 #endif /* NEED_VARARGS */
index 26ce81ad5e2903af9de1d299961edd1738f562bb..ddd7d20374aff932887d7cbc9358479b8ed317b2 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 tradstdc.h      $NHDT-Date: 1448210011 2015/11/22 16:33:31 $  $NHDT-Branch: master $:$NHDT-Revision: 1.27 $ */
+/* NetHack 3.6 tradstdc.h      $NHDT-Date: 1501723401 2017/08/03 01:23:21 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.28 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 #else
 
 /*USE_OLDARGS*/
+/*
+ * CAVEAT:  passing double (including float promoted to double) will
+ * almost certainly break this, as would any integer type bigger than
+ * sizeof (char *).
+ * NetHack avoids floating point, and any configuration able to use
+ * 'long long int' or I64P32 or the like should be using USE_STDARG.
+ */
+#ifndef VA_TYPE
+typedef const char *vA;
+#define VA_TYPE
+#endif
 #define VA_ARGS arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
 #define VA_DECL(typ1, var1)                                             \
-    (var1, VA_ARGS) typ1 var1;                                          \
-    char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8, *arg9; \
+    (var1, VA_ARGS) typ1 var1; vA VA_ARGS;                              \
     {
 #define VA_DECL2(typ1, var1, typ2, var2)                                \
-    (var1, var2, VA_ARGS) typ1 var1;                                    \
-    typ2 var2;                                                          \
-    char *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7, *arg8, *arg9; \
+    (var1, var2, VA_ARGS) typ1 var1; typ2 var2; vA VA_ARGS;             \
     {
 #define VA_START(x)
 #define VA_INIT(var1, typ1)
  */
 #define VA_SHIFT()                                                    \
     (arg1 = arg2, arg2 = arg3, arg3 = arg4, arg4 = arg5, arg5 = arg6, \
-     arg6 = arg7, arg7 = arg8, arg8 = arg9)
+     arg6 = arg7, arg7 = arg8, arg8 = arg9, arg9 = 0)
 #define VA_NEXT(var1, typ1) ((var1 = (typ1) arg1), VA_SHIFT(), var1)
 #define VA_END() }
 #endif
@@ -380,7 +388,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
  * append this to a prototype declaration (see pline() in extern.h).
  */
 #ifdef __GNUC__
-#if __GNUC__ >= 2
+#if (__GNUC__ >= 2) && !defined(USE_OLDARGS)
 #define PRINTF_F(f, v) __attribute__((format(printf, f, v)))
 #endif
 #if __GNUC__ >= 3
index 773c9480b07c2788d3583ca8e67a0281399316f5..ecf7a444c45ef9b120b70bfcc33025c78e905963 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 lev_main.c      $NHDT-Date: 1501461281 2017/07/31 00:34:41 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.46 $ */
+/* NetHack 3.6 lev_main.c      $NHDT-Date: 1501723418 2017/08/03 01:23:38 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.47 $ */
 /*      Copyright (c) 1989 by Jean-Christophe Collet */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -281,7 +281,7 @@ char **argv;
             }
             fin = freopen(fname, "r", stdin);
             if (!fin) {
-                lc_pline("Can't open \"%s\" for input.\n", fname);
+                lc_pline("Can't open \"%s\" for input.\n", VA_PASS1(fname));
                 perror(fname);
                 errors_encountered = TRUE;
             } else {
@@ -644,56 +644,56 @@ VA_DECL2(sp_lev *, sp, const char *, fmt)
         case 'i': /* integer */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_int(ov, VA_NEXT(la, long) );
+            set_opvar_int(ov, VA_NEXT(la, long));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 'c': /* coordinate */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_coord(ov, VA_NEXT(la, long) );
+            set_opvar_coord(ov, VA_NEXT(la, long));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 'r': /* region */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_region(ov, VA_NEXT(la, long) );
+            set_opvar_region(ov, VA_NEXT(la, long));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 'm': /* mapchar */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_mapchar(ov, VA_NEXT(la, long) );
+            set_opvar_mapchar(ov, VA_NEXT(la, long));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 'M': /* monster */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_monst(ov, VA_NEXT(la, long) );
+            set_opvar_monst(ov, VA_NEXT(la, long));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 'O': /* object */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_obj(ov, VA_NEXT(la, long) );
+            set_opvar_obj(ov, VA_NEXT(la, long));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 's': /* string */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_str(ov, VA_NEXT(lp, const char *) );
+            set_opvar_str(ov, VA_NEXT(lp, const char *));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
         case 'v': /* variable */
         {
             struct opvar *ov = New(struct opvar);
-            set_opvar_var(ov, VA_NEXT(lp, const char *) );
+            set_opvar_var(ov, VA_NEXT(lp, const char *));
             add_opcode(sp, SPO_PUSH, ov);
             break;
         }
@@ -701,12 +701,13 @@ VA_DECL2(sp_lev *, sp, const char *, fmt)
         {
             long i = VA_NEXT(la, int);
             if (i < 0 || i >= MAX_SP_OPCODES)
-                lc_pline("add_opvars: unknown opcode '%ld'.", i);
+                lc_pline("add_opvars: unknown opcode '%ld'.", VA_PASS1(i));
             add_opcode(sp, i, NULL);
             break;
         }
         default:
-            lc_pline("add_opvars: illegal format character '%c'.", *p);
+            lc_pline("add_opvars: illegal format character '%ld'.",
+                     VA_PASS1((long) *p));
             break;
         }
     }
@@ -774,7 +775,8 @@ char *name;
     struct lc_funcdefs *f = New(struct lc_funcdefs);
 
     if (!f) {
-        lc_error("Could not alloc function definition for '%s'.", name);
+        lc_error("Could not alloc function definition for '%s'.",
+                 VA_PASS1(name));
         return NULL;
     }
     f->next = NULL;
@@ -855,7 +857,8 @@ char *name;
     struct lc_vardefs *f = New(struct lc_vardefs);
 
     if (!f) {
-        lc_error("Could not alloc variable definition for '%s'.", name);
+        lc_error("Could not alloc variable definition for '%s'.",
+                 VA_PASS1(name));
         return NULL;
     }
     f->next = NULL;
@@ -874,7 +877,7 @@ struct lc_vardefs *fchain;
 
     while (tmp) {
         if (be_verbose && (tmp->n_used == 0))
-            lc_warning("Unused variable '%s'", tmp->name);
+            lc_warning("Unused variable '%s'", VA_PASS1(tmp->name));
         nxt = tmp->next;
         Free(tmp->name);
         Free(tmp);
@@ -913,7 +916,7 @@ long spovar;
     spovar &= ~SPOVAR_ARRAY;
     switch (spovar) {
     default:
-        lc_error("spovar2str(%ld)", spovar);
+        lc_error("spovar2str(%ld)", VA_PASS1(spovar));
         break;
     case SPOVAR_INT:
         n = "integer";
@@ -969,9 +972,11 @@ long vartype;
     if ((tmp = vardef_defined(vd, varname, 1)) != 0) {
         if (tmp->var_type != vartype)
             lc_error("Trying to use variable '%s' as %s, when it is %s.",
-                     varname, spovar2str(vartype), spovar2str(tmp->var_type));
+                     VA_PASS3(varname,
+                              spovar2str(vartype),
+                              spovar2str(tmp->var_type)));
     } else
-        lc_error("Variable '%s' not defined.", varname);
+        lc_error("Variable '%s' not defined.", VA_PASS1(varname));
 }
 
 struct lc_vardefs *
@@ -985,7 +990,9 @@ long vartype;
     if ((tmp = vardef_defined(vd, varname, 1)) != 0) {
         if (tmp->var_type != vartype)
             lc_error("Trying to redefine variable '%s' as %s, when it is %s.",
-                     varname, spovar2str(vartype), spovar2str(tmp->var_type));
+                     VA_PASS3(varname,
+                              spovar2str(vartype),
+                              spovar2str(tmp->var_type)));
     } else {
         tmp = vardef_new(vartype, varname);
         tmp->next = vd;
@@ -1012,7 +1019,8 @@ int opcode;
     case SPO_JGE:
         return SPO_JL;
     default:
-        lc_error("Cannot reverse comparison jmp opcode %d.", opcode);
+        lc_error("Cannot reverse comparison jmp opcode %ld.",
+                 VA_PASS1((long) opcode));
         return SPO_NULL;
     }
 }
@@ -1054,7 +1062,8 @@ struct opvar *ov;
             tmpov->vardata.str[len] = '\0';
         } break;
         default: {
-            lc_error("Unknown opvar_clone value type (%d)!", ov->spovartyp);
+            lc_error("Unknown opvar_clone value type (%ld)!",
+                     VA_PASS1((long) ov->spovartyp));
         } /* default */
         } /* switch */
         return tmpov;
@@ -1083,9 +1092,10 @@ char *ldfname;
     struct lc_funcdefs *f;
 
     if (index(ldfname, '.'))
-        lc_error("Invalid dot ('.') in level name '%s'.", ldfname);
+        lc_error("Invalid dot ('.') in level name '%s'.", VA_PASS1(ldfname));
     if ((int) strlen(ldfname) > 14)
-        lc_error("Level names limited to 14 characters ('%s').", ldfname);
+        lc_error("Level names limited to 14 characters ('%s').",
+                 VA_PASS1(ldfname));
     f = function_definitions;
     while (f) {
         f->n_called = 0;
@@ -1173,8 +1183,8 @@ char c;
         if (!class || class == mons[i].mlet)
             if (!case_insensitive_comp(s, mons[i].mname)) {
                 if (be_verbose)
-                    lc_warning("Monster type \"%s\" matches \"%s\".", s,
-                               mons[i].mname);
+                    lc_warning("Monster type \"%s\" matches \"%s\".",
+                               VA_PASS2(s, mons[i].mname));
                 return i;
             }
     return ERR;
@@ -1209,7 +1219,8 @@ char c; /* class */
         objname = obj_descr[i].oc_name;
         if (objname && !case_insensitive_comp(s, objname)) {
             if (be_verbose)
-                lc_warning("Object type \"%s\" matches \"%s\".", s, objname);
+                lc_warning("Object type \"%s\" matches \"%s\".",
+                           VA_PASS2(s, objname));
             return i;
         }
     }
@@ -1318,14 +1329,14 @@ genericptr_t dat;
     _opcode *tmp;
 
     if ((opc < 0) || (opc >= MAX_SP_OPCODES))
-        lc_error("Unknown opcode '%d'", opc);
+        lc_error("Unknown opcode '%ld'", VA_PASS1((long) opc));
 
     tmp = (_opcode *) alloc(sizeof(_opcode) * (nop + 1));
     if (!tmp) { /* lint suppression */
         /*NOTREACHED*/
 #if 0
         /* not possible; alloc() never returns Null */
-        lc_error("Could not alloc opcode space");
+        lc_error("%s", VA_PASS1("Could not alloc opcode space"));
 #endif
         return;
     }
@@ -1396,9 +1407,9 @@ sp_lev *sp;
         for (i = 0; i < len; i++)
             if ((tmpmap[max_hig][i] = what_map_char(map[i]))
                 == INVALID_TYPE) {
-                lc_warning("Invalid character '%c' @ (%d, %d) - replacing "
-                           "with stone",
-                           map[i], max_hig, i);
+                lc_warning(
+                "Invalid character '%ld' @ (%ld, %ld) - replacing with stone",
+                           VA_PASS3((long) map[i], (long) max_hig, (long) i));
                 tmpmap[max_hig][i] = STONE;
             }
         while (i < max_len)
@@ -1413,8 +1424,9 @@ sp_lev *sp;
     max_y_map = max_hig - 1;
 
     if (max_len > MAP_X_LIM || max_hig > MAP_Y_LIM) {
-        lc_error("Map too large at (%d x %d), max is (%d x %d)", max_len,
-                 max_hig, MAP_X_LIM, MAP_Y_LIM);
+        lc_error("Map too large at (%ld x %ld), max is (%ld x %ld)",
+                 VA_PASS4((long) max_len, (long) max_hig,
+                          (long) MAP_X_LIM, (long) MAP_Y_LIM));
     }
 
     mbuf = (char *) alloc(((max_hig - 1) * max_len) + (max_len - 1) + 2);
@@ -1424,7 +1436,8 @@ sp_lev *sp;
 
     mbuf[((max_hig - 1) * max_len) + (max_len - 1) + 1] = '\0';
 
-    add_opvars(sp, "siio", VA_PASS4(mbuf, max_hig, max_len, SPO_MAP));
+    add_opvars(sp, "siio", VA_PASS4(mbuf, (long) max_hig, (long) max_len,
+                                    SPO_MAP));
 
     for (dy = 0; dy < max_hig; dy++)
         Free(tmpmap[dy]);