summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-11 08:56:31 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-11 08:56:31 (GMT)
commit4a8b7efd011cd0b919533728fcb8d6697bafd271 (patch)
tree10068d4fd2b33288abf2b3ea6339b4b86f25819b
parent0d9815b244b0073e85619a33eeed5041def2dc5b (diff)
parentdb31b9f1cedb54fbdc52442ea1c21bf06c556b68 (diff)
downloadtk-4a8b7efd011cd0b919533728fcb8d6697bafd271.zip
tk-4a8b7efd011cd0b919533728fcb8d6697bafd271.tar.gz
tk-4a8b7efd011cd0b919533728fcb8d6697bafd271.tar.bz2
Merge 8.6
-rw-r--r--generic/tkFont.c2
-rw-r--r--generic/tkInt.h5
-rw-r--r--generic/tkPointer.c2
-rw-r--r--generic/tkSelect.c2
-rw-r--r--generic/tkText.h4
-rw-r--r--generic/tkTextDisp.c2
-rw-r--r--unix/tkUnixWm.c2
-rw-r--r--win/tkWinFont.c6
-rw-r--r--win/tkWinWm.c2
9 files changed, 16 insertions, 11 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c
index b230fff..7155cc1 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -96,7 +96,7 @@ typedef struct TextLayout {
* layout. */
int numChunks; /* Number of chunks actually used in following
* array. */
- LayoutChunk chunks[1]; /* Array of chunks. The actual size will be
+ LayoutChunk chunks[TKFLEXARRAY];/* Array of chunks. The actual size will be
* maxChunks. THIS FIELD MUST BE THE LAST IN
* THE STRUCTURE. */
} TextLayout;
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 354573f..0e72161 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -88,6 +88,11 @@
# define Tcl_UtfToChar16DString Tcl_UtfToUniCharDString
#endif
+#if defined(__GNUC__) && (__GNUC__ > 2)
+# define TKFLEXARRAY 0
+#else
+# define TKFLEXARRAY 1
+#endif
#ifndef Tcl_GetParent
# define Tcl_GetParent Tcl_GetMaster
diff --git a/generic/tkPointer.c b/generic/tkPointer.c
index aa739d4..addfd0e 100644
--- a/generic/tkPointer.c
+++ b/generic/tkPointer.c
@@ -25,7 +25,7 @@
typedef struct {
TkWindow *grabWinPtr; /* Window that defines the top of the grab
* tree in a global grab. */
- int lastState; /* Last known state flags. */
+ unsigned lastState; /* Last known state flags. */
XPoint lastPos; /* Last reported mouse position. */
TkWindow *lastWinPtr; /* Last reported mouse window. */
TkWindow *restrictWinPtr; /* Window to which all mouse events will be
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index a2a6018..7cf62c2 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -28,7 +28,7 @@ typedef struct {
* chunk. */
char buffer[4]; /* A buffer to hold part of a UTF character
* that is split across chunks. */
- char command[1]; /* Command to invoke. Actual space is
+ char command[TKFLEXARRAY]; /* Command to invoke. Actual space is
* allocated as large as necessary. This must
* be the last entry in the structure. */
} CommandInfo;
diff --git a/generic/tkText.h b/generic/tkText.h
index 75cab59..e9e6303 100644
--- a/generic/tkText.h
+++ b/generic/tkText.h
@@ -168,7 +168,7 @@ typedef struct TkTextSegment {
TkSizeT size; /* Size of this segment (# of bytes of index
* space it occupies). */
union {
- char chars[2]; /* Characters that make up character info.
+ char chars[TKFLEXARRAY]; /* Characters that make up character info.
* Actual length varies to hold as many
* characters as needed.*/
TkTextToggle toggle; /* Information about tag toggle. */
@@ -489,7 +489,7 @@ typedef struct TkTextTabArray {
double tabIncrement; /* The accurate fractional pixel increment
* between interpolated tabs we have to create
* when we exceed numTabs. */
- TkTextTab tabs[1]; /* Array of tabs. The actual size will be
+ TkTextTab tabs[TKFLEXARRAY];/* Array of tabs. The actual size will be
* numTabs. THIS FIELD MUST BE THE LAST IN THE
* STRUCTURE. */
} TkTextTabArray;
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 61b0a8b..a28f606 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -444,7 +444,7 @@ typedef struct TextDInfo {
typedef struct CharInfo {
int numBytes; /* Number of bytes to display. */
- char chars[1]; /* UTF characters to display.
+ char chars[TKFLEXARRAY]; /* UTF characters to display.
* Allocated as large as necessary. THIS MUST BE THE LAST
* FIELD IN THE STRUCTURE. */
} CharInfo;
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c
index a32f897..06d908b 100644
--- a/unix/tkUnixWm.c
+++ b/unix/tkUnixWm.c
@@ -28,7 +28,7 @@ typedef struct ProtocolHandler {
* same top-level window, or NULL for end of
* list. */
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
- char command[1]; /* Tcl command to invoke when a client message
+ char command[TKFLEXARRAY]; /* Tcl command to invoke when a client message
* for this protocol arrives. The actual size
* of the structure varies to accommodate the
* needs of the actual command. THIS MUST BE
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index e1bbd53..50f2f3b 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1495,9 +1495,9 @@ MultiFontTextOut(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
(int) (p - source), &runString);
- familyPtr->textOutProc(hdc, x-(tm.tmOverhang/2), y,
+ familyPtr->textOutProc(hdc, x-((double)tm.tmOverhang/2), y,
(WCHAR *)Tcl_DStringValue(&runString),
- Tcl_DStringLength(&runString)>>familyPtr->isWideFont);
+ Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
familyPtr->getTextExtentPoint32Proc(hdc,
(WCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont,
@@ -1517,7 +1517,7 @@ MultiFontTextOut(
familyPtr = lastSubFontPtr->familyPtr;
Tcl_UtfToExternalDString(familyPtr->encoding, source,
(int) (p - source), &runString);
- familyPtr->textOutProc(hdc, x-(tm.tmOverhang/2), y,
+ familyPtr->textOutProc(hdc, x-((double)tm.tmOverhang/2), y,
(WCHAR *)Tcl_DStringValue(&runString),
Tcl_DStringLength(&runString) >> familyPtr->isWideFont);
Tcl_DStringFree(&runString);
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 9d3902a..324511a 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -58,7 +58,7 @@ typedef struct ProtocolHandler {
* same top-level window, or NULL for end of
* list. */
Tcl_Interp *interp; /* Interpreter in which to invoke command. */
- char command[1]; /* Tcl command to invoke when a client message
+ char command[TKFLEXARRAY]; /* Tcl command to invoke when a client message
* for this protocol arrives. The actual size
* of the structure varies to accommodate the
* needs of the actual command. THIS MUST BE