From bf0b38b6c277f6eb5e802e443f042b16c3c82a23 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 8 Jun 2015 19:09:57 -0400 Subject: [PATCH] Revert "Set up basic logging." Not right now. This reverts commit 499bf2d00c0d7a5f712f0198ac1b2358d02eb6d5. --- TODO.md | 1 - redo/test/main.c | 10 +++++----- redo/test/page1.c | 2 +- redo/test/page4.c | 2 +- redo/ui.idl | 3 --- redo/windows/util.c | 15 --------------- 6 files changed, 7 insertions(+), 26 deletions(-) diff --git a/TODO.md b/TODO.md index 790ee5d8..efd24b1b 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,3 @@ -- refine logging - figure out how to deal with dchild at all, including preferred sizes - make OS X uiEntry width based on default in Interface Builder, not from sizeToFit - update state whenever setting parent diff --git a/redo/test/main.c b/redo/test/main.c index c651c267..dbb6291c 100644 --- a/redo/test/main.c +++ b/redo/test/main.c @@ -15,14 +15,14 @@ void die(const char *fmt, ...) int onClosing(uiWindow *w, void *data) { - uiLog("[test program] in onClosing()\n"); + printf("in onClosing()\n"); uiQuit(); return 1; } int onShouldQuit(void *data) { - uiLog("[test program] in onShouldQuit()\n"); + printf("in onShouldQuit()\n"); if (uiMenuItemChecked(shouldQuitItem)) { uiControlDestroy(uiControl(data)); return 1; @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) w = newWindow("Main Window", 320, 240, 1); uiWindowOnClosing(w, onClosing, NULL); - uiLog("[test program] main window %p\n", w); + printf("main window %p\n", w); uiOnShouldQuit(onShouldQuit, w); @@ -103,8 +103,8 @@ int main(int argc, char *argv[]) uiControlShow(uiControl(w)); uiMain(); - uiLog("[test program] after uiMain()\n"); + printf("after uiMain()\n"); uiUninit(); - uiLog("[test program] after uiUninit()\n"); + printf("after uiUninit()\n"); return 0; } diff --git a/redo/test/page1.c b/redo/test/page1.c index 29aaf945..2115ba26 100644 --- a/redo/test/page1.c +++ b/redo/test/page1.c @@ -27,7 +27,7 @@ TEXT(Group, uiGroup, uiGroupTitle, uiGroupSetTitle) static void onChanged(uiEntry *e, void *data) { - uiLog("[test program] onChanged()\n"); + printf("onChanged()\n"); } static void toggleSpaced(uiCheckbox *c, void *data) diff --git a/redo/test/page4.c b/redo/test/page4.c index 341d1493..a68153c0 100644 --- a/redo/test/page4.c +++ b/redo/test/page4.c @@ -9,7 +9,7 @@ static uiProgressBar *pbar; static void on ## what ## Changed(ui ## what *this, void *data) \ { \ uintmax_t value; \ - uiLog("[test program] on %s changed\n", #what); \ + printf("on %s changed\n", #what); \ value = ui ## what ## Value(this); \ uiSpinboxSetValue(spinbox, value); \ uiSliderSetValue(slider, value); \ diff --git a/redo/ui.idl b/redo/ui.idl index afc34f12..dd83fa3e 100644 --- a/redo/ui.idl +++ b/redo/ui.idl @@ -28,9 +28,6 @@ func OnShouldQuit(f *func(data *void) int, data *void); func FreeText(text *char); -// TODO add ... to IDL -raw "_UI_EXTERN void uiLog(const char *format, ...);"; - func RegisterType(name *const char, parent uintmax_t, size size_t) uintmax_t; func IsA(p *void, type uintmax_t, fail int) *void; struct Typed { diff --git a/redo/windows/util.c b/redo/windows/util.c index 8011a1ae..eb5a0e30 100644 --- a/redo/windows/util.c +++ b/redo/windows/util.c @@ -34,21 +34,6 @@ int windowClassOf(HWND hwnd, ...) return -1; } -// TODO refine this -void uiLog(const char *fmt, ...) -{ - va_list ap; - char buf[2048]; - - va_start(ap, fmt); - vsnprintf(buf, 2044, fmt, ap); - va_end(ap); - // unfortunately we need to make sure this is callable even before uiInit() executes or after uiUninit() has executed - // that means we can't use toUTF16(), because that requires our private heap - // sadly that means we're stuck with OutputDebugStringA() without some serious refinement - OutputDebugStringA(buf); -} - void complain(const char *fmt, ...) { va_list ap;