Index: soft/giet_vm/applications/rosenfeld/src/mt19937.c
===================================================================
--- soft/giet_vm/applications/rosenfeld/src/mt19937.c	(revision 772)
+++ soft/giet_vm/applications/rosenfeld/src/mt19937.c	(revision 821)
@@ -54,5 +54,5 @@
 
 static unsigned long mt[N]; /* the array for the state vector  */
-static int mti=N+1; /* mti==N+1 means mt[N] is not initialized */
+static int mti = N + 1 ;    /* mti==N+1 means mt[N] is not initialized */
 
 static int global_seed;
@@ -61,9 +61,8 @@
 void init_genrand(unsigned long s)
 {
-    mt[0]= s & 0xffffffffUL;
+    mt[0] = s & 0xffffffffUL;
     global_seed = s; // modif LL
-    for (mti=1; mti<N; mti++) {
-        mt[mti] = 
-            (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti); 
+    for (mti = 1; mti < N; mti++) {
+        mt[mti] = (1812433253UL * (mt[mti - 1] ^ (mt[mti - 1] >> 30)) + mti); 
         /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
         /* In the previous versions, MSBs of the seed affect   */
@@ -84,20 +83,28 @@
     //init_genrand(19650218UL);
     init_genrand(global_seed);
-    i=1; j=0;
-    k = (N>key_length ? N : key_length);
+    i = 1;
+    j = 0;
+    k = (N > key_length ? N : key_length);
     for (; k; k--) {
-        mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
-            + init_key[j] + j; /* non linear */
-        mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
-        i++; j++;
-        if (i>=N) { mt[0] = mt[N-1]; i=1; }
-        if (j>=key_length) j=0;
-    }
-    for (k=N-1; k; k--) {
-        mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
-            - i; /* non linear */
+        mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1664525UL)) + init_key[j] + j; /* non linear */
         mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
         i++;
-        if (i>=N) { mt[0] = mt[N-1]; i=1; }
+        j++;
+        if (i >= N) {
+            mt[0] = mt[N - 1];
+            i = 1;
+        }
+        if (j >= key_length) {
+            j = 0;
+        }
+    }
+    for (k = N - 1; k; k--) {
+        mt[i] = (mt[i] ^ ((mt[i - 1] ^ (mt[i - 1] >> 30)) * 1566083941UL)) - i; /* non linear */
+        mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
+        i++;
+        if (i >= N) {
+            mt[0] = mt[N - 1];
+            i = 1;
+        }
     }
 
@@ -109,5 +116,5 @@
 {
     unsigned long y;
-    static unsigned long mag01[2]={0x0UL, MATRIX_A};
+    static unsigned long mag01[2] = {0x0UL, MATRIX_A};
     /* mag01[x] = x * MATRIX_A  for x=0,1 */
 
@@ -115,18 +122,19 @@
         int kk;
 
-        if (mti == N+1)   /* if init_genrand() has not been called, */
+        if (mti == N + 1) {  /* if init_genrand() has not been called, */
             //init_genrand(5489UL); /* a default initial seed is used */
             init_genrand(global_seed);
-
-        for (kk=0;kk<N-M;kk++) {
-            y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
-            mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1UL];
-        }
-        for (;kk<N-1;kk++) {
-            y = (mt[kk]&UPPER_MASK)|(mt[kk+1]&LOWER_MASK);
-            mt[kk] = mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
-        }
-        y = (mt[N-1]&UPPER_MASK)|(mt[0]&LOWER_MASK);
-        mt[N-1] = mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1UL];
+        }
+
+        for (kk = 0;kk < N - M; kk++) {
+            y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
+            mt[kk] = mt[kk + M] ^ (y >> 1) ^ mag01[y & 0x1UL];
+        }
+        for (; kk < N - 1; kk++) {
+            y = (mt[kk] & UPPER_MASK) | (mt[kk + 1] & LOWER_MASK);
+            mt[kk] = mt[kk + (M - N)] ^ (y >> 1) ^ mag01[y & 0x1UL];
+        }
+        y = (mt[N - 1] & UPPER_MASK) | (mt[0] & LOWER_MASK);
+        mt[N - 1] = mt[M - 1] ^ (y >> 1) ^ mag01[y & 0x1UL];
 
         mti = 0;
@@ -147,5 +155,5 @@
 long genrand_int31(void)
 {
-    return (long)(genrand_int32()>>1);
+    return (long) (genrand_int32() >> 1);
 }
 
@@ -153,5 +161,5 @@
 double genrand_real1(void)
 {
-    return genrand_int32()*(1.0/4294967295.0); 
+    return genrand_int32() * (1.0 / 4294967295.0); 
     /* divided by 2^32-1 */ 
 }
@@ -160,5 +168,5 @@
 double genrand_real2(void)
 {
-    return genrand_int32()*(1.0/4294967296.0); 
+    return genrand_int32() * (1.0 / 4294967296.0); 
     /* divided by 2^32 */
 }
@@ -167,5 +175,5 @@
 double genrand_real3(void)
 {
-    return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0); 
+    return (((double) genrand_int32()) + 0.5) * (1.0 / 4294967296.0); 
     /* divided by 2^32 */
 }
@@ -174,6 +182,6 @@
 double genrand_res53(void) 
 { 
-    unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6; 
-    return(a*67108864.0+b)*(1.0/9007199254740992.0); 
+    unsigned long a = genrand_int32() >> 5, b = genrand_int32() >> 6; 
+    return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0); 
 } 
 /* These real versions are due to Isaku Wada, 2002/01/09 added */
@@ -182,16 +190,31 @@
 {
     int i;
-    unsigned long init[4]={0x123, 0x234, 0x345, 0x456}, length=4;
+    unsigned long init[4] = {0x123, 0x234, 0x345, 0x456}, length = 4;
     init_by_array(init, length);
     printf("1000 outputs of genrand_int32()\n");
-    for (i=0; i<1000; i++) {
+    for (i = 0; i < 1000; i++) {
         printf("%10lu ", genrand_int32());
-        if (i%5==4) printf("\n");
+        if (i % 5 == 4) {
+            printf("\n");
+        }
     }
     printf("\n1000 outputs of genrand_real2()\n");
-    for (i=0; i<1000; i++) {
+    for (i = 0; i < 1000; i++) {
         printf("%10.8f ", genrand_real2());
-        if (i%5==4) printf("\n");
+        if (i % 5 == 4) {
+            printf("\n");
+        }
     }
     return 0;
 }
+
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
+
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
+
