Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2016-05-12 17:58:51 +0000
committerHenrik Rentz-Reichert2016-05-12 17:58:51 +0000
commitca194fc0bb7fefa1f5c2b38293454b7e5d6f9e48 (patch)
tree311dcd83ec65f27140579a7e1a20675fcb66e3ae /runtime/org.eclipse.etrice.runtime.c/src/util
parent63fc31c930f81b2d6350d759bde58356835b24ea (diff)
downloadorg.eclipse.etrice-ca194fc0bb7fefa1f5c2b38293454b7e5d6f9e48.tar.gz
org.eclipse.etrice-ca194fc0bb7fefa1f5c2b38293454b7e5d6f9e48.tar.xz
org.eclipse.etrice-ca194fc0bb7fefa1f5c2b38293454b7e5d6f9e48.zip
some adjustments in C projects and generators to be ANSI compatible
Diffstat (limited to 'runtime/org.eclipse.etrice.runtime.c/src/util')
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/util/RandomGenerator.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/util/RandomGenerator.c b/runtime/org.eclipse.etrice.runtime.c/src/util/RandomGenerator.c
index b20444b56..cdf42bb6c 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/util/RandomGenerator.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/util/RandomGenerator.c
@@ -26,11 +26,12 @@ void RandomGenerator_init(RandomGenerator* self, etFloat64 seed, etFloat64 min,
etFloat64 RandomGenerator_getNext(RandomGenerator* self){
- self->seed = 1000. * fabs(log(self->seed)); /* shift comma 3 times to get nice values */
- etInt64 resultInt = self->seed; /* get int number left of comma */
- self->seed = self->seed - resultInt; /* cut off everything left of comma */
+ etInt64 resultInt;
+ self->seed = 1000. * fabs(log(self->seed)); /* shift comma 3 times to get nice values */
+ resultInt = self->seed; /* get int number left of comma */
+ self->seed = self->seed - resultInt; /* cut off everything left of comma */
self->current = self->seed*self->range + self->min; /* stretch to range */
- self->seed += 0.1; /** seed must always be bigger than 0 for log in next iteration */
+ self->seed += 0.1; /* seed must always be bigger than 0 for log in next iteration */
return self->current;
}

Back to the top