diff --git a/ChangeLog b/ChangeLog index 17cfb923c..61cdb96c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-02-28 Ian Romanick + + * hw/xfree86/common/xf86Helper.c: (xf86AddDriver), + (xf86MatchPciInstances): + Remove redundant definition of struct Inst. + Safeguard xf86AddDriver against future additions to DriverRec. + 2006-02-28 Daniel Stone * xkb/maprules.c: diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index a6c7d5c89..2c29b5485 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -90,8 +90,11 @@ xf86AddDriver(DriverPtr driver, pointer module, int flags) if (flags & HaveDriverFuncs) *xf86DriverList[xf86NumDrivers - 1] = *driver; else { - memcpy(xf86DriverList[xf86NumDrivers - 1], driver, sizeof(DriverRec1)); - xf86DriverList[xf86NumDrivers - 1]->driverFunc = NULL; + (void) memset( xf86DriverList[xf86NumDrivers - 1], 0, + sizeof( DriverRec ) ); + (void) memcpy( xf86DriverList[xf86NumDrivers - 1], driver, + sizeof(DriverRec1)); + } xf86DriverList[xf86NumDrivers - 1]->module = module; xf86DriverList[xf86NumDrivers - 1]->refCount = 0; @@ -1605,14 +1608,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID, int i,j; MessageType from; pciVideoPtr pPci, *ppPci; - struct Inst { - pciVideoPtr pci; - GDevPtr dev; - Bool foundHW; /* PCIid in list of supported chipsets */ - Bool claimed; /* BusID matches with a device section */ - int chip; - int screen; - } *instances = NULL; + struct Inst *instances = NULL; int numClaimedInstances = 0; int allocatedInstances = 0; int numFound = 0;