summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-09 15:51:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-09 15:51:07 (GMT)
commit21137085136c518a6811a89cd8389902dd698d5c (patch)
tree5c5e14e486942a46b329a793f3a2f1334a5384e1 /generic
parentdb5334e96c94245cfd513a3d474a1281ef958641 (diff)
parent19d77c785d7d580ccdc9437a07715c05e672676b (diff)
downloadtk-21137085136c518a6811a89cd8389902dd698d5c.zip
tk-21137085136c518a6811a89cd8389902dd698d5c.tar.gz
tk-21137085136c518a6811a89cd8389902dd698d5c.tar.bz2
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r--generic/nanosvg.h5
-rw-r--r--generic/nanosvgrast.h8
-rw-r--r--generic/tkCanvas.c5
-rw-r--r--generic/tkCmds.c3
-rw-r--r--generic/tkEntry.c4
-rw-r--r--generic/tkFont.c3
-rw-r--r--generic/tkFrame.c2
-rw-r--r--generic/tkGrid.c5
-rw-r--r--generic/tkImgGIF.c14
-rw-r--r--generic/tkImgListFormat.c7
-rw-r--r--generic/tkMenu.c7
-rw-r--r--generic/tkObj.c2
-rw-r--r--generic/tkPack.c3
-rw-r--r--generic/tkText.c15
-rw-r--r--generic/tkText.h2
-rw-r--r--generic/tkTextBTree.c2
-rw-r--r--generic/tkTextDisp.c3
-rw-r--r--generic/tkTextTag.c16
-rw-r--r--generic/tkWindow.c2
-rw-r--r--generic/ttk/ttkTreeview.c2
20 files changed, 67 insertions, 43 deletions
diff --git a/generic/nanosvg.h b/generic/nanosvg.h
index 985f0ad..8cf637d 100644
--- a/generic/nanosvg.h
+++ b/generic/nanosvg.h
@@ -209,12 +209,11 @@ NANOSVG_SCOPE void nsvgDelete(NSVGimage* image);
}
#endif
-#endif /* NANOSVG_H */
-
#ifdef NANOSVG_IMPLEMENTATION
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#include <math.h>
#define NSVG_PI (3.14159265358979323846264338327f)
@@ -3121,3 +3120,5 @@ void nsvgDelete(NSVGimage* image)
}
#endif
+
+#endif /* NANOSVG_H */
diff --git a/generic/nanosvgrast.h b/generic/nanosvgrast.h
index 3625238..49c33b1 100644
--- a/generic/nanosvgrast.h
+++ b/generic/nanosvgrast.h
@@ -25,6 +25,8 @@
#ifndef NANOSVGRAST_H
#define NANOSVGRAST_H
+#include "nanosvg.h"
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -84,11 +86,11 @@ NANOSVG_SCOPE void nsvgDeleteRasterizer(NSVGrasterizer*);
}
#endif
-#endif /* NANOSVGRAST_H */
-
#ifdef NANOSVGRAST_IMPLEMENTATION
#include <math.h>
+#include <stdlib.h>
+#include <string.h>
#define NSVG__SUBSAMPLES 5
#define NSVG__FIXSHIFT 10
@@ -1469,3 +1471,5 @@ void nsvgRasterize(NSVGrasterizer* r,
}
#endif
+
+#endif /* NANOSVGRAST_H */
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index ed9f2b6..12939e6 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -598,7 +598,8 @@ DefaultRotateImplementation(
double y,
double angleRadians)
{
- int objc, i, ok = 1;
+ TkSizeT i, objc;
+ int ok = 1;
Tcl_Obj **objv, **newObjv;
double *coordv;
double s = sin(angleRadians);
@@ -2382,7 +2383,7 @@ ConfigureCanvas(
canvasPtr->scrollX2 = 0;
canvasPtr->scrollY2 = 0;
if (canvasPtr->regionString != NULL) {
- int argc2;
+ TkSizeT argc2;
const char **argv2;
if (Tcl_SplitList(canvasPtr->interp, canvasPtr->regionString,
diff --git a/generic/tkCmds.c b/generic/tkCmds.c
index b4c6cc6..ec48f91 100644
--- a/generic/tkCmds.c
+++ b/generic/tkCmds.c
@@ -349,8 +349,7 @@ Tk_BindtagsObjCmd(
{
Tk_Window tkwin = (Tk_Window)clientData;
TkWindow *winPtr, *winPtr2;
- TkSizeT i;
- int length;
+ TkSizeT i, length;
const char *p;
Tcl_Obj *listPtr, **tags;
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index 26e4d86..b291acd 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -1261,7 +1261,7 @@ ConfigureEntry(
sbPtr->listObj = NULL;
if (sbPtr->valueStr != NULL) {
Tcl_Obj *newObjPtr;
- int nelems;
+ TkSizeT nelems;
newObjPtr = Tcl_NewStringObj(sbPtr->valueStr, -1);
if (Tcl_ListObjLength(interp, newObjPtr, &nelems)
@@ -4426,7 +4426,7 @@ SpinboxInvoke(
* there. If not, move to the first element of the list.
*/
- int i, listc;
+ TkSizeT i, listc;
TkSizeT elemLen, length = entryPtr->numChars;
const char *bytes;
Tcl_Obj **listv;
diff --git a/generic/tkFont.c b/generic/tkFont.c
index 74c617f..0010d12 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -3671,7 +3671,8 @@ ParseFontNameObj(
* default values. */
{
const char *dash;
- int objc, result, i, n;
+ int result, n;
+ TkSizeT objc, i;
Tcl_Obj **objv;
const char *string;
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 2b45c31..e84b2b6 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -489,7 +489,7 @@ TkListCreateFrame(
* Gives the base name to use for the new
* application. */
{
- int objc;
+ TkSizeT objc;
Tcl_Obj **objv;
if (TCL_OK != Tcl_ListObjGetElements(interp, listObj, &objc, &objv)) {
diff --git a/generic/tkGrid.c b/generic/tkGrid.c
index cda36f1..d796110 100644
--- a/generic/tkGrid.c
+++ b/generic/tkGrid.c
@@ -983,10 +983,11 @@ GridRowColumnConfigureCommand(
int slot; /* the column or row number */
int slotType; /* COLUMN or ROW */
int size; /* the configuration value */
- int lObjc; /* Number of items in index list */
+ TkSizeT lObjc; /* Number of items in index list */
Tcl_Obj **lObjv; /* array of indices */
int ok; /* temporary TCL result code */
- int i, j, first, last;
+ int i, first, last;
+ TkSizeT j;
const char *string;
static const char *const optionStrings[] = {
"-minsize", "-pad", "-uniform", "-weight", NULL
diff --git a/generic/tkImgGIF.c b/generic/tkImgGIF.c
index 594ec1e..b9c908b 100644
--- a/generic/tkImgGIF.c
+++ b/generic/tkImgGIF.c
@@ -634,6 +634,13 @@ FileReadGIF(
imageHeight, colorMap, 0, 0, 0, -1) != TCL_OK) {
goto error;
}
+
+ /*
+ * This extension starts a new scope, so Graphic control Extension
+ * data should be cleared
+ */
+ transparent = -1;
+
continue;
}
break;
@@ -1067,7 +1074,12 @@ DoExtension(
switch (label) {
case 0x01: /* Plain Text Extension */
- /* this extension is ignored, skip below */
+ /*
+ * This extension starts a new scope, so Graphic control Extension
+ * data should be cleared
+ */
+ *transparent = -1;
+ /* this extension is ignored, skip below */
break;
case 0xf9: /* Graphic Control Extension */
count = GetDataBlock(gifConfPtr, chan, buf);
diff --git a/generic/tkImgListFormat.c b/generic/tkImgListFormat.c
index 824d303..f5b416a 100644
--- a/generic/tkImgListFormat.c
+++ b/generic/tkImgListFormat.c
@@ -196,8 +196,7 @@ ParseFormatOptions(
* this struct */
{
- int index, optIndex, first;
- enum ColorFormatType typeIndex;
+ int index, optIndex, first, typeIndex;
const char *option;
first = 1;
@@ -258,7 +257,7 @@ ParseFormatOptions(
return TCL_ERROR;
}
if (Tcl_GetIndexFromObj(NULL, objv[index], colorFormatNames, "",
- TCL_EXACT, (int *)&typeIndex) != TCL_OK
+ TCL_EXACT, &typeIndex) != TCL_OK
|| (typeIndex != COLORFORMAT_LIST
&& typeIndex != COLORFORMAT_RGB2
&& typeIndex != COLORFORMAT_RGBA2) ) {
@@ -269,7 +268,7 @@ ParseFormatOptions(
"BAD_COLOR_FORMAT", NULL);
return TCL_ERROR;
}
- optPtr->colorFormat = typeIndex;
+ optPtr->colorFormat = (enum ColorFormatType)typeIndex;
break;
default:
Tcl_Panic("ParseFormatOptions: unexpected switch fallthrough");
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index c1696f4..4730575 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -2690,7 +2690,8 @@ CloneMenu(
* menubar, or a tearoff? */
{
int returnResult;
- int menuType, i;
+ int menuType;
+ TkSizeT i;
TkMenuReferences *menuRefPtr;
Tcl_Obj *menuDupCommandArray[4];
@@ -2730,7 +2731,7 @@ CloneMenu(
&& (menuPtr->numEntries == menuRefPtr->menuPtr->numEntries)) {
TkMenu *newMenuPtr = menuRefPtr->menuPtr;
Tcl_Obj *newObjv[3];
- int numElements;
+ TkSizeT numElements;
/*
* Now put this newly created menu into the parent menu's instance
@@ -2801,7 +2802,7 @@ CloneMenu(
* Clone all of the cascade menus that this menu points to.
*/
- for (i = 0; i < (int)menuPtr->numEntries; i++) {
+ for (i = 0; i < menuPtr->numEntries; i++) {
TkMenuReferences *cascadeRefPtr;
TkMenu *oldCascadePtr;
diff --git a/generic/tkObj.c b/generic/tkObj.c
index 28e0be3..1577be9 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -1116,7 +1116,7 @@ TkParsePadAmount(
int *allPtr) /* Write the total padding here */
{
int firstInt, secondInt; /* The two components of the padding */
- int objc; /* The length of the list (should be 1 or 2) */
+ TkSizeT objc; /* The length of the list (should be 1 or 2) */
Tcl_Obj **objv; /* The objects in the list */
/*
diff --git a/generic/tkPack.c b/generic/tkPack.c
index 29e4cec..8d91f2b 100644
--- a/generic/tkPack.c
+++ b/generic/tkPack.c
@@ -1111,7 +1111,8 @@ PackAfter(
Packer *packPtr;
Tk_Window tkwin, ancestor, parent;
Tcl_Obj **options;
- int index, optionCount, c;
+ int c;
+ TkSizeT index, optionCount;
/*
* Iterate over all of the window specifiers, each consisting of two
diff --git a/generic/tkText.c b/generic/tkText.c
index deeeec8..ef4763d 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -2956,7 +2956,8 @@ TextUndoRedoCallback(
* shared text data structure. */
{
TkSharedText *sharedPtr = (TkSharedText *)clientData;
- int res, objc;
+ int res;
+ TkSizeT objc;
Tcl_Obj **objv;
TkText *textPtr;
@@ -3121,7 +3122,7 @@ DeleteIndexRange(
int pixels[2*PIXEL_CLIENTS];
Tcl_HashSearch search;
Tcl_HashEntry *hPtr;
- int i;
+ TkSizeT i;
if (sharedTextPtr == NULL) {
sharedTextPtr = textPtr->sharedTextPtr;
@@ -3167,7 +3168,7 @@ DeleteIndexRange(
line2 = TkBTreeLinesTo(textPtr, index2.linePtr);
if (line2 == TkBTreeNumLines(sharedTextPtr->tree, textPtr)) {
TkTextTag **arrayPtr;
- int arraySize;
+ TkSizeT arraySize;
TkTextIndex oldIndex2;
oldIndex2 = index2;
@@ -3729,12 +3730,12 @@ TextInsertCmd(
if (objc > (j+1)) {
Tcl_Obj **tagNamePtrs;
TkTextTag **oldTagArrayPtr;
- int numTags;
+ TkSizeT numTags;
TkTextIndexForwBytes(textPtr, &index1, length, &index2);
oldTagArrayPtr = TkBTreeGetTags(&index1, NULL, &numTags);
if (oldTagArrayPtr != NULL) {
- int i;
+ TkSizeT i;
for (i = 0; i < numTags; i++) {
TkBTreeTag(&index1, &index2, oldTagArrayPtr[i], 0);
@@ -3745,7 +3746,7 @@ TextInsertCmd(
&tagNamePtrs) != TCL_OK) {
return TCL_ERROR;
} else {
- int i;
+ TkSizeT i;
for (i = 0; i < numTags; i++) {
const char *strTag = Tcl_GetString(tagNamePtrs[i]);
@@ -4491,7 +4492,7 @@ TkTextGetTabs(
Tcl_Obj *stringPtr) /* Description of the tab stops. See the text
* manual entry for details. */
{
- int objc, i, count;
+ TkSizeT objc, i, count;
Tcl_Obj **objv;
TkTextTabArray *tabArrayPtr;
TkTextTab *tabPtr;
diff --git a/generic/tkText.h b/generic/tkText.h
index aba6b3b..3a24ad8 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -1026,7 +1026,7 @@ MODULE_SCOPE TkTextLine *TkBTreeFindPixelLine(TkTextBTree tree,
const TkText *textPtr, int pixels,
int *pixelOffset);
MODULE_SCOPE TkTextTag **TkBTreeGetTags(const TkTextIndex *indexPtr,
- const TkText *textPtr, int *numTagsPtr);
+ const TkText *textPtr, TkSizeT *numTagsPtr);
MODULE_SCOPE void TkBTreeInsertChars(TkTextBTree tree,
TkTextIndex *indexPtr, const char *string);
MODULE_SCOPE int TkBTreeLinesTo(const TkText *textPtr,
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c
index e609126..9b38352 100644
--- a/generic/tkTextBTree.c
+++ b/generic/tkTextBTree.c
@@ -3361,7 +3361,7 @@ TkBTreeGetTags(
const TkText *textPtr, /* If non-NULL, then only return tags for this
* text widget (when there are peer
* widgets). */
- int *numTagsPtr) /* Store number of tags found at this
+ TkSizeT *numTagsPtr) /* Store number of tags found at this
* location. */
{
Node *nodePtr;
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 303c3d5..43faf40 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -777,7 +777,8 @@ GetStyle(
StyleValues styleValues;
TextStyle *stylePtr;
Tcl_HashEntry *hPtr;
- int numTags, isNew, i;
+ TkSizeT numTags, i;
+ int isNew;
int isSelected;
XGCValues gcValues;
unsigned long mask;
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c
index 9d4e874..e519ade 100644
--- a/generic/tkTextTag.c
+++ b/generic/tkTextTag.c
@@ -131,7 +131,8 @@ TkTextTagCmd(
TAG_NAMES, TAG_NEXTRANGE, TAG_PREVRANGE, TAG_RAISE, TAG_RANGES,
TAG_REMOVE
};
- int optionIndex, i;
+ int optionIndex;
+ TkSizeT i;
TkTextTag *tagPtr;
TkTextIndex index1, index2;
@@ -169,12 +170,12 @@ TkTextTagCmd(
*/
textPtr->sharedTextPtr->stateEpoch++;
}
- for (i = 4; i < objc; i += 2) {
+ for (i = 4; i < (TkSizeT)objc; i += 2) {
if (TkTextGetObjIndex(interp, textPtr, objv[i],
&index1) != TCL_OK) {
return TCL_ERROR;
}
- if (objc > (i+1)) {
+ if ((TkSizeT)objc > (i+1)) {
if (TkTextGetObjIndex(interp, textPtr, objv[i+1],
&index2) != TCL_OK) {
return TCL_ERROR;
@@ -536,7 +537,7 @@ TkTextTagCmd(
Tcl_WrongNumArgs(interp, 3, objv, "tagName ?tagName ...?");
return TCL_ERROR;
}
- for (i = 3; i < objc; i++) {
+ for (i = 3; i < (TkSizeT)objc; i++) {
hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->tagTable,
Tcl_GetString(objv[i]));
if (hPtr == NULL) {
@@ -598,7 +599,7 @@ TkTextTagCmd(
}
case TAG_NAMES: {
TkTextTag **arrayPtr;
- int arraySize;
+ TkSizeT arraySize;
Tcl_Obj *listObj;
if ((objc != 3) && (objc != 4)) {
@@ -1463,7 +1464,7 @@ TkTextBindProc(
TkTextIndex index;
TkTextTag** tagArrayPtr;
- int numTags;
+ TkSizeT numTags;
TkTextMarkNameToIndex(textPtr, "insert", &index);
tagArrayPtr = TkBTreeGetTags(&index, textPtr, &numTags);
@@ -1524,7 +1525,8 @@ TkTextPickCurrent(
TkTextTag **copyArrayPtr = NULL;
/* Initialization needed to prevent compiler
* warning. */
- int numOldTags, numNewTags, i, j, nearby;
+ int numOldTags, i, nearby;
+ TkSizeT numNewTags, j;
size_t size;
XEvent event;
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 904a336..e8a2a19 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -3248,7 +3248,7 @@ Initialize(
}
if (value) {
- int objc;
+ TkSizeT objc;
Tcl_Obj **objv, **rest;
Tcl_Obj *parseList = Tcl_NewListObj(1, NULL);
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index 8e57e39..e70bf04 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -729,7 +729,7 @@ static TreeItem **GetItemListFromObj(
{
TreeItem **items;
Tcl_Obj **elements;
- int i, nElements;
+ TkSizeT i, nElements;
if (Tcl_ListObjGetElements(interp,objPtr,&nElements,&elements) != TCL_OK) {
return NULL;