Turn MOD from function to macro.
[open-adventure.git] / misc.c
diff --git a/misc.c b/misc.c
index 9da70dc8e447d0d9f04455c4659115bd465b0348..d89b4058fbcfd003329b3a470b8fed765b7ba93e 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -78,7 +78,7 @@ void newspeak(char* msg)
          if (msg[i + 1] == 'd')
            {
              copy[i + 1] = 's';
-             sprintf(parameters[pi], "%d", PARMS[pi]);
+             sprintf(parameters[pi], "%ld", PARMS[pi]);
            }
 
          // Unmodified string specifier.
@@ -128,7 +128,7 @@ void newspeak(char* msg)
 
   // Render the final string.
   char rendered[2000]; // FIXME: to be replaced with dynamic allocation
-  sprintf(&rendered, copy, parameters[1], parameters[2], parameters[3], parameters[4]); // FIXME: to be replaced with vsprintf()
+  sprintf((char *)&rendered, copy, parameters[1], parameters[2], parameters[3], parameters[4]); // FIXME: to be replaced with vsprintf()
 
   // Print the message.
   printf("%s\n", rendered);
@@ -630,14 +630,14 @@ bool MAPLIN(FILE *fp)
      *  and is not changed thereafter unless the routines on this page choose
      *  to do so. */
 
-    if (!oldstyle && !isatty(1))
+    if (prompt)
        fputs("> ", stdout);
     do {
-       if (oldstyle) {
+       if (!editline) {
            IGNORE(fgets(rawbuf,sizeof(rawbuf)-1,fp));
            eof = (feof(fp));
        } else {
-           char *cp = linenoise("> ");
+           char *cp = linenoise(prompt ? "> ": "");
            eof = (cp == NULL);
            if (!eof) {
                strncpy(rawbuf, cp, sizeof(rawbuf)-1);
@@ -698,7 +698,4 @@ void DATIME(long* d, long* t)
     *t = (long) tv.tv_usec;
 }
 
-long MOD(long n, long m) 
-{
-    return(n%m);
-}
+/* end */