summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-12-20 22:16:33 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-12-20 22:16:33 (GMT)
commit10d55ac03132aa4b7caa60831c65e2c9c483f573 (patch)
treeed238ed8e932adcc46cb8972fdd31a62906cf02d
parent0fcea2c01171ef4f697d53c90bede2b315d49dd6 (diff)
downloadtcl-10d55ac03132aa4b7caa60831c65e2c9c483f573.zip
tcl-10d55ac03132aa4b7caa60831c65e2c9c483f573.tar.gz
tcl-10d55ac03132aa4b7caa60831c65e2c9c483f573.tar.bz2
Use %ld instead of %d in Tcl_GetMemoryInfo
-rw-r--r--ChangeLog5
-rwxr-xr-xgeneric/tclThreadAlloc.c18
2 files changed, 14 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 9716b22..e4ec9c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-20 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+
+ * generic/tclThreadAlloc.c (Tcl_GetMemoryInfo): Format values as longs
+ and not ints, so they are less likely to wrap on 64-bit machines.
+
2005-12-19 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* doc/Tcl.n: Clarify what is going on in variable substitution
diff --git a/generic/tclThreadAlloc.c b/generic/tclThreadAlloc.c
index 6b02906..69f0e9f 100755
--- a/generic/tclThreadAlloc.c
+++ b/generic/tclThreadAlloc.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclThreadAlloc.c,v 1.4.2.6 2005/04/07 11:27:17 vasiljevic Exp $
+ * RCS: @(#) $Id: tclThreadAlloc.c,v 1.4.2.7 2005/12/20 22:16:34 dkf Exp $
*/
#include "tclInt.h"
@@ -90,12 +90,12 @@ typedef struct Block {
typedef struct Bucket {
Block *firstPtr;
- int nfree;
- int nget;
- int nput;
- int nwait;
- int nlock;
- int nrequest;
+ long nfree;
+ long nget;
+ long nput;
+ long nwait;
+ long nlock;
+ long nrequest;
} Bucket;
/*
@@ -637,8 +637,8 @@ Tcl_GetMemoryInfo(Tcl_DString *dsPtr)
Tcl_DStringAppendElement(dsPtr, buf);
}
for (n = 0; n < NBUCKETS; ++n) {
- sprintf(buf, "%d %d %d %d %d %d %d",
- (int) binfo[n].blocksize,
+ sprintf(buf, "%lu %ld %ld %ld %ld %ld %ld",
+ (unsigned long) binfo[n].blocksize,
cachePtr->buckets[n].nfree,
cachePtr->buckets[n].nget,
cachePtr->buckets[n].nput,