about summary refs log tree commit diff
path: root/converter
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2006-09-16 18:53:46 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2006-09-16 18:53:46 +0000
commit74f5b2bd2c1d052104b6da996e2ace4cab4bf74c (patch)
tree865bcbf1a4f2577a70bcdd8138bf34932256a734 /converter
parent9fa92debf9dbfa2e4b990260ad3e0a73f3d69ce7 (diff)
downloadnetpbm-mirror-74f5b2bd2c1d052104b6da996e2ace4cab4bf74c.tar.gz
netpbm-mirror-74f5b2bd2c1d052104b6da996e2ace4cab4bf74c.tar.xz
netpbm-mirror-74f5b2bd2c1d052104b6da996e2ace4cab4bf74c.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@58 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter')
-rw-r--r--converter/other/pnmtopalm/gen_palm_colormap.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/converter/other/pnmtopalm/gen_palm_colormap.c b/converter/other/pnmtopalm/gen_palm_colormap.c
index 4b65e631..b71854b2 100644
--- a/converter/other/pnmtopalm/gen_palm_colormap.c
+++ b/converter/other/pnmtopalm/gen_palm_colormap.c
@@ -7,18 +7,25 @@
 
 #include "palm.h"
 
-int main( int argc, char **argv ) {
-
-  int i;
-  Color_s current;
-  Colormap default_map = palmcolor_build_default_8bit_colormap ();
-
-  printf("P3\n%d 1\n255\n", default_map->ncolors);
-  for (i = 0;  i < default_map->ncolors;  i++) {
-    current = default_map->color_entries[i];
-    printf ("%d %d %d\n", (current & 0xFF0000) >> 16, (current & 0xFF00) >> 8, (current & 0xFF));
-    /* printf ("%x:  %d %d %d\n", (current & 0xFF000000) >> 24, (current & 0xFF0000) >> 16, (current & 0xFF00) >> 8, (current & 0xFF)); */
-  };
-  return 0;
+int
+main(int     argc,
+     char ** argv) {
+
+    Colormap const defaultMap = palmcolor_build_default_8bit_colormap();
+
+    unsigned int i;
+    
+    printf("P3\n%d 1\n255\n", defaultMap->ncolors);
+
+    for (i = 0; i < defaultMap->ncolors; ++i) {
+        Color_s const current = defaultMap->color_entries[i];
+
+        printf("%u %u %u\n",
+               (unsigned char)(current >> 16),
+               (unsigned char)(current >>  8),
+               (unsigned char)(current >>  0));
+    }
+
+    return 0;
 }