From f4b5f6283c65c88d2d6d5560f2c5ec40eab9bf17 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 17 Nov 2008 00:44:01 +0000 Subject: Convert while(1) loop into do while git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@70 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- fourier.c | 17 +++++------------ 1 file 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 -- cgit v1.2.3