Use min/max instead of MIN/MAX.
diff --git a/controls/edit.c b/controls/edit.c
index c10729e..29cf1ee 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -977,7 +977,7 @@
current_def->length = current_def->net_length;
break;
}
- es->text_width = MAX(es->text_width, current_def->width);
+ es->text_width = max(es->text_width, current_def->width);
start += current_def->length;
*previous_next = current_def;
previous_next = ¤t_def->next;
@@ -1138,8 +1138,8 @@
*/
static void EDIT_ConfinePoint(WND *wnd, EDITSTATE *es, LPINT x, LPINT y)
{
- *x = MIN(MAX(*x, es->format_rect.left), es->format_rect.right - 1);
- *y = MIN(MAX(*y, es->format_rect.top), es->format_rect.bottom - 1);
+ *x = min(max(*x, es->format_rect.left), es->format_rect.right - 1);
+ *y = min(max(*y, es->format_rect.top), es->format_rect.bottom - 1);
}
@@ -1351,20 +1351,20 @@
EDIT_UnlockBuffer(wnd, es, TRUE);
if (es->text) {
if ((es->text = HeapReAlloc(es->heap, 0, es->text, size + 1)))
- es->buffer_size = MIN(HeapSize(es->heap, 0, es->text) - 1, es->buffer_limit);
+ es->buffer_size = min(HeapSize(es->heap, 0, es->text) - 1, es->buffer_limit);
else
es->buffer_size = 0;
} else if (es->hloc32) {
if ((hNew32 = LocalReAlloc(es->hloc32, size + 1, 0))) {
TRACE("Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
es->hloc32 = hNew32;
- es->buffer_size = MIN(LocalSize(es->hloc32) - 1, es->buffer_limit);
+ es->buffer_size = min(LocalSize(es->hloc32) - 1, es->buffer_limit);
}
} else if (es->hloc16) {
if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) {
TRACE("Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
es->hloc16 = hNew16;
- es->buffer_size = MIN(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit);
+ es->buffer_size = min(LOCAL_Size(wnd->hInstance, es->hloc16) - 1, es->buffer_limit);
}
}
if (es->buffer_size < size) {
@@ -1698,8 +1698,8 @@
s = es->selection_start;
e = es->selection_end;
ORDER_INT(s, e);
- s = MIN(li + ll, MAX(li, s));
- e = MIN(li + ll, MAX(li, e));
+ s = min(li + ll, max(li, s));
+ e = min(li + ll, max(li, e));
if (rev && (s != e) &&
((es->flags & EF_FOCUSED) || (es->style & ES_NOHIDESEL))) {
x += EDIT_PaintText(wnd, es, dc, x, y, line, 0, s - li, FALSE);
@@ -1798,10 +1798,10 @@
}
es->format_rect.left += es->left_margin;
es->format_rect.right -= es->right_margin;
- es->format_rect.right = MAX(es->format_rect.right, es->format_rect.left + es->char_width);
+ es->format_rect.right = max(es->format_rect.right, es->format_rect.left + es->char_width);
if (es->style & ES_MULTILINE)
es->format_rect.bottom = es->format_rect.top +
- MAX(1, (es->format_rect.bottom - es->format_rect.top) / es->line_height) * es->line_height;
+ max(1, (es->format_rect.bottom - es->format_rect.top) / es->line_height) * es->line_height;
else
es->format_rect.bottom = es->format_rect.top + es->line_height;
if ((es->style & ES_MULTILINE) && !(es->style & ES_AUTOHSCROLL))
@@ -1988,7 +1988,7 @@
ERR("could not allocate new 32 bit buffer\n");
return 0;
}
- newSize = MIN(LocalSize(newBuf) - 1, es->buffer_limit);
+ newSize = min(LocalSize(newBuf) - 1, es->buffer_limit);
if (!(newText = LocalLock(newBuf))) {
ERR("could not lock new 32 bit buffer\n");
LocalFree(newBuf);
@@ -2048,7 +2048,7 @@
ERR("could not allocate new 16 bit buffer\n");
return 0;
}
- newSize = MIN(LOCAL_Size(wnd->hInstance, newBuf) - 1, es->buffer_limit);
+ newSize = min(LOCAL_Size(wnd->hInstance, newBuf) - 1, es->buffer_limit);
if (!(newText = LOCAL_Lock(wnd->hInstance, newBuf))) {
ERR("could not lock new 16 bit buffer\n");
LOCAL_Free(wnd->hInstance, newBuf);
@@ -2091,7 +2091,7 @@
line = 0;
i = EDIT_EM_LineIndex(wnd, es, line);
src = es->text + i;
- len = MIN(*(WORD *)lpch, EDIT_EM_LineLength(wnd, es, i));
+ len = min(*(WORD *)lpch, EDIT_EM_LineLength(wnd, es, i));
for (i = 0 ; i < len ; i++) {
*lpch = *src;
src++;
@@ -2155,7 +2155,7 @@
if (index > lstrlenA(es->text))
return es->line_count - 1;
if (index == -1)
- index = MIN(es->selection_start, es->selection_end);
+ index = min(es->selection_start, es->selection_end);
line = 0;
line_def = es->first_line_def;
@@ -2256,7 +2256,7 @@
dx = -es->x_offset;
if (dx > es->text_width - es->x_offset)
dx = es->text_width - es->x_offset;
- nyoff = MAX(0, es->y_offset + dy);
+ nyoff = max(0, es->y_offset + dy);
if (nyoff >= es->line_count)
nyoff = es->line_count - 1;
dy = (es->y_offset - nyoff) * es->line_height;
@@ -2294,7 +2294,7 @@
HFONT old_font = 0;
SIZE size;
- index = MIN(index, len);
+ index = min(index, len);
dc = GetDC(wnd->hwndSelf);
if (es->font)
old_font = SelectObject(dc, es->font);
@@ -2654,12 +2654,12 @@
{
if (es->style & ES_MULTILINE) {
if (limit)
- es->buffer_limit = MIN(limit, BUFLIMIT_MULTI);
+ es->buffer_limit = min(limit, BUFLIMIT_MULTI);
else
es->buffer_limit = BUFLIMIT_MULTI;
} else {
if (limit)
- es->buffer_limit = MIN(limit, BUFLIMIT_SINGLE);
+ es->buffer_limit = min(limit, BUFLIMIT_SINGLE);
else
es->buffer_limit = BUFLIMIT_SINGLE;
}
@@ -2739,8 +2739,8 @@
start = es->selection_end;
end = es->selection_end;
} else {
- start = MIN(start, len);
- end = MIN(end, len);
+ start = min(start, len);
+ end = min(end, len);
}
es->selection_start = start;
es->selection_end = end;
@@ -3724,7 +3724,7 @@
GetClipBox(dc, &rcRgn);
if (es->style & ES_MULTILINE) {
INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
- for (i = es->y_offset ; i <= MIN(es->y_offset + vlc, es->y_offset + es->line_count - 1) ; i++) {
+ for (i = es->y_offset ; i <= min(es->y_offset + vlc, es->y_offset + es->line_count - 1) ; i++) {
EDIT_GetLineRect(wnd, es, i, 0, -1, &rcLine);
if (IntersectRect(&rc, &rcRgn, &rcLine))
EDIT_PaintLine(wnd, es, dc, i, rev);