diff options
author | Keith Packard <keithp@keithp.com> | 2003-10-14 05:05:28 +0000 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2003-10-14 05:05:28 +0000 |
commit | 777f31cd0b5ec387d975e6d10ae73fa325e4c311 (patch) | |
tree | c9f01316304b7f9ef95435fe774a0f6c06b5288d | |
parent | a398339b6d5209a11af93a3b836b0cad326a0799 (diff) |
-Wall fixes. Add klinux.h to export function declarations
-rw-r--r-- | hw/kdrive/linux/bus.c | 1 | ||||
-rw-r--r-- | hw/kdrive/linux/keyboard.c | 1 | ||||
-rw-r--r-- | hw/kdrive/linux/klinux.h | 34 | ||||
-rw-r--r-- | hw/kdrive/linux/linux.c | 29 | ||||
-rw-r--r-- | hw/kdrive/linux/mouse.c | 14 | ||||
-rw-r--r-- | hw/kdrive/linux/ps2.c | 1 |
6 files changed, 56 insertions, 24 deletions
diff --git a/hw/kdrive/linux/bus.c b/hw/kdrive/linux/bus.c index 3dcebc70e..5451b0aa4 100644 --- a/hw/kdrive/linux/bus.c +++ b/hw/kdrive/linux/bus.c @@ -39,7 +39,6 @@ void BusRead (int adbPort, void *closure) { unsigned char buf[3]; - unsigned char *b; int n; int dx, dy; unsigned long flags; diff --git a/hw/kdrive/linux/keyboard.c b/hw/kdrive/linux/keyboard.c index 2efda3955..f2998766e 100644 --- a/hw/kdrive/linux/keyboard.c +++ b/hw/kdrive/linux/keyboard.c @@ -406,7 +406,6 @@ LinuxKeyboardEnable (int fd, void *closure) struct termios nTty; unsigned char buf[256]; int n; - int flags; ioctl (fd, KDGKBMODE, &LinuxKbdTrans); tcgetattr (fd, &LinuxTermios); diff --git a/hw/kdrive/linux/klinux.h b/hw/kdrive/linux/klinux.h new file mode 100644 index 000000000..29ebe3aa9 --- /dev/null +++ b/hw/kdrive/linux/klinux.h @@ -0,0 +1,34 @@ +/* + * $Id$ + * + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _KLINUX_H_ +#define _KLINUX_H_ + +Bool +LinuxFindPci (CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr *attr); + +unsigned char * +LinuxGetPciCfg(KdCardAttr *attr); + +#endif /* _KLINUX_H_ */ diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c index 9f2ca3cc8..eb52f160c 100644 --- a/hw/kdrive/linux/linux.c +++ b/hw/kdrive/linux/linux.c @@ -26,6 +26,7 @@ #include <config.h> #endif #include "kdrive.h" +#include "klinux.h" #include <errno.h> #include <signal.h> #include <linux/vt.h> @@ -41,14 +42,14 @@ int LinuxApmFd = -1; static int activeVT; static Bool enabled; -void +static void LinuxVTRequest (int sig) { kdSwitchPending = TRUE; } /* Check before chowning -- this avoids touching the file system */ -void +static void LinuxCheckChown (char *file) { struct stat st; @@ -63,13 +64,12 @@ LinuxCheckChown (char *file) chown (file, u, g); } -int +static int LinuxInit () { - int i, fd; + int fd = -1; char vtname[11]; struct vt_stat vts; - struct stat statb; LinuxConsoleFd = -1; /* check if we're run with euid==0 */ @@ -131,7 +131,7 @@ LinuxFindPci (CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr *attr) { FILE *f; char line[2048], *l, *end; - CARD32 bus, id, mode, addr; + CARD32 bus, id, addr; int n; CARD32 ven_dev; Bool ret = FALSE; @@ -194,7 +194,8 @@ LinuxFindPci (CARD16 vendor, CARD16 device, CARD32 count, KdCardAttr *attr) } unsigned char * -LinuxGetPciCfg(KdCardAttr *attr) { +LinuxGetPciCfg(KdCardAttr *attr) +{ char filename[256]; FILE *f; unsigned char *cfg; @@ -224,7 +225,7 @@ LinuxGetPciCfg(KdCardAttr *attr) { return cfg; } -void +static void LinuxSetSwitchMode (int mode) { struct sigaction act; @@ -263,14 +264,14 @@ LinuxSetSwitchMode (int mode) } } -void +static void LinuxApmBlock (pointer blockData, OSTimePtr pTimeout, pointer pReadmask) { } static Bool LinuxApmRunning; -void +static void LinuxApmWakeup (pointer blockData, int result, pointer pReadmask) { fd_set *readmask = (fd_set *) pReadmask; @@ -322,7 +323,7 @@ LinuxApmWakeup (pointer blockData, int result, pointer pReadmask) #define NOBLOCK FNDELAY #endif -void +static void LinuxEnable (void) { if (enabled) @@ -364,7 +365,7 @@ LinuxEnable (void) enabled = TRUE; } -Bool +static Bool LinuxSpecialKey (KeySym sym) { struct vt_stat vts; @@ -383,7 +384,7 @@ LinuxSpecialKey (KeySym sym) return FALSE; } -void +static void LinuxDisable (void) { ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */ @@ -402,7 +403,7 @@ LinuxDisable (void) } } -void +static void LinuxFini (void) { struct vt_mode VT; diff --git a/hw/kdrive/linux/mouse.c b/hw/kdrive/linux/mouse.c index 7c91a52d1..2158a587d 100644 --- a/hw/kdrive/linux/mouse.c +++ b/hw/kdrive/linux/mouse.c @@ -94,7 +94,6 @@ MouseFlush (Kbufio *b, char *buf, int size) { CARD32 now = GetTimeInMillis (); CARD32 done = now + 100; - int p = 0; int c; int n = 0; @@ -434,7 +433,7 @@ static int ps2SkipInit (KdMouseInfo *mi, int ninit, Bool ret_next) { Kmouse *km = mi->driver; - int c; + int c = -1; int skipping; Bool waiting; @@ -465,7 +464,6 @@ static Bool ps2Init (KdMouseInfo *mi) { Kmouse *km = mi->driver; - int c; int skipping; Bool waiting; int id; @@ -507,6 +505,7 @@ ps2Init (KdMouseInfo *mi) * skipped */ (void) ps2SkipInit (mi, ninit, FALSE); + return TRUE; } static Bool busParse (KdMouseInfo *mi, unsigned char *ev, int ne) @@ -584,13 +583,12 @@ static const KmouseProt msProt = { static Bool logiComplete (KdMouseInfo *mi, unsigned char *ev, int ne) { Kmouse *km = mi->driver; - const KmouseProt *prot = km->prot; - int c; if ((ev[0] & 0x40) == 0x40) return ne == 3; if (km->stage != MouseBroken && (ev[0] & ~0x23) == 0) return ne == 1; + return FALSE; } static int logiValid (KdMouseInfo *mi, unsigned char *ev, int ne) @@ -880,6 +878,8 @@ MouseRead (int mousePort, void *closure) km->stage = MouseBroken; } break; + case MouseWorking: + break; } } else @@ -911,14 +911,13 @@ char *kdefaultMouse[] = { #define NUM_DEFAULT_MOUSE (sizeof (kdefaultMouse) / sizeof (kdefaultMouse[0])) -int +Bool MouseInit (void) { int i; int fd; Kmouse *km; KdMouseInfo *mi, *next; - KmouseProt *mp; int n = 0; char *prot; @@ -966,6 +965,7 @@ MouseInit (void) close (fd); } } + return TRUE; } void diff --git a/hw/kdrive/linux/ps2.c b/hw/kdrive/linux/ps2.c index 0fb76a6de..3a3444366 100644 --- a/hw/kdrive/linux/ps2.c +++ b/hw/kdrive/linux/ps2.c @@ -79,7 +79,6 @@ Ps2Read (int ps2Port, void *closure) int n; int dx, dy; unsigned long flags; - int id = (int) closure; unsigned long left_button = KD_BUTTON_1; unsigned long right_button = KD_BUTTON_3; |