summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-17 00:44:01 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-17 00:44:01 +0000
commitf4b5f6283c65c88d2d6d5560f2c5ec40eab9bf17 (patch)
treec4b6a693e44b255f3c01397619ae718ff56af733
parent739aebec5ed793f23e63851fa4dac1b2ae6a6d2b (diff)
Convert while(1) loop into do while
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@70 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r--fourier.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/fourier.c b/fourier.c
index af81436..a031365 100644
--- a/fourier.c
+++ b/fourier.c
@@ -49,12 +49,14 @@ DoFourier(void)
clock_t total_time = 0;
int iterations = 0;
static bool is_adjusted = false;
- static int array_size = 100;
+ static int array_size = 50;
if (is_adjusted == false) {
is_adjusted = true;
- while (1) {
+ do {
+ array_size += 50;
+
abase = realloc(abase, array_size * sizeof(double));
if (!abase) {
fprintf(stderr, "Error in %s, could not allocate memory. Exitting...\n", context);
@@ -73,16 +75,7 @@ DoFourier(void)
** less than or equal to the permitted minimum, re-allocate
** larger arrays and try again.
*/
-
- if (DoFPUTransIteration(abase,bbase, array_size) > MINIMUM_TICKS) {
- break;
- }
-
- /*
- ** Make bigger arrays and try again.
- */
- array_size += 50;
- }
+ } while (DoFPUTransIteration(abase,bbase, array_size) <= MINIMUM_TICKS);
} else {
/*
** Don't need self-adjustment. Just allocate the