Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2] avformat/udp: fix warning about unused varible
@ 2025-09-21  1:19 Brad Smith via ffmpeg-devel
  2025-09-21  2:45 ` [FFmpeg-devel] " Timo Rothenpieler via ffmpeg-devel
  0 siblings, 1 reply; 2+ messages in thread
From: Brad Smith via ffmpeg-devel @ 2025-09-21  1:19 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Brad Smith

libavformat/udp.c:283:9: warning: unused variable 'i' [-Wunused-variable]

Signed-off-by: Brad Smith <brad@comstyle.com>
---
 libavformat/udp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index e1dec49010..839c301369 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -282,14 +282,12 @@ static int udp_set_multicast_sources(URLContext *h,
                                      struct sockaddr_storage *sources,
                                      int nb_sources, int include)
 {
-    int i;
     if (addr->sa_family != AF_INET) {
 #if HAVE_STRUCT_GROUP_SOURCE_REQ && defined(MCAST_BLOCK_SOURCE)
         /* For IPv4 prefer the old approach, as that alone works reliably on
          * Windows and it also supports supplying the interface based on its
          * address. */
-        int i;
-        for (i = 0; i < nb_sources; i++) {
+        for (int i = 0; i < nb_sources; i++) {
             struct group_source_req mreqs;
             int level = addr->sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
 
@@ -316,7 +314,7 @@ static int udp_set_multicast_sources(URLContext *h,
 #endif
     }
 #if HAVE_STRUCT_IP_MREQ_SOURCE && defined(IP_BLOCK_SOURCE)
-    for (i = 0; i < nb_sources; i++) {
+    for (int i = 0; i < nb_sources; i++) {
         struct ip_mreq_source mreqs;
         if (sources[i].ss_family != AF_INET) {
             av_log(h, AV_LOG_ERROR, "Source/block address %d is of incorrect protocol family\n", i + 1);
-- 
2.51.0

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [FFmpeg-devel] Re: [PATCH v2] avformat/udp: fix warning about unused varible
  2025-09-21  1:19 [FFmpeg-devel] [PATCH v2] avformat/udp: fix warning about unused varible Brad Smith via ffmpeg-devel
@ 2025-09-21  2:45 ` Timo Rothenpieler via ffmpeg-devel
  0 siblings, 0 replies; 2+ messages in thread
From: Timo Rothenpieler via ffmpeg-devel @ 2025-09-21  2:45 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Timo Rothenpieler


[-- Attachment #1.1: Type: text/plain, Size: 1714 bytes --]

On 21.09.2025 03:19, Brad Smith via ffmpeg-devel wrote:
> libavformat/udp.c:283:9: warning: unused variable 'i' [-Wunused-variable]
> 
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
>   libavformat/udp.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index e1dec49010..839c301369 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -282,14 +282,12 @@ static int udp_set_multicast_sources(URLContext *h,
>                                        struct sockaddr_storage *sources,
>                                        int nb_sources, int include)
>   {
> -    int i;
>       if (addr->sa_family != AF_INET) {
>   #if HAVE_STRUCT_GROUP_SOURCE_REQ && defined(MCAST_BLOCK_SOURCE)
>           /* For IPv4 prefer the old approach, as that alone works reliably on
>            * Windows and it also supports supplying the interface based on its
>            * address. */
> -        int i;
> -        for (i = 0; i < nb_sources; i++) {
> +        for (int i = 0; i < nb_sources; i++) {
>               struct group_source_req mreqs;
>               int level = addr->sa_family == AF_INET ? IPPROTO_IP : IPPROTO_IPV6;
>   
> @@ -316,7 +314,7 @@ static int udp_set_multicast_sources(URLContext *h,
>   #endif
>       }
>   #if HAVE_STRUCT_IP_MREQ_SOURCE && defined(IP_BLOCK_SOURCE)
> -    for (i = 0; i < nb_sources; i++) {
> +    for (int i = 0; i < nb_sources; i++) {
>           struct ip_mreq_source mreqs;
>           if (sources[i].ss_family != AF_INET) {
>               av_log(h, AV_LOG_ERROR, "Source/block address %d is of incorrect protocol family\n", i + 1);

looks okay to me

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4742 bytes --]

[-- Attachment #2: Type: text/plain, Size: 163 bytes --]

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-21  2:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-21  1:19 [FFmpeg-devel] [PATCH v2] avformat/udp: fix warning about unused varible Brad Smith via ffmpeg-devel
2025-09-21  2:45 ` [FFmpeg-devel] " Timo Rothenpieler via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git