From patchwork Mon May 7 15:25:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 27147 Received: (qmail 24368 invoked by alias); 7 May 2018 15:25:28 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24356 invoked by uid 89); 7 May 2018 15:25:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy=guidelines, 016 X-HELO: homiemail-a56.g.dreamhost.com From: Siddhesh Poyarekar To: libc-alpha@sourceware.org Subject: [COMMITTED] benchtests: Move iterator declaration into loop header Date: Mon, 7 May 2018 20:55:12 +0530 Message-Id: <20180507152512.1477-1-siddhesh@sourceware.org> This is a minor style change to move the definition of I to its usage scope instead of at the top of the function. This is consistent with glibc style guidelines and more importantly it was getting in the way of my testing. * benchtests/bench-memcpy-walk.c (do_test): Move declaration of I into loop header. * benchtests/bench-memmove-walk.c (do_test): Likewise. --- ChangeLog | 9 ++++++++- benchtests/bench-memcpy-walk.c | 3 +-- benchtests/bench-memmove-walk.c | 5 ++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7397335533..6febbc0017 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2018-05-07 Alexandre Oliva +2018-05-07 Siddhesh Poyarekar + + * benchtests/bench-memcpy-walk.c (test_main): Move declaration + of I into loop header. + * benchtests/bench-memmove-walk.c + (test_main): Likewise. + +2018-05-07 Alexandre Oliva Revert: 2018-04-30 Raymond Nicholson diff --git a/benchtests/bench-memcpy-walk.c b/benchtests/bench-memcpy-walk.c index caf71e51c4..2771f56b1f 100644 --- a/benchtests/bench-memcpy-walk.c +++ b/benchtests/bench-memcpy-walk.c @@ -83,7 +83,6 @@ int test_main (void) { json_ctx_t json_ctx; - size_t i; test_init (); @@ -102,7 +101,7 @@ test_main (void) json_array_end (&json_ctx); json_array_begin (&json_ctx, "results"); - for (i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) + for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) { /* Test length alignments from 0-16 bytes. */ for (int j = 0; j < 8; j++) diff --git a/benchtests/bench-memmove-walk.c b/benchtests/bench-memmove-walk.c index eee5d0bac7..80a7d62d4d 100644 --- a/benchtests/bench-memmove-walk.c +++ b/benchtests/bench-memmove-walk.c @@ -86,7 +86,6 @@ int test_main (void) { json_ctx_t json_ctx; - size_t i; test_init (); @@ -106,7 +105,7 @@ test_main (void) json_array_begin (&json_ctx, "results"); /* Non-overlapping buffers. */ - for (i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) + for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) { /* Test length alignments from 0-16 bytes. */ for (int j = 0; j < 8; j++) @@ -117,7 +116,7 @@ test_main (void) } /* Overlapping buffers. */ - for (i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) + for (size_t i = START_SIZE; i <= MIN_PAGE_SIZE; i <<= 1) { /* Test length alignments from 0-16 bytes. */ for (int j = 0; j < 8; j++)