From 87e37b7daf93619a72d051103fd5c68764f7a68e Mon Sep 17 00:00:00 2001 From: Ales Kozumplik Date: Fri, 23 Dec 2011 13:44:22 +0100 Subject: [PATCH] depends.c:skipColor() is not longer a macro - Prevents double evaluation of the 'ocolor' parameter. --- lib/depends.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 43247f9..90df472 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -129,8 +129,19 @@ static rpmdbMatchIterator rpmtsPrunedIterator(rpmts ts, rpmDbiTagVal tag, return mi; } -#define skipColor(_tscolor, _color, _ocolor) \ - ((_tscolor) && (_color) && (_ocolor) && !((_color) & (_ocolor))) +/** + * Decides whether to skip a package upgrade/obsoletion on TE color. + * + * @param tscolor color of this transaction + * @param color color of this transaction element + * @param ocolor header color of the upgraded/obsoleted package + * + * @return non-zero if the package should be skipped + */ +static int skipColor(rpm_color_t tscolor, rpm_color_t color, rpm_color_t ocolor) +{ + return tscolor && color && ocolor && !(color & ocolor); +} /* Add erase elements for older packages of same color (if any). */ static void addUpgradeErasures(rpmts ts, tsMembers tsmem, rpm_color_t tscolor, -- 2.7.4