about summary refs log tree commit diff
path: root/converter/other/fiasco/lib
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-02-12 20:40:29 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-02-12 20:40:29 +0000
commit47e6714f1bb9be3587d5c76d5638887b595e6355 (patch)
treea691961ad493be82b6c9b206304a458bd603a9e4 /converter/other/fiasco/lib
parent7270a56af11a9bf5ac18baa50dc8fedbd545af7f (diff)
downloadnetpbm-mirror-47e6714f1bb9be3587d5c76d5638887b595e6355.tar.gz
netpbm-mirror-47e6714f1bb9be3587d5c76d5638887b595e6355.tar.xz
netpbm-mirror-47e6714f1bb9be3587d5c76d5638887b595e6355.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1643 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/fiasco/lib')
-rw-r--r--converter/other/fiasco/lib/error.c24
-rw-r--r--converter/other/fiasco/lib/macros.h11
-rw-r--r--converter/other/fiasco/lib/misc.c6
3 files changed, 4 insertions, 37 deletions
diff --git a/converter/other/fiasco/lib/error.c b/converter/other/fiasco/lib/error.c
index 13cec99a..ee3afe1f 100644
--- a/converter/other/fiasco/lib/error.c
+++ b/converter/other/fiasco/lib/error.c
@@ -108,11 +108,7 @@ set_error (const char *format, ...)
       Free (error_message);
    error_message = Calloc (len, sizeof (char));
    
-#if HAVE_VPRINTF
    vsprintf (error_message, format, args);
-#elif HAVE_DOPRNT
-   _doprnt (format, args, stderr);
-#endif /* HAVE_DOPRNT */
 
    va_end (args);
 }
@@ -169,11 +165,7 @@ error (const char *format, ...)
       Free (error_message);
    error_message = Calloc (len, sizeof (char));
    
-#if HAVE_VPRINTF
    vsprintf (error_message, format, args);
-#elif HAVE_DOPRNT
-   _doprnt (format, args, stderr);
-#endif /* HAVE_DOPRNT */
 
    va_end (args);
    
@@ -227,11 +219,7 @@ warning (const char *format, ...)
       return;
 	
    fprintf (stderr, "Warning: ");
-#if HAVE_VPRINTF
    vfprintf (stderr, format, args);
-#elif HAVE_DOPRNT
-   _doprnt (format, args, stderr);
-#endif /* HAVE_DOPRNT */
    fputc ('\n', stderr);
 
    va_end (args);
@@ -250,11 +238,7 @@ message (const char *format, ...)
    if (verboselevel == FIASCO_NO_VERBOSITY)
       return;
 
-#if HAVE_VPRINTF
    vfprintf (stderr, format, args);
-#elif HAVE_DOPRNT
-   _doprnt (format, args, stderr);
-#endif /* HAVE_DOPRNT */
    fputc ('\n', stderr);
    va_end (args);
 }
@@ -273,11 +257,7 @@ debug_message (const char *format, ...)
       return;
 
    fprintf (stderr, "*** ");
-#if HAVE_VPRINTF
    vfprintf (stderr, format, args);
-#elif HAVE_DOPRNT
-   _doprnt (format, args, stderr);
-#endif /* HAVE_DOPRNT */
    fputc ('\n', stderr);
    va_end (args);
 }
@@ -295,11 +275,7 @@ info (const char *format, ...)
    if (verboselevel == FIASCO_NO_VERBOSITY)
       return;
 
-#if HAVE_VPRINTF
    vfprintf (stderr, format, args);
-#elif HAVE_DOPRNT
-   _doprnt (format, args, stderr);
-#endif /* HAVE_DOPRNT */
    fflush (stderr);
    va_end (args);
 }
diff --git a/converter/other/fiasco/lib/macros.h b/converter/other/fiasco/lib/macros.h
index 877abeea..9968110a 100644
--- a/converter/other/fiasco/lib/macros.h
+++ b/converter/other/fiasco/lib/macros.h
@@ -28,11 +28,6 @@
 #   define SEEK_CUR	1
 #endif /* not SEEK_CUR */
 
-#ifdef WIN32
-#undef max
-#undef min
-#endif /* not WIN32 */
-
 /*****************************************************************************
 
 				Various macros
@@ -50,12 +45,6 @@
 #define address_of_level(l)	((unsigned) (size_of_level (l) - 1))
 #define size_of_tree(l)		((unsigned) (address_of_level ((l) + 1)))
 #define is_odd(n)		(abs (n) % 2)
-#ifndef max
-#define max(a,b)		((a) < (b) ? (b) : (a))
-#endif
-#ifndef min
-#define min(a,b)	        ((a) > (b) ? (b) : (a))
-#endif
 #define _(x) (x) 
 
 
diff --git a/converter/other/fiasco/lib/misc.c b/converter/other/fiasco/lib/misc.c
index dd9f0bb2..11e2da54 100644
--- a/converter/other/fiasco/lib/misc.c
+++ b/converter/other/fiasco/lib/misc.c
@@ -36,6 +36,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "pm_c_util.h"
+
 #include "types.h"
 #include "macros.h"
 #include "error.h"
@@ -445,13 +447,13 @@ variance (const word_t *pixels, unsigned x0, unsigned y0,
    assert (pixels);
    
    for (average = 0, n = 0, y = y0; y < y0 + height; y++)
-      for (x = x0; x < min (x0 + width, cols); x++, n++)
+      for (x = x0; x < MIN(x0 + width, cols); x++, n++)
 	 average += pixels [y * cols + x] / 16;
 
    average /= n;
 
    for (variance = 0, y = y0; y < y0 + height; y++)
-      for (x = x0; x < min (x0 + width, cols); x++)
+      for (x = x0; x < MIN(x0 + width, cols); x++)
 	 variance += square ((pixels [y * cols + x] / 16) - average);
 
    return variance;