Remove dead code, useless #defines, et al
This commit is contained in:
parent
b0a99fb02b
commit
16e40ecf43
19
configure.ac
19
configure.ac
|
@ -662,14 +662,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.la'
|
|||
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
|
||||
|
||||
dnl Core modules for most extensions, et al.
|
||||
# Require updated renderproto for ABI sanity if we're 64-bit.
|
||||
if test "$ac_cv_sizeof_unsigned_long" = 8; then
|
||||
RENDERPROTO="[renderproto >= 0.9.3]"
|
||||
else
|
||||
RENDERPROTO="renderproto"
|
||||
fi
|
||||
|
||||
REQUIRED_MODULES="[randrproto >= 1.2] $RENDERPROTO [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto [xextproto >= 7.0.3] [xproto >= 7.0.13] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.9.99.1] [kbproto >= 1.0.3]"
|
||||
REQUIRED_MODULES="[randrproto >= 1.2] [renderproto >= 0.9.3] [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto [xextproto >= 7.0.3] [xproto >= 7.0.13] xtrans [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto [inputproto >= 1.9.99.1] [kbproto >= 1.0.3]"
|
||||
REQUIRED_LIBS="xfont xau fontenc [pixman-1 >= 0.9.5]"
|
||||
|
||||
dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
|
||||
|
@ -1056,7 +1049,6 @@ AC_SUBST([VENDOR_NAME_SHORT])
|
|||
AC_SUBST([VENDOR_RELEASE])
|
||||
AC_SUBST([VENDOR_MAN_VERSION])
|
||||
|
||||
AC_DEFINE(DDXOSINIT, 1, [Use OsVendorInit])
|
||||
AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
|
||||
AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
|
||||
|
||||
|
@ -1530,9 +1522,6 @@ if test "x$XWIN" = xyes; then
|
|||
AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager])
|
||||
fi
|
||||
|
||||
AC_DEFINE(DDXOSINIT, 1, [Use OsVendorInit])
|
||||
AC_DEFINE(DDXTIME, 1, [Use GetTimeInMillis])
|
||||
AC_DEFINE(DDXOSFATALERROR, 1, [Use OsVendorFatalError])
|
||||
AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF])
|
||||
AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ])
|
||||
if test "x$XF86VIDMODE" = xyes; then
|
||||
|
@ -1757,7 +1746,6 @@ AC_SUBST([KDRIVE_LOCAL_LIBS])
|
|||
AC_SUBST([KDRIVE_LIBS])
|
||||
AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes])
|
||||
AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes])
|
||||
AM_CONDITIONAL(H3600_TS, false)
|
||||
AM_CONDITIONAL(KDRIVEVESA, [test "x$KDRIVEVESA" = xyes])
|
||||
AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes])
|
||||
AM_CONDITIONAL(XSDLSERVER, [test x"$XSDL" = xyes])
|
||||
|
@ -1788,7 +1776,10 @@ AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir])
|
|||
AC_SUBST(XKB_COMPILED_DIR)
|
||||
|
||||
dnl and the rest of these are generic, so they're in config.h
|
||||
AC_DEFINE(XResExtension, 1, [Build XRes extension])
|
||||
dnl
|
||||
dnl though, thanks to the passing of some significant amount of time, the
|
||||
dnl above is probably a complete fallacy, and you should not rely on it.
|
||||
dnl but this is still actually better than imake, honest. -daniels
|
||||
|
||||
AC_TRY_COMPILE([
|
||||
#include <features.h>
|
||||
|
|
|
@ -10,10 +10,6 @@ if TSLIB
|
|||
TSLIB_C = tslib.c
|
||||
endif
|
||||
|
||||
if H3600_TS
|
||||
TS_C = ts.c
|
||||
endif
|
||||
|
||||
if KDRIVE_HW
|
||||
KDRIVE_HW_SOURCES = \
|
||||
agp.c \
|
||||
|
@ -30,5 +26,4 @@ liblinux_a_SOURCES = \
|
|||
ms.c \
|
||||
ps2.c \
|
||||
$(KDRIVE_HW_SOURCES) \
|
||||
$(TSLIB_C) \
|
||||
$(TS_C)
|
||||
$(TSLIB_C)
|
||||
|
|
|
@ -1,209 +0,0 @@
|
|||
/*
|
||||
* Derived from ps2.c by Jim Gettys
|
||||
*
|
||||
* Copyright © 1999 Keith Packard
|
||||
* Copyright © 2000 Compaq Computer Corporation
|
||||
*
|
||||
* 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 or Compaq not be used in
|
||||
* advertising or publicity pertaining to distribution of the software without
|
||||
* specific, written prior permission. Keith Packard and Compaq makes no
|
||||
* representations about the suitability of this software for any purpose. It
|
||||
* is provided "as is" without express or implied warranty.
|
||||
*
|
||||
* KEITH PACKARD AND COMPAQ DISCLAIM 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.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <kdrive-config.h>
|
||||
#endif
|
||||
#define NEED_EVENTS
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/Xpoll.h>
|
||||
#include "inputstr.h"
|
||||
#include "scrnintstr.h"
|
||||
#include "kdrive.h"
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/h3600_ts.h> /* touch screen events */
|
||||
|
||||
static long lastx = 0, lasty = 0;
|
||||
|
||||
int KdTsPhyScreen = 0;
|
||||
|
||||
static int
|
||||
TsReadBytes (int fd, char *buf, int len, int min)
|
||||
{
|
||||
int n, tot;
|
||||
fd_set set;
|
||||
struct timeval tv;
|
||||
|
||||
tot = 0;
|
||||
while (len)
|
||||
{
|
||||
n = read (fd, buf, len);
|
||||
if (n > 0)
|
||||
{
|
||||
tot += n;
|
||||
buf += n;
|
||||
len -= n;
|
||||
}
|
||||
if (tot % min == 0)
|
||||
break;
|
||||
FD_ZERO (&set);
|
||||
FD_SET (fd, &set);
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 100 * 1000;
|
||||
n = select (fd + 1, &set, 0, 0, &tv);
|
||||
if (n <= 0)
|
||||
break;
|
||||
}
|
||||
return tot;
|
||||
}
|
||||
|
||||
static void
|
||||
TsRead (int tsPort, void *closure)
|
||||
{
|
||||
KdPointerInfo *pi = closure;
|
||||
TS_EVENT event;
|
||||
int n;
|
||||
long x, y;
|
||||
unsigned long flags;
|
||||
|
||||
n = TsReadBytes (tsPort, (char *) &event, sizeof (event), sizeof (event));
|
||||
if (n == sizeof (event))
|
||||
{
|
||||
if (event.pressure)
|
||||
{
|
||||
/*
|
||||
* HACK ATTACK. (static global variables used !)
|
||||
* Here we test for the touch screen driver actually being on the
|
||||
* touch screen, if it is we send absolute coordinates. If not,
|
||||
* then we send delta's so that we can track the entire vga screen.
|
||||
*/
|
||||
if (KdCurScreen == KdTsPhyScreen) {
|
||||
flags = KD_BUTTON_1;
|
||||
x = event.x;
|
||||
y = event.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
flags = /* KD_BUTTON_1 |*/ KD_MOUSE_DELTA;
|
||||
if ((lastx == 0) || (lasty == 0)) {
|
||||
x = 0;
|
||||
y = 0;
|
||||
} else {
|
||||
x = event.x - lastx;
|
||||
y = event.y - lasty;
|
||||
}
|
||||
lastx = event.x;
|
||||
lasty = event.y;
|
||||
}
|
||||
} else {
|
||||
flags = KD_MOUSE_DELTA;
|
||||
x = 0;
|
||||
y = 0;
|
||||
lastx = 0;
|
||||
lasty = 0;
|
||||
}
|
||||
KdEnqueuePointerEvent (pi, flags, x, y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
char *TsNames[] = {
|
||||
"/dev/ts",
|
||||
"/dev/h3600_ts" /* temporary name; note this code can try
|
||||
to open more than one device */
|
||||
};
|
||||
|
||||
#define NUM_TS_NAMES (sizeof (TsNames) / sizeof (TsNames[0]))
|
||||
|
||||
static Status
|
||||
TsInit (KdPointerInfo *pi)
|
||||
{
|
||||
int i;
|
||||
int fd;
|
||||
int n = 0;
|
||||
|
||||
if (!pi->path || strcmp(pi->path, "auto") == 0) {
|
||||
for (i = 0; i < NUM_TS_NAMES; i++) {
|
||||
fd = open (TsNames[i], 0);
|
||||
if (fd >= 0) {
|
||||
pi->path = KdSaveString (TsNames[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
fd = open (pi->path, 0);
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
ErrorF("TsInit: Couldn't open %s\n", pi->path);
|
||||
return BadMatch;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
pi->name = KdSaveString("H3600 Touchscreen");
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static Status
|
||||
TsEnable (KdPointerInfo *pi)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (!pi || !pi->path)
|
||||
return BadImplementation;
|
||||
|
||||
fd = open(pi->path, 0);
|
||||
|
||||
if (fd < 0) {
|
||||
ErrorF("TsInit: Couldn't open %s\n", pi->path);
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
struct h3600_ts_calibration cal;
|
||||
/*
|
||||
* Check to see if this is a touch screen
|
||||
*/
|
||||
if (ioctl (fd, TS_GET_CAL, &cal) != -1) {
|
||||
mi->driverPrivate = (void *) fd;
|
||||
if (!KdRegisterFd (fd, TsRead, (void *) mi)) {
|
||||
close(fd);
|
||||
return BadAlloc;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ErrorF("TsEnable: %s is not a touchscreen\n", pi->path);
|
||||
close (fd);
|
||||
return BadMatch;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static void
|
||||
TsFini (KdPointerInfo *pi)
|
||||
{
|
||||
KdUnregisterFds (pi, (int)pi->driverPrivate, TRUE);
|
||||
mi->driverPrivate = NULL;
|
||||
}
|
||||
|
||||
KdPointerDriver TsDriver = {
|
||||
TsInit,
|
||||
TsEnable,
|
||||
TsDisable,
|
||||
TsFini,
|
||||
NULL,
|
||||
};
|
|
@ -1385,6 +1385,11 @@ KdInitOutput (ScreenInfo *pScreenInfo,
|
|||
signal(SIGSEGV, KdBacktrace);
|
||||
}
|
||||
|
||||
void
|
||||
OsVendorFatalError(void)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DPMSExtension
|
||||
int
|
||||
DPMSSet(ClientPtr client, int level)
|
||||
|
|
|
@ -27,29 +27,12 @@
|
|||
/* Support Composite Extension */
|
||||
#undef COMPOSITE
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Support Damage extension */
|
||||
#undef DAMAGE
|
||||
|
||||
/* Build for darwin with Quartz support */
|
||||
#undef DARWIN_WITH_QUARTZ
|
||||
|
||||
/* Use OsVendorInit */
|
||||
#undef DDXOSINIT
|
||||
|
||||
/* Use GetTimeInMillis */
|
||||
#undef DDXTIME
|
||||
|
||||
/* Use OsVendorFatalError */
|
||||
#undef DDXOSFATALERROR
|
||||
|
||||
/* Use OsVendorVErrorF */
|
||||
#undef DDXOSVERRORF
|
||||
|
||||
|
@ -68,9 +51,6 @@
|
|||
/* Path to DRI drivers */
|
||||
#undef DRI_DRIVER_PATH
|
||||
|
||||
/* Include handhelds.org h3600 touchscreen driver */
|
||||
#undef H3600_TS
|
||||
|
||||
/* Support XDM-AUTH*-1 */
|
||||
#undef HASXDMAUTH
|
||||
|
||||
|
@ -92,13 +72,6 @@
|
|||
/* Support SHM */
|
||||
#undef HAS_SHM
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define to 1 if you have the <asm/mtrr.h> header file. */
|
||||
#undef HAVE_ASM_MTRR_H
|
||||
|
||||
|
@ -130,12 +103,6 @@
|
|||
/* Define to 1 if you have the `getisax' function. */
|
||||
#undef HAVE_GETISAX
|
||||
|
||||
/* Define to 1 if you have the `getopt' function. */
|
||||
#undef HAVE_GETOPT
|
||||
|
||||
/* Define to 1 if you have the `getopt_long' function. */
|
||||
#undef HAVE_GETOPT_LONG
|
||||
|
||||
/* Define to 1 if you have the `getuid' function. */
|
||||
#undef HAVE_GETUID
|
||||
|
||||
|
@ -166,18 +133,6 @@
|
|||
/* Define to 1 if you have the <linux/fb.h> header file. */
|
||||
#undef HAVE_LINUX_FB_H
|
||||
|
||||
/* Define to 1 if you have the <linux/h3600_ts.h> header file. */
|
||||
#undef HAVE_LINUX_H3600_TS_H
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
|
@ -300,17 +255,6 @@
|
|||
/* Include time-based scheduler */
|
||||
#undef SMART_SCHEDULE
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 on systems derived from System V Release 4 */
|
||||
#undef SVR4
|
||||
|
||||
|
@ -392,9 +336,6 @@
|
|||
/* Build XvMC Extension */
|
||||
#undef XvMCExtension
|
||||
|
||||
/* Build XRes extension */
|
||||
#undef XResExtension
|
||||
|
||||
/* Support XSync extension */
|
||||
#undef XSYNC
|
||||
|
||||
|
@ -453,9 +394,6 @@
|
|||
/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */
|
||||
#undef BSD44SOCKETS
|
||||
|
||||
/* Define to 1 if modules should avoid the libcwrapper */
|
||||
#undef NO_LIBCWRAPPER
|
||||
|
||||
/* Support D-Bus */
|
||||
#undef HAVE_DBUS
|
||||
|
||||
|
|
|
@ -18,12 +18,6 @@
|
|||
/* Current X.Org version. */
|
||||
#undef XORG_VERSION_CURRENT
|
||||
|
||||
/* Need XFree86 libc-replacement typedefs. */
|
||||
#undef NEED_XF86_TYPES
|
||||
|
||||
/* Need XFree86 libc-replacement functions. */
|
||||
#undef NEED_XF86_PROTOTYPES
|
||||
|
||||
/* Name of X server. */
|
||||
#undef __XSERVERNAME__
|
||||
|
||||
|
|
|
@ -25,18 +25,12 @@
|
|||
/* Support Composite Extension */
|
||||
#undef COMPOSITE
|
||||
|
||||
/* Use OsVendorInit */
|
||||
#undef DDXOSINIT
|
||||
|
||||
/* Build DPMS extension */
|
||||
#undef DPMSExtension
|
||||
|
||||
/* Build GLX extension */
|
||||
#undef GLXEXT
|
||||
|
||||
/* Include handhelds.org h3600 touchscreen driver */
|
||||
#undef H3600_TS
|
||||
|
||||
/* Support XDM-AUTH*-1 */
|
||||
#undef HASXDMAUTH
|
||||
|
||||
|
@ -49,12 +43,6 @@
|
|||
/* Support MIT-SHM Extension */
|
||||
#undef MITSHM
|
||||
|
||||
/* Need XFree86 helper functions */
|
||||
#undef NEED_XF86_PROTOTYPES
|
||||
|
||||
/* Need XFree86 typedefs */
|
||||
#undef NEED_XF86_TYPES
|
||||
|
||||
/* Internal define for Xinerama */
|
||||
#undef PANORAMIX
|
||||
|
||||
|
@ -148,9 +136,6 @@
|
|||
/* Build XvMC Extension */
|
||||
#undef XvMCExtension
|
||||
|
||||
/* Build XRes extension */
|
||||
#undef XResExtension
|
||||
|
||||
/* Support XSync extension */
|
||||
#undef XSYNC
|
||||
|
||||
|
|
2
os/log.c
2
os/log.c
|
@ -524,10 +524,8 @@ FatalError(const char *f, ...)
|
|||
VErrorF(f, args);
|
||||
va_end(args);
|
||||
ErrorF("\n");
|
||||
#ifdef DDXOSFATALERROR
|
||||
if (!beenhere)
|
||||
OsVendorFatalError();
|
||||
#endif
|
||||
if (!beenhere) {
|
||||
beenhere = TRUE;
|
||||
AbortServer();
|
||||
|
|
|
@ -193,9 +193,7 @@ OsInit(void)
|
|||
been_here = TRUE;
|
||||
}
|
||||
TimerInit();
|
||||
#ifdef DDXOSINIT
|
||||
OsVendorInit();
|
||||
#endif
|
||||
/*
|
||||
* No log file by default. OsVendorInit() should call LogInit() with the
|
||||
* log file name if logging to a file is desired.
|
||||
|
|
Loading…
Reference in New Issue
Block a user