All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] getaddrinfo_a.3: Use C99 style to declare loop counter variables
@ 2020-09-11 23:09 Alejandro Colomar
  2020-09-12  5:58 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar @ 2020-09-11 23:09 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, Alejandro Colomar

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
---
 man3/getaddrinfo_a.3 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/man3/getaddrinfo_a.3 b/man3/getaddrinfo_a.3
index 3a8ddc98e..ca108df1a 100644
--- a/man3/getaddrinfo_a.3
+++ b/man3/getaddrinfo_a.3
@@ -495,7 +495,7 @@ static void
 wait_requests(void)
 {
     char *id;
-    int i, ret, n;
+    int ret, n;
     struct gaicb const **wait_reqs = calloc(nreqs, sizeof(*wait_reqs));
                 /* NULL elements are ignored by gai_suspend(). */
 
@@ -516,7 +516,7 @@ wait_requests(void)
         return;
     }
 
-    for (i = 0; i < nreqs; i++) {
+    for (int i = 0; i < nreqs; i++) {
         if (wait_reqs[i] == NULL)
             continue;
 
@@ -554,11 +554,11 @@ cancel_requests(void)
 static void
 list_requests(void)
 {
-    int i, ret;
+    int ret;
     char host[NI_MAXHOST];
     struct addrinfo *res;
 
-    for (i = 0; i < nreqs; i++) {
+    for (int i = 0; i < nreqs; i++) {
         printf("[%02d] %s: ", i, reqs[i]\->ar_name);
         ret = gai_error(reqs[i]);
 
-- 
2.28.0


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

* Re: [PATCH] getaddrinfo_a.3: Use C99 style to declare loop counter variables
  2020-09-11 23:09 [PATCH] getaddrinfo_a.3: Use C99 style to declare loop counter variables Alejandro Colomar
@ 2020-09-12  5:58 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-09-12  5:58 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hello Alex,

On 9/12/20 1:09 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man3/getaddrinfo_a.3 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/man3/getaddrinfo_a.3 b/man3/getaddrinfo_a.3
> index 3a8ddc98e..ca108df1a 100644
> --- a/man3/getaddrinfo_a.3
> +++ b/man3/getaddrinfo_a.3
> @@ -495,7 +495,7 @@ static void
>  wait_requests(void)
>  {
>      char *id;
> -    int i, ret, n;
> +    int ret, n;
>      struct gaicb const **wait_reqs = calloc(nreqs, sizeof(*wait_reqs));
>                  /* NULL elements are ignored by gai_suspend(). */
>  
> @@ -516,7 +516,7 @@ wait_requests(void)
>          return;
>      }
>  
> -    for (i = 0; i < nreqs; i++) {
> +    for (int i = 0; i < nreqs; i++) {
>          if (wait_reqs[i] == NULL)
>              continue;
>  
> @@ -554,11 +554,11 @@ cancel_requests(void)
>  static void
>  list_requests(void)
>  {
> -    int i, ret;
> +    int ret;
>      char host[NI_MAXHOST];
>      struct addrinfo *res;
>  
> -    for (i = 0; i < nreqs; i++) {
> +    for (int i = 0; i < nreqs; i++) {
>          printf("[%02d] %s: ", i, reqs[i]\->ar_name);
>          ret = gai_error(reqs[i]);
>  
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

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

end of thread, other threads:[~2020-09-12  5:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 23:09 [PATCH] getaddrinfo_a.3: Use C99 style to declare loop counter variables Alejandro Colomar
2020-09-12  5:58 ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.