summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-02-01 17:21:34 +1100
committerAdam Jackson <ajax@redhat.com>2008-02-14 08:21:44 +1100
commite91ff09568c5579818b6641e88e95c6fe122cbe7 (patch)
tree86c27ab6eb83c9c2c67f55037f0afe3a5797c117
parent0bdd20a0454c94f902fd4874855125bf7510fcf5 (diff)
Friends don't let friends call xf86AddModuleInfo.
That code only existed to leak memory. It can go now, thanks.
-rw-r--r--hw/xfree86/common/xf86.h4
-rw-r--r--hw/xfree86/common/xf86Globals.c2
-rw-r--r--hw/xfree86/common/xf86Helper.c24
-rw-r--r--hw/xfree86/common/xf86Priv.h3
-rw-r--r--hw/xfree86/common/xf86str.h2
-rw-r--r--hw/xfree86/exa/examodule.c26
-rw-r--r--hw/xfree86/loader/xf86sym.c2
-rw-r--r--hw/xfree86/xaa/xaaInitAccel.c26
8 files changed, 7 insertions, 82 deletions
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 4e7d914bf..4b3e10463 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -337,8 +337,8 @@ int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
pointer value);
Bool xf86IsUnblank(int mode);
-void xf86AddModuleInfo(ModuleInfoPtr info, pointer module);
-void xf86DeleteModuleInfo(int idx);
+_X_DEPRECATED void xf86AddModuleInfo(pointer info, pointer module);
+_X_DEPRECATED void xf86DeleteModuleInfo(int idx);
void xf86getsecs(long *, long *);
/* xf86Debug.c */
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index ba603f4df..0dc42c66b 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -153,8 +153,6 @@ DriverPtr *xf86DriverList = NULL;
int xf86NumDrivers = 0;
InputDriverPtr *xf86InputDriverList = NULL;
int xf86NumInputDrivers = 0;
-ModuleInfoPtr *xf86ModuleInfoList = NULL;
-int xf86NumModuleInfos = 0;
int xf86NumScreens = 0;
const char *xf86VisualNames[] = {
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index ec524e63c..8978f8206 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -170,37 +170,17 @@ xf86LookupInput(const char *name)
return NULL;
}
+/* ABI stubs of despair */
_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
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 */
_X_EXPORT ScrnInfoPtr
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index 4723f5aba..32801cb3f 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 1997-2002 by The XFree86 Project, Inc.
*
@@ -97,8 +96,6 @@ extern Bool xf86SupportedMouseTypes[];
extern int xf86NumMouseTypes;
extern DriverPtr *xf86DriverList;
-extern ModuleInfoPtr *xf86ModuleInfoList;
-extern int xf86NumModuleInfos;
extern int xf86NumDrivers;
extern Bool xf86Resetting;
extern Bool xf86Initialising;
diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h
index 2e0213597..fc94284cb 100644
--- a/hw/xfree86/common/xf86str.h
+++ b/hw/xfree86/common/xf86str.h
@@ -348,7 +348,7 @@ typedef struct _DriverRec {
* functions to configuration tools, the Xserver, or any other
* application/module interested in such information.
*/
-typedef struct _ModuleInfoRec {
+_X_DEPRECATED typedef struct _ModuleInfoRec {
int moduleVersion;
char * moduleName;
pointer module;
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index b8d306eb4..086639cc5 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -178,8 +178,6 @@ exaDDXDriverInit(ScreenPtr pScreen)
}
-static MODULESETUPPROTO(exaSetup);
-
/*ARGSUSED*/
static const OptionInfoRec *
EXAAvailableOptions(void *unused)
@@ -201,26 +199,4 @@ static XF86ModuleVersionInfo exaVersRec =
{0,0,0,0}
};
-_X_EXPORT XF86ModuleData exaModuleData = { &exaVersRec, exaSetup, 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;
-}
+_X_EXPORT XF86ModuleData exaModuleData = { &exaVersRec, NULL, NULL };
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 623e87ab5..754e9c06b 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -479,8 +479,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86IsScreenPrimary)
SYMFUNC(xf86RegisterRootWindowProperty)
SYMFUNC(xf86IsUnblank)
- SYMFUNC(xf86AddModuleInfo)
- SYMFUNC(xf86DeleteModuleInfo)
#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
/* xf86sbusBus.c */
diff --git a/hw/xfree86/xaa/xaaInitAccel.c b/hw/xfree86/xaa/xaaInitAccel.c
index fe0b70a14..1b7c15487 100644
--- a/hw/xfree86/xaa/xaaInitAccel.c
+++ b/hw/xfree86/xaa/xaaInitAccel.c
@@ -93,8 +93,6 @@ static const OptionInfoRec XAAOptions[] = {
OPTV_NONE, {0}, FALSE }
};
-static MODULESETUPPROTO(xaaSetup);
-
static XF86ModuleVersionInfo xaaVersRec =
{
"xaa",
@@ -109,29 +107,7 @@ static XF86ModuleVersionInfo xaaVersRec =
{0,0,0,0}
};
-_X_EXPORT XF86ModuleData xaaModuleData = { &xaaVersRec, xaaSetup, 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;
-}
+_X_EXPORT XF86ModuleData xaaModuleData = { &xaaVersRec, NULL, NULL };
/*ARGSUSED*/
static const OptionInfoRec *