about summary refs log tree commit diff
path: root/converter/other/fiasco
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-04-10 16:07:24 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2010-04-10 16:07:24 +0000
commit7d714381d1af9f51ae0094df79e1fe8d28c46b84 (patch)
treecf576cb526aa84b025b3bb599062e1849a55a3b0 /converter/other/fiasco
parent73225706f044df73549d0982e782b41ff94e117f (diff)
downloadnetpbm-mirror-7d714381d1af9f51ae0094df79e1fe8d28c46b84.tar.gz
netpbm-mirror-7d714381d1af9f51ae0094df79e1fe8d28c46b84.tar.xz
netpbm-mirror-7d714381d1af9f51ae0094df79e1fe8d28c46b84.zip
Fix compiler warnings
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1185 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/fiasco')
-rw-r--r--converter/other/fiasco/lib/dither.c22
-rw-r--r--converter/other/fiasco/params.c150
2 files changed, 82 insertions, 90 deletions
diff --git a/converter/other/fiasco/lib/dither.c b/converter/other/fiasco/lib/dither.c
index a39afa3c..a26e0541 100644
--- a/converter/other/fiasco/lib/dither.c
+++ b/converter/other/fiasco/lib/dither.c
@@ -65,19 +65,22 @@
 static int 
 display_16_bit (const struct fiasco_renderer *this, unsigned char *ximage,
 		const fiasco_image_t *fiasco_image);
+
 static int 
 display_24_bit_bgr (const struct fiasco_renderer *this, unsigned char *ximage,
 		    const fiasco_image_t *fiasco_image);
+
 static int 
 display_24_bit_rgb (const struct fiasco_renderer *this, unsigned char *ximage,
 		    const fiasco_image_t *fiasco_image);
+
 static int 
 display_32_bit (const struct fiasco_renderer *this, unsigned char *ximage,
 		const fiasco_image_t *fiasco_image);
+
 static int
 free_bits_at_bottom (unsigned long a);
-static int
-free_bits_at_top (unsigned long a);
+
 static int
 number_of_bits_set (unsigned long a);
 
@@ -345,21 +348,6 @@ number_of_bits_set (unsigned long a)
 }
 
 static int
-free_bits_at_top (unsigned long a)
-/*
- *  How many 0 bits are there at most significant end of longword.
- *  Low performance, do not call often.
- */
-{
-   if(!a)				/* assume char is 8 bits */
-      return sizeof (unsigned long) * 8;
-   else if (((long) a) < 0l)		/* assume twos complement */
-      return 0;
-   else
-      return 1 + free_bits_at_top ( a << 1);
-}
-
-static int
 free_bits_at_bottom (unsigned long a)
 /*
  *  How many 0 bits are there at least significant end of longword.
diff --git a/converter/other/fiasco/params.c b/converter/other/fiasco/params.c
index 7a302b82..a5aefbd6 100644
--- a/converter/other/fiasco/params.c
+++ b/converter/other/fiasco/params.c
@@ -631,6 +631,8 @@ read_parameter_file (param_t *params, FILE *file)
    }
 }   
 
+
+
 static void 
 usage (const param_t *params, const char *progname, const char *synopsis,
        const char *comment, const char *non_opt_string,
@@ -647,82 +649,84 @@ usage (const param_t *params, const char *progname, const char *synopsis,
  *  No return value.
  */
 {
-   int	  i;
-   size_t width = 0;
+    int	  i;
+    size_t width = 0;
    
-   fprintf (stderr, "Usage: %s [OPTION]...%s\n", progname,
-	    non_opt_string ? non_opt_string : " ");
-   if (synopsis != NULL)
-      fprintf (stderr, synopsis);
-   fprintf (stderr, "\n\n");
-   fprintf (stderr, "Mandatory or optional arguments to long options "
-	    "are mandatory or optional\nfor short options too. "
-	    "Default values are surrounded by {}.\n");
-   for (i = 0; params [i].name != NULL; i++)
-      if (params [i].optchar != '\0' || show_all_options)
-      {
-	 if (params [i].type == POSTR)
-	    width = max (width, (strlen (params [i].name)
-				 + strlen (params [i].argument_name) + 2));
-	 else if (params [i].type != PFLAG)
-	    width = max (width, (strlen (params [i].name)
-				 + strlen (params [i].argument_name)));
-	 else
-	    width = max (width, (strlen (params [i].name)) - 1);
-      }
+    fprintf (stderr, "Usage: %s [OPTION]...%s\n", progname,
+             non_opt_string ? non_opt_string : " ");
+    if (synopsis != NULL)
+        fprintf (stderr, synopsis);
+    fprintf (stderr, "\n\n");
+    fprintf (stderr, "Mandatory or optional arguments to long options "
+             "are mandatory or optional\nfor short options too. "
+             "Default values are surrounded by {}.\n");
+    for (i = 0; params [i].name != NULL; i++)
+        if (params [i].optchar != '\0' || show_all_options)
+        {
+            if (params [i].type == POSTR)
+                width = max (width, (strlen (params [i].name)
+                                     + strlen (params [i].argument_name) + 2));
+            else if (params [i].type != PFLAG)
+                width = max (width, (strlen (params [i].name)
+                                     + strlen (params [i].argument_name)));
+            else
+                width = max (width, (strlen (params [i].name)) - 1);
+        }
    
-   for (i = 0; params [i].name != NULL; i++)
-      if (params [i].optchar != '\0' || show_all_options)
-      {
-	 if (params [i].optchar != '\0')
-	    fprintf (stderr, "  -%c, --", params [i].optchar);
-	 else
-	    fprintf (stderr, "      --");
+    for (i = 0; params [i].name != NULL; i++)
+        if (params [i].optchar != '\0' || show_all_options)
+        {
+            if (params [i].optchar != '\0')
+                fprintf (stderr, "  -%c, --", params [i].optchar);
+            else
+                fprintf (stderr, "      --");
 	 
-	 if (params [i].type == POSTR)
-	    fprintf (stderr, "%s=[%s]%-*s  ", params [i].name,
-		     params [i].argument_name,
-		     max (0, (width - 2 - strlen (params [i].name)
-			   - strlen (params [i].argument_name))), "");
-	 else if (params [i].type != PFLAG)
-	    fprintf (stderr, "%s=%-*s  ", params [i].name,
-		  width - strlen (params [i].name),
-		  params [i].argument_name);
-	 else
-	    fprintf (stderr, "%-*s  ", width + 1, params [i].name);
-
-	 fprintf (stderr, params [i].use, params [i].argument_name);
+            if (params [i].type == POSTR)
+                fprintf (stderr, "%s=[%s]%-*s  ", params [i].name,
+                         params [i].argument_name,
+                         (unsigned)
+                         max(0, (width - 2 - strlen (params [i].name)
+                                 - strlen (params [i].argument_name))), "");
+            else if (params [i].type != PFLAG)
+                fprintf (stderr, "%s=%-*s  ", params [i].name,
+                         (unsigned)(width - strlen (params [i].name)),
+                         params [i].argument_name);
+            else
+                fprintf (stderr, "%-*s  ",
+                         (unsigned)(width + 1), params [i].name);
+
+            fprintf (stderr, params [i].use, params [i].argument_name);
 	 
-	 switch (params [i].type)
-	 {
-	    case PFLAG:
-	       break;
-	    case PINT:
-	       fprintf (stderr, "{%d}", params [i].value.i);
-	       break;
-	    case PFLOAT:
-	       fprintf (stderr, "{%.2f}", (double) params [i].value.f);
-	       break;
-	    case PSTR:
-	    case POSTR:
-	       if (params [i].value.s)
-		  fprintf (stderr, "{%s}", params [i].value.s);
-	       break;
-	    default:
-	       error ("type %d for %s invalid",
-		      params [i].type, params [i].name);
-	 }
-	 fprintf (stderr, "\n");
-      }
-   fprintf (stderr, "\n");
-   fprintf (stderr, "Parameter initialization order:\n");
-   fprintf (stderr,
-	    "1.) %s\n2.) $HOME/%s\t 3.) command line\t 4.) --config=file",
-	    sys_file_name, usr_file_name);
-   fprintf (stderr, "\n\n");
-   if (comment != NULL)
-      fprintf (stderr, "%s\n", comment);
-
-   exit (1);
+            switch (params [i].type)
+            {
+            case PFLAG:
+                break;
+            case PINT:
+                fprintf (stderr, "{%d}", params [i].value.i);
+                break;
+            case PFLOAT:
+                fprintf (stderr, "{%.2f}", (double) params [i].value.f);
+                break;
+            case PSTR:
+            case POSTR:
+                if (params [i].value.s)
+                    fprintf (stderr, "{%s}", params [i].value.s);
+                break;
+            default:
+                error ("type %d for %s invalid",
+                       params [i].type, params [i].name);
+            }
+            fprintf (stderr, "\n");
+        }
+    fprintf (stderr, "\n");
+    fprintf (stderr, "Parameter initialization order:\n");
+    fprintf (stderr,
+             "1.) %s\n2.) $HOME/%s\t 3.) command line\t 4.) --config=file",
+             sys_file_name, usr_file_name);
+    fprintf (stderr, "\n\n");
+    if (comment != NULL)
+        fprintf (stderr, "%s\n", comment);
+
+    exit (1);
 }