From 1ee27a4484d3e423f0df7e55ed43cb2e31ed5fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 19 Jun 2012 13:22:05 +0000 Subject: [PATCH] Up-case "min" and "max" macros to provide visual cues that there's macro expansion afoot. While here, remove unused "overlap" macro. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bård Skaflestad --- uniquepoints.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/uniquepoints.c b/uniquepoints.c index 0dde8c20..4e6779d9 100644 --- a/uniquepoints.c +++ b/uniquepoints.c @@ -44,10 +44,8 @@ #include "preprocess.h" #include "uniquepoints.h" -#define min(i,j) ((i)<(j) ? (i) : (j)) -#define max(i,j) ((i)>(j) ? (i) : (j)) -#define overlap(a1,a2,b1,b2) max(a1,b1) < min(a2,b2) - +#define MIN(i,j) (((i) < (j)) ? (i) : (j)) +#define MAX(i,j) (((i) > (j)) ? (i) : (j)) /*----------------------------------------------------------------- Compare function passed to qsortx */ @@ -187,10 +185,10 @@ vector_positions(const int dims[3] , { size_t im, ip, jm, jp; - im = max(1, i ) - 1; - ip = min(dims[0], i+1) - 1; - jm = max(1, j ) - 1; - jp = min(dims[1], j+1) - 1; + im = MAX(1, i ) - 1; + jm = MAX(1, j ) - 1; + ip = MIN(dims[0], i+1) - 1; + jp = MIN(dims[1], j+1) - 1; start[ 0 ] = dims[2] * (im + dims[0]*jm); start[ 1 ] = dims[2] * (im + dims[0]*jp);