summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvText.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-11-17 10:57:35 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-11-17 10:57:35 (GMT)
commitade22ba319d8ff4395c82135981cc073804ce97a (patch)
tree551a8431a7603d8f0d73f739344653f03f7c3a35 /generic/tkCanvText.c
parent3857560b944b318c14b18b5105c6e25d169bb9a6 (diff)
downloadtk-ade22ba319d8ff4395c82135981cc073804ce97a.zip
tk-ade22ba319d8ff4395c82135981cc073804ce97a.tar.gz
tk-ade22ba319d8ff4395c82135981cc073804ce97a.tar.bz2
Lots of ANSIfying of function decls.
Also a few spots where code has been cleaned up more completely.
Diffstat (limited to 'generic/tkCanvText.c')
-rw-r--r--generic/tkCanvText.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index 05ff604..2cfa782 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvText.c,v 1.19 2005/11/04 15:23:05 dkf Exp $
+ * RCS: @(#) $Id: tkCanvText.c,v 1.20 2005/11/17 10:57:35 dkf Exp $
*/
#include <stdio.h>
@@ -899,7 +899,7 @@ TextInsert(
{
TextItem *textPtr = (TextItem *) itemPtr;
int byteIndex, byteCount, charsAdded;
- char *new, *text;
+ char *newStr, *text;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
string = Tcl_GetStringFromObj((Tcl_Obj *) string, &byteCount);
@@ -918,13 +918,13 @@ TextInsert(
return;
}
- new = (char *) ckalloc((unsigned) textPtr->numBytes + byteCount + 1);
- memcpy(new, text, (size_t) byteIndex);
- strcpy(new + byteIndex, string);
- strcpy(new + byteIndex + byteCount, text + byteIndex);
+ newStr = (char *) ckalloc((unsigned) textPtr->numBytes + byteCount + 1);
+ memcpy(newStr, text, (size_t) byteIndex);
+ strcpy(newStr + byteIndex, string);
+ strcpy(newStr + byteIndex + byteCount, text + byteIndex);
ckfree(text);
- textPtr->text = new;
+ textPtr->text = newStr;
charsAdded = Tcl_NumUtfChars(string, byteCount);
textPtr->numChars += charsAdded;
textPtr->numBytes += byteCount;
@@ -980,7 +980,7 @@ TextDeleteChars(
{
TextItem *textPtr = (TextItem *) itemPtr;
int byteIndex, byteCount, charsRemoved;
- char *new, *text;
+ char *newStr, *text;
Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
text = textPtr->text;
@@ -999,12 +999,12 @@ TextDeleteChars(
byteCount = Tcl_UtfAtIndex(text + byteIndex, charsRemoved)
- (text + byteIndex);
- new = (char *) ckalloc((unsigned) (textPtr->numBytes + 1 - byteCount));
- memcpy(new, text, (size_t) byteIndex);
- strcpy(new + byteIndex, text + byteIndex + byteCount);
+ newStr = (char *) ckalloc((unsigned) (textPtr->numBytes + 1 - byteCount));
+ memcpy(newStr, text, (size_t) byteIndex);
+ strcpy(newStr + byteIndex, text + byteIndex + byteCount);
ckfree(text);
- textPtr->text = new;
+ textPtr->text = newStr;
textPtr->numChars -= charsRemoved;
textPtr->numBytes -= byteCount;