[FFmpeg-devel] [PATCH] Fix some warnings in NUT (de)muxer
Michael Niedermayer
michaelni
Sun Mar 28 00:33:25 CET 2010
On Fri, Mar 26, 2010 at 09:23:33PM +0100, Vitor Sessak wrote:
> Michael Niedermayer wrote:
>> 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
>
> Like attached?
>
> BTW, why don't libavutil/tree.h functions do not get as params
>
> int (*cmp)(const void *key, const void *b)
>
> intead of
>
> int (*cmp)(void *key, const void *b)
dont know
>
> ? But in any way this is unrelated to the attached patch.
>
> -Vitor
> nut.c | 6 +++---
> nut.h | 4 ++--
> nutdec.c | 9 ++++++---
> nutenc.c | 3 ++-
> 4 files changed, 13 insertions(+), 9 deletions(-)
> 0a035119ecc838dadca54319e47f2b45a135a66d nut_warnings4.diff
ok
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"
-------------- 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/20100328/b8509601/attachment.pgp>
More information about the ffmpeg-devel
mailing list