Removed some unnecessary #include directives
[pspp] / src / groff-font.c
index 9427089d3009f330e1e5997a6c59aab56583862e..e5811ef40de411a824d048d2d77b6a030e969f66 100644 (file)
 #include "alloc.h"
 #include "error.h"
 #include "filename.h"
+#include "getline.h"
 #include "hash.h"
 #include "pool.h"
 #include "str.h"
 #include "version.h"
 
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
 int font_number_to_index (int);
 
 int space_index;
@@ -388,10 +392,15 @@ lose:
 static int
 font_msg (int class, const char *format,...)
 {
+  struct error error;
   va_list args;
 
+  error.class = class;
+  err_location (&error.where);
+  error.title = _("installation error: Groff font error: ");
+
   va_start (args, format);
-  tmsg (class, format, args, _("installation error: Groff font error: "));
+  err_vmsg (&error, format, args);
   va_end (args);
 
   return 0;
@@ -402,7 +411,7 @@ font_msg (int class, const char *format,...)
 static void
 scan_badchars (char *line, int len)
 {
-  unsigned char *cp = line;
+  char *cp = line;
 
   /* Same bad characters as Groff. */
   static unsigned char badchars[32] =
@@ -413,12 +422,15 @@ scan_badchars (char *line, int len)
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   };
 
-  for (; len--; cp++)
-    if (badchars[*cp >> 3] & (1 << (*cp & 7)))
-      {
-       font_msg (SE, _("Bad character \\%3o."), *cp);
-       *cp = ' ';
-      }
+  for (; len--; cp++) 
+    {
+      int c = (unsigned char) *cp;
+      if (badchars[c >> 3] & (1 << (c & 7)))
+        {
+          font_msg (SE, _("Bad character \\%3o."), *cp);
+          *cp = ' ';
+        } 
+    }
 }
 \f
 /* Character name hashing. */