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