]> git.pld-linux.org Git - packages/hhvm.git/blob - MAX.patch
out of tree build is still broken
[packages/hhvm.git] / MAX.patch
1
2 https://github.com/facebook/hhvm/commit/8207a31c26cc42fee79363a14c4a8f4fcbfffe63
3
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
8
9 Summary: <algorithm> has preferable type-safe versions that don't double-eval
10 their args.
11
12 Reviewed By: @paulbiss
13
14 Differential Revision: D1599803
15 ---
16  hphp/compiler/analysis/emitter.cpp | 6 +++---
17  hphp/util/compatibility.h          | 4 ----
18  2 files changed, 3 insertions(+), 7 deletions(-)
19
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());
32    }
33    m_symStack.push_back(SymEntry(sym));
34  }
35 @@ -1010,7 +1010,7 @@ int SymbolicStack::sizeActual() const {
36  
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);
41  }
42  
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);
51  
52 -// From sys/param.h
53 -#define MIN(a,b) (((a)<(b))?(a):(b))
54 -#define MAX(a,b) (((a)>(b))?(a):(b))
55 -
56  #endif
57  
58  //////////////////////////////////////////////////////////////////////
This page took 0.027165 seconds and 3 git commands to generate.