about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-11-01 15:36:51 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2007-11-01 15:36:51 +0000
commitb276ce71244bdcd5256af8ce54c558aa6e0c1051 (patch)
treefd30335f6266cf31f3276c1ee2b4a3c5572788e5
parent7fd6ea65f94d4a3e130dccbd51f4b3d15be0a5ae (diff)
downloadnetpbm-mirror-b276ce71244bdcd5256af8ce54c558aa6e0c1051.tar.gz
netpbm-mirror-b276ce71244bdcd5256af8ce54c558aa6e0c1051.tar.xz
netpbm-mirror-b276ce71244bdcd5256af8ce54c558aa6e0c1051.zip
Remove ARGS
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@449 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/other/pnmtorast.c139
-rw-r--r--converter/other/rast.h30
2 files changed, 95 insertions, 74 deletions
diff --git a/converter/other/pnmtorast.c b/converter/other/pnmtorast.c
index 7d1ae05a..605e815c 100644
--- a/converter/other/pnmtorast.c
+++ b/converter/other/pnmtorast.c
@@ -15,15 +15,79 @@
 #include "mallocvar.h"
 
 #define MAXCOLORS 256
-static colormap_t* make_pr_colormap ARGS(( colorhist_vector chv, int colors ));
-static colormap_t* make_gray_pr_colormap ARGS(( void ));
-static colormap_t* alloc_pr_colormap ARGS(( void ));
+
+
+
+static colormap_t *
+alloc_pr_colormap(void) {
+
+    colormap_t* pr_colormapP;
+
+    MALLOCVAR(pr_colormapP);
+    if ( pr_colormapP == NULL )
+        pm_error( "out of memory" );
+    pr_colormapP->type = RMT_EQUAL_RGB;
+    pr_colormapP->length = MAXCOLORS;
+    MALLOCARRAY(pr_colormapP->map[0], MAXCOLORS);
+    MALLOCARRAY(pr_colormapP->map[1], MAXCOLORS);
+    MALLOCARRAY(pr_colormapP->map[2], MAXCOLORS);
+    if ( pr_colormapP->map[0] == NULL || 
+         pr_colormapP->map[1] == NULL ||
+         pr_colormapP->map[2] == NULL )
+        pm_error( "out of memory" );
+
+    return pr_colormapP;
+}
+
+
+
+static colormap_t*
+make_pr_colormap(colorhist_vector const chv,
+                 int              const colors) {
+
+    colormap_t* pr_colormapP;
+    int i;
+
+    pr_colormapP = alloc_pr_colormap( );
+
+    for ( i = 0; i < colors; ++i )
+    {
+        pr_colormapP->map[0][i] = PPM_GETR( chv[i].color );
+        pr_colormapP->map[1][i] = PPM_GETG( chv[i].color );
+        pr_colormapP->map[2][i] = PPM_GETB( chv[i].color );
+    }
+    for ( ; i < MAXCOLORS; ++i )
+        pr_colormapP->map[0][i] = pr_colormapP->map[1][i] =
+            pr_colormapP->map[2][i] = 0;
+
+    return pr_colormapP;
+}
+
+
+
+static colormap_t *
+make_gray_pr_colormap(void) {
+
+    colormap_t* pr_colormapP;
+    int i;
+
+    pr_colormapP = alloc_pr_colormap( );
+
+    for ( i = 0; i < MAXCOLORS; ++i )
+    {
+        pr_colormapP->map[0][i] = i;
+        pr_colormapP->map[1][i] = i;
+        pr_colormapP->map[2][i] = i;
+    }
+
+    return pr_colormapP;
+}
+
+
 
 int
-main( argc, argv )
-    int argc;
-    char* argv[];
-{
+main(int argc, char ** argv) {
+
     FILE* ifp;
     xel** xels;
     xel* xelrow;
@@ -247,64 +311,3 @@ main( argc, argv )
     exit( 0 );
 }
 
-static colormap_t*
-make_pr_colormap( chv, colors )
-    colorhist_vector chv;
-    int colors;
-{
-    colormap_t* pr_colormapP;
-    int i;
-
-    pr_colormapP = alloc_pr_colormap( );
-
-    for ( i = 0; i < colors; ++i )
-    {
-        pr_colormapP->map[0][i] = PPM_GETR( chv[i].color );
-        pr_colormapP->map[1][i] = PPM_GETG( chv[i].color );
-        pr_colormapP->map[2][i] = PPM_GETB( chv[i].color );
-    }
-    for ( ; i < MAXCOLORS; ++i )
-        pr_colormapP->map[0][i] = pr_colormapP->map[1][i] =
-            pr_colormapP->map[2][i] = 0;
-
-    return pr_colormapP;
-}
-
-static colormap_t*
-make_gray_pr_colormap( )
-{
-    colormap_t* pr_colormapP;
-    int i;
-
-    pr_colormapP = alloc_pr_colormap( );
-
-    for ( i = 0; i < MAXCOLORS; ++i )
-    {
-        pr_colormapP->map[0][i] = i;
-        pr_colormapP->map[1][i] = i;
-        pr_colormapP->map[2][i] = i;
-    }
-
-    return pr_colormapP;
-}
-
-static colormap_t*
-alloc_pr_colormap( )
-{
-    colormap_t* pr_colormapP;
-
-    MALLOCVAR(pr_colormapP);
-    if ( pr_colormapP == NULL )
-        pm_error( "out of memory" );
-    pr_colormapP->type = RMT_EQUAL_RGB;
-    pr_colormapP->length = MAXCOLORS;
-    MALLOCARRAY(pr_colormapP->map[0], MAXCOLORS);
-    MALLOCARRAY(pr_colormapP->map[1], MAXCOLORS);
-    MALLOCARRAY(pr_colormapP->map[2], MAXCOLORS);
-    if ( pr_colormapP->map[0] == NULL || 
-         pr_colormapP->map[1] == NULL ||
-         pr_colormapP->map[2] == NULL )
-        pm_error( "out of memory" );
-
-    return pr_colormapP;
-}
diff --git a/converter/other/rast.h b/converter/other/rast.h
index 1854e495..e79896ea 100644
--- a/converter/other/rast.h
+++ b/converter/other/rast.h
@@ -97,15 +97,33 @@ typedef struct {
 
 /* And the routine definitions. */
 
-struct pixrect* mem_create ARGS(( int w, int h, int depth ));
-void mem_free ARGS(( struct pixrect* p ));
+struct pixrect *
+mem_create(int const w,
+           int const h,
+           int const depth);
 
-int pr_dump ARGS(( struct pixrect* p, FILE* out, colormap_t* colormap, int type, int copy_flag ));
+void
+mem_free(struct pixrect * const p);
 
-int pr_load_header ARGS(( FILE* in, struct rasterfile* hP ));
+int
+pr_dump(struct pixrect * const p,
+        FILE *           const out,
+        colormap_t *     const colormap,
+        int              const type,
+        int              const copy_flag);
 
-int pr_load_colormap ARGS(( FILE* in, struct rasterfile* hP, colormap_t* colormap ));
+int
+pr_load_header(FILE *              const in,
+               struct rasterfile * const hP);
 
-struct pixrect* pr_load_image ARGS(( FILE* in, struct rasterfile* hP, colormap_t* colormap ));
+int
+pr_load_colormap(FILE *              const in,
+                 struct rasterfile * const hP,
+                 colormap_t *        const colormap);
+
+struct pixrect *
+pr_load_image(FILE *              const in,
+              struct rasterfile * const hP,
+              colormap_t *        const colormap);
 
 #endif