From dc5c90f4a6e01534ffc03e64ca44c034c87a68df Mon Sep 17 00:00:00 2001 From: nijtmans Date: Tue, 7 Oct 2008 20:51:46 +0000 Subject: * tclWinTest.c: Fix compiler warning when compiling this file with mingw gcc: tclWinTest.c:706: warning: dereferencing type-punned pointer will break strict-aliasing rules * generic/tclLoad.c: Make sure that any library which doesn't have an unloadproc is only really unloaded when no library code is executed yet. [Bug 2059262] --- ChangeLog | 9 +++++++++ generic/tclLoad.c | 8 +++++--- win/tclWinTest.c | 8 ++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78a56d1..a7491f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-06 Jan Nijtmans + + * tclWinTest.c: Fix compiler warning when compiling this file with mingw gcc: + tclWinTest.c:706: warning: dereferencing type-punned pointer will break + strict-aliasing rules + * generic/tclLoad.c: Make sure that any library which doesn't have an + unloadproc is only really unloaded when no library code is executed + yet. [Bug 2059262] + 2008-10-06 Joe Mistachkin * tools/man2tcl.c: Added missing line from patch by Harald Oehlmann. diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 29e2d01..89e003c 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclLoad.c,v 1.16 2007/02/20 23:24:03 nijtmans Exp $ + * RCS: @(#) $Id: tclLoad.c,v 1.16.4.1 2008/10/07 20:51:46 nijtmans Exp $ */ #include "tclInt.h" @@ -795,7 +795,9 @@ Tcl_UnloadObjCmd( if (unLoadProcPtr != NULL) { Tcl_MutexLock(&packageMutex); - (*unLoadProcPtr)(pkgPtr->loadHandle); + if (pkgPtr->unloadProc != NULL) { + (*unLoadProcPtr)(pkgPtr->loadHandle); + } /* * Remove this library from the loaded library cache. @@ -1152,7 +1154,7 @@ TclFinalizeLoad(void) if (pkgPtr->fileName[0] != '\0') { Tcl_FSUnloadFileProc *unLoadProcPtr = pkgPtr->unLoadProcPtr; - if (unLoadProcPtr != NULL) { + if ((unLoadProcPtr != NULL) && (pkgPtr->unloadProc != NULL)) { (*unLoadProcPtr)(pkgPtr->loadHandle); } } diff --git a/win/tclWinTest.c b/win/tclWinTest.c index 946f179..adea787 100644 --- a/win/tclWinTest.c +++ b/win/tclWinTest.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinTest.c,v 1.22 2007/12/13 15:28:44 dgp Exp $ + * RCS: @(#) $Id: tclWinTest.c,v 1.22.2.1 2008/10/07 20:51:47 nijtmans Exp $ */ #include "tclInt.h" @@ -700,10 +700,10 @@ TestplatformChmod( acl_readOnly_found = FALSE; for (j = 0; j < ACLSize.AceCount; j++) { - PACL *pACE2; + LPVOID pACE2; ACE_HEADER *phACE2; - if (!getAceProc(curAcl, j, (LPVOID *) &pACE2)) { + if (!getAceProc(curAcl, j, &pACE2)) { goto done; } @@ -736,7 +736,7 @@ TestplatformChmod( * Copy the current ACE from the old to the new ACL. */ - if (!addAceProc(newAcl, ACL_REVISION, MAXDWORD, pACE2, + if (!addAceProc(newAcl, ACL_REVISION, MAXDWORD, (PACL *)pACE2, ((PACE_HEADER) pACE2)->AceSize)) { goto done; } -- cgit v0.12