From a794c019fc0416aa27cb0dde1889e3486725aa4c Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 12 Jul 2011 16:05:43 +0000 Subject: platform portable type matching in debug prints --- generic/tclAssembly.c | 4 ++-- generic/tclCompile.c | 2 +- generic/tclExecute.c | 2 +- generic/tclObj.c | 8 ++++---- generic/tclPreserve.c | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 754941f..1b87886 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -1035,8 +1035,8 @@ TclAssembleCode( #ifdef TCL_COMPILE_DEBUG if ((tclTraceCompile >= 2) && (envPtr->procPtr == NULL)) { - printf(" %4d Assembling: ", - envPtr->codeNext - envPtr->codeStart); + printf(" %4ld Assembling: ", + (long)(envPtr->codeNext - envPtr->codeStart)); TclPrintSource(stdout, parsePtr->commandStart, TclMin(instLen, 55)); printf("\n"); diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 0eaf834..18679b2 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2468,7 +2468,7 @@ TclInitByteCodeObj( #else nextPtr = EncodeCmdLocMap(envPtr, codePtr, (unsigned char *) p); if (((size_t)(nextPtr - p)) != cmdLocBytes) { - Tcl_Panic("TclInitByteCodeObj: encoded cmd location bytes %d != expected size %d", (nextPtr - p), cmdLocBytes); + Tcl_Panic("TclInitByteCodeObj: encoded cmd location bytes %lu != expected size %lu", (unsigned long)(nextPtr - p), (unsigned long)cmdLocBytes); } #endif diff --git a/generic/tclExecute.c b/generic/tclExecute.c index fee096a..a7d6184 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -8441,7 +8441,7 @@ EvalStatsCmd( Tcl_AppendPrintfToObj(objPtr, "\n----------------------------------------------------------------\n"); Tcl_AppendPrintfToObj(objPtr, "Compilation and execution statistics for interpreter %#lx\n", - iPtr); + (long int)iPtr); Tcl_AppendPrintfToObj(objPtr, "\nNumber ByteCodes executed\t%ld\n", statsPtr->numExecutions); diff --git a/generic/tclObj.c b/generic/tclObj.c index 129d80d..95924c1 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -1330,7 +1330,7 @@ TclFreeObj( ObjInitDeletionContext(context); if (objPtr->refCount < -1) { - Tcl_Panic("Reference count for %lx was negative", objPtr); + Tcl_Panic("Reference count for %p was negative", objPtr); } /* @@ -3724,7 +3724,7 @@ Tcl_DbIncrRefCount( hPtr = Tcl_FindHashEntry(tablePtr, objPtr); if (!hPtr) { Tcl_Panic("%s%s", - "Trying to incr ref count of " + "Trying to incr ref count of ", "Tcl_Obj allocated in another thread"); } } @@ -3789,7 +3789,7 @@ Tcl_DbDecrRefCount( hPtr = Tcl_FindHashEntry(tablePtr, objPtr); if (!hPtr) { Tcl_Panic("%s%s", - "Trying to decr ref count of " + "Trying to decr ref count of ", "Tcl_Obj allocated in another thread"); } @@ -3868,7 +3868,7 @@ Tcl_DbIsShared( hPtr = Tcl_FindHashEntry(tablePtr, objPtr); if (!hPtr) { Tcl_Panic("%s%s", - "Trying to check shared status of" + "Trying to check shared status of", "Tcl_Obj allocated in another thread"); } } diff --git a/generic/tclPreserve.c b/generic/tclPreserve.c index cbd7b63..0bd8f93 100644 --- a/generic/tclPreserve.c +++ b/generic/tclPreserve.c @@ -368,10 +368,10 @@ TclHandleFree( handlePtr = (HandleStruct *) handle; #ifdef TCL_MEM_DEBUG if (handlePtr->refCount == 0x61616161) { - Tcl_Panic("using previously disposed TclHandle %x", handlePtr); + Tcl_Panic("using previously disposed TclHandle %p", handlePtr); } if (handlePtr->ptr2 != handlePtr->ptr) { - Tcl_Panic("someone has changed the block referenced by the handle %x\nfrom %x to %x", + Tcl_Panic("someone has changed the block referenced by the handle %p\nfrom %p to %p", handlePtr, handlePtr->ptr2, handlePtr->ptr); } #endif @@ -411,10 +411,10 @@ TclHandlePreserve( handlePtr = (HandleStruct *) handle; #ifdef TCL_MEM_DEBUG if (handlePtr->refCount == 0x61616161) { - Tcl_Panic("using previously disposed TclHandle %x", handlePtr); + Tcl_Panic("using previously disposed TclHandle %p", handlePtr); } if ((handlePtr->ptr != NULL) && (handlePtr->ptr != handlePtr->ptr2)) { - Tcl_Panic("someone has changed the block referenced by the handle %x\nfrom %x to %x", + Tcl_Panic("someone has changed the block referenced by the handle %p\nfrom %p to %p", handlePtr, handlePtr->ptr2, handlePtr->ptr); } #endif @@ -452,10 +452,10 @@ TclHandleRelease( handlePtr = (HandleStruct *) handle; #ifdef TCL_MEM_DEBUG if (handlePtr->refCount == 0x61616161) { - Tcl_Panic("using previously disposed TclHandle %x", handlePtr); + Tcl_Panic("using previously disposed TclHandle %p", handlePtr); } if ((handlePtr->ptr != NULL) && (handlePtr->ptr != handlePtr->ptr2)) { - Tcl_Panic("someone has changed the block referenced by the handle %x\nfrom %x to %x", + Tcl_Panic("someone has changed the block referenced by the handle %p\nfrom %p to %p", handlePtr, handlePtr->ptr2, handlePtr->ptr); } #endif -- cgit v0.12