Replace current verbose GPL stuff in libbb/*.c with one-line GPL boilerplate.
[oweals/busybox.git] / console-tools / loadfont.c
index 4580dc4e05a5d86125fd40b762d5470ce47e77ee..2421cadcfd5e7b48eb05501800cb536ae4b8d271 100644 (file)
@@ -10,7 +10,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
-#include <memory.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include <endian.h>
 #include "busybox.h"
 
-static const int PSF_MAGIC1 = 0x36;
-static const int PSF_MAGIC2 = 0x04;
+enum{
+       PSF_MAGIC1 = 0x36,
+       PSF_MAGIC2 = 0x04,
 
-static const int PSF_MODE512 = 0x01;
-static const int PSF_MODEHASTAB = 0x02;
-static const int PSF_MAXMODE = 0x03;
-static const int PSF_SEPARATOR = 0xFFFF;
+       PSF_MODE512 = 0x01,
+       PSF_MODEHASTAB = 0x02,
+       PSF_MAXMODE = 0x03,
+       PSF_SEPARATOR = 0xFFFF
+};
 
 struct psf_header {
        unsigned char magic1, magic2;   /* Magic number */
@@ -39,7 +40,7 @@ struct psf_header {
 
 static void loadnewfont(int fd);
 
-extern int loadfont_main(int argc, char **argv)
+int loadfont_main(int argc, char **argv)
 {
        int fd;
 
@@ -52,7 +53,7 @@ extern int loadfont_main(int argc, char **argv)
        return EXIT_SUCCESS;
 }
 
-static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
+static void do_loadfont(int fd, unsigned char *inbuf, int unit, int fontsize)
 {
        char buf[16384];
        int i;
@@ -126,11 +127,6 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
        ud.entry_ct = ct;
        ud.entries = up;
        if (ioctl(fd, PIO_UNIMAP, &ud)) {
-#if 0
-               if (errno == ENOMEM) {
-                       /* change advice parameters */
-               }
-#endif
                bb_perror_msg_and_die("PIO_UNIMAP");
        }
 }
@@ -138,7 +134,7 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
 static void loadnewfont(int fd)
 {
        int unit;
-       char inbuf[32768];                      /* primitive */
+       unsigned char inbuf[32768];                     /* primitive */
        unsigned int inputlth, offset;
 
        /*