summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-24 21:29:59 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-24 21:29:59 (GMT)
commita8636d143def6ec81330e49af713edbb2e08862a (patch)
treeecbaea802a0bc17da9aaadc8f12c97d15e9c768d /generic/ttk
parent334a6b720c513b352e0b4d13dc50b498a78c2ee4 (diff)
downloadtk-a8636d143def6ec81330e49af713edbb2e08862a.zip
tk-a8636d143def6ec81330e49af713edbb2e08862a.tar.gz
tk-a8636d143def6ec81330e49af713edbb2e08862a.tar.bz2
More progress
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkEntry.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 95c1a9a..6cd8131 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -84,8 +84,8 @@ typedef struct {
* Internal state:
*/
char *string; /* Storage for string (malloced) */
- int numBytes; /* Length of string in bytes. */
- int numChars; /* Length of string in characters. */
+ TkSizeT numBytes; /* Length of string in bytes. */
+ TkSizeT numChars; /* Length of string in characters. */
int insertPos; /* Insert index */
int selectFirst; /* Index of start of selection, or -1 */
@@ -734,7 +734,7 @@ static void
EntryStoreValue(Entry *entryPtr, const char *value)
{
size_t numBytes = strlen(value);
- int numChars = Tcl_NumUtfChars(value, numBytes);
+ TkSizeT numChars = Tcl_NumUtfChars(value, numBytes);
if (entryPtr->core.flags & VALIDATING)
entryPtr->core.flags |= VALIDATION_SET_VALUE;
@@ -886,7 +886,7 @@ DeleteChars(
if (index < 0) {
index = 0;
}
- if (count > entryPtr->entry.numChars - index) {
+ if (count + index > (int)entryPtr->entry.numChars) {
count = entryPtr->entry.numChars - index;
}
if (count <= 0) {
@@ -1373,8 +1373,8 @@ EntryIndex(
const char *string;
if (TCL_OK == TkGetIntForIndex(indexObj, entryPtr->entry.numChars - 1, 1, &idx)) {
- if (idx + 1 > (TkSizeT)entryPtr->entry.numChars + 1) {
- idx = (TkSizeT)entryPtr->entry.numChars;
+ if (idx + 1 > entryPtr->entry.numChars + 1) {
+ idx = entryPtr->entry.numChars;
}
*indexPtr = (int)idx;
return TCL_OK;
@@ -1430,7 +1430,7 @@ EntryIndex(
* last character to be selected, for example.
*/
- if (roundUp && (*indexPtr < entryPtr->entry.numChars)) {
+ if (roundUp && (*indexPtr < (int)entryPtr->entry.numChars)) {
*indexPtr += 1;
}
} else {