Use MAX and MIN macros from sys/param.h
This commit is contained in:
parent
67d01c2bab
commit
42c88c4100
@ -100,9 +100,6 @@ __FBSDID("$FreeBSD$");
|
||||
# define TIMESPEC_NS(timespec) 0
|
||||
#endif
|
||||
|
||||
#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
/*
|
||||
* diff - compare two files.
|
||||
*/
|
||||
@ -709,7 +706,7 @@ stone(int *a, int n, int *b, int *c, int flags)
|
||||
bound = UINT_MAX;
|
||||
else {
|
||||
sq = isqrt(n);
|
||||
bound = MAXIMUM(256, sq);
|
||||
bound = MAX(256, sq);
|
||||
}
|
||||
|
||||
k = 0;
|
||||
@ -1446,10 +1443,10 @@ dump_context_vec(FILE *f1, FILE *f2, int flags)
|
||||
return;
|
||||
|
||||
b = d = 0; /* gcc */
|
||||
lowa = MAXIMUM(1, cvp->a - diff_context);
|
||||
upb = MINIMUM(len[0], context_vec_ptr->b + diff_context);
|
||||
lowc = MAXIMUM(1, cvp->c - diff_context);
|
||||
upd = MINIMUM(len[1], context_vec_ptr->d + diff_context);
|
||||
lowa = MAX(1, cvp->a - diff_context);
|
||||
upb = MIN(len[0], context_vec_ptr->b + diff_context);
|
||||
lowc = MAX(1, cvp->c - diff_context);
|
||||
upd = MIN(len[1], context_vec_ptr->d + diff_context);
|
||||
|
||||
diff_output("***************");
|
||||
if ((flags & D_PROTOTYPE)) {
|
||||
@ -1549,10 +1546,10 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags)
|
||||
return;
|
||||
|
||||
b = d = 0; /* gcc */
|
||||
lowa = MAXIMUM(1, cvp->a - diff_context);
|
||||
upb = MINIMUM(len[0], context_vec_ptr->b + diff_context);
|
||||
lowc = MAXIMUM(1, cvp->c - diff_context);
|
||||
upd = MINIMUM(len[1], context_vec_ptr->d + diff_context);
|
||||
lowa = MAX(1, cvp->a - diff_context);
|
||||
upb = MIN(len[0], context_vec_ptr->b + diff_context);
|
||||
lowc = MAX(1, cvp->c - diff_context);
|
||||
upd = MIN(len[1], context_vec_ptr->d + diff_context);
|
||||
|
||||
diff_output("@@ -");
|
||||
uni_range(lowa, upb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user