We've had a mix of min, max from libpspp/misc.h and MIN, MAX from
[pspp-builds.git] / src / data / variable.c
index fc81c01e1499dd443795271c7ff13a40fdac9891..ca302415d22799c4a8547dd398ad601802b3fea3 100644 (file)
@@ -31,6 +31,8 @@
 #include <libpspp/str.h>
 #include "value-labels.h"
 
+#include "minmax.h"
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
@@ -106,7 +108,7 @@ compare_values (const union value *a, const union value *b, int width)
   if (width == 0) 
     return a->f < b->f ? -1 : a->f > b->f;
   else
-    return memcmp (a->s, b->s, min(MAX_SHORT_STRING, width));
+    return memcmp (a->s, b->s, MIN(MAX_SHORT_STRING, width));
 }
 
 /* Create a hash of v */
@@ -118,7 +120,7 @@ hash_value(const union value  *v, int width)
   if ( 0 == width ) 
     id_hash = hsh_hash_double (v->f);
   else
-    id_hash = hsh_hash_bytes (v->s, min(MAX_SHORT_STRING, width));
+    id_hash = hsh_hash_bytes (v->s, MIN(MAX_SHORT_STRING, width));
 
   return id_hash;
 }