Commit 777f31cd authored by Keith Packard's avatar Keith Packard

-Wall fixes. Add klinux.h to export function declarations

parent a398339b
......@@ -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;
......
......@@ -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);
......
/*
* $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_ */
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment