summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-03-31 19:54:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-03-31 19:54:49 (GMT)
commit8d2dbe96066152901e507e44cf7dec9b00f2bee3 (patch)
tree27cd4550429711dfdbcc60e83e12d01c5f4b9b03
parentc46f74289a79498f91f6bd70d409449bc6f00b41 (diff)
downloadtk-8d2dbe96066152901e507e44cf7dec9b00f2bee3.zip
tk-8d2dbe96066152901e507e44cf7dec9b00f2bee3.tar.gz
tk-8d2dbe96066152901e507e44cf7dec9b00f2bee3.tar.bz2
Change (internal) signature of TkMenuConfigureEntryDrawOptions/TkActivateMenuEntry such that - if compiled with Tcl 9.0 headers - indexes > 2G can be used.
Also, change a lot of Tcl_NewIntObj()/Tcl_NewBooleanObj() calls to Tcl_NewWideIntObj().
-rw-r--r--generic/tkMacWinMenu.c2
-rw-r--r--generic/tkMain.c4
-rw-r--r--generic/tkMenu.c70
-rw-r--r--generic/tkMenu.h10
-rw-r--r--generic/tkMenuDraw.c11
-rw-r--r--generic/tkTest.c8
-rw-r--r--generic/tkWindow.c2
-rw-r--r--generic/ttk/ttkEntry.c4
-rw-r--r--generic/ttk/ttkTreeview.c4
-rw-r--r--generic/ttk/ttkWidget.c2
-rw-r--r--macosx/tkMacOSXDialog.c4
-rw-r--r--macosx/tkMacOSXFont.c2
-rw-r--r--macosx/tkMacOSXMenu.c18
-rw-r--r--macosx/tkMacOSXWm.c54
-rw-r--r--macosx/tkMacOSXWm.h2
-rw-r--r--unix/tkUnixFont.c2
-rw-r--r--unix/tkUnixMenu.c10
-rw-r--r--unix/tkUnixSend.c2
-rw-r--r--unix/tkUnixWm.c46
-rw-r--r--win/tkWinDialog.c4
-rw-r--r--win/tkWinMenu.c18
-rw-r--r--win/tkWinWm.c54
22 files changed, 166 insertions, 167 deletions
diff --git a/generic/tkMacWinMenu.c b/generic/tkMacWinMenu.c
index 9449838..e6b673c 100644
--- a/generic/tkMacWinMenu.c
+++ b/generic/tkMacWinMenu.c
@@ -66,7 +66,7 @@ PreprocessMenu(
do {
finished = 1;
- for (index = 0; index < menuPtr->numEntries; index++) {
+ for (index = 0; index < (int)menuPtr->numEntries; index++) {
register TkMenuEntry *entryPtr = menuPtr->entries[index];
if ((entryPtr->type == CASCADE_ENTRY)
diff --git a/generic/tkMain.c b/generic/tkMain.c
index e50b0f4..007903c 100644
--- a/generic/tkMain.c
+++ b/generic/tkMain.c
@@ -298,7 +298,7 @@ Tk_MainEx(
argc--;
argv++;
- Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewIntObj(argc), TCL_GLOBAL_ONLY);
+ Tcl_SetVar2Ex(interp, "argc", NULL, Tcl_NewWideIntObj(argc), TCL_GLOBAL_ONLY);
argvPtr = Tcl_NewListObj(0, NULL);
while (argc--) {
@@ -325,7 +325,7 @@ Tk_MainEx(
}
#endif
Tcl_SetVar2Ex(interp, "tcl_interactive", NULL,
- Tcl_NewIntObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY);
+ Tcl_NewWideIntObj(!path && (is.tty || nullStdin)), TCL_GLOBAL_ONLY);
/*
* Invoke application-specific initialization.
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index dd29d79..89b752d 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -357,7 +357,7 @@ static int MenuAddOrInsert(Tcl_Interp *interp,
TkMenu *menuPtr, Tcl_Obj *indexPtr, int objc,
Tcl_Obj *const objv[]);
static void MenuCmdDeletedProc(ClientData clientData);
-static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, int index, int type);
+static TkMenuEntry * MenuNewEntry(TkMenu *menuPtr, TkSizeT index, int type);
static char * MenuVarProc(ClientData clientData,
Tcl_Interp *interp, const char *name1,
const char *name2, int flags);
@@ -457,7 +457,7 @@ Tk_MenuObjCmd(
menuPtr->widgetCmd = Tcl_CreateObjCommand(interp,
Tk_PathName(menuPtr->tkwin), MenuWidgetObjCmd, menuPtr,
MenuCmdDeletedProc);
- menuPtr->active = -1;
+ menuPtr->active = (TkSizeT)-1;
menuPtr->cursorPtr = NULL;
menuPtr->masterMenuPtr = menuPtr;
menuPtr->menuType = UNKNOWN_TYPE;
@@ -648,7 +648,7 @@ MenuWidgetObjCmd(
if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
goto error;
}
- if (menuPtr->active == index) {
+ if ((int)menuPtr->active == index) {
goto done;
}
if ((index >= 0) && ((menuPtr->entries[index]->type==SEPARATOR_ENTRY)
@@ -737,7 +737,7 @@ MenuWidgetObjCmd(
if (isdigit(UCHAR(Tcl_GetString(objv[2])[0]))
&& Tcl_GetIntFromObj(NULL, objv[2], &first) == TCL_OK) {
- if (first >= menuPtr->numEntries) {
+ if (first >= (int)menuPtr->numEntries) {
goto done;
}
} else if (TkGetMenuIndex(interp,menuPtr,objv[2],0,&first) != TCL_OK){
@@ -839,10 +839,10 @@ MenuWidgetObjCmd(
if (TkGetMenuIndex(interp, menuPtr, objv[2], 0, &index) != TCL_OK) {
goto error;
}
- if (index < 0) {
+ if (index == -1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("none", -1));
} else {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(index));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(index));
}
break;
}
@@ -1489,7 +1489,7 @@ MenuWorldChanged(
ClientData instanceData) /* Information about widget. */
{
TkMenu *menuPtr = instanceData;
- int i;
+ TkSizeT i;
TkMenuConfigureDrawOptions(menuPtr);
for (i = 0; i < menuPtr->numEntries; i++) {
@@ -1630,12 +1630,11 @@ ConfigureMenu(
Tcl_EventuallyFree(menuListPtr->entries[0], (Tcl_FreeProc *) DestroyMenuEntry);
- for (i = 0; i < menuListPtr->numEntries - 1; i++) {
+ for (i = 0; i < (int)menuListPtr->numEntries - 1; i++) {
menuListPtr->entries[i] = menuListPtr->entries[i + 1];
menuListPtr->entries[i]->index = i;
}
- menuListPtr->numEntries--;
- if (menuListPtr->numEntries == 0) {
+ if (--menuListPtr->numEntries == 0) {
ckfree(menuListPtr->entries);
menuListPtr->entries = NULL;
}
@@ -1650,7 +1649,7 @@ ConfigureMenu(
* parent.
*/
- for (i = 0; i < menuListPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuListPtr->numEntries; i++) {
TkMenuEntry *mePtr;
mePtr = menuListPtr->entries[i];
@@ -2148,7 +2147,7 @@ TkGetMenuIndex(
if (isdigit(UCHAR(string[0]))) {
if (Tcl_GetInt(interp, string, &i) == TCL_OK) {
- if (i >= menuPtr->numEntries) {
+ if (i >= (int)menuPtr->numEntries) {
if (lastOK) {
i = menuPtr->numEntries;
} else {
@@ -2163,7 +2162,7 @@ TkGetMenuIndex(
Tcl_ResetResult(interp);
}
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
Tcl_Obj *labelPtr = menuPtr->entries[i]->labelPtr;
const char *label = (labelPtr == NULL) ? NULL : Tcl_GetString(labelPtr);
@@ -2246,13 +2245,13 @@ MenuCmdDeletedProc(
static TkMenuEntry *
MenuNewEntry(
TkMenu *menuPtr, /* Menu that will hold the new entry. */
- int index, /* Where in the menu the new entry is to
+ TkSizeT index, /* Where in the menu the new entry is to
* go. */
int type) /* The type of the new entry. */
{
TkMenuEntry *mePtr;
TkMenuEntry **newEntries;
- int i;
+ TkSizeT i;
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -2392,7 +2391,7 @@ MenuAddOrInsert(
}
if (ConfigureMenuEntry(mePtr, objc - 1, objv + 1) != TCL_OK) {
TkMenu *errorMenuPtr;
- int i;
+ TkSizeT i;
for (errorMenuPtr = menuPtr->masterMenuPtr;
errorMenuPtr != NULL;
@@ -2403,8 +2402,7 @@ MenuAddOrInsert(
errorMenuPtr->entries[i] = errorMenuPtr->entries[i + 1];
errorMenuPtr->entries[i]->index = i;
}
- errorMenuPtr->numEntries--;
- if (errorMenuPtr->numEntries == 0) {
+ if (--errorMenuPtr->numEntries == 0) {
ckfree(errorMenuPtr->entries);
errorMenuPtr->entries = NULL;
}
@@ -2588,13 +2586,13 @@ MenuVarProc(
int
TkActivateMenuEntry(
register TkMenu *menuPtr, /* Menu in which to activate. */
- int index) /* Index of entry to activate, or -1 to
- * deactivate all entries. */
+ TkSizeT index) /* Index of entry to activate, or
+ * TCL_INDEX_NONE to deactivate all entries. */
{
register TkMenuEntry *mePtr;
int result = TCL_OK;
- if (menuPtr->active >= 0) {
+ if (menuPtr->active != (TkSizeT)-1) {
mePtr = menuPtr->entries[menuPtr->active];
/*
@@ -2608,7 +2606,7 @@ TkActivateMenuEntry(
TkEventuallyRedrawMenu(menuPtr, menuPtr->entries[menuPtr->active]);
}
menuPtr->active = index;
- if (index >= 0) {
+ if (index != (TkSizeT)-1) {
mePtr = menuPtr->entries[index];
mePtr->state = ENTRY_ACTIVE;
TkEventuallyRedrawMenu(menuPtr, mePtr);
@@ -2799,7 +2797,7 @@ CloneMenu(
* Clone all of the cascade menus that this menu points to.
*/
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
TkMenuReferences *cascadeRefPtr;
TkMenu *oldCascadePtr;
@@ -2870,10 +2868,10 @@ MenuDoXPosition(
return TCL_ERROR;
}
Tcl_ResetResult(interp);
- if (index < 0) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(0));
+ if (index == -1) {
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0));
} else {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(menuPtr->entries[index]->x));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(menuPtr->entries[index]->x));
}
return TCL_OK;
}
@@ -2907,10 +2905,10 @@ MenuDoYPosition(
goto error;
}
Tcl_ResetResult(interp);
- if (index < 0) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(0));
+ if (index == -1) {
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(0));
} else {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(menuPtr->entries[index]->y));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(menuPtr->entries[index]->y));
}
return TCL_OK;
@@ -2978,7 +2976,7 @@ GetIndexFromCoords(
? Tk_Width(menuPtr->tkwin) : Tk_ReqWidth(menuPtr->tkwin);
max -= borderwidth;
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
if (menuPtr->entries[i]->entryFlags & ENTRY_LAST_COLUMN) {
x2 = max;
} else {
@@ -3021,7 +3019,7 @@ static void
RecursivelyDeleteMenu(
TkMenu *menuPtr) /* The menubar instance we are deleting. */
{
- int i;
+ TkSizeT i;
TkMenuEntry *mePtr;
/*
@@ -3108,7 +3106,7 @@ TkNewMenuName(
Tcl_AppendToObj(resultPtr, ".", -1);
}
Tcl_AppendObjToObj(resultPtr, childPtr);
- intPtr = Tcl_NewIntObj(i);
+ intPtr = Tcl_NewWideIntObj(i);
Tcl_AppendObjToObj(resultPtr, intPtr);
Tcl_DecrRefCount(intPtr);
}
@@ -3525,7 +3523,7 @@ DeleteMenuCloneEntries(
for (i = last; i >= first; i--) {
Tcl_EventuallyFree(menuListPtr->entries[i], (Tcl_FreeProc *) DestroyMenuEntry);
}
- for (i = last + 1; i < menuListPtr->numEntries; i++) {
+ for (i = last + 1; i < (int)menuListPtr->numEntries; i++) {
j = i - numDeleted;
menuListPtr->entries[j] = menuListPtr->entries[i];
menuListPtr->entries[j]->index = j;
@@ -3535,10 +3533,10 @@ DeleteMenuCloneEntries(
ckfree(menuListPtr->entries);
menuListPtr->entries = NULL;
}
- if ((menuListPtr->active >= first)
- && (menuListPtr->active <= last)) {
+ if (((int)menuListPtr->active >= first)
+ && ((int)menuListPtr->active <= last)) {
menuListPtr->active = -1;
- } else if (menuListPtr->active > last) {
+ } else if ((int)menuListPtr->active > last) {
menuListPtr->active -= numDeleted;
}
TkEventuallyRecomputeMenu(menuListPtr);
diff --git a/generic/tkMenu.h b/generic/tkMenu.h
index 8e25059..5449879 100644
--- a/generic/tkMenu.h
+++ b/generic/tkMenu.h
@@ -267,9 +267,9 @@ typedef struct TkMenu {
Tcl_Command widgetCmd; /* Token for menu's widget command. */
TkMenuEntry **entries; /* Array of pointers to all the entries in the
* menu. NULL means no entries. */
- int numEntries; /* Number of elements in entries. */
- int active; /* Index of active entry. -1 means nothing
- * active. */
+ TkSizeT numEntries; /* Number of elements in entries. */
+ TkSizeT active; /* Index of active entry. TCL_INDEX_NONE means
+ * nothing active. */
int menuType; /* MASTER_MENU, TEAROFF_MENU, or MENUBAR. See
* below for definitions. */
Tcl_Obj *menuTypePtr; /* Used to control whether created tkwin is a
@@ -482,7 +482,7 @@ typedef struct TkMenuReferences {
* the outside world:
*/
-MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, int index);
+MODULE_SCOPE int TkActivateMenuEntry(TkMenu *menuPtr, TkSizeT index);
MODULE_SCOPE void TkBindMenu(Tk_Window tkwin, TkMenu *menuPtr);
MODULE_SCOPE TkMenuReferences*TkCreateMenuReferences(Tcl_Interp *interp,
const char *name);
@@ -503,7 +503,7 @@ MODULE_SCOPE int TkInvokeMenu(Tcl_Interp *interp, TkMenu *menuPtr,
int index);
MODULE_SCOPE void TkMenuConfigureDrawOptions(TkMenu *menuPtr);
MODULE_SCOPE int TkMenuConfigureEntryDrawOptions(
- TkMenuEntry *mePtr, int index);
+ TkMenuEntry *mePtr, TkSizeT index);
MODULE_SCOPE void TkMenuFreeDrawOptions(TkMenu *menuPtr);
MODULE_SCOPE void TkMenuEntryFreeDrawOptions(TkMenuEntry *mePtr);
MODULE_SCOPE void TkMenuEventProc(ClientData clientData,
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index bd00d38..e3a1ef6 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.c
@@ -298,7 +298,7 @@ TkMenuConfigureDrawOptions(
int
TkMenuConfigureEntryDrawOptions(
TkMenuEntry *mePtr,
- int index)
+ TkSizeT index)
{
XGCValues gcValues;
GC newGC, newActiveGC, newDisabledGC, newIndicatorGC;
@@ -487,7 +487,7 @@ TkEventuallyRedrawMenu(
register TkMenuEntry *mePtr)/* Entry to redraw. NULL means redraw all the
* entries in the menu. */
{
- int i;
+ TkSizeT i;
if (menuPtr->tkwin == NULL) {
return;
@@ -618,7 +618,8 @@ DisplayMenu(
register TkMenu *menuPtr = clientData;
register TkMenuEntry *mePtr;
register Tk_Window tkwin = menuPtr->tkwin;
- int index, strictMotif;
+ TkSizeT index;
+ int strictMotif;
Tk_Font tkfont;
Tk_FontMetrics menuMetrics;
int width;
@@ -911,8 +912,8 @@ TkPostSubmenu(
menuPtr->postedCascade = mePtr;
subary[0] = mePtr->namePtr;
subary[1] = Tcl_NewStringObj("post", -1);
- subary[2] = Tcl_NewIntObj(x);
- subary[3] = Tcl_NewIntObj(y);
+ subary[2] = Tcl_NewWideIntObj(x);
+ subary[3] = Tcl_NewWideIntObj(y);
Tcl_IncrRefCount(subary[1]);
Tcl_IncrRefCount(subary[2]);
Tcl_IncrRefCount(subary[3]);
diff --git a/generic/tkTest.c b/generic/tkTest.c
index 2061893..46a1a13 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -1212,7 +1212,7 @@ TrivialConfigObjCmd(
headerPtr->optionTable, objc - 2, objv + 2,
tkwin, NULL, &mask);
if (result == TCL_OK) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(mask));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(mask));
}
}
break;
@@ -1222,7 +1222,7 @@ TrivialConfigObjCmd(
tkwin, &saved, &mask);
Tk_FreeSavedOptions(&saved);
if (result == TCL_OK) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(mask));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(mask));
}
break;
}
@@ -2167,8 +2167,8 @@ TestPhotoStringMatchCmd(
return TCL_ERROR;
}
if (TkDebugPhotoStringMatchDef(interp, objv[1], dummy, &width, &height)) {
- resultObj[0] = Tcl_NewIntObj(width);
- resultObj[1] = Tcl_NewIntObj(height);
+ resultObj[0] = Tcl_NewWideIntObj(width);
+ resultObj[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, resultObj));
return TCL_OK;
} else {
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 3d91927..d8c2068 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3170,7 +3170,7 @@ Initialize(
Tcl_SetVar2Ex(interp, "argv", NULL,
Tcl_NewListObj(objc-1, rest+1), TCL_GLOBAL_ONLY);
Tcl_SetVar2Ex(interp, "argc", NULL,
- Tcl_NewIntObj(objc-1), TCL_GLOBAL_ONLY);
+ Tcl_NewWideIntObj(objc-1), TCL_GLOBAL_ONLY);
ckfree(rest);
}
Tcl_DecrRefCount(parseList);
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 49b6553..3fc0c36 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1605,7 +1605,7 @@ static int EntrySelectionPresentCommand(
return TCL_ERROR;
}
Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj(entryPtr->entry.selectFirst >= 0));
+ Tcl_NewWideIntObj(entryPtr->entry.selectFirst >= 0));
return TCL_OK;
}
@@ -1682,7 +1682,7 @@ static int EntryValidateCommand(
if (code == TCL_ERROR)
return code;
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(code == TCL_OK));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(code == TCL_OK));
return TCL_OK;
}
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 48656f7..cc2c9e1 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -2144,7 +2144,7 @@ static int TreeviewExistsCommand(
}
entryPtr = Tcl_FindHashEntry(&tv->tree.items, Tcl_GetString(objv[2]));
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(entryPtr != 0));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(entryPtr != 0));
return TCL_OK;
}
@@ -3114,7 +3114,7 @@ static int TreeviewTagHasCommand(
return TCL_ERROR;
}
Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj(Ttk_TagSetContains(item->tagset, tag)));
+ Tcl_NewWideIntObj(Ttk_TagSetContains(item->tagset, tag)));
return TCL_OK;
} else {
Tcl_WrongNumArgs(interp, 3, objv, "tagName ?item?");
diff --git a/generic/ttk/ttkWidget.c b/generic/ttk/ttkWidget.c
index c2f8d60..70243bf 100644
--- a/generic/ttk/ttkWidget.c
+++ b/generic/ttk/ttkWidget.c
@@ -738,7 +738,7 @@ int TtkWidgetInstateCommand(
if (objc == 3) {
Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj(Ttk_StateMatches(state,&spec)));
+ Tcl_NewWideIntObj(Ttk_StateMatches(state,&spec)));
} else if (objc == 4) {
if (Ttk_StateMatches(state,&spec)) {
status = Tcl_EvalObjEx(interp, objv[3], 0);
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 785f929..a7e10b4 100644
--- a/macosx/tkMacOSXDialog.c
+++ b/macosx/tkMacOSXDialog.c
@@ -1674,8 +1674,8 @@ FontchooserCget(
}
break;
case FontchooserVisible:
- resObj = Tcl_NewBooleanObj([[[NSFontManager sharedFontManager]
- fontPanel:NO] isVisible]);
+ resObj = Tcl_NewWideIntObj([[[NSFontManager sharedFontManager]
+ fontPanel:NO] isVisible] != 0);
break;
default:
resObj = Tcl_NewObj();
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index 353ad6b..deaab20 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -1242,7 +1242,7 @@ TkMacOSXFontDescriptionForNSFontAndNSFontAttributes(
id strikethrough = [nsAttributes objectForKey:
NSStrikethroughStyleAttributeName];
objv[i++] = Tcl_NewStringObj(familyName, -1);
- objv[i++] = Tcl_NewIntObj([nsFont pointSize]);
+ objv[i++] = Tcl_NewWideIntObj([nsFont pointSize]);
#define S(s) Tcl_NewStringObj(STRINGIFY(s),(int)(sizeof(STRINGIFY(s))-1))
objv[i++] = (traits & NSBoldFontMask) ? S(bold) : S(normal);
objv[i++] = (traits & NSItalicFontMask) ? S(italic) : S(roman);
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 227c379..3d7cdaf 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -699,7 +699,7 @@ TkpConfigureMenuEntry(
TkMenuEntry *submePtr = menuRefPtr->menuPtr->entries[i];
/* Work around an apparent bug where itemArray can have
more items than the menu's entries[] array. */
- if (i >= menuRefPtr->menuPtr->numEntries) break;
+ if (i >= (int)menuRefPtr->menuPtr->numEntries) break;
[item setEnabled: !(submePtr->state == ENTRY_DISABLED)];
i++;
}
@@ -806,7 +806,7 @@ TkpPostMenu(
if (itemIndex >= 0) {
item = [menu itemAtIndex:itemIndex];
}
-
+
/*
* The post commands could have deleted the menu, which means we are dead
* and should go away.
@@ -862,7 +862,7 @@ TkpPostTearoffMenu(
int vRootX, vRootY, vRootWidth, vRootHeight;
int result;
- if (index >= menuPtr->numEntries) {
+ if (index >= (int)menuPtr->numEntries) {
index = menuPtr->numEntries - 1;
}
if (index >= 0) {
@@ -1025,7 +1025,7 @@ TkpSetMainMenubar(
* to a different application. In that case, install the default
* menubar.
*/
-
+
if (menu || interp != currentInterp) {
[NSApp tkSetMainMenu:menu];
}
@@ -1233,7 +1233,7 @@ TkpComputeStandardMenuGeometry(
if (menuPtr->tkwin == NULL || menuPtr->masterMenuPtr != menuPtr) {
return;
}
-
+
menuSize = [(NSMenu *)menuPtr->platformData size];
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
&borderWidth);
@@ -1257,7 +1257,7 @@ TkpComputeStandardMenuGeometry(
Tk_GetFontMetrics(menuFont, &menuMetrics);
menuModifierCharWidth = ModifierCharWidth(menuFont);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
if (mePtr->type == CASCADE_ENTRY || mePtr->accelLength > 0) {
haveAccel = 1;
@@ -1265,7 +1265,7 @@ TkpComputeStandardMenuGeometry(
}
}
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
if (mePtr->type == TEAROFF_ENTRY) {
continue;
@@ -1413,7 +1413,7 @@ GenerateMenuSelectEvent(
if (menuPtr) {
int index = [menu tkIndexOfItem:menuItem];
- if (index < 0 || index >= menuPtr->numEntries ||
+ if (index < 0 || index >= (int)menuPtr->numEntries ||
(menuPtr->entries[index])->state == ENTRY_DISABLED) {
TkActivateMenuEntry(menuPtr, -1);
} else {
@@ -1492,7 +1492,7 @@ RecursivelyClearActiveMenu(
int i;
TkActivateMenuEntry(menuPtr, -1);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
TkMenuEntry *mePtr = menuPtr->entries[i];
if (mePtr->type == CASCADE_ENTRY
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index a607ae5..2a91822 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -1114,7 +1114,7 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(wmTracing));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(wmTracing != 0));
return TCL_OK;
}
return Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing);
@@ -1250,10 +1250,10 @@ WmAspectCmd(
if (wmPtr->sizeHintsFlags & PAspect) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->minAspect.x);
- results[1] = Tcl_NewIntObj(wmPtr->minAspect.y);
- results[2] = Tcl_NewIntObj(wmPtr->maxAspect.x);
- results[3] = Tcl_NewIntObj(wmPtr->maxAspect.y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minAspect.x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minAspect.y);
+ results[2] = Tcl_NewWideIntObj(wmPtr->maxAspect.x);
+ results[3] = Tcl_NewWideIntObj(wmPtr->maxAspect.y);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -1453,23 +1453,23 @@ WmGetAttribute(
result = Tcl_NewDoubleObj([macWindow alphaValue]);
break;
case WMATT_FULLSCREEN:
- result = Tcl_NewBooleanObj(wmPtr->flags & WM_FULLSCREEN);
+ result = Tcl_NewWideIntObj((wmPtr->flags & WM_FULLSCREEN) != 0);
break;
case WMATT_MODIFIED:
- result = Tcl_NewBooleanObj([macWindow isDocumentEdited]);
+ result = Tcl_NewWideIntObj([macWindow isDocumentEdited] != 0);
break;
case WMATT_NOTIFY:
- result = Tcl_NewBooleanObj(tkMacOSXWmAttrNotifyVal);
+ result = Tcl_NewWideIntObj(tkMacOSXWmAttrNotifyVal != 0);
break;
case WMATT_TITLEPATH:
result = Tcl_NewStringObj([[macWindow representedFilename] UTF8String],
-1);
break;
case WMATT_TOPMOST:
- result = Tcl_NewBooleanObj(wmPtr->flags & WM_TOPMOST);
+ result = Tcl_NewWideIntObj((wmPtr->flags & WM_TOPMOST) != 0);
break;
case WMATT_TRANSPARENT:
- result = Tcl_NewBooleanObj(wmPtr->flags & WM_TRANSPARENT);
+ result = Tcl_NewWideIntObj((wmPtr->flags & WM_TRANSPARENT) != 0);
break;
case WMATT_TYPE:
result = Tcl_NewStringObj("unsupported", -1);
@@ -2102,10 +2102,10 @@ WmGridCmd(
if (wmPtr->sizeHintsFlags & PBaseSize) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->reqGridWidth);
- results[1] = Tcl_NewIntObj(wmPtr->reqGridHeight);
- results[2] = Tcl_NewIntObj(wmPtr->widthInc);
- results[3] = Tcl_NewIntObj(wmPtr->heightInc);
+ results[0] = Tcl_NewWideIntObj(wmPtr->reqGridWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->reqGridHeight);
+ results[2] = Tcl_NewWideIntObj(wmPtr->widthInc);
+ results[3] = Tcl_NewWideIntObj(wmPtr->heightInc);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -2596,8 +2596,8 @@ WmIconpositionCmd(
if (wmPtr->hints.flags & IconPositionHint) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->hints.icon_x);
- results[1] = Tcl_NewIntObj(wmPtr->hints.icon_y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->hints.icon_x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->hints.icon_y);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
}
return TCL_OK;
@@ -2823,8 +2823,8 @@ WmMaxsizeCmd(
Tcl_Obj *results[2];
GetMaxSize(winPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -2877,8 +2877,8 @@ WmMinsizeCmd(
Tcl_Obj *results[2];
GetMinSize(winPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -2929,8 +2929,8 @@ WmOverrideredirectCmd(
}
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- Tk_Attributes((Tk_Window) winPtr)->override_redirect));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ Tk_Attributes((Tk_Window) winPtr)->override_redirect != 0));
return TCL_OK;
}
@@ -3148,8 +3148,8 @@ WmResizableCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewBooleanObj(!(wmPtr->flags & WM_WIDTH_NOT_RESIZABLE));
- results[1] = Tcl_NewBooleanObj(!(wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE));
+ results[0] = Tcl_NewWideIntObj((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) == 0);
+ results[1] = Tcl_NewWideIntObj((wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE) == 0);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -3374,7 +3374,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result != 0));
return TCL_OK;
}
}
@@ -3633,7 +3633,7 @@ WmTransientCmd(
/*
* Add the transient to the master's list, if it not already there.
*/
-
+
for (transient = wmPtr2->transientPtr;
transient != NULL && transient->winPtr != winPtr;
transient = transient->nextPtr) {}
@@ -3688,7 +3688,7 @@ RemoveTransient(
WmInfo *wmPtr = winPtr->wmInfoPtr, *wmPtr2;
TkWindow *masterPtr;
Transient *T, *temp;
-
+
if (wmPtr == NULL || wmPtr->master == NULL) {
return;
}
diff --git a/macosx/tkMacOSXWm.h b/macosx/tkMacOSXWm.h
index 5f07fe6..20bbb6d 100644
--- a/macosx/tkMacOSXWm.h
+++ b/macosx/tkMacOSXWm.h
@@ -43,7 +43,7 @@ typedef struct ProtocolHandler {
typedef struct Transient {
TkWindow *winPtr;
int flags;
- struct Transient *nextPtr;
+ struct Transient *nextPtr;
} Transient;
#define WITHDRAWN_BY_MASTER 0x1
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 168e8c9..c94aff2 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -3017,7 +3017,7 @@ GetEncodingAlias(
const EncodingAlias *aliasPtr;
for (aliasPtr = encodingAliases; aliasPtr->aliasPattern != NULL; ) {
- if (Tcl_StringMatch(name, aliasPtr->aliasPattern)) {
+ if (Tcl_StringCaseMatch(name, aliasPtr->aliasPattern, 0)) {
return aliasPtr->realName;
}
aliasPtr++;
diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c
index 3b29a8c..296523c 100644
--- a/unix/tkUnixMenu.c
+++ b/unix/tkUnixMenu.c
@@ -938,7 +938,7 @@ TkpPostTearoffMenu(
int vRootX, vRootY, vRootWidth, vRootHeight;
int result;
- if (index >= menuPtr->numEntries) {
+ if (index >= (int)menuPtr->numEntries) {
index = menuPtr->numEntries - 1;
}
if (index >= 0) {
@@ -1130,7 +1130,7 @@ TkpComputeMenubarGeometry(
menuFont = Tk_GetFontFromObj(menuPtr->tkwin, menuPtr->fontPtr);
Tk_GetFontMetrics(menuFont, &menuMetrics);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
mePtr->entryFlags &= ~ENTRY_LAST_COLUMN;
if (mePtr->fontPtr != NULL) {
@@ -1207,7 +1207,7 @@ TkpComputeMenubarGeometry(
maxWidth = x + menuPtr->entries[lastEntry]->width + borderWidth;
}
x = borderWidth;
- for (j = lastRowBreak; j < menuPtr->numEntries; j++) {
+ for (j = lastRowBreak; j < (int)menuPtr->numEntries; j++) {
if (j == helpMenuIndex) {
continue;
}
@@ -1709,7 +1709,7 @@ TkpComputeStandardMenuGeometry(
Tk_GetFontMetrics(menuFont, &menuMetrics);
accelSpace = Tk_TextWidth(menuFont, "M", 1);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
mePtr = menuPtr->entries[i];
if (mePtr->fontPtr == NULL) {
tkfont = menuFont;
@@ -1804,7 +1804,7 @@ TkpComputeStandardMenuGeometry(
if (accelWidth != 0) {
labelWidth += accelSpace;
}
- for (j = lastColumnBreak; j < menuPtr->numEntries; j++) {
+ for (j = lastColumnBreak; j < (int)menuPtr->numEntries; j++) {
menuPtr->entries[j]->indicatorSpace = indicatorSpace;
menuPtr->entries[j]->labelWidth = labelWidth;
menuPtr->entries[j]->width = indicatorSpace + labelWidth
diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c
index 0b4f05d..9b6e79f 100644
--- a/unix/tkUnixSend.c
+++ b/unix/tkUnixSend.c
@@ -2052,7 +2052,7 @@ TkpTestsendCmd(
Tcl_DStringFree(&tmp);
}
} else if (index == TESTSEND_SERIAL) {
- Tcl_SetObjResult(interp, Tcl_NewIntObj(localData.sendSerial+1));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(localData.sendSerial+1));
}
return TCL_OK;
}
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index f548bcd..2a940bc 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -1055,8 +1055,8 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- dispPtr->flags & TK_DISPLAY_WM_TRACING));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ (dispPtr->flags & TK_DISPLAY_WM_TRACING) != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
@@ -1200,10 +1200,10 @@ WmAspectCmd(
if (wmPtr->sizeHintsFlags & PAspect) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->minAspect.x);
- results[1] = Tcl_NewIntObj(wmPtr->minAspect.y);
- results[2] = Tcl_NewIntObj(wmPtr->maxAspect.x);
- results[3] = Tcl_NewIntObj(wmPtr->maxAspect.y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minAspect.x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minAspect.y);
+ results[2] = Tcl_NewWideIntObj(wmPtr->maxAspect.x);
+ results[3] = Tcl_NewWideIntObj(wmPtr->maxAspect.y);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -1345,11 +1345,11 @@ WmGetAttribute(
case WMATT_ALPHA:
return Tcl_NewDoubleObj(wmPtr->attributes.alpha);
case WMATT_TOPMOST:
- return Tcl_NewBooleanObj(wmPtr->attributes.topmost);
+ return Tcl_NewWideIntObj(wmPtr->attributes.topmost != 0);
case WMATT_ZOOMED:
- return Tcl_NewBooleanObj(wmPtr->attributes.zoomed);
+ return Tcl_NewWideIntObj(wmPtr->attributes.zoomed != 0);
case WMATT_FULLSCREEN:
- return Tcl_NewBooleanObj(wmPtr->attributes.fullscreen);
+ return Tcl_NewWideIntObj(wmPtr->attributes.fullscreen != 0);
case WMATT_TYPE:
return GetNetWmType(winPtr);
case _WMATT_LAST_ATTRIBUTE: /*NOTREACHED*/
@@ -1980,10 +1980,10 @@ WmGridCmd(
if (wmPtr->sizeHintsFlags & PBaseSize) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->reqGridWidth);
- results[1] = Tcl_NewIntObj(wmPtr->reqGridHeight);
- results[2] = Tcl_NewIntObj(wmPtr->widthInc);
- results[3] = Tcl_NewIntObj(wmPtr->heightInc);
+ results[0] = Tcl_NewWideIntObj(wmPtr->reqGridWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->reqGridHeight);
+ results[2] = Tcl_NewWideIntObj(wmPtr->widthInc);
+ results[3] = Tcl_NewWideIntObj(wmPtr->heightInc);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -2538,8 +2538,8 @@ WmIconpositionCmd(
if (wmPtr->hints.flags & IconPositionHint) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->hints.icon_x);
- results[1] = Tcl_NewIntObj(wmPtr->hints.icon_y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->hints.icon_x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->hints.icon_y);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
}
return TCL_OK;
@@ -2777,8 +2777,8 @@ WmMaxsizeCmd(
Tcl_Obj *results[2];
GetMaxSize(wmPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -2835,8 +2835,8 @@ WmMinsizeCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->minWidth);
- results[1] = Tcl_NewIntObj(wmPtr->minHeight);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minHeight);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -2885,7 +2885,7 @@ WmOverrideredirectCmd(
}
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
@@ -3121,8 +3121,8 @@ WmResizableCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
- results[1] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
+ results[0] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
+ results[1] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -3329,7 +3329,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result));
return TCL_OK;
}
return TCL_OK;
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 42a588b..506247c 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -3076,7 +3076,7 @@ GetFontObj(
Tcl_NewStringObj(Tcl_DStringValue(&ds), -1));
Tcl_DStringFree(&ds);
pt = -MulDiv(plf->lfHeight, 72, GetDeviceCaps(hdc, LOGPIXELSY));
- Tcl_ListObjAppendElement(NULL, resObj, Tcl_NewIntObj(pt));
+ Tcl_ListObjAppendElement(NULL, resObj, Tcl_NewWideIntObj(pt));
if (plf->lfWeight >= 700) {
Tcl_ListObjAppendElement(NULL, resObj, Tcl_NewStringObj("bold", -1));
}
@@ -3254,7 +3254,7 @@ FontchooserCget(
}
break;
case FontchooserVisible:
- resObj = Tcl_NewBooleanObj(hdPtr->hwnd && IsWindow(hdPtr->hwnd));
+ resObj = Tcl_NewWideIntObj((hdPtr->hwnd != NULL) && IsWindow(hdPtr->hwnd));
break;
default:
resObj = Tcl_NewStringObj("", 0);
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 7f1e9cc..df817ee 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -781,7 +781,7 @@ TkpPostMenu(
return result;
}
- if (index >= menuPtr->numEntries) {
+ if (index >= (int)menuPtr->numEntries) {
index = menuPtr->numEntries - 1;
}
if (index >= 0) {
@@ -877,7 +877,7 @@ TkpPostTearoffMenu(
int vRootX, vRootY, vRootWidth, vRootHeight;
int result;
- if (index >= menuPtr->numEntries) {
+ if (index >= (int)menuPtr->numEntries) {
index = menuPtr->numEntries - 1;
}
if (index >= 0) {
@@ -1262,7 +1262,7 @@ TkWinHandleMenuEvent(
menuChar = Tcl_UniCharToUpper(LOWORD(*pwParam));
Tcl_DStringInit(&ds);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
underline = menuPtr->entries[i]->underline;
labelPtr = menuPtr->entries[i]->labelPtr;
if ((underline >= 0) && (labelPtr != NULL)) {
@@ -1410,7 +1410,7 @@ TkWinHandleMenuEvent(
}
mePtr = NULL;
if (flags != 0xFFFF) {
- if ((flags&MF_POPUP) && (entryIndex<menuPtr->numEntries)) {
+ if ((flags&MF_POPUP) && (entryIndex < (int)menuPtr->numEntries)) {
mePtr = menuPtr->entries[entryIndex];
} else {
hashEntryPtr = Tcl_FindHashEntry(&tsdPtr->commandTable,
@@ -1424,7 +1424,7 @@ TkWinHandleMenuEvent(
if ((mePtr == NULL) || (mePtr->state == ENTRY_DISABLED)) {
TkActivateMenuEntry(menuPtr, -1);
} else {
- if (mePtr->index >= menuPtr->numEntries) {
+ if (mePtr->index >= (int)menuPtr->numEntries) {
Tcl_Panic("Trying to activate an entry which doesn't exist");
}
TkActivateMenuEntry(menuPtr, mePtr->index);
@@ -1461,7 +1461,7 @@ void
RecursivelyClearActiveMenu(
TkMenu *menuPtr) /* The menu to reset. */
{
- int i;
+ TkSizeT i;
TkMenuEntry *mePtr;
TkActivateMenuEntry(menuPtr, -1);
@@ -2984,7 +2984,7 @@ TkpComputeStandardMenuGeometry(
Tk_GetPixelsFromObj(menuPtr->interp, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
- for (i = 0; i < menuPtr->numEntries; i++) {
+ for (i = 0; i < (int)menuPtr->numEntries; i++) {
if (menuPtr->entries[i]->fontPtr == NULL) {
tkfont = menuFont;
fmPtr = &menuMetrics;
@@ -3068,7 +3068,7 @@ TkpComputeStandardMenuGeometry(
if (accelWidth != 0) {
labelWidth += accelSpace;
}
- for (j = lastColumnBreak; j < menuPtr->numEntries; j++) {
+ for (j = lastColumnBreak; j < (int)menuPtr->numEntries; j++) {
menuPtr->entries[j]->indicatorSpace = indicatorSpace;
menuPtr->entries[j]->labelWidth = labelWidth;
menuPtr->entries[j]->width = indicatorSpace + labelWidth
@@ -3294,7 +3294,7 @@ TkWinGetMenuSystemDefault(
if ((strcmp(dbName, "activeBorderWidth") == 0) ||
(strcmp(dbName, "borderWidth") == 0)) {
- valuePtr = Tcl_NewIntObj(defaultBorderWidth);
+ valuePtr = Tcl_NewWideIntObj(defaultBorderWidth);
} else if (strcmp(dbName, "font") == 0) {
valuePtr = Tcl_NewStringObj(Tcl_DStringValue(&menuFontDString), -1);
}
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 4d8a952..a3d7f89 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -2823,8 +2823,8 @@ Tk_WmObjCmd(
return TCL_ERROR;
}
if (objc == 2) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- dispPtr->flags & TK_DISPLAY_WM_TRACING));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ (dispPtr->flags & TK_DISPLAY_WM_TRACING) != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[2], &wmTracing) != TCL_OK) {
@@ -2968,10 +2968,10 @@ WmAspectCmd(
if (wmPtr->sizeHintsFlags & PAspect) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->minAspect.x);
- results[1] = Tcl_NewIntObj(wmPtr->minAspect.y);
- results[2] = Tcl_NewIntObj(wmPtr->maxAspect.x);
- results[3] = Tcl_NewIntObj(wmPtr->maxAspect.y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->minAspect.x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->minAspect.y);
+ results[2] = Tcl_NewWideIntObj(wmPtr->maxAspect.x);
+ results[3] = Tcl_NewWideIntObj(wmPtr->maxAspect.y);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -3060,19 +3060,19 @@ WmAttributesCmd(
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-disabled", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((style & WS_DISABLED)));
+ Tcl_NewWideIntObj((style & WS_DISABLED) != 0));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-fullscreen", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((wmPtr->flags & WM_FULLSCREEN)));
+ Tcl_NewWideIntObj((wmPtr->flags & WM_FULLSCREEN) != 0));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-toolwindow", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((exStyle & WS_EX_TOOLWINDOW)));
+ Tcl_NewWideIntObj((exStyle & WS_EX_TOOLWINDOW) != 0));
Tcl_ListObjAppendElement(NULL, objPtr,
Tcl_NewStringObj("-topmost", -1));
Tcl_ListObjAppendElement(NULL, objPtr,
- Tcl_NewBooleanObj((exStyle & WS_EX_TOPMOST)));
+ Tcl_NewWideIntObj((exStyle & WS_EX_TOPMOST) != 0));
Tcl_SetObjResult(interp, objPtr);
return TCL_OK;
}
@@ -3210,8 +3210,8 @@ WmAttributesCmd(
}
if (config_fullscreen) {
if (objc == 4) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(
- wmPtr->flags & WM_FULLSCREEN));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(
+ (wmPtr->flags & WM_FULLSCREEN) != 0));
} else {
fullscreen_attr_changed = 1;
fullscreen_attr = boolean;
@@ -3219,7 +3219,7 @@ WmAttributesCmd(
config_fullscreen = 0;
} else if (objc == 4) {
Tcl_SetObjResult(interp,
- Tcl_NewBooleanObj(*stylePtr & styleBit));
+ Tcl_NewWideIntObj((*stylePtr & styleBit) != 0));
} else if (boolean) {
*stylePtr |= styleBit;
} else {
@@ -3837,10 +3837,10 @@ WmGridCmd(
if (wmPtr->sizeHintsFlags & PBaseSize) {
Tcl_Obj *results[4];
- results[0] = Tcl_NewIntObj(wmPtr->reqGridWidth);
- results[1] = Tcl_NewIntObj(wmPtr->reqGridHeight);
- results[2] = Tcl_NewIntObj(wmPtr->widthInc);
- results[3] = Tcl_NewIntObj(wmPtr->heightInc);
+ results[0] = Tcl_NewWideIntObj(wmPtr->reqGridWidth);
+ results[1] = Tcl_NewWideIntObj(wmPtr->reqGridHeight);
+ results[2] = Tcl_NewWideIntObj(wmPtr->widthInc);
+ results[3] = Tcl_NewWideIntObj(wmPtr->heightInc);
Tcl_SetObjResult(interp, Tcl_NewListObj(4, results));
}
return TCL_OK;
@@ -4502,8 +4502,8 @@ WmIconpositionCmd(
if (wmPtr->hints.flags & IconPositionHint) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewIntObj(wmPtr->hints.icon_x);
- results[1] = Tcl_NewIntObj(wmPtr->hints.icon_y);
+ results[0] = Tcl_NewWideIntObj(wmPtr->hints.icon_x);
+ results[1] = Tcl_NewWideIntObj(wmPtr->hints.icon_y);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
}
return TCL_OK;
@@ -4722,8 +4722,8 @@ WmMaxsizeCmd(
Tcl_Obj *results[2];
GetMaxSize(wmPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -4773,8 +4773,8 @@ WmMinsizeCmd(
Tcl_Obj *results[2];
GetMinSize(wmPtr, &width, &height);
- results[0] = Tcl_NewIntObj(width);
- results[1] = Tcl_NewIntObj(height);
+ results[0] = Tcl_NewWideIntObj(width);
+ results[1] = Tcl_NewWideIntObj(height);
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -4833,7 +4833,7 @@ WmOverrideredirectCmd(
curValue = Tk_Attributes((Tk_Window) winPtr)->override_redirect;
}
if (objc == 3) {
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(curValue));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(curValue != 0));
return TCL_OK;
}
if (Tcl_GetBooleanFromObj(interp, objv[3], &boolean) != TCL_OK) {
@@ -5060,8 +5060,8 @@ WmResizableCmd(
if (objc == 3) {
Tcl_Obj *results[2];
- results[0] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
- results[1] = Tcl_NewBooleanObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
+ results[0] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_WIDTH_NOT_RESIZABLE));
+ results[1] = Tcl_NewWideIntObj(!(wmPtr->flags&WM_HEIGHT_NOT_RESIZABLE));
Tcl_SetObjResult(interp, Tcl_NewListObj(2, results));
return TCL_OK;
}
@@ -5279,7 +5279,7 @@ WmStackorderCmd(
} else { /* OPT_ISBELOW */
result = index1 < index2;
}
- Tcl_SetObjResult(interp, Tcl_NewBooleanObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result));
return TCL_OK;
}
}