Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: include/xclass/ORectangle.h
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/include/xclass/ORectangle.h,v
- retrieving revision 1.4
- diff -u -r1.4 ORectangle.h
- --- include/xclass/ORectangle.h 16 May 2003 08:46:29 -0000 1.4
- +++ include/xclass/ORectangle.h 13 Jun 2023 11:34:17 -0000
- @@ -26,7 +26,8 @@
- #include <xclass/OBaseObject.h>
- #include <xclass/ODimension.h>
- -
- +#include <algorithm>
- +/*
- #ifndef min
- #define min(a,b) (((a)<(b)) ? (a) : (b))
- #endif
- @@ -34,7 +35,7 @@
- #ifndef max
- #define max(a,b) (((a)>(b)) ? (a) : (b))
- #endif
- -
- +*/
- //----------------------------------------------------------------------
- @@ -72,8 +73,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; }
- Index: include/xclass/OXFileList.h
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/include/xclass/OXFileList.h,v
- retrieving revision 1.8
- diff -u -r1.8 OXFileList.h
- --- include/xclass/OXFileList.h 14 Oct 2004 14:29:29 -0000 1.8
- +++ include/xclass/OXFileList.h 13 Jun 2023 11:34:17 -0000
- @@ -23,6 +23,7 @@
- #define __OXFILELIST_H
- #include <vector>
- +#include <algorithm>
- #include <regex.h>
- #include <X11/Xlib.h>
- Index: include/xclass/OXHelpDoc.h
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/include/xclass/OXHelpDoc.h,v
- retrieving revision 1.1
- diff -u -r1.1 OXHelpDoc.h
- --- include/xclass/OXHelpDoc.h 2 Jul 2004 12:42:35 -0000 1.1
- +++ include/xclass/OXHelpDoc.h 13 Jun 2023 11:34:17 -0000
- @@ -23,6 +23,7 @@
- #define __OXHELPDOC_H
- #include <vector>
- +#include <algorithm>
- #include <xclass/utils.h>
- #include <xclass/OHtmlUri.h>
- Index: include/xclass/OXListTree.h
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/include/xclass/OXListTree.h,v
- retrieving revision 1.9
- diff -u -r1.9 OXListTree.h
- --- include/xclass/OXListTree.h 23 Aug 2002 09:41:35 -0000 1.9
- +++ include/xclass/OXListTree.h 13 Jun 2023 11:34:17 -0000
- @@ -140,7 +140,7 @@
- void _InsertChildren(OListTreeItem *parent, OListTreeItem *item);
- int _SearchChildren(OListTreeItem *item, int y, int findy,
- OListTreeItem **finditem);
- - OListTreeItem *OXListTree::_FindItem(int findy);
- + OListTreeItem *_FindItem(int findy);
- OListTreeItem *_first, *_selected;
- int _hspacing, _vspacing, _indent, _margin, _last_y;
- Index: include/xclass/utils.h
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/include/xclass/utils.h,v
- retrieving revision 1.2
- diff -u -r1.2 utils.h
- --- include/xclass/utils.h 5 Jul 2002 08:11:37 -0000 1.2
- +++ include/xclass/utils.h 13 Jun 2023 11:34:17 -0000
- @@ -55,7 +55,7 @@
- #undef NULL
- #define NULL 0
- -
- +/*
- #ifndef min
- #define min(a,b) (((a)<(b)) ? (a) : (b))
- #endif
- @@ -63,7 +63,7 @@
- #ifndef max
- #define max(a,b) (((a)>(b)) ? (a) : (b))
- #endif
- -
- +*/
- char *StrDup(const char *s);
- int MakePath(const char *path, mode_t mode);
- void FatalError(const char *fmt, ...);
- Index: lib/libxclass/O2ColumnsLayout.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/O2ColumnsLayout.cc,v
- retrieving revision 1.2
- diff -u -r1.2 O2ColumnsLayout.cc
- --- lib/libxclass/O2ColumnsLayout.cc 22 Aug 2002 10:43:45 -0000 1.2
- +++ lib/libxclass/O2ColumnsLayout.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,7 @@
- **************************************************************************/
- +#include <algorithm>
- #include <xclass/O2ColumnsLayout.h>
- //----------------------------------------------------------------------
- @@ -39,16 +40,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 +73,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;
- }
- Index: lib/libxclass/OColor.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OColor.cc,v
- retrieving revision 1.1
- diff -u -r1.1 OColor.cc
- --- lib/libxclass/OColor.cc 23 Nov 2001 10:08:47 -0000 1.1
- +++ lib/libxclass/OColor.cc 13 Jun 2023 11:34:17 -0000
- @@ -18,6 +18,7 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **************************************************************************/
- +#include <algorithm>
- #include <X11/X.h>
- @@ -95,8 +96,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;
- Index: lib/libxclass/ODNDmanager.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/ODNDmanager.cc,v
- retrieving revision 1.4
- diff -u -r1.4 ODNDmanager.cc
- --- lib/libxclass/ODNDmanager.cc 5 Nov 2001 10:06:13 -0000 1.4
- +++ lib/libxclass/ODNDmanager.cc 13 Jun 2023 11:34:17 -0000
- @@ -25,6 +25,8 @@
- #include <fcntl.h>
- #include <sys/stat.h>
- +#include <algorithm>
- +
- #include <X11/Xatom.h>
- #include <X11/cursorfont.h>
- @@ -216,7 +218,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) {
- Index: lib/libxclass/OGifImage.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OGifImage.cc,v
- retrieving revision 1.1
- diff -u -r1.1 OGifImage.cc
- --- lib/libxclass/OGifImage.cc 14 May 2003 13:33:00 -0000 1.1
- +++ lib/libxclass/OGifImage.cc 13 Jun 2023 11:34:17 -0000
- @@ -934,7 +934,7 @@
- void OGifImage::AllocClosestColor(int ColorMapSize) {
- int i, j, Index = 0, Count = 0, XNumOfColors;
- - unsigned long D, Distance, AvgDistance = 0, Red, Green, Blue;
- + long D, Distance, AvgDistance = 0, Red, Green, Blue;
- bool Failed = false;
- XColor *XOldColorTable;
- Index: lib/libxclass/OLayout.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OLayout.cc,v
- retrieving revision 1.4
- diff -u -r1.4 OLayout.cc
- --- lib/libxclass/OLayout.cc 23 Sep 2004 11:28:00 -0000 1.4
- +++ lib/libxclass/OLayout.cc 13 Jun 2023 11:34:17 -0000
- @@ -22,6 +22,15 @@
- #include <xclass/utils.h>
- #include <xclass/OXCompositeFrame.h>
- +#ifndef min
- +#define min(a,b) (((a)<(b)) ? (a) : (b))
- +#endif
- +
- +#ifndef max
- +#define max(a,b) (((a)>(b)) ? (a) : (b))
- +#endif
- +
- +
- //--------------------------------------------------------------------
- Index: lib/libxclass/OListViewLayout.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OListViewLayout.cc,v
- retrieving revision 1.2
- diff -u -r1.2 OListViewLayout.cc
- --- lib/libxclass/OListViewLayout.cc 5 Jul 2002 08:11:38 -0000 1.2
- +++ lib/libxclass/OListViewLayout.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,9 @@
- **************************************************************************/
- +
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXClient.h>
- #include <xclass/OXCompositeFrame.h>
- @@ -42,11 +45,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 +88,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 +103,7 @@
- }
- }
- if (x != _sep) y += max_osize.h + _sep;
- - max_size.h = max(y, msize.h);
- + max_size.h = std::max(y, (int)msize.h);
- return max_size;
- }
- @@ -117,11 +120,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 +164,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 +179,7 @@
- }
- }
- if (y != (_sep << 1)) x += max_osize.w + _sep;
- - max_size.w = max(x, msize.w);
- + max_size.w = std::max(x, (int)msize.w);
- return max_size;
- }
- @@ -190,7 +193,7 @@
- for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
- csize = ptr->frame->GetDefaultSize();
- - max_oh = max(max_oh, csize.h);
- + max_oh = std::max(max_oh, (int)csize.h);
- }
- for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
- @@ -210,8 +213,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) {
- Index: lib/libxclass/OMatrixLayout.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OMatrixLayout.cc,v
- retrieving revision 1.2
- diff -u -r1.2 OMatrixLayout.cc
- --- lib/libxclass/OMatrixLayout.cc 5 Jul 2002 08:11:38 -0000 1.2
- +++ lib/libxclass/OMatrixLayout.cc 13 Jun 2023 11:34:17 -0000
- @@ -18,6 +18,7 @@
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **************************************************************************/
- +#include <algorithm>
- #include <xclass/utils.h>
- #include <xclass/OXCompositeFrame.h>
- @@ -62,8 +63,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 +88,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) {
- Index: lib/libxclass/ORowColumnLayout.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/ORowColumnLayout.cc,v
- retrieving revision 1.3
- diff -u -r1.3 ORowColumnLayout.cc
- --- lib/libxclass/ORowColumnLayout.cc 20 Aug 2002 13:27:56 -0000 1.3
- +++ lib/libxclass/ORowColumnLayout.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,8 @@
- **************************************************************************/
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXCompositeFrame.h>
- @@ -53,7 +55,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 +101,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);
- }
- }
- Index: lib/libxclass/OXAboutDialog.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXAboutDialog.cc,v
- retrieving revision 1.4
- diff -u -r1.4 OXAboutDialog.cc
- --- lib/libxclass/OXAboutDialog.cc 1 Jul 2002 09:58:13 -0000 1.4
- +++ lib/libxclass/OXAboutDialog.cc 13 Jun 2023 11:34:17 -0000
- @@ -18,6 +18,7 @@
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **************************************************************************/
- +#include <algorithm>
- #include <xclass/utils.h>
- #include <xclass/OXLabel.h>
- @@ -73,7 +74,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) {
- Index: lib/libxclass/OXCanvas.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXCanvas.cc,v
- retrieving revision 1.7
- diff -u -r1.7 OXCanvas.cc
- --- lib/libxclass/OXCanvas.cc 20 Aug 2002 13:27:56 -0000 1.7
- +++ lib/libxclass/OXCanvas.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,8 @@
- **************************************************************************/
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXClient.h>
- #include <xclass/OXWidget.h>
- @@ -68,12 +70,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 +158,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);
- Index: lib/libxclass/OXClient.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXClient.cc,v
- retrieving revision 1.15
- diff -u -r1.15 OXClient.cc
- --- lib/libxclass/OXClient.cc 14 Oct 2004 14:29:29 -0000 1.15
- +++ lib/libxclass/OXClient.cc 13 Jun 2023 11:34:17 -0000
- @@ -27,6 +27,8 @@
- #include <sys/time.h>
- #include <sys/types.h>
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXClient.h>
- #include <xclass/OXRootWindow.h>
- @@ -217,13 +219,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((white_p.red/5), (int)color.red);
- + color.green = std::max((white_p.green/5), (int)color.green);
- + color.blue = std::max((white_p.blue/5), (int)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((int)white_p.red, (color.red*140)/100);
- + color.green = std::min((int)white_p.green, (color.green*140)/100);
- + color.blue = std::min((int)white_p.blue, (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;
- Index: lib/libxclass/OXColorDialog.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXColorDialog.cc,v
- retrieving revision 1.6
- diff -u -r1.6 OXColorDialog.cc
- --- lib/libxclass/OXColorDialog.cc 25 Jul 2004 15:41:56 -0000 1.6
- +++ lib/libxclass/OXColorDialog.cc 13 Jun 2023 11:34:17 -0000
- @@ -22,6 +22,8 @@
- #include <stdio.h>
- #include <stdlib.h>
- +#include <algorithm>
- +
- #include <X11/keysym.h>
- #include <xclass/OXLabel.h>
- @@ -976,7 +978,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);
- Index: lib/libxclass/OXFSDDListBox.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXFSDDListBox.cc,v
- retrieving revision 1.6
- diff -u -r1.6 OXFSDDListBox.cc
- --- lib/libxclass/OXFSDDListBox.cc 16 Sep 2004 15:36:10 -0000 1.6
- +++ lib/libxclass/OXFSDDListBox.cc 13 Jun 2023 11:34:17 -0000
- @@ -22,6 +22,8 @@
- #include <stdio.h>
- #include <unistd.h>
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/ODimension.h>
- #include <xclass/OXFSDDListBox.h>
- @@ -138,7 +140,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) {
- Index: lib/libxclass/OXFileDialog.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXFileDialog.cc,v
- retrieving revision 1.14
- diff -u -r1.14 OXFileDialog.cc
- --- lib/libxclass/OXFileDialog.cc 23 Sep 2004 11:28:01 -0000 1.14
- +++ lib/libxclass/OXFileDialog.cc 13 Jun 2023 11:34:17 -0000
- @@ -26,6 +26,8 @@
- #include <errno.h>
- #include <sys/stat.h>
- +#include <algorithm>
- +
- #include <X11/keysym.h>
- #include <xclass/utils.h>
- @@ -374,7 +376,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);
- Index: lib/libxclass/OXFrame.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXFrame.cc,v
- retrieving revision 1.9
- diff -u -r1.9 OXFrame.cc
- --- lib/libxclass/OXFrame.cc 14 Oct 2004 14:29:29 -0000 1.9
- +++ lib/libxclass/OXFrame.cc 13 Jun 2023 11:34:17 -0000
- @@ -345,8 +345,8 @@
- case ButtonPress:
- if ((event->xbutton.time - _lastclick < 350) &&
- (event->xbutton.button == _lastbutton) &&
- - (abs(event->xbutton.x_root - _dbx) < 3) &&
- - (abs(event->xbutton.y_root - _dby) < 3) &&
- + (abs(int(event->xbutton.x_root - _dbx) < 3)) &&
- + (abs(int(event->xbutton.y_root - _dby) < 3)) &&
- (event->xbutton.window == _dbw))
- ++_clickcount;
- else
- Index: lib/libxclass/OXItemView.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXItemView.cc,v
- retrieving revision 1.9
- diff -u -r1.9 OXItemView.cc
- --- lib/libxclass/OXItemView.cc 14 Oct 2004 14:29:29 -0000 1.9
- +++ lib/libxclass/OXItemView.cc 13 Jun 2023 11:34:17 -0000
- @@ -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++) {
- Index: lib/libxclass/OXListBox.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXListBox.cc,v
- retrieving revision 1.12
- diff -u -r1.12 OXListBox.cc
- --- lib/libxclass/OXListBox.cc 18 Sep 2004 10:44:22 -0000 1.12
- +++ lib/libxclass/OXListBox.cc 13 Jun 2023 11:34:17 -0000
- @@ -21,6 +21,8 @@
- #include <X11/keysym.h>
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXListBox.h>
- #include <xclass/ODimension.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);
- Index: lib/libxclass/OXListTree.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXListTree.cc,v
- retrieving revision 1.11
- diff -u -r1.11 OXListTree.cc
- --- lib/libxclass/OXListTree.cc 25 Jul 2004 15:41:56 -0000 1.11
- +++ lib/libxclass/OXListTree.cc 13 Jun 2023 11:34:17 -0000
- @@ -59,7 +59,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;
- Index: lib/libxclass/OXListView.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXListView.cc,v
- retrieving revision 1.10
- diff -u -r1.10 OXListView.cc
- --- lib/libxclass/OXListView.cc 14 Oct 2004 14:29:29 -0000 1.10
- +++ lib/libxclass/OXListView.cc 13 Jun 2023 11:34:17 -0000
- @@ -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 (_fullLine && (_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);
- }
- }
- @@ -960,7 +960,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++) {
- @@ -994,7 +994,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++) {
- @@ -1028,7 +1028,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++) {
- Index: lib/libxclass/OXMdiMainFrame.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXMdiMainFrame.cc,v
- retrieving revision 1.3
- diff -u -r1.3 OXMdiMainFrame.cc
- --- lib/libxclass/OXMdiMainFrame.cc 4 May 2003 12:52:09 -0000 1.3
- +++ lib/libxclass/OXMdiMainFrame.cc 13 Jun 2023 11:34:17 -0000
- @@ -22,6 +22,8 @@
- #include <stdio.h>
- #include <stdlib.h>
- +#include <algorithm>
- +
- #include <X11/keysym.h>
- #include <X11/cursorfont.h>
- @@ -995,8 +997,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 +1011,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();
- Index: lib/libxclass/OXMenu.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXMenu.cc,v
- retrieving revision 1.13
- diff -u -r1.13 OXMenu.cc
- --- lib/libxclass/OXMenu.cc 2 Jul 2004 12:42:35 -0000 1.13
- +++ lib/libxclass/OXMenu.cc 13 Jun 2023 11:34:17 -0000
- @@ -21,6 +21,8 @@
- #include <string.h>
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXMenu.h>
- #include <xclass/OXMainFrame.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;
- Index: lib/libxclass/OXMsgBox.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXMsgBox.cc,v
- retrieving revision 1.7
- diff -u -r1.7 OXMsgBox.cc
- --- lib/libxclass/OXMsgBox.cc 5 Jul 2002 08:11:38 -0000 1.7
- +++ lib/libxclass/OXMsgBox.cc 13 Jun 2023 11:34:17 -0000
- @@ -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
- Index: lib/libxclass/OXPropertiesDialog.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXPropertiesDialog.cc,v
- retrieving revision 1.6
- diff -u -r1.6 OXPropertiesDialog.cc
- --- lib/libxclass/OXPropertiesDialog.cc 25 Jul 2004 15:41:56 -0000 1.6
- +++ lib/libxclass/OXPropertiesDialog.cc 13 Jun 2023 11:34:17 -0000
- @@ -31,6 +31,8 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXClient.h>
- #include <xclass/OResourcePool.h>
- @@ -131,8 +133,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,
- Index: lib/libxclass/OXResizer.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXResizer.cc,v
- retrieving revision 1.2
- diff -u -r1.2 OXResizer.cc
- --- lib/libxclass/OXResizer.cc 5 Nov 2001 10:06:13 -0000 1.2
- +++ lib/libxclass/OXResizer.cc 13 Jun 2023 11:34:17 -0000
- @@ -22,6 +22,8 @@
- #include <X11/X.h>
- #include <X11/cursorfont.h>
- +#include <algorithm>
- +
- #include <xclass/OXCompositeFrame.h>
- #include <xclass/OXResizer.h>
- @@ -244,12 +246,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 +494,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);
- }
- Index: lib/libxclass/OXScrollBar.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXScrollBar.cc,v
- retrieving revision 1.6
- diff -u -r1.6 OXScrollBar.cc
- --- lib/libxclass/OXScrollBar.cc 2 Jul 2004 12:42:35 -0000 1.6
- +++ lib/libxclass/OXScrollBar.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,8 @@
- **************************************************************************/
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OResourcePool.h>
- #include <xclass/OXCompositeFrame.h>
- @@ -205,10 +207,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 +268,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 +344,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 +376,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 +416,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 +477,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 +551,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 +583,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);
- Index: lib/libxclass/OXTab.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXTab.cc,v
- retrieving revision 1.5
- diff -u -r1.5 OXTab.cc
- --- lib/libxclass/OXTab.cc 5 Jul 2002 08:11:38 -0000 1.5
- +++ lib/libxclass/OXTab.cc 13 Jun 2023 11:34:17 -0000
- @@ -20,6 +20,7 @@
- **************************************************************************/
- #include <string.h>
- +#include <algorithm>
- #include <xclass/utils.h>
- #include <xclass/OXTab.h>
- @@ -56,7 +57,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 +82,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) {
- Index: lib/libxclass/OXTextEdit.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXTextEdit.cc,v
- retrieving revision 1.6
- diff -u -r1.6 OXTextEdit.cc
- --- lib/libxclass/OXTextEdit.cc 4 May 2003 12:52:09 -0000 1.6
- +++ lib/libxclass/OXTextEdit.cc 13 Jun 2023 11:34:17 -0000
- @@ -23,6 +23,8 @@
- #include <string.h>
- #include <ctype.h>
- +#include <algorithm>
- +
- #include <X11/keysym.h>
- #include <xclass/utils.h>
- @@ -1647,8 +1649,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 +1665,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
- Index: lib/libxclass/OXTextEntry.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXTextEntry.cc,v
- retrieving revision 1.9
- diff -u -r1.9 OXTextEntry.cc
- --- lib/libxclass/OXTextEntry.cc 12 Sep 2004 10:19:15 -0000 1.9
- +++ lib/libxclass/OXTextEntry.cc 13 Jun 2023 11:34:17 -0000
- @@ -18,6 +18,7 @@
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- **************************************************************************/
- +#include <algorithm>
- #include <xclass/utils.h>
- #include <xclass/OXTextEntry.h>
- @@ -165,8 +166,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 +237,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 +318,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 +501,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 +517,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 +550,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 +660,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;
- Index: lib/libxclass/OXToolBarButton.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXToolBarButton.cc,v
- retrieving revision 1.1
- diff -u -r1.1 OXToolBarButton.cc
- --- lib/libxclass/OXToolBarButton.cc 2 Jul 2004 12:43:48 -0000 1.1
- +++ lib/libxclass/OXToolBarButton.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,8 @@
- **************************************************************************/
- +#include <algorithm>
- +
- #include <xclass/OString.h>
- #include <xclass/OPicture.h>
- #include <xclass/OXToolBarButton.h>
- @@ -136,16 +138,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((int)size.w, _normalPic->GetWidth());
- + size.h = std::max((int)size.h, _normalPic->GetHeight());
- }
- if (_onPic) {
- - size.w = max(size.w, _onPic->GetWidth());
- - size.h = max(size.h, _onPic->GetHeight());
- + size.w = std::max((int)size.w, _onPic->GetWidth());
- + size.h = std::max((int)size.h, _onPic->GetHeight());
- }
- if (_disabledPic) {
- - size.w = max(size.w, _disabledPic->GetWidth());
- - size.h = max(size.h, _disabledPic->GetHeight());
- + size.w = std::max((int)size.w, _disabledPic->GetWidth());
- + size.h = std::max((int)size.h, _disabledPic->GetHeight());
- }
- size.w += 6;
- size.h += _th + 6;
- Index: lib/libxclass/OXView.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXView.cc,v
- retrieving revision 1.7
- diff -u -r1.7 OXView.cc
- --- lib/libxclass/OXView.cc 23 Sep 2004 11:28:01 -0000 1.7
- +++ lib/libxclass/OXView.cc 13 Jun 2023 11:34:17 -0000
- @@ -22,6 +22,8 @@
- #include <stdlib.h>
- #include <stdio.h>
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OPicture.h>
- #include <xclass/OXView.h>
- @@ -158,14 +160,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);
- Index: lib/libxclass/OXWindow.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXWindow.cc,v
- retrieving revision 1.4
- diff -u -r1.4 OXWindow.cc
- --- lib/libxclass/OXWindow.cc 9 Sep 2004 11:42:37 -0000 1.4
- +++ lib/libxclass/OXWindow.cc 13 Jun 2023 11:34:17 -0000
- @@ -19,6 +19,8 @@
- **************************************************************************/
- +#include <algorithm>
- +
- #include <xclass/utils.h>
- #include <xclass/OXWindow.h>
- @@ -34,7 +36,7 @@
- _parent = p;
- _toplevel = p->_toplevel;
- _id = XCreateWindow(GetDisplay(), _parent->_id, x, y,
- - max(w, 1), max(h, 1), max(border, 0),
- + 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 +66,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() {
- Index: test/exec.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/test/exec.cc,v
- retrieving revision 1.3
- diff -u -r1.3 exec.cc
- --- test/exec.cc 20 Jun 2002 12:45:38 -0000 1.3
- +++ test/exec.cc 13 Jun 2023 11:34:17 -0000
- @@ -26,6 +26,8 @@
- #include <errno.h>
- #include <ctype.h>
- +#include <algorithm>
- +
- #include <xclass/OXClient.h>
- #include <xclass/OXTransientFrame.h>
- #include <xclass/OXMenu.h>
- @@ -369,12 +371,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
- Index: test/ftest.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/test/ftest.cc,v
- retrieving revision 1.2
- diff -u -r1.2 ftest.cc
- --- test/ftest.cc 17 Jul 2002 08:52:16 -0000 1.2
- +++ test/ftest.cc 13 Jun 2023 11:34:18 -0000
- @@ -25,6 +25,8 @@
- #include <fcntl.h>
- #include <sys/stat.h>
- +#include <time.h>
- +
- #include <xclass/OXClient.h>
- #include <xclass/OXWindow.h>
- #include <xclass/OXFrame.h>
- Index: test/xdnd.cc
- ===================================================================
- RCS file: /cvsroot/xclass/xclass/test/xdnd.cc,v
- retrieving revision 1.3
- diff -u -r1.3 xdnd.cc
- --- test/xdnd.cc 5 Nov 2001 10:06:13 -0000 1.3
- +++ test/xdnd.cc 13 Jun 2023 11:34:18 -0000
- @@ -25,6 +25,8 @@
- #include <fcntl.h>
- #include <sys/stat.h>
- +#include <algorithm>
- +
- #include <X11/X.h>
- #include <X11/Xatom.h>
- @@ -248,7 +250,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;
- ===
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement