[FFmpeg-devel] [PATCH] Fix some warnings in NUT (de)muxer
Michael Niedermayer
michaelni
Wed Mar 24 20:46:06 CET 2010
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*
> @@ -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
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- 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/6f990de6/attachment.pgp>
More information about the ffmpeg-devel
mailing list