diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkGrid.c | 2 | ||||
-rw-r--r-- | generic/tkImage.c | 3 | ||||
-rw-r--r-- | generic/tkInt.h | 6 | ||||
-rw-r--r-- | generic/tkPack.c | 4 | ||||
-rw-r--r-- | generic/tkPlace.c | 4 | ||||
-rw-r--r-- | generic/tkSelect.c | 2 | ||||
-rw-r--r-- | generic/tkStubInit.c | 2 | ||||
-rw-r--r-- | generic/tkText.h | 2 | ||||
-rw-r--r-- | generic/tkTextDisp.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkManager.c | 16 |
10 files changed, 25 insertions, 20 deletions
diff --git a/generic/tkGrid.c b/generic/tkGrid.c index 00a8546..067407a 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -384,8 +384,8 @@ Tk_GridObjCmd( return GridPropagateCommand(tkwin, interp, objc, objv); case GRID_SIZE: return GridSizeCommand(tkwin, interp, objc, objv); - case GRID_CONTENT: case GRID_SLAVES: + case GRID_CONTENT: return GridContentCommand(tkwin, interp, objc, objv); /* diff --git a/generic/tkImage.c b/generic/tkImage.c index e4015fd..23d7ecf 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -104,12 +104,11 @@ static void EventuallyDeleteImage(ImageModel *modelPtr, static void ImageTypeThreadExitProc( - ClientData dummy) /* not used */ + TCL_UNUSED(void *)) { Tk_ImageType *freePtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); - (void)dummy; while (tsdPtr->oldImageTypeList != NULL) { freePtr = tsdPtr->oldImageTypeList; diff --git a/generic/tkInt.h b/generic/tkInt.h index 354573f..1f6f333 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -81,6 +81,12 @@ # endif #endif +#if defined(__GNUC__) && (__GNUC__ > 2) +# define TKFLEXARRAY 0 +#else +# define TKFLEXARRAY 1 +#endif + #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 7) # define Tcl_WCharToUtfDString ((char * (*)(const WCHAR *, int len, Tcl_DString *))Tcl_UniCharToUtfDString) # define Tcl_UtfToWCharDString ((WCHAR * (*)(const char *, int len, Tcl_DString *))Tcl_UtfToUniCharDString) diff --git a/generic/tkPack.c b/generic/tkPack.c index 65a2512..d73de4a 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -445,8 +445,8 @@ Tk_PackObjCmd( } break; } - case PACK_CONTENT: - case PACK_SLAVES: { + case PACK_SLAVES: + case PACK_CONTENT: { Tk_Window container; Packer *containerPtr, *contentPtr; Tcl_Obj *resultObj; diff --git a/generic/tkPlace.c b/generic/tkPlace.c index fdfc3e4..01386a2 100644 --- a/generic/tkPlace.c +++ b/generic/tkPlace.c @@ -330,8 +330,8 @@ Tk_PlaceObjCmd( } return PlaceInfoCommand(interp, tkwin); - case PLACE_CONTENT: - case PLACE_SLAVES: { + case PLACE_SLAVES: + case PLACE_CONTENT: { Container *containerPtr; if (objc != 3) { diff --git a/generic/tkSelect.c b/generic/tkSelect.c index a45aa4b..fda2dc3 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/tkStubInit.c b/generic/tkStubInit.c index 7adf4c2..c1151d4 100644 --- a/generic/tkStubInit.c +++ b/generic/tkStubInit.c @@ -115,7 +115,7 @@ static Tk_Style Tk_GetStyleFromObj(Tcl_Obj *obj) (const char *(*) (void *,Tk_Window, char *, int, \ Tcl_FreeProc **))(void *)TkCanvasTagsPrintProc -#if !defined(MAC_OSX_TK) +#if !defined(MAC_OSX_TK) && defined(MAC_OSX_TCL) # undef TkpWillDrawWidget # undef TkpRedrawWidget # define TkpWillDrawWidget ((int (*)(Tk_Window))(void *)doNothing) diff --git a/generic/tkText.h b/generic/tkText.h index 61a2a53..973ae74 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[0]; /* 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. */ diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index abcd3e3..d56a675 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -444,8 +444,8 @@ typedef struct TextDInfo { typedef struct CharInfo { int numBytes; /* Number of bytes to display. */ - char chars[1]; /* UTF characters to display. Actual size will - * be numBytes, not 1. THIS MUST BE THE LAST + 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/generic/ttk/ttkManager.c b/generic/ttk/ttkManager.c index 9ea70ec..0d41d21 100644 --- a/generic/ttk/ttkManager.c +++ b/generic/ttk/ttkManager.c @@ -462,7 +462,7 @@ int Ttk_GetContentIndexFromObj( return TCL_OK; } - /* Try interpreting as a content window name; + /* Try interpreting as a window name; */ if ((*string == '.') && (tkwin = Tk_NameToWindow(interp, string, mgr->window))) { @@ -504,20 +504,20 @@ void Ttk_ReorderContent(Ttk_Manager *mgr, TkSizeT fromIndex, TkSizeT toIndex) /* ASSERT: fromIndex == toIndex */ mgr->content[fromIndex] = moved; - /* Schedule a relayout. In general, rearranging contents + /* Schedule a relayout. In general, rearranging content * may also change the size: */ ScheduleUpdate(mgr, MGR_RESIZE_REQUIRED); } -/* ++ Ttk_Maintainable(interp, content, container) -- +/* ++ Ttk_Maintainable(interp, window, container) -- * Utility routine. Verifies that 'container' may be used to maintain - * the geometry of 'content' via Tk_MaintainGeometry: + * the geometry of 'window' via Tk_MaintainGeometry: * - * + 'container' is either 'content's parent -OR- - * + 'container is a descendant of 'content's parent. - * + 'content' is not a toplevel window - * + 'content' belongs to the same toplevel as 'container' + * + 'container' is either 'window's parent -OR- + * + 'container is a descendant of 'window's parent. + * + 'window' is not a toplevel window + * + 'window' belongs to the same toplevel as 'container' * * Returns: 1 if OK; otherwise 0, leaving an error message in 'interp'. */ |