[FFmpeg-devel] [PATCH] Remove two 'comparison always false' warnings in libavformat
Michael Niedermayer
michaelni
Sun May 4 21:40:33 CEST 2008
On Sun, May 04, 2008 at 06:12:09PM +0200, Diego 'Flameeyes' Petten? wrote:
> Diego Biurrun <diego at biurrun.de> writes:
>
> > What happened after dinner? :)
>
> That I prepared the patch and forgot to send :P
>
> Properly handle AVERROR(EIO) returned by udp_set_url functions.
>
> From: Diego 'Flameeyes' Petten? <flameeyes at gmail.com>
>
>
> ---
>
> libavformat/udp.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index aadda98..76e4230 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -158,12 +158,12 @@ static struct addrinfo* udp_ipv6_resolve_host(const char *hostname, int port, in
> return res;
> }
>
> -static int udp_set_url(struct sockaddr_storage *addr, const char *hostname, int port) {
> +static size_t udp_set_url(struct sockaddr_storage *addr, const char *hostname, int port) {
why?
[...]
> @@ -296,7 +296,7 @@ int udp_set_remote_url(URLContext *h, const char *uri)
>
> /* set the destination address */
> s->dest_addr_len = udp_set_url(&s->dest_addr, hostname, port);
> - if (s->dest_addr_len < 0) {
> + if (s->dest_addr_len == (size_t)(AVERROR(EIO))) {
> return AVERROR(EIO);
> }
What if the function returns another error?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- 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/20080504/252b911f/attachment.pgp>
More information about the ffmpeg-devel
mailing list