diff options
author | dgp <dgp@users.sourceforge.net> | 2009-02-11 15:28:41 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-02-11 15:28:41 (GMT) |
commit | 93480ff215923ba215001b05e93b3316e4742487 (patch) | |
tree | 31098b1bfe3bdb60aec45fe69f6aea57ba273956 | |
parent | bfcd65034eb86288bb554aef03df7c98101c3089 (diff) | |
download | tcl-93480ff215923ba215001b05e93b3316e4742487.zip tcl-93480ff215923ba215001b05e93b3316e4742487.tar.gz tcl-93480ff215923ba215001b05e93b3316e4742487.tar.bz2 |
* 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.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclStringObj.c | 4 | ||||
-rw-r--r-- | generic/tclUtf.c | 3 |
3 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,9 @@ +2009-02-11 Don Porter <dgp@users.sourceforge.net> + + * 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 <nijtmans@users.sf.net> * 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); |