Use standard library min/max

This commit is contained in:
Pavel Krajcevski 2013-03-06 19:01:19 -05:00
parent 53fe825e49
commit c475ee1dec

View file

@ -43,10 +43,11 @@
#include "TexComp.h" #include "TexComp.h"
#include <math.h> #include <algorithm>
#include <stdlib.h> #include <cmath>
#include <stdio.h> #include <cstdlib>
#include <assert.h> #include <cstdio>
#include <cassert>
#include "BC7Compressor.h" #include "BC7Compressor.h"
#include "Thread.h" #include "Thread.h"
@ -57,19 +58,9 @@
#include "Image.h" #include "Image.h"
template <typename T>
static T min(const T &a, const T &b) {
return (a < b)? a : b;
}
template <typename T>
static T max(const T &a, const T &b) {
return (a > b)? a : b;
}
template <typename T> template <typename T>
static void clamp(T &x, const T &minX, const T &maxX) { static void clamp(T &x, const T &minX, const T &maxX) {
x = max(min(maxX, x), minX); x = std::max(std::min(maxX, x), minX);
} }
template <typename T> template <typename T>