|
|
hi,
Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2019-19-02 12:17 AM (-4), clipka wrote:
> > Am 19.02.2019 um 04:55 schrieb Cousin Ricky:
> >> It doesn't compile for me. Below is the last part of the console
> >> session:
> >
> > Please try prepending all `shared_ptr`, `min` and `max` in the file
> > `unix/disp_sdl.cpp` with `std::`, and adding `#include <memory>` to the
> > top of the file.
>
> It worked. Thank you.
and for me, thanks. including the diff below, in case it's of use to someone
else. to apply copy+paste to file, then run "patch -p0 < patch20190219".
regards, jr.
-----<snip>-----
--- unix/disp_sdl.cpp 2019-02-19 01:48:21.000000000 +0000
+++ unix/disp_sdl.cpp 2019-11-28 10:52:31.218265290 +0000
@@ -42,6 +42,7 @@
#include "disp_sdl.h"
#include <algorithm>
+#include <memory>
#include <boost/format.hpp>
@@ -54,7 +55,7 @@
using namespace vfe;
using namespace vfePlatform;
- extern shared_ptr<Display> gDisplay;
+ extern std::shared_ptr<Display> gDisplay;
const UnixOptionsProcessor::Option_Info UnixSDLDisplay::Options[] =
{
@@ -181,8 +182,8 @@
// [JG] about testing vs ...(-1), have a look at SDL_ListModes
API (the return is very ugly).
if ((modes != nullptr) && (reinterpret_cast<SDL_Rect**>(-1) !=
modes))
{
- width = min(modes[0]->w - 10, width);
- height = min(modes[0]->h - 80, height);
+ width = std::min(modes[0]->w - 10, width);
+ height = std::min(modes[0]->h - 80, height);
}
}
@@ -250,7 +251,7 @@
* The difference is nearly invisible until the values of
GetWidth and GetHeight are subtil (such as +W2596 +H1003 on a display of 1920 x
1080)
* where in such situation, the computed ratio is not exactly
the same as the other.
*/
- m_display_scale = min(float(width) / GetWidth(), float(height)
/ GetHeight());
+ m_display_scale = std::min(float(width) / GetWidth(),
float(height) / GetHeight());
}
SetCaption(false);
@@ -345,10 +346,10 @@
{
unsigned int rx2 = m_update_rect.x + m_update_rect.w;
unsigned int ry2 = m_update_rect.y + m_update_rect.h;
- m_update_rect.x = min((unsigned int)m_update_rect.x, x);
- m_update_rect.y = min((unsigned int)m_update_rect.y, y);
- rx2 = max(rx2, x);
- ry2 = max(ry2, y);
+ m_update_rect.x = std::min((unsigned int)m_update_rect.x, x);
+ m_update_rect.y = std::min((unsigned int)m_update_rect.y, y);
+ rx2 = std::max(rx2, x);
+ ry2 = std::max(ry2, y);
m_update_rect.w = rx2 - m_update_rect.x;
m_update_rect.h = ry2 - m_update_rect.y;
}
@@ -357,10 +358,10 @@
{
unsigned int rx2 = m_update_rect.x + m_update_rect.w;
unsigned int ry2 = m_update_rect.y + m_update_rect.h;
- m_update_rect.x = min((unsigned int)m_update_rect.x, x1);
- m_update_rect.y = min((unsigned int)m_update_rect.y, y1);
- rx2 = max(rx2, x2);
- ry2 = max(ry2, y2);
+ m_update_rect.x = std::min((unsigned int)m_update_rect.x, x1);
+ m_update_rect.y = std::min((unsigned int)m_update_rect.y, y1);
+ rx2 = std::max(rx2, x2);
+ ry2 = std::max(ry2, y2);
m_update_rect.w = rx2 - m_update_rect.x;
m_update_rect.h = ry2 - m_update_rect.y;
}
@@ -405,10 +406,10 @@
if (!m_valid)
return;
- int ix1 = min(x1, GetWidth()-1);
- int ix2 = min(x2, GetWidth()-1);
- int iy1 = min(y1, GetHeight()-1);
- int iy2 = min(y2, GetHeight()-1);
+ int ix1 = std::min(x1, GetWidth()-1);
+ int ix2 = std::min(x2, GetWidth()-1);
+ int iy1 = std::min(y1, GetHeight()-1);
+ int iy2 = std::min(y2, GetHeight()-1);
if (SDL_MUSTLOCK(m_display) && SDL_LockSurface(m_display) < 0)
return;
@@ -455,10 +456,10 @@
if (!m_valid)
return;
- unsigned int ix1 = min(x1, GetWidth()-1);
- unsigned int ix2 = min(x2, GetWidth()-1);
- unsigned int iy1 = min(y1, GetHeight()-1);
- unsigned int iy2 = min(y2, GetHeight()-1);
+ unsigned int ix1 = std::min(x1, GetWidth()-1);
+ unsigned int ix2 = std::min(x2, GetWidth()-1);
+ unsigned int iy1 = std::min(y1, GetHeight()-1);
+ unsigned int iy2 = std::min(y2, GetHeight()-1);
if (m_display_scaled)
{
@@ -487,10 +488,10 @@
if (!m_valid)
return;
- unsigned int ix1 = min(x1, GetWidth()-1);
- unsigned int ix2 = min(x2, GetWidth()-1);
- unsigned int iy1 = min(y1, GetHeight()-1);
- unsigned int iy2 = min(y2, GetHeight()-1);
+ unsigned int ix1 = std::min(x1, GetWidth()-1);
+ unsigned int ix2 = std::min(x2, GetWidth()-1);
+ unsigned int iy1 = std::min(y1, GetHeight()-1);
+ unsigned int iy2 = std::min(y2, GetHeight()-1);
if (SDL_MUSTLOCK(m_display) && SDL_LockSurface(m_display) < 0)
return;
Post a reply to this message
|
|