Rhys Kidd
2019-Jan-19 23:30 UTC
[Nouveau] [PATCH xf86-video-nouveau] xv: fix build warning regarding const qualifier
Fixes warning with gcc 8.2: nouveau_xv.c: In function ‘NVInitVideo’: nouveau_xv.c:2247:68: warning: passing argument 2 of ‘vlCreateAdaptorXvMC’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, textureAdaptor[0]->name); ~~~~~~~~~~~~~~~~~^~~~~~ In file included from nouveau_xv.c:42: vl_hwmc.h:6:63: note: expected ‘char *’ but argument is of type ‘const char *’ XF86MCAdaptorPtr vlCreateAdaptorXvMC(ScreenPtr pScreen, char *xv_adaptor_name); ~~~~~~^~~~~~~~~~~~~~~ Signed-off-by: Rhys Kidd <rhyskidd at gmail.com> --- src/nouveau_xv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c index a7ec21a..3258ef7 100644 --- a/src/nouveau_xv.c +++ b/src/nouveau_xv.c @@ -2244,7 +2244,7 @@ NVInitVideo(ScreenPtr pScreen) XF86MCAdaptorPtr *adaptorsXvMC = malloc(sizeof(XF86MCAdaptorPtr)); if (adaptorsXvMC) { - adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, textureAdaptor[0]->name); + adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, (char *)textureAdaptor[0]->name); if (adaptorsXvMC[0]) { vlInitXvMC(pScreen, 1, adaptorsXvMC); -- 2.19.1
Ilia Mirkin
2019-Jan-19 23:32 UTC
[Nouveau] [PATCH xf86-video-nouveau] xv: fix build warning regarding const qualifier
Is vlCreateAdaptorXvMC just silly, or does it really want to take ownership of the name pointer? On Sat, Jan 19, 2019 at 6:30 PM Rhys Kidd <rhyskidd at gmail.com> wrote:> > Fixes warning with gcc 8.2: > > nouveau_xv.c: In function ‘NVInitVideo’: > nouveau_xv.c:2247:68: warning: passing argument 2 of ‘vlCreateAdaptorXvMC’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] > adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, textureAdaptor[0]->name); > ~~~~~~~~~~~~~~~~~^~~~~~ > In file included from nouveau_xv.c:42: > vl_hwmc.h:6:63: note: expected ‘char *’ but argument is of type ‘const char *’ > XF86MCAdaptorPtr vlCreateAdaptorXvMC(ScreenPtr pScreen, char *xv_adaptor_name); > ~~~~~~^~~~~~~~~~~~~~~ > > Signed-off-by: Rhys Kidd <rhyskidd at gmail.com> > --- > src/nouveau_xv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c > index a7ec21a..3258ef7 100644 > --- a/src/nouveau_xv.c > +++ b/src/nouveau_xv.c > @@ -2244,7 +2244,7 @@ NVInitVideo(ScreenPtr pScreen) > XF86MCAdaptorPtr *adaptorsXvMC = malloc(sizeof(XF86MCAdaptorPtr)); > > if (adaptorsXvMC) { > - adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, textureAdaptor[0]->name); > + adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, (char *)textureAdaptor[0]->name); > > if (adaptorsXvMC[0]) { > vlInitXvMC(pScreen, 1, adaptorsXvMC); > -- > 2.19.1 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/nouveau
Rhys Kidd
2019-Jan-19 23:37 UTC
[Nouveau] [PATCH xf86-video-nouveau] xv: fix build warning regarding const qualifier
On Sat, 19 Jan 2019 at 18:32, Ilia Mirkin <imirkin at alum.mit.edu> wrote:> Is vlCreateAdaptorXvMC just silly, or does it really want to take > ownership of the name pointer? >vlCreateAdaptorXvMC( ) doesn't need to take over ownership of the name pointer, so yes - I guess it's being silly in one respect by not being specific about const.> > On Sat, Jan 19, 2019 at 6:30 PM Rhys Kidd <rhyskidd at gmail.com> wrote: > > > > Fixes warning with gcc 8.2: > > > > nouveau_xv.c: In function ‘NVInitVideo’: > > nouveau_xv.c:2247:68: warning: passing argument 2 of > ‘vlCreateAdaptorXvMC’ discards ‘const’ qualifier from pointer target type > [-Wdiscarded-qualifiers] > > adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, > textureAdaptor[0]->name); > > > ~~~~~~~~~~~~~~~~~^~~~~~ > > In file included from nouveau_xv.c:42: > > vl_hwmc.h:6:63: note: expected ‘char *’ but argument is of type ‘const > char *’ > > XF86MCAdaptorPtr vlCreateAdaptorXvMC(ScreenPtr pScreen, char > *xv_adaptor_name); > > > ~~~~~~^~~~~~~~~~~~~~~ > > > > Signed-off-by: Rhys Kidd <rhyskidd at gmail.com> > > --- > > src/nouveau_xv.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c > > index a7ec21a..3258ef7 100644 > > --- a/src/nouveau_xv.c > > +++ b/src/nouveau_xv.c > > @@ -2244,7 +2244,7 @@ NVInitVideo(ScreenPtr pScreen) > > XF86MCAdaptorPtr *adaptorsXvMC > malloc(sizeof(XF86MCAdaptorPtr)); > > > > if (adaptorsXvMC) { > > - adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, > textureAdaptor[0]->name); > > + adaptorsXvMC[0] = vlCreateAdaptorXvMC(pScreen, > (char *)textureAdaptor[0]->name); > > > > if (adaptorsXvMC[0]) { > > vlInitXvMC(pScreen, 1, adaptorsXvMC); > > -- > > 2.19.1 > > > > _______________________________________________ > > Nouveau mailing list > > Nouveau at lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/nouveau >-------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.freedesktop.org/archives/nouveau/attachments/20190119/9c1c8d70/attachment.html>
Reasonably Related Threads
- [PATCH xf86-video-nouveau] xv: fix build warning regarding const qualifier
- [PATCH xf86-video-nouveau] xv: fix build warning regarding const qualifier
- [PATCH xf86-video-nouveau v2] xv: Silence build warning regarding const qualifier
- nv vpe video decoder
- [PATCH xf86-video-nouveau 1/2] xv: Avoid shadowed declaration of 'int i' in NVPutImage