From e8dfb769389763a4b6d7df25409b0dd512b98c4e Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Sun, 28 Jan 2007 23:48:54 +0300 Subject: [PATCH] [BUILD] Apply patch from SUSE. Apply kbd-1.12-happy-abuild.diff patch from SUSE distribution. Patch fix some build warnings. Signed-off-by: Alexey Gladkov --- openvt/Makefile | 3 ++- src/loadkeys.y | 12 +++++------- src/mapscrn.c | 10 +++++----- src/outpsfheader.c | 1 + src/psffontop.c | 2 +- src/setleds.c | 2 +- src/spawn_console.c | 4 ++++ 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/openvt/Makefile b/openvt/Makefile index 51dcf51..1eec2c7 100644 --- a/openvt/Makefile +++ b/openvt/Makefile @@ -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 diff --git a/src/loadkeys.y b/src/loadkeys.y index f6b92c5..ab8ad8f 100644 --- a/src/loadkeys.y +++ b/src/loadkeys.y @@ -20,6 +20,7 @@ #include #include #include +#include /* 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; diff --git a/src/mapscrn.c b/src/mapscrn.c index 8793eb5..d3ea58c 100644 --- a/src/mapscrn.c +++ b/src/mapscrn.c @@ -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]; diff --git a/src/outpsfheader.c b/src/outpsfheader.c index a788497..d963ccc 100644 --- a/src/outpsfheader.c +++ b/src/outpsfheader.c @@ -1,6 +1,7 @@ /* outpsfheader - auxiliary fn - not to be installed */ /* assumes a little-endian machine */ #include +#include /* exit */ #include "psf.h" void diff --git a/src/psffontop.c b/src/psffontop.c index 9a2252f..de5102f 100644 --- a/src/psffontop.c +++ b/src/psffontop.c @@ -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; diff --git a/src/setleds.c b/src/setleds.c index 0170c33..ca4cf3b 100644 --- a/src/setleds.c +++ b/src/setleds.c @@ -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; diff --git a/src/spawn_console.c b/src/spawn_console.c index 466ef60..97bee45 100644 --- a/src/spawn_console.c +++ b/src/spawn_console.c @@ -12,6 +12,10 @@ #include #include #include +#include /* system */ +#include /* open */ +#include /* ioctl */ +#include /* sleep */ void sighup(){ -- 2.7.4