From bbe4ec79f29531c217efeda1327237c482352a07 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 26 Dec 2009 10:24:04 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 5 +++-- config.h.in | 3 +++ configure | 17 +++++++++++++++++ configure.ac | 10 ++++++++++ doc/rxvt.7.pod | 9 +++++++-- src/Makefile.in | 4 +--- src/keyboard.C | 2 +- src/screen.C | 8 -------- src/version.h | 4 ++-- src/xdefaults.C | 4 ---- 10 files changed, 44 insertions(+), 22 deletions(-) diff --git a/Changes b/Changes index f98c7bc8..ad3cc399 100644 --- a/Changes +++ b/Changes @@ -19,8 +19,6 @@ WISH: load system-wide config file even if we don't have one WISH: look into XAddConnectionWatch, does anybody need that? DUMB: support tex fonts -TODO: exg-- patch -TODO: selection_beg/end should set screen, or so TODO: perl-shell-window? TODO: zweimal numlock? falsche codes rxvt urxvt for numpad? - port to glibc-2.10 changes (strchr etc. returning const char * @@ -60,6 +58,9 @@ TODO: zweimal numlock? falsche codes rxvt urxvt for numpad? - setting the selection from perl will now reset the selection screen to the current screen. the srceen can be manipulated using the new ->selection_screen method. + - implement --enable-assert configure option and get rid of DEBUG_STRICT + (based on patch by exg). + - upgrade to libev-3.9 prerelease. 9.06 Sat Nov 8 17:47:18 CET 2008 - NOTICE: this release updates terminfo/termcap. diff --git a/config.h.in b/config.h.in index 4b24a2c5..33c2758c 100644 --- a/config.h.in +++ b/config.h.in @@ -297,6 +297,9 @@ /* Define to use wheel events (button4 and button5) to scroll */ #undef MOUSE_WHEEL +/* Disable assertions (good for debugging) */ +#undef NDEBUG + /* Support NeXT style scrollbars */ #undef NEXT_SCROLLBAR diff --git a/configure b/configure index 3e4dbfe2..80b6de44 100755 --- a/configure +++ b/configure @@ -1296,6 +1296,7 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-everything enable standard non-multichoice features NOTE: this option is order dependent + --enable-assert enable assertions --enable-warnings turn on g++ warnings --enable-unicode3 use 21 instead of 16 bits to represent unicode characters --enable-combining enable composition of base and combining characters @@ -4455,6 +4456,22 @@ if test "${enable_everything+set}" = set; then fi +ASSERTIONS=no +# Check whether --enable-assert was given. +if test "${enable_assert+set}" = set; then + enableval=$enable_assert; if test x$enableval = xyes; then + ASSERTIONS=yes + fi +fi + +if test x$ASSERTIONS = xno; then + +cat >>confdefs.h <<\_ACEOF +#define NDEBUG 1 +_ACEOF + +fi + WARNINGS=no # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then diff --git a/configure.ac b/configure.ac index 050cd304..d7952de4 100644 --- a/configure.ac +++ b/configure.ac @@ -172,6 +172,16 @@ AC_ARG_ENABLE(everything, fi ]) +ASSERTIONS=no +AC_ARG_ENABLE(assert, + [ --enable-assert enable assertions], + [if test x$enableval = xyes; then + ASSERTIONS=yes + fi]) +if test x$ASSERTIONS = xno; then + AC_DEFINE(NDEBUG, 1, Disable assertions (good for debugging)) +fi + WARNINGS=no AC_ARG_ENABLE(warnings, [ --enable-warnings turn on g++ warnings], diff --git a/doc/rxvt.7.pod b/doc/rxvt.7.pod index 90065a21..2e48b30d 100644 --- a/doc/rxvt.7.pod +++ b/doc/rxvt.7.pod @@ -2261,8 +2261,8 @@ All =item --enable-everything -Add (or remove) support for all non-multichoice options listed in "./configure ---help". +Add (or remove) support for all non-multichoice options listed in +C<./configure --help>, except for C<--enable-assert>. You can specify this and then disable options you do not like by I this with the appropriate C<--disable-...> arguments, @@ -2520,6 +2520,11 @@ perl will I be initialised when all extensions have been disabled C<-pe "" --perl-ext-common "">, so it should be safe to enable from a resource standpoint. +=item --enable-assert (default: off) + +Enables the assertions in the code, normally disabled. This switch is only +useful when developing rxvt-unicode. + =item --with-afterimage-config=DIR Look for the libAfterImage config script in DIR. diff --git a/src/Makefile.in b/src/Makefile.in index 012bcf56..64006b80 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -21,14 +21,12 @@ DEFS = @DEFS@ LIBS = @LIBS@ XINC = @X_CFLAGS@ @AFTERIMAGE_CFLAGS@ XLIB = @X_LIBS@ @AFTERIMAGE_LIBS@ -lX11 @X_EXTRA_LIBS@ -COMPILE = $(CXX) -I.. -I$(srcdir) -I. -I$(srcdir)/../libev $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(DEBUG) $(XINC) +COMPILE = $(CXX) -I.. -I$(srcdir) -I. -I$(srcdir)/../libev $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(XINC) LINK = @LINKER@ $(LDFLAGS) srcdir = @srcdir@ VPATH = @srcdir@ -DEBUG=-DDEBUG_STRICT - first_rule: all dummy: diff --git a/src/keyboard.C b/src/keyboard.C index 818773c5..4c224929 100644 --- a/src/keyboard.C +++ b/src/keyboard.C @@ -428,7 +428,7 @@ keyboard_manager::setup_hash () keymap.swap (sorted_keymap); -#ifdef DEBUG_STRICT +#ifndef NDEBUG // check for invariants for (i = 0; i < KEYSYM_HASH_BUDGETS; ++i) { diff --git a/src/screen.C b/src/screen.C index a4a14c5b..6c60c45a 100644 --- a/src/screen.C +++ b/src/screen.C @@ -288,9 +288,7 @@ rxvt_term::scr_reset () do { p = MOD (p - 1, prev_total_rows); -#ifdef DEBUG_STRICT assert (old_buf [MOD (p, prev_total_rows)].t); -#endif int plines = 1; int llen = old_buf [MOD (p, prev_total_rows)].l; @@ -512,10 +510,8 @@ rxvt_term::scr_cursor (cursor_mode mode) NOTHROW /* boundary check in case screen size changed between SAVE and RESTORE */ min_it (s->cur.row, nrow - 1); min_it (s->cur.col, ncol - 1); -#ifdef DEBUG_STRICT assert (s->cur.row >= 0); assert (s->cur.col >= 0); -#endif } void @@ -785,11 +781,9 @@ rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW } } -#ifdef DEBUG_STRICT assert (screen.cur.col < ncol); assert (screen.cur.row < nrow && screen.cur.row >= top_row); -#endif int row = screen.cur.row; checksel = selection.op && current_screen == selection.screen ? 1 : 0; @@ -1003,9 +997,7 @@ rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) NOTHROW max_it (line->l, screen.cur.col); -#ifdef DEBUG_STRICT assert (screen.cur.row >= 0); -#endif } /* ------------------------------------------------------------------------- */ diff --git a/src/version.h b/src/version.h index 8b8d769b..37d35271 100644 --- a/src/version.h +++ b/src/version.h @@ -1,3 +1,3 @@ // VERSION _must_ be \d.\d+ -#define VERSION "9.06" -#define DATE "2008-06-15" +#define VERSION "9.07" +#define DATE "2009-12-27" diff --git a/src/xdefaults.C b/src/xdefaults.C index 97bf4c74..4717dd48 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -403,9 +403,7 @@ rxvt_usage (int type) if (optList[i].arg) len = strlen (optList[i].arg) + 1; -#ifdef DEBUG_STRICT assert (optList[i].opt != NULL); -#endif len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2: 0); col += len; if (col > 79) @@ -429,9 +427,7 @@ rxvt_usage (int type) for (i = 0; i < optList_size; i++) if (optList[i].desc != NULL) { -#ifdef DEBUG_STRICT assert (optList[i].opt != NULL); -#endif rxvt_log (" %s%s %-*s%s%s\n", (optList_isBool (i) ? "-/+" : "-"), optList[i].opt, (INDENT - strlen (optList[i].opt) -- 2.34.1