BRect: Replace max_c() and min_c() with std::max() and std::min()
This commit is contained in:
@@ -1,15 +1,19 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2001-2012, Haiku, Inc. All Rights Reserved.
|
* Copyright 2001-2014 Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Frans van Nispen
|
* Frans van Nispen
|
||||||
|
* John Scipione, [email protected]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <Rect.h>
|
#include <Rect.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BRect::SetLeftTop(const BPoint point)
|
BRect::SetLeftTop(const BPoint point)
|
||||||
@@ -230,16 +234,16 @@ BRect::operator!=(BRect other) const
|
|||||||
BRect
|
BRect
|
||||||
BRect::operator&(BRect other) const
|
BRect::operator&(BRect other) const
|
||||||
{
|
{
|
||||||
return BRect(max_c(left, other.left), max_c(top, other.top),
|
return BRect(std::max(left, other.left), std::max(top, other.top),
|
||||||
min_c(right, other.right), min_c(bottom, other.bottom));
|
std::min(right, other.right), std::min(bottom, other.bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BRect::operator|(BRect other) const
|
BRect::operator|(BRect other) const
|
||||||
{
|
{
|
||||||
return BRect(min_c(left, other.left), min_c(top, other.top),
|
return BRect(std::min(left, other.left), std::min(top, other.top),
|
||||||
max_c(right, other.right), max_c(bottom, other.bottom));
|
std::max(right, other.right), std::max(bottom, other.bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user