[FFmpeg-devel] [PATCH] Fix some warnings in NUT (de)muxer
Vitor Sessak
vitor1001
Wed Mar 24 21:03:31 CET 2010
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).
>> @@ -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?
-Vitor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nut_warnings3.diff
Type: text/x-patch
Size: 3027 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100324/264ff36a/attachment.bin>
More information about the ffmpeg-devel
mailing list