Skip to content

Commit

Permalink
benchtests: Move iterator declaration into loop header
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
siddhesh committed May 7, 2018
1 parent ffa81c2 commit 543477f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 8 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
2018-05-07 Alexandre Oliva <[email protected]>
2018-05-07 Siddhesh Poyarekar <[email protected]>

* 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 <[email protected]>

Revert:
2018-04-30 Raymond Nicholson <[email protected]>
Expand Down
3 changes: 1 addition & 2 deletions benchtests/bench-memcpy-walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ int
test_main (void)
{
json_ctx_t json_ctx;
size_t i;

test_init ();

Expand All @@ -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++)
Expand Down
5 changes: 2 additions & 3 deletions benchtests/bench-memmove-walk.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ int
test_main (void)
{
json_ctx_t json_ctx;
size_t i;

test_init ();

Expand All @@ -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++)
Expand All @@ -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++)
Expand Down

0 comments on commit 543477f

Please sign in to comment.