[BUILD] Apply patch from SUSE.
authorAlexey Gladkov <legion@altlinux.org>
Sun, 28 Jan 2007 20:48:54 +0000 (23:48 +0300)
committerAlexey Gladkov <legion@altlinux.org>
Sun, 28 Jan 2007 20:48:54 +0000 (23:48 +0300)
Apply kbd-1.12-happy-abuild.diff patch from SUSE distribution.
Patch fix some build warnings.

Signed-off-by: Alexey Gladkov <legion@altlinux.org>
openvt/Makefile
src/loadkeys.y
src/mapscrn.c
src/outpsfheader.c
src/psffontop.c
src/setleds.c
src/spawn_console.c

index 51dcf51..1eec2c7 100644 (file)
@@ -1,6 +1,7 @@
 
 CC=gcc
-CFLAGS=-O2 -Wall -ansi
+RPM_OPT_FLAGS=-O2 -Wall -ansi
+CFLAGS=$(RPM_OPT_FLAGS)
 LDFLAGS=$(CFLAGS) -s 
 
 SRC=openvt.c
index f6b92c5..ab8ad8f 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/ioctl.h>
 #include <linux/kd.h>
 #include <linux/keyboard.h>
+#include <unistd.h>            /* readlink */
 #include "paths.h"
 #include "getfd.h"
 #include "findfile.h"
@@ -65,9 +66,9 @@ static void do_constant_key (int, u_short);
 static void loadkeys(char *console, int *warned);
 static void mktable(void);
 static void strings_as_usual(void);
-static void keypad_as_usual(char *keyboard);
-static void function_keys_as_usual(char *keyboard);
-static void consoles_as_usual(char *keyboard);
+/* static void keypad_as_usual(char *keyboard); */
+/* static void function_keys_as_usual(char *keyboard); */
+/* static void consoles_as_usual(char *keyboard); */
 static void compose_as_usual(char *charset);
 static void lkfatal0(const char *, int);
 extern int set_charset(const char *charset);
@@ -559,7 +560,6 @@ FILE *find_incl_file(char *s) {
 
 void
 open_include(char *s) {
-       char *t, *te;
 
        if (verbose)
                /* start reading include file */
@@ -713,7 +713,6 @@ addkey(int index, int table, int keycode) {
             int alttable = table | M_ALT;
             int type = KTYP(keycode);
             int val = KVAL(keycode);
-            char *p;
             if (alttable != table && defining[alttable] &&
                 (!keymap_was_set[alttable] ||
                  !(keymap_was_set[alttable])[index]) &&
@@ -1021,7 +1020,7 @@ do_constant (void) {
 static void
 loadkeys (char *console, int *warned) {
         int fd;
-        int keyct, funcct, diacct;
+        int keyct, funcct, diacct = 0;
 
        fd = getfd(console);
        keyct = defkeys(fd, console, &warned);
@@ -1156,7 +1155,6 @@ static void
 mktable () {
        int i, imax, j;
 
-       struct kbsentry kbs;
        u_char *p;
        int maxfunc;
        unsigned int keymap_count = 0;
index 8793eb5..d3ea58c 100644 (file)
@@ -126,7 +126,7 @@ readnewmapfromfile(int fd, char *mfil, char *buf, unsigned short *ubuf) {
        FILE *fp;
        struct stat stbuf;
        int u = 0;
-       int lineno;
+       int lineno = 0;
 
        if ((fp = findfile(mfil, mapdirpath, mapsuffixes)) == NULL) {
                fprintf(stderr, _("mapscrn: cannot open map file _%s_\n"),
@@ -215,18 +215,18 @@ ctoi(unsigned char *s) {
 
        if ((strncmp(s,"0x",2) == 0) && 
            (strspn(s+2,"0123456789abcdefABCDEF") == strlen(s+2)))
-               sscanf(s+2,"%x",&i);
+               (void)sscanf(s+2,"%x",&i);
 
        else if ((*s == '0') &&
                 (strspn(s,"01234567") == strlen(s)))
-               sscanf(s,"%o",&i);
+               (void)sscanf(s,"%o",&i);
 
        else if (strspn(s,"0123456789") == strlen(s)) 
-               sscanf(s,"%d",&i);
+               (void)sscanf(s,"%d",&i);
 
        else if ((strncmp(s,"U+",2) == 0) && strlen(s) == 6 &&
                 (strspn(s+2,"0123456789abcdefABCDEF") == 4))
-               sscanf(s+2,"%x",&i);
+               (void)sscanf(s+2,"%x",&i);
 
        else if ((strlen(s) == 3) && (s[0] == '\'') && (s[2] == '\''))
                i=s[1];
index a788497..d963ccc 100644 (file)
@@ -1,6 +1,7 @@
 /* outpsfheader - auxiliary fn - not to be installed */
 /* assumes a little-endian machine */
 #include <stdio.h>
+#include <stdlib.h>    /* exit */
 #include "psf.h"
 
 void
index 9a2252f..de5102f 100644 (file)
@@ -465,7 +465,7 @@ writepsffont(FILE *ofil, char *fontbuf, int width, int height, int fontlen,
        writepsffontheader(ofil, width, height, fontlen, &psftype, flags);
        utf8 = (psftype == 2);
 
-       fwrite(fontbuf, charsize, fontlen, ofil);
+       (void)fwrite(fontbuf, charsize, fontlen, ofil);
        /* unimaps: -1 => do nothing: caller will append map */
        if (uclistheads != NULL && uclistheads != (struct unicode_list*)-1) {
                struct unicode_list *ul;
index 0170c33..ca4cf3b 100644 (file)
@@ -149,7 +149,7 @@ main(int argc, char **argv) {
     int optL = 0, optD = 0, optF = 0, verbose = 0;
     char oleds, nleds, oflags, nflags, odefflags, ndefflags;
     char nval, ndef, sign;
-    char osunleds, nsunleds, nsunval, nsundef;
+    char osunleds = 0, nsunleds, nsunval, nsundef;
     char *ap;
     struct led *lp;
 
index 466ef60..97bee45 100644 (file)
 #include <signal.h>
 #include <errno.h>
 #include <linux/kd.h>
+#include <stdlib.h>    /* system */
+#include <fcntl.h>     /* open */
+#include <sys/ioctl.h> /* ioctl */
+#include <unistd.h>    /* sleep */
 
 void
 sighup(){