Work to get rid of GCC 4.0 warnings, part 2.
[pspp] / src / postscript.c
index c828a0df2a49136cf73433458384996355516d31..fd738ababba65e1e344a053d53466f1722eb0b6c 100644 (file)
 #include <errno.h>
 #include <limits.h>
 #include <stdlib.h>
+#include <time.h>
 
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#if TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#else
-#if HAVE_SYS_TIME_H
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-#endif
-
 #include "alloc.h"
 #include "bitvector.h"
 #include "error.h"
 #include "filename.h"
 #include "font.h"
+#include "getl.h"
 #include "getline.h"
 #include "hash.h"
 #include "main.h"
@@ -57,6 +48,9 @@
 #include "som.h"
 #include "version.h"
 
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
 /* FIXMEs:
 
    optimize-text-size not implemented.
@@ -1452,7 +1446,7 @@ postopen (struct file_ext *f)
          char *beg;
          beg = buf2 = fn_interp_vars (buf, ps_get_var);
          len = strlen (buf2);
-         while (isspace (*beg))
+         while (isspace ((unsigned char) *beg))
            beg++, len--;
          if (beg[len - 1] == '\n')
            len--;
@@ -1494,7 +1488,7 @@ quote_ps_name (char *dest, const char *string)
   const char *sp;
 
   for (sp = string; *sp; sp++)
-    switch (*(unsigned char *) sp)
+    switch (*sp)
       {
       case 'a':
       case 'f':
@@ -1569,7 +1563,7 @@ quote_ps_name (char *dest, const char *string)
          *dp++ = '<';
          for (sp = string; *sp && dp < &dest[256]; sp++)
            {
-             sprintf (dp, "%02x", *(unsigned char *) sp);
+             sprintf (dp, "%02x", (unsigned char) *sp);
              dp += 2;
            }
          return stpcpy (dp, ">cvn");
@@ -1594,7 +1588,7 @@ quote_ps_string (char *dest, const char *string)
       dp = stpcpy (dp, "\\(");
     else if (*sp == ')')
       dp = stpcpy (dp, "\\)");
-    else if (*sp < 32 || *((unsigned char *) sp) > 127)
+    else if (*sp < 32 || (unsigned char) *sp > 127)
       dp = spprintf (dp, "\\%3o", *sp);
     else
       *dp++ = *sp;
@@ -2472,7 +2466,7 @@ write_text (struct outp_driver *this,
          if (TEST_BIT (literal_chars[ext->data], cp->ch))
            *lp++ = cp->ch;
          else
-           switch (cp->ch)
+           switch ((char) cp->ch)
              {
              case '(':
                lp = stpcpy (lp, "\\(");