summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-14 11:46:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-12-14 11:46:52 (GMT)
commit5357570e1f8319ecea3ce3c930913200ebc485dd (patch)
tree5eb91720f2a780a9857925f899b41a90af702333 /generic
parentd3accd1f1590ad5fd9a5bac5f611912c8dd9809c (diff)
parent953c81157e52a85fb0e0322336b34ee6367ea6d4 (diff)
downloadtk-5357570e1f8319ecea3ce3c930913200ebc485dd.zip
tk-5357570e1f8319ecea3ce3c930913200ebc485dd.tar.gz
tk-5357570e1f8319ecea3ce3c930913200ebc485dd.tar.bz2
Merge 8.6. Make anchorStrings, reliefString and justifyString MODULE_SCOPE
Diffstat (limited to 'generic')
-rw-r--r--generic/tk3d.c4
-rw-r--r--generic/tkGet.c8
-rw-r--r--generic/tkInt.h12
-rw-r--r--generic/ttk/ttkEntry.c8
4 files changed, 19 insertions, 13 deletions
diff --git a/generic/tk3d.c b/generic/tk3d.c
index 249d62c..e988d3e 100644
--- a/generic/tk3d.c
+++ b/generic/tk3d.c
@@ -19,7 +19,7 @@
* by Tk_GetReliefFromObj.
*/
-static const char *const reliefStrings[] = {
+const char *const tkReliefStrings[] = {
"flat", "groove", "raised", "ridge", "solid", "sunken", NULL
};
@@ -623,7 +623,7 @@ Tk_GetReliefFromObj(
* from. */
int *resultPtr) /* Where to place the answer. */
{
- return Tcl_GetIndexFromObjStruct(interp, objPtr, reliefStrings,
+ return Tcl_GetIndexFromObjStruct(interp, objPtr, tkReliefStrings,
sizeof(char *), "relief", 0, resultPtr);
}
diff --git a/generic/tkGet.c b/generic/tkGet.c
index cc8c6f9..7df6ead 100644
--- a/generic/tkGet.c
+++ b/generic/tkGet.c
@@ -35,10 +35,10 @@ static void FreeUidThreadExitProc(ClientData clientData);
* used by Tk_GetAnchorFromObj and Tk_GetJustifyFromObj.
*/
-static const char *const anchorStrings[] = {
+const char *const tkAnchorStrings[] = {
"n", "ne", "e", "se", "s", "sw", "w", "nw", "center", NULL
};
-static const char *const justifyStrings[] = {
+const char *const tkJustifyStrings[] = {
"left", "right", "center", NULL
};
@@ -71,7 +71,7 @@ Tk_GetAnchorFromObj(
{
int index, code;
- code = Tcl_GetIndexFromObj(interp, objPtr, anchorStrings, "anchor", 0,
+ code = Tcl_GetIndexFromObj(interp, objPtr, tkAnchorStrings, "anchor", 0,
&index);
if (code == TCL_OK) {
*anchorPtr = (Tk_Anchor) index;
@@ -385,7 +385,7 @@ Tk_GetJustifyFromObj(
{
int index, code;
- code = Tcl_GetIndexFromObj(interp, objPtr, justifyStrings,
+ code = Tcl_GetIndexFromObj(interp, objPtr, tkJustifyStrings,
"justification", 0, &index);
if (code == TCL_OK) {
*justifyPtr = (Tk_Justify) index;
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 031630b..0e46a52 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -125,9 +125,7 @@
/*
* Fallback in case Tk is linked against a Tcl version not having TIP #585
- * (TCL_INDEX_TEMP_TABLE flag). This allows to use the internal
- * INDEX_TEMP_TABLE flag of Tcl. However this is rather ugly and not robust
- * since nothing prevents Tcl from changing the value of its internal flags!
+ * (TCL_INDEX_TEMP_TABLE).
*/
#if !defined(TCL_INDEX_TEMP_TABLE)
@@ -912,6 +910,14 @@ typedef struct TkWindow {
} TkWindow;
/*
+ * String tables:
+ */
+
+MODULE_SCOPE const char *const tkAnchorStrings[];
+MODULE_SCOPE const char *const tkReliefStrings[];
+MODULE_SCOPE const char *const tkJustifyStrings[];
+
+/*
* Real definition of some events. Note that these events come from outside
* but have internally generated pieces added to them.
*/
diff --git a/generic/ttk/ttkEntry.c b/generic/ttk/ttkEntry.c
index 0069199..b0502a4 100644
--- a/generic/ttk/ttkEntry.c
+++ b/generic/ttk/ttkEntry.c
@@ -1396,10 +1396,10 @@ EntryIndex(
if (idx == TCL_INDEX_NONE) {
idx = 0;
} else if (idx > entryPtr->entry.numChars) {
- idx = entryPtr->entry.numChars;
- }
- *indexPtr = idx;
- return TCL_OK;
+ idx = entryPtr->entry.numChars;
+ }
+ *indexPtr = idx;
+ return TCL_OK;
}
string = Tcl_GetStringFromObj(indexObj, &length);