From 0c8fe75ed181d03b7bc9b547b0afdbb54094ec09 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 10 Jun 2008 00:57:20 +0000 Subject: [PATCH] --- ase/cmd/awk/awk.c | 33 --------------------------------- ase/cmd/lsp/lsp.c | 34 ---------------------------------- ase/lib/utl/assert.c | 23 +++++++++-------------- 3 files changed, 9 insertions(+), 81 deletions(-) diff --git a/ase/cmd/awk/awk.c b/ase/cmd/awk/awk.c index 0cd03860..c4a73408 100644 --- a/ase/cmd/awk/awk.c +++ b/ase/cmd/awk/awk.c @@ -45,39 +45,6 @@ struct mmgr_data_t }; #endif -#ifndef NDEBUG -void ase_assert_abort (void) -{ - abort (); -} - -void ase_assert_printf (const ase_char_t* fmt, ...) -{ - va_list ap; -#ifdef _WIN32 - int n; - ase_char_t buf[1024]; -#endif - - va_start (ap, fmt); -#if defined(_WIN32) - n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap); - if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0'); - - #if defined(_MSC_VER) && (_MSC_VER<1400) - MessageBox (NULL, buf, - ASE_T("Assertion Failure"), MB_OK|MB_ICONERROR); - #else - MessageBox (NULL, buf, - ASE_T("\uB2DD\uAE30\uB9AC \uC870\uB610"), MB_OK|MB_ICONERROR); - #endif -#else - ase_vprintf (fmt, ap); -#endif - va_end (ap); -} -#endif - static void local_dprintf (const ase_char_t* fmt, ...) { va_list ap; diff --git a/ase/cmd/lsp/lsp.c b/ase/cmd/lsp/lsp.c index 190b839a..3cf29da7 100644 --- a/ase/cmd/lsp/lsp.c +++ b/ase/cmd/lsp/lsp.c @@ -28,40 +28,6 @@ #include #endif -#ifndef NDEBUG -void ase_assert_abort (void) -{ - abort (); -} - -void ase_assert_printf (const ase_char_t* fmt, ...) -{ - va_list ap; -#ifdef _WIN32 - int n; - ase_char_t buf[1024]; -#endif - - va_start (ap, fmt); -#if defined(_WIN32) - n = _vsntprintf (buf, ASE_COUNTOF(buf), fmt, ap); - if (n < 0) buf[ASE_COUNTOF(buf)-1] = ASE_T('\0'); - - #if defined(_MSC_VER) && (_MSC_VER<1400) - MessageBox (NULL, buf, - ASE_T("Assertion Failure"), MB_OK|MB_ICONERROR); - #else - MessageBox (NULL, buf, - ASE_T("\uB2DD\uAE30\uB9AC \uC870\uB610"), MB_OK|MB_ICONERROR); - #endif -#else - ase_vprintf (fmt, ap); -#endif - va_end (ap); -} -#endif - - static ase_ssize_t get_input ( int cmd, void* arg, ase_char_t* data, ase_size_t size) { diff --git a/ase/lib/utl/assert.c b/ase/lib/utl/assert.c index e3432a26..2382cee7 100644 --- a/ase/lib/utl/assert.c +++ b/ase/lib/utl/assert.c @@ -1,5 +1,5 @@ /* - * $Id: assert.c 200 2008-06-09 06:49:17Z baconevi $ + * $Id: assert.c 201 2008-06-09 06:57:20Z baconevi $ */ #include @@ -14,21 +14,16 @@ void ase_assert_failed ( const ase_char_t* expr, const ase_char_t* desc, const ase_char_t* file, ase_size_t line) { - if (desc == ASE_NULL) - { - ase_fprintf ( - ASE_STDERR, - ASE_T("ASSERTION FAILURE AT FILE %s LINE %lu\n%s\n"), - file, (unsigned long)line, expr); - } - else - { - ase_fprintf ( - ASE_STDERR, - ASE_T("ASSERTION FAILURE AT FILE %s LINE %lu\n%s\n\nDESCRIPTION:\n%s\n"), - file, (unsigned long)line, expr, desc); + ase_fprintf (ASE_STDERR, ASE_T("=[ASSERTION FAILURE]============================================================")); + ase_fprintf (ASE_STDERR, ASE_T("FILE %s LINE %lu: %s\n"), + file, (unsigned long)line, expr); + if (desc != ASE_NULL) + { + ase_fprintf (ASE_STDERR, ASE_T("DESCRIPTION: %s\n"), + file, (unsigned long)line, expr, desc); } + ase_fprintf (ASE_STDERR, ASE_T("================================================================================")); abort (); }