This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] print length in strrchr benchtest


On Wed, Feb 19, 2014 at 01:41:21AM -0600, Rajalakshmi Srinivasaraghavan wrote:
> The return criteria of strrchr() is to read till NULL even if the
> search character is hit.So its better to print len instead of pos.
> 
> 	benchtests/bench-strrchr.c : print length instead of position

Incorrect ChangeLog format: missing asterisk, unnecessary space before
the colon, comment should be capitalized and should end with a period.

> 
> Signed-off-by: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
> ---
>  benchtests/bench-strrchr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/benchtests/bench-strrchr.c b/benchtests/bench-strrchr.c
> index adcedde..3d42236 100644
> --- a/benchtests/bench-strrchr.c
> +++ b/benchtests/bench-strrchr.c
> @@ -122,7 +122,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
>    else
>      result = NULL;
>  
> -  printf ("Length %4zd, alignment in bytes %2zd:", pos, align * sizeof(CHAR));
> +  printf ("Length %4zd, alignment in bytes %2zd:", len, align * sizeof(CHAR));
>  

Space between sizeof and the bracket following it.  It's an existing
defect, but it could have been fixed with this patch.

>    FOR_EACH_IMPL (impl, 0)
>      do_one_test (impl, (CHAR *) (buf + align), seek_char, result);

I have fixed those and pushed your fix; noted here for your future
submissions.  The formatting patch I've pushed is below.

Thanks,
Siddhesh


commit b8cd1c4ea5788d10bdb586f22a75f38f284ccdf0
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Feb 21 11:31:41 2014 +0530

    Minor formatting fix

diff --git a/ChangeLog b/ChangeLog
index 2a80e08..ddd3247 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-21  Siddhesh Poyarekar  <siddhesh@redhat.com>
+
+	* benchtests/bench-strrchr.c (do_test): Fix minor formatting.
+
 2014-02-21  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
 
 	* benchtests/bench-strrchr.c: Print length instead of position.
diff --git a/benchtests/bench-strrchr.c b/benchtests/bench-strrchr.c
index 3d42236..d5b62e3 100644
--- a/benchtests/bench-strrchr.c
+++ b/benchtests/bench-strrchr.c
@@ -97,7 +97,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
   CHAR *buf = (CHAR *) buf1;
 
   align &= 7;
-  if ( (align + len) * sizeof(CHAR) >= page_size)
+  if ((align + len) * sizeof (CHAR) >= page_size)
     return;
 
   for (i = 0; i < len; ++i)
@@ -122,7 +122,7 @@ do_test (size_t align, size_t pos, size_t len, int seek_char, int max_char)
   else
     result = NULL;
 
-  printf ("Length %4zd, alignment in bytes %2zd:", len, align * sizeof(CHAR));
+  printf ("Length %4zd, alignment in bytes %2zd:", len, align * sizeof (CHAR));
 
   FOR_EACH_IMPL (impl, 0)
     do_one_test (impl, (CHAR *) (buf + align), seek_char, result);

Attachment: pgpLU3oIOPQPv.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]