summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclBinary.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 2b0bb9a..b44769a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2001-08-23 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+ * generic/tclBinary.c (FormatNumber): Extract a long from the
+ object and not an int, to stop [binary format] from being unable
+ to format some input numbers on architectures where sizeof(int) is
+ less than sizeof(long) (particularly Alpha.) [Bug #441861]
+
* tests/format.test: Converted conditional execution of tests into
a test constraint.
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index e0facb5..9fd9f4d 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBinary.c,v 1.7 2001/04/04 16:07:20 kennykb Exp $
+ * RCS: @(#) $Id: tclBinary.c,v 1.8 2001/08/23 14:22:49 dkf Exp $
*/
#include <math.h>
@@ -1393,7 +1393,7 @@ FormatNumber(interp, type, src, cursorPtr)
Tcl_Obj *src; /* Number to format. */
unsigned char **cursorPtr; /* Pointer to index into destination buffer. */
{
- int value;
+ long value;
double dvalue;
if ((type == 'd') || (type == 'f')) {
@@ -1426,7 +1426,7 @@ FormatNumber(interp, type, src, cursorPtr)
*cursorPtr += sizeof(float);
}
} else {
- if (Tcl_GetIntFromObj(interp, src, &value) != TCL_OK) {
+ if (Tcl_GetLongFromObj(interp, src, &value) != TCL_OK) {
return TCL_ERROR;
}
if (type == 'c') {