From 93480ff215923ba215001b05e93b3316e4742487 Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 11 Feb 2009 15:28:41 +0000 Subject: * generic/tclStringObj.c: Changed type of the 'allocated' field of the String struct from size_t to int since only int values are ever stored in it. --- ChangeLog | 6 ++++++ generic/tclStringObj.c | 4 ++-- generic/tclUtf.c | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 556116a..af98add 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-11 Don Porter + + * generic/tclStringObj.c: Changed type of the 'allocated' field + of the String struct from size_t to int since only int values are + ever stored in it. + 2009-02-10 Jan Nijtmans * generic/tclEncoding.c Eliminate some unnessary type casts diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index b2dd292..3fa8528 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -33,7 +33,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStringObj.c,v 1.95 2009/02/10 23:09:05 nijtmans Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.96 2009/02/11 15:28:56 dgp Exp $ */ #include "tclInt.h" #include "tommath.h" @@ -94,7 +94,7 @@ typedef struct String { * means that there is a valid Unicode rep, or * that the number of UTF bytes == the number * of chars. */ - size_t allocated; /* The amount of space actually allocated for + int allocated; /* The amount of space actually allocated for * the UTF string (minus 1 byte for the * termination char). */ size_t uallocated; /* The amount of space actually allocated for diff --git a/generic/tclUtf.c b/generic/tclUtf.c index aed3ff7..16acab2 100644 --- a/generic/tclUtf.c +++ b/generic/tclUtf.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtf.c,v 1.38 2008/04/27 22:21:33 dkf Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.39 2009/02/11 15:28:59 dgp Exp $ */ #include "tclInt.h" @@ -417,6 +417,7 @@ Tcl_UtfToUniCharDString( */ oldLength = Tcl_DStringLength(dsPtr); +/* TODO: fix overreach! */ Tcl_DStringSetLength(dsPtr, (int) ((oldLength + length + 1) * sizeof(Tcl_UniChar))); wString = (Tcl_UniChar *) (Tcl_DStringValue(dsPtr) + oldLength); -- cgit v0.12