summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkEntry.c
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2007-01-11 19:59:26 (GMT)
committerjenglish <jenglish@flightlab.com>2007-01-11 19:59:26 (GMT)
commitc48f4f5bf3717299252cba2e4faa31f395ce1689 (patch)
tree8277dd861a947f2adb0b4634f031f9c651f7e8d0 /generic/ttk/ttkEntry.c
parent72b0a491e8d2e18f644d6698540fbe79918d17ea (diff)
downloadtk-c48f4f5bf3717299252cba2e4faa31f395ce1689.zip
tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.tar.gz
tk-c48f4f5bf3717299252cba2e4faa31f395ce1689.tar.bz2
Revert previous change to keep in sync with Tile codebase.
The minor warnings from GCC fixed in the previous revision were false positives due to improper use of "-Wconversion". Still compiles cleanly with "gcc -Wall -Werror" (gcc 3.3.5).
Diffstat (limited to 'generic/ttk/ttkEntry.c')
-rw-r--r--generic/ttk/ttkEntry.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 6ac910a..f09e5cf 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1,5 +1,5 @@
/*
- * $Id: ttkEntry.c,v 1.7 2007/01/11 15:35:40 dkf Exp $
+ * $Id: ttkEntry.c,v 1.8 2007/01/11 19:59:26 jenglish Exp $
*
* DERIVED FROM: tk/generic/tkEntry.c r1.35.
*
@@ -293,7 +293,7 @@ static char *EntryDisplayString(const char *showChar, int numChars)
Tcl_UtfToUniChar(showChar, &ch);
size = Tcl_UniCharToUtf(ch, buf);
- p = displayString = ckalloc((unsigned)numChars * size + 1);
+ p = displayString = ckalloc(numChars * size + 1);
while (numChars--) {
p += Tcl_UniCharToUtf(ch, p);
@@ -710,7 +710,7 @@ static void
EntryStoreValue(Entry *entryPtr, const char *value)
{
size_t numBytes = strlen(value);
- int numChars = Tcl_NumUtfChars(value, (int)numBytes);
+ int numChars = Tcl_NumUtfChars(value, numBytes);
if (entryPtr->core.flags & VALIDATING)
entryPtr->core.flags |= VALIDATION_SET_VALUE;
@@ -811,7 +811,7 @@ InsertChars(
char *string = entryPtr->entry.string;
size_t byteIndex = Tcl_UtfAtIndex(string, index) - string;
size_t byteCount = strlen(value);
- int charsAdded = Tcl_NumUtfChars(value, (int)byteCount);
+ int charsAdded = Tcl_NumUtfChars(value, byteCount);
size_t newByteCount = entryPtr->entry.numBytes + byteCount + 1;
char *new;
int code;
@@ -1245,9 +1245,8 @@ static void EntryDisplay(void *clientData, Drawable d)
Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight);
gc = EntryGetGC(entryPtr, es.insertColorObj);
- XFillRectangle(Tk_Display(tkwin), d, gc,
- cursorX-cursorWidth/2, cursorY,
- (unsigned)cursorWidth, (unsigned)cursorHeight);
+ XFillRectangle(Tk_Display(tkwin), d, gc,
+ cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight);
Tk_FreeGC(Tk_Display(tkwin), gc);
}
@@ -1298,13 +1297,13 @@ EntryIndex(
int length;
const char *string = Tcl_GetStringFromObj(indexObj, &length);
- if (strncmp(string, "end", (unsigned) length) == 0) {
+ if (strncmp(string, "end", length) == 0) {
*indexPtr = entryPtr->entry.numChars;
- } else if (strncmp(string, "insert", (unsigned) length) == 0) {
+ } else if (strncmp(string, "insert", length) == 0) {
*indexPtr = entryPtr->entry.insertPos;
- } else if (strncmp(string, "left", (unsigned) length) == 0) { /* for debugging */
+ } else if (strncmp(string, "left", length) == 0) { /* for debugging */
*indexPtr = entryPtr->entry.xscroll.first;
- } else if (strncmp(string, "right", (unsigned) length) == 0) { /* for debugging */
+ } else if (strncmp(string, "right", length) == 0) { /* for debugging */
*indexPtr = entryPtr->entry.xscroll.last;
} else if (strncmp(string, "sel.", 4) == 0) {
if (entryPtr->entry.selectFirst < 0) {
@@ -1313,9 +1312,9 @@ EntryIndex(
Tk_PathName(entryPtr->core.tkwin), NULL);
return TCL_ERROR;
}
- if (strncmp(string, "sel.first", (unsigned) length) == 0) {
+ if (strncmp(string, "sel.first", length) == 0) {
*indexPtr = entryPtr->entry.selectFirst;
- } else if (strncmp(string, "sel.last", (unsigned) length) == 0) {
+ } else if (strncmp(string, "sel.last", length) == 0) {
*indexPtr = entryPtr->entry.selectLast;
} else {
goto badIndex;