Make use of the DEFAULT_DEBUG_CHANNEL where appropriate.
Use the default version of FIXME, ERR, WARN, TRACE for the default
channel.
diff --git a/controls/edit.c b/controls/edit.c
index c173c83..febfb76 100644
--- a/controls/edit.c
+++ b/controls/edit.c
@@ -25,8 +25,8 @@
#include "tweak.h"
#include "winversion.h"
+DEFAULT_DEBUG_CHANNEL(edit)
DECLARE_DEBUG_CHANNEL(combo)
-DECLARE_DEBUG_CHANNEL(edit)
DECLARE_DEBUG_CHANNEL(relay)
#define BUFLIMIT_MULTI 65534 /* maximum buffer size (not including '\0')
@@ -118,7 +118,7 @@
#define ORDER_UINT(x,y) do { if ((UINT)(y) < (UINT)(x)) SWAP_UINT32((x),(y)); } while(0)
#define DPRINTF_EDIT_NOTIFY(hwnd, str) \
- do {TRACE_(edit)("notification " str " sent to hwnd=%08x\n", \
+ do {TRACE("notification " str " sent to hwnd=%08x\n", \
(UINT)(hwnd));} while(0)
/* used for disabled or read-only edit control */
@@ -134,11 +134,11 @@
MAKEWPARAM((wnd)->wIDmenu, wNotifyCode), \
(LPARAM)(wnd)->hwndSelf);} while(0)
#define DPRINTF_EDIT_MSG16(str) \
- TRACE_(edit)(\
+ TRACE(\
"16 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
(UINT)hwnd, (UINT)wParam, (UINT)lParam)
#define DPRINTF_EDIT_MSG32(str) \
- TRACE_(edit)(\
+ TRACE(\
"32 bit : " str ": hwnd=%08x, wParam=%08x, lParam=%08x\n", \
(UINT)hwnd, (UINT)wParam, (UINT)lParam)
@@ -1194,7 +1194,7 @@
static void EDIT_LockBuffer(WND *wnd, EDITSTATE *es)
{
if (!es) {
- ERR_(edit)("no EDITSTATE ... please report\n");
+ ERR("no EDITSTATE ... please report\n");
return;
}
if (!(es->style & ES_MULTILINE))
@@ -1205,7 +1205,7 @@
else if (es->hloc16)
es->text = LOCAL_Lock(wnd->hInstance, es->hloc16);
else {
- ERR_(edit)("no buffer ... please report\n");
+ ERR("no buffer ... please report\n");
return;
}
}
@@ -1344,7 +1344,7 @@
if (size > es->buffer_limit)
size = es->buffer_limit;
- TRACE_(edit)("trying to ReAlloc to %d+1\n", size);
+ TRACE("trying to ReAlloc to %d+1\n", size);
EDIT_UnlockBuffer(wnd, es, TRUE);
if (es->text) {
@@ -1354,25 +1354,25 @@
es->buffer_size = 0;
} else if (es->hloc32) {
if ((hNew32 = LocalReAlloc(es->hloc32, size + 1, 0))) {
- TRACE_(edit)("Old 32 bit handle %08x, new handle %08x\n", es->hloc32, hNew32);
+ 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);
}
} else if (es->hloc16) {
if ((hNew16 = LOCAL_ReAlloc(wnd->hInstance, es->hloc16, size + 1, LMEM_MOVEABLE))) {
- TRACE_(edit)("Old 16 bit handle %08x, new handle %08x\n", es->hloc16, hNew16);
+ 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);
}
}
if (es->buffer_size < size) {
EDIT_LockBuffer(wnd, es);
- WARN_(edit)("FAILED ! We now have %d+1\n", es->buffer_size);
+ WARN("FAILED ! We now have %d+1\n", es->buffer_size);
EDIT_NOTIFY_PARENT(wnd, EN_ERRSPACE, "EN_ERRSPACE");
return FALSE;
} else {
EDIT_LockBuffer(wnd, es);
- TRACE_(edit)("We now have %d+1\n", es->buffer_size);
+ TRACE("We now have %d+1\n", es->buffer_size);
return TRUE;
}
}
@@ -1391,12 +1391,12 @@
return TRUE;
size = ((size / GROWLENGTH) + 1) * GROWLENGTH;
- TRACE_(edit)("trying to ReAlloc to %d+1\n", size);
+ TRACE("trying to ReAlloc to %d+1\n", size);
if ((es->undo_text = HeapReAlloc(es->heap, 0, es->undo_text, size + 1))) {
es->undo_buffer_size = HeapSize(es->heap, 0, es->undo_text) - 1;
if (es->undo_buffer_size < size) {
- WARN_(edit)("FAILED ! We now have %d+1\n", es->undo_buffer_size);
+ WARN("FAILED ! We now have %d+1\n", es->undo_buffer_size);
return FALSE;
}
return TRUE;
@@ -1686,7 +1686,7 @@
} else if (line)
return;
- TRACE_(edit)("line=%d\n", line);
+ TRACE("line=%d\n", line);
pos = EDIT_EM_PosFromChar(wnd, es, EDIT_EM_LineIndex(wnd, es, line), FALSE);
x = SLOWORD(pos);
@@ -1815,17 +1815,17 @@
static void EDIT_UnlockBuffer(WND *wnd, EDITSTATE *es, BOOL force)
{
if (!es) {
- ERR_(edit)("no EDITSTATE ... please report\n");
+ ERR("no EDITSTATE ... please report\n");
return;
}
if (!(es->style & ES_MULTILINE))
return;
if (!es->lock_count) {
- ERR_(edit)("lock_count == 0 ... please report\n");
+ ERR("lock_count == 0 ... please report\n");
return;
}
if (!es->text) {
- ERR_(edit)("es->text == 0 ... please report\n");
+ ERR("es->text == 0 ... please report\n");
return;
}
if (force || (es->lock_count == 1)) {
@@ -1856,7 +1856,7 @@
{
INT ret = 0;
- TRACE_(edit)("s=%p, index=%u, count=%u, action=%d\n",
+ TRACE("s=%p, index=%u, count=%u, action=%d\n",
s, index, count, action);
switch (action) {
@@ -1900,7 +1900,7 @@
ret = (s[index] == ' ');
break;
default:
- ERR_(edit)("unknown action code, please report !\n");
+ ERR("unknown action code, please report !\n");
break;
}
return ret;
@@ -1946,7 +1946,7 @@
es->flags &= ~EF_USE_SOFTBRK;
if (add_eol) {
es->flags |= EF_USE_SOFTBRK;
- FIXME_(edit)("soft break enabled, not implemented\n");
+ FIXME("soft break enabled, not implemented\n");
}
return add_eol;
}
@@ -1983,12 +1983,12 @@
return (HLOCAL)es->hloc16;
if (!(newBuf = LocalAlloc(LMEM_MOVEABLE, lstrlenA(es->text) + 1))) {
- ERR_(edit)("could not allocate new 32 bit buffer\n");
+ ERR("could not allocate new 32 bit buffer\n");
return 0;
}
newSize = MIN(LocalSize(newBuf) - 1, es->buffer_limit);
if (!(newText = LocalLock(newBuf))) {
- ERR_(edit)("could not lock new 32 bit buffer\n");
+ ERR("could not lock new 32 bit buffer\n");
LocalFree(newBuf);
return 0;
}
@@ -2001,7 +2001,7 @@
es->buffer_size = newSize;
es->text = newText;
EDIT_LockBuffer(wnd, es);
- TRACE_(edit)("switched to 32 bit local heap\n");
+ TRACE("switched to 32 bit local heap\n");
return es->hloc32;
}
@@ -2037,18 +2037,18 @@
if (!LOCAL_HeapSize(wnd->hInstance)) {
if (!LocalInit16(wnd->hInstance, 0,
GlobalSize16(wnd->hInstance))) {
- ERR_(edit)("could not initialize local heap\n");
+ ERR("could not initialize local heap\n");
return 0;
}
- TRACE_(edit)("local heap initialized\n");
+ TRACE("local heap initialized\n");
}
if (!(newBuf = LOCAL_Alloc(wnd->hInstance, LMEM_MOVEABLE, lstrlenA(es->text) + 1))) {
- ERR_(edit)("could not allocate new 16 bit buffer\n");
+ ERR("could not allocate new 16 bit buffer\n");
return 0;
}
newSize = MIN(LOCAL_Size(wnd->hInstance, newBuf) - 1, es->buffer_limit);
if (!(newText = LOCAL_Lock(wnd->hInstance, newBuf))) {
- ERR_(edit)("could not lock new 16 bit buffer\n");
+ ERR("could not lock new 16 bit buffer\n");
LOCAL_Free(wnd->hInstance, newBuf);
return 0;
}
@@ -2065,7 +2065,7 @@
es->buffer_size = newSize;
es->text = newText;
EDIT_LockBuffer(wnd, es);
- TRACE_(edit)("switched to 16 bit buffer\n");
+ TRACE("switched to 16 bit buffer\n");
return es->hloc16;
}
@@ -2567,7 +2567,7 @@
return;
if (!hloc) {
- WARN_(edit)("called with NULL handle\n");
+ WARN("called with NULL handle\n");
return;
}
@@ -2610,7 +2610,7 @@
return;
if (!hloc) {
- WARN_(edit)("called with NULL handle\n");
+ WARN("called with NULL handle\n");
return;
}
@@ -2689,7 +2689,7 @@
else
es->right_margin = es->char_width / 3;
}
- TRACE_(edit)("left=%d, right=%d\n", es->left_margin, es->right_margin);
+ TRACE("left=%d, right=%d\n", es->left_margin, es->right_margin);
}
@@ -2873,7 +2873,7 @@
lstrcpyA(utext, es->undo_text);
- TRACE_(edit)("before UNDO:insertion length = %d, deletion buffer = %s\n",
+ TRACE("before UNDO:insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, utext);
EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
@@ -2882,7 +2882,7 @@
EDIT_EM_SetSel(wnd, es, es->undo_position, es->undo_position + es->undo_insert_count, FALSE);
HeapFree(es->heap, 0, utext);
- TRACE_(edit)("after UNDO:insertion length = %d, deletion buffer = %s\n",
+ TRACE("after UNDO:insertion length = %d, deletion buffer = %s\n",
es->undo_insert_count, es->undo_text);
return TRUE;
@@ -2970,7 +2970,7 @@
EDIT_EM_ScrollCaret(wnd, es);
break;
default:
- ERR_(edit)("unknown menu item, please report\n");
+ ERR("unknown menu item, please report\n");
break;
}
}
@@ -3162,9 +3162,9 @@
LRESULT ret = 0;
if (!(es->flags & EF_HSCROLL_HACK)) {
- ERR_(edit)("hacked WM_HSCROLL handler invoked\n");
- ERR_(edit)(" if you are _not_ running 16 bit notepad, please report\n");
- ERR_(edit)(" (this message is only displayed once per edit control)\n");
+ ERR("hacked WM_HSCROLL handler invoked\n");
+ ERR(" if you are _not_ running 16 bit notepad, please report\n");
+ ERR(" (this message is only displayed once per edit control)\n");
es->flags |= EF_HSCROLL_HACK;
}
@@ -3219,7 +3219,7 @@
break;
default:
- ERR_(edit)("undocumented (hacked) WM_HSCROLL parameter, please report\n");
+ ERR("undocumented (hacked) WM_HSCROLL parameter, please report\n");
return 0;
}
if (dx)
@@ -3289,7 +3289,7 @@
break;
default:
- ERR_(edit)("undocumented WM_HSCROLL parameter, please report\n");
+ ERR("undocumented WM_HSCROLL parameter, please report\n");
return 0;
}
if (dx)
@@ -3872,10 +3872,10 @@
{
EDIT_EM_SetSel(wnd, es, 0, -1, FALSE);
if (text) {
- TRACE_(edit)("\t'%s'\n", text);
+ TRACE("\t'%s'\n", text);
EDIT_EM_ReplaceSel(wnd, es, FALSE, text);
} else {
- TRACE_(edit)("\t<NULL>\n");
+ TRACE("\t<NULL>\n");
EDIT_EM_ReplaceSel(wnd, es, FALSE, "");
}
es->x_offset = 0;
@@ -3961,9 +3961,9 @@
LRESULT ret = 0;
if (!(es->flags & EF_VSCROLL_HACK)) {
- ERR_(edit)("hacked WM_VSCROLL handler invoked\n");
- ERR_(edit)(" if you are _not_ running 16 bit notepad, please report\n");
- ERR_(edit)(" (this message is only displayed once per edit control)\n");
+ ERR("hacked WM_VSCROLL handler invoked\n");
+ ERR(" if you are _not_ running 16 bit notepad, please report\n");
+ ERR(" (this message is only displayed once per edit control)\n");
es->flags |= EF_VSCROLL_HACK;
}
@@ -4006,7 +4006,7 @@
break;
default:
- ERR_(edit)("undocumented (hacked) WM_VSCROLL parameter, please report\n");
+ ERR("undocumented (hacked) WM_VSCROLL parameter, please report\n");
return 0;
}
if (dy)
@@ -4063,8 +4063,8 @@
break;
default:
- ERR_(edit)("undocumented WM_VSCROLL action %d, please report\n",
- action);
+ ERR("undocumented WM_VSCROLL action %d, please report\n",
+ action);
return 0;
}
if (dy)