From 9607d9470eec07df817e58f64d312ccb5ac4cfcc Mon Sep 17 00:00:00 2001 From: Cristian Rodríguez Date: Mon, 1 Apr 2013 03:08:05 -0300 Subject: Always use our own MAX/MIN definitions code in src/shared/macro.h only defined MAX/MIN in case they were not defined previously. however the MAX/MIN macros implemented in glibc are not of the "safe" kind but defined as: define MIN(a,b) (((a)<(b))?(a):(b)) define MAX(a,b) (((a)>(b))?(a):(b)) Avoid nasty side effects by using our own versions instead. Also fix the warnings derived from this change. [zj: - modify MAX3 macro to fix warning about _a shadowing _a, - do bootchart/svg.c too, - remove unused MIN3.] --- src/shared/prioq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/prioq.c') diff --git a/src/shared/prioq.c b/src/shared/prioq.c index 64c44aef82..a2205719b4 100644 --- a/src/shared/prioq.c +++ b/src/shared/prioq.c @@ -159,7 +159,7 @@ int prioq_put(Prioq *q, void *data, unsigned *idx) { unsigned n; struct prioq_item *j; - n = MAX((q->n_items+1) * 2, 16); + n = MAX((q->n_items+1) * 2, 16u); j = realloc(q->items, sizeof(struct prioq_item) * n); if (!j) return -ENOMEM; -- cgit v1.2.3-54-g00ecf