diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2002-07-11 13:53:58 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2002-07-11 13:53:58 (GMT) |
commit | 43c49d4d334650878eb8ab860583b9620bb4e218 (patch) | |
tree | 522730c12095f3a8c46a99b384c3facdf8d6f6b0 | |
parent | 27a219b98b878a7dc6e7f1a88c45724c61fb27eb (diff) | |
download | tcl-43c49d4d334650878eb8ab860583b9620bb4e218.zip tcl-43c49d4d334650878eb8ab860583b9620bb4e218.tar.gz tcl-43c49d4d334650878eb8ab860583b9620bb4e218.tar.bz2 |
ckalloc() et al take 'unsigned int' sizes, so print them with '%ud' not '%d'
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclCkalloc.c | 16 |
2 files changed, 14 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2002-07-11 Donal K. Fellows <fellowsd@cs.man.ac.uk> + + * generic/tclCkalloc.c: ckalloc() and friends take the block size + as an unsigned, so we should use %ud when reporting it in fprintf() + and panic(). + 2002-07-11 Miguel Sofer <msofer@users.sourceforge.net> * generic/tclCompile.c: now setting local vars undefined at diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 434df51..4a6c279 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -13,7 +13,7 @@ * * This code contributed by Karl Lehenbauer and Mark Diekhans * - * RCS: @(#) $Id: tclCkalloc.c,v 1.15 2002/01/25 20:40:55 dgp Exp $ + * RCS: @(#) $Id: tclCkalloc.c,v 1.16 2002/07/11 13:53:59 dkf Exp $ */ #include "tclInt.h" @@ -378,7 +378,7 @@ Tcl_DbCkalloc(size, file, line) if (result == NULL) { fflush(stdout); TclDumpMemoryInfo(stderr); - panic("unable to alloc %d bytes, %s line %d", size, file, line); + panic("unable to alloc %ud bytes, %s line %d", size, file, line); } /* @@ -422,7 +422,7 @@ Tcl_DbCkalloc(size, file, line) } if (alloc_tracing) - fprintf(stderr,"ckalloc %lx %d %s %d\n", + fprintf(stderr,"ckalloc %lx %ud %s %d\n", (long unsigned int) result->body, size, file, line); if (break_on_malloc && (total_mallocs >= break_on_malloc)) { @@ -507,7 +507,7 @@ Tcl_AttemptDbCkalloc(size, file, line) } if (alloc_tracing) - fprintf(stderr,"ckalloc %lx %d %s %d\n", + fprintf(stderr,"ckalloc %lx %ud %s %d\n", (long unsigned int) result->body, size, file, line); if (break_on_malloc && (total_mallocs >= break_on_malloc)) { @@ -1010,7 +1010,7 @@ Tcl_Alloc (size) * a special pointer on failure, but we only check for NULL */ if ((result == NULL) && size) { - panic("unable to alloc %d bytes", size); + panic("unable to alloc %ud bytes", size); } return result; } @@ -1027,7 +1027,7 @@ Tcl_DbCkalloc(size, file, line) if ((result == NULL) && size) { fflush(stdout); - panic("unable to alloc %d bytes, %s line %d", size, file, line); + panic("unable to alloc %ud bytes, %s line %d", size, file, line); } return result; } @@ -1085,7 +1085,7 @@ Tcl_Realloc(ptr, size) result = TclpRealloc(ptr, size); if ((result == NULL) && size) { - panic("unable to realloc %d bytes", size); + panic("unable to realloc %ud bytes", size); } return result; } @@ -1103,7 +1103,7 @@ Tcl_DbCkrealloc(ptr, size, file, line) if ((result == NULL) && size) { fflush(stdout); - panic("unable to realloc %d bytes, %s line %d", size, file, line); + panic("unable to realloc %ud bytes, %s line %d", size, file, line); } return result; } |