Index: soft/giet_vm/applications/rosenfeld/src/palette.c
===================================================================
--- soft/giet_vm/applications/rosenfeld/src/palette.c	(revision 772)
+++ soft/giet_vm/applications/rosenfeld/src/palette.c	(revision 821)
@@ -16,18 +16,13 @@
 
 
-#ifdef CLI
 #include "nrc_os_config.h"
 #include "nrc.h"
-#endif
 
 #include "palette.h"
 
-/*
- * Modif : 98-11-18 ajout de Save
- */
-
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_Display(RGBQuad *palette)
-    /* ---------------------------------------------- */
+
+/* --------------------------------- */
+void Palette_Display(RGBQuad * palette)
+/* --------------------------------- */
 {
     int i;
@@ -37,59 +32,18 @@
     }
 }
-/* ----------------------------------------------------------- */
-//IMAGE_EXPORT(void) Palette_Save(RGBQuad *palette, char *filename)
-/* ----------------------------------------------------------- */
-/*{
-  int i, j;
-  int k = 32;
-  int hauteur = k, largeur = k*256;
-  uint8  **X;
-  Image *image;
-
-
-  IConstructor(&image, hauteur, largeur, 0);
-  X = (uint8**) Image_Get_Data(image);
-  for(i=0; i<hauteur; i++) {
-  for(j=0; j<largeur; j++) {
-  X[i][j] = j/k;
-  }
-  }
-//SaveBMP(image, palette, filename);
-IDestructor(&image);
-}*/
-/* --------------------------------------------------------------------- */
-//IMAGE_EXPORT(void) Palette_SaveSub(RGBQuad *palette, int n, char *filename)
-/* --------------------------------------------------------------------- */
-/*{
-  int i, j;
-  int hauteur = 8, largeur = 8*n;
-  uint8  **X;
-  Image *image;
-
-
-  IConstructor(&image, largeur, hauteur, 0);
-  X = (uint8**) Image_Get_Data(image);
-  for(i=0; i<hauteur; i++) {
-  for(j=8; j<=largeur; j++) {
-  X[i][j] = j/8;
-  }
-  }
-//SaveBMP(image, palette, filename);
-IDestructor(&image);
-}*/
+
+
 /* --------------------------------------------------- */
 IMAGE_EXPORT(void) Palette_GrayBlue2Red(RGBQuad *palette)
-    /* --------------------------------------------------- */
-    /* ancien SetupPalette */
-{
-    int i;
-
+/* --------------------------------------------------- */
+/* ancien SetupPalette */
+{
     /*
      * Partie basse : image en niveau de gris
      */
-    for(i=0; i<128; i++) {
-        palette[i].blue     = 2*i;
-        palette[i].green    = 2*i;
-        palette[i].red      = 2*i;
+    for (int i = 0; i < 128; i++) {
+        palette[i].blue     = 2 * i;
+        palette[i].green    = 2 * i;
+        palette[i].red      = 2 * i;
         palette[i].reserved = 0;
     }
@@ -98,9 +52,9 @@
      * degrade de bleus puis degrade de rouges
      */
-    for(i=0; i<128; i++) {
-        palette[i+128].blue     = 255 - 2*i;
-        palette[i+128].green    = 0;
-        palette[i+128].red      = 2*i+1;
-        palette[i+128].reserved = 0;
+    for (int i = 0; i < 128; i++) {
+        palette[i + 128].blue     = 255 - 2 * i;
+        palette[i + 128].green    = 0;
+        palette[i + 128].red      = 2 * i + 1;
+        palette[i + 128].reserved = 0;
     }
     palette[128].blue     = 255;
@@ -113,25 +67,12 @@
     palette[255].red      = 255;
     palette[255].reserved = 0;
-
-    /*for(i=0; i<256; i++) {
-      palette[i].rgbBlue     = i;
-      palette[i].rgbGreen    = i;
-      palette[i].rgbRed      = i;
-      palette[i].rgbReserved = 0;
-      }*/
-
-    /*if(verbose) {
-      for(i=0; i<256; i++) {
-      printf("%d %3d %3d %3d\n", i, Palette[i].rgbRed, Palette[i].rgbGreen, Palette[i].rgbBlue);
-      }
-      }*/
-}
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_Classic(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i;
-
-    for(i=0; i<256; i++) {
+}
+
+
+/* --------------------------------- */
+void Palette_Classic(RGBQuad * palette)
+/* --------------------------------- */
+{
+    for (int i = 0; i < 256; i++) {
         palette[i].blue     = (uint8) i;
         palette[i].green    = (uint8) i;
@@ -140,11 +81,11 @@
     }
 }
-/* ------------------------------------------- */
-IMAGE_EXPORT(void) Palette_Gray(RGBQuad *palette)
-    /* ------------------------------------------- */
-{
-    int i;
-
-    for(i=0; i<256; i++) {
+
+
+/* ------------------------------ */
+void Palette_Gray(RGBQuad * palette)
+/* ------------------------------ */
+{
+    for (int i = 0; i < 256; i++) {
         palette[i].blue     = (uint8) i;
         palette[i].green    = (uint8) i;
@@ -154,13 +95,13 @@
 }
 
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_Pseudo1(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i;
-    for(i=0; i<255; i++) {
-        palette[i].blue     = (uint8) ((3*i)%256);
-        palette[i].green    = (uint8) ((87*i)%256);
-        palette[i].red      = (uint8) ((117*i)%256);
+
+/* --------------------------------- */
+void Palette_Pseudo1(RGBQuad * palette)
+/* --------------------------------- */
+{
+    for (int i = 0; i < 255; i++) {
+        palette[i].blue     = (uint8) ((3 * i) % 256);
+        palette[i].green    = (uint8) ((87 * i) % 256);
+        palette[i].red      = (uint8) ((117 * i) % 256);
         palette[i].reserved = 0;
     }
@@ -170,13 +111,15 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_Pseudo2(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i;
-    for(i=0; i<255; i++) {
-        palette[i].blue     = (uint8) ((     257*i)%256); /* nextprime(256) */
-        palette[i].green    = (uint8) ((   65537*i)%256); /* nextprime(256^2) */
-        palette[i].red      = (uint8) ((16777259*i)%256); /* nextprime(256^3) */
+
+
+/* --------------------------------- */
+void Palette_Pseudo2(RGBQuad * palette)
+/* --------------------------------- */
+{
+    unsigned int i;
+    for (i = 0; i < 255; i++) {
+        palette[i].blue     = (uint8) ((     257 * i) % 256); /* nextprime(256) */
+        palette[i].green    = (uint8) ((   65537 * i) % 256); /* nextprime(256^2) */
+        palette[i].red      = (uint8) ((16777259 * i) % 256); /* nextprime(256^3) */
         palette[i].reserved = 0;
     }
@@ -186,17 +129,19 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ------------------------------------------ */
-IMAGE_EXPORT(void) Palette_Hue(RGBQuad *palette)
-    /* ------------------------------------------ */
+
+
+/* ----------------------------- */
+void Palette_Hue(RGBQuad * palette)
+/* ----------------------------- */
 {
     int i;
     double k, r, g, b; /* alpha rgb */
-    for(i=0; i<255; i++) {
+    for (i = 0; i < 255; i++) {
 
         k = (double) i / 256;
 
         r = 2.0 * k * PI;
-        g = 2.0 * k * PI - (2.0*PI/3.0);
-        b = 2.0 * k * PI  - (4.0*PI/3.0);
+        g = 2.0 * k * PI - (2.0* PI / 3.0);
+        b = 2.0 * k * PI - (4.0* PI / 3.0);
 
         palette[i].blue     = (uint8) (128.0 * (1.0 + cos(b)));
@@ -206,18 +151,20 @@
     }
 }
-/* ------------------------------------------------ */
-IMAGE_EXPORT(void) Palette_RandomHue(RGBQuad *palette)
-    /* ------------------------------------------------ */
+
+
+/* ----------------------------------- */
+void Palette_RandomHue(RGBQuad * palette)
+/* ----------------------------------- */
 {
     int i, ii;
     double k, r, g, b; /* alpha rgb */
-    for(i=0; i<255; i++) {
-
-        ii = (3*i)%256;
+    for (i = 0; i < 255; i++) {
+
+        ii = (3 * i) % 256;
         k = (double) (ii / 256);
 
         r = 2.0 * k * PI;
-        g = 2.0 * k * PI - (2.0*PI/3.0);
-        b = 2.0 * k * PI  - (4.0*PI/3.0);
+        g = 2.0 * k * PI - (2.0 * PI / 3.0);
+        b = 2.0 * k * PI - (4.0 * PI / 3.0);
 
         palette[i].blue     = (uint8) (128.0 * (1.0 + cos(b)));
@@ -227,17 +174,19 @@
     }
 }
-/* -------------------------------------------- */
-IMAGE_EXPORT(void) Palette_HueBW(RGBQuad *palette)
-    /* -------------------------------------------- */
+
+
+/* ------------------------------- */
+void Palette_HueBW(RGBQuad * palette)
+/* ------------------------------- */
 {
     int i;
     double k, r, g, b; /* alpha rgb */
-    for(i=0; i<255; i++) {
+    for (i = 0; i < 255; i++) {
 
         k = (double) i / 256;
 
         r = 2.0 * k * PI;
-        g = 2.0 * k * PI - (2.0*PI/3.0);
-        b = 2.0 * k * PI  - (4.0*PI/3.0);
+        g = 2.0 * k * PI - (2.0 * PI / 3.0);
+        b = 2.0 * k * PI - (4.0 * PI / 3.0);
 
         palette[i].blue     = (uint8) (128.0 * (1.0 + cos(b)));
@@ -256,20 +205,22 @@
     palette[255].reserved = (uint8) 0;
 }
-/* -------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_RandomHueBW(RGBQuad *palette)
-    /* -------------------------------------------------- */
+
+
+/* ------------------------------------- */
+void Palette_RandomHueBW(RGBQuad * palette)
+/* ------------------------------------- */
 {
     int i, ii, im;
     double k, r, g, b; /* alpha rgb */
-    for(i=0; i<255; i++) {
-
-        ii = (7*i)%256;
+    for (i = 0; i < 255; i++) {
+
+        ii = (7 * i) % 256;
         k = (double) ii / 256;
 
         r = 2.0 * k * PI;
-        g = 2.0 * k * PI - (2.0*PI/3.0);
-        b = 2.0 * k * PI  - (4.0*PI/3.0);
-
-        im = (i-27)%255;
+        g = 2.0 * k * PI - (2.0 * PI / 3.0);
+        b = 2.0 * k * PI - (4.0 * PI / 3.0);
+
+        im = (i - 27) % 255;
         im = i;
         palette[im].blue     = (uint8) (128.0 * (1.0 + cos(b)));
@@ -288,10 +239,11 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ------------------------------------------------ */
-IMAGE_EXPORT(void) Palette_3ColorsBW(RGBQuad *palette)
-    /* ------------------------------------------------ */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
+
+
+/* ----------------------------------- */
+void Palette_3ColorsBW(RGBQuad * palette)
+/* ----------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
     RGBQuad pattern[3];
 
@@ -308,9 +260,9 @@
     pattern[2].blue  = bb;
 
-    for(i=0; i<255; i++) {
-        palette[1+i].red      = pattern[i%3].red;
-        palette[1+i].green    = pattern[i%3].green;
-        palette[1+i].blue     = pattern[i%3].blue;
-        palette[1+i].reserved = (uint8) 0;
+    for (int i = 0; i < 255; i++) {
+        palette[1 + i].red      = pattern[i % 3].red;
+        palette[1 + i].green    = pattern[i % 3].green;
+        palette[1 + i].blue     = pattern[i % 3].blue;
+        palette[1 + i].reserved = (uint8) 0;
     }
     palette[0].blue     = (uint8) 0;
@@ -324,10 +276,12 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_3Colors(RGBQuad *palette)
-    /* ---------------------------------------------- */
+
+
+/* --------------------------------- */
+void Palette_3Colors(RGBQuad * palette)
+/* --------------------------------- */
 {
     int i;
-    uint8 rr = 255,gg = 255, bb = 255;
+    uint8 rr = 255, gg = 255, bb = 255;
     RGBQuad pattern[3];
 
@@ -344,17 +298,18 @@
     pattern[2].blue  = bb;
 
-    for(i=0; i<256; i++) {
-        palette[i].red      = pattern[i%3].red;
-        palette[i].green    = pattern[i%3].green;
-        palette[i].blue     = pattern[i%3].blue;
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* -------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_3Colors_Red(RGBQuad *palette)
-    /* -------------------------------------------------- */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
+    for (i = 0; i < 256; i++) {
+        palette[i].red      = pattern[i % 3].red;
+        palette[i].green    = pattern[i % 3].green;
+        palette[i].blue     = pattern[i % 3].blue;
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ------------------------------------- */
+void Palette_3Colors_Red(RGBQuad * palette)
+/* ------------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
     RGBQuad pattern[3];
 
@@ -376,17 +331,18 @@
     palette[0].blue  = pattern[0].blue;
 
-    for(i=0; i<255; i++) {
-        palette[1+i].red      = pattern[1+i%2].red;
-        palette[1+i].green    = pattern[1+i%2].green;
-        palette[1+i].blue     = pattern[1+i%2].blue;
-        palette[1+i].reserved = (uint8) 0;
-    }
-}
-/* ------------------------------------------------ */
-IMAGE_EXPORT(void) Palette_6ColorsBW(RGBQuad *palette)
-    /* ------------------------------------------------ */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
+    for (int i = 0; i < 255; i++) {
+        palette[1 + i].red      = pattern[1 + i % 2].red;
+        palette[1 + i].green    = pattern[1 + i % 2].green;
+        palette[1 + i].blue     = pattern[1 + i % 2].blue;
+        palette[1 + i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ----------------------------------- */
+void Palette_6ColorsBW(RGBQuad * palette)
+/* ----------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
     RGBQuad pattern[6];
 
@@ -415,9 +371,9 @@
     pattern[5].blue  = bb;
 
-    for(i=0; i<255; i++) {
-        palette[1+i].red      = pattern[i%6].red;
-        palette[1+i].green    = pattern[i%6].green;
-        palette[1+i].blue     = pattern[i%6].blue;
-        palette[1+i].reserved = (uint8) 0;
+    for (int i = 0; i < 255; i++) {
+        palette[1 + i].red      = pattern[i % 6].red;
+        palette[1 + i].green    = pattern[i % 6].green;
+        palette[1 + i].blue     = pattern[i % 6].blue;
+        palette[1 + i].reserved = (uint8) 0;
     }
     palette[0].blue     = (uint8) 0;
@@ -431,10 +387,11 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_6Colors(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
+
+
+/* --------------------------------- */
+void Palette_6Colors(RGBQuad * palette)
+/* --------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
     RGBQuad pattern[6];
 
@@ -463,17 +420,18 @@
     pattern[5].blue  = bb;
 
-    for(i=0; i<256; i++) {
-        palette[i].red      = pattern[i%6].red;
-        palette[i].green    = pattern[i%6].green;
-        palette[i].blue     = pattern[i%6].blue;
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* -------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_6Colors_Red(RGBQuad *palette)
-    /* -------------------------------------------------- */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
+    for (int i = 0; i < 256; i++) {
+        palette[i].red      = pattern[i % 6].red;
+        palette[i].green    = pattern[i % 6].green;
+        palette[i].blue     = pattern[i % 6].blue;
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ------------------------------------- */
+void Palette_6Colors_Red(RGBQuad * palette)
+/* ------------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
     RGBQuad pattern[6];
 
@@ -507,18 +465,20 @@
     palette[0].blue  = pattern[0].blue;
 
-    for(i=0; i<255; i++) {
-        palette[1+i].red      = pattern[1+i%5].red;
-        palette[1+i].green    = pattern[1+i%5].green;
-        palette[1+i].blue     = pattern[1+i%5].blue;
-        palette[1+i].reserved = (uint8) 0;
-    }
-}
-/* ------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_18ColorsBW(RGBQuad *palette)
-    /* ------------------------------------------------- */
+    for (int i = 0; i < 255; i++) {
+        palette[1 + i].red      = pattern[1 + i % 5].red;
+        palette[1 + i].green    = pattern[1 + i % 5].green;
+        palette[1 + i].blue     = pattern[1 + i % 5].blue;
+        palette[1 + i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ------------------------------------ */
+void Palette_18ColorsBW(RGBQuad * palette)
+/* ------------------------------------ */
 {
     int i;
-    uint8 rr = 255,gg = 255, bb = 255;
-    uint8  r  =127, g = 127,  b = 127;
+    uint8 rr = 255, gg = 255, bb = 255;
+    uint8  r = 127, g = 127,  b = 127;
 
     RGBQuad pattern[18];
@@ -596,9 +556,9 @@
     pattern[17].blue  = bb;
 
-    for(i=0; i<255; i++) {
-        palette[1+i].red      = pattern[i%18].red;
-        palette[1+i].green    = pattern[i%18].green;
-        palette[1+i].blue     = pattern[i%18].blue;
-        palette[1+i].reserved = (uint8) 0;
+    for (int i = 0; i < 255; i++) {
+        palette[1 + i].red      = pattern[i % 18].red;
+        palette[1 + i].green    = pattern[i % 18].green;
+        palette[1 + i].blue     = pattern[i % 18].blue;
+        palette[1 + i].reserved = (uint8) 0;
     }
     palette[0].blue     = (uint8) 0;
@@ -612,11 +572,12 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ----------------------------------------------- */
-IMAGE_EXPORT(void) Palette_18Colors(RGBQuad *palette)
-    /* ----------------------------------------------- */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
-    uint8  r  =127, g = 127,  b = 127;
+
+
+/* ---------------------------------- */
+void Palette_18Colors(RGBQuad * palette)
+/* ---------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
+    uint8  r = 127, g = 127,  b = 127;
 
     RGBQuad pattern[18];
@@ -694,17 +655,18 @@
     pattern[17].blue  = bb;
 
-    for(i=0; i<256; i++) {
-        palette[i].red      = pattern[i%18].red;
-        palette[i].green    = pattern[i%18].green;
-        palette[i].blue     = pattern[i%18].blue;
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* ------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_64ColorsBW(RGBQuad *palette)
-    /* ------------------------------------------------- */
-{
-    int r, g, b;
-    int i, m;
+    for (int i = 0; i < 256; i++) {
+        palette[i].red      = pattern[i % 18].red;
+        palette[i].green    = pattern[i % 18].green;
+        palette[i].blue     = pattern[i % 18].blue;
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ------------------------------------ */
+void Palette_64ColorsBW(RGBQuad * palette)
+/* ------------------------------------ */
+{
+    int m;
     //uint8 x1 = 64, x2 = 128, x3 = 192, x4 = 255;
     uint8 X[4];
@@ -717,7 +679,7 @@
 
     m = 1;
-    for(r=0; r<4; r++) {
-        for(g=0; g<4; g++) {
-            for(b=0; b<4; b++) {
+    for (int r = 0; r < 4; r++) {
+        for (int g = 0; g < 4; g++) {
+            for (int b = 0; b < 4; b++) {
                 palette[m].red   = X[r];
                 palette[m].green = X[g];
@@ -728,9 +690,9 @@
     }
 
-    for(i=0; i<255-(1+m); i++) {
-        palette[1+m+i].red      = palette[i%m].red;
-        palette[1+m+i].green    = palette[i%m].green;
-        palette[1+m+i].blue     = palette[i%m].blue;
-        palette[1+m+i].reserved = (uint8) 0;
+    for (int i = 0; i < 255 - (1 + m); i++) {
+        palette[1 + m + i].red      = palette[i % m].red;
+        palette[1 + m + i].green    = palette[i % m].green;
+        palette[1 + m + i].blue     = palette[i % m].blue;
+        palette[1 + m + i].reserved = (uint8) 0;
     }
     palette[0].blue     = (uint8) 0;
@@ -744,9 +706,10 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_256ColorsBW(RGBQuad *palette)
-    /* ------------------------------------------------- */
-{
-    int r, g, b;
+
+
+/* ------------------------------------- */
+void Palette_256ColorsBW(RGBQuad * palette)
+/* ------------------------------------- */
+{
     int m;
     //uint8 x1 = 64, x2 = 128, x3 = 192, x4 = 255;
@@ -764,14 +727,14 @@
 
     m = 1;
-    for(r=0; r<8; r++) {
-        for(g=0; g<8; g++) {
-            for(b=0; b<8; b++) {
-                if(m<255) {
+    for (int r = 0; r < 8; r++) {
+        for (int g = 0; g < 8; g++) {
+            for (int b = 0; b < 8; b++) {
+                if (m < 255) {
                     xr = X[r]; xg = X[g]; xb = X[b];
                     palette[m].red   = xr;
                     palette[m].green = xg;
                     palette[m].blue  = xb;
-                    if((xr!=255) && (xg!=255) && (xb!=255)) m++;
-                    if((xr!=000) && (xg!=000) && (xb!=000)) m++;
+                    if ((xr != 255) && (xg != 255) && (xb != 255)) m++;
+                    if ((xr != 000) && (xg != 000) && (xb != 000)) m++;
                 }
             }
@@ -789,11 +752,12 @@
     palette[255].reserved = (uint8) 0;
 }
-/* ----------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_18ColorsBW_Red(RGBQuad *palette)
-    /* ----------------------------------------------------- */
-{
-    int i;
-    uint8 rr = 255,gg = 255, bb = 255;
-    uint8  r  =127, g = 127,  b = 127;
+
+
+/* ---------------------------------------- */
+void Palette_18ColorsBW_Red(RGBQuad * palette)
+/* ---------------------------------------- */
+{
+    uint8 rr = 255, gg = 255, bb = 255;
+    uint8  r = 127, g = 127,  b = 127;
 
     RGBQuad pattern[18];
@@ -871,9 +835,9 @@
     pattern[17].blue  = bb;
 
-    for(i=0; i<254; i++) {
-        palette[2+i].red      = pattern[1+i%17].red;
-        palette[2+i].green    = pattern[1+i%17].green;
-        palette[2+i].blue     = pattern[1+i%17].blue;
-        palette[2+i].reserved = (uint8) 0;
+    for (int i = 0; i < 254; i++) {
+        palette[2 + i].red      = pattern[1 + i % 17].red;
+        palette[2 + i].green    = pattern[1 + i % 17].green;
+        palette[2 + i].blue     = pattern[1 + i % 17].blue;
+        palette[2 + i].reserved = (uint8) 0;
     }
     /* noir en 0 */
@@ -890,9 +854,10 @@
     palette[255].blue  = gg;
 }
-/* -------------------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_18ColorsBW_RedGreenBlue(RGBQuad *palette)
-    /* -------------------------------------------------------------- */
-{
-    int i;
+
+
+/* ------------------------------------------------- */
+void Palette_18ColorsBW_RedGreenBlue(RGBQuad * palette)
+/* ------------------------------------------------- */
+{
     uint8 i0 = 255;
     uint8 i1 = 127;
@@ -965,9 +930,9 @@
     pattern[14].blue  = i0;
 
-    for(i=0; i<=250; i++) {
-        palette[4+i].red      = pattern[i%14].red;
-        palette[4+i].green    = pattern[i%14].green;
-        palette[4+i].blue     = pattern[i%14].blue;
-        palette[4+i].reserved = (uint8) 0;
+    for (int i = 0; i <= 250; i++) {
+        palette[4 + i].red      = pattern[i % 14].red;
+        palette[4 + i].green    = pattern[i % 14].green;
+        palette[4 + i].blue     = pattern[i % 14].blue;
+        palette[4 + i].reserved = (uint8) 0;
     }
 
@@ -997,126 +962,101 @@
     palette[255].blue  = i0;
 }
-/* ---------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_3ColorsGrayBW(RGBQuad *palette)
-    /* ---------------------------------------------------- */
-{
-    int i;
-
+
+
+/* --------------------------------------- */
+void Palette_3ColorsGrayBW(RGBQuad * palette)
+/* --------------------------------------- */
+{
     Palette_3ColorsBW(palette);
 
-    for(i=128; i<256; i++) {
-        palette[i].red      = 1 + 2*(i-128);
-        palette[i].green    = 1 + 2*(i-128);
-        palette[i].blue     = 1 + 2*(i-128);
-        palette[i].reserved = (uint8) 0;
-    }
-    /* palette[255] = blanc <- OK */
-}
-/* -------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_3ColorsGray(RGBQuad *palette)
-    /* -------------------------------------------------- */
-{
-    int i;
-
+    for (int i = 128; i < 256; i++) {
+        palette[i].red      = 1 + 2 * (i - 128);
+        palette[i].green    = 1 + 2 * (i - 128);
+        palette[i].blue     = 1 + 2 * (i - 128);
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ------------------------------------- */
+void Palette_3ColorsGray(RGBQuad * palette)
+/* ------------------------------------- */
+{
     Palette_3Colors(palette);
 
-    for(i=128; i<256; i++) {
-        palette[i].red      = 1 + 2*(i-128);
-        palette[i].green    = 1 + 2*(i-128);
-        palette[i].blue     = 1 + 2*(i-128);
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* ---------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_6ColorsGrayBW(RGBQuad *palette)
-    /* ---------------------------------------------------- */
-{
-    int i;
-
+    for (int i = 128; i < 256; i++) {
+        palette[i].red      = 1 + 2 * (i - 128);
+        palette[i].green    = 1 + 2 * (i - 128);
+        palette[i].blue     = 1 + 2 * (i - 128);
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* --------------------------------------- */
+void Palette_6ColorsGrayBW(RGBQuad * palette)
+/* --------------------------------------- */
+{
     Palette_6ColorsBW(palette);
 
-    for(i=128; i<256; i++) {
-        palette[i].red      = 1 + 2*(i-128);
-        palette[i].green    = 1 + 2*(i-128);
-        palette[i].blue     = 1 + 2*(i-128);
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* -------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_6ColorsGray(RGBQuad *palette)
-    /* -------------------------------------------------- */
-{
-    int i;
-
+    for (int i = 128; i < 256; i++) {
+        palette[i].red      = 1 + 2 * (i - 128);
+        palette[i].green    = 1 + 2 * (i - 128);
+        palette[i].blue     = 1 + 2 * (i - 128);
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ------------------------------------- */
+void Palette_6ColorsGray(RGBQuad * palette)
+/* ------------------------------------- */
+{
     Palette_6Colors(palette);
 
-    for(i=128; i<256; i++) {
-        palette[i].red      = 1 + 2*(i-128);
-        palette[i].green    = 1 + 2*(i-128);
-        palette[i].blue     = 1 + 2*(i-128);
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* ----------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_18ColorsGrayBW(RGBQuad *palette)
-    /* ----------------------------------------------------- */
-{
-    int i;
-
+    for (int i = 128; i < 256; i++) {
+        palette[i].red      = 1 + 2 * (i - 128);
+        palette[i].green    = 1 + 2 * (i - 128);
+        palette[i].blue     = 1 + 2 * (i - 128);
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ---------------------------------------- */
+void Palette_18ColorsGrayBW(RGBQuad * palette)
+/* ---------------------------------------- */
+{
     Palette_18ColorsBW(palette);
 
-    for(i=128; i<256; i++) {
-        palette[i].red      = 1 + 2*(i-128);
-        palette[i].green    = 1 + 2*(i-128);
-        palette[i].blue     = 1 + 2*(i-128);
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* --------------------------------------------------- */
-IMAGE_EXPORT(void) Palette_18ColorsGray(RGBQuad *palette)
-    /* --------------------------------------------------- */
-{
-    int i;
-
+    for (int i = 128; i < 256; i++) {
+        palette[i].red      = 1 + 2 * (i - 128);
+        palette[i].green    = 1 + 2 * (i - 128);
+        palette[i].blue     = 1 + 2 * (i - 128);
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* -------------------------------------- */
+void Palette_18ColorsGray(RGBQuad * palette)
+/* -------------------------------------- */
+{
     Palette_18Colors(palette);
 
-    for(i=128; i<256; i++) {
-        palette[i].red      = 1 + 2*(i-128);
-        palette[i].green    = 1 + 2*(i-128);
-        palette[i].blue     = 1 + 2*(i-128);
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* -------------------------------------------------------------------- */
-//IMAGE_EXPORT(void) Palette_PackGrayLower(Image *src, Lut *lut, Image *dst)
-/* -------------------------------------------------------------------- */
-/*{
-  int k;
-  uint8 *l = (uint8*) Lut_Get_Data(lut);
-
-  for(k=0; k<256; k++) {
-  l[k] = (uint8) (k >> 1);
-  }
-
-  Lut_Apply(src, lut, dst);
-  }*/
-/* -------------------------------------------------------------------- */
-//IMAGE_EXPORT(void) Palette_PackGrayUpper(Image *src, Lut *lut, Image *dst)
-/* -------------------------------------------------------------------- */
-/*{
-  int k;
-  uint8 *l = (uint8*) Lut_Get_Data(lut);
-
-  for(k=0; k<256; k++) {
-  l[k] = (uint8) 128 + (k >> 1);
-  }
-
-  Lut_Apply(src, lut, dst);
-  }*/
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_2Colors(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i, level;
+    for(int i = 128; i < 256; i++) {
+        palette[i].red      = 1 + 2 * (i - 128);
+        palette[i].green    = 1 + 2 * (i - 128);
+        palette[i].blue     = 1 + 2 * (i - 128);
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* --------------------------------- */
+void Palette_2Colors(RGBQuad * palette)
+/* --------------------------------- */
+{
+    int level;
 
     RGBQuad pattern[2];
@@ -1132,21 +1072,23 @@
     pattern[1].blue  = level;
 
-    for(i=0; i<256; i++) {
-        palette[i].red      = pattern[i%2].red;
-        palette[i].green    = pattern[i%2].green;
-        palette[i].blue     = pattern[i%2].blue;
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_4Colors(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i, level;
+    for (int i = 0; i < 256; i++) {
+        palette[i].red      = pattern[i % 2].red;
+        palette[i].green    = pattern[i % 2].green;
+        palette[i].blue     = pattern[i % 2].blue;
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* --------------------------------- */
+void Palette_4Colors(RGBQuad * palette)
+/* --------------------------------- */
+{
+    int level;
 
     RGBQuad pattern[4];
 
-    for(i=0; i<2; i++) {
-        level = (i<<8) - 1;
+    for (int i = 0; i < 2; i++) {
+        level = (i << 8) - 1;
         pattern[i].red   = level;
         pattern[0].green = level;
@@ -1154,21 +1096,23 @@
     }
 
-    for(i=0; i<256; i++) {
-        palette[i].red      = pattern[i%2].red;
-        palette[i].green    = pattern[i%2].green;
-        palette[i].blue     = pattern[i%2].blue;
-        palette[i].reserved = (uint8) 0;
-    }
-}
-/* ---------------------------------------------- */
-IMAGE_EXPORT(void) Palette_16Colors(RGBQuad *palette)
-    /* ---------------------------------------------- */
-{
-    int i, level;
+    for (int i = 0; i < 256; i++) {
+        palette[i].red      = pattern[i % 2].red;
+        palette[i].green    = pattern[i % 2].green;
+        palette[i].blue     = pattern[i % 2].blue;
+        palette[i].reserved = (uint8) 0;
+    }
+}
+
+
+/* ---------------------------------- */
+void Palette_16Colors(RGBQuad * palette)
+/* ---------------------------------- */
+{
+    int level;
 
     RGBQuad pattern[16];
 
-    for(i=0; i<4; i++) {
-        level = (i<<8) - 1;
+    for (int i = 0; i < 4; i++) {
+        level = (i << 8) - 1;
         pattern[i].red   = level;
         pattern[0].green = level;
@@ -1176,9 +1120,20 @@
     }
 
-    for(i=0; i<256; i++) {
-        palette[i].red      = pattern[i%2].red;
-        palette[i].green    = pattern[i%2].green;
-        palette[i].blue     = pattern[i%2].blue;
-        palette[i].reserved = (uint8) 0;
-    }
-}
+    for (int i = 0; i < 256; i++) {
+        palette[i].red      = pattern[i % 2].red;
+        palette[i].green    = pattern[i % 2].green;
+        palette[i].blue     = pattern[i % 2].blue;
+        palette[i].reserved = (uint8) 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
+
