[Spice-devel] [PATCH xf86-video-qxl 04/13] qxl_driver: cleanup: fix const cast warnings
Christophe Fergeau
cfergeau at redhat.com
Tue Apr 10 05:06:25 PDT 2012
On Tue, Apr 10, 2012 at 02:59:02PM +0300, Alon Levy wrote:
> On Tue, Apr 10, 2012 at 12:18:11PM +0200, Christophe Fergeau wrote:
> > On Mon, Apr 09, 2012 at 08:33:10PM +0300, Alon Levy wrote:
> > > ---
> > > src/qxl_driver.c | 6 ++++--
> > > 1 file changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/src/qxl_driver.c b/src/qxl_driver.c
> > > index 5c826f3..82a6ff1 100644
> > > --- a/src/qxl_driver.c
> > > +++ b/src/qxl_driver.c
> > > @@ -1617,6 +1617,8 @@ static PciChipsets qxlPciChips[] =
> > > #endif
> > > #endif /* !XSPICE */
> > >
> > > +static char qxl_driver_name[] = QXL_DRIVER_NAME;
> > > +
> > > static void
> > > qxl_identify(int flags)
> > > {
> > > @@ -1629,7 +1631,7 @@ static void
> > > qxl_init_scrn(ScrnInfoPtr pScrn)
> > > {
> > > pScrn->driverVersion = 0;
> > > - pScrn->driverName = pScrn->name = QXL_DRIVER_NAME;
> > > + pScrn->driverName = pScrn->name = qxl_driver_name;
> > > pScrn->PreInit = qxl_pre_init;
> > > pScrn->ScreenInit = qxl_screen_init;
> > > pScrn->SwitchMode = qxl_switch_mode;
> > > @@ -1741,7 +1743,7 @@ qxl_pci_probe(DriverPtr drv, int entity, struct pci_device *dev, intptr_t match)
> > >
> > > static DriverRec qxl_driver = {
> > > 0,
> > > - QXL_DRIVER_NAME,
> > > + qxl_driver_name,
> > > qxl_identify,
> > > qxl_probe,
> > > qxl_available_options,
> >
> > Will xorg attempt to modify driverName? If not, I'd just add (char *) casts
> > instead of creating a copy of QXL_DRIVER_NAME. Or is it customary to do
> > things this way in X drivers?
>
> No reason to assume it would change it, this is purely to remove a
> warning - I know I'm doing it the wrong way, but (char *) doesn't fix
> the warning. I could remove the -W flag used, but I don't like that
> solution.
Ah, what is the warning exactly?
Christophe
> It can't be stack allocated since it's used later, so I think
> this is actually right (changing my mind from earlier this paragraph).
>
> >
> > Christophe
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20120410/370f68d7/attachment.pgp>
More information about the Spice-devel
mailing list