mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
5.5 KiB

  1. --- ./rfb/Rect.h.old 2003-06-30 21:50:25.000000000 +0100
  2. +++ ./rfb/Rect.h 2004-05-20 14:43:56.299371046 +0100
  3. @@ -21,13 +21,7 @@
  4. #ifndef __RFB_RECT_INCLUDED__
  5. #define __RFB_RECT_INCLUDED__
  6. -#ifndef max
  7. -#define max(a,b) (((a) > (b)) ? (a) : (b))
  8. -#endif
  9. -
  10. -#ifndef min
  11. -#define min(a,b) (((a) < (b)) ? (a) : (b))
  12. -#endif
  13. +#include <algorithm>
  14. namespace rfb {
  15. @@ -70,20 +64,20 @@
  16. }
  17. inline Rect intersect(const Rect &r) const {
  18. Rect result;
  19. - result.tl.x = max(tl.x, r.tl.x);
  20. - result.tl.y = max(tl.y, r.tl.y);
  21. - result.br.x = max(min(br.x, r.br.x), result.tl.x);
  22. - result.br.y = max(min(br.y, r.br.y), result.tl.y);
  23. + result.tl.x = std::max(tl.x, r.tl.x);
  24. + result.tl.y = std::max(tl.y, r.tl.y);
  25. + result.br.x = std::max(std::min(br.x, r.br.x), result.tl.x);
  26. + result.br.y = std::max(std::min(br.y, r.br.y), result.tl.y);
  27. return result;
  28. }
  29. inline Rect union_boundary(const Rect &r) const {
  30. if (r.is_empty()) return *this;
  31. if (is_empty()) return r;
  32. Rect result;
  33. - result.tl.x = min(tl.x, r.tl.x);
  34. - result.tl.y = min(tl.y, r.tl.y);
  35. - result.br.x = max(br.x, r.br.x);
  36. - result.br.y = max(br.y, r.br.y);
  37. + result.tl.x = std::min(tl.x, r.tl.x);
  38. + result.tl.y = std::min(tl.y, r.tl.y);
  39. + result.br.x = std::max(br.x, r.br.x);
  40. + result.br.y = std::max(br.y, r.br.y);
  41. return result;
  42. }
  43. inline Rect translate(const Point &p) const {
  44. --- ./rfb/ComparingUpdateTracker.cxx.orig 2004-05-18 17:16:51.000000000 +0100
  45. +++ ./rfb/ComparingUpdateTracker.cxx 2004-05-20 14:44:48.225445585 +0100
  46. @@ -60,7 +60,7 @@
  47. // since in effect the entire framebuffer has changed.
  48. oldFb.setSize(fb->width(), fb->height());
  49. for (int y=0; y<fb->height(); y+=BLOCK_SIZE) {
  50. - Rect pos(0, y, fb->width(), min(fb->height(), y+BLOCK_SIZE));
  51. + Rect pos(0, y, fb->width(), std::min(fb->height(), y+BLOCK_SIZE));
  52. int srcStride;
  53. const rdr::U8* srcData = fb->getPixelsR(pos, &srcStride);
  54. oldFb.imageRect(pos, srcData, srcStride);
  55. @@ -100,20 +100,20 @@
  56. for (int blockTop = r.tl.y; blockTop < r.br.y; blockTop += BLOCK_SIZE)
  57. {
  58. // Get a strip of the source buffer
  59. - Rect pos(r.tl.x, blockTop, r.br.x, min(r.br.y, blockTop+BLOCK_SIZE));
  60. + Rect pos(r.tl.x, blockTop, r.br.x, std::min(r.br.y, blockTop+BLOCK_SIZE));
  61. int fbStride;
  62. const rdr::U8* newBlockPtr = fb->getPixelsR(pos, &fbStride);
  63. int newStrideBytes = fbStride * bytesPerPixel;
  64. rdr::U8* oldBlockPtr = oldData;
  65. - int blockBottom = min(blockTop+BLOCK_SIZE, r.br.y);
  66. + int blockBottom = std::min(blockTop+BLOCK_SIZE, r.br.y);
  67. for (int blockLeft = r.tl.x; blockLeft < r.br.x; blockLeft += BLOCK_SIZE)
  68. {
  69. const rdr::U8* newPtr = newBlockPtr;
  70. rdr::U8* oldPtr = oldBlockPtr;
  71. - int blockRight = min(blockLeft+BLOCK_SIZE, r.br.x);
  72. + int blockRight = std::min(blockLeft+BLOCK_SIZE, r.br.x);
  73. int blockWidthInBytes = (blockRight-blockLeft) * bytesPerPixel;
  74. for (int y = blockTop; y < blockBottom; y++)
  75. --- ./rfb/hextileDecode.h.old 2003-07-31 19:03:38.000000000 +0100
  76. +++ ./rfb/hextileDecode.h 2004-05-20 14:43:56.337363784 +0100
  77. @@ -52,11 +52,11 @@
  78. for (t.tl.y = r.tl.y; t.tl.y < r.br.y; t.tl.y += 16) {
  79. - t.br.y = min(r.br.y, t.tl.y + 16);
  80. + t.br.y = std::min(r.br.y, t.tl.y + 16);
  81. for (t.tl.x = r.tl.x; t.tl.x < r.br.x; t.tl.x += 16) {
  82. - t.br.x = min(r.br.x, t.tl.x + 16);
  83. + t.br.x = std::min(r.br.x, t.tl.x + 16);
  84. int tileType = is->readU8();
  85. --- ./rfb/hextileEncode.h.old 2003-07-31 19:03:38.000000000 +0100
  86. +++ ./rfb/hextileEncode.h 2004-05-20 14:43:56.340363210 +0100
  87. @@ -60,11 +60,11 @@
  88. for (t.tl.y = r.tl.y; t.tl.y < r.br.y; t.tl.y += 16) {
  89. - t.br.y = min(r.br.y, t.tl.y + 16);
  90. + t.br.y = std::min(r.br.y, t.tl.y + 16);
  91. for (t.tl.x = r.tl.x; t.tl.x < r.br.x; t.tl.x += 16) {
  92. - t.br.x = min(r.br.x, t.tl.x + 16);
  93. + t.br.x = std::min(r.br.x, t.tl.x + 16);
  94. GET_IMAGE_INTO_BUF(t,buf);
  95. --- ./rfb/zrleEncode.h.orig 2004-05-18 17:16:52.000000000 +0100
  96. +++ ./rfb/zrleEncode.h 2004-05-20 14:46:54.105384909 +0100
  97. @@ -130,7 +130,7 @@
  98. for (t.tl.y = r.tl.y; t.tl.y < r.br.y; t.tl.y += 64) {
  99. - t.br.y = min(r.br.y, t.tl.y + 64);
  100. + t.br.y = std::min(r.br.y, t.tl.y + 64);
  101. if (os->length() + worstCaseLine > maxLen) {
  102. if (t.tl.y == r.tl.y)
  103. @@ -143,7 +143,7 @@
  104. for (t.tl.x = r.tl.x; t.tl.x < r.br.x; t.tl.x += 64) {
  105. - t.br.x = min(r.br.x, t.tl.x + 64);
  106. + t.br.x = std::min(r.br.x, t.tl.x + 64);
  107. GET_IMAGE_INTO_BUF(t,buf);
  108. --- ./rfb/zrleDecode.h.orig 2003-07-31 19:03:38.000000000 +0100
  109. +++ ./rfb/zrleDecode.h 2004-05-20 14:43:56.352360917 +0100
  110. @@ -61,11 +61,11 @@
  111. for (t.tl.y = r.tl.y; t.tl.y < r.br.y; t.tl.y += 64) {
  112. - t.br.y = min(r.br.y, t.tl.y + 64);
  113. + t.br.y = std::min(r.br.y, t.tl.y + 64);
  114. for (t.tl.x = r.tl.x; t.tl.x < r.br.x; t.tl.x += 64) {
  115. - t.br.x = min(r.br.x, t.tl.x + 64);
  116. + t.br.x = std::min(r.br.x, t.tl.x + 64);
  117. int mode = zis->readU8();
  118. bool rle = mode & 128;
  119. --- ./tx/TXImage.cxx.orig 2004-03-18 17:37:37.000000000 +0000
  120. +++ ./tx/TXImage.cxx 2004-05-20 14:43:56.355360344 +0100
  121. @@ -71,8 +71,8 @@
  122. if (w == width() && h == height()) return;
  123. int oldStrideBytes = getStride() * (format.bpp/8);
  124. - int rowsToCopy = min(h, height());
  125. - int bytesPerRow = min(w, width()) * (format.bpp/8);
  126. + int rowsToCopy = std::min(h, height());
  127. + int bytesPerRow = std::min(w, width()) * (format.bpp/8);
  128. rdr::U8* oldData = 0;
  129. bool allocData = false;