From fe2b267ee9d5dff5839a3d018e8a200c2dd368ba Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 15 Oct 2018 18:53:37 +0000 Subject: Add support for "wine", and fix 2 test-cases which fail in wine --- tests/winFont.test | 4 ++-- win/Makefile.in | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/winFont.test b/tests/winFont.test index 93aeca9..662eb10 100644 --- a/tests/winFont.test +++ b/tests/winFont.test @@ -80,7 +80,7 @@ test winfont-2.8 {TkpGetFontFromAttributes procedure: Courier fonts} -constraint lappend x [font actual {-family "Courier"} -family] lappend x [font actual {-family "Monaco"} -family] lappend x [font actual {-family "Courier New"} -family] -} -result {Courier Courier {Courier New}} +} -match regexp -result {Courier (Courier|Monaco) {Courier New}} test winfont-2.9 {TkpGetFontFromAttributes procedure: Helvetica fonts} -constraints { win } -setup { @@ -89,7 +89,7 @@ test winfont-2.9 {TkpGetFontFromAttributes procedure: Helvetica fonts} -constrai lappend x [font actual {-family "Helvetica"} -family] lappend x [font actual {-family "Geneva"} -family] lappend x [font actual {-family "Arial"} -family] -} -result {Helvetica Helvetica Arial} +} -match regexp -result {Helvetica (Helvetica|Geneva) Arial} test winfont-2.10 {TkpGetFontFromAttributes procedure: fallback} -constraints { win } -body { diff --git a/win/Makefile.in b/win/Makefile.in index 3c1c9e3..f0352196 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -216,6 +216,7 @@ NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED # required just to do a normal build although it can be required to run # make dist. TCL_EXE = @TCLSH_PROG@ +WINE = @WINE@ CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ -I"${GENERIC_DIR_NATIVE}" -I"${WIN_DIR_NATIVE}" \ @@ -440,23 +441,23 @@ $(MAN2TCL): $(TCL_SRC_DIR)/tools/man2tcl.c test: test-classic test-ttk test-classic: binaries $(TKTEST) $(TEST_DLL_FILE) $(CAT32) - $(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" \ - $(TESTFLAGS) | ./$(CAT32) + $(SHELL_ENV) $(WINE) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/all.tcl" \ + $(TESTFLAGS) | $(WINE) ./$(CAT32) test-ttk: binaries $(TKTEST) $(TEST_DLL_FILE) $(CAT32) - $(SHELL_ENV) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/ttk/all.tcl" \ - $(TESTFLAGS) | ./$(CAT32) + $(SHELL_ENV) $(WINE) ./$(TKTEST) "$(ROOT_DIR_NATIVE)/tests/ttk/all.tcl" \ + $(TESTFLAGS) | $(WINE) ./$(CAT32) runtest: binaries $(TKTEST) $(TEST_DLL_FILE) - $(SHELL_ENV) ./$(TKTEST) $(TESTFLAGS) $(SCRIPT) + $(SHELL_ENV) $(WINE) ./$(TKTEST) $(TESTFLAGS) $(SCRIPT) # This target can be used to run wish from the build directory # via `make shell` or `make shell SCRIPT=foo.tcl` shell: binaries - $(SHELL_ENV) ./$(WISH) $(SCRIPT) + $(SHELL_ENV) $(WINE) ./$(WISH) $(SCRIPT) demo: $(WISH) - $(SHELL_ENV) ./$(WISH) $(ROOT_DIR)/library/demos/widget + $(SHELL_ENV) $(WINE) ./$(WISH) $(ROOT_DIR)/library/demos/widget # This target can be used to run wish inside either gdb or insight gdb: binaries -- cgit v0.12 From 2c6df21a22544260bc790e12db7c701c7653d376 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 15 Oct 2018 18:55:40 +0000 Subject: Use more size_t internally, comparable with TIP #494 but then in Tk. Eliminate unnecessary type casts --- generic/tk.h | 31 +++++++++++++++++++++------- generic/tkConfig.c | 56 +++++++++++++++++++++++++------------------------- generic/tkInt.h | 4 ++++ generic/tkOldConfig.c | 21 ++++++++++--------- generic/tkTest.c | 2 +- generic/tkTextBTree.c | 8 ++++---- generic/tkTextDisp.c | 2 +- generic/tkTextImage.c | 2 +- generic/tkTextMark.c | 4 ++-- generic/tkTextWind.c | 4 ++-- generic/ttk/ttkTheme.c | 2 +- unix/tkUnixWm.c | 2 +- win/tkWinWm.c | 2 +- 13 files changed, 81 insertions(+), 59 deletions(-) diff --git a/generic/tk.h b/generic/tk.h index 412c561..a0affbc 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -190,13 +190,14 @@ typedef struct Tk_OptionSpec { const char *defValue; /* Default value for option if not specified * in command line, the option database, or * the system. */ - int objOffset; /* Where in record to store a Tcl_Obj * that +#if TCL_MAJOR_VERSION > 8 + size_t objOffset; /* Where in record to store a Tcl_Obj * that * holds the value of this option, specified * as an offset in bytes from the start of the * record. Use the Tk_Offset macro to generate * values for this. -1 means don't store the * Tcl_Obj in the record. */ - int internalOffset; /* Where in record to store the internal + size_t internalOffset; /* Where in record to store the internal * representation of the value of this option, * such as an int or XColor *. This field is * specified as an offset in bytes from the @@ -204,6 +205,10 @@ typedef struct Tk_OptionSpec { * macro to generate values for it. -1 means * don't store the internal representation in * the record. */ +#else + int objOffset; + int internalOffset; +#endif int flags; /* Any combination of the values defined * below. */ const void *clientData; /* An alternate place to put option-specific @@ -290,7 +295,7 @@ typedef struct Tk_SavedOption { double internalForm; /* The old value of the option, in some * internal representation such as an int or * (XColor *). Valid only if the field - * optionPtr->specPtr->objOffset is < 0. The + * optionPtr->specPtr->objOffset is -1. The * space must be large enough to accommodate a * double, a long, or a pointer; right now it * looks like a double (i.e., 8 bytes) is big @@ -310,7 +315,11 @@ typedef struct Tk_SavedOptions { * configuration options. */ Tk_Window tkwin; /* Window associated with recordPtr; needed to * restore certain options. */ - int numItems; /* The number of valid items in items field. */ +#if TCL_MAJOR_VERSION > 8 + size_t numItems; /* The number of valid items in items field. */ +#else + int numItems; +#endif Tk_SavedOption items[TK_NUM_SAVED_OPTIONS]; /* Items used to hold old values. */ struct Tk_SavedOptions *nextPtr; @@ -368,9 +377,13 @@ typedef struct Tk_ConfigSpec { Tk_Uid dbClass; /* Class for option in database. */ Tk_Uid defValue; /* Default value for option if not specified * in command line or database. */ - int offset; /* Where in widget record to store value; use +#if TCL_MAJOR_VERSION > 8 + size_t offset; /* Where in widget record to store value; use * Tk_Offset macro to generate values for * this. */ +#else + int offset; +#endif int specFlags; /* Any combination of the values defined * below; other bits are used internally by * tkConfig.c. */ @@ -1051,8 +1064,12 @@ typedef void (Tk_ItemDCharsProc)(Tk_Canvas canvas, Tk_Item *itemPtr, typedef struct Tk_ItemType { CONST86 char *name; /* The name of this type of item, such as * "line". */ - int itemSize; /* Total amount of space needed for item's +#if TCL_MAJOR_VERSION > 8 + size_t itemSize; /* Total amount of space needed for item's * record. */ +#else + int itemSize; +#endif Tk_ItemCreateProc *createProc; /* Procedure to create a new item of this * type. */ @@ -1177,7 +1194,7 @@ typedef struct Tk_TSOffset { } Tk_TSOffset; /* - * Bit fields in Tk_Offset->flags: + * Bit fields in Tk_TSOffset->flags: */ #define TK_OFFSET_INDEX 1 diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 4e90fab..d0802f3 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -115,14 +115,14 @@ typedef struct OptionTable { * Forward declarations for functions defined later in this file: */ -static int DoObjConfig(Tcl_Interp *interp, char *recordPtr, +static int DoObjConfig(Tcl_Interp *interp, void *recordPtr, Option *optionPtr, Tcl_Obj *valuePtr, Tk_Window tkwin, Tk_SavedOption *savePtr); static void FreeResources(Option *optionPtr, Tcl_Obj *objPtr, - char *internalPtr, Tk_Window tkwin); -static Tcl_Obj * GetConfigList(char *recordPtr, + void *internalPtr, Tk_Window tkwin); +static Tcl_Obj * GetConfigList(void *recordPtr, Option *optionPtr, Tk_Window tkwin); -static Tcl_Obj * GetObjectForOption(char *recordPtr, +static Tcl_Obj * GetObjectForOption(void *recordPtr, Option *optionPtr, Tk_Window tkwin); static Option * GetOption(const char *name, OptionTable *tablePtr); static Option * GetOptionFromObj(Tcl_Interp *interp, @@ -279,7 +279,7 @@ Tk_CreateOptionTable( } } if (((specPtr->type == TK_OPTION_STRING) - && (specPtr->internalOffset >= 0)) + && (specPtr->internalOffset != TCL_AUTO_LENGTH)) || (specPtr->type == TK_OPTION_COLOR) || (specPtr->type == TK_OPTION_FONT) || (specPtr->type == TK_OPTION_BITMAP) @@ -552,7 +552,7 @@ DoObjConfig( Tcl_Interp *interp, /* Interpreter for error reporting. If NULL, * then no message is left if an error * occurs. */ - char *recordPtr, /* The record to modify to hold the new option + void *recordPtr, /* The record to modify to hold the new option * value. */ Option *optionPtr, /* Pointer to information about the option. */ Tcl_Obj *valuePtr, /* New value for option. */ @@ -568,10 +568,10 @@ DoObjConfig( * free the old value). */ { Tcl_Obj **slotPtrPtr, *oldPtr; - char *internalPtr; /* Points to location in record where internal + void *internalPtr; /* Points to location in record where internal * representation of value should be stored, * or NULL. */ - char *oldInternalPtr; /* Points to location in which to save old + void *oldInternalPtr; /* Points to location in which to save old * internal representation of value. */ Tk_SavedOption internal; /* Used to save the old internal * representation of the value if @@ -584,7 +584,7 @@ DoObjConfig( */ specPtr = optionPtr->specPtr; - if (specPtr->objOffset >= 0) { + if (specPtr->objOffset != TCL_AUTO_LENGTH) { slotPtrPtr = (Tcl_Obj **) (recordPtr + specPtr->objOffset); oldPtr = *slotPtrPtr; } else { @@ -597,7 +597,7 @@ DoObjConfig( * object and internal forms, if they exist. */ - if (specPtr->internalOffset >= 0) { + if (specPtr->internalOffset != TCL_AUTO_LENGTH) { internalPtr = recordPtr + specPtr->internalOffset; } else { internalPtr = NULL; @@ -1340,7 +1340,7 @@ Tk_RestoreSavedOptions( Tk_SavedOptions *savePtr) /* Holds saved option information; must have * been passed to Tk_SetOptions. */ { - int i; + size_t i; Option *optionPtr; Tcl_Obj *newPtr; /* New object value of option, which we * replace with old value and free. Taken from @@ -1360,7 +1360,7 @@ Tk_RestoreSavedOptions( ckfree(savePtr->nextPtr); savePtr->nextPtr = NULL; } - for (i = savePtr->numItems - 1; i >= 0; i--) { + for (i = savePtr->numItems - 1; i != (size_t)-1; i--) { optionPtr = savePtr->items[i].optionPtr; specPtr = optionPtr->specPtr; @@ -1369,12 +1369,12 @@ Tk_RestoreSavedOptions( * record. */ - if (specPtr->objOffset >= 0) { + if (specPtr->objOffset != TCL_AUTO_LENGTH) { newPtr = *((Tcl_Obj **) (savePtr->recordPtr + specPtr->objOffset)); } else { newPtr = NULL; } - if (specPtr->internalOffset >= 0) { + if (specPtr->internalOffset != TCL_AUTO_LENGTH) { internalPtr = savePtr->recordPtr + specPtr->internalOffset; } else { internalPtr = NULL; @@ -1390,11 +1390,11 @@ Tk_RestoreSavedOptions( * Now restore the old value of the option. */ - if (specPtr->objOffset >= 0) { + if (specPtr->objOffset != TCL_AUTO_LENGTH) { *((Tcl_Obj **) (savePtr->recordPtr + specPtr->objOffset)) = savePtr->items[i].valuePtr; } - if (specPtr->internalOffset >= 0) { + if (specPtr->internalOffset != TCL_AUTO_LENGTH) { register char *ptr = (char *) &savePtr->items[i].internalForm; CLANG_ASSERT(internalPtr); @@ -1487,7 +1487,7 @@ Tk_FreeSavedOptions( Tk_SavedOptions *savePtr) /* Contains options saved in a previous call * to Tk_SetOptions. */ { - int count; + size_t count; Tk_SavedOption *savedOptionPtr; if (savePtr->nextPtr != NULL) { @@ -1537,7 +1537,7 @@ Tk_FreeConfigOptions( Option *optionPtr; size_t count; Tcl_Obj **oldPtrPtr, *oldPtr; - char *oldInternalPtr; + void *oldInternalPtr; const Tk_OptionSpec *specPtr; for (tablePtr = (OptionTable *) optionTable; tablePtr != NULL; @@ -1548,14 +1548,14 @@ Tk_FreeConfigOptions( if (specPtr->type == TK_OPTION_SYNONYM) { continue; } - if (specPtr->objOffset >= 0) { + if (specPtr->objOffset != TCL_AUTO_LENGTH) { oldPtrPtr = (Tcl_Obj **) (recordPtr + specPtr->objOffset); oldPtr = *oldPtrPtr; *oldPtrPtr = NULL; } else { oldPtr = NULL; } - if (specPtr->internalOffset >= 0) { + if (specPtr->internalOffset != TCL_AUTO_LENGTH) { oldInternalPtr = recordPtr + specPtr->internalOffset; } else { oldInternalPtr = NULL; @@ -1593,10 +1593,10 @@ FreeResources( Option *optionPtr, /* Description of the configuration option. */ Tcl_Obj *objPtr, /* The current value of the option, specified * as an object. */ - char *internalPtr, /* A pointer to an internal representation for + void *internalPtr, /* A pointer to an internal representation for * the option's value, such as an int or * (XColor *). Only valid if - * optionPtr->specPtr->internalOffset >= 0. */ + * optionPtr->specPtr->internalOffset != -1. */ Tk_Window tkwin) /* The window in which this option is used. */ { int internalFormExists; @@ -1607,7 +1607,7 @@ FreeResources( * form, then use the object form. */ - internalFormExists = optionPtr->specPtr->internalOffset >= 0; + internalFormExists = optionPtr->specPtr->internalOffset != TCL_AUTO_LENGTH; switch (optionPtr->specPtr->type) { case TK_OPTION_STRING: if (internalFormExists) { @@ -1781,7 +1781,7 @@ Tk_GetOptionInfo( static Tcl_Obj * GetConfigList( - char *recordPtr, /* Pointer to record holding current values of + void *recordPtr, /* Pointer to record holding current values of * configuration options. */ Option *optionPtr, /* Pointer to information describing a * particular option. */ @@ -1824,7 +1824,7 @@ GetConfigList( } Tcl_ListObjAppendElement(NULL, listPtr, elementPtr); - if (optionPtr->specPtr->objOffset >= 0) { + if (optionPtr->specPtr->objOffset != TCL_AUTO_LENGTH) { elementPtr = *((Tcl_Obj **) (recordPtr + optionPtr->specPtr->objOffset)); if (elementPtr == NULL) { @@ -1859,7 +1859,7 @@ GetConfigList( static Tcl_Obj * GetObjectForOption( - char *recordPtr, /* Pointer to record holding current values of + void *recordPtr, /* Pointer to record holding current values of * configuration options. */ Option *optionPtr, /* Pointer to information describing an option * whose internal value is stored in @@ -1867,7 +1867,7 @@ GetObjectForOption( Tk_Window tkwin) /* Window corresponding to recordPtr. */ { Tcl_Obj *objPtr; - char *internalPtr; /* Points to internal value of option in + void *internalPtr; /* Points to internal value of option in * record. */ internalPtr = recordPtr + optionPtr->specPtr->internalOffset; @@ -2019,7 +2019,7 @@ Tk_GetOptionValue( if (optionPtr->specPtr->type == TK_OPTION_SYNONYM) { optionPtr = optionPtr->extra.synonymPtr; } - if (optionPtr->specPtr->objOffset >= 0) { + if (optionPtr->specPtr->objOffset != TCL_AUTO_LENGTH) { resultPtr = *((Tcl_Obj **) (recordPtr+optionPtr->specPtr->objOffset)); if (resultPtr == NULL) { /* diff --git a/generic/tkInt.h b/generic/tkInt.h index 29c69c9..849781f 100644 --- a/generic/tkInt.h +++ b/generic/tkInt.h @@ -83,6 +83,10 @@ # endif #endif +#ifndef TCL_AUTO_LENGTH +# define TCL_AUTO_LENGTH (-1) +#endif + /* * Opaque type declarations: */ diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index f8f5d1c..4473a3e 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -35,14 +35,14 @@ static int DoConfig(Tcl_Interp *interp, Tk_Window tkwin, Tk_ConfigSpec *specPtr, Tk_Uid value, - int valueIsUid, char *widgRec); + int valueIsUid, void *widgRec); static Tk_ConfigSpec * FindConfigSpec(Tcl_Interp *interp, Tk_ConfigSpec *specs, const char *argvName, int needFlags, int hateFlags); static char * FormatConfigInfo(Tcl_Interp *interp, Tk_Window tkwin, - const Tk_ConfigSpec *specPtr, char *widgRec); + const Tk_ConfigSpec *specPtr, void *widgRec); static const char * FormatConfigValue(Tcl_Interp *interp, Tk_Window tkwin, - const Tk_ConfigSpec *specPtr, char *widgRec, + const Tk_ConfigSpec *specPtr, void *widgRec, char *buffer, Tcl_FreeProc **freeProcPtr); static Tk_ConfigSpec * GetCachedSpecs(Tcl_Interp *interp, const Tk_ConfigSpec *staticSpecs); @@ -344,10 +344,10 @@ DoConfig( Tk_Uid value, /* Value to use to fill in widgRec. */ int valueIsUid, /* Non-zero means value is a Tk_Uid; zero * means it's an ordinary string. */ - char *widgRec) /* Record whose fields are to be modified. + void *widgRec) /* Record whose fields are to be modified. * Values must be properly initialized. */ { - char *ptr; + void *ptr; Tk_Uid uid; int nullValue; @@ -357,7 +357,7 @@ DoConfig( } do { - ptr = widgRec + specPtr->offset; + ptr = (char *)widgRec + specPtr->offset; switch (specPtr->type) { case TK_CONFIG_BOOLEAN: if (Tcl_GetBoolean(interp, value, (int *) ptr) != TCL_OK) { @@ -693,7 +693,7 @@ FormatConfigInfo( register const Tk_ConfigSpec *specPtr, /* Pointer to information describing * option. */ - char *widgRec) /* Pointer to record holding current values of + void *widgRec) /* Pointer to record holding current values of * info for widget. */ { const char *argv[6]; @@ -759,7 +759,7 @@ FormatConfigValue( Tk_Window tkwin, /* Window corresponding to widget. */ const Tk_ConfigSpec *specPtr, /* Pointer to information describing option. * Must not point to a synonym option. */ - char *widgRec, /* Pointer to record holding current values of + void *widgRec, /* Pointer to record holding current values of * info for widget. */ char *buffer, /* Static buffer to use for small values. * Must have at least 200 bytes of storage. */ @@ -767,10 +767,11 @@ FormatConfigValue( * function to free the result, or NULL if * result is static. */ { - const char *ptr, *result; + void *ptr; + const char *result; *freeProcPtr = NULL; - ptr = widgRec + specPtr->offset; + ptr = (char *)widgRec + specPtr->offset; result = ""; switch (specPtr->type) { case TK_CONFIG_BOOLEAN: diff --git a/generic/tkTest.c b/generic/tkTest.c index 567540e..e439cdc 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -2053,7 +2053,7 @@ CustomOptionSet( objEmpty = 0; - if (internalOffset >= 0) { + if (internalOffset != -1) { internalPtr = recordPtr + internalOffset; } else { internalPtr = NULL; diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 23aef2d..1ae04ea 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -140,10 +140,10 @@ int tkBTreeDebug = 0; * Macros that determine how much space to allocate for new segments: */ -#define CSEG_SIZE(chars) ((unsigned) (Tk_Offset(TkTextSegment, body) \ - + 1 + (chars))) -#define TSEG_SIZE ((unsigned) (Tk_Offset(TkTextSegment, body) \ - + sizeof(TkTextToggle))) +#define CSEG_SIZE(chars) (Tk_Offset(TkTextSegment, body) \ + + 1 + (chars)) +#define TSEG_SIZE (Tk_Offset(TkTextSegment, body) \ + + sizeof(TkTextToggle)) /* * Forward declarations for functions defined in this file: diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 2df41d4..965f1a4 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -7690,7 +7690,7 @@ TkTextCharLayoutProc( chunkPtr->breakIndex = -1; #if !TK_LAYOUT_WITH_BASE_CHUNKS - ciPtr = ckalloc((Tk_Offset(CharInfo, chars) + 1) + bytesThatFit); + ciPtr = ckalloc(Tk_Offset(CharInfo, chars) + 1 + bytesThatFit); chunkPtr->clientData = ciPtr; memcpy(ciPtr->chars, p, (unsigned) bytesThatFit); #endif /* TK_LAYOUT_WITH_BASE_CHUNKS */ diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 41dd448..d261a2c 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -18,7 +18,7 @@ */ #define EI_SEG_SIZE \ - ((unsigned) (Tk_Offset(TkTextSegment, body) + sizeof(TkTextEmbImage))) + (Tk_Offset(TkTextSegment, body) + sizeof(TkTextEmbImage)) /* * Prototypes for functions defined in this file: diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 19d0c2a..da455d3 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -19,8 +19,8 @@ * Macro that determines the size of a mark segment: */ -#define MSEG_SIZE ((unsigned) (Tk_Offset(TkTextSegment, body) \ - + sizeof(TkTextMark))) +#define MSEG_SIZE (Tk_Offset(TkTextSegment, body) \ + + sizeof(TkTextMark)) /* * Forward references for functions defined in this file: diff --git a/generic/tkTextWind.c b/generic/tkTextWind.c index c9fc20f..d6f848f 100644 --- a/generic/tkTextWind.c +++ b/generic/tkTextWind.c @@ -35,8 +35,8 @@ static const Tk_GeomMgr textGeomType = { * Macro that determines the size of an embedded window segment: */ -#define EW_SEG_SIZE ((unsigned) (Tk_Offset(TkTextSegment, body) \ - + sizeof(TkTextEmbWindow))) +#define EW_SEG_SIZE (Tk_Offset(TkTextSegment, body) \ + + sizeof(TkTextEmbWindow)) /* * Prototypes for functions defined in this file: diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 342b16a..595effd 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -142,7 +142,7 @@ static const Tk_OptionSpec *TTKGetOptionSpec( /* Make sure widget option has a Tcl_Obj* entry: */ - if (optionSpec->objOffset < 0) { + if (optionSpec->objOffset == TCL_AUTO_LENGTH) { return 0; } diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 0d14e03..539404a 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -36,7 +36,7 @@ typedef struct ProtocolHandler { } ProtocolHandler; #define HANDLER_SIZE(cmdLength) \ - (((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength)) + ((Tk_Offset(ProtocolHandler, command) + 1 + cmdLength)) /* * Data for [wm attributes] command: diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 4e7618d..20cd72b 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -66,7 +66,7 @@ typedef struct ProtocolHandler { } ProtocolHandler; #define HANDLER_SIZE(cmdLength) \ - ((unsigned) ((Tk_Offset(ProtocolHandler, command) + 1) + cmdLength)) + (Tk_Offset(ProtocolHandler, command) + 1 + cmdLength) /* * Helper type passed via lParam to TkWmStackorderToplevelEnumProc -- cgit v0.12 From 1ff0e419c40769fd92d04d779b266a94ab19c9a3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 15 Oct 2018 19:01:27 +0000 Subject: Fix comment --- generic/tk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tk.h b/generic/tk.h index 87150e9..633a595 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -1174,7 +1174,7 @@ typedef struct Tk_TSOffset { } Tk_TSOffset; /* - * Bit fields in Tk_Offset->flags: + * Bit fields in Tk_TSOffset->flags: */ #define TK_OFFSET_INDEX 1 -- cgit v0.12