use std::min, std::max

This commit is contained in:
joris 2013-07-02 11:57:07 +02:00
parent 180de1f00d
commit 486c887c62
2 changed files with 3 additions and 3 deletions

View file

@ -909,11 +909,11 @@ int EvalNumber(const NumberDesc *number)
case ENumber_Min : // a <= b ? a : b
a = EvalNumber(number->D.BinOp.Left);
b = EvalNumber(number->D.BinOp.Right);
return (a <= b ? a : b);
return std::min(a, b);
case ENumber_Max : // a >= b ? a : b
a = EvalNumber(number->D.BinOp.Left);
b = EvalNumber(number->D.BinOp.Right);
return (a >= b ? a : b);
return std::max(a, b);
case ENumber_Gt : // a > b ? 1 : 0
a = EvalNumber(number->D.BinOp.Left);
b = EvalNumber(number->D.BinOp.Right);

View file

@ -404,7 +404,7 @@ static void GetPopupSize(const CPopup &popup, const ButtonAction &button,
contentHeight = std::max(content.minSize.y, 2 * content.MarginY + content.GetHeight(button, Costs));
maxContentHeight = std::max(contentHeight, maxContentHeight);
if (content.Wrap) {
popupWidth += contentWidth - maxContentWidth > 0 ? contentWidth - maxContentWidth : 0;
popupWidth += std::max(0, contentWidth - maxContentWidth);
popupHeight += maxContentHeight;
maxContentWidth = std::max(maxContentWidth, contentWidth);
contentWidth = popup.MarginX;