Fix build warnings
authorAlexey Gladkov <legion@altlinux.org>
Wed, 26 Dec 2007 14:05:38 +0000 (17:05 +0300)
committerAlexey Gladkov <legion@altlinux.org>
Wed, 26 Dec 2007 14:05:38 +0000 (17:05 +0300)
Signed-off-by: Alexey Gladkov <legion@altlinux.org>
src/dumpkeys.c
src/kdfontop.c
src/kdfontop.h
src/loadkeys.y
src/mapscrn.c
src/outpsfheader.c
src/screendump.c
src/setfont.c
src/spawn_console.c
src/spawn_login.c
src/utf8.c

index 8f7fd1c..8673153 100644 (file)
@@ -499,7 +499,7 @@ static void
 dump_funcs(void) {
        int i;
        struct kbsentry fbuf;
-       char *p;
+       unsigned char *p;
 
        for (i = 0; i < MAX_NR_FUNC; i++) {
                fbuf.kb_func = i;
index 2bdf50b..51158fd 100644 (file)
@@ -130,7 +130,7 @@ struct console_font_op {
 #endif /* KDFONTOP */
 
 int
-font_charheight(char *buf, int count, int width) {
+font_charheight(unsigned char *buf, int count, int width) {
        int h, i, x;
        int bytewidth = (width+7)/8;
 
@@ -149,7 +149,7 @@ font_charheight(char *buf, int count, int width) {
  * Must not exit - we may have cleanup to do.
  */
 int
-getfont(int fd, char *buf, int *count, int *width, int *height) {
+getfont(int fd, unsigned char *buf, int *count, int *width, int *height) {
        struct consolefontdesc cfd;
        struct console_font_op cfo;
        int i;
@@ -179,7 +179,7 @@ getfont(int fd, char *buf, int *count, int *width, int *height) {
        /* Second attempt: GIO_FONTX */
        cfd.charcount = *count;
        cfd.charheight = 0;
-       cfd.chardata = buf;
+       cfd.chardata = (char *)buf;
        i = ioctl(fd, GIO_FONTX, &cfd);
        if (i == 0) {
                *count = cfd.charcount;
@@ -223,7 +223,7 @@ getfontsize(int fd) {
 }
 
 int
-putfont(int fd, char *buf, int count, int width, int height) {
+putfont(int fd, unsigned char *buf, int count, int width, int height) {
        struct consolefontdesc cfd;
        struct console_font_op cfo;
        int i;
@@ -252,7 +252,7 @@ putfont(int fd, char *buf, int count, int width, int height) {
           round up and try again. */
        if (errno == EINVAL && width == 8 && count != 256 && count < 512) {
                int ct = ((count > 256) ? 512 : 256);
-               char *mybuf = malloc(32 * ct);
+               unsigned char *mybuf = malloc(32 * ct);
 
                if (!mybuf) {
                        fprintf(stderr, _("%s: out of memory\n"), progname);
@@ -271,7 +271,7 @@ putfont(int fd, char *buf, int count, int width, int height) {
        /* Second attempt: PIO_FONTX */
        cfd.charcount = count;
        cfd.charheight = height;
-       cfd.chardata = buf;
+       cfd.chardata = (char *)buf;
        i = ioctl(fd, PIO_FONTX, &cfd);
        if (i == 0)
                return 0;
index efd0ce1..9918bc8 100644 (file)
@@ -3,20 +3,20 @@
  * Return 0 on success -1 on failure.
  * Sets number of glyphs in COUNT, glyph size in WIDTH and HEIGHT.
  */
-extern int getfont(int fd, char *buf, int *count, int *width, int *height);
+extern int getfont(int fd, unsigned char *buf, int *count, int *width, int *height);
 
 /*
  * Load kernel font of width WIDTH and pointsize HEIGHT from BUF
  * with length COUNT.
  * Return 0 on success, -1 on failure.
  */
-extern int putfont(int fd, char *buf, int count, int width, int height);
+extern int putfont(int fd, unsigned char *buf, int count, int width, int height);
 
 /*
  * Find the maximum height of nonblank pixels
  * (in the ((WIDTH+7)/8)*32*COUNT bytes of BUF).
  */
-extern int font_charheight(char *buf, int count, int width);
+extern int font_charheight(unsigned char *buf, int count, int width);
 
 /*
  * Find the size of the kernel font.
index 0af3671..f1f2d02 100644 (file)
@@ -1027,7 +1027,7 @@ loadkeys (char *console, int *warned) {
         int keyct, funcct, diacct = 0;
 
        fd = getfd(console);
-       keyct = defkeys(fd, console, &warned);
+       keyct = defkeys(fd, console, warned);
        funcct = deffuncs(fd);
        if (verbose) {
                printf(_("\nChanged %d %s and %d %s.\n"),
index e81cad4..fe1dbc5 100644 (file)
@@ -21,7 +21,7 @@
 void saveoldmap(int fd, char *omfil);
 void loadnewmap(int fd, char *mfil);
 
-static int ctoi (unsigned char *);
+static int ctoi (char *);
 
 /* search for the map file in these directories (with trailing /) */
 static char *mapdirpath[] = { "", DATADIR "/" TRANSDIR "/", 0 };
@@ -210,7 +210,7 @@ loadnewmap(int fd, char *mfil) {
  * ('x', x a single byte or a utf8 sequence).
  */
 int
-ctoi(unsigned char *s) {
+ctoi(char *s) {
        int i;
 
        if ((strncmp(s,"0x",2) == 0) && 
index d963ccc..b00dce5 100644 (file)
@@ -4,7 +4,7 @@
 #include <stdlib.h>    /* exit */
 #include "psf.h"
 
-void
+static void
 usage(void) {
        fprintf(stderr, "call: outpsfheader psftype fontsize charsize hastable\n");
        exit(1);
index 5494295..1ebd290 100644 (file)
@@ -144,7 +144,7 @@ try_ioctl:
        }
 
        outbuf = xmalloc(rows*(cols+1));
-       p = screenbuf + 2;
+       p = ((char *)screenbuf) + 2;
        q = outbuf;
         for (i=0; i<rows; i++) {
            for (j=0; j<cols; j++)
index aa5dd79..af3805a 100644 (file)
@@ -248,7 +248,7 @@ static int erase_mode = 1;
 static void
 do_loadfont(int fd, char *inbuf, int width, int height, int hwunit,
            int fontsize, char *pathname) {
-       char *buf;
+       unsigned char *buf;
        int i, buflen;
        int bytewidth = (width+7)/8;
        int charsize = height * bytewidth;
@@ -639,7 +639,7 @@ do_saveoldfont(int fd, char *ofil, FILE *fpo, int unimap_follows,
 
 /* this is the max font size the kernel is willing to handle */
 #define MAXFONTSIZE    65536
-       char buf[MAXFONTSIZE];
+       unsigned char buf[MAXFONTSIZE];
 
        int i, ct, width, height, bytewidth, charsize, kcharsize;
 
index 0904ef9..ef84d10 100644 (file)
@@ -18,8 +18,8 @@
 #include <sys/ioctl.h> /* ioctl */
 #include <unistd.h>    /* sleep */
 
-void
-sighup(){
+static void
+sighup(int n) {
     if (system("openvt -s -l bash") == -1) {
       perror("system");
       exit(1);
index 1cbf8f4..921bbd9 100644 (file)
@@ -13,8 +13,8 @@
 #include <sys/ioctl.h>
 #include <linux/kd.h>
 
-void
-sighup() {
+static void
+sighup(int n) {
     if (system("openvt -s -l -- login -h spawn") == -1) {
        perror("system");
        exit(1);
index 70ee032..f1ba667 100644 (file)
@@ -44,7 +44,7 @@ from_utf8(char **inptr, int cnt, int *err) {
                *err = UTF8_BAD;
                return 0;
        }
-       *inptr = in;
+       *inptr = (char *)in;
        *err = 0;
        return uc;
 }