[FFmpeg-devel] [PATCH] Fix some warnings in NUT (de)muxer
Michael Niedermayer
michaelni
Wed Mar 24 22:51:30 CET 2010
On Wed, Mar 24, 2010 at 09:03:31PM +0100, Vitor Sessak wrote:
> Michael Niedermayer wrote:
>> On Wed, Mar 24, 2010 at 08:35:24PM +0100, Vitor Sessak wrote:
>>> $subj.
>>>
>>> Patch 1:
>>> libavformat/nutdec.c: In function ?read_seek?:
>>> libavformat/nutdec.c:862: warning: passing argument 3 of
>>> ?av_tree_find? from incompatible pointer type
>>> ./libavutil/tree.h:44: note: expected ?int (*)(void *, const void *)?
>>> but argument is of type ?int (*)(struct Syncpoint *, struct Syncpoint
>>> *)?
>>> libavformat/nutdec.c:871: warning: passing argument 3 of
>>> ?av_tree_find? from incompatible pointer type
>>> ./libavutil/tree.h:44: note: expected ?int (*)(void *, const void *)?
>>> but argument is of type ?int (*)(struct Syncpoint *, struct Syncpoint
>>> *)?
>>> libavformat/nutdec.c:879: warning: passing argument 3 of
>>> ?av_tree_find? from incompatible pointer type
>>> ./libavutil/tree.h:44: note: expected ?int (*)(void *, const void *)?
>>> but argument is of type ?int (*)(struct Syncpoint *, struct Syncpoint
>>> *)?
>>> CC libavformat/nutenc.o
>>> libavformat/nutenc.c: In function ?write_packet?:
>>> libavformat/nutenc.c:680: warning: passing argument 3 of
>>> ?av_tree_find? from incompatible pointer type
>>> ./libavutil/tree.h:44: note: expected ?int (*)(void *, const void *)?
>>> but argument is of type ?int (*)(struct Syncpoint *, struct Syncpoint
>>> *)?
>>>
>>> Patch 2:
>>> libavformat/nutdec.c: In function ?read_seek?:
>>> libavformat/nutdec.c:862: warning: passing argument 4 of
>>> ?av_tree_find? from incompatible pointer type
>>> ./libavutil/tree.h:44: note: expected ?void **? but argument is of
>>> type ?struct Syncpoint **?
>>> libavformat/nutdec.c:871: warning: passing argument 4 of
>>> ?av_tree_find? from incompatible pointer type
>>> ./libavutil/tree.h:44: note: expected ?void **? but argument is of
>>> type ?struct Syncpoint **?
>>>
>>> -Vitor
>>> nut.c | 11 ++++++++---
>>> nut.h | 4 ++--
>>> 2 files changed, 10 insertions(+), 5 deletions(-)
>>> 4fb6aa0edd5e782f70ef9b755e04262c98ece7cf nut_warnings.diff
>>> Index: libavformat/nut.c
>>> ===================================================================
>>> --- libavformat/nut.c (revision 22644)
>>> +++ libavformat/nut.c (working copy)
>>> @@ -47,11 +47,15 @@
>>> return ((lsb - delta)&mask) + delta;
>>> }
>>> -int ff_nut_sp_pos_cmp(Syncpoint *a, Syncpoint *b){
>>> +int ff_nut_sp_pos_cmp(void *ap, const void *bp){
>>> + Syncpoint *a = ap;
>>> + const Syncpoint *b = bp;
>>> return ((a->pos - b->pos) >> 32) - ((b->pos - a->pos) >> 32);
>>> }
>>> -int ff_nut_sp_pts_cmp(Syncpoint *a, Syncpoint *b){
>>> +int ff_nut_sp_pts_cmp(void *ap, const void *bp){
>>> + Syncpoint *a = ap;
>>> + const Syncpoint *b = bp;
>>> return ((a->ts - b->ts) >> 32) - ((b->ts - a->ts) >> 32);
>>> }
>>>
>> fix gcc instead or just cast the function pointer to void*
>
> Used the cast, but added "const" to the type to make it more correct
> (attached).
both args should be const
>
>>> @@ -69,9 +73,10 @@
>>> }
>>> }
>>> -static void enu_free(void *opaque, void *elem)
>>> +static int enu_free(void *opaque, void *elem)
>>> {
>>> av_free(elem);
>>> + return 0;
>>> }
>> ok
>
> Applied. What about the second patch in the previous email?
ok of corse
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I wish the Xiph folks would stop pretending they've got something they
do not. Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100324/a15b4047/attachment.pgp>
More information about the ffmpeg-devel
mailing list