X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flibpspp%2Farray.c;h=db4dbcba01a2af3e2f909465ae8830bb8a1559c8;hb=cecaf561d11939de82a6598324376b8cf8225fd5;hp=c7e25f60fcae3cd19a56fece18cc4be4e9cd0b1e;hpb=e7d0a9f16192ceeff9243f0ede8e399ee1ef0d44;p=pspp diff --git a/src/libpspp/array.c b/src/libpspp/array.c index c7e25f60fc..db4dbcba01 100644 --- a/src/libpspp/array.c +++ b/src/libpspp/array.c @@ -1,6 +1,5 @@ /* PSPP - computes sample statistics. Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. - Written by Ben Pfaff . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -91,7 +90,6 @@ #include #include "array.h" -#include #include #include #include @@ -99,6 +97,8 @@ #include #include "message.h" + +#include "minmax.h" /* Finds an element in ARRAY, which contains COUNT elements of SIZE bytes each, using COMPARE for comparisons. Returns the @@ -700,12 +700,10 @@ sort (void *array, size_t count, size_t size, of the array to sort, and END_PTR points at the very last element in the array (*not* one beyond it!). */ -#define min(x, y) ((x) < (y) ? (x) : (y)) - { char *const end_ptr = &first[size * (count - 1)]; char *tmp_ptr = first; - char *thresh = min(end_ptr, first + max_thresh); + char *thresh = MIN (end_ptr, first + max_thresh); register char *run_ptr; /* Find smallest element in first threshold and place it at the