Friends don't let friends call xf86AddModuleInfo.
That code only existed to leak memory. It can go now, thanks.
This commit is contained in:
parent
0bdd20a045
commit
e91ff09568
|
@ -337,8 +337,8 @@ int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
|
||||||
pointer value);
|
pointer value);
|
||||||
Bool xf86IsUnblank(int mode);
|
Bool xf86IsUnblank(int mode);
|
||||||
|
|
||||||
void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
|
_X_DEPRECATED void xf86AddModuleInfo(pointer info, pointer module);
|
||||||
void xf86DeleteModuleInfo(int idx);
|
_X_DEPRECATED void xf86DeleteModuleInfo(int idx);
|
||||||
void xf86getsecs(long *, long *);
|
void xf86getsecs(long *, long *);
|
||||||
|
|
||||||
/* xf86Debug.c */
|
/* xf86Debug.c */
|
||||||
|
|
|
@ -153,8 +153,6 @@ DriverPtr *xf86DriverList = NULL;
|
||||||
int xf86NumDrivers = 0;
|
int xf86NumDrivers = 0;
|
||||||
InputDriverPtr *xf86InputDriverList = NULL;
|
InputDriverPtr *xf86InputDriverList = NULL;
|
||||||
int xf86NumInputDrivers = 0;
|
int xf86NumInputDrivers = 0;
|
||||||
ModuleInfoPtr *xf86ModuleInfoList = NULL;
|
|
||||||
int xf86NumModuleInfos = 0;
|
|
||||||
int xf86NumScreens = 0;
|
int xf86NumScreens = 0;
|
||||||
|
|
||||||
const char *xf86VisualNames[] = {
|
const char *xf86VisualNames[] = {
|
||||||
|
|
|
@ -170,37 +170,17 @@ xf86LookupInput(const char *name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ABI stubs of despair */
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
xf86AddModuleInfo(ModuleInfoPtr info, pointer module)
|
xf86AddModuleInfo(pointer info, pointer module)
|
||||||
{
|
{
|
||||||
/* Don't add null entries */
|
|
||||||
if (!module)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (xf86ModuleInfoList == NULL)
|
|
||||||
xf86NumModuleInfos = 0;
|
|
||||||
|
|
||||||
xf86NumModuleInfos++;
|
|
||||||
xf86ModuleInfoList = xnfrealloc(xf86ModuleInfoList,
|
|
||||||
xf86NumModuleInfos * sizeof(ModuleInfoPtr));
|
|
||||||
xf86ModuleInfoList[xf86NumModuleInfos - 1] = xnfalloc(sizeof(ModuleInfoRec));
|
|
||||||
*xf86ModuleInfoList[xf86NumModuleInfos - 1] = *info;
|
|
||||||
xf86ModuleInfoList[xf86NumModuleInfos - 1]->module = module;
|
|
||||||
xf86ModuleInfoList[xf86NumModuleInfos - 1]->refCount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_X_EXPORT void
|
_X_EXPORT void
|
||||||
xf86DeleteModuleInfo(int idx)
|
xf86DeleteModuleInfo(int idx)
|
||||||
{
|
{
|
||||||
if (xf86ModuleInfoList[idx]) {
|
|
||||||
if (xf86ModuleInfoList[idx]->module)
|
|
||||||
UnloadModule(xf86ModuleInfoList[idx]->module);
|
|
||||||
xfree(xf86ModuleInfoList[idx]);
|
|
||||||
xf86ModuleInfoList[idx] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Allocate a new ScrnInfoRec in xf86Screens */
|
/* Allocate a new ScrnInfoRec in xf86Screens */
|
||||||
|
|
||||||
_X_EXPORT ScrnInfoPtr
|
_X_EXPORT ScrnInfoPtr
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997-2002 by The XFree86 Project, Inc.
|
* Copyright (c) 1997-2002 by The XFree86 Project, Inc.
|
||||||
*
|
*
|
||||||
|
@ -97,8 +96,6 @@ extern Bool xf86SupportedMouseTypes[];
|
||||||
extern int xf86NumMouseTypes;
|
extern int xf86NumMouseTypes;
|
||||||
|
|
||||||
extern DriverPtr *xf86DriverList;
|
extern DriverPtr *xf86DriverList;
|
||||||
extern ModuleInfoPtr *xf86ModuleInfoList;
|
|
||||||
extern int xf86NumModuleInfos;
|
|
||||||
extern int xf86NumDrivers;
|
extern int xf86NumDrivers;
|
||||||
extern Bool xf86Resetting;
|
extern Bool xf86Resetting;
|
||||||
extern Bool xf86Initialising;
|
extern Bool xf86Initialising;
|
||||||
|
|
|
@ -348,7 +348,7 @@ typedef struct _DriverRec {
|
||||||
* functions to configuration tools, the Xserver, or any other
|
* functions to configuration tools, the Xserver, or any other
|
||||||
* application/module interested in such information.
|
* application/module interested in such information.
|
||||||
*/
|
*/
|
||||||
typedef struct _ModuleInfoRec {
|
_X_DEPRECATED typedef struct _ModuleInfoRec {
|
||||||
int moduleVersion;
|
int moduleVersion;
|
||||||
char * moduleName;
|
char * moduleName;
|
||||||
pointer module;
|
pointer module;
|
||||||
|
|
|
@ -178,8 +178,6 @@ exaDDXDriverInit(ScreenPtr pScreen)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static MODULESETUPPROTO(exaSetup);
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static const OptionInfoRec *
|
static const OptionInfoRec *
|
||||||
EXAAvailableOptions(void *unused)
|
EXAAvailableOptions(void *unused)
|
||||||
|
@ -201,26 +199,4 @@ static XF86ModuleVersionInfo exaVersRec =
|
||||||
{0,0,0,0}
|
{0,0,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData exaModuleData = { &exaVersRec, exaSetup, NULL };
|
_X_EXPORT XF86ModuleData exaModuleData = { &exaVersRec, NULL, NULL };
|
||||||
|
|
||||||
static ModuleInfoRec EXA = {
|
|
||||||
1,
|
|
||||||
"EXA",
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
EXAAvailableOptions,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static pointer
|
|
||||||
exaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
|
|
||||||
{
|
|
||||||
static Bool Initialised = FALSE;
|
|
||||||
|
|
||||||
if (!Initialised) {
|
|
||||||
Initialised = TRUE;
|
|
||||||
xf86AddModuleInfo(&EXA, Module);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (pointer)TRUE;
|
|
||||||
}
|
|
||||||
|
|
|
@ -479,8 +479,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
|
||||||
SYMFUNC(xf86IsScreenPrimary)
|
SYMFUNC(xf86IsScreenPrimary)
|
||||||
SYMFUNC(xf86RegisterRootWindowProperty)
|
SYMFUNC(xf86RegisterRootWindowProperty)
|
||||||
SYMFUNC(xf86IsUnblank)
|
SYMFUNC(xf86IsUnblank)
|
||||||
SYMFUNC(xf86AddModuleInfo)
|
|
||||||
SYMFUNC(xf86DeleteModuleInfo)
|
|
||||||
|
|
||||||
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
|
||||||
/* xf86sbusBus.c */
|
/* xf86sbusBus.c */
|
||||||
|
|
|
@ -93,8 +93,6 @@ static const OptionInfoRec XAAOptions[] = {
|
||||||
OPTV_NONE, {0}, FALSE }
|
OPTV_NONE, {0}, FALSE }
|
||||||
};
|
};
|
||||||
|
|
||||||
static MODULESETUPPROTO(xaaSetup);
|
|
||||||
|
|
||||||
static XF86ModuleVersionInfo xaaVersRec =
|
static XF86ModuleVersionInfo xaaVersRec =
|
||||||
{
|
{
|
||||||
"xaa",
|
"xaa",
|
||||||
|
@ -109,29 +107,7 @@ static XF86ModuleVersionInfo xaaVersRec =
|
||||||
{0,0,0,0}
|
{0,0,0,0}
|
||||||
};
|
};
|
||||||
|
|
||||||
_X_EXPORT XF86ModuleData xaaModuleData = { &xaaVersRec, xaaSetup, NULL };
|
_X_EXPORT XF86ModuleData xaaModuleData = { &xaaVersRec, NULL, NULL };
|
||||||
|
|
||||||
ModuleInfoRec XAA = {
|
|
||||||
1,
|
|
||||||
"XAA",
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
XAAAvailableOptions,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static pointer
|
|
||||||
xaaSetup(pointer Module, pointer Options, int *ErrorMajor, int *ErrorMinor)
|
|
||||||
{
|
|
||||||
static Bool Initialised = FALSE;
|
|
||||||
|
|
||||||
if (!Initialised) {
|
|
||||||
Initialised = TRUE;
|
|
||||||
xf86AddModuleInfo(&XAA, Module);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (pointer)TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
static const OptionInfoRec *
|
static const OptionInfoRec *
|
||||||
|
|
Loading…
Reference in New Issue