From 21e5079881531ebceefe721e59d840825dcbaa62 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 3 Dec 2020 08:28:20 +0000 Subject: 'grep -q "Failed' should be followed by single tab. Try to fix mingw-gcc build --- .github/workflows/mac-build.yml | 2 +- .github/workflows/win-build.yml | 15 ++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/mac-build.yml b/.github/workflows/mac-build.yml index fb546a7..c06afce 100644 --- a/.github/workflows/mac-build.yml +++ b/.github/workflows/mac-build.yml @@ -102,7 +102,7 @@ jobs: echo "::error::Failure during Test" exit 1 } - cat out-classic.txt out-ttk.txt | grep -q "Failed[[:space:]][[:space:]]*[1-9]" && { + cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { echo "::error::Failure during Test" exit 1 } diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 504037d..317bfc9 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -60,7 +60,7 @@ jobs: echo "::error::Failure during Test" exit 1 } - cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { + cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { echo "::error::Failure during Test" exit 1 } @@ -141,15 +141,8 @@ jobs: } - name: Run Tests run: | - make test-classic | tee out-classic.txt || { + make test-classic | tee out-classic.txt || echo "::error::Failure during Test" + make test-ttk | tee out-ttk.txt || echo "::error::Failure during Test" + cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { echo "::error::Failure during Test" - exit 1 - } - make test-ttk | tee out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { - echo "::error::Failure during Test" - exit 1 } -- cgit v0.12 From 7d5165546e1f1cd69e5899902fe78af07524bac3 Mon Sep 17 00:00:00 2001 From: marc_culler Date: Fri, 11 Dec 2020 05:55:13 +0000 Subject: Fix the build on macOS 10.6. --- macosx/tkMacOSXBitmap.c | 2 +- macosx/tkMacOSXColor.c | 7 ++++--- macosx/tkMacOSXDraw.c | 2 +- macosx/tkMacOSXFont.c | 7 ++----- macosx/tkMacOSXPrivate.h | 1 + macosx/ttkMacOSXTheme.c | 2 +- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index 29bb163..4c77d92 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -178,7 +178,7 @@ TkpCreateNativeBitmap( NSImage *iconImage = [[NSWorkspace sharedWorkspace] iconForFileType: iconUTI]; CGSize size = CGSizeMake(builtInIconSize, builtInIconSize); - Pixmap pixmap = PixmapFromImage(display, iconImage, NSSizeToCGSize(size)); + Pixmap pixmap = PixmapFromImage(display, iconImage, size); return pixmap; } diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 543f1d5..99606e0 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -342,13 +342,14 @@ GetRGBA( [color getComponents: rgba]; #else { + OSStatus err = noErr; RGBColor rgb; err = GetThemeTextColor(kThemeTextColorPushButtonActive, 32, true, &rgb); if (err == noErr) { - rgba[0] = (CGFLoat) rgb.red / 65535; - rgba[1] = (CGFLoat) rgb.green / 65535; - rgba[2] = (CGFLoat) rgb.blue / 65535; + rgba[0] = (CGFloat) rgb.red / 65535; + rgba[1] = (CGFloat) rgb.green / 65535; + rgba[2] = (CGFloat) rgb.blue / 65535; } } #endif diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 06d1810..22b6a45 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1345,7 +1345,7 @@ TkMacOSXSetupDrawingContext( * will get redrawn in the next call to its drawRect method. */ - currentBounds = CGContextGetClipBoundingBox(dc.context); + currentBounds = NSRectFromCGRect(CGContextGetClipBoundingBox(dc.context)); if (!NSContainsRect(currentBounds, drawingBounds)) { [view addTkDirtyRect:drawingBounds]; } diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 37d4eab..ca370f3 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -127,7 +127,7 @@ static int CreateNamedSystemFont(Tcl_Interp *interp, self = [self init]; if (self) { _string = [[NSString alloc] initWithString:aString]; - self.UTF8String = _string.UTF8String; + _UTF8String = _string.UTF8String; } return self; } @@ -149,10 +149,6 @@ static int CreateNamedSystemFont(Tcl_Interp *interp, return [_string characterAtIndex:index]; } -# ifndef __clang__ -@synthesize DString = _ds; -#endif - - (Tcl_DString)DString { if ( _ds.string == NULL) { @@ -177,6 +173,7 @@ static int CreateNamedSystemFont(Tcl_Interp *interp, #ifndef __clang__ @synthesize UTF8String = _UTF8String; +@synthesize DString = _ds; #endif @end diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 8e57641..ea53e5f 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -557,6 +557,7 @@ VISIBILITY_HIDDEN @private Tcl_DString _ds; NSString *_string; + const char *_UTF8String; } @property const char *UTF8String; @property (readonly) Tcl_DString DString; diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index b4ba894..17982b6 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -1351,7 +1351,7 @@ static void ButtonElementMinSize( ThemeButtonParams *params = (ThemeButtonParams *)clientData; if (params->heightMetric != NoThemeMetric) { - ChkErr(GetThemeMetric, params->heightMetric, minHeight); + ChkErr(GetThemeMetric, params->heightMetric, (SInt *) minHeight); /* * The theme height does not include the 1-pixel border around -- cgit v0.12 From 9dd9285067b77e023ef74ecd957e5e6bba9d699f Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 13 Dec 2020 18:58:37 +0000 Subject: Fix pack/place testcases on Unix. Follow-up to [f68fa7edd10d0b17] --- tests/pack.test | 2 +- tests/place.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pack.test b/tests/pack.test index b86fa34..f365959 100644 --- a/tests/pack.test +++ b/tests/pack.test @@ -1551,7 +1551,7 @@ test pack-17.2 {PackLostContentProc procedure} -setup { pack info .pack.a } -returnCodes error -result {window ".pack.a" isn't packed} -if {[tk windowingsystem] == "win32"} { +if {[tk windowingsystem] ne "aqua"} { proc packUpdate {} { update } diff --git a/tests/place.test b/tests/place.test index 5813ac5..a809095 100644 --- a/tests/place.test +++ b/tests/place.test @@ -261,7 +261,7 @@ test place-7.10 {ReconfigurePlacement procedure, computing size} -setup { list [winfo width .t.f2] [winfo height .t.f2] } -result {30 60} -if {[tk windowingsystem] == "win32"} { +if {[tk windowingsystem] ne "aqua"} { proc placeUpdate {} { update } -- cgit v0.12 From 26a3200d7f06438c5bc14dfc762ba11e82e34e57 Mon Sep 17 00:00:00 2001 From: marc_culler Date: Sun, 13 Dec 2020 23:33:17 +0000 Subject: Fix build in macOS 10.11 El Capitan: @available is not available in 10.11 --- macosx/tkMacOSXWm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 942a6f8..045d8d2 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6900,7 +6900,7 @@ ApplyWindowAttributeFlagChanges( * to the screen size. (For 10.11 and up, only) */ - if (@available(macOS 10.11, *)) { + if ([NSApp macOSVersion] >= 101100) { NSSize screenSize = [[macWindow screen] frame].size; [macWindow setMaxFullScreenContentSize:screenSize]; } -- cgit v0.12 From 7bbd536cdea0e0d4bcdef049f8bc2ff964fa3445 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Dec 2020 09:31:57 +0000 Subject: Backport some "github actions" improvements from 8.6 --- .github/workflows/linux-build.yml | 16 ++++++---------- .github/workflows/win-build.yml | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml index adb8d43..f9178e4 100644 --- a/.github/workflows/linux-build.yml +++ b/.github/workflows/linux-build.yml @@ -38,7 +38,6 @@ jobs: sudo apt-get install tcl8.5-dev libxss-dev mkdir "$HOME/install" touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "TEST_INSTALL_DIR=$HOME/install" >> $GITHUB_ENV echo "CFGOPT=$CFGOPT --with-tcl=/usr/lib/tcl8.5" >> $GITHUB_ENV echo "CC=$COMPILER" >> $GITHUB_ENV echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV @@ -50,7 +49,7 @@ jobs: OPTS: ${{ matrix.compiler }}-${{ matrix.symbols }}${{ matrix.disables }} - name: Configure (symbols=${{ matrix.symbols }} opts=${{ matrix.disables }}) run: | - ./configure $CFGOPT "--prefix=$TEST_INSTALL_DIR" || { + ./configure $CFGOPT "--prefix=$HOME/install" || { cat config.log echo "::error::Failure during Configure" exit 1 @@ -123,7 +122,6 @@ jobs: sudo apt-get install tcl8.5-dev libxss-dev xvfb mkdir "$HOME/install" touch tk/doc/man.macros tk/generic/tkStubInit.c - echo "TEST_INSTALL_DIR=$HOME/install" >> $GITHUB_ENV echo "CFGOPT=$CFGOPT --with-tcl=/usr/lib/tcl8.5" >> $GITHUB_ENV echo "CC=$COMPILER" >> $GITHUB_ENV working-directory: "." @@ -132,7 +130,7 @@ jobs: COMPILER: ${{ matrix.compiler }} - name: Configure (symbols=${{ matrix.symbols }}) run: | - ./configure $CFGOPT "--prefix=$TEST_INSTALL_DIR" || { + ./configure $CFGOPT "--prefix=$HOME/install" || { cat config.log echo "::error::Failure during Configure" exit 1 @@ -145,15 +143,13 @@ jobs: } - name: Run Tests run: | - xvfb-run --auto-servernum make test-classic | tee out-classic.txt || { + xvfb-run --auto-servernum make test-classic | tee out-classic.txt + xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { echo "::error::Failure during Test" exit 1 } - xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt || { - echo "::error::Failure during Test" - exit 1 - } - cat out-classic.txt out-ttk.txt | grep -q "Failed 0" || { + grep -q "Failed 0" out-ttk.txt || { echo "::error::Failure during Test" exit 1 } diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 317bfc9..483d21b 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -60,7 +60,11 @@ jobs: echo "::error::Failure during Test" exit 1 } - cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { + grep -q "Failed 0" out-classic.txt || { + echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { echo "::error::Failure during Test" exit 1 } @@ -141,8 +145,13 @@ jobs: } - name: Run Tests run: | - make test-classic | tee out-classic.txt || echo "::error::Failure during Test" - make test-ttk | tee out-ttk.txt || echo "::error::Failure during Test" - cat out-classic.txt out-ttk.txt | grep -q "Failed [1-9]" && { + make test-classic | tee out-classic.txt + make test-ttk | tee out-ttk.txt + grep -q "Failed 0" out-classic.txt || { echo "::error::Failure during Test" + exit 1 + } + grep -q "Failed 0" out-ttk.txt || { + echo "::error::Failure during Test" + exit 1 } -- cgit v0.12 From 58588c714b254c02cfb6f20f808d935673b90cb1 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 14 Dec 2020 10:07:45 +0000 Subject: Fix warnings seen on MS-VC6 PSDK 2003SP1: C:\test\tk8.6.11_rc0\win\..\win\tkWinFont.c(1500) : warning C4761: integral size mismatch in argument; conversion supplied --- win/tkWinFont.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 1e1403f..c7520a5 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -1495,7 +1495,7 @@ MultiFontTextOut( familyPtr = lastSubFontPtr->familyPtr; Tcl_UtfToExternalDString(familyPtr->encoding, source, (int) (p - source), &runString); - familyPtr->textOutProc(hdc, x-((double)tm.tmOverhang/2), y, + familyPtr->textOutProc(hdc, x-(double)(tm.tmOverhang/2), y, (WCHAR *)Tcl_DStringValue(&runString), Tcl_DStringLength(&runString) >> familyPtr->isWideFont); familyPtr->getTextExtentPoint32Proc(hdc, @@ -1517,7 +1517,7 @@ MultiFontTextOut( familyPtr = lastSubFontPtr->familyPtr; Tcl_UtfToExternalDString(familyPtr->encoding, source, (int) (p - source), &runString); - familyPtr->textOutProc(hdc, x-((double)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); -- cgit v0.12