summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2008-11-17 04:45:41 +0000
committerMatt Turner <mattst88@gmail.com>2008-11-17 04:45:41 +0000
commit10a5d62de08035803b5fadc5fcd32c873f8b1702 (patch)
treef8f0cc6dcb877084be2e5865d493de0568c751ff
parenta7d42b99065f359a89bff6052a6c4578bf848310 (diff)
Convert for-if-break construct into do while
git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@77 0d43b9a7-5ab2-4d7b-af9d-f64450cef757
-rw-r--r--neural.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/neural.c b/neural.c
index 996d5cd..05e7c2b 100644
--- a/neural.c
+++ b/neural.c
@@ -120,7 +120,7 @@ DoNNET(void)
clock_t total_time = 0;
int iterations = 0;
static bool is_adjusted = false;
- static int loops = 1;
+ static int loops = 0;
/*
** Init random number generator.
@@ -151,12 +151,10 @@ DoNNET(void)
** # of loops and increasing the loop count until we
** get a number of loops that we can use.
*/
- for (; loops < LOOP_MAX; loops++) {
- randnum((int32_t)3);
- if(DoNNetIteration(loops) > MINIMUM_TICKS) {
- break;
- }
- }
+ do {
+ randnum(3);
+ ++loops;
+ } while ((DoNNetIteration(loops) <= MINIMUM_TICKS) && (loops < LOOP_MAX));
}
do {