File xclass-0.9.2-gcc-3.1.patch of Package xclass
--- xclass-0.9.2/include/xclass/ORectangle.h
+++ xclass-0.9.2/include/xclass/ORectangle.h
@@ -22,16 +22,18 @@
#ifndef __ORECTANGLE_H
#define __ORECTANGLE_H
+#include <algorithm>
+
#include <xclass/utils.h>
#include <xclass/OBaseObject.h>
#include <xclass/ODimension.h>
-#ifndef min
+#if 0
#define min(a,b) (((a)<(b)) ? (a) : (b))
#endif
-#ifndef max
+#if 0
#define max(a,b) (((a)>(b)) ? (a) : (b))
#endif
@@ -72,8 +74,8 @@
OPosition right_bottom() const
{ return OPosition(x + (int) w - 1, y + (int) h - 1); }
void merge(ORectangle &r)
- { int max_x = max(x + (int) w, r.x + (int) r.w); x = min(x, r.x);
- int max_y = max(y + (int) h, r.y + (int) r.h); y = min(y, r.y);
+ { int max_x = std::max(x + (int) w, r.x + (int) r.w); x = std::min(x, r.x);
+ int max_y = std::max(y + (int) h, r.y + (int) r.h); y = std::min(y, r.y);
w = max_x - x;
h = max_y - y; }
void empty() { x = y = 0; w = h = 0; }
--- xclass-0.9.2/include/xclass/utils.h
+++ xclass-0.9.2/include/xclass/utils.h
@@ -31,6 +31,8 @@
#include <fcntl.h>
#include <unistd.h>
+#include <algorithm>
+
#include <xclass/XCconfig.h>
//--- Text justification modes for OXLabel, OXButton, etc...
@@ -56,11 +58,11 @@
#undef NULL
#define NULL 0
-#ifndef min
+#if 0
#define min(a,b) (((a)<(b)) ? (a) : (b))
#endif
-#ifndef max
+#if 0
#define max(a,b) (((a)>(b)) ? (a) : (b))
#endif
--- xclass-0.9.2/lib/libxclass/O2ColumnsLayout.cc
+++ xclass-0.9.2/lib/libxclass/O2ColumnsLayout.cc
@@ -39,16 +39,16 @@
for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
++count;
csize = ptr->frame->GetDefaultSize();
- c1size.w = max(c1size.w, csize.w);
- c1size.h = max(c1size.h, csize.h);
+ c1size.w = std::max(c1size.w, csize.w);
+ c1size.h = std::max(c1size.h, csize.h);
ptr = ptr->next;
if (ptr == NULL) break;
csize = ptr->frame->GetDefaultSize();
- c2size.w = max(c2size.w, csize.w);
- c2size.h = max(c2size.h, csize.h);
+ c2size.w = std::max(c2size.w, csize.w);
+ c2size.h = std::max(c2size.h, csize.h);
}
- h = max(c1size.h, c2size.h);
+ h = std::max(c1size.h, c2size.h);
for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
csize = ptr->frame->GetDefaultSize();
@@ -72,17 +72,17 @@
for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
++count;
csize = ptr->frame->GetDefaultSize();
- c1size.w = max(c1size.w, csize.w);
- c1size.h = max(c1size.h, csize.h);
+ c1size.w = std::max(c1size.w, csize.w);
+ c1size.h = std::max(c1size.h, csize.h);
ptr = ptr->next;
if (ptr == NULL) break;
csize = ptr->frame->GetDefaultSize();
- c2size.w = max(c2size.w, csize.w);
- c2size.h = max(c2size.h, csize.h);
+ c2size.w = std::max(c2size.w, csize.w);
+ c2size.h = std::max(c2size.h, csize.h);
}
size.w = c1size.w + _hsep + c2size.w + ins.l + ins.r;
- size.h = (max(c1size.h, c2size.h) + _vsep) * count + ins.t + ins.b;
+ size.h = (std::max(c1size.h, c2size.h) + _vsep) * count + ins.t + ins.b;
return size;
}
--- xclass-0.9.2/lib/libxclass/OColor.cc
+++ xclass-0.9.2/lib/libxclass/OColor.cc
@@ -95,8 +95,8 @@
_G = g / (double) COLOR_MAX;
_B = b / (double) COLOR_MAX;
- Cmax = max(_R, max(_G, _B));
- Cmin = min(_R, min(_G, _B));
+ Cmax = std::max(_R, std::max(_G, _B));
+ Cmin = std::min(_R, std::min(_G, _B));
// calculate luminosity
_L = (Cmax + Cmin) / 2.0;
--- xclass-0.9.2/lib/libxclass/ODNDmanager.cc
+++ xclass-0.9.2/lib/libxclass/ODNDmanager.cc
@@ -216,7 +216,7 @@
}
types = (Atom *) data;
- _useVersion = min(_version, types[0]);
+ _useVersion = std::min(_version, types[0]);
Debug(DBG_MISC, "Using XDND version %d\n", _useVersion);
if ((count > 1) && typelist) {
--- xclass-0.9.2/lib/libxclass/OLayout.cc
+++ xclass-0.9.2/lib/libxclass/OLayout.cc
@@ -63,7 +63,7 @@
if ((hints & LHINTS_EXPAND_Y) || (hints & LHINTS_CENTER_Y)) {
nb_expand++;
exp += size.h;
- exp_max = max(exp_max, size.h);
+ exp_max = std::max(static_cast<unsigned int>(exp_max), size.h);
} else
remain -= size.h;
}
@@ -151,7 +151,7 @@
for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
if (ptr->frame->IsVisible()) {
csize = ptr->frame->GetDefaultSize();
- size.w = max(size.w, csize.w + ptr->layout->GetPadLeft() +
+ size.w = std::max(size.w, csize.w + ptr->layout->GetPadLeft() +
ptr->layout->GetPadRight());
size.h += csize.h + ptr->layout->GetPadTop() +
ptr->layout->GetPadBottom();
@@ -200,7 +200,7 @@
if ((hints & LHINTS_EXPAND_X) || (hints & LHINTS_CENTER_X)) {
nb_expand++;
exp += size.w;
- exp_max = max(exp_max, size.w);
+ exp_max = std::max(static_cast<unsigned int>(exp_max), size.w);
} else
remain -= size.w;
}
@@ -290,7 +290,7 @@
csize = ptr->frame->GetDefaultSize();
size.w += csize.w + ptr->layout->GetPadLeft() +
ptr->layout->GetPadRight();
- size.h = max(size.h, csize.h + ptr->layout->GetPadTop() +
+ size.h = std::max(size.h, csize.h + ptr->layout->GetPadTop() +
ptr->layout->GetPadBottom());
}
}
--- xclass-0.9.2/lib/libxclass/OListViewLayout.cc
+++ xclass-0.9.2/lib/libxclass/OListViewLayout.cc
@@ -42,11 +42,11 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
csize = ptr->frame->GetDefaultSize();
- max_osize.w = max(max_osize.w, csize.w);
- max_osize.h = max(max_osize.h, csize.h);
+ max_osize.w = std::max(max_osize.w, csize.w);
+ max_osize.h = std::max(max_osize.h, csize.h);
}
- max_width = max(msize.w, max_osize.w + (_sep << 1));
+ max_width = std::max(msize.w, max_osize.w + (_sep << 1));
x = _sep; y = _sep << 1;
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
@@ -85,11 +85,11 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
max_size = ptr->frame->GetDefaultSize();
- max_osize.w = max(max_osize.w, max_size.w);
- max_osize.h = max(max_osize.h, max_size.h);
+ max_osize.w = std::max(max_osize.w, max_size.w);
+ max_osize.h = std::max(max_osize.h, max_size.h);
}
- max_size.w = max(msize.w, max_osize.w + (_sep << 1));
+ max_size.w = std::max(msize.w, max_osize.w + (_sep << 1));
x = _sep; y = _sep << 1;
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
@@ -100,7 +100,7 @@
}
}
if (x != _sep) y += max_osize.h + _sep;
- max_size.h = max(y, msize.h);
+ max_size.h = std::max(static_cast<unsigned int>(y), msize.h);
return max_size;
}
@@ -117,11 +117,11 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
csize = ptr->frame->GetDefaultSize();
- max_osize.w = max(max_osize.w, csize.w);
- max_osize.h = max(max_osize.h, csize.h);
+ max_osize.w = std::max(max_osize.w, csize.w);
+ max_osize.h = std::max(max_osize.h, csize.h);
}
- max_height = max(msize.h, max_osize.h + (_sep << 1));
+ max_height = std::max(msize.h, max_osize.h + (_sep << 1));
x = _sep; y = _sep << 1;
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
@@ -161,11 +161,11 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
max_size = ptr->frame->GetDefaultSize();
- max_osize.w = max(max_osize.w, max_size.w);
- max_osize.h = max(max_osize.h, max_size.h);
+ max_osize.w = std::max(max_osize.w, max_size.w);
+ max_osize.h = std::max(max_osize.h, max_size.h);
}
- max_size.h = max(msize.h, max_osize.h + (_sep << 1));
+ max_size.h = std::max(msize.h, max_osize.h + (_sep << 1));
x = _sep; y = _sep << 1;
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
@@ -176,7 +176,7 @@
}
}
if (y != (_sep << 1)) x += max_osize.w + _sep;
- max_size.w = max(x, msize.w);
+ max_size.w = std::max(static_cast<unsigned int>(x), msize.w);
return max_size;
}
@@ -190,7 +190,7 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
csize = ptr->frame->GetDefaultSize();
- max_oh = max(max_oh, csize.h);
+ max_oh = std::max(static_cast<unsigned int>(max_oh), csize.h);
}
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
@@ -210,8 +210,8 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
csize = ptr->frame->GetDefaultSize();
- max_osize.w = max(max_osize.w, csize.w);
- max_osize.h = max(max_osize.h, csize.h);
+ max_osize.w = std::max(max_osize.w, csize.w);
+ max_osize.h = std::max(max_osize.h, csize.h);
}
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
--- xclass-0.9.2/lib/libxclass/OMatrixLayout.cc
+++ xclass-0.9.2/lib/libxclass/OMatrixLayout.cc
@@ -62,8 +62,8 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
count++;
csize = ptr->frame->GetDefaultSize();
- maxsize.w = max(maxsize.w, csize.w);
- maxsize.h = max(maxsize.h, csize.h);
+ maxsize.w = std::max(maxsize.w, csize.w);
+ maxsize.h = std::max(maxsize.h, csize.h);
}
if (rows == 0) {
@@ -87,8 +87,8 @@
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
csize = ptr->frame->GetDefaultSize();
- maxsize.w = max(maxsize.w, csize.w);
- maxsize.h = max(maxsize.h, csize.h);
+ maxsize.w = std::max(maxsize.w, csize.w);
+ maxsize.h = std::max(maxsize.h, csize.h);
}
for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
--- xclass-0.9.2/lib/libxclass/ORowColumnLayout.cc
+++ xclass-0.9.2/lib/libxclass/ORowColumnLayout.cc
@@ -53,7 +53,7 @@
for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
if (ptr->frame->IsVisible()) {
dsize = ptr->frame->GetDefaultSize();
- size.h = max(size.h, dsize.h);
+ size.h = std::max(size.h, dsize.h);
size.w += dsize.w + sep;
}
}
@@ -99,7 +99,7 @@
if (ptr->frame->IsVisible()) {
dsize = ptr->frame->GetDefaultSize();
size.h += dsize.h + sep;
- size.w = max(size.w, dsize.w);
+ size.w = std::max(size.w, dsize.w);
}
}
--- xclass-0.9.2/lib/libxclass/OXAboutDialog.cc
+++ xclass-0.9.2/lib/libxclass/OXAboutDialog.cc
@@ -73,7 +73,7 @@
f1->AddFrame(l = new OXLabel(f1, new OString(info->copyright)), _lh2);
l->SetTextJustify(info->cprt_justify);
if (info->cprt_font) l->SetFont(info->cprt_font);
- width = max(width, l->GetDefaultWidth());
+ width = std::max(width, l->GetDefaultWidth());
}
if (info->text) {
--- xclass-0.9.2/lib/libxclass/OXCanvas.cc
+++ xclass-0.9.2/lib/libxclass/OXCanvas.cc
@@ -68,12 +68,12 @@
int amount, ch;
ch = _vport->GetHeight();
- amount = max(ch / 6, 1);
+ amount = std::max(ch / 6, 1);
if (event->state & ShiftMask)
amount = 1;
else if (event->state & ControlMask)
- amount = ch - max(ch / 20, 1);
+ amount = ch - std::max(ch / 20, 1);
if (event->button == Button4) {
SetVPos(-_vport->GetVPos() - amount);
@@ -156,8 +156,8 @@
_vport->MoveResize(_insets.l, _insets.t, cw, ch);
- tcw = max(_container->GetDefaultWidth(), cw);
- tch = max(_container->GetDefaultHeight(), ch);
+ tcw = std::max(_container->GetDefaultWidth(), cw);
+ tch = std::max(_container->GetDefaultHeight(), ch);
_container->SetHeight(0); // force a resize in OXFrame::Resize
_container->Resize(tcw, tch);
--- xclass-0.9.2/lib/libxclass/OXClient.cc
+++ xclass-0.9.2/lib/libxclass/OXClient.cc
@@ -217,13 +217,13 @@
XQueryColor(_dpy, _defaultColormap, &white_p);
#if 1
- color.red = max((white_p.red/5), color.red);
- color.green = max((white_p.green/5), color.green);
- color.blue = max((white_p.blue/5), color.blue);
+ color.red = std::max(static_cast<short unsigned int>(white_p.red/5), color.red);
+ color.green = std::max(static_cast<short unsigned int>(white_p.green/5), color.green);
+ color.blue = std::max(static_cast<short unsigned int>(white_p.blue/5), color.blue);
- color.red = min(white_p.red, (color.red*140)/100);
- color.green = min(white_p.green, (color.green*140)/100);
- color.blue = min(white_p.blue, (color.blue*140)/100);
+ color.red = std::min(white_p.red, static_cast<short unsigned int>((color.red*140)/100));
+ color.green = std::min(white_p.green, static_cast<short unsigned int>((color.green*140)/100));
+ color.blue = std::min(white_p.blue, static_cast<short unsigned int>((color.blue*140)/100));
#else
color.red = white_p.red - (white_p.red - color.red - 1) / 2;
color.green = white_p.green - (white_p.green - color.green - 1) / 2;
--- xclass-0.9.2/lib/libxclass/OXColorDialog.cc
+++ xclass-0.9.2/lib/libxclass/OXColorDialog.cc
@@ -557,7 +557,7 @@
void OXColorPick::_CreateDitheredImage(XImage *image, int which) {
XColor line[WIDTH];
struct { int r, g, b; } ed[WIDTH], ef;
- int x, y, c, nc, v, e[4];
+ int x, y, c, nc = 0, v, e[4];
long dist, sdist;
int iw = image->width;
@@ -976,7 +976,7 @@
hf->AddFrame(cancel, new OLayoutHints(LHINTS_BOTTOM | LHINTS_EXPAND_X));
int w = ok->GetDefaultWidth();
- w = max(w, cancel->GetDefaultWidth());
+ w = std::max(w, cancel->GetDefaultWidth());
hf->Resize(2 * (w + 20), hf->GetDefaultHeight());
ok->Associate(this);
--- xclass-0.9.2/lib/libxclass/OXFSDDListBox.cc
+++ xclass-0.9.2/lib/libxclass/OXFSDDListBox.cc
@@ -138,7 +138,7 @@
ODimension isize(_pic->GetWidth(), _pic->GetHeight());
ODimension lsize(_tw, _th+1);
- return ODimension(isize.w + lsize.w + 5, max(isize.h, lsize.h) + 2);
+ return ODimension(isize.w + lsize.w + 5, std::max(isize.h, lsize.h) + 2);
}
void OXTreeLBEntry::UpdateEntry(OXLBEntry *e) {
--- xclass-0.9.2/lib/libxclass/OXFileDialog.cc
+++ xclass-0.9.2/lib/libxclass/OXFileDialog.cc
@@ -374,7 +374,7 @@
_vbf->AddFrame(_ok, _lb);
_vbf->AddFrame(_cancel, _lb);
- int width = max(_ok->GetDefaultWidth(), _cancel->GetDefaultWidth()) + 20;
+ int width = std::max(_ok->GetDefaultWidth(), _cancel->GetDefaultWidth()) + 20;
_vbf->Resize(width, _vbf->GetDefaultHeight());
_hf->AddFrame(_vbf, _lvbf);
--- xclass-0.9.2/lib/libxclass/OXItemView.cc
+++ xclass-0.9.2/lib/libxclass/OXItemView.cc
@@ -19,6 +19,8 @@
**************************************************************************/
+#include <algorithm>
+
#include <xclass/utils.h>
#include <xclass/OXItemView.h>
@@ -473,15 +475,15 @@
OPosition start = ToPhysical(_selDragStart);
OPosition end = ToPhysical(_selDragEnd);
- start.y = max(start.y, 0);
- start.x = max(start.x, 0);
- start.y = min(start.y, _canvas->GetHeight());
- start.x = min(start.x, _canvas->GetWidth());
-
- end.y = max(end.y, 0);
- end.x = max(end.x, 0);
- end.y = min(end.y, _canvas->GetHeight());
- end.x = min(end.x, _canvas->GetWidth());
+ start.y = std::max(start.y, 0);
+ start.x = std::max(start.x, 0);
+ start.y = std::min(start.y, _canvas->GetHeight());
+ start.x = std::min(start.x, _canvas->GetWidth());
+
+ end.y = std::max(end.y, 0);
+ end.x = std::max(end.x, 0);
+ end.y = std::min(end.y, _canvas->GetHeight());
+ end.x = std::min(end.x, _canvas->GetWidth());
_canvas->DrawRectangle(_lineGC->GetGC(),
start.x, start.y, end.x - start.x, end.y - start.y);
@@ -496,10 +498,10 @@
if (_items.size() == 0) return;
if (_dragSelecting) {
- _selDragStart.x = min(_selAnchor.x, mousePos.x);
- _selDragEnd.x = max(_selAnchor.x, mousePos.x);
- _selDragStart.y = min(_selAnchor.y, mousePos.y);
- _selDragEnd.y = max(_selAnchor.y, mousePos.y);
+ _selDragStart.x = std::min(_selAnchor.x, mousePos.x);
+ _selDragEnd.x = std::max(_selAnchor.x, mousePos.x);
+ _selDragStart.y = std::min(_selAnchor.y, mousePos.y);
+ _selDragEnd.y = std::max(_selAnchor.y, mousePos.y);
selected = 0;
for (unsigned int i = 0; i < _items.size(); i++) {
--- xclass-0.9.2/lib/libxclass/OXListBox.cc
+++ xclass-0.9.2/lib/libxclass/OXListBox.cc
@@ -19,6 +19,8 @@
**************************************************************************/
+#include <algorithm>
+
#include <X11/keysym.h>
#include <xclass/utils.h>
@@ -714,13 +716,13 @@
lbe = new OXTextLBEntry(_lbc, s, ID);
lhints = new OLayoutHints(LHINTS_EXPAND_X | LHINTS_TOP);
- _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
+ _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
_lbc->AddEntry(lbe, lhints);
if (_autoUpdate) Update();
}
void OXListBox::AddEntry(OXLBEntry *lbe, OLayoutHints *lhints) {
- _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
+ _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
_lbc->AddEntry(lbe, lhints);
if (_autoUpdate) Update();
}
@@ -731,13 +733,13 @@
lbe = new OXTextLBEntry(_lbc, s, ID);
lhints = new OLayoutHints(LHINTS_EXPAND_X | LHINTS_TOP);
- _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
+ _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
_lbc->InsertEntry(lbe, lhints, afterID);
if (_autoUpdate) Update();
}
void OXListBox::InsertEntry(OXLBEntry *lbe, OLayoutHints *lhints, int afterID) {
- _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
+ _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
_lbc->InsertEntry(lbe, lhints, afterID);
if (_autoUpdate) Update();
}
@@ -757,7 +759,7 @@
void OXListBox::Resize(int w, int h) {
if (_integralHeight) {
int ih = _insets.t + _insets.b;
- h = max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
+ h = std::max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
}
OXCompositeFrame::Resize(w, h);
}
@@ -765,7 +767,7 @@
void OXListBox::MoveResize(int x, int y, int w, int h) {
if (_integralHeight) {
int ih = _insets.t + _insets.b;
- h = max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
+ h = std::max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
}
OXCompositeFrame::MoveResize(x, y, w, h);
}
@@ -775,7 +777,7 @@
if (_integralHeight) {
int ih = _insets.t + _insets.b;
- h = max(_itemVsize, ((_h - ih) / _itemVsize) * _itemVsize) + ih;
+ h = std::max(_itemVsize, ((_h - ih) / _itemVsize) * _itemVsize) + ih;
} else {
h = _h;
}
@@ -822,7 +824,7 @@
_vport->MoveResize(_insets.l, _insets.t, cw, ch);
_container->Layout();
- tch = max(_container->GetDefaultHeight(), ch);
+ tch = std::max(_container->GetDefaultHeight(), ch);
_container->SetHeight(0); // force a resize in OXFrame::Resize
_container->Resize(cw, tch);
// _vport->SetPos(0, 0);
--- xclass-0.9.2/lib/libxclass/OXListTree.cc
+++ xclass-0.9.2/lib/libxclass/OXListTree.cc
@@ -24,6 +24,8 @@
#include <stdio.h>
+#include <algorithm>
+
#include <X11/keysym.h>
#include <xclass/OXClient.h>
@@ -59,7 +61,7 @@
open_pic = opened;
closed_pic = closed;
- picWidth = max(open_pic->GetWidth(), closed_pic->GetWidth());
+ picWidth = std::max(open_pic->GetWidth(), closed_pic->GetWidth());
open =
active = False;
--- xclass-0.9.2/lib/libxclass/OXListView.cc
+++ xclass-0.9.2/lib/libxclass/OXListView.cc
@@ -158,7 +158,7 @@
switch (_viewMode) {
default:
case LV_LARGE_ICONS:
- size.w = max(isize.w, lsize.w);
+ size.w = std::max(isize.w, lsize.w);
size.h = isize.h + lsize.h + 6;
break;
@@ -166,7 +166,7 @@
case LV_LIST:
case LV_DETAILS:
size.w = isize.w + lsize.w + 4;
- size.h = max(isize.h, lsize.h);
+ size.h = std::max(isize.h, lsize.h);
if (_fullRowSelect && (_viewMode == LV_DETAILS)) size.w = _parent->GetVirtualSize().w;
break;
}
@@ -213,7 +213,7 @@
w->FillRectangle(rectGC, -_parent->GetScrollPosition().x, pos.y, size.w, size.h);
} else {
w->FillRectangle(rectGC, pos.x + _textPos.x, pos.y + _textPos.y,
- min(_tw, columnData[0]->width - _textPos.x - 2), _th + 1);
+ std::min(_tw, columnData[0]->width - _textPos.x - 2), _th + 1);
}
if (_focused && (_tw > 0)) {
@@ -225,10 +225,10 @@
} else {
w->DrawRectangle(_client->GetResourcePool()->GetDocumentBckgndGC()->GetGC(),
pos.x + _textPos.x, pos.y + _textPos.y,
- min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
+ std::min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
w->DrawRectangle(_client->GetResourcePool()->GetFocusHiliteGC()->GetGC(),
pos.x + _textPos.x, pos.y + _textPos.y,
- min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
+ std::min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
}
}
@@ -961,7 +961,7 @@
case LV_LARGE_ICONS:
currentPos.x = _itemSep.w;
currentPos.y = _itemSep.h;
- _virtualSize.w = max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
+ _virtualSize.w = std::max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
_rows = 0;
for (i = 0; i < _items.size(); i++) {
@@ -995,7 +995,7 @@
case LV_SMALL_ICONS:
currentPos.x = _itemSep.w;
currentPos.y = _itemSep.h;
- _virtualSize.w = max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
+ _virtualSize.w = std::max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
_rows = 0;
for (i = 0; i < _items.size(); i++) {
@@ -1029,7 +1029,7 @@
case LV_LIST:
currentPos.x = _itemSep.w;
currentPos.y = _itemSep.h;
- _virtualSize.h = max(canvasSize.h, maxItemSize.h + _itemSep.h * 2);
+ _virtualSize.h = std::max(canvasSize.h, maxItemSize.h + _itemSep.h * 2);
_cols = 0;
for (i = 0; i < _items.size(); i++) {
--- xclass-0.9.2/lib/libxclass/OXMdiMainFrame.cc
+++ xclass-0.9.2/lib/libxclass/OXMdiMainFrame.cc
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <algorithm>
#include <X11/keysym.h>
#include <X11/cursorfont.h>
@@ -995,8 +996,8 @@
int xpos = -_main->GetViewPort()->GetHPos();
int ypos = -_main->GetViewPort()->GetVPos();
- return ODimension(max(xpos + _w, rect.right_bottom().x + 1),
- max(ypos + _h, rect.right_bottom().y + 1));
+ return ODimension(std::max(xpos + _w, rect.right_bottom().x + 1),
+ std::max(ypos + _h, rect.right_bottom().y + 1));
}
int OXMdiContainer::HandleConfigureNotify(XConfigureEvent *event) {
@@ -1009,8 +1010,8 @@
int vw = _main->GetViewPort()->GetWidth();
int vh = _main->GetViewPort()->GetHeight();
- int w = max(vw, rect.right_bottom().x + 1);
- int h = max(vh, rect.right_bottom().y + 1);
+ int w = std::max(vw, rect.right_bottom().x + 1);
+ int h = std::max(vh, rect.right_bottom().y + 1);
if ((w != _w) || (h != _h)) {
((OXMainFrame *)_main)->Layout();
--- xclass-0.9.2/lib/libxclass/OXMenu.cc
+++ xclass-0.9.2/lib/libxclass/OXMenu.cc
@@ -19,6 +19,8 @@
**************************************************************************/
+#include <algorithm>
+
#include <string.h>
#include <xclass/utils.h>
@@ -631,10 +633,10 @@
} else {
pw = 0;
}
- lsize = max(lsize, ltw);
- rsize = max(rsize, rtw);
+ lsize = std::max(lsize, ltw);
+ rsize = std::max(rsize, rtw);
tw = (rsize > 0) ? lsize + rsize + sepw : ltw;
- w = max(w, spw + _xl + tw + RIGHT_GAP); // _xl already includes pw
+ w = std::max(w, spw + _xl + tw + RIGHT_GAP); // _xl already includes pw
h += _hifont->TextHeight() + 3;
break;
@@ -650,7 +652,7 @@
rtw = 0;
}
tw = (rsize > 0) ? lsize + rsize + sepw : ltw;
- w = max(w, spw + _xl + tw + RIGHT_GAP + POPUPMARK_WIDTH);
+ w = std::max(w, spw + _xl + tw + RIGHT_GAP + POPUPMARK_WIDTH);
h += _hifont->TextHeight() + 3;
break;
--- xclass-0.9.2/lib/libxclass/OXMsgBox.cc
+++ xclass-0.9.2/lib/libxclass/OXMsgBox.cc
@@ -18,6 +18,7 @@
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**************************************************************************/
+#include <algorithm>
#include <xclass/utils.h>
#include <xclass/OXClient.h>
@@ -98,7 +99,7 @@
Yes = new OXTextButton(ButtonFrame, new OHotString("&Yes"), ID_YES);
Yes->Associate(this);
ButtonFrame->AddFrame(Yes, L1);
- width = max(width, Yes->GetDefaultWidth()); ++nb;
+ width = std::max(width, Yes->GetDefaultWidth()); ++nb;
}
if (buttons & ID_YESALL) {
@@ -106,63 +107,63 @@
ID_YESALL);
YesAll->Associate(this);
ButtonFrame->AddFrame(YesAll, L1);
- width = max(width, YesAll->GetDefaultWidth()); ++nb;
+ width = std::max(width, YesAll->GetDefaultWidth()); ++nb;
}
if (buttons & ID_NO) {
No = new OXTextButton(ButtonFrame, new OHotString("&No"), ID_NO);
No->Associate(this);
ButtonFrame->AddFrame(No, L1);
- width = max(width, No->GetDefaultWidth()); ++nb;
+ width = std::max(width, No->GetDefaultWidth()); ++nb;
}
if (buttons & ID_OK) {
OK = new OXTextButton(ButtonFrame, new OHotString("&OK"), ID_OK);
OK->Associate(this);
ButtonFrame->AddFrame(OK, L1);
- width = max(width, OK->GetDefaultWidth()); ++nb;
+ width = std::max(width, OK->GetDefaultWidth()); ++nb;
}
if (buttons & ID_APPLY) {
Apply = new OXTextButton(ButtonFrame, new OHotString("&Apply"), ID_APPLY);
Apply->Associate(this);
ButtonFrame->AddFrame(Apply, L1);
- width = max(width, Apply->GetDefaultWidth()); ++nb;
+ width = std::max(width, Apply->GetDefaultWidth()); ++nb;
}
if (buttons & ID_RETRY) {
Retry = new OXTextButton(ButtonFrame, new OHotString("&Retry"), ID_RETRY);
Retry->Associate(this);
ButtonFrame->AddFrame(Retry, L1);
- width = max(width, Retry->GetDefaultWidth()); ++nb;
+ width = std::max(width, Retry->GetDefaultWidth()); ++nb;
}
if (buttons & ID_IGNORE) {
Ignore = new OXTextButton(ButtonFrame, new OHotString("&Ignore"), ID_IGNORE);
Ignore->Associate(this);
ButtonFrame->AddFrame(Ignore, L1);
- width = max(width, Ignore->GetDefaultWidth()); ++nb;
+ width = std::max(width, Ignore->GetDefaultWidth()); ++nb;
}
if (buttons & ID_CANCEL) {
Cancel = new OXTextButton(ButtonFrame, new OHotString("&Cancel"), ID_CANCEL);
Cancel->Associate(this);
ButtonFrame->AddFrame(Cancel, L1);
- width = max(width, Cancel->GetDefaultWidth()); ++nb;
+ width = std::max(width, Cancel->GetDefaultWidth()); ++nb;
}
if (buttons & ID_CLOSE) {
Close = new OXTextButton(ButtonFrame, new OHotString("C&lose"), ID_CLOSE);
Close->Associate(this);
ButtonFrame->AddFrame(Close, L1);
- width = max(width, Close->GetDefaultWidth()); ++nb;
+ width = std::max(width, Close->GetDefaultWidth()); ++nb;
}
if (buttons & ID_DISMISS) {
Dismiss = new OXTextButton(ButtonFrame, new OHotString("&Dismiss"), ID_DISMISS);
Dismiss->Associate(this);
ButtonFrame->AddFrame(Dismiss, L1);
- width = max(width, Dismiss->GetDefaultWidth()); ++nb;
+ width = std::max(width, Dismiss->GetDefaultWidth()); ++nb;
}
//--- place buttons at the bottom
--- xclass-0.9.2/lib/libxclass/OXPropertiesDialog.cc
+++ xclass-0.9.2/lib/libxclass/OXPropertiesDialog.cc
@@ -18,6 +18,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**************************************************************************/
+#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
@@ -131,8 +132,8 @@
bf->AddFrame(Apply, bly);
width = Ok->GetDefaultWidth();
- width = max(width, Cancel->GetDefaultWidth());
- width = max(width, Apply->GetDefaultWidth());
+ width = std::max(width, Cancel->GetDefaultWidth());
+ width = std::max(width, Apply->GetDefaultWidth());
bf->Resize((width + 20) * 3, bf->GetDefaultHeight());
// the "Apply" button is initially disabled,
--- xclass-0.9.2/lib/libxclass/OXResizer.cc
+++ xclass-0.9.2/lib/libxclass/OXResizer.cc
@@ -18,6 +18,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**************************************************************************/
+#include <algorithm>
#include <X11/X.h>
#include <X11/cursorfont.h>
@@ -244,12 +245,12 @@
}
void OXHorizontalResizer::Resize(int w, int h) {
- if (_handle) _handle->Resize(max(w, 1), max(h, 1));
+ if (_handle) _handle->Resize(std::max(w, 1), std::max(h, 1));
OXFrame::Resize(w, h);
}
void OXHorizontalResizer::MoveResize(int x, int y, int w, int h) {
- if (_handle) _handle->MoveResize(x + hx, y + hy, max(w, 1), max(h, 1));;
+ if (_handle) _handle->MoveResize(x + hx, y + hy, std::max(w, 1), std::max(h, 1));;
OXFrame::MoveResize(x, y, w, h);
}
@@ -492,12 +493,12 @@
}
void OXVerticalResizer::Resize(int w, int h) {
- if (_handle) _handle->Resize(max(w, 1), max(h, 1));
+ if (_handle) _handle->Resize(std::max(w, 1), std::max(h, 1));
OXFrame::Resize(w, h);
}
void OXVerticalResizer::MoveResize(int x, int y, int w, int h) {
- if (_handle) _handle->MoveResize(x + hx, y + hy, max(w, 1), max(h, 1));;
+ if (_handle) _handle->MoveResize(x + hx, y + hy, std::max(w, 1), std::max(h, 1));;
OXFrame::MoveResize(x, y, w, h);
}
--- xclass-0.9.2/lib/libxclass/OXScrollBar.cc
+++ xclass-0.9.2/lib/libxclass/OXScrollBar.cc
@@ -205,10 +205,10 @@
GrabModeAsync, GrabModeAsync, None, None);
_dragging = False;
- _x0 = _y0 = (_sb_width = max(_sb_width, 5));
+ _x0 = _y0 = (_sb_width = std::max(_sb_width, 5));
_pos = 0;
- _range = max(h - (_sb_width << 1), 1);
+ _range = std::max(h - (_sb_width << 1), 1);
_psize = _range >> 1;
_slsize = 50;
@@ -266,7 +266,7 @@
IN_RANGE(_pos, 0, _range - _psize);
- _x0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
+ _x0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
IN_RANGE(_x0, _sb_width, _sb_width + _slrange);
@@ -342,15 +342,15 @@
void OXHScrollBar::SetRange(int range, int page_size, int sendMsg) {
- _range = max(range, 1);
- _psize = max(page_size, 0);
+ _range = std::max(range, 1);
+ _psize = std::max(page_size, 0);
- _slsize = max(_psize * (_w - (_sb_width << 1)) / _range, 6);
- _slsize = min(_slsize, _w - (_sb_width << 1));
+ _slsize = std::max(_psize * (_w - (_sb_width << 1)) / _range, 6);
+ _slsize = std::min(_slsize, _w - (_sb_width << 1));
- _slrange = max(_w - (_sb_width << 1) - _slsize, 1);
+ _slrange = std::max(_w - (_sb_width << 1) - _slsize, 1);
- _x0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
+ _x0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
IN_RANGE(_x0, _sb_width, _sb_width + _slrange);
_slider->MoveResize(_x0, 0, _slsize, _sb_width);
@@ -374,7 +374,7 @@
_pos = pos;
IN_RANGE(_pos, 0, _range - _psize);
- _x0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
+ _x0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
IN_RANGE(_x0, _sb_width, _sb_width + _slrange);
_slider->MoveResize(_x0, 0, _slsize, _sb_width);
@@ -414,10 +414,10 @@
GrabModeAsync, GrabModeAsync, None, None);
_dragging = False;
- _x0 = _y0 = (_sb_width = max(_sb_width, 5));
+ _x0 = _y0 = (_sb_width = std::max(_sb_width, 5));
_pos = 0;
- _range = max(h - (_sb_width << 1), 1);
+ _range = std::max(h - (_sb_width << 1), 1);
_psize = _range >> 1;
_slsize = 50;
@@ -475,7 +475,7 @@
IN_RANGE(_pos, 0, _range - _psize);
- _y0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
+ _y0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
IN_RANGE(_y0, _sb_width, _sb_width + _slrange);
@@ -549,15 +549,15 @@
void OXVScrollBar::SetRange(int range, int page_size, int sendMsg) {
- _range = max(range, 1);
- _psize = max(page_size, 0);
+ _range = std::max(range, 1);
+ _psize = std::max(page_size, 0);
- _slsize = max(_psize * (_h - (_sb_width << 1)) / _range, 6);
- _slsize = min(_slsize, _h - (_sb_width << 1));
+ _slsize = std::max(_psize * (_h - (_sb_width << 1)) / _range, 6);
+ _slsize = std::min(_slsize, _h - (_sb_width << 1));
- _slrange = max(_h - (_sb_width << 1) - _slsize, 1);
+ _slrange = std::max(_h - (_sb_width << 1) - _slsize, 1);
- _y0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
+ _y0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
IN_RANGE(_y0, _sb_width, _sb_width + _slrange);
_slider->MoveResize(0, _y0, _sb_width, _slsize);
@@ -581,7 +581,7 @@
_pos = pos;
IN_RANGE(_pos, 0, _range - _psize);
- _y0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
+ _y0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
IN_RANGE(_y0, _sb_width, _sb_width + _slrange);
_slider->MoveResize(0, _y0, _sb_width, _slsize);
--- xclass-0.9.2/lib/libxclass/OXTab.cc
+++ xclass-0.9.2/lib/libxclass/OXTab.cc
@@ -56,7 +56,7 @@
_tw = _font->TextWidth(_text->GetString(), _text->GetLength());
_th = _font->TextHeight();
_yt = fm.ascent;
- Resize(max(_tw+12, 45), _th+6);
+ Resize(std::max(_tw+12, 45), _th+6);
}
OXTabElt::~OXTabElt() {
@@ -81,7 +81,7 @@
}
ODimension OXTabElt::GetDefaultSize() const {
- return ODimension(max(_tw+12, 40), _th+6);
+ return ODimension(std::max(_tw+12, 40), _th+6);
}
void OXTabElt::ShowFocusHilite(int onoff) {
--- xclass-0.9.2/lib/libxclass/OXTextEdit.cc
+++ xclass-0.9.2/lib/libxclass/OXTextEdit.cc
@@ -1647,8 +1647,8 @@
} else {
- lineSelStart = min(mousePos.x, _selAnchor.x);
- lineSelEnd = max(mousePos.x, _selAnchor.x);
+ lineSelStart = std::min(mousePos.x, _selAnchor.x);
+ lineSelEnd = std::max(mousePos.x, _selAnchor.x);
}
@@ -1663,10 +1663,10 @@
// update the coordinates of the selection area
- _selDragStart.x = min(_selAnchor.x, mousePos.x);
- _selDragStart.y = min(_selAnchor.y, mousePos.y);
- _selDragEnd.x = max(_selAnchor.x, mousePos.x);
- _selDragEnd.y = max(_selAnchor.y, mousePos.y);
+ _selDragStart.x = std::min(_selAnchor.x, mousePos.x);
+ _selDragStart.y = std::min(_selAnchor.y, mousePos.y);
+ _selDragEnd.x = std::max(_selAnchor.x, mousePos.x);
+ _selDragEnd.y = std::max(_selAnchor.y, mousePos.y);
// all lines that are inside the selection area are selected and their
// selection is adjusted
--- xclass-0.9.2/lib/libxclass/OXTextEntry.cc
+++ xclass-0.9.2/lib/libxclass/OXTextEntry.cc
@@ -165,8 +165,8 @@
drawGC->SetBackground(_backPixel);
if (_selection_on &&
- _cursor_ix >= min(_start_ix, _end_ix) &&
- _cursor_ix < max(_start_ix, _end_ix)) {
+ _cursor_ix >= std::min(_start_ix, _end_ix) &&
+ _cursor_ix < std::max(_start_ix, _end_ix)) {
drawGC = _selGC;
drawGC->SetFont(_normGC->GetFont());
drawGC->SetBackground(_defaultSelectedBackground);
@@ -236,8 +236,8 @@
if (_selection_on) {
int xs, ws, ixs, iws;
- xs = min(_start_x, _end_x);
- ixs = min(_start_ix, _end_ix);
+ xs = std::min(_start_x, _end_x);
+ ixs = std::min(_start_ix, _end_ix);
if ((_vstart_x > xs) && (start_char > ixs)) {
xs = _vstart_x;
@@ -317,8 +317,8 @@
ix = down;
// safety check...
- ix = max(ix, 0);
- ix = min(ix, len); // len-1
+ ix = std::max(ix, 0);
+ ix = std::min(ix, len); // len-1
return ix;
}
@@ -500,7 +500,7 @@
if (_selection_on) {
int start, ns;
- start = min(_start_ix, _end_ix);
+ start = std::min(_start_ix, _end_ix);
ns = abs(_end_ix - _start_ix);
_text->RemoveText(start, ns);
_selection_on = False;
@@ -516,7 +516,7 @@
if (_selection_on) {
int start, ns;
- start = min(_start_ix, _end_ix);
+ start = std::min(_start_ix, _end_ix);
ns = abs(_end_ix - _start_ix);
_text->RemoveText(start, ns);
_selection_on = False;
@@ -549,7 +549,7 @@
if (_selection_on && (strlen(tmp) > 0)) {
int start, ns;
- start = min(_start_ix, _end_ix);
+ start = std::min(_start_ix, _end_ix);
ns = abs(_end_ix - _start_ix);
_text->RemoveText(start, ns);
_selection_on = False;
@@ -659,7 +659,7 @@
if (_selection_on) {
int start, ns;
- start = min(_start_ix, _end_ix);
+ start = std::min(_start_ix, _end_ix);
ns = abs(_end_ix - _start_ix);
_text->RemoveText(start, ns);
_selection_on = False;
--- xclass-0.9.2/lib/libxclass/OXToolBarButton.cc
+++ xclass-0.9.2/lib/libxclass/OXToolBarButton.cc
@@ -136,16 +136,16 @@
ODimension OXToolBarButton::GetDefaultSize() const {
ODimension size(_tw, 0);
if (_normalPic) {
- size.w = max(size.w, _normalPic->GetWidth());
- size.h = max(size.h, _normalPic->GetHeight());
+ size.w = std::max(size.w, static_cast<unsigned int>(_normalPic->GetWidth()));
+ size.h = std::max(size.h, static_cast<unsigned int>(_normalPic->GetHeight()));
}
if (_onPic) {
- size.w = max(size.w, _onPic->GetWidth());
- size.h = max(size.h, _onPic->GetHeight());
+ size.w = std::max(size.w, static_cast<unsigned int>(_onPic->GetWidth()));
+ size.h = std::max(size.h, static_cast<unsigned int>(_onPic->GetHeight()));
}
if (_disabledPic) {
- size.w = max(size.w, _disabledPic->GetWidth());
- size.h = max(size.h, _disabledPic->GetHeight());
+ size.w = std::max(size.w, static_cast<unsigned int>(_disabledPic->GetWidth()));
+ size.h = std::max(size.h, static_cast<unsigned int>(_disabledPic->GetHeight()));
}
size.w += 6;
size.h += _th + 6;
--- xclass-0.9.2/lib/libxclass/OXView.cc
+++ xclass-0.9.2/lib/libxclass/OXView.cc
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <algorithm>
#include <xclass/utils.h>
#include <xclass/OPicture.h>
@@ -158,14 +159,14 @@
ch = _canvas->GetHeight();
if (_scrollValue.y == 1)
- amount = _scrollValue.y * max(ch / 6, 1);
+ amount = _scrollValue.y * std::max(ch / 6, 1);
else
amount = _scrollValue.y * 5;
if (event->state & ShiftMask)
amount = _scrollValue.y;
else if (event->state & ControlMask)
- amount = ch - max(ch / 20, 1);
+ amount = ch - std::max(ch / 20, 1);
if (event->button == Button4) {
ScrollDown(amount);
--- xclass-0.9.2/lib/libxclass/OXWindow.cc
+++ xclass-0.9.2/lib/libxclass/OXWindow.cc
@@ -34,7 +34,7 @@
_parent = p;
_toplevel = p->_toplevel;
_id = XCreateWindow(GetDisplay(), _parent->_id,
- x, y, max(w, 1), max(h, 1), max(border, 0),
+ x, y, std::max(w, 1), std::max(h, 1), std::max(border, 0),
depth, clss, visual, vmask, attr);
_windowExists = (_id != None);
_client->RegisterWindow(this);
@@ -64,11 +64,11 @@
}
void OXWindow::Resize(int w, int h) {
- XResizeWindow(GetDisplay(), _id, max(w, 1), max(h, 1));
+ XResizeWindow(GetDisplay(), _id, std::max(w, 1), std::max(h, 1));
}
void OXWindow::MoveResize(int x, int y, int w, int h) {
- XMoveResizeWindow(GetDisplay(), _id, x, y, max(w, 1), max(h, 1));
+ XMoveResizeWindow(GetDisplay(), _id, x, y, std::max(w, 1), std::max(h, 1));
}
int OXWindow::IsMapped() {
--- xclass-0.9.2/test/exec.cc
+++ xclass-0.9.2/test/exec.cc
@@ -369,12 +369,12 @@
Ok->SetDefault();
Ok->Associate(this);
ButtonFrame->AddFrame(Ok, L1);
- width = max(width, Ok->GetDefaultWidth());
+ width = std::max(width, Ok->GetDefaultWidth());
Cancel = new OXTextButton(ButtonFrame, new OHotString("&Cancel"), ID_CANCEL);
Cancel->Associate(this);
ButtonFrame->AddFrame(Cancel, L1);
- width = max(width, Cancel->GetDefaultWidth());
+ width = std::max(width, Cancel->GetDefaultWidth());
//--- place buttons at the bottom
--- xclass-0.9.2/test/xdnd.cc
+++ xclass-0.9.2/test/xdnd.cc
@@ -248,7 +248,7 @@
_font->GetFontMetrics(&fm);
_ta = fm.ascent;
- w = max(icon->GetWidth(), _tw);
+ w = std::max(icon->GetWidth(), _tw);
h = icon->GetHeight() + _th+1 + 6;
ix = (w - icon->GetWidth()) >> 1;