[v2] stdio-common/printf-prs.c: Reword comment

Message ID 20210324182915.29042-1-alx.manpages@gmail.com
State Committed
Commit 8786bf6eb60cd5e2c80bace42714b4de3bda8c4e
Delegated to: Adhemerval Zanella Netto
Headers
Series [v2] stdio-common/printf-prs.c: Reword comment |

Commit Message

Alejandro Colomar March 24, 2021, 6:29 p.m. UTC
  'this' can be understood as the current parameter, but in this case it
is meaning the other one, the one holding the width/precission.

'it' better describes that parameter, differentiating it from the
one corresponding to the current specifier.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 stdio-common/printf-prs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Adhemerval Zanella Netto March 29, 2021, 9:04 p.m. UTC | #1
On 24/03/2021 15:29, Alejandro Colomar via Libc-alpha wrote:
> 'this' can be understood as the current parameter, but in this case it
> is meaning the other one, the one holding the width/precission.
> 
> 'it' better describes that parameter, differentiating it from the
> one corresponding to the current specifier.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

We don't use SCO, but rather Copyright assignment.  The rest looks good
to me (although I am not a native speaker).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  stdio-common/printf-prs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/stdio-common/printf-prs.c b/stdio-common/printf-prs.c
> index 1d4e00553d..8ebf09a0a9 100644
> --- a/stdio-common/printf-prs.c
> +++ b/stdio-common/printf-prs.c
> @@ -72,11 +72,11 @@ parse_printf_format (const char *fmt, size_t n, int *argtypes)
>        /* Parse this spec.  */
>        nargs += __parse_one_specmb (f, nargs, &spec, &max_ref_arg);
>  
> -      /* If the width is determined by an argument this is an int.  */
> +      /* If the width is determined by an argument, it is an int.  */
>        if (spec.width_arg != -1 && (size_t) spec.width_arg < n)
>  	argtypes[spec.width_arg] = PA_INT;
>  
> -      /* If the precision is determined by an argument this is an int.  */
> +      /* If the precision is determined by an argument, it is an int.  */
>        if (spec.prec_arg != -1 && (size_t) spec.prec_arg < n)
>  	argtypes[spec.prec_arg] = PA_INT;
>  
>
  
Alejandro Colomar March 29, 2021, 9:53 p.m. UTC | #2
On 3/29/21 11:04 PM, Adhemerval Zanella wrote:
> 
> 
> On 24/03/2021 15:29, Alejandro Colomar via Libc-alpha wrote:
>> 'this' can be understood as the current parameter, but in this case it
>> is meaning the other one, the one holding the width/precission.
>>
>> 'it' better describes that parameter, differentiating it from the
>> one corresponding to the current specifier.
>>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> 
> We don't use SCO, but rather Copyright assignment.  The rest looks good
> to me (although I am not a native speaker).

I hope you don't need a copyright assignment for such a small change :).
 I guess a simple statement in this email that you can do as you wish
with this patch should be enough.

Anyway, I hereby assign copyright of this patch to the glibc copyright
holder(s).

Cheers,

Alex



> 
> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
> 
>> ---
>>  stdio-common/printf-prs.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/stdio-common/printf-prs.c b/stdio-common/printf-prs.c
>> index 1d4e00553d..8ebf09a0a9 100644
>> --- a/stdio-common/printf-prs.c
>> +++ b/stdio-common/printf-prs.c
>> @@ -72,11 +72,11 @@ parse_printf_format (const char *fmt, size_t n, int *argtypes)
>>        /* Parse this spec.  */
>>        nargs += __parse_one_specmb (f, nargs, &spec, &max_ref_arg);
>>  
>> -      /* If the width is determined by an argument this is an int.  */
>> +      /* If the width is determined by an argument, it is an int.  */
>>        if (spec.width_arg != -1 && (size_t) spec.width_arg < n)
>>  	argtypes[spec.width_arg] = PA_INT;
>>  
>> -      /* If the precision is determined by an argument this is an int.  */
>> +      /* If the precision is determined by an argument, it is an int.  */
>>        if (spec.prec_arg != -1 && (size_t) spec.prec_arg < n)
>>  	argtypes[spec.prec_arg] = PA_INT;
>>  
>>
  
Adhemerval Zanella Netto March 30, 2021, 12:12 p.m. UTC | #3
On 29/03/2021 18:53, Alejandro Colomar (man-pages) wrote:
> 
> 
> On 3/29/21 11:04 PM, Adhemerval Zanella wrote:
>>
>>
>> On 24/03/2021 15:29, Alejandro Colomar via Libc-alpha wrote:
>>> 'this' can be understood as the current parameter, but in this case it
>>> is meaning the other one, the one holding the width/precission.
>>>
>>> 'it' better describes that parameter, differentiating it from the
>>> one corresponding to the current specifier.
>>>
>>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>>
>> We don't use SCO, but rather Copyright assignment.  The rest looks good
>> to me (although I am not a native speaker).
> 
> I hope you don't need a copyright assignment for such a small change :).
>  I guess a simple statement in this email that you can do as you wish
> with this patch should be enough.

I don't think it would require for such changes, it is more a warning that
we do use 'Signed-off-by:' in the patch submission.

> 
> Anyway, I hereby assign copyright of this patch to the glibc copyright
> holder(s).

This change is simple and fits in the trivial one, I will push it for you.

> 
> Cheers,
> 
> Alex
> 
> 
> 
>>
>> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
>>
>>> ---
>>>  stdio-common/printf-prs.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/stdio-common/printf-prs.c b/stdio-common/printf-prs.c
>>> index 1d4e00553d..8ebf09a0a9 100644
>>> --- a/stdio-common/printf-prs.c
>>> +++ b/stdio-common/printf-prs.c
>>> @@ -72,11 +72,11 @@ parse_printf_format (const char *fmt, size_t n, int *argtypes)
>>>        /* Parse this spec.  */
>>>        nargs += __parse_one_specmb (f, nargs, &spec, &max_ref_arg);
>>>  
>>> -      /* If the width is determined by an argument this is an int.  */
>>> +      /* If the width is determined by an argument, it is an int.  */
>>>        if (spec.width_arg != -1 && (size_t) spec.width_arg < n)
>>>  	argtypes[spec.width_arg] = PA_INT;
>>>  
>>> -      /* If the precision is determined by an argument this is an int.  */
>>> +      /* If the precision is determined by an argument, it is an int.  */
>>>        if (spec.prec_arg != -1 && (size_t) spec.prec_arg < n)
>>>  	argtypes[spec.prec_arg] = PA_INT;
>>>  
>>>
>
  

Patch

diff --git a/stdio-common/printf-prs.c b/stdio-common/printf-prs.c
index 1d4e00553d..8ebf09a0a9 100644
--- a/stdio-common/printf-prs.c
+++ b/stdio-common/printf-prs.c
@@ -72,11 +72,11 @@  parse_printf_format (const char *fmt, size_t n, int *argtypes)
       /* Parse this spec.  */
       nargs += __parse_one_specmb (f, nargs, &spec, &max_ref_arg);
 
-      /* If the width is determined by an argument this is an int.  */
+      /* If the width is determined by an argument, it is an int.  */
       if (spec.width_arg != -1 && (size_t) spec.width_arg < n)
 	argtypes[spec.width_arg] = PA_INT;
 
-      /* If the precision is determined by an argument this is an int.  */
+      /* If the precision is determined by an argument, it is an int.  */
       if (spec.prec_arg != -1 && (size_t) spec.prec_arg < n)
 	argtypes[spec.prec_arg] = PA_INT;