From 02e1cf97bd71fea4171adaed0ccfd7f19ffdbbaf Mon Sep 17 00:00:00 2001 From: mdejong Date: Fri, 17 Jan 2003 22:10:43 +0000 Subject: * generic/tcl.h: Revert earlier change that defined TCL_WIDE_INT_TYPE as long long and TCL_LL_MODIFIER as L when compiling with mingw. This change ended up causing some test case failures when compiling with mingw. * generic/tclObj.c (UpdateStringOfWideInt): Describe the warning generated by mingw and why it needs to be ignored so that someone is not tempted to "fix" this problem again in the future. --- ChangeLog | 13 +++++++++++++ generic/tcl.h | 4 ++-- generic/tclObj.c | 8 +++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f3c070..3d3cdd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-01-17 Mo DeJong + + * generic/tcl.h: Revert earlier change that + defined TCL_WIDE_INT_TYPE as long long and + TCL_LL_MODIFIER as L when compiling with + mingw. This change ended up causing some + test case failures when compiling with mingw. + * generic/tclObj.c (UpdateStringOfWideInt): + Describe the warning generated by mingw and + why it needs to be ignored so that someone + is not tempted to "fix" this problem again + in the future. + 2003-01-16 Vince Darley * generic/tclStringObj.c: Tcl_SetObjLength fix for when diff --git a/generic/tcl.h b/generic/tcl.h index 7a6fd2a..0c60153 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tcl.h,v 1.150 2003/01/14 02:06:10 mdejong Exp $ + * RCS: @(#) $Id: tcl.h,v 1.151 2003/01/17 22:10:56 mdejong Exp $ */ #ifndef _TCL @@ -353,7 +353,7 @@ typedef long LONG; */ #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG) -# if defined(__CYGWIN__) || defined(__MINGW32__) +# if defined(__CYGWIN__) # define TCL_WIDE_INT_TYPE long long # define TCL_LL_MODIFIER "L" typedef struct stat Tcl_StatBuf; diff --git a/generic/tclObj.c b/generic/tclObj.c index 8200cf3..f9cee12 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.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: tclObj.c,v 1.41 2002/11/19 02:34:50 hobbs Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.42 2003/01/17 22:11:02 mdejong Exp $ */ #include "tclInt.h" @@ -2257,6 +2257,12 @@ UpdateStringOfWideInt(objPtr) register unsigned len; register Tcl_WideInt wideVal = objPtr->internalRep.wideValue; + /* + * Note that sprintf will generate a compiler warning under + * Mingw claiming %I64 is an unknown format specifier. + * Just ignore this warning. We can't use %L as the format + * specifier since that gets printed as a 32 bit value. + */ sprintf(buffer, "%" TCL_LL_MODIFIER "d", wideVal); len = strlen(buffer); objPtr->bytes = ckalloc((unsigned) len + 1); -- cgit v0.12