From 55d6a6f1556c91507706bd8a708cd87721a2ab0f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 11 Oct 2024 11:48:45 +0000 Subject: [PATCH] Add comment. Backported some indenting/spacing --- generic/tkError.c | 7 +++++-- tests/font.test | 2 +- tests/wm.test | 4 ++-- unix/installManPage | 4 ++-- unix/tkUnixInit.c | 4 ++-- unix/tkUnixKey.c | 18 +++++++++--------- xlib/xcolors.c | 10 +++++----- 7 files changed, 26 insertions(+), 23 deletions(-) diff --git a/generic/tkError.c b/generic/tkError.c index 89857e6ad9..0036b7eb3e 100644 --- a/generic/tkError.c +++ b/generic/tkError.c @@ -152,6 +152,11 @@ Tk_DeleteErrorHandler( errorPtr->lastRequest = NextRequest(dispPtr->display) - 1; + /* + * Ensure that no user callback for this handler is invoked any further. + */ + errorPtr->errorProc = NULL; + /* * Every once-in-a-while, cleanup handlers that are no longer active. We * probably won't be able to free the handler that was just deleted (need @@ -164,8 +169,6 @@ Tk_DeleteErrorHandler( * there are many handlers that stay around forever). */ - errorPtr->errorProc = NULL; - if (dispPtr->deleteCount++ >= 9) { TkErrorHandler *prevPtr; TkErrorHandler *nextPtr; diff --git a/tests/font.test b/tests/font.test index a779aca566..dba2812383 100644 --- a/tests/font.test +++ b/tests/font.test @@ -42,7 +42,7 @@ wm geom .t +0+0 update idletasks switch [tk windowingsystem] { - x11 {set fixed "TkFixedFont"} + x11 {set fixed "TkFixedFont"} win32 {set fixed "courier 12"} aqua {set fixed "monaco 9"} } diff --git a/tests/wm.test b/tests/wm.test index 5542f14bf9..c09ad816a1 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -1921,7 +1921,7 @@ test wm-transient-7.4 {Reassign transient, destroy new toplevel} -body { toplevel .transient wm transient .transient .t1 wm transient .transient .t2 - destroy .t2 ;# caused panic in 8.4b1 + destroy .t2 ;# caused panic in 8.4b1 destroy .t1 destroy .transient } -cleanup { @@ -1934,7 +1934,7 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body { wm transient .transient .t1 wm transient .transient .t2 destroy .transient - destroy .t2 ;# caused panic in 8.4b1 + destroy .t2 ;# caused panic in 8.4b1 destroy .t1 ;# so did this } -cleanup { deleteWindows diff --git a/unix/installManPage b/unix/installManPage index 1e29bb027b..f2e2f53b2d 100755 --- a/unix/installManPage +++ b/unix/installManPage @@ -12,8 +12,8 @@ Suffix="" while true; do case $1 in - -s | --symlinks ) Sym="-s " ;; - -z | --compress ) Gzip=$2; shift ;; + -s | --symlinks ) Sym="-s " ;; + -z | --compress ) Gzip=$2; shift ;; -e | --extension ) Gz=$2; shift ;; -x | --suffix ) Suffix=$2; shift ;; -*) cat <charValuePtr != NULL) { Tcl_DStringSetLength(dsPtr, kePtr->charValueLen); memcpy(Tcl_DStringValue(dsPtr), kePtr->charValuePtr, - (unsigned) kePtr->charValueLen+1); + kePtr->charValueLen+1); return Tcl_DStringValue(dsPtr); } @@ -178,7 +178,7 @@ TkpGetString( Tcl_DStringSetLength(&buf, TCL_DSTRING_STATIC_SIZE-1); len = XmbLookupString(winPtr->inputContext, &eventPtr->xkey, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf), - &kePtr->keysym, &status); + &kePtr->keysym, &status); /* * If the buffer wasn't big enough, grow the buffer and try again. @@ -235,9 +235,9 @@ TkpGetString( */ done: - kePtr->charValuePtr = ckalloc(len + 1); + kePtr->charValuePtr = (char *)ckalloc(len + 1); kePtr->charValueLen = len; - memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), (unsigned) len + 1); + memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), len + 1); return Tcl_DStringValue(dsPtr); } @@ -331,7 +331,7 @@ TkpGetKeySym( */ if (eventPtr->xkey.keycode > 0xff) { - return NoSymbol; + return NoSymbol; } /* @@ -381,7 +381,6 @@ TkpGetKeySym( && (eventPtr->xkey.state & LockMask))) { index += 1; } - sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0, index); @@ -444,7 +443,8 @@ TkpInitKeymapInfo( XModifierKeymap *modMapPtr; KeyCode *codePtr; KeySym keysym; - int count, i, j, max, arraySize; + int count, i, max; + int j, arraySize; #define KEYCODE_ARRAY_SIZE 20 dispPtr->bindInfoStale = 0; @@ -510,7 +510,7 @@ TkpInitKeymapInfo( } dispPtr->numModKeyCodes = 0; arraySize = KEYCODE_ARRAY_SIZE; - dispPtr->modKeyCodes = ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); + dispPtr->modKeyCodes = (KeyCode *)ckalloc(KEYCODE_ARRAY_SIZE * sizeof(KeyCode)); for (i = 0, codePtr = modMapPtr->modifiermap; i < max; i++, codePtr++) { if (*codePtr == 0) { continue; @@ -537,7 +537,7 @@ TkpInitKeymapInfo( */ arraySize *= 2; - newCodes = ckalloc(arraySize * sizeof(KeyCode)); + newCodes = (KeyCode *)ckalloc(arraySize * sizeof(KeyCode)); memcpy(newCodes, dispPtr->modKeyCodes, dispPtr->numModKeyCodes * sizeof(KeyCode)); ckfree(dispPtr->modKeyCodes); diff --git a/xlib/xcolors.c b/xlib/xcolors.c index f4ffe31cb9..d26d85a832 100644 --- a/xlib/xcolors.c +++ b/xlib/xcolors.c @@ -306,7 +306,7 @@ colorcmp( c += 'a' - 'A'; } else if (((unsigned)(c - '1') <= (unsigned)('9' - '1'))) { if (d == '0') { - d += 10; + d += 10; } else if (!d) { num = c - '0'; while ((unsigned)((c = *spec++) - '0') <= (unsigned)('9' - '0')) { @@ -336,8 +336,8 @@ colorcmp( Status XParseColor( - Display *display, - Colormap map, + TCL_UNUSED(Display *), + TCL_UNUSED(Colormap), const char *spec, XColor *colorPtr) { @@ -414,11 +414,11 @@ XParseColor( } if (num > (*p)[31]) { if (((*p)[31] != 8) || num > 100) { - return 0; + return 0; } num = (num * 255 + 50) / 100; if ((num == 230) || (num == 128)) { - /* + /* * Those two entries have a deviation i.r.t the table. */