Advertisement
Guest User

xclass fixes for new gcc

a guest
Jun 13th, 2023
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.95 KB | Source Code | 0 0
  1. Index: include/xclass/ORectangle.h
  2. ===================================================================
  3. RCS file: /cvsroot/xclass/xclass/include/xclass/ORectangle.h,v
  4. retrieving revision 1.4
  5. diff -u -r1.4 ORectangle.h
  6. --- include/xclass/ORectangle.h 16 May 2003 08:46:29 -0000 1.4
  7. +++ include/xclass/ORectangle.h 13 Jun 2023 11:34:17 -0000
  8. @@ -26,7 +26,8 @@
  9. #include <xclass/OBaseObject.h>
  10. #include <xclass/ODimension.h>
  11.  
  12. -
  13. +#include <algorithm>
  14. +/*
  15. #ifndef min
  16. #define min(a,b) (((a)<(b)) ? (a) : (b))
  17. #endif
  18. @@ -34,7 +35,7 @@
  19. #ifndef max
  20. #define max(a,b) (((a)>(b)) ? (a) : (b))
  21. #endif
  22. -
  23. +*/
  24.  
  25. //----------------------------------------------------------------------
  26.  
  27. @@ -72,8 +73,8 @@
  28. OPosition right_bottom() const
  29. { return OPosition(x + (int) w - 1, y + (int) h - 1); }
  30. void merge(ORectangle &r)
  31. - { int max_x = max(x + (int) w, r.x + (int) r.w); x = min(x, r.x);
  32. - int max_y = max(y + (int) h, r.y + (int) r.h); y = min(y, r.y);
  33. + { int max_x = std::max(x + (int) w, r.x + (int) r.w); x = std::min(x, r.x);
  34. + int max_y = std::max(y + (int) h, r.y + (int) r.h); y = std::min(y, r.y);
  35. w = max_x - x;
  36. h = max_y - y; }
  37. void empty() { x = y = 0; w = h = 0; }
  38. Index: include/xclass/OXFileList.h
  39. ===================================================================
  40. RCS file: /cvsroot/xclass/xclass/include/xclass/OXFileList.h,v
  41. retrieving revision 1.8
  42. diff -u -r1.8 OXFileList.h
  43. --- include/xclass/OXFileList.h 14 Oct 2004 14:29:29 -0000 1.8
  44. +++ include/xclass/OXFileList.h 13 Jun 2023 11:34:17 -0000
  45. @@ -23,6 +23,7 @@
  46. #define __OXFILELIST_H
  47.  
  48. #include <vector>
  49. +#include <algorithm>
  50.  
  51. #include <regex.h>
  52. #include <X11/Xlib.h>
  53. Index: include/xclass/OXHelpDoc.h
  54. ===================================================================
  55. RCS file: /cvsroot/xclass/xclass/include/xclass/OXHelpDoc.h,v
  56. retrieving revision 1.1
  57. diff -u -r1.1 OXHelpDoc.h
  58. --- include/xclass/OXHelpDoc.h 2 Jul 2004 12:42:35 -0000 1.1
  59. +++ include/xclass/OXHelpDoc.h 13 Jun 2023 11:34:17 -0000
  60. @@ -23,6 +23,7 @@
  61. #define __OXHELPDOC_H
  62.  
  63. #include <vector>
  64. +#include <algorithm>
  65.  
  66. #include <xclass/utils.h>
  67. #include <xclass/OHtmlUri.h>
  68. Index: include/xclass/OXListTree.h
  69. ===================================================================
  70. RCS file: /cvsroot/xclass/xclass/include/xclass/OXListTree.h,v
  71. retrieving revision 1.9
  72. diff -u -r1.9 OXListTree.h
  73. --- include/xclass/OXListTree.h 23 Aug 2002 09:41:35 -0000 1.9
  74. +++ include/xclass/OXListTree.h 13 Jun 2023 11:34:17 -0000
  75. @@ -140,7 +140,7 @@
  76. void _InsertChildren(OListTreeItem *parent, OListTreeItem *item);
  77. int _SearchChildren(OListTreeItem *item, int y, int findy,
  78. OListTreeItem **finditem);
  79. - OListTreeItem *OXListTree::_FindItem(int findy);
  80. + OListTreeItem *_FindItem(int findy);
  81.  
  82. OListTreeItem *_first, *_selected;
  83. int _hspacing, _vspacing, _indent, _margin, _last_y;
  84. Index: include/xclass/utils.h
  85. ===================================================================
  86. RCS file: /cvsroot/xclass/xclass/include/xclass/utils.h,v
  87. retrieving revision 1.2
  88. diff -u -r1.2 utils.h
  89. --- include/xclass/utils.h 5 Jul 2002 08:11:37 -0000 1.2
  90. +++ include/xclass/utils.h 13 Jun 2023 11:34:17 -0000
  91. @@ -55,7 +55,7 @@
  92.  
  93. #undef NULL
  94. #define NULL 0
  95. -
  96. +/*
  97. #ifndef min
  98. #define min(a,b) (((a)<(b)) ? (a) : (b))
  99. #endif
  100. @@ -63,7 +63,7 @@
  101. #ifndef max
  102. #define max(a,b) (((a)>(b)) ? (a) : (b))
  103. #endif
  104. -
  105. +*/
  106. char *StrDup(const char *s);
  107. int MakePath(const char *path, mode_t mode);
  108. void FatalError(const char *fmt, ...);
  109. Index: lib/libxclass/O2ColumnsLayout.cc
  110. ===================================================================
  111. RCS file: /cvsroot/xclass/xclass/lib/libxclass/O2ColumnsLayout.cc,v
  112. retrieving revision 1.2
  113. diff -u -r1.2 O2ColumnsLayout.cc
  114. --- lib/libxclass/O2ColumnsLayout.cc 22 Aug 2002 10:43:45 -0000 1.2
  115. +++ lib/libxclass/O2ColumnsLayout.cc 13 Jun 2023 11:34:17 -0000
  116. @@ -19,6 +19,7 @@
  117.  
  118. **************************************************************************/
  119.  
  120. +#include <algorithm>
  121. #include <xclass/O2ColumnsLayout.h>
  122.  
  123. //----------------------------------------------------------------------
  124. @@ -39,16 +40,16 @@
  125. for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
  126. ++count;
  127. csize = ptr->frame->GetDefaultSize();
  128. - c1size.w = max(c1size.w, csize.w);
  129. - c1size.h = max(c1size.h, csize.h);
  130. + c1size.w = std::max(c1size.w, csize.w);
  131. + c1size.h = std::max(c1size.h, csize.h);
  132. ptr = ptr->next;
  133. if (ptr == NULL) break;
  134. csize = ptr->frame->GetDefaultSize();
  135. - c2size.w = max(c2size.w, csize.w);
  136. - c2size.h = max(c2size.h, csize.h);
  137. + c2size.w = std::max(c2size.w, csize.w);
  138. + c2size.h = std::max(c2size.h, csize.h);
  139. }
  140.  
  141. - h = max(c1size.h, c2size.h);
  142. + h = std::max(c1size.h, c2size.h);
  143.  
  144. for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
  145. csize = ptr->frame->GetDefaultSize();
  146. @@ -72,17 +73,17 @@
  147. for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
  148. ++count;
  149. csize = ptr->frame->GetDefaultSize();
  150. - c1size.w = max(c1size.w, csize.w);
  151. - c1size.h = max(c1size.h, csize.h);
  152. + c1size.w = std::max(c1size.w, csize.w);
  153. + c1size.h = std::max(c1size.h, csize.h);
  154. ptr = ptr->next;
  155. if (ptr == NULL) break;
  156. csize = ptr->frame->GetDefaultSize();
  157. - c2size.w = max(c2size.w, csize.w);
  158. - c2size.h = max(c2size.h, csize.h);
  159. + c2size.w = std::max(c2size.w, csize.w);
  160. + c2size.h = std::max(c2size.h, csize.h);
  161. }
  162.  
  163. size.w = c1size.w + _hsep + c2size.w + ins.l + ins.r;
  164. - size.h = (max(c1size.h, c2size.h) + _vsep) * count + ins.t + ins.b;
  165. + size.h = (std::max(c1size.h, c2size.h) + _vsep) * count + ins.t + ins.b;
  166.  
  167. return size;
  168. }
  169. Index: lib/libxclass/OColor.cc
  170. ===================================================================
  171. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OColor.cc,v
  172. retrieving revision 1.1
  173. diff -u -r1.1 OColor.cc
  174. --- lib/libxclass/OColor.cc 23 Nov 2001 10:08:47 -0000 1.1
  175. +++ lib/libxclass/OColor.cc 13 Jun 2023 11:34:17 -0000
  176. @@ -18,6 +18,7 @@
  177. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  178.  
  179. **************************************************************************/
  180. +#include <algorithm>
  181.  
  182. #include <X11/X.h>
  183.  
  184. @@ -95,8 +96,8 @@
  185. _G = g / (double) COLOR_MAX;
  186. _B = b / (double) COLOR_MAX;
  187.  
  188. - Cmax = max(_R, max(_G, _B));
  189. - Cmin = min(_R, min(_G, _B));
  190. + Cmax = std::max(_R, std::max(_G, _B));
  191. + Cmin = std::min(_R, std::min(_G, _B));
  192.  
  193. // calculate luminosity
  194. _L = (Cmax + Cmin) / 2.0;
  195. Index: lib/libxclass/ODNDmanager.cc
  196. ===================================================================
  197. RCS file: /cvsroot/xclass/xclass/lib/libxclass/ODNDmanager.cc,v
  198. retrieving revision 1.4
  199. diff -u -r1.4 ODNDmanager.cc
  200. --- lib/libxclass/ODNDmanager.cc 5 Nov 2001 10:06:13 -0000 1.4
  201. +++ lib/libxclass/ODNDmanager.cc 13 Jun 2023 11:34:17 -0000
  202. @@ -25,6 +25,8 @@
  203. #include <fcntl.h>
  204. #include <sys/stat.h>
  205.  
  206. +#include <algorithm>
  207. +
  208. #include <X11/Xatom.h>
  209. #include <X11/cursorfont.h>
  210.  
  211. @@ -216,7 +218,7 @@
  212. }
  213.  
  214. types = (Atom *) data;
  215. - _useVersion = min(_version, types[0]);
  216. + _useVersion = std::min(_version, types[0]);
  217. Debug(DBG_MISC, "Using XDND version %d\n", _useVersion);
  218.  
  219. if ((count > 1) && typelist) {
  220. Index: lib/libxclass/OGifImage.cc
  221. ===================================================================
  222. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OGifImage.cc,v
  223. retrieving revision 1.1
  224. diff -u -r1.1 OGifImage.cc
  225. --- lib/libxclass/OGifImage.cc 14 May 2003 13:33:00 -0000 1.1
  226. +++ lib/libxclass/OGifImage.cc 13 Jun 2023 11:34:17 -0000
  227. @@ -934,7 +934,7 @@
  228.  
  229. void OGifImage::AllocClosestColor(int ColorMapSize) {
  230. int i, j, Index = 0, Count = 0, XNumOfColors;
  231. - unsigned long D, Distance, AvgDistance = 0, Red, Green, Blue;
  232. + long D, Distance, AvgDistance = 0, Red, Green, Blue;
  233. bool Failed = false;
  234. XColor *XOldColorTable;
  235.  
  236. Index: lib/libxclass/OLayout.cc
  237. ===================================================================
  238. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OLayout.cc,v
  239. retrieving revision 1.4
  240. diff -u -r1.4 OLayout.cc
  241. --- lib/libxclass/OLayout.cc 23 Sep 2004 11:28:00 -0000 1.4
  242. +++ lib/libxclass/OLayout.cc 13 Jun 2023 11:34:17 -0000
  243. @@ -22,6 +22,15 @@
  244. #include <xclass/utils.h>
  245. #include <xclass/OXCompositeFrame.h>
  246.  
  247. +#ifndef min
  248. +#define min(a,b) (((a)<(b)) ? (a) : (b))
  249. +#endif
  250. +
  251. +#ifndef max
  252. +#define max(a,b) (((a)>(b)) ? (a) : (b))
  253. +#endif
  254. +
  255. +
  256.  
  257. //--------------------------------------------------------------------
  258.  
  259. Index: lib/libxclass/OListViewLayout.cc
  260. ===================================================================
  261. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OListViewLayout.cc,v
  262. retrieving revision 1.2
  263. diff -u -r1.2 OListViewLayout.cc
  264. --- lib/libxclass/OListViewLayout.cc 5 Jul 2002 08:11:38 -0000 1.2
  265. +++ lib/libxclass/OListViewLayout.cc 13 Jun 2023 11:34:17 -0000
  266. @@ -19,6 +19,9 @@
  267.  
  268. **************************************************************************/
  269.  
  270. +
  271. +#include <algorithm>
  272. +
  273. #include <xclass/utils.h>
  274. #include <xclass/OXClient.h>
  275. #include <xclass/OXCompositeFrame.h>
  276. @@ -42,11 +45,11 @@
  277.  
  278. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  279. csize = ptr->frame->GetDefaultSize();
  280. - max_osize.w = max(max_osize.w, csize.w);
  281. - max_osize.h = max(max_osize.h, csize.h);
  282. + max_osize.w = std::max(max_osize.w, csize.w);
  283. + max_osize.h = std::max(max_osize.h, csize.h);
  284. }
  285.  
  286. - max_width = max(msize.w, max_osize.w + (_sep << 1));
  287. + max_width = std::max(msize.w, max_osize.w + (_sep << 1));
  288. x = _sep; y = _sep << 1;
  289. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  290.  
  291. @@ -85,11 +88,11 @@
  292.  
  293. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  294. max_size = ptr->frame->GetDefaultSize();
  295. - max_osize.w = max(max_osize.w, max_size.w);
  296. - max_osize.h = max(max_osize.h, max_size.h);
  297. + max_osize.w = std::max(max_osize.w, max_size.w);
  298. + max_osize.h = std::max(max_osize.h, max_size.h);
  299. }
  300.  
  301. - max_size.w = max(msize.w, max_osize.w + (_sep << 1));
  302. + max_size.w = std::max(msize.w, max_osize.w + (_sep << 1));
  303.  
  304. x = _sep; y = _sep << 1;
  305. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  306. @@ -100,7 +103,7 @@
  307. }
  308. }
  309. if (x != _sep) y += max_osize.h + _sep;
  310. - max_size.h = max(y, msize.h);
  311. + max_size.h = std::max(y, (int)msize.h);
  312.  
  313. return max_size;
  314. }
  315. @@ -117,11 +120,11 @@
  316.  
  317. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  318. csize = ptr->frame->GetDefaultSize();
  319. - max_osize.w = max(max_osize.w, csize.w);
  320. - max_osize.h = max(max_osize.h, csize.h);
  321. + max_osize.w = std::max(max_osize.w, csize.w);
  322. + max_osize.h = std::max(max_osize.h, csize.h);
  323. }
  324.  
  325. - max_height = max(msize.h, max_osize.h + (_sep << 1));
  326. + max_height = std::max(msize.h, max_osize.h + (_sep << 1));
  327.  
  328. x = _sep; y = _sep << 1;
  329. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  330. @@ -161,11 +164,11 @@
  331.  
  332. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  333. max_size = ptr->frame->GetDefaultSize();
  334. - max_osize.w = max(max_osize.w, max_size.w);
  335. - max_osize.h = max(max_osize.h, max_size.h);
  336. + max_osize.w = std::max(max_osize.w, max_size.w);
  337. + max_osize.h = std::max(max_osize.h, max_size.h);
  338. }
  339.  
  340. - max_size.h = max(msize.h, max_osize.h + (_sep << 1));
  341. + max_size.h = std::max(msize.h, max_osize.h + (_sep << 1));
  342.  
  343. x = _sep; y = _sep << 1;
  344. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  345. @@ -176,7 +179,7 @@
  346. }
  347. }
  348. if (y != (_sep << 1)) x += max_osize.w + _sep;
  349. - max_size.w = max(x, msize.w);
  350. + max_size.w = std::max(x, (int)msize.w);
  351.  
  352. return max_size;
  353. }
  354. @@ -190,7 +193,7 @@
  355.  
  356. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  357. csize = ptr->frame->GetDefaultSize();
  358. - max_oh = max(max_oh, csize.h);
  359. + max_oh = std::max(max_oh, (int)csize.h);
  360. }
  361.  
  362. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  363. @@ -210,8 +213,8 @@
  364.  
  365. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  366. csize = ptr->frame->GetDefaultSize();
  367. - max_osize.w = max(max_osize.w, csize.w);
  368. - max_osize.h = max(max_osize.h, csize.h);
  369. + max_osize.w = std::max(max_osize.w, csize.w);
  370. + max_osize.h = std::max(max_osize.h, csize.h);
  371. }
  372.  
  373. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  374. Index: lib/libxclass/OMatrixLayout.cc
  375. ===================================================================
  376. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OMatrixLayout.cc,v
  377. retrieving revision 1.2
  378. diff -u -r1.2 OMatrixLayout.cc
  379. --- lib/libxclass/OMatrixLayout.cc 5 Jul 2002 08:11:38 -0000 1.2
  380. +++ lib/libxclass/OMatrixLayout.cc 13 Jun 2023 11:34:17 -0000
  381. @@ -18,6 +18,7 @@
  382. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  383.  
  384. **************************************************************************/
  385. +#include <algorithm>
  386.  
  387. #include <xclass/utils.h>
  388. #include <xclass/OXCompositeFrame.h>
  389. @@ -62,8 +63,8 @@
  390. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  391. count++;
  392. csize = ptr->frame->GetDefaultSize();
  393. - maxsize.w = max(maxsize.w, csize.w);
  394. - maxsize.h = max(maxsize.h, csize.h);
  395. + maxsize.w = std::max(maxsize.w, csize.w);
  396. + maxsize.h = std::max(maxsize.h, csize.h);
  397. }
  398.  
  399. if (rows == 0) {
  400. @@ -87,8 +88,8 @@
  401.  
  402. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  403. csize = ptr->frame->GetDefaultSize();
  404. - maxsize.w = max(maxsize.w, csize.w);
  405. - maxsize.h = max(maxsize.h, csize.h);
  406. + maxsize.w = std::max(maxsize.w, csize.w);
  407. + maxsize.h = std::max(maxsize.h, csize.h);
  408. }
  409.  
  410. for (ptr=*_list; ptr != NULL; ptr=ptr->next) {
  411. Index: lib/libxclass/ORowColumnLayout.cc
  412. ===================================================================
  413. RCS file: /cvsroot/xclass/xclass/lib/libxclass/ORowColumnLayout.cc,v
  414. retrieving revision 1.3
  415. diff -u -r1.3 ORowColumnLayout.cc
  416. --- lib/libxclass/ORowColumnLayout.cc 20 Aug 2002 13:27:56 -0000 1.3
  417. +++ lib/libxclass/ORowColumnLayout.cc 13 Jun 2023 11:34:17 -0000
  418. @@ -19,6 +19,8 @@
  419.  
  420. **************************************************************************/
  421.  
  422. +#include <algorithm>
  423. +
  424. #include <xclass/utils.h>
  425. #include <xclass/OXCompositeFrame.h>
  426.  
  427. @@ -53,7 +55,7 @@
  428. for (ptr = *_list; ptr != NULL; ptr = ptr->next) {
  429. if (ptr->frame->IsVisible()) {
  430. dsize = ptr->frame->GetDefaultSize();
  431. - size.h = max(size.h, dsize.h);
  432. + size.h = std::max(size.h, dsize.h);
  433. size.w += dsize.w + sep;
  434. }
  435. }
  436. @@ -99,7 +101,7 @@
  437. if (ptr->frame->IsVisible()) {
  438. dsize = ptr->frame->GetDefaultSize();
  439. size.h += dsize.h + sep;
  440. - size.w = max(size.w, dsize.w);
  441. + size.w = std::max(size.w, dsize.w);
  442. }
  443. }
  444.  
  445. Index: lib/libxclass/OXAboutDialog.cc
  446. ===================================================================
  447. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXAboutDialog.cc,v
  448. retrieving revision 1.4
  449. diff -u -r1.4 OXAboutDialog.cc
  450. --- lib/libxclass/OXAboutDialog.cc 1 Jul 2002 09:58:13 -0000 1.4
  451. +++ lib/libxclass/OXAboutDialog.cc 13 Jun 2023 11:34:17 -0000
  452. @@ -18,6 +18,7 @@
  453. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  454.  
  455. **************************************************************************/
  456. +#include <algorithm>
  457.  
  458. #include <xclass/utils.h>
  459. #include <xclass/OXLabel.h>
  460. @@ -73,7 +74,7 @@
  461. f1->AddFrame(l = new OXLabel(f1, new OString(info->copyright)), _lh2);
  462. l->SetTextJustify(info->cprt_justify);
  463. if (info->cprt_font) l->SetFont(info->cprt_font);
  464. - width = max(width, l->GetDefaultWidth());
  465. + width = std::max(width, l->GetDefaultWidth());
  466. }
  467.  
  468. if (info->text) {
  469. Index: lib/libxclass/OXCanvas.cc
  470. ===================================================================
  471. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXCanvas.cc,v
  472. retrieving revision 1.7
  473. diff -u -r1.7 OXCanvas.cc
  474. --- lib/libxclass/OXCanvas.cc 20 Aug 2002 13:27:56 -0000 1.7
  475. +++ lib/libxclass/OXCanvas.cc 13 Jun 2023 11:34:17 -0000
  476. @@ -19,6 +19,8 @@
  477.  
  478. **************************************************************************/
  479.  
  480. +#include <algorithm>
  481. +
  482. #include <xclass/utils.h>
  483. #include <xclass/OXClient.h>
  484. #include <xclass/OXWidget.h>
  485. @@ -68,12 +70,12 @@
  486. int amount, ch;
  487.  
  488. ch = _vport->GetHeight();
  489. - amount = max(ch / 6, 1);
  490. + amount = std::max(ch / 6, 1);
  491.  
  492. if (event->state & ShiftMask)
  493. amount = 1;
  494. else if (event->state & ControlMask)
  495. - amount = ch - max(ch / 20, 1);
  496. + amount = ch - std::max(ch / 20, 1);
  497.  
  498. if (event->button == Button4) {
  499. SetVPos(-_vport->GetVPos() - amount);
  500. @@ -156,8 +158,8 @@
  501.  
  502. _vport->MoveResize(_insets.l, _insets.t, cw, ch);
  503.  
  504. - tcw = max(_container->GetDefaultWidth(), cw);
  505. - tch = max(_container->GetDefaultHeight(), ch);
  506. + tcw = std::max(_container->GetDefaultWidth(), cw);
  507. + tch = std::max(_container->GetDefaultHeight(), ch);
  508. _container->SetHeight(0); // force a resize in OXFrame::Resize
  509. _container->Resize(tcw, tch);
  510.  
  511. Index: lib/libxclass/OXClient.cc
  512. ===================================================================
  513. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXClient.cc,v
  514. retrieving revision 1.15
  515. diff -u -r1.15 OXClient.cc
  516. --- lib/libxclass/OXClient.cc 14 Oct 2004 14:29:29 -0000 1.15
  517. +++ lib/libxclass/OXClient.cc 13 Jun 2023 11:34:17 -0000
  518. @@ -27,6 +27,8 @@
  519. #include <sys/time.h>
  520. #include <sys/types.h>
  521.  
  522. +#include <algorithm>
  523. +
  524. #include <xclass/utils.h>
  525. #include <xclass/OXClient.h>
  526. #include <xclass/OXRootWindow.h>
  527. @@ -217,13 +219,13 @@
  528. XQueryColor(_dpy, _defaultColormap, &white_p);
  529.  
  530. #if 1
  531. - color.red = max((white_p.red/5), color.red);
  532. - color.green = max((white_p.green/5), color.green);
  533. - color.blue = max((white_p.blue/5), color.blue);
  534. + color.red = std::max((white_p.red/5), (int)color.red);
  535. + color.green = std::max((white_p.green/5), (int)color.green);
  536. + color.blue = std::max((white_p.blue/5), (int)color.blue);
  537.  
  538. - color.red = min(white_p.red, (color.red*140)/100);
  539. - color.green = min(white_p.green, (color.green*140)/100);
  540. - color.blue = min(white_p.blue, (color.blue*140)/100);
  541. + color.red = std::min((int)white_p.red, (color.red*140)/100);
  542. + color.green = std::min((int)white_p.green, (color.green*140)/100);
  543. + color.blue = std::min((int)white_p.blue, (color.blue*140)/100);
  544. #else
  545. color.red = white_p.red - (white_p.red - color.red - 1) / 2;
  546. color.green = white_p.green - (white_p.green - color.green - 1) / 2;
  547. Index: lib/libxclass/OXColorDialog.cc
  548. ===================================================================
  549. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXColorDialog.cc,v
  550. retrieving revision 1.6
  551. diff -u -r1.6 OXColorDialog.cc
  552. --- lib/libxclass/OXColorDialog.cc 25 Jul 2004 15:41:56 -0000 1.6
  553. +++ lib/libxclass/OXColorDialog.cc 13 Jun 2023 11:34:17 -0000
  554. @@ -22,6 +22,8 @@
  555. #include <stdio.h>
  556. #include <stdlib.h>
  557.  
  558. +#include <algorithm>
  559. +
  560. #include <X11/keysym.h>
  561.  
  562. #include <xclass/OXLabel.h>
  563. @@ -976,7 +978,7 @@
  564. hf->AddFrame(cancel, new OLayoutHints(LHINTS_BOTTOM | LHINTS_EXPAND_X));
  565.  
  566. int w = ok->GetDefaultWidth();
  567. - w = max(w, cancel->GetDefaultWidth());
  568. + w = std::max(w, cancel->GetDefaultWidth());
  569. hf->Resize(2 * (w + 20), hf->GetDefaultHeight());
  570.  
  571. ok->Associate(this);
  572. Index: lib/libxclass/OXFSDDListBox.cc
  573. ===================================================================
  574. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXFSDDListBox.cc,v
  575. retrieving revision 1.6
  576. diff -u -r1.6 OXFSDDListBox.cc
  577. --- lib/libxclass/OXFSDDListBox.cc 16 Sep 2004 15:36:10 -0000 1.6
  578. +++ lib/libxclass/OXFSDDListBox.cc 13 Jun 2023 11:34:17 -0000
  579. @@ -22,6 +22,8 @@
  580. #include <stdio.h>
  581. #include <unistd.h>
  582.  
  583. +#include <algorithm>
  584. +
  585. #include <xclass/utils.h>
  586. #include <xclass/ODimension.h>
  587. #include <xclass/OXFSDDListBox.h>
  588. @@ -138,7 +140,7 @@
  589. ODimension isize(_pic->GetWidth(), _pic->GetHeight());
  590. ODimension lsize(_tw, _th+1);
  591.  
  592. - return ODimension(isize.w + lsize.w + 5, max(isize.h, lsize.h) + 2);
  593. + return ODimension(isize.w + lsize.w + 5, std::max(isize.h, lsize.h) + 2);
  594. }
  595.  
  596. void OXTreeLBEntry::UpdateEntry(OXLBEntry *e) {
  597. Index: lib/libxclass/OXFileDialog.cc
  598. ===================================================================
  599. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXFileDialog.cc,v
  600. retrieving revision 1.14
  601. diff -u -r1.14 OXFileDialog.cc
  602. --- lib/libxclass/OXFileDialog.cc 23 Sep 2004 11:28:01 -0000 1.14
  603. +++ lib/libxclass/OXFileDialog.cc 13 Jun 2023 11:34:17 -0000
  604. @@ -26,6 +26,8 @@
  605. #include <errno.h>
  606. #include <sys/stat.h>
  607.  
  608. +#include <algorithm>
  609. +
  610. #include <X11/keysym.h>
  611.  
  612. #include <xclass/utils.h>
  613. @@ -374,7 +376,7 @@
  614. _vbf->AddFrame(_ok, _lb);
  615. _vbf->AddFrame(_cancel, _lb);
  616.  
  617. - int width = max(_ok->GetDefaultWidth(), _cancel->GetDefaultWidth()) + 20;
  618. + int width = std::max(_ok->GetDefaultWidth(), _cancel->GetDefaultWidth()) + 20;
  619. _vbf->Resize(width, _vbf->GetDefaultHeight());
  620.  
  621. _hf->AddFrame(_vbf, _lvbf);
  622. Index: lib/libxclass/OXFrame.cc
  623. ===================================================================
  624. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXFrame.cc,v
  625. retrieving revision 1.9
  626. diff -u -r1.9 OXFrame.cc
  627. --- lib/libxclass/OXFrame.cc 14 Oct 2004 14:29:29 -0000 1.9
  628. +++ lib/libxclass/OXFrame.cc 13 Jun 2023 11:34:17 -0000
  629. @@ -345,8 +345,8 @@
  630. case ButtonPress:
  631. if ((event->xbutton.time - _lastclick < 350) &&
  632. (event->xbutton.button == _lastbutton) &&
  633. - (abs(event->xbutton.x_root - _dbx) < 3) &&
  634. - (abs(event->xbutton.y_root - _dby) < 3) &&
  635. + (abs(int(event->xbutton.x_root - _dbx) < 3)) &&
  636. + (abs(int(event->xbutton.y_root - _dby) < 3)) &&
  637. (event->xbutton.window == _dbw))
  638. ++_clickcount;
  639. else
  640. Index: lib/libxclass/OXItemView.cc
  641. ===================================================================
  642. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXItemView.cc,v
  643. retrieving revision 1.9
  644. diff -u -r1.9 OXItemView.cc
  645. --- lib/libxclass/OXItemView.cc 14 Oct 2004 14:29:29 -0000 1.9
  646. +++ lib/libxclass/OXItemView.cc 13 Jun 2023 11:34:17 -0000
  647. @@ -19,6 +19,8 @@
  648.  
  649. **************************************************************************/
  650.  
  651. +#include <algorithm>
  652. +
  653. #include <xclass/utils.h>
  654. #include <xclass/OXItemView.h>
  655.  
  656. @@ -473,15 +475,15 @@
  657. OPosition start = ToPhysical(_selDragStart);
  658. OPosition end = ToPhysical(_selDragEnd);
  659.  
  660. - start.y = max(start.y, 0);
  661. - start.x = max(start.x, 0);
  662. - start.y = min(start.y, _canvas->GetHeight());
  663. - start.x = min(start.x, _canvas->GetWidth());
  664. -
  665. - end.y = max(end.y, 0);
  666. - end.x = max(end.x, 0);
  667. - end.y = min(end.y, _canvas->GetHeight());
  668. - end.x = min(end.x, _canvas->GetWidth());
  669. + start.y = std::max(start.y, 0);
  670. + start.x = std::max(start.x, 0);
  671. + start.y = std::min(start.y, _canvas->GetHeight());
  672. + start.x = std::min(start.x, _canvas->GetWidth());
  673. +
  674. + end.y = std::max(end.y, 0);
  675. + end.x = std::max(end.x, 0);
  676. + end.y = std::min(end.y, _canvas->GetHeight());
  677. + end.x = std::min(end.x, _canvas->GetWidth());
  678.  
  679. _canvas->DrawRectangle(_lineGC->GetGC(),
  680. start.x, start.y, end.x - start.x, end.y - start.y);
  681. @@ -496,10 +498,10 @@
  682. if (_items.size() == 0) return;
  683.  
  684. if (_dragSelecting) {
  685. - _selDragStart.x = min(_selAnchor.x, mousePos.x);
  686. - _selDragEnd.x = max(_selAnchor.x, mousePos.x);
  687. - _selDragStart.y = min(_selAnchor.y, mousePos.y);
  688. - _selDragEnd.y = max(_selAnchor.y, mousePos.y);
  689. + _selDragStart.x = std::min(_selAnchor.x, mousePos.x);
  690. + _selDragEnd.x = std::max(_selAnchor.x, mousePos.x);
  691. + _selDragStart.y = std::min(_selAnchor.y, mousePos.y);
  692. + _selDragEnd.y = std::max(_selAnchor.y, mousePos.y);
  693.  
  694. selected = 0;
  695. for (unsigned int i = 0; i < _items.size(); i++) {
  696. Index: lib/libxclass/OXListBox.cc
  697. ===================================================================
  698. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXListBox.cc,v
  699. retrieving revision 1.12
  700. diff -u -r1.12 OXListBox.cc
  701. --- lib/libxclass/OXListBox.cc 18 Sep 2004 10:44:22 -0000 1.12
  702. +++ lib/libxclass/OXListBox.cc 13 Jun 2023 11:34:17 -0000
  703. @@ -21,6 +21,8 @@
  704.  
  705. #include <X11/keysym.h>
  706.  
  707. +#include <algorithm>
  708. +
  709. #include <xclass/utils.h>
  710. #include <xclass/OXListBox.h>
  711. #include <xclass/ODimension.h>
  712. @@ -714,13 +716,13 @@
  713.  
  714. lbe = new OXTextLBEntry(_lbc, s, ID);
  715. lhints = new OLayoutHints(LHINTS_EXPAND_X | LHINTS_TOP);
  716. - _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
  717. + _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
  718. _lbc->AddEntry(lbe, lhints);
  719. if (_autoUpdate) Update();
  720. }
  721.  
  722. void OXListBox::AddEntry(OXLBEntry *lbe, OLayoutHints *lhints) {
  723. - _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
  724. + _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
  725. _lbc->AddEntry(lbe, lhints);
  726. if (_autoUpdate) Update();
  727. }
  728. @@ -731,13 +733,13 @@
  729.  
  730. lbe = new OXTextLBEntry(_lbc, s, ID);
  731. lhints = new OLayoutHints(LHINTS_EXPAND_X | LHINTS_TOP);
  732. - _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
  733. + _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
  734. _lbc->InsertEntry(lbe, lhints, afterID);
  735. if (_autoUpdate) Update();
  736. }
  737.  
  738. void OXListBox::InsertEntry(OXLBEntry *lbe, OLayoutHints *lhints, int afterID) {
  739. - _itemVsize = max(_itemVsize, lbe->GetDefaultHeight());
  740. + _itemVsize = std::max(_itemVsize, lbe->GetDefaultHeight());
  741. _lbc->InsertEntry(lbe, lhints, afterID);
  742. if (_autoUpdate) Update();
  743. }
  744. @@ -757,7 +759,7 @@
  745. void OXListBox::Resize(int w, int h) {
  746. if (_integralHeight) {
  747. int ih = _insets.t + _insets.b;
  748. - h = max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
  749. + h = std::max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
  750. }
  751. OXCompositeFrame::Resize(w, h);
  752. }
  753. @@ -765,7 +767,7 @@
  754. void OXListBox::MoveResize(int x, int y, int w, int h) {
  755. if (_integralHeight) {
  756. int ih = _insets.t + _insets.b;
  757. - h = max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
  758. + h = std::max(_itemVsize, ((h - ih) / _itemVsize) * _itemVsize) + ih;
  759. }
  760. OXCompositeFrame::MoveResize(x, y, w, h);
  761. }
  762. @@ -775,7 +777,7 @@
  763.  
  764. if (_integralHeight) {
  765. int ih = _insets.t + _insets.b;
  766. - h = max(_itemVsize, ((_h - ih) / _itemVsize) * _itemVsize) + ih;
  767. + h = std::max(_itemVsize, ((_h - ih) / _itemVsize) * _itemVsize) + ih;
  768. } else {
  769. h = _h;
  770. }
  771. @@ -822,7 +824,7 @@
  772.  
  773. _vport->MoveResize(_insets.l, _insets.t, cw, ch);
  774. _container->Layout();
  775. - tch = max(_container->GetDefaultHeight(), ch);
  776. + tch = std::max(_container->GetDefaultHeight(), ch);
  777. _container->SetHeight(0); // force a resize in OXFrame::Resize
  778. _container->Resize(cw, tch);
  779. // _vport->SetPos(0, 0);
  780. Index: lib/libxclass/OXListTree.cc
  781. ===================================================================
  782. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXListTree.cc,v
  783. retrieving revision 1.11
  784. diff -u -r1.11 OXListTree.cc
  785. --- lib/libxclass/OXListTree.cc 25 Jul 2004 15:41:56 -0000 1.11
  786. +++ lib/libxclass/OXListTree.cc 13 Jun 2023 11:34:17 -0000
  787. @@ -59,7 +59,7 @@
  788.  
  789. open_pic = opened;
  790. closed_pic = closed;
  791. - picWidth = max(open_pic->GetWidth(), closed_pic->GetWidth());
  792. + picWidth = std::max(open_pic->GetWidth(), closed_pic->GetWidth());
  793.  
  794. open =
  795. active = False;
  796. Index: lib/libxclass/OXListView.cc
  797. ===================================================================
  798. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXListView.cc,v
  799. retrieving revision 1.10
  800. diff -u -r1.10 OXListView.cc
  801. --- lib/libxclass/OXListView.cc 14 Oct 2004 14:29:29 -0000 1.10
  802. +++ lib/libxclass/OXListView.cc 13 Jun 2023 11:34:17 -0000
  803. @@ -158,7 +158,7 @@
  804. switch (_viewMode) {
  805. default:
  806. case LV_LARGE_ICONS:
  807. - size.w = max(isize.w, lsize.w);
  808. + size.w = std::max(isize.w, lsize.w);
  809. size.h = isize.h + lsize.h + 6;
  810. break;
  811.  
  812. @@ -166,7 +166,7 @@
  813. case LV_LIST:
  814. case LV_DETAILS:
  815. size.w = isize.w + lsize.w + 4;
  816. - size.h = max(isize.h, lsize.h);
  817. + size.h = std::max(isize.h, lsize.h);
  818. if (_fullLine && (_viewMode == LV_DETAILS)) size.w = _parent->GetVirtualSize().w;
  819. break;
  820. }
  821. @@ -213,7 +213,7 @@
  822. w->FillRectangle(rectGC, -_parent->GetScrollPosition().x, pos.y, size.w, size.h);
  823. } else {
  824. w->FillRectangle(rectGC, pos.x + _textPos.x, pos.y + _textPos.y,
  825. - min(_tw, columnData[0]->width - _textPos.x - 2), _th + 1);
  826. + std::min(_tw, columnData[0]->width - _textPos.x - 2), _th + 1);
  827. }
  828.  
  829. if (_focused && (_tw > 0)) {
  830. @@ -225,10 +225,10 @@
  831. } else {
  832. w->DrawRectangle(_client->GetResourcePool()->GetDocumentBckgndGC()->GetGC(),
  833. pos.x + _textPos.x, pos.y + _textPos.y,
  834. - min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
  835. + std::min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
  836. w->DrawRectangle(_client->GetResourcePool()->GetFocusHiliteGC()->GetGC(),
  837. pos.x + _textPos.x, pos.y + _textPos.y,
  838. - min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
  839. + std::min(_tw, columnData[0]->width - _textPos.x - 2)-1, _th);
  840. }
  841. }
  842.  
  843. @@ -960,7 +960,7 @@
  844. case LV_LARGE_ICONS:
  845. currentPos.x = _itemSep.w;
  846. currentPos.y = _itemSep.h;
  847. - _virtualSize.w = max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
  848. + _virtualSize.w = std::max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
  849. _rows = 0;
  850. for (i = 0; i < _items.size(); i++) {
  851.  
  852. @@ -994,7 +994,7 @@
  853. case LV_SMALL_ICONS:
  854. currentPos.x = _itemSep.w;
  855. currentPos.y = _itemSep.h;
  856. - _virtualSize.w = max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
  857. + _virtualSize.w = std::max(canvasSize.w, maxItemSize.w + _itemSep.w * 2);
  858. _rows = 0;
  859. for (i = 0; i < _items.size(); i++) {
  860.  
  861. @@ -1028,7 +1028,7 @@
  862. case LV_LIST:
  863. currentPos.x = _itemSep.w;
  864. currentPos.y = _itemSep.h;
  865. - _virtualSize.h = max(canvasSize.h, maxItemSize.h + _itemSep.h * 2);
  866. + _virtualSize.h = std::max(canvasSize.h, maxItemSize.h + _itemSep.h * 2);
  867. _cols = 0;
  868. for (i = 0; i < _items.size(); i++) {
  869.  
  870. Index: lib/libxclass/OXMdiMainFrame.cc
  871. ===================================================================
  872. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXMdiMainFrame.cc,v
  873. retrieving revision 1.3
  874. diff -u -r1.3 OXMdiMainFrame.cc
  875. --- lib/libxclass/OXMdiMainFrame.cc 4 May 2003 12:52:09 -0000 1.3
  876. +++ lib/libxclass/OXMdiMainFrame.cc 13 Jun 2023 11:34:17 -0000
  877. @@ -22,6 +22,8 @@
  878. #include <stdio.h>
  879. #include <stdlib.h>
  880.  
  881. +#include <algorithm>
  882. +
  883. #include <X11/keysym.h>
  884. #include <X11/cursorfont.h>
  885.  
  886. @@ -995,8 +997,8 @@
  887. int xpos = -_main->GetViewPort()->GetHPos();
  888. int ypos = -_main->GetViewPort()->GetVPos();
  889.  
  890. - return ODimension(max(xpos + _w, rect.right_bottom().x + 1),
  891. - max(ypos + _h, rect.right_bottom().y + 1));
  892. + return ODimension(std::max(xpos + _w, rect.right_bottom().x + 1),
  893. + std::max(ypos + _h, rect.right_bottom().y + 1));
  894. }
  895.  
  896. int OXMdiContainer::HandleConfigureNotify(XConfigureEvent *event) {
  897. @@ -1009,8 +1011,8 @@
  898. int vw = _main->GetViewPort()->GetWidth();
  899. int vh = _main->GetViewPort()->GetHeight();
  900.  
  901. - int w = max(vw, rect.right_bottom().x + 1);
  902. - int h = max(vh, rect.right_bottom().y + 1);
  903. + int w = std::max(vw, rect.right_bottom().x + 1);
  904. + int h = std::max(vh, rect.right_bottom().y + 1);
  905.  
  906. if ((w != _w) || (h != _h)) {
  907. ((OXMainFrame *)_main)->Layout();
  908. Index: lib/libxclass/OXMenu.cc
  909. ===================================================================
  910. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXMenu.cc,v
  911. retrieving revision 1.13
  912. diff -u -r1.13 OXMenu.cc
  913. --- lib/libxclass/OXMenu.cc 2 Jul 2004 12:42:35 -0000 1.13
  914. +++ lib/libxclass/OXMenu.cc 13 Jun 2023 11:34:17 -0000
  915. @@ -21,6 +21,8 @@
  916.  
  917. #include <string.h>
  918.  
  919. +#include <algorithm>
  920. +
  921. #include <xclass/utils.h>
  922. #include <xclass/OXMenu.h>
  923. #include <xclass/OXMainFrame.h>
  924. @@ -631,10 +633,10 @@
  925. } else {
  926. pw = 0;
  927. }
  928. - lsize = max(lsize, ltw);
  929. - rsize = max(rsize, rtw);
  930. + lsize = std::max(lsize, ltw);
  931. + rsize = std::max(rsize, rtw);
  932. tw = (rsize > 0) ? lsize + rsize + sepw : ltw;
  933. - w = max(w, spw + _xl + tw + RIGHT_GAP); // _xl already includes pw
  934. + w = std::max(w, spw + _xl + tw + RIGHT_GAP); // _xl already includes pw
  935. h += _hifont->TextHeight() + 3;
  936. break;
  937.  
  938. @@ -650,7 +652,7 @@
  939. rtw = 0;
  940. }
  941. tw = (rsize > 0) ? lsize + rsize + sepw : ltw;
  942. - w = max(w, spw + _xl + tw + RIGHT_GAP + POPUPMARK_WIDTH);
  943. + w = std::max(w, spw + _xl + tw + RIGHT_GAP + POPUPMARK_WIDTH);
  944. h += _hifont->TextHeight() + 3;
  945. break;
  946.  
  947. Index: lib/libxclass/OXMsgBox.cc
  948. ===================================================================
  949. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXMsgBox.cc,v
  950. retrieving revision 1.7
  951. diff -u -r1.7 OXMsgBox.cc
  952. --- lib/libxclass/OXMsgBox.cc 5 Jul 2002 08:11:38 -0000 1.7
  953. +++ lib/libxclass/OXMsgBox.cc 13 Jun 2023 11:34:17 -0000
  954. @@ -18,6 +18,7 @@
  955. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  956.  
  957. **************************************************************************/
  958. +#include <algorithm>
  959.  
  960. #include <xclass/utils.h>
  961. #include <xclass/OXClient.h>
  962. @@ -98,7 +99,7 @@
  963. Yes = new OXTextButton(ButtonFrame, new OHotString("&Yes"), ID_YES);
  964. Yes->Associate(this);
  965. ButtonFrame->AddFrame(Yes, L1);
  966. - width = max(width, Yes->GetDefaultWidth()); ++nb;
  967. + width = std::max(width, Yes->GetDefaultWidth()); ++nb;
  968. }
  969.  
  970. if (buttons & ID_YESALL) {
  971. @@ -106,63 +107,63 @@
  972. ID_YESALL);
  973. YesAll->Associate(this);
  974. ButtonFrame->AddFrame(YesAll, L1);
  975. - width = max(width, YesAll->GetDefaultWidth()); ++nb;
  976. + width = std::max(width, YesAll->GetDefaultWidth()); ++nb;
  977. }
  978.  
  979. if (buttons & ID_NO) {
  980. No = new OXTextButton(ButtonFrame, new OHotString("&No"), ID_NO);
  981. No->Associate(this);
  982. ButtonFrame->AddFrame(No, L1);
  983. - width = max(width, No->GetDefaultWidth()); ++nb;
  984. + width = std::max(width, No->GetDefaultWidth()); ++nb;
  985. }
  986.  
  987. if (buttons & ID_OK) {
  988. OK = new OXTextButton(ButtonFrame, new OHotString("&OK"), ID_OK);
  989. OK->Associate(this);
  990. ButtonFrame->AddFrame(OK, L1);
  991. - width = max(width, OK->GetDefaultWidth()); ++nb;
  992. + width = std::max(width, OK->GetDefaultWidth()); ++nb;
  993. }
  994.  
  995. if (buttons & ID_APPLY) {
  996. Apply = new OXTextButton(ButtonFrame, new OHotString("&Apply"), ID_APPLY);
  997. Apply->Associate(this);
  998. ButtonFrame->AddFrame(Apply, L1);
  999. - width = max(width, Apply->GetDefaultWidth()); ++nb;
  1000. + width = std::max(width, Apply->GetDefaultWidth()); ++nb;
  1001. }
  1002.  
  1003. if (buttons & ID_RETRY) {
  1004. Retry = new OXTextButton(ButtonFrame, new OHotString("&Retry"), ID_RETRY);
  1005. Retry->Associate(this);
  1006. ButtonFrame->AddFrame(Retry, L1);
  1007. - width = max(width, Retry->GetDefaultWidth()); ++nb;
  1008. + width = std::max(width, Retry->GetDefaultWidth()); ++nb;
  1009. }
  1010.  
  1011. if (buttons & ID_IGNORE) {
  1012. Ignore = new OXTextButton(ButtonFrame, new OHotString("&Ignore"), ID_IGNORE);
  1013. Ignore->Associate(this);
  1014. ButtonFrame->AddFrame(Ignore, L1);
  1015. - width = max(width, Ignore->GetDefaultWidth()); ++nb;
  1016. + width = std::max(width, Ignore->GetDefaultWidth()); ++nb;
  1017. }
  1018.  
  1019. if (buttons & ID_CANCEL) {
  1020. Cancel = new OXTextButton(ButtonFrame, new OHotString("&Cancel"), ID_CANCEL);
  1021. Cancel->Associate(this);
  1022. ButtonFrame->AddFrame(Cancel, L1);
  1023. - width = max(width, Cancel->GetDefaultWidth()); ++nb;
  1024. + width = std::max(width, Cancel->GetDefaultWidth()); ++nb;
  1025. }
  1026.  
  1027. if (buttons & ID_CLOSE) {
  1028. Close = new OXTextButton(ButtonFrame, new OHotString("C&lose"), ID_CLOSE);
  1029. Close->Associate(this);
  1030. ButtonFrame->AddFrame(Close, L1);
  1031. - width = max(width, Close->GetDefaultWidth()); ++nb;
  1032. + width = std::max(width, Close->GetDefaultWidth()); ++nb;
  1033. }
  1034.  
  1035. if (buttons & ID_DISMISS) {
  1036. Dismiss = new OXTextButton(ButtonFrame, new OHotString("&Dismiss"), ID_DISMISS);
  1037. Dismiss->Associate(this);
  1038. ButtonFrame->AddFrame(Dismiss, L1);
  1039. - width = max(width, Dismiss->GetDefaultWidth()); ++nb;
  1040. + width = std::max(width, Dismiss->GetDefaultWidth()); ++nb;
  1041. }
  1042.  
  1043. //--- place buttons at the bottom
  1044. Index: lib/libxclass/OXPropertiesDialog.cc
  1045. ===================================================================
  1046. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXPropertiesDialog.cc,v
  1047. retrieving revision 1.6
  1048. diff -u -r1.6 OXPropertiesDialog.cc
  1049. --- lib/libxclass/OXPropertiesDialog.cc 25 Jul 2004 15:41:56 -0000 1.6
  1050. +++ lib/libxclass/OXPropertiesDialog.cc 13 Jun 2023 11:34:17 -0000
  1051. @@ -31,6 +31,8 @@
  1052. #include <sys/types.h>
  1053. #include <sys/stat.h>
  1054.  
  1055. +#include <algorithm>
  1056. +
  1057. #include <xclass/utils.h>
  1058. #include <xclass/OXClient.h>
  1059. #include <xclass/OResourcePool.h>
  1060. @@ -131,8 +133,8 @@
  1061. bf->AddFrame(Apply, bly);
  1062.  
  1063. width = Ok->GetDefaultWidth();
  1064. - width = max(width, Cancel->GetDefaultWidth());
  1065. - width = max(width, Apply->GetDefaultWidth());
  1066. + width = std::max(width, Cancel->GetDefaultWidth());
  1067. + width = std::max(width, Apply->GetDefaultWidth());
  1068. bf->Resize((width + 20) * 3, bf->GetDefaultHeight());
  1069.  
  1070. // the "Apply" button is initially disabled,
  1071. Index: lib/libxclass/OXResizer.cc
  1072. ===================================================================
  1073. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXResizer.cc,v
  1074. retrieving revision 1.2
  1075. diff -u -r1.2 OXResizer.cc
  1076. --- lib/libxclass/OXResizer.cc 5 Nov 2001 10:06:13 -0000 1.2
  1077. +++ lib/libxclass/OXResizer.cc 13 Jun 2023 11:34:17 -0000
  1078. @@ -22,6 +22,8 @@
  1079. #include <X11/X.h>
  1080. #include <X11/cursorfont.h>
  1081.  
  1082. +#include <algorithm>
  1083. +
  1084. #include <xclass/OXCompositeFrame.h>
  1085. #include <xclass/OXResizer.h>
  1086.  
  1087. @@ -244,12 +246,12 @@
  1088. }
  1089.  
  1090. void OXHorizontalResizer::Resize(int w, int h) {
  1091. - if (_handle) _handle->Resize(max(w, 1), max(h, 1));
  1092. + if (_handle) _handle->Resize(std::max(w, 1), std::max(h, 1));
  1093. OXFrame::Resize(w, h);
  1094. }
  1095.  
  1096. void OXHorizontalResizer::MoveResize(int x, int y, int w, int h) {
  1097. - if (_handle) _handle->MoveResize(x + hx, y + hy, max(w, 1), max(h, 1));;
  1098. + if (_handle) _handle->MoveResize(x + hx, y + hy, std::max(w, 1), std::max(h, 1));;
  1099. OXFrame::MoveResize(x, y, w, h);
  1100. }
  1101.  
  1102. @@ -492,12 +494,12 @@
  1103. }
  1104.  
  1105. void OXVerticalResizer::Resize(int w, int h) {
  1106. - if (_handle) _handle->Resize(max(w, 1), max(h, 1));
  1107. + if (_handle) _handle->Resize(std::max(w, 1), std::max(h, 1));
  1108. OXFrame::Resize(w, h);
  1109. }
  1110.  
  1111. void OXVerticalResizer::MoveResize(int x, int y, int w, int h) {
  1112. - if (_handle) _handle->MoveResize(x + hx, y + hy, max(w, 1), max(h, 1));;
  1113. + if (_handle) _handle->MoveResize(x + hx, y + hy, std::max(w, 1), std::max(h, 1));;
  1114. OXFrame::MoveResize(x, y, w, h);
  1115. }
  1116.  
  1117. Index: lib/libxclass/OXScrollBar.cc
  1118. ===================================================================
  1119. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXScrollBar.cc,v
  1120. retrieving revision 1.6
  1121. diff -u -r1.6 OXScrollBar.cc
  1122. --- lib/libxclass/OXScrollBar.cc 2 Jul 2004 12:42:35 -0000 1.6
  1123. +++ lib/libxclass/OXScrollBar.cc 13 Jun 2023 11:34:17 -0000
  1124. @@ -19,6 +19,8 @@
  1125.  
  1126. **************************************************************************/
  1127.  
  1128. +#include <algorithm>
  1129. +
  1130. #include <xclass/utils.h>
  1131. #include <xclass/OResourcePool.h>
  1132. #include <xclass/OXCompositeFrame.h>
  1133. @@ -205,10 +207,10 @@
  1134. GrabModeAsync, GrabModeAsync, None, None);
  1135.  
  1136. _dragging = False;
  1137. - _x0 = _y0 = (_sb_width = max(_sb_width, 5));
  1138. + _x0 = _y0 = (_sb_width = std::max(_sb_width, 5));
  1139. _pos = 0;
  1140.  
  1141. - _range = max(h - (_sb_width << 1), 1);
  1142. + _range = std::max(h - (_sb_width << 1), 1);
  1143. _psize = _range >> 1;
  1144.  
  1145. _slsize = 50;
  1146. @@ -266,7 +268,7 @@
  1147.  
  1148. IN_RANGE(_pos, 0, _range - _psize);
  1149.  
  1150. - _x0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
  1151. + _x0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
  1152.  
  1153. IN_RANGE(_x0, _sb_width, _sb_width + _slrange);
  1154.  
  1155. @@ -342,15 +344,15 @@
  1156.  
  1157. void OXHScrollBar::SetRange(int range, int page_size, int sendMsg) {
  1158.  
  1159. - _range = max(range, 1);
  1160. - _psize = max(page_size, 0);
  1161. + _range = std::max(range, 1);
  1162. + _psize = std::max(page_size, 0);
  1163.  
  1164. - _slsize = max(_psize * (_w - (_sb_width << 1)) / _range, 6);
  1165. - _slsize = min(_slsize, _w - (_sb_width << 1));
  1166. + _slsize = std::max(_psize * (_w - (_sb_width << 1)) / _range, 6);
  1167. + _slsize = std::min(_slsize, _w - (_sb_width << 1));
  1168.  
  1169. - _slrange = max(_w - (_sb_width << 1) - _slsize, 1);
  1170. + _slrange = std::max(_w - (_sb_width << 1) - _slsize, 1);
  1171.  
  1172. - _x0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
  1173. + _x0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
  1174. IN_RANGE(_x0, _sb_width, _sb_width + _slrange);
  1175.  
  1176. _slider->MoveResize(_x0, 0, _slsize, _sb_width);
  1177. @@ -374,7 +376,7 @@
  1178. _pos = pos;
  1179. IN_RANGE(_pos, 0, _range - _psize);
  1180.  
  1181. - _x0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
  1182. + _x0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
  1183. IN_RANGE(_x0, _sb_width, _sb_width + _slrange);
  1184.  
  1185. _slider->MoveResize(_x0, 0, _slsize, _sb_width);
  1186. @@ -414,10 +416,10 @@
  1187. GrabModeAsync, GrabModeAsync, None, None);
  1188.  
  1189. _dragging = False;
  1190. - _x0 = _y0 = (_sb_width = max(_sb_width, 5));
  1191. + _x0 = _y0 = (_sb_width = std::max(_sb_width, 5));
  1192. _pos = 0;
  1193.  
  1194. - _range = max(h - (_sb_width << 1), 1);
  1195. + _range = std::max(h - (_sb_width << 1), 1);
  1196. _psize = _range >> 1;
  1197.  
  1198. _slsize = 50;
  1199. @@ -475,7 +477,7 @@
  1200.  
  1201. IN_RANGE(_pos, 0, _range - _psize);
  1202.  
  1203. - _y0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
  1204. + _y0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
  1205.  
  1206. IN_RANGE(_y0, _sb_width, _sb_width + _slrange);
  1207.  
  1208. @@ -549,15 +551,15 @@
  1209.  
  1210. void OXVScrollBar::SetRange(int range, int page_size, int sendMsg) {
  1211.  
  1212. - _range = max(range, 1);
  1213. - _psize = max(page_size, 0);
  1214. + _range = std::max(range, 1);
  1215. + _psize = std::max(page_size, 0);
  1216.  
  1217. - _slsize = max(_psize * (_h - (_sb_width << 1)) / _range, 6);
  1218. - _slsize = min(_slsize, _h - (_sb_width << 1));
  1219. + _slsize = std::max(_psize * (_h - (_sb_width << 1)) / _range, 6);
  1220. + _slsize = std::min(_slsize, _h - (_sb_width << 1));
  1221.  
  1222. - _slrange = max(_h - (_sb_width << 1) - _slsize, 1);
  1223. + _slrange = std::max(_h - (_sb_width << 1) - _slsize, 1);
  1224.  
  1225. - _y0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
  1226. + _y0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
  1227. IN_RANGE(_y0, _sb_width, _sb_width + _slrange);
  1228.  
  1229. _slider->MoveResize(0, _y0, _sb_width, _slsize);
  1230. @@ -581,7 +583,7 @@
  1231. _pos = pos;
  1232. IN_RANGE(_pos, 0, _range - _psize);
  1233.  
  1234. - _y0 = _sb_width + _pos * _slrange / max(_range-_psize, 1);
  1235. + _y0 = _sb_width + _pos * _slrange / std::max(_range-_psize, 1);
  1236. IN_RANGE(_y0, _sb_width, _sb_width + _slrange);
  1237.  
  1238. _slider->MoveResize(0, _y0, _sb_width, _slsize);
  1239. Index: lib/libxclass/OXTab.cc
  1240. ===================================================================
  1241. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXTab.cc,v
  1242. retrieving revision 1.5
  1243. diff -u -r1.5 OXTab.cc
  1244. --- lib/libxclass/OXTab.cc 5 Jul 2002 08:11:38 -0000 1.5
  1245. +++ lib/libxclass/OXTab.cc 13 Jun 2023 11:34:17 -0000
  1246. @@ -20,6 +20,7 @@
  1247. **************************************************************************/
  1248.  
  1249. #include <string.h>
  1250. +#include <algorithm>
  1251.  
  1252. #include <xclass/utils.h>
  1253. #include <xclass/OXTab.h>
  1254. @@ -56,7 +57,7 @@
  1255. _tw = _font->TextWidth(_text->GetString(), _text->GetLength());
  1256. _th = _font->TextHeight();
  1257. _yt = fm.ascent;
  1258. - Resize(max(_tw+12, 45), _th+6);
  1259. + Resize(std::max(_tw+12, 45), _th+6);
  1260. }
  1261.  
  1262. OXTabElt::~OXTabElt() {
  1263. @@ -81,7 +82,7 @@
  1264. }
  1265.  
  1266. ODimension OXTabElt::GetDefaultSize() const {
  1267. - return ODimension(max(_tw+12, 40), _th+6);
  1268. + return ODimension(std::max(_tw+12, 40), _th+6);
  1269. }
  1270.  
  1271. void OXTabElt::ShowFocusHilite(int onoff) {
  1272. Index: lib/libxclass/OXTextEdit.cc
  1273. ===================================================================
  1274. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXTextEdit.cc,v
  1275. retrieving revision 1.6
  1276. diff -u -r1.6 OXTextEdit.cc
  1277. --- lib/libxclass/OXTextEdit.cc 4 May 2003 12:52:09 -0000 1.6
  1278. +++ lib/libxclass/OXTextEdit.cc 13 Jun 2023 11:34:17 -0000
  1279. @@ -23,6 +23,8 @@
  1280. #include <string.h>
  1281. #include <ctype.h>
  1282.  
  1283. +#include <algorithm>
  1284. +
  1285. #include <X11/keysym.h>
  1286.  
  1287. #include <xclass/utils.h>
  1288. @@ -1647,8 +1649,8 @@
  1289.  
  1290. } else {
  1291.  
  1292. - lineSelStart = min(mousePos.x, _selAnchor.x);
  1293. - lineSelEnd = max(mousePos.x, _selAnchor.x);
  1294. + lineSelStart = std::min(mousePos.x, _selAnchor.x);
  1295. + lineSelEnd = std::max(mousePos.x, _selAnchor.x);
  1296.  
  1297. }
  1298.  
  1299. @@ -1663,10 +1665,10 @@
  1300.  
  1301. // update the coordinates of the selection area
  1302.  
  1303. - _selDragStart.x = min(_selAnchor.x, mousePos.x);
  1304. - _selDragStart.y = min(_selAnchor.y, mousePos.y);
  1305. - _selDragEnd.x = max(_selAnchor.x, mousePos.x);
  1306. - _selDragEnd.y = max(_selAnchor.y, mousePos.y);
  1307. + _selDragStart.x = std::min(_selAnchor.x, mousePos.x);
  1308. + _selDragStart.y = std::min(_selAnchor.y, mousePos.y);
  1309. + _selDragEnd.x = std::max(_selAnchor.x, mousePos.x);
  1310. + _selDragEnd.y = std::max(_selAnchor.y, mousePos.y);
  1311.  
  1312. // all lines that are inside the selection area are selected and their
  1313. // selection is adjusted
  1314. Index: lib/libxclass/OXTextEntry.cc
  1315. ===================================================================
  1316. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXTextEntry.cc,v
  1317. retrieving revision 1.9
  1318. diff -u -r1.9 OXTextEntry.cc
  1319. --- lib/libxclass/OXTextEntry.cc 12 Sep 2004 10:19:15 -0000 1.9
  1320. +++ lib/libxclass/OXTextEntry.cc 13 Jun 2023 11:34:17 -0000
  1321. @@ -18,6 +18,7 @@
  1322. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1323.  
  1324. **************************************************************************/
  1325. +#include <algorithm>
  1326.  
  1327. #include <xclass/utils.h>
  1328. #include <xclass/OXTextEntry.h>
  1329. @@ -165,8 +166,8 @@
  1330. drawGC->SetBackground(_backPixel);
  1331.  
  1332. if (_selection_on &&
  1333. - _cursor_ix >= min(_start_ix, _end_ix) &&
  1334. - _cursor_ix < max(_start_ix, _end_ix)) {
  1335. + _cursor_ix >= std::min(_start_ix, _end_ix) &&
  1336. + _cursor_ix < std::max(_start_ix, _end_ix)) {
  1337. drawGC = _selGC;
  1338. drawGC->SetFont(_normGC->GetFont());
  1339. drawGC->SetBackground(_defaultSelectedBackground);
  1340. @@ -236,8 +237,8 @@
  1341. if (_selection_on) {
  1342. int xs, ws, ixs, iws;
  1343.  
  1344. - xs = min(_start_x, _end_x);
  1345. - ixs = min(_start_ix, _end_ix);
  1346. + xs = std::min(_start_x, _end_x);
  1347. + ixs = std::min(_start_ix, _end_ix);
  1348.  
  1349. if ((_vstart_x > xs) && (start_char > ixs)) {
  1350. xs = _vstart_x;
  1351. @@ -317,8 +318,8 @@
  1352. ix = down;
  1353.  
  1354. // safety check...
  1355. - ix = max(ix, 0);
  1356. - ix = min(ix, len); // len-1
  1357. + ix = std::max(ix, 0);
  1358. + ix = std::min(ix, len); // len-1
  1359. return ix;
  1360. }
  1361.  
  1362. @@ -500,7 +501,7 @@
  1363. if (_selection_on) {
  1364. int start, ns;
  1365.  
  1366. - start = min(_start_ix, _end_ix);
  1367. + start = std::min(_start_ix, _end_ix);
  1368. ns = abs(_end_ix - _start_ix);
  1369. _text->RemoveText(start, ns);
  1370. _selection_on = False;
  1371. @@ -516,7 +517,7 @@
  1372. if (_selection_on) {
  1373. int start, ns;
  1374.  
  1375. - start = min(_start_ix, _end_ix);
  1376. + start = std::min(_start_ix, _end_ix);
  1377. ns = abs(_end_ix - _start_ix);
  1378. _text->RemoveText(start, ns);
  1379. _selection_on = False;
  1380. @@ -549,7 +550,7 @@
  1381. if (_selection_on && (strlen(tmp) > 0)) {
  1382. int start, ns;
  1383.  
  1384. - start = min(_start_ix, _end_ix);
  1385. + start = std::min(_start_ix, _end_ix);
  1386. ns = abs(_end_ix - _start_ix);
  1387. _text->RemoveText(start, ns);
  1388. _selection_on = False;
  1389. @@ -659,7 +660,7 @@
  1390. if (_selection_on) {
  1391. int start, ns;
  1392.  
  1393. - start = min(_start_ix, _end_ix);
  1394. + start = std::min(_start_ix, _end_ix);
  1395. ns = abs(_end_ix - _start_ix);
  1396. _text->RemoveText(start, ns);
  1397. _selection_on = False;
  1398. Index: lib/libxclass/OXToolBarButton.cc
  1399. ===================================================================
  1400. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXToolBarButton.cc,v
  1401. retrieving revision 1.1
  1402. diff -u -r1.1 OXToolBarButton.cc
  1403. --- lib/libxclass/OXToolBarButton.cc 2 Jul 2004 12:43:48 -0000 1.1
  1404. +++ lib/libxclass/OXToolBarButton.cc 13 Jun 2023 11:34:17 -0000
  1405. @@ -19,6 +19,8 @@
  1406.  
  1407. **************************************************************************/
  1408.  
  1409. +#include <algorithm>
  1410. +
  1411. #include <xclass/OString.h>
  1412. #include <xclass/OPicture.h>
  1413. #include <xclass/OXToolBarButton.h>
  1414. @@ -136,16 +138,16 @@
  1415. ODimension OXToolBarButton::GetDefaultSize() const {
  1416. ODimension size(_tw, 0);
  1417. if (_normalPic) {
  1418. - size.w = max(size.w, _normalPic->GetWidth());
  1419. - size.h = max(size.h, _normalPic->GetHeight());
  1420. + size.w = std::max((int)size.w, _normalPic->GetWidth());
  1421. + size.h = std::max((int)size.h, _normalPic->GetHeight());
  1422. }
  1423. if (_onPic) {
  1424. - size.w = max(size.w, _onPic->GetWidth());
  1425. - size.h = max(size.h, _onPic->GetHeight());
  1426. + size.w = std::max((int)size.w, _onPic->GetWidth());
  1427. + size.h = std::max((int)size.h, _onPic->GetHeight());
  1428. }
  1429. if (_disabledPic) {
  1430. - size.w = max(size.w, _disabledPic->GetWidth());
  1431. - size.h = max(size.h, _disabledPic->GetHeight());
  1432. + size.w = std::max((int)size.w, _disabledPic->GetWidth());
  1433. + size.h = std::max((int)size.h, _disabledPic->GetHeight());
  1434. }
  1435. size.w += 6;
  1436. size.h += _th + 6;
  1437. Index: lib/libxclass/OXView.cc
  1438. ===================================================================
  1439. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXView.cc,v
  1440. retrieving revision 1.7
  1441. diff -u -r1.7 OXView.cc
  1442. --- lib/libxclass/OXView.cc 23 Sep 2004 11:28:01 -0000 1.7
  1443. +++ lib/libxclass/OXView.cc 13 Jun 2023 11:34:17 -0000
  1444. @@ -22,6 +22,8 @@
  1445. #include <stdlib.h>
  1446. #include <stdio.h>
  1447.  
  1448. +#include <algorithm>
  1449. +
  1450. #include <xclass/utils.h>
  1451. #include <xclass/OPicture.h>
  1452. #include <xclass/OXView.h>
  1453. @@ -158,14 +160,14 @@
  1454.  
  1455. ch = _canvas->GetHeight();
  1456. if (_scrollValue.y == 1)
  1457. - amount = _scrollValue.y * max(ch / 6, 1);
  1458. + amount = _scrollValue.y * std::max(ch / 6, 1);
  1459. else
  1460. amount = _scrollValue.y * 5;
  1461.  
  1462. if (event->state & ShiftMask)
  1463. amount = _scrollValue.y;
  1464. else if (event->state & ControlMask)
  1465. - amount = ch - max(ch / 20, 1);
  1466. + amount = ch - std::max(ch / 20, 1);
  1467.  
  1468. if (event->button == Button4) {
  1469. ScrollDown(amount);
  1470. Index: lib/libxclass/OXWindow.cc
  1471. ===================================================================
  1472. RCS file: /cvsroot/xclass/xclass/lib/libxclass/OXWindow.cc,v
  1473. retrieving revision 1.4
  1474. diff -u -r1.4 OXWindow.cc
  1475. --- lib/libxclass/OXWindow.cc 9 Sep 2004 11:42:37 -0000 1.4
  1476. +++ lib/libxclass/OXWindow.cc 13 Jun 2023 11:34:17 -0000
  1477. @@ -19,6 +19,8 @@
  1478.  
  1479. **************************************************************************/
  1480.  
  1481. +#include <algorithm>
  1482. +
  1483. #include <xclass/utils.h>
  1484. #include <xclass/OXWindow.h>
  1485.  
  1486. @@ -34,7 +36,7 @@
  1487. _parent = p;
  1488. _toplevel = p->_toplevel;
  1489. _id = XCreateWindow(GetDisplay(), _parent->_id, x, y,
  1490. - max(w, 1), max(h, 1), max(border, 0),
  1491. + std::max(w, 1), std::max(h, 1), std::max(border, 0),
  1492. depth, clss, visual, vmask, attr);
  1493. _windowExists = (_id != None);
  1494. _client->RegisterWindow(this);
  1495. @@ -64,11 +66,11 @@
  1496. }
  1497.  
  1498. void OXWindow::Resize(int w, int h) {
  1499. - XResizeWindow(GetDisplay(), _id, max(w, 1), max(h, 1));
  1500. + XResizeWindow(GetDisplay(), _id, std::max(w, 1), std::max(h, 1));
  1501. }
  1502.  
  1503. void OXWindow::MoveResize(int x, int y, int w, int h) {
  1504. - XMoveResizeWindow(GetDisplay(), _id, x, y, max(w, 1), max(h, 1));
  1505. + XMoveResizeWindow(GetDisplay(), _id, x, y, std::max(w, 1), std::max(h, 1));
  1506. }
  1507.  
  1508. int OXWindow::IsMapped() {
  1509. Index: test/exec.cc
  1510. ===================================================================
  1511. RCS file: /cvsroot/xclass/xclass/test/exec.cc,v
  1512. retrieving revision 1.3
  1513. diff -u -r1.3 exec.cc
  1514. --- test/exec.cc 20 Jun 2002 12:45:38 -0000 1.3
  1515. +++ test/exec.cc 13 Jun 2023 11:34:17 -0000
  1516. @@ -26,6 +26,8 @@
  1517. #include <errno.h>
  1518. #include <ctype.h>
  1519.  
  1520. +#include <algorithm>
  1521. +
  1522. #include <xclass/OXClient.h>
  1523. #include <xclass/OXTransientFrame.h>
  1524. #include <xclass/OXMenu.h>
  1525. @@ -369,12 +371,12 @@
  1526. Ok->SetDefault();
  1527. Ok->Associate(this);
  1528. ButtonFrame->AddFrame(Ok, L1);
  1529. - width = max(width, Ok->GetDefaultWidth());
  1530. + width = std::max(width, Ok->GetDefaultWidth());
  1531.  
  1532. Cancel = new OXTextButton(ButtonFrame, new OHotString("&Cancel"), ID_CANCEL);
  1533. Cancel->Associate(this);
  1534. ButtonFrame->AddFrame(Cancel, L1);
  1535. - width = max(width, Cancel->GetDefaultWidth());
  1536. + width = std::max(width, Cancel->GetDefaultWidth());
  1537.  
  1538. //--- place buttons at the bottom
  1539.  
  1540. Index: test/ftest.cc
  1541. ===================================================================
  1542. RCS file: /cvsroot/xclass/xclass/test/ftest.cc,v
  1543. retrieving revision 1.2
  1544. diff -u -r1.2 ftest.cc
  1545. --- test/ftest.cc 17 Jul 2002 08:52:16 -0000 1.2
  1546. +++ test/ftest.cc 13 Jun 2023 11:34:18 -0000
  1547. @@ -25,6 +25,8 @@
  1548. #include <fcntl.h>
  1549. #include <sys/stat.h>
  1550.  
  1551. +#include <time.h>
  1552. +
  1553. #include <xclass/OXClient.h>
  1554. #include <xclass/OXWindow.h>
  1555. #include <xclass/OXFrame.h>
  1556. Index: test/xdnd.cc
  1557. ===================================================================
  1558. RCS file: /cvsroot/xclass/xclass/test/xdnd.cc,v
  1559. retrieving revision 1.3
  1560. diff -u -r1.3 xdnd.cc
  1561. --- test/xdnd.cc 5 Nov 2001 10:06:13 -0000 1.3
  1562. +++ test/xdnd.cc 13 Jun 2023 11:34:18 -0000
  1563. @@ -25,6 +25,8 @@
  1564. #include <fcntl.h>
  1565. #include <sys/stat.h>
  1566.  
  1567. +#include <algorithm>
  1568. +
  1569. #include <X11/X.h>
  1570. #include <X11/Xatom.h>
  1571.  
  1572. @@ -248,7 +250,7 @@
  1573. _font->GetFontMetrics(&fm);
  1574. _ta = fm.ascent;
  1575.  
  1576. - w = max(icon->GetWidth(), _tw);
  1577. + w = std::max(icon->GetWidth(), _tw);
  1578. h = icon->GetHeight() + _th+1 + 6;
  1579.  
  1580. ix = (w - icon->GetWidth()) >> 1;
  1581.  
  1582. ===
Tags: xclass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement