2 https://github.com/facebook/hhvm/commit/8207a31c26cc42fee79363a14c4a8f4fcbfffe63
4 From 8207a31c26cc42fee79363a14c4a8f4fcbfffe63 Mon Sep 17 00:00:00 2001
5 From: Jordan DeLong <jdelong@fb.com>
6 Date: Mon, 6 Oct 2014 18:30:28 -0700
7 Subject: [PATCH] Remove some MIN/MAX macro uses in the emitter
9 Summary: <algorithm> has preferable type-safe versions that don't double-eval
12 Reviewed By: @paulbiss
14 Differential Revision: D1599803
16 hphp/compiler/analysis/emitter.cpp | 6 +++---
17 hphp/util/compatibility.h | 4 ----
18 2 files changed, 3 insertions(+), 7 deletions(-)
20 diff --git a/hphp/compiler/analysis/emitter.cpp b/hphp/compiler/analysis/emitter.cpp
21 index 321e637..b1d3f2d 100644
22 --- a/hphp/compiler/analysis/emitter.cpp
23 +++ b/hphp/compiler/analysis/emitter.cpp
24 @@ -799,8 +799,8 @@ void SymbolicStack::push(char sym) {
25 if (sym != StackSym::W && sym != StackSym::K && sym != StackSym::L &&
26 sym != StackSym::T && sym != StackSym::I && sym != StackSym::H) {
27 m_actualStack.push_back(m_symStack.size());
28 - *m_actualStackHighWaterPtr = MAX(*m_actualStackHighWaterPtr,
29 - (int)m_actualStack.size());
30 + *m_actualStackHighWaterPtr = std::max(*m_actualStackHighWaterPtr,
31 + (int)m_actualStack.size());
33 m_symStack.push_back(SymEntry(sym));
35 @@ -1010,7 +1010,7 @@ int SymbolicStack::sizeActual() const {
37 void SymbolicStack::pushFDesc() {
38 m_fdescCount += kNumActRecCells;
39 - *m_fdescHighWaterPtr = MAX(*m_fdescHighWaterPtr, m_fdescCount);
40 + *m_fdescHighWaterPtr = std::max(*m_fdescHighWaterPtr, m_fdescCount);
43 void SymbolicStack::popFDesc() {
44 diff --git a/hphp/util/compatibility.h b/hphp/util/compatibility.h
45 index 723f6c8..43f1bc8 100644
46 --- a/hphp/util/compatibility.h
47 +++ b/hphp/util/compatibility.h
48 @@ -58,10 +58,6 @@ typedef struct {
49 int dladdr(const void *addr, Dl_info *info);
50 int backtrace (void **buffer, int size);
53 -#define MIN(a,b) (((a)<(b))?(a):(b))
54 -#define MAX(a,b) (((a)>(b))?(a):(b))
58 //////////////////////////////////////////////////////////////////////