hw/xfree86: Fix -Wincompatible-pointer-types sbus compile failure

```
../hw/xfree86/common/xf86sbusBus.c: In function ‘xf86SbusConfigureNewDev’:
../hw/xfree86/common/xf86sbusBus.c:751:21: error: passing argument 1 of ‘XNFasprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
  751 |         XNFasprintf(&GDev->busID, "SBUS:%s", promPath);
      |                     ^~~~~~~~~~~~
      |                     |
      |                     const char **
```

Apply the same fix as in commit e1e01d2e3 ("xfree86/common: Warning
fixes. Mostly const string handling.")

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1751>
This commit is contained in:
Matt Turner 2024-12-16 22:38:24 -05:00
parent 00a96cd82a
commit bdacb100bf

View File

@ -740,6 +740,7 @@ void
xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev) xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev)
{ {
char *promPath = NULL; char *promPath = NULL;
char *tmp;
sBus = (sbusDevicePtr) busData; sBus = (sbusDevicePtr) busData;
GDev->identifier = sBus->descr; GDev->identifier = sBus->descr;
@ -748,10 +749,11 @@ xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev)
sparcPromClose(); sparcPromClose();
} }
if (promPath) { if (promPath) {
XNFasprintf(&GDev->busID, "SBUS:%s", promPath); XNFasprintf(&tmp, "SBUS:%s", promPath);
free(promPath); free(promPath);
} }
else { else {
XNFasprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum); XNFasprintf(&tmp, "SBUS:fb%d", sBus->fbNum);
} }
GDev->busID = tmp;
} }