summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvText.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2005-11-17 10:57:35 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2005-11-17 10:57:35 (GMT)
commit7035fc87adb344a188869752f50282301f73548d (patch)
tree551a8431a7603d8f0d73f739344653f03f7c3a35 /generic/tkCanvText.c
parenta73f450fb85d87cd248b7be23ba14bd736956fbc (diff)
downloadtk-7035fc87adb344a188869752f50282301f73548d.zip
tk-7035fc87adb344a188869752f50282301f73548d.tar.gz
tk-7035fc87adb344a188869752f50282301f73548d.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;