diff options
author | Matt Turner <mattst88@gmail.com> | 2024-12-16 22:38:24 -0500 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-12-17 17:27:20 +0000 |
commit | 203e0667d21953737537d1991ec76b768fe588ae (patch) | |
tree | 02790d6041368839cc277c3959266d1ca14d1b02 | |
parent | 1958e0f25b6b46940625b407a5e15b39fa648b26 (diff) |
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.")
(cherry picked from commit bdacb100bf6a551bc9045f7f0048cbb99eb3db5a)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1752>
-rw-r--r-- | hw/xfree86/common/xf86sbusBus.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c index a4b114af0..ae4e45773 100644 --- a/hw/xfree86/common/xf86sbusBus.c +++ b/hw/xfree86/common/xf86sbusBus.c @@ -740,6 +740,7 @@ void xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev) { char *promPath = NULL; + char *tmp; sBus = (sbusDevicePtr) busData; GDev->identifier = sBus->descr; @@ -748,10 +749,11 @@ xf86SbusConfigureNewDev(void *busData, sbusDevicePtr sBus, GDevRec * GDev) sparcPromClose(); } if (promPath) { - XNFasprintf(&GDev->busID, "SBUS:%s", promPath); + XNFasprintf(&tmp, "SBUS:%s", promPath); free(promPath); } else { - XNFasprintf(&GDev->busID, "SBUS:fb%d", sBus->fbNum); + XNFasprintf(&tmp, "SBUS:fb%d", sBus->fbNum); } + GDev->busID = tmp; } |