Commit 9a0f25de authored by Adam Jackson's avatar Adam Jackson

Static cleanups, dead code deletion.

parent ac235684
......@@ -37,7 +37,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
extern int IReqCode;
extern int BadDevice;
extern int BadEvent;
extern int BadMode;
extern int DeviceBusy;
extern int BadClass;
......
......@@ -116,7 +116,7 @@ int ExtEventIndex;
Mask ExtValidMasks[EMASKSIZE];
Mask ExtExclusiveMasks[EMASKSIZE];
struct dev_type
static struct dev_type
{
Atom type;
char *name;
......@@ -152,7 +152,7 @@ XExtEventInfo EventInfo[32];
int IReqCode = 0;
int BadDevice = 0;
int BadEvent = 1;
static int BadEvent = 1;
int BadMode = 2;
int DeviceBusy = 3;
int BadClass = 4;
......
......@@ -48,7 +48,7 @@
#include "compint.h"
void
static void
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure)
{
WindowPtr pWin = (WindowPtr) closure;
......
......@@ -50,10 +50,10 @@
#include "compint.h"
static CARD8 CompositeReqCode;
int CompositeClientPrivateIndex;
static int CompositeClientPrivateIndex;
RESTYPE CompositeClientWindowType;
RESTYPE CompositeClientSubwindowsType;
RESTYPE CompositeClientOverlayType;
static RESTYPE CompositeClientOverlayType;
static void deleteCompOverlayClient (CompOverlayClientPtr pOcToDel,
ScreenPtr pScreen);
......@@ -423,7 +423,7 @@ createOverlayWindow (ScreenPtr pScreen)
return pWin;
}
int
static int
ProcCompositeGetOverlayWindow (ClientPtr client)
{
REQUEST(xCompositeGetOverlayWindowReq);
......@@ -477,7 +477,7 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
return client->noClientException;
}
int
static int
ProcCompositeReleaseOverlayWindow (ClientPtr client)
{
REQUEST(xCompositeReleaseOverlayWindowReq);
......@@ -515,7 +515,7 @@ ProcCompositeReleaseOverlayWindow (ClientPtr client)
return client->noClientException;
}
int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
static int (*ProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
ProcCompositeQueryVersion,
ProcCompositeRedirectWindow,
ProcCompositeRedirectSubwindows,
......@@ -625,7 +625,7 @@ SProcCompositeNameWindowPixmap (ClientPtr client)
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
int
static int
SProcCompositeGetOverlayWindow (ClientPtr client)
{
int n;
......@@ -637,7 +637,7 @@ SProcCompositeGetOverlayWindow (ClientPtr client)
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
int
static int
SProcCompositeReleaseOverlayWindow (ClientPtr client)
{
int n;
......@@ -649,7 +649,7 @@ SProcCompositeReleaseOverlayWindow (ClientPtr client)
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
static int (*SProcCompositeVector[CompositeNumberRequests])(ClientPtr) = {
SProcCompositeQueryVersion,
SProcCompositeRedirectWindow,
SProcCompositeRedirectSubwindows,
......
......@@ -51,7 +51,7 @@
int CompScreenPrivateIndex;
int CompWindowPrivateIndex;
int CompSubwindowsPrivateIndex;
int CompGeneration;
static int CompGeneration;
static Bool
......
......@@ -171,9 +171,6 @@ extern RESTYPE CompositeClientSubwindowsType;
* compalloc.c
*/
void
compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure);
Bool
compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update);
......@@ -292,18 +289,6 @@ compWindowUpdate (WindowPtr pWin);
void
deleteCompOverlayClientsForScreen (ScreenPtr pScreen);
int
ProcCompositeGetOverlayWindow (ClientPtr client);
int
ProcCompositeReleaseOverlayWindow (ClientPtr client);
int
SProcCompositeGetOverlayWindow (ClientPtr client);
int
SProcCompositeReleaseOverlayWindow (ClientPtr client);
WindowPtr
CompositeRealChildHead (WindowPtr pWin);
......
......@@ -28,12 +28,12 @@
#include "damageextint.h"
unsigned char DamageReqCode;
int DamageEventBase;
int DamageErrorBase;
int DamageClientPrivateIndex;
RESTYPE DamageExtType;
RESTYPE DamageExtWinType;
static unsigned char DamageReqCode;
static int DamageEventBase;
static int DamageErrorBase;
static int DamageClientPrivateIndex;
static RESTYPE DamageExtType;
static RESTYPE DamageExtWinType;
/* Version of the damage extension supported by the server, as opposed to the
* DAMAGE_* defines from damageproto for what version the proto header
......@@ -319,7 +319,7 @@ static const int version_requests[] = {
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
static int (*ProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
ProcDamageQueryVersion,
ProcDamageCreate,
......@@ -408,7 +408,7 @@ SProcDamageAdd (ClientPtr client)
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
static int (*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
/*************** Version 1 ******************/
SProcDamageQueryVersion,
SProcDamageCreate,
......@@ -478,7 +478,7 @@ FreeDamageExtWin (pointer value, XID wid)
return Success;
}
void
static void
SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to)
{
......
......@@ -44,13 +44,6 @@
#include "damage.h"
#include "xfixes.h"
extern unsigned char DamageReqCode;
extern int DamageEventBase;
extern int DamageErrorBase;
extern int DamageClientPrivateIndex;
extern RESTYPE DamageExtType;
extern RESTYPE DamageExtWinType;
typedef struct _DamageClient {
CARD32 major_version;
CARD32 minor_version;
......@@ -67,9 +60,6 @@ typedef struct _DamageExt {
XID id;
} DamageExtRec, *DamageExtPtr;
extern int (*ProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
#define VERIFY_DAMAGEEXT(pDamageExt, rid, client, mode) { \
pDamageExt = SecurityLookupIDByType (client, rid, DamageExtType, mode); \
if (!pDamageExt) { \
......@@ -78,10 +68,6 @@ extern int (*SProcDamageVector[/*XDamageNumberRequests*/])(ClientPtr);
} \
}
void
SDamageNotifyEvent (xDamageNotifyEvent *from,
xDamageNotifyEvent *to);
void
DamageExtSetCritical (ClientPtr pClient, Bool critical);
......
......@@ -59,21 +59,12 @@
#include <stdio.h>
/* DEFINES */
/* TYPEDEFS */
/* GLOBALS */
static int miDbePrivPrivGeneration = 0;
static int miDbeWindowPrivPrivIndex = -1;
RESTYPE dbeDrawableResType;
RESTYPE dbeWindowPrivResType;
int dbeScreenPrivIndex = -1;
int dbeWindowPrivIndex = -1;
static RESTYPE dbeDrawableResType;
static RESTYPE dbeWindowPrivResType;
static int dbeScreenPrivIndex = -1;
static int dbeWindowPrivIndex = -1;
/******************************************************************************
......
......@@ -79,7 +79,8 @@ SOFTWARE.
#include "exglobals.h"
#include "exevents.h"
int CoreDevicePrivatesIndex = 0, CoreDevicePrivatesGeneration = -1;
int CoreDevicePrivatesIndex = 0;
static int CoreDevicePrivatesGeneration = -1;
DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart)
......@@ -926,16 +927,16 @@ InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc)
}
LedCtrl defaultLedControl = {
static LedCtrl defaultLedControl = {
DEFAULT_LEDS, DEFAULT_LEDS_MASK, 0};
BellCtrl defaultBellControl = {
static BellCtrl defaultBellControl = {
DEFAULT_BELL,
DEFAULT_BELL_PITCH,
DEFAULT_BELL_DURATION,
0};
IntegerCtrl defaultIntegerControl = {
static IntegerCtrl defaultIntegerControl = {
DEFAULT_INT_RESOLUTION,
DEFAULT_INT_MIN_VALUE,
DEFAULT_INT_MAX_VALUE,
......
......@@ -297,8 +297,8 @@ long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL;
long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE;
long SmartScheduleTime;
ClientPtr SmartLastClient;
int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
static ClientPtr SmartLastClient;
static int SmartLastIndex[SMART_MAX_PRIORITY-SMART_MIN_PRIORITY+1];
int SmartScheduleClient(int *clientReady, int nready);
#ifdef SMART_DEBUG
......
......@@ -156,7 +156,7 @@ extern Mask xevieFilters[128];
extern int xevieEventSent;
extern int xevieKBEventSent;
int xeviegrabState = 0;
xEvent *xeviexE;
static xEvent *xeviexE;
#endif
#include <X11/extensions/XIproto.h>
......
......@@ -66,7 +66,7 @@ SOFTWARE.
#define LAST_EVENT 128
#define LAST_ERROR 255
ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
static ScreenProcEntry AuxillaryScreenProcs[MAXSCREENS];
static ExtensionEntry **extensions = (ExtensionEntry **)NULL;
......
......@@ -69,7 +69,7 @@ extern FontPtr defaultFont;
static Bool CreateDefaultTile(GCPtr pGC);
unsigned char DefaultDash[2] = {4, 4};
static unsigned char DefaultDash[2] = {4, 4};
_X_EXPORT void
ValidateGC(DrawablePtr pDraw, GC *pGC)
......
......@@ -246,7 +246,7 @@ CreateNewResourceClass()
return next;
}
ClientResourceRec clientTable[MAXCLIENTS];
static ClientResourceRec clientTable[MAXCLIENTS];
/*****************
* InitClientResources
......
......@@ -2847,7 +2847,7 @@ xf86IsListSubsetOf(resPtr list, resPtr BaseList)
return TRUE;
}
resPtr
static resPtr
findIntersect(resRange Range, resPtr list)
{
resRange range;
......
......@@ -143,7 +143,6 @@ memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
Bool xf86IsSubsetOf(resRange range, resPtr list);
Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
resPtr findIntersect(resRange Range, resPtr list);
resPtr xf86FindIntersect(resRange Range, resPtr list);
void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
Bool useEstimated);
......
......@@ -68,7 +68,7 @@ static int nDevToConfig = 0, CurrentDriver;
_X_EXPORT xf86MonPtr ConfiguredMonitor;
Bool xf86DoConfigurePass1 = TRUE;
Bool foundMouse = FALSE;
static Bool foundMouse = FALSE;
#if defined(__UNIXOS2__)
#define DFLT_MOUSE_DEV "mouse$"
......
......@@ -126,9 +126,9 @@ extern Bool noXkbExtension;
*/
#ifdef USE_VT_SYSREQ
Bool VTSysreqToggle = FALSE;
static Bool VTSysreqToggle = FALSE;
#endif /* !USE_VT_SYSREQ */
Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
static Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for
*BSD and for avoiding VT
switches when using the DRI
automatic full screen mode.*/
......
......@@ -110,7 +110,7 @@ static void xf86XVAdjustFrame(int index, int x, int y, int flags);
static Bool xf86XVInitAdaptors(ScreenPtr, XF86VideoAdaptorPtr*, int);
int XF86XVWindowIndex = -1;
static int XF86XVWindowIndex = -1;
int XF86XvScreenIndex = -1;
static unsigned long XF86XVGeneration = 0;
static unsigned long PortResource = 0;
......
......@@ -189,101 +189,6 @@ _LoaderListPop(int handle)
return 0;
}
/*
* _LoaderHandleToName() will return the name of the first module with a
* given handle. This requires getting the last module on the LIFO with
* the given handle.
*/
char *
_LoaderHandleToName(int handle)
{
loaderPtr item = listHead;
loaderPtr aritem = NULL;
loaderPtr lastitem = NULL;
if (handle < 0) {
return "(built-in)";
}
while (item) {
if (item->handle == handle) {
if (strchr(item->name, ':') == NULL)
aritem = item;
else
lastitem = item;
}
item = item->next;
}
if (aritem)
return aritem->name;
if (lastitem)
return lastitem->name;
return 0;
}
/*
* _LoaderHandleToCanonicalName() will return the cname of the first module
* with a given handle. This requires getting the last module on the LIFO with
* the given handle.
*/
char *
_LoaderHandleToCanonicalName(int handle)
{
loaderPtr item = listHead;
loaderPtr lastitem = NULL;
if (handle < 0) {
return "(built-in)";
}
while (item) {
if (item->handle == handle) {
lastitem = item;
}
item = item->next;
}
if (lastitem)
return lastitem->cname;
return NULL;
}
/*
* _LoaderModuleToName() will return the name of the first module with a
* given handle. This requires getting the last module on the LIFO with
* the given handle.
*/
char *
_LoaderModuleToName(int module)
{
loaderPtr item = listHead;
loaderPtr aritem = NULL;
loaderPtr lastitem = NULL;
if (module < 0) {
return "(built-in)";
}
while (item) {
if (item->module == module) {
if (strchr(item->name, ':') == NULL)
aritem = item;
else
lastitem = item;
}
item = item->next;
}
if (aritem)
return aritem->name;
if (lastitem)
return lastitem->name;
return 0;
}
/* These four are just ABI stubs */
_X_EXPORT void
LoaderRefSymbols(const char *sym0, ...)
......@@ -450,35 +355,14 @@ LoaderUnload(int handle)
return 0;
}
void
LoaderDuplicateSymbol(const char *symbol, const int handle)
{
ErrorF("Duplicate symbol %s in %s\n", symbol,
listHead ? listHead->name : "(built-in)");
ErrorF("Also defined in %s\n", _LoaderHandleToName(handle));
FatalError("Module load failure\n");
}
unsigned long LoaderOptions = 0;
void
LoaderResetOptions(void)
{
LoaderOptions = 0;
}
void
LoaderSetOptions(unsigned long opts)
{
LoaderOptions |= opts;
}
void
LoaderClearOptions(unsigned long opts)
{
LoaderOptions &= ~opts;
}
_X_EXPORT int
LoaderGetABIVersion(const char *abiclass)
{
......
......@@ -97,9 +97,6 @@ void LoadFont(FontModule *);
void UnloadModule(ModuleDescPtr);
void UnloadSubModule(ModuleDescPtr);
void UnloadDriver(ModuleDescPtr);
void FreeModuleDesc(ModuleDescPtr mod);
ModuleDescPtr NewModuleDesc(const char *);
ModuleDescPtr AddSibling(ModuleDescPtr head, ModuleDescPtr new);
void LoaderSetPath(const char *path);
void LoaderSortExtensions(void);
......@@ -108,7 +105,6 @@ unsigned long LoaderGetModuleVersion(ModuleDescPtr mod);
void LoaderResetOptions(void);
void LoaderSetOptions(unsigned long);
void LoaderClearOptions(unsigned long);
/* Options for LoaderSetOptions */
#define LDR_OPT_ABI_MISMATCH_NONFATAL 0x0001
......
......@@ -745,6 +745,13 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data,
return TRUE;
}
static ModuleDescPtr
AddSibling(ModuleDescPtr head, ModuleDescPtr new)
{
new->sib = head;
return (new);
}
_X_EXPORT ModuleDescPtr
LoadSubModule(ModuleDescPtr parent, const char *module,
const char **subdirlist, const char **patternlist,
......@@ -775,35 +782,28 @@ LoadSubModule(ModuleDescPtr parent, const char *module,
return submod;
}
ModuleDescPtr
LoadSubModuleLocal(ModuleDescPtr parent, const char *module,
const char **subdirlist, const char **patternlist,
pointer options, const XF86ModReqInfo * modreq,
int *errmaj, int *errmin)
static ModuleDescPtr
NewModuleDesc(const char *name)
{
ModuleDescPtr submod;
xf86MsgVerb(X_INFO, 3, "Loading local sub module \"%s\"\n", module);
ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
if (PathIsAbsolute(module))
{
xf86Msg(X_ERROR,
"LoadSubModule: Absolute module path not permitted: \"%s\"\n",
module);
if (errmaj)
*errmaj = LDR_BADUSAGE;
if (errmin)
*errmin = 0;
return NULL;
if (mdp) {
mdp->child = NULL;
mdp->sib = NULL;
mdp->parent = NULL;
mdp->demand_next = NULL;
mdp->name = xstrdup(name);
mdp->filename = NULL;
mdp->identifier = NULL;
mdp->client_id = 0;
mdp->in_use = 0;
mdp->handle = -1;
mdp->SetupProc = NULL;
mdp->TearDownProc = NULL;
mdp->TearDownData = NULL;
}
submod = doLoadModule(module, NULL, subdirlist, patternlist, options,
modreq, errmaj, errmin, 0);
if (submod && submod != (ModuleDescPtr) 1) {
parent->child = AddSibling(parent->child, submod);
submod->parent = parent;
}
return submod;
return (mdp);
}
_X_EXPORT ModuleDescPtr
......@@ -1099,26 +1099,12 @@ LoadModule(const char *module, const char *path, const char **subdirlist,
modreq, errmaj, errmin, LD_FLAG_GLOBAL);
}
ModuleDescPtr
LoadDriver(const char *module, const char *path, int handle, pointer options,
int *errmaj, int *errmin)
{
return LoadModule(module, path, NULL, NULL, options, NULL, errmaj,
errmin);
}
void
UnloadModule(ModuleDescPtr mod)
{
UnloadModuleOrDriver(mod);
}
void
UnloadDriver(ModuleDescPtr mod)
{
UnloadModuleOrDriver(mod);
}
static void
UnloadModuleOrDriver(ModuleDescPtr mod)
{
......@@ -1168,7 +1154,7 @@ UnloadSubModule(ModuleDescPtr mod)
xfree(mod);
}
void
static void
FreeModuleDesc(ModuleDescPtr head)
{
ModuleDescPtr sibs, prev;
......@@ -1177,7 +1163,7 @@ FreeModuleDesc(ModuleDescPtr head)
return;
/*
* only free it if it's not marked as in use. In use means that it may
* be unloaded someday, and UnloadModule or UnloadDriver will free it
* be unloaded someday, and UnloadModule will free it
*/
if (head->in_use)
return;
......@@ -1192,38 +1178,6 @@ FreeModuleDesc(ModuleDescPtr head)
}
}
ModuleDescPtr
NewModuleDesc(const char *name)
{
ModuleDescPtr mdp = xalloc(sizeof(ModuleDesc));
if (mdp) {
mdp->child = NULL;
mdp->sib = NULL;
mdp->parent = NULL;
mdp->demand_next = NULL;
mdp->name = xstrdup(name);
mdp->filename = NULL;
mdp->identifier = NULL;
mdp->client_id = 0;
mdp->in_use = 0;
mdp->handle = -1;
mdp->SetupProc = NULL;
mdp->TearDownProc = NULL;
mdp->TearDownData = NULL;
}
return (mdp);
}
ModuleDescPtr
AddSibling(ModuleDescPtr head, ModuleDescPtr new)
{
new->sib = head;
return (new);
}
static void
RemoveChild(ModuleDescPtr child)
{
......
......@@ -48,7 +48,21 @@ static xf86ConfigSymTabRec DRITab[] =
#define CLEANUP xf86freeBuffersList
XF86ConfBuffersPtr
static void
xf86freeBuffersList (XF86ConfBuffersPtr ptr)
{
XF86ConfBuffersPtr prev;
while (ptr) {
TestFree (ptr->buf_flags);
TestFree (ptr->buf_comment);
prev = ptr;
ptr = ptr->list.next;
xf86conffree (prev);
}
}
static XF86ConfBuffersPtr
xf86parseBuffers (void)
{
int token;
......@@ -169,18 +183,3 @@ xf86freeDRI (XF86ConfDRIPtr ptr)
TestFree (ptr->dri_comment);
xf86conffree (ptr);
}
void
xf86freeBuffersList (XF86ConfBuffersPtr ptr)
{
XF86ConfBuffersPtr prev;
while (ptr) {
TestFree (ptr->buf_flags);
TestFree (ptr->buf_comment);
prev = ptr;