remove trailing whitespace

Whitespace police in full effect.
This commit is contained in:
Daniel Stone 2006-11-08 15:36:47 +02:00 committed by Daniel Stone
parent 2035f115b7
commit e7900d68c3
3 changed files with 109 additions and 109 deletions

View File

@ -168,7 +168,7 @@ updateMotionHistory(DeviceIntPtr pDev, CARD32 ms, int first_valuator,
pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) % pDev->valuator->last_motion = (pDev->valuator->last_motion + 1) %
pDev->valuator->numMotionEvents; pDev->valuator->numMotionEvents;
/* If we're wrapping around, just keep the circular buffer going. */ /* If we're wrapping around, just keep the circular buffer going. */
if (pDev->valuator->first_motion == pDev->valuator->last_motion) if (pDev->valuator->first_motion == pDev->valuator->last_motion)
pDev->valuator->first_motion = (pDev->valuator->first_motion + 1) % pDev->valuator->first_motion = (pDev->valuator->first_motion + 1) %
@ -745,7 +745,7 @@ SwitchCoreKeyboard(DeviceIntPtr pDev)
* Currently a no-op. * Currently a no-op.
* *
* Call this just before processInputProc. * Call this just before processInputProc.
*/ */
_X_EXPORT void _X_EXPORT void
SwitchCorePointer(DeviceIntPtr pDev) SwitchCorePointer(DeviceIntPtr pDev)
{ {

View File

@ -372,7 +372,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
#endif #endif
/* Okay the message made it to the ddx. The common layer */ /* Okay the message made it to the ddx. The common layer */
/* can check for relevant messages here and react to any */ /* can check for relevant messages here and react to any */
/* that have a global effect. For example: */ /* that have a global effect. For example: */
/* */ /* */
/* if (!strcmp(message, "foo") { */ /* if (!strcmp(message, "foo") { */
/* do_foo(); break */ /* do_foo(); break */
@ -457,9 +457,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
if (pInfo->read_input && pInfo->fd >= 0 && if (pInfo->read_input && pInfo->fd >= 0 &&
(FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) {
int sigstate = xf86BlockSIGIO(); int sigstate = xf86BlockSIGIO();
pInfo->read_input(pInfo); pInfo->read_input(pInfo);
xf86UnblockSIGIO(sigstate); xf86UnblockSIGIO(sigstate);
/* /*
* Remove the descriptior from the set because more than one * Remove the descriptior from the set because more than one
* device may share the same file descriptor. * device may share the same file descriptor.
@ -478,9 +478,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
while (pInfo) { while (pInfo) {
if (pInfo->read_input && pInfo->fd >= 0) { if (pInfo->read_input && pInfo->fd >= 0) {
int sigstate = xf86BlockSIGIO(); int sigstate = xf86BlockSIGIO();
pInfo->read_input(pInfo); pInfo->read_input(pInfo);
xf86UnblockSIGIO(sigstate); xf86UnblockSIGIO(sigstate);
/* /*
* Must break here because more than one device may share * Must break here because more than one device may share
* the same file descriptor. * the same file descriptor.
@ -502,7 +502,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
} }
} }
} }
if (xf86VTSwitchPending()) xf86VTSwitch(); if (xf86VTSwitchPending()) xf86VTSwitch();
if (xf86Info.inputPending) ProcessInputEvents(); if (xf86Info.inputPending) ProcessInputEvents();
@ -527,7 +527,7 @@ xf86SigioReadInput(int fd,
/* /*
* xf86AddEnabledDevice -- * xf86AddEnabledDevice --
* *
*/ */
_X_EXPORT void _X_EXPORT void
xf86AddEnabledDevice(InputInfoPtr pInfo) xf86AddEnabledDevice(InputInfoPtr pInfo)
@ -539,7 +539,7 @@ xf86AddEnabledDevice(InputInfoPtr pInfo)
/* /*
* xf86RemoveEnabledDevice -- * xf86RemoveEnabledDevice --
* *
*/ */
_X_EXPORT void _X_EXPORT void
xf86RemoveEnabledDevice(InputInfoPtr pInfo) xf86RemoveEnabledDevice(InputInfoPtr pInfo)
@ -560,7 +560,7 @@ xf86InterceptSignals(int *signo)
static void (*xf86SigIllHandler)(void) = NULL; static void (*xf86SigIllHandler)(void) = NULL;
_X_EXPORT void _X_EXPORT void
xf86InterceptSigIll(void (*sigillhandler)(void)) xf86InterceptSigIll(void (*sigillhandler)(void))
{ {
xf86SigIllHandler = sigillhandler; xf86SigIllHandler = sigillhandler;
@ -608,7 +608,7 @@ static int xorg_backtrace_frame(uintptr_t pc, int signo, void *arg)
ElfSym *dlsym; ElfSym *dlsym;
char header[32]; char header[32];
int depth = *((int *) arg); int depth = *((int *) arg);
if (signo) { if (signo) {
char signame[SIG2STR_MAX]; char signame[SIG2STR_MAX];
@ -621,7 +621,7 @@ static int xorg_backtrace_frame(uintptr_t pc, int signo, void *arg)
snprintf(header, sizeof(header), "%d: 0x%lx", depth, pc); snprintf(header, sizeof(header), "%d: 0x%lx", depth, pc);
*((int *) arg) = depth + 1; *((int *) arg) = depth + 1;
/* Ask system dynamic loader for info on the address */ /* Ask system dynamic loader for info on the address */
if (dladdr1((void *) pc, &dlinfo, (void **) &dlsym, RTLD_DL_SYMENT)) { if (dladdr1((void *) pc, &dlinfo, (void **) &dlsym, RTLD_DL_SYMENT)) {
unsigned long offset = pc - (uintptr_t) dlinfo.dli_saddr; unsigned long offset = pc - (uintptr_t) dlinfo.dli_saddr;
@ -643,7 +643,7 @@ static int xorg_backtrace_frame(uintptr_t pc, int signo, void *arg)
*/ */
ErrorF("%s\n", header); ErrorF("%s\n", header);
} }
return 0; return 0;
} }
# endif /* HAVE_WALKCONTEXT */ # endif /* HAVE_WALKCONTEXT */
@ -686,7 +686,7 @@ static int xorg_backtrace_pstack(void) {
while (!done) { while (!done) {
bytesread = read(pipefd[0], btline, sizeof(btline) - 1); bytesread = read(pipefd[0], btline, sizeof(btline) - 1);
if (bytesread > 0) { if (bytesread > 0) {
btline[bytesread] = 0; btline[bytesread] = 0;
ErrorF("%s", btline); ErrorF("%s", btline);
@ -710,11 +710,11 @@ static int xorg_backtrace_pstack(void) {
static __inline__ void xorg_backtrace(void) { static __inline__ void xorg_backtrace(void) {
ErrorF("\nBacktrace:\n"); ErrorF("\nBacktrace:\n");
# ifdef HAVE_PSTACK # ifdef HAVE_PSTACK
/* First try fork/exec of pstack - otherwise fall back to walkcontext /* First try fork/exec of pstack - otherwise fall back to walkcontext
pstack is preferred since it can print names of non-exported functions */ pstack is preferred since it can print names of non-exported functions */
if (xorg_backtrace_pstack() < 0) if (xorg_backtrace_pstack() < 0)
# endif # endif
{ {
@ -752,7 +752,7 @@ xf86SigHandler(int signo)
(void) signal(signo, xf86SigHandler); (void) signal(signo, xf86SigHandler);
return; return;
} }
if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) { if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
*xf86SignalIntercept = signo; *xf86SignalIntercept = signo;
/* Re-arm handler just in case */ /* Re-arm handler just in case */
@ -767,7 +767,7 @@ xf86SigHandler(int signo)
#endif #endif
xorg_backtrace(); xorg_backtrace();
FatalError("Caught signal %d. Server aborting\n", signo); FatalError("Caught signal %d. Server aborting\n", signo);
} }
@ -854,7 +854,7 @@ xf86VTSwitch()
#ifdef DEBUG #ifdef DEBUG
ErrorF("xf86VTSwitch()\n"); ErrorF("xf86VTSwitch()\n");
#endif #endif
#ifdef XFreeXDGA #ifdef XFreeXDGA
if(!DGAVTSwitch()) if(!DGAVTSwitch())
return; return;
@ -881,9 +881,9 @@ xf86VTSwitch()
} }
#if !defined(__UNIXOS2__) #if !defined(__UNIXOS2__)
/* /*
* Keep the order: Disable Device > LeaveVT * Keep the order: Disable Device > LeaveVT
* EnterVT > EnableDevice * EnterVT > EnableDevice
*/ */
pInfo = xf86InputDevs; pInfo = xf86InputDevs;
while (pInfo) { while (pInfo) {
@ -903,7 +903,7 @@ xf86VTSwitch()
if (!xf86VTSwitchAway()) { if (!xf86VTSwitchAway()) {
/* /*
* switch failed * switch failed
*/ */
#ifdef DEBUG #ifdef DEBUG
@ -1003,7 +1003,7 @@ xf86VTSwitch()
/* XXX HACK */ /* XXX HACK */
xf86ReleaseKeys(inputInfo.keyboard); xf86ReleaseKeys(inputInfo.keyboard);
#endif /* !__UNIXOS2__ */ #endif /* !__UNIXOS2__ */
for (ih = InputHandlers; ih; ih = ih->next) for (ih = InputHandlers; ih; ih = ih->next)
xf86EnableInputHandler(ih); xf86EnableInputHandler(ih);
@ -1039,7 +1039,7 @@ addInputHandler(int fd, InputHandlerProc proc, pointer data)
_X_EXPORT pointer _X_EXPORT pointer
xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data) xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data)
{ {
IHPtr ih = addInputHandler(fd, proc, data); IHPtr ih = addInputHandler(fd, proc, data);
if (ih) if (ih)
@ -1049,7 +1049,7 @@ xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data)
_X_EXPORT pointer _X_EXPORT pointer
xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data) xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data)
{ {
IHPtr ih = addInputHandler(fd, proc, data); IHPtr ih = addInputHandler(fd, proc, data);
if (ih) if (ih)
@ -1079,13 +1079,13 @@ xf86RemoveInputHandler(pointer handler)
{ {
IHPtr ih; IHPtr ih;
int fd; int fd;
if (!handler) if (!handler)
return -1; return -1;
ih = handler; ih = handler;
fd = ih->fd; fd = ih->fd;
if (ih->fd >= 0) if (ih->fd >= 0)
RemoveEnabledDevice(ih->fd); RemoveEnabledDevice(ih->fd);
removeInputHandler(ih); removeInputHandler(ih);
@ -1098,13 +1098,13 @@ xf86RemoveGeneralHandler(pointer handler)
{ {
IHPtr ih; IHPtr ih;
int fd; int fd;
if (!handler) if (!handler)
return -1; return -1;
ih = handler; ih = handler;
fd = ih->fd; fd = ih->fd;
if (ih->fd >= 0) if (ih->fd >= 0)
RemoveGeneralSocket(ih->fd); RemoveGeneralSocket(ih->fd);
removeInputHandler(ih); removeInputHandler(ih);
@ -1193,7 +1193,7 @@ void
xf86ReloadInputDevs(int sig) xf86ReloadInputDevs(int sig)
{ {
InputInfoPtr pInfo; InputInfoPtr pInfo;
signal(sig, (void(*)(int))xf86ReloadInputDevs); signal(sig, (void(*)(int))xf86ReloadInputDevs);
pInfo = xf86InputDevs; pInfo = xf86InputDevs;
@ -1202,7 +1202,7 @@ xf86ReloadInputDevs(int sig)
EnableDevice(pInfo->dev); EnableDevice(pInfo->dev);
pInfo = pInfo->next; pInfo = pInfo->next;
} }
return; return;
} }
@ -1224,7 +1224,7 @@ xf86PostWSKbdEvent(struct wscons_event *event)
int value = event->value; int value = event->value;
unsigned int keycode; unsigned int keycode;
int blocked; int blocked;
if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) { if (type == WSCONS_EVENT_KEY_UP || type == WSCONS_EVENT_KEY_DOWN) {
Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE); Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE);

View File

@ -90,7 +90,7 @@ xf86AddDriver(DriverPtr driver, pointer module, int flags)
else { else {
(void) memset( xf86DriverList[xf86NumDrivers - 1], 0, (void) memset( xf86DriverList[xf86NumDrivers - 1], 0,
sizeof( DriverRec ) ); sizeof( DriverRec ) );
(void) memcpy( xf86DriverList[xf86NumDrivers - 1], driver, (void) memcpy( xf86DriverList[xf86NumDrivers - 1], driver,
sizeof(DriverRec1)); sizeof(DriverRec1));
} }
@ -241,7 +241,7 @@ xf86AllocateScreen(DriverPtr drv, int flags)
#endif #endif
xf86Screens[i]->DriverFunc = drv->driverFunc; xf86Screens[i]->DriverFunc = drv->driverFunc;
return xf86Screens[i]; return xf86Screens[i];
} }
@ -293,7 +293,7 @@ xf86DeleteScreen(int scrnIndex, int flags)
xfree(pScrn); xfree(pScrn);
/* Move the other entries down, updating their scrnIndex fields */ /* Move the other entries down, updating their scrnIndex fields */
xf86NumScreens--; xf86NumScreens--;
for (i = scrnIndex; i < xf86NumScreens; i++) { for (i = scrnIndex; i < xf86NumScreens; i++) {
@ -487,7 +487,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
depth24flags &= ~(SupportConvert32to24 | SupportConvert32to24 | depth24flags &= ~(SupportConvert32to24 | SupportConvert32to24 |
PreferConvert24to32 | PreferConvert32to24); PreferConvert24to32 | PreferConvert32to24);
#endif #endif
if (xf86FbBpp > 0) { if (xf86FbBpp > 0) {
scrp->bitsPerPixel = xf86FbBpp; scrp->bitsPerPixel = xf86FbBpp;
scrp->bitsPerPixelFrom = X_CMDLINE; scrp->bitsPerPixelFrom = X_CMDLINE;
@ -946,7 +946,7 @@ xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
{ {
MessageType from = X_DEFAULT; MessageType from = X_DEFAULT;
#if 0 #if 0
xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC); xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
#endif #endif
if (TEST_GAMMA(xf86Gamma)) { if (TEST_GAMMA(xf86Gamma)) {
from = X_CMDLINE; from = X_CMDLINE;
@ -999,7 +999,7 @@ _X_EXPORT void
xf86SetDpi(ScrnInfoPtr pScrn, int x, int y) xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
{ {
MessageType from = X_DEFAULT; MessageType from = X_DEFAULT;
xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC); xf86MonPtr DDC = (xf86MonPtr)(pScrn->monitor->DDC);
int ddcWidthmm, ddcHeightmm; int ddcWidthmm, ddcHeightmm;
int widthErr, heightErr; int widthErr, heightErr;
@ -1009,7 +1009,7 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0) ) { if (DDC && (DDC->features.hsize > 0 && DDC->features.vsize > 0) ) {
/* DDC gives display size in mm for individual modes, /* DDC gives display size in mm for individual modes,
* but cm for monitor * but cm for monitor
*/ */
ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */ ddcWidthmm = DDC->features.hsize * 10; /* 10mm in 1cm */
ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */ ddcHeightmm = DDC->features.vsize * 10; /* 10mm in 1cm */
@ -1053,7 +1053,7 @@ xf86SetDpi(ScrnInfoPtr pScrn, int x, int y)
if (widthErr>10 || heightErr>10) { if (widthErr>10 || heightErr>10) {
/* Should include config file name for monitor here */ /* Should include config file name for monitor here */
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n", "Probed monitor is %dx%d mm, using Displaysize %dx%d mm\n",
ddcWidthmm,ddcHeightmm, pScrn->widthmm,pScrn->heightmm); ddcWidthmm,ddcHeightmm, pScrn->widthmm,pScrn->heightmm);
} }
} }
@ -1149,7 +1149,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
pWin->valdata->before.resized = TRUE; pWin->valdata->before.resized = TRUE;
} }
} }
/* /*
* Use REGION_BREAK to avoid optimizations in ValidateTree * Use REGION_BREAK to avoid optimizations in ValidateTree
* that assume the root borderClip can't change well, normally * that assume the root borderClip can't change well, normally
@ -1174,9 +1174,9 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
REGION_EMPTY(pScreen, &pWin->borderClip); REGION_EMPTY(pScreen, &pWin->borderClip);
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
} }
ResizeChildrenWinSize (pWin, 0, 0, 0, 0); ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
if (WasViewable) if (WasViewable)
{ {
if (pWin->backStorage) if (pWin->backStorage)
@ -1221,7 +1221,7 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
if (bsExposed) if (bsExposed)
{ {
RegionPtr valExposed = NullRegion; RegionPtr valExposed = NullRegion;
if (pWin->valdata) if (pWin->valdata)
valExposed = &pWin->valdata->after.exposed; valExposed = &pWin->valdata->after.exposed;
(*pScreen->WindowExposures) (pWin, valExposed, bsExposed); (*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
@ -1280,7 +1280,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
*/ */
pspix->devPrivate = pScrnInfo->pixmapPrivate; pspix->devPrivate = pScrnInfo->pixmapPrivate;
/* /*
* Restore all of the clip lists on the screen * Restore all of the clip lists on the screen
*/ */
if (!xf86Resetting) if (!xf86Resetting)
xf86SetRootClip (pScreen, TRUE); xf86SetRootClip (pScreen, TRUE);
@ -1289,7 +1289,7 @@ xf86EnableDisableFBAccess(int scrnIndex, Bool enable)
else else
{ {
/* /*
* Empty all of the clip lists on the screen * Empty all of the clip lists on the screen
*/ */
xf86SetRootClip (pScreen, FALSE); xf86SetRootClip (pScreen, FALSE);
/* /*
@ -1410,7 +1410,7 @@ xf86LogInit()
#define LOGSUFFIX ".log" #define LOGSUFFIX ".log"
#define LOGOLDSUFFIX ".old" #define LOGOLDSUFFIX ".old"
/* Get the log file name */ /* Get the log file name */
if (xf86LogFileFrom == X_DEFAULT) { if (xf86LogFileFrom == X_DEFAULT) {
/* Append the display number and ".log" */ /* Append the display number and ".log" */
@ -1538,7 +1538,7 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
*sectlist = NULL; *sectlist = NULL;
if (xf86DoProbe) return 1; if (xf86DoProbe) return 1;
if (xf86DoConfigure && xf86DoConfigurePass1) return 1; if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
/* /*
@ -1546,18 +1546,18 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
* as they show up in the config file with the drivers that the server * as they show up in the config file with the drivers that the server
* loads at run time. * loads at run time.
* *
* ChipProbe can call * ChipProbe can call
* int xf86MatchDevice(char * drivername, GDevPtr ** sectlist) * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist)
* with its driver name. The function allocates an array of GDevPtr and * with its driver name. The function allocates an array of GDevPtr and
* returns this via sectlist and returns the number of elements in * returns this via sectlist and returns the number of elements in
* this list as return value. 0 means none found, -1 means fatal error. * this list as return value. 0 means none found, -1 means fatal error.
* *
* It can figure out which of the Device sections to use for which card * It can figure out which of the Device sections to use for which card
* (using things like the Card statement, etc). For single headed servers * (using things like the Card statement, etc). For single headed servers
* there will of course be just one such Device section. * there will of course be just one such Device section.
*/ */
i = 0; i = 0;
/* /*
* first we need to loop over all the Screens sections to get to all * first we need to loop over all the Screens sections to get to all
* 'active' device sections * 'active' device sections
@ -1587,7 +1587,7 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
} }
j++; j++;
} }
/* /*
* make the array NULL terminated and return its address * make the array NULL terminated and return its address
*/ */
@ -1613,7 +1613,7 @@ struct Inst {
/** /**
* Find set of unclaimed devices matching a given vendor ID. * Find set of unclaimed devices matching a given vendor ID.
* *
* Used by drivers to find as yet unclaimed devices matching the specified * Used by drivers to find as yet unclaimed devices matching the specified
* vendor ID. * vendor ID.
* *
@ -1629,7 +1629,7 @@ struct Inst {
* \param drvp Pointer the driver's control structure. * \param drvp Pointer the driver's control structure.
* \param foundEntities Returned list of entity indicies associated with the * \param foundEntities Returned list of entity indicies associated with the
* driver. * driver.
* *
* \returns * \returns
* The number of elements in returned in \c foundEntities on success or zero * The number of elements in returned in \c foundEntities on success or zero
* on failure. * on failure.
@ -1644,7 +1644,7 @@ struct Inst {
* that parameter. * that parameter.
*/ */
_X_EXPORT int _X_EXPORT int
xf86MatchPciInstances(const char *driverName, int vendorID, xf86MatchPciInstances(const char *driverName, int vendorID,
SymTabPtr chipsets, PciChipsets *PCIchipsets, SymTabPtr chipsets, PciChipsets *PCIchipsets,
GDevPtr *devList, int numDevs, DriverPtr drvp, GDevPtr *devList, int numDevs, DriverPtr drvp,
int **foundEntities) int **foundEntities)
@ -1723,7 +1723,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
foundVendor = TRUE; foundVendor = TRUE;
} }
if ( (device_id == pPci->chipType) if ( (device_id == pPci->chipType)
|| ((vendorID == PCI_VENDOR_GENERIC) || ((vendorID == PCI_VENDOR_GENERIC)
&& (match_class == device_class)) ) { && (match_class == device_class)) ) {
if ( instances != NULL ) { if ( instances != NULL ) {
instances[allocatedInstances - 1].foundHW = TRUE; instances[allocatedInstances - 1].foundHW = TRUE;
@ -1734,7 +1734,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
if ( xf86DoConfigure && xf86DoConfigurePass1 ) { if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
if ( xf86CheckPciSlot(pPci->bus, pPci->device, if ( xf86CheckPciSlot(pPci->bus, pPci->device,
pPci->func) ) { pPci->func) ) {
GDevPtr pGDev = GDevPtr pGDev =
xf86AddDeviceToConfigure( drvp->driverName, xf86AddDeviceToConfigure( drvp->driverName,
pPci, -1 ); pPci, -1 );
if (pGDev) { if (pGDev) {
@ -1792,7 +1792,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
*/ */
for (j = 0; j < numDevs; j++) { for (j = 0; j < numDevs; j++) {
if (devList[j]->screen > 0 && devList[j]->busID if (devList[j]->screen > 0 && devList[j]->busID
&& *devList[j]->busID) { && *devList[j]->busID) {
for (i = 0; i < allocatedInstances; i++) { for (i = 0; i < allocatedInstances; i++) {
pPci = instances[i].pci; pPci = instances[i].pci;
@ -1821,7 +1821,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
pPci->device, pPci->device,
pPci->func) && pPci->func) &&
devList[j]->screen == instances[i].screen) { devList[j]->screen == instances[i].screen) {
if (devBus) if (devBus)
xf86MsgVerb(X_WARNING,0, xf86MsgVerb(X_WARNING,0,
"%s: More than one matching Device section for " "%s: More than one matching Device section for "
@ -1830,10 +1830,10 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
devList[j]->identifier); devList[j]->identifier);
else else
devBus = devList[j]; devBus = devList[j];
} }
} else { } else {
/* /*
* if device section without BusID is found * if device section without BusID is found
* only assign to it to the primary device. * only assign to it to the primary device.
*/ */
if (xf86IsPrimaryPci(pPci)) { if (xf86IsPrimaryPci(pPci)) {
@ -1848,7 +1848,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
} }
} }
} }
if (devBus) dev = devBus; /* busID preferred */ if (devBus) dev = devBus; /* busID preferred */
if (!dev) { if (!dev) {
if (xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) { if (xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func)) {
xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section " xf86MsgVerb(X_WARNING, 0, "%s: No matching Device section "
@ -2068,7 +2068,7 @@ xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
dev->identifier); dev->identifier);
} else } else
foundChip = c->token; foundChip = c->token;
} else { } else {
if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev); if (FindIsaDevice) foundChip = (*FindIsaDevice)(dev);
/* Probe it */ /* Probe it */
from = X_PROBED; from = X_PROBED;
@ -2079,7 +2079,7 @@ xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
if (foundChip >= 0){ if (foundChip >= 0){
for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) { for (Chips = ISAchipsets; Chips->numChipset >= 0; Chips++) {
if (Chips->numChipset == foundChip) if (Chips->numChipset == foundChip)
break; break;
} }
if (Chips->numChipset == -1){ if (Chips->numChipset == -1){
@ -2102,7 +2102,7 @@ xf86MatchIsaInstances(const char *driverName, SymTabPtr chipsets,
} }
} }
*foundEntities = retEntities; *foundEntities = retEntities;
return numFound; return numFound;
} }
@ -2126,7 +2126,7 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
if (num > MAXCLOCKS) if (num > MAXCLOCKS)
num = MAXCLOCKS; num = MAXCLOCKS;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if (ProtectRegs) if (ProtectRegs)
(*ProtectRegs)(pScrn, TRUE); (*ProtectRegs)(pScrn, TRUE);
@ -2139,7 +2139,7 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
(*ProtectRegs)(pScrn, FALSE); (*ProtectRegs)(pScrn, FALSE);
if (BlankScreen) if (BlankScreen)
(*BlankScreen)(pScrn, FALSE); (*BlankScreen)(pScrn, FALSE);
usleep(50000); /* let VCO stabilise */ usleep(50000); /* let VCO stabilise */
cnt = 0; cnt = 0;
@ -2153,25 +2153,25 @@ xf86GetClocks(ScrnInfoPtr pScrn, int num, Bool (*ClockFunc)(ScrnInfoPtr, int),
ErrorF("your OS does not support disabling interrupts, then you\n"); ErrorF("your OS does not support disabling interrupts, then you\n");
FatalError("must specify a Clocks line in the XF86Config file.\n"); FatalError("must specify a Clocks line in the XF86Config file.\n");
} }
while ((inb(status) & maskval) == 0x00) while ((inb(status) & maskval) == 0x00)
if (sync-- == 0) goto finish; if (sync-- == 0) goto finish;
/* Something appears to be happening, so reset sync count */ /* Something appears to be happening, so reset sync count */
sync = 200000; sync = 200000;
while ((inb(status) & maskval) == maskval) while ((inb(status) & maskval) == maskval)
if (sync-- == 0) goto finish; if (sync-- == 0) goto finish;
/* Something appears to be happening, so reset sync count */ /* Something appears to be happening, so reset sync count */
sync = 200000; sync = 200000;
while ((inb(status) & maskval) == 0x00) while ((inb(status) & maskval) == 0x00)
if (sync-- == 0) goto finish; if (sync-- == 0) goto finish;
for (rcnt = 0; rcnt < 5; rcnt++) for (rcnt = 0; rcnt < 5; rcnt++)
{ {
while (!(inb(status) & maskval)) while (!(inb(status) & maskval))
cnt++; cnt++;
while ((inb(status) & maskval)) while ((inb(status) & maskval))
cnt++; cnt++;
} }
finish: finish:
xf86EnableInterrupts(); xf86EnableInterrupts();
@ -2182,7 +2182,7 @@ finish:
xf86SetPriority(FALSE); xf86SetPriority(FALSE);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if (i != knownclkindex) if (i != knownclkindex)
{ {
@ -2190,10 +2190,10 @@ finish:
{ {
pScrn->clock[i] = 0; pScrn->clock[i] = 0;
} }
else else
{ {
pScrn->clock[i] = (int)(0.5 + pScrn->clock[i] = (int)(0.5 +
(((float)knownclkvalue) * pScrn->clock[knownclkindex]) / (((float)knownclkvalue) * pScrn->clock[knownclkindex]) /
(pScrn->clock[i])); (pScrn->clock[i]));
/* Round to nearest 10KHz */ /* Round to nearest 10KHz */
pScrn->clock[i] += 5; pScrn->clock[i] += 5;
@ -2204,7 +2204,7 @@ finish:
} }
pScrn->clock[knownclkindex] = knownclkvalue; pScrn->clock[knownclkindex] = knownclkvalue;
pScrn->numClocks = num; pScrn->numClocks = num;
/* Restore registers that were written on */ /* Restore registers that were written on */
(*ClockFunc)(pScrn, CLK_REG_RESTORE); (*ClockFunc)(pScrn, CLK_REG_RESTORE);
@ -2425,17 +2425,17 @@ xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name)
/* /*
* xf86LoadOneModule loads a single module. * xf86LoadOneModule loads a single module.
*/ */
_X_EXPORT pointer _X_EXPORT pointer
xf86LoadOneModule(char *name, pointer opt) xf86LoadOneModule(char *name, pointer opt)
{ {
int errmaj, errmin; int errmaj, errmin;
char *Name; char *Name;
pointer mod; pointer mod;
if (!name) if (!name)
return NULL; return NULL;
#ifndef NORMALISE_MODULE_NAME #ifndef NORMALISE_MODULE_NAME
Name = xstrdup(name); Name = xstrdup(name);
#else #else
@ -2507,7 +2507,7 @@ static const OptionInfoRec BSOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE } { -1, NULL, OPTV_NONE, {0}, FALSE }
}; };
_X_EXPORT void _X_EXPORT void
xf86SetBackingStore(ScreenPtr pScreen) xf86SetBackingStore(ScreenPtr pScreen)
{ {
Bool useBS = FALSE; Bool useBS = FALSE;
@ -2547,7 +2547,7 @@ static const OptionInfoRec SMOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE } { -1, NULL, OPTV_NONE, {0}, FALSE }
}; };
_X_EXPORT void _X_EXPORT void
xf86SetSilkenMouse (ScreenPtr pScreen) xf86SetSilkenMouse (ScreenPtr pScreen)
{ {
Bool useSM = TRUE; Bool useSM = TRUE;
@ -2558,12 +2558,12 @@ xf86SetSilkenMouse (ScreenPtr pScreen)
options = xnfalloc(sizeof(SMOptions)); options = xnfalloc(sizeof(SMOptions));
(void)memcpy(options, SMOptions, sizeof(SMOptions)); (void)memcpy(options, SMOptions, sizeof(SMOptions));
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
/* check for commandline option here */ /* check for commandline option here */
/* disable if screen shares resources */ /* disable if screen shares resources */
if (((pScrn->racMemFlags & RAC_CURSOR) && if (((pScrn->racMemFlags & RAC_CURSOR) &&
!xf86NoSharedResources(pScrn->scrnIndex,MEM)) || !xf86NoSharedResources(pScrn->scrnIndex,MEM)) ||
((pScrn->racIoFlags & RAC_CURSOR) && ((pScrn->racIoFlags & RAC_CURSOR) &&
!xf86NoSharedResources(pScrn->scrnIndex,IO))) { !xf86NoSharedResources(pScrn->scrnIndex,IO))) {
useSM = FALSE; useSM = FALSE;
from = X_PROBED; from = X_PROBED;
@ -2632,7 +2632,7 @@ xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
IsaChipsets *i_id; IsaChipsets *i_id;
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return pScrn; if (!pEnt) return pScrn;
if (!(pEnt->location.type == BUS_ISA)) { if (!(pEnt->location.type == BUS_ISA)) {
xfree(pEnt); xfree(pEnt);
return pScrn; return pScrn;
@ -2646,7 +2646,7 @@ xf86ConfigIsaEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
} }
if (!pScrn) if (!pScrn)
pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
xf86AddEntityToScreen(pScrn,entityIndex); xf86AddEntityToScreen(pScrn,entityIndex);
if (i_chip) { if (i_chip) {
@ -2671,7 +2671,7 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return pScrn; if (!pEnt) return pScrn;
if (!(pEnt->location.type == BUS_PCI) if (!(pEnt->location.type == BUS_PCI)
|| !xf86GetPciInfoForEntity(entityIndex)) { || !xf86GetPciInfoForEntity(entityIndex)) {
xfree(pEnt); xfree(pEnt);
return pScrn; return pScrn;
@ -2708,12 +2708,12 @@ xf86ConfigPciEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
_X_EXPORT ScrnInfoPtr _X_EXPORT ScrnInfoPtr
xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
EntityProc init, EntityProc enter, EntityProc leave, EntityProc init, EntityProc enter, EntityProc leave,
pointer private) pointer private)
{ {
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return pScrn; if (!pEnt) return pScrn;
if (!(pEnt->location.type == BUS_NONE)) { if (!(pEnt->location.type == BUS_NONE)) {
xfree(pEnt); xfree(pEnt);
return pScrn; return pScrn;
@ -2726,7 +2726,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex,
} }
if (!pScrn) if (!pScrn)
pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag); pScrn = xf86AllocateScreen(pEnt->driver,scrnFlag);
xf86AddEntityToScreen(pScrn,entityIndex); xf86AddEntityToScreen(pScrn,entityIndex);
xf86SetEntityFuncs(entityIndex,init,enter,leave,private); xf86SetEntityFuncs(entityIndex,init,enter,leave,private);
@ -2748,14 +2748,14 @@ xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
IsaChipsets *i_id; IsaChipsets *i_id;
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return FALSE; if (!pEnt) return FALSE;
if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) { if (!pEnt->active || !(pEnt->location.type == BUS_ISA)) {
xfree(pEnt); xfree(pEnt);
return FALSE; return FALSE;
} }
xf86AddEntityToScreen(pScrn,entityIndex); xf86AddEntityToScreen(pScrn,entityIndex);
if (i_chip) { if (i_chip) {
for (i_id = i_chip; i_id->numChipset != -1; i_id++) { for (i_id = i_chip; i_id->numChipset != -1; i_id++) {
if (pEnt->chipset == i_id->numChipset) break; if (pEnt->chipset == i_id->numChipset) break;
@ -2766,10 +2766,10 @@ xf86ConfigActiveIsaEntity(ScrnInfoPtr pScrn, int entityIndex,
xf86ClaimFixedResources(res,entityIndex); xf86ClaimFixedResources(res,entityIndex);
if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
_X_EXPORT Bool _X_EXPORT Bool
xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
PciChipsets *p_chip, resList res, EntityProc init, PciChipsets *p_chip, resList res, EntityProc init,
@ -2778,13 +2778,13 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
PciChipsets *p_id; PciChipsets *p_id;
EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex); EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
if (!pEnt) return FALSE; if (!pEnt) return FALSE;
if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) { if (!pEnt->active || !(pEnt->location.type == BUS_PCI)) {
xfree(pEnt); xfree(pEnt);
return FALSE; return FALSE;
} }
xf86AddEntityToScreen(pScrn,entityIndex); xf86AddEntityToScreen(pScrn,entityIndex);
if (p_chip) { if (p_chip) {
for (p_id = p_chip; p_id->numChipset != -1; p_id++) { for (p_id = p_chip; p_id->numChipset != -1; p_id++) {
if (pEnt->chipset == p_id->numChipset) break; if (pEnt->chipset == p_id->numChipset) break;
@ -2792,11 +2792,11 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex,
xf86ClaimFixedResources(p_id->resList,entityIndex); xf86ClaimFixedResources(p_id->resList,entityIndex);
} }
xfree(pEnt); xfree(pEnt);
xf86ClaimFixedResources(res,entityIndex); xf86ClaimFixedResources(res,entityIndex);
if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private)) if (!xf86SetEntityFuncs(entityIndex,init,enter,leave,private))
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -2852,7 +2852,7 @@ xf86ConfigIsaEntityInactive(EntityInfoPtr pEnt, IsaChipsets *i_chip,
} }
void void
xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init, xf86ConfigFbEntityInactive(EntityInfoPtr pEnt, EntityProc init,
EntityProc enter, EntityProc leave, pointer private) EntityProc enter, EntityProc leave, pointer private)
{ {
ScrnInfoPtr pScrn; ScrnInfoPtr pScrn;
@ -2921,7 +2921,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
pNewProp->format = format; pNewProp->format = format;
pNewProp->size = len; pNewProp->size = len;
pNewProp->data = value; pNewProp->data = value;
#ifdef DEBUG #ifdef DEBUG
ErrorF("new property filled\n"); ErrorF("new property filled\n");
#endif #endif
@ -2963,7 +2963,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
#ifdef DEBUG #ifdef DEBUG
ErrorF("xf86RegisterRootWindowProperty succeeded\n"); ErrorF("xf86RegisterRootWindowProperty succeeded\n");
#endif #endif
return(Success); return(Success);
} }
_X_EXPORT Bool _X_EXPORT Bool