summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/ttk_combobox.n2
-rw-r--r--doc/ttk_entry.n2
-rw-r--r--doc/ttk_spinbox.n4
-rw-r--r--macosx/tkMacOSXNotify.c2
-rw-r--r--macosx/tkMacOSXSubwindows.c4
-rw-r--r--macosx/tkMacOSXWindowEvent.c9
-rw-r--r--tests/canvText.test3
-rw-r--r--tests/clipboard.test4
-rw-r--r--tests/entry.test3
-rw-r--r--tests/focus.test9
-rw-r--r--tests/pack.test5
-rw-r--r--tests/place.test5
-rw-r--r--tests/scrollbar.test13
-rw-r--r--tests/textDisp.test29
-rw-r--r--tests/unixEmbed.test9
-rw-r--r--tests/unixFont.test9
-rw-r--r--tests/unixWm.test13
-rw-r--r--tests/winfo.test3
-rw-r--r--tests/wm.test9
-rw-r--r--unix/tkUnixFont.c83
-rw-r--r--unix/tkUnixRFont.c20
21 files changed, 133 insertions, 107 deletions
diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n
index 9d0bcc6..37b91aa 100644
--- a/doc/ttk_combobox.n
+++ b/doc/ttk_combobox.n
@@ -142,6 +142,8 @@ are:
.RS
Can only be changed when using non-native and non-graphical themes.
.RE
+\fB\-insertcolor\fP \fIcolor\fP
+.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
diff --git a/doc/ttk_entry.n b/doc/ttk_entry.n
index 4eb67cc..da183f7 100644
--- a/doc/ttk_entry.n
+++ b/doc/ttk_entry.n
@@ -448,6 +448,8 @@ Some themes use a graphical background and their field background colors cannot
.RE
\fB\-foreground\fP \fIcolor\fP
.br
+\fB\-insertcolor\fP \fIcolor\fP
+.br
\fB\-insertwidth\fP \fIamount\fP
.br
\fB\-lightcolor\fP \fIcolor\fP
diff --git a/doc/ttk_spinbox.n b/doc/ttk_spinbox.n
index 9ae9881..d7b7657 100644
--- a/doc/ttk_spinbox.n
+++ b/doc/ttk_spinbox.n
@@ -107,6 +107,10 @@ value is specified for \fB\-fieldbackground\fP. Otherwise it is ignored.
.br
\fB\-foreground\fP \fIcolor\fP
.br
+\fB\-insertcolor\fP \fIcolor\fP
+.br
+\fB\-insertwidth\fP \fIamount\fP
+.br
\fB\-lightcolor\fP \fIcolor\fP
.br
\fB\-padding\fP \fIpadding\fP
diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c
index 5163e21..b32c635 100644
--- a/macosx/tkMacOSXNotify.c
+++ b/macosx/tkMacOSXNotify.c
@@ -156,7 +156,7 @@ void DebugPrintQueue(void)
* this block should be removed.
*/
-# if MAC_OSX_VERSION_MAX_ALLOWED >= 101500
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
if ([theEvent type] == NSAppKitDefined) {
static Bool aWindowIsMoving = NO;
switch([theEvent subtype]) {
diff --git a/macosx/tkMacOSXSubwindows.c b/macosx/tkMacOSXSubwindows.c
index 15081cb..280c041 100644
--- a/macosx/tkMacOSXSubwindows.c
+++ b/macosx/tkMacOSXSubwindows.c
@@ -369,7 +369,7 @@ XResizeWindow(
r.origin.y += r.size.height - height;
r.size.width = width;
r.size.height = height;
- [w setFrame:[w frameRectForContentRect:r] display:YES];
+ [w setFrame:[w frameRectForContentRect:r] display:NO];
}
}
} else {
@@ -426,7 +426,7 @@ XMoveResizeWindow(
X + XOff, TkMacOSXZeroScreenHeight() - Y - YOff - Height,
Width, Height);
- [w setFrame:[w frameRectForContentRect:r] display:YES];
+ [w setFrame:[w frameRectForContentRect:r] display:NO];
}
} else {
MoveResizeWindow(macWin);
diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c
index 5a2809c..ae5190f 100644
--- a/macosx/tkMacOSXWindowEvent.c
+++ b/macosx/tkMacOSXWindowEvent.c
@@ -970,6 +970,14 @@ ConfigureRestrictProc(
TkWindow *winPtr = TkMacOSXGetTkWindow(w);
Tk_Window tkwin = (Tk_Window)winPtr;
+ /*
+ * See ticket [1fa8c3ed8d]. This may not be needed for macOSX 11.
+ */
+
+ if(![NSApp isDrawing]) {
+ return;
+ }
+
if (![self inLiveResize] &&
[w respondsToSelector: @selector (tkLayoutChanged)]) {
[(TKWindow *)w tkLayoutChanged];
@@ -1017,7 +1025,6 @@ ConfigureRestrictProc(
*/
[self generateExposeEvents: [self bounds]];
- [w displayIfNeeded];
/*
* Finally, unlock the main autoreleasePool.
diff --git a/tests/canvText.test b/tests/canvText.test
index 5ac088d..c0b9075 100644
--- a/tests/canvText.test
+++ b/tests/canvText.test
@@ -12,6 +12,7 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# Canvas used in 1.* - 17.* tests
canvas .c -width 400 -height 300 -bd 2 -relief sunken
@@ -942,7 +943,7 @@ test canvText-19.1 {patch 1006286, leading space caused wrap under Win32} -setup
destroy .c
} -result {{Yeah } Yeah- 4 4}
-test canvText-20.1 {angled text bounding box} -constraints failsOnUbuntu -setup {
+test canvText-20.1 {angled text bounding box} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
destroy .c
canvas .c
proc transpose {bbox} {
diff --git a/tests/clipboard.test b/tests/clipboard.test
index 81534d5..7c1a506 100644
--- a/tests/clipboard.test
+++ b/tests/clipboard.test
@@ -21,6 +21,8 @@ namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
+
# set up a very large buffer to test INCR retrievals
set longValue ""
foreach i {a b c d e f g j h i j k l m o p q r s t u v w x y z} {
@@ -233,7 +235,7 @@ test clipboard-6.1 {Tk_ClipboardAppend procedure} -setup {
} -cleanup {
clipboard clear
} -returnCodes ok -result {first chunk second chunk}
-test clipboard-6.2 {Tk_ClipboardAppend procedure} -constraints x11 -setup {
+test clipboard-6.2 {Tk_ClipboardAppend procedure} -constraints {x11 failsOnXQuarz} -setup {
clipboard clear
} -body {
setupbg
diff --git a/tests/entry.test b/tests/entry.test
index 4463b9b..a557e91 100644
--- a/tests/entry.test
+++ b/tests/entry.test
@@ -13,6 +13,7 @@ tcltest::loadTestedCommands
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# For xscrollcommand
set scrollInfo {}
@@ -1687,7 +1688,7 @@ test entry-5.7 {ConfigureEntry procedure} -setup {
test entry-5.8 {ConfigureEntry procedure} -constraints {
- fonts
+ fonts failsOnXQuarz
} -setup {
entry .e -borderwidth 2 -highlightthickness 2
pack .e
diff --git a/tests/focus.test b/tests/focus.test
index 2760255..3bdf778 100644
--- a/tests/focus.test
+++ b/tests/focus.test
@@ -12,6 +12,7 @@ tcltest::loadTestedCommands
namespace import -force tcltest::test
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
proc focusSetup {} {
destroy .t
@@ -310,7 +311,7 @@ in .t.b1 NotifyNonlinear
} .t.b1}
test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
- unix testwrapper failsOnUbuntu
+ unix testwrapper failsOnUbuntu failsOnXQuarz
} -body {
focus .t.b1
focus .
@@ -322,7 +323,7 @@ test focus-2.6 {TkFocusFilterEvent procedure, FocusIn events} -constraints {
list $x $focusInfo
} -result {.t.b1 {press .t.b1 x}}
test focus-2.7 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
- unix testwrapper failsOnUbuntu
+ unix testwrapper failsOnUbuntu failsOnXQuarz
} -body {
set result {}
foreach detail {NotifyAncestor NotifyInferior NotifyNonlinear
@@ -343,7 +344,7 @@ test focus-2.8 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
focus
} -result {.t.b1}
test focus-2.9 {TkFocusFilterEvent procedure, FocusOut events} -constraints {
- unix testwrapper failsOnUbuntu
+ unix testwrapper failsOnUbuntu failsOnXQuarz
} -body {
focus .t.b1
event gen [testwrapper .] <FocusOut> -detail NotifyAncestor
@@ -601,7 +602,7 @@ cleanupbg
# Test 5.1 fails (before and after update)
test focus-5.1 {ChangeXFocus procedure, don't take focus unless have it} -constraints {
- unix testwrapper secureserver failsOnUbuntu
+ unix testwrapper secureserver failsOnUbuntu failsOnXQuarz
} -body {
setupbg
focusSetup
diff --git a/tests/pack.test b/tests/pack.test
index 9fd8035..1f40083 100644
--- a/tests/pack.test
+++ b/tests/pack.test
@@ -12,6 +12,7 @@ tcltest::loadTestedCommands
namespace import -force tcltest::test
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# Create some test windows.
@@ -1560,7 +1561,7 @@ if {[tk windowingsystem] == "win32"} {
}
test pack-18.1 {unmap content when container unmapped} -constraints {
- tempNotPc failsOnUbuntu
+ tempNotPc failsOnUbuntu failsOnXQuarz
} -setup {
eval destroy [winfo child .pack]
} -body {
@@ -1591,7 +1592,7 @@ test pack-18.1 {unmap content when container unmapped} -constraints {
lappend result [winfo ismapped .pack.a]
} -result {1 0 200 75 0 1}
-test pack-18.2 {unmap content when container unmapped} -constraints failsOnUbuntu -setup {
+test pack-18.2 {unmap content when container unmapped} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
eval destroy [winfo child .pack]
} -body {
diff --git a/tests/place.test b/tests/place.test
index 840ffca..9408b72 100644
--- a/tests/place.test
+++ b/tests/place.test
@@ -14,6 +14,7 @@ tcltest::loadTestedCommands
testConstraint memory [llength [info commands memory]]
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# XXX - This test file is woefully incomplete. At present, only a
# few of the features are tested.
@@ -269,7 +270,7 @@ if {[tk windowingsystem] == "win32"} {
}
}
-test place-8.1 {PlaceStructureProc, mapping and unmapping content} -constraints failsOnUbuntu -setup {
+test place-8.1 {PlaceStructureProc, mapping and unmapping content} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
place forget .t.f2
place forget .t.f
} -body {
@@ -285,7 +286,7 @@ test place-8.1 {PlaceStructureProc, mapping and unmapping content} -constraints
placeUpdate
lappend result [winfo ismapped .t.f2]
} -result {1 0 40 30 0 1}
-test place-8.2 {PlaceStructureProc, mapping and unmapping content} -constraints failsOnUbuntu -setup {
+test place-8.2 {PlaceStructureProc, mapping and unmapping content} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
place forget .t.f2
place forget .t.f
update idletasks
diff --git a/tests/scrollbar.test b/tests/scrollbar.test
index 4963cf8..62d15c8 100644
--- a/tests/scrollbar.test
+++ b/tests/scrollbar.test
@@ -12,6 +12,7 @@ eval tcltest::configure $argv
tcltest::loadTestedCommands
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
proc scroll args {
global scrollInfo
@@ -272,13 +273,13 @@ test scrollbar-3.35 {ScrollbarWidgetCmd procedure, "fraction" option} {
format {%.6g} [.s fraction 4 21]
} [format %.6g [expr {(21.0 - ([winfo height .s] - [getTroughSize .s])/2.0) \
/([getTroughSize .s] - 1)}]]
-test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} {x11 failsOnUbuntu} {
+test scrollbar-3.36 {ScrollbarWidgetCmd procedure, "fraction" option} {x11 failsOnUbuntu failsOnXQuarz} {
format {%.6g} [.s fraction 4 179]
} {1}
test scrollbar-3.37 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics} {
format {%.6g} [.s fraction 4 [expr {200 - [testmetrics cyvscroll .s]}]]
} {1}
-test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} {x11 failsOnUbuntu} {
+test scrollbar-3.38 {ScrollbarWidgetCmd procedure, "fraction" option} {x11 failsOnUbuntu failsOnXQuarz} {
format {%.6g} [.s fraction 4 178]
} {0.993711}
test scrollbar-3.39 {ScrollbarWidgetCmd procedure, "fraction" option} {testmetrics win} {
@@ -493,7 +494,7 @@ test scrollbar-6.11.2 {ScrollbarPosition procedure} aqua {
# macOS scrollbars have no arrows nowadays
.s identify 8 4
} {trough1}
-test scrollbar-6.12.1 {ScrollbarPosition procedure} {x11 failsOnUbuntu} {
+test scrollbar-6.12.1 {ScrollbarPosition procedure} {x11 failsOnUbuntu failsOnXQuarz} {
.s identify 8 19
} {arrow1}
test scrollbar-6.12.2 {ScrollbarPosition procedure} aqua {
@@ -551,7 +552,7 @@ test scrollbar-6.28 {ScrollbarPosition procedure} {testmetrics win} {
.s identify [expr {[winfo width .s] / 2}] [expr {[winfo height .s]
- [testmetrics cyvscroll .s] - 1}]
} {trough2}
-test scrollbar-6.29.1 {ScrollbarPosition procedure} {x11 failsOnUbuntu} {
+test scrollbar-6.29.1 {ScrollbarPosition procedure} {x11 failsOnUbuntu failsOnXQuarz} {
.s identify 8 180
} {arrow2}
test scrollbar-6.29.2 {ScrollbarPosition procedure} aqua {
@@ -575,7 +576,7 @@ test scrollbar-6.33 {ScrollbarPosition procedure} win {
test scrollbar-6.34 {ScrollbarPosition procedure} unix {
.s identify 4 100
} {trough2}
-test scrollbar-6.35 {ScrollbarPosition procedure} {unix failsOnUbuntu} {
+test scrollbar-6.35 {ScrollbarPosition procedure} {unix failsOnUbuntu failsOnXQuarz} {
.s identify 18 100
} {trough2}
test scrollbar-6.37 {ScrollbarPosition procedure} win {
@@ -614,7 +615,7 @@ test scrollbar-6.43 {ScrollbarPosition procedure} {testmetrics win} {
.t.s identify [expr {int(.4 / [.t.s delta 1 0]) + [testmetrics cxhscroll .t.s]
- 1}] [expr {[winfo height .t.s] / 2}]
} {slider}
-test scrollbar-6.44 {ScrollbarPosition procedure} {unix failsOnUbuntu} {
+test scrollbar-6.44 {ScrollbarPosition procedure} {unix failsOnUbuntu failsOnXQuarz} {
.t.s identify 100 18
} {trough2}
test scrollbar-6.46 {ScrollbarPosition procedure} win {
diff --git a/tests/textDisp.test b/tests/textDisp.test
index 39d50d0..f64dd88 100644
--- a/tests/textDisp.test
+++ b/tests/textDisp.test
@@ -12,6 +12,7 @@ tcltest::loadTestedCommands
namespace import -force tcltest::test
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# Platform specific procedure for updating the text widget.
@@ -665,7 +666,7 @@ test textDisp-4.7 {UpdateDisplayInfo, filling in extra vertical space} {
updateText
set x
} {8.0 {16.0 17.0 15.0 14.0 13.0 12.0 11.0 10.0 9.0 8.0} {8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0}}
-test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} {
+test textDisp-4.8 {UpdateDisplayInfo, filling in extra vertical space} failsOnXQuarz {
.t delete 1.0 end
.t insert end "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17"
.t yview 16.0
@@ -728,7 +729,7 @@ test textDisp-4.13 {UpdateDisplayInfo, special handling for top/bottom lines} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}}
-test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} {
+test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} failsOnXQuarz {
.t tag remove x 1.0 end
.t yview 1.0
updateText
@@ -861,7 +862,7 @@ test textDisp-5.2 {DisplayDLine, line resizes during display} {
} [list 30 30]
.t configure -wrap char
-test textDisp-6.1 {scrolling in DisplayText, scroll up} {
+test textDisp-6.1 {scrolling in DisplayText, scroll up} failsOnXQuarz {
.t delete 1.0 end
.t insert 1.0 "Line 1"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
@@ -1149,7 +1150,7 @@ test textDisp-8.6 {TkTextChanged} {
updateText
list $tk_textRelayout $tk_textRedraw
} {{1.0 1.20 1.40} {1.0 1.20 1.40}}
-test textDisp-8.7 {TkTextChanged} {
+test textDisp-8.7 {TkTextChanged} failsOnXQuarz {
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, two times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
@@ -1171,7 +1172,7 @@ test textDisp-8.8 {TkTextChanged} {
updateText
list $tk_textRelayout $tk_textRedraw
} {2.0 2.0}
-test textDisp-8.9 {TkTextChanged} {
+test textDisp-8.9 {TkTextChanged} failsOnXQuarz {
.t delete 1.0 end
.t insert 1.0 "Line 1 is so long that it wraps around, two times"
foreach i {2 3 4 5 6 7 8 9 10 11 12 13 14 15} {
@@ -1282,7 +1283,7 @@ test textDisp-9.4 {TkTextRedrawTag} failsOnUbuntu {
updateText
list $tk_textRelayout $tk_textRedraw
} {{2.0 2.20} {2.0 2.20 eof}}
-test textDisp-9.5 {TkTextRedrawTag} failsOnUbuntu {
+test textDisp-9.5 {TkTextRedrawTag} {failsOnUbuntu failsOnXQuarz} {
.t configure -wrap char
.t delete 1.0 end
.t insert 1.0 "Line 1\nLine 2 is long enough to wrap around\nLine 3\nLine 4"
@@ -1444,7 +1445,7 @@ test textDisp-11.1 {TkTextSetYView} {
updateText
.t index @0,0
} {30.0}
-test textDisp-11.2 {TkTextSetYView} {
+test textDisp-11.2 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
.t yview 32.0
@@ -1458,7 +1459,7 @@ test textDisp-11.3 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {28.0 {28.0 29.0}}
-test textDisp-11.4 {TkTextSetYView} {
+test textDisp-11.4 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
.t yview 31.4
@@ -1489,7 +1490,7 @@ test textDisp-11.7 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {21.0 {21.0 22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}}
-test textDisp-11.8 {TkTextSetYView} {
+test textDisp-11.8 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
set tk_textRedraw {}
@@ -1497,7 +1498,7 @@ test textDisp-11.8 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {32.0 {40.0 41.0}}
-test textDisp-11.9 {TkTextSetYView} {
+test textDisp-11.9 {TkTextSetYView} failsOnXQuarz {
.t yview 30.0
updateText
set tk_textRedraw {}
@@ -1521,7 +1522,7 @@ test textDisp-11.11 {TkTextSetYView} {
updateText
list [.t index @0,0] $tk_textRedraw
} {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}}
-test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} {
+test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} failsOnXQuarz {
.t insert 10.0 "Long line with enough text to wrap\n"
.t yview 1.0
updateText
@@ -2863,7 +2864,7 @@ test textDisp-19.16 {count -ypixels} {
[.t count -ypixels 16.0 "16.0 displaylineend +1c"] \
[.t count -ypixels "16.0 +1 displaylines" "16.0 +4 displaylines +3c"]
} [list [expr {260 + 20 * $fixedDiff}] [expr {260 + 20 * $fixedDiff}] $fixedHeight [expr {2*$fixedHeight}] $fixedHeight [expr {3*$fixedHeight}]]
-test textDisp-19.17 {count -ypixels with indices in elided lines} failsOnUbuntu {
+test textDisp-19.17 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -2890,7 +2891,7 @@ test textDisp-19.17 {count -ypixels with indices in elided lines} failsOnUbuntu
.t yview 35.0
lappend res [.t count -ypixels 5.0 25.0]
} [list [expr {4 * $fixedHeight}] [expr {3 * $fixedHeight}] 0 0 0 0 0 0 [expr {5 * $fixedHeight}] [expr {- 5 * $fixedHeight}] [expr {2 * $fixedHeight}] [expr {3 * $fixedHeight}] [expr {5 * $fixedHeight}]]
-test textDisp-19.18 {count -ypixels with indices in elided lines} failsOnUbuntu {
+test textDisp-19.18 {count -ypixels with indices in elided lines} {failsOnUbuntu failsOnXQuarz} {
.t configure -wrap none
.t delete 1.0 end
for {set i 1} {$i < 100} {incr i} {
@@ -3407,7 +3408,7 @@ test textDisp-24.24 {TkTextCharLayoutProc, justification and tabs} {textfonts} {
.t tag add x 1.0 end
list [.t bbox 1.0] [.t bbox 1.10]
} [list [list 45 3 7 $fixedHeight] [list 94 3 7 $fixedHeight]]
-test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts} -setup {
+test textDisp-24.25 {TkTextCharLayoutProc, justification and tabs} -constraints {textfonts failsOnXQuarz} -setup {
text .tt -tabs {40 right} -wrap none -font $fixedFont
pack .tt
} -body {
diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test
index 578075e..f859150 100644
--- a/tests/unixEmbed.test
+++ b/tests/unixEmbed.test
@@ -12,6 +12,7 @@ tcltest::loadTestedCommands
namespace import -force tcltest::test
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
namespace eval ::_test_tmp {}
@@ -990,7 +991,7 @@ test unixEmbed-7.1 {TkpRedirectKeyEvent procedure, forward keystroke} -constrain
# TkpRedirectKeyEvent is not implemented in win or aqua. If someone
# implements it they should change the constraints for this test.
test unixEmbed-7.1a {TkpRedirectKeyEvent procedure, forward keystroke} -constraints {
- unix notAqua
+ unix notAqua failsOnXQuarz
} -setup {
deleteWindows
catch {interp delete child}
@@ -1088,7 +1089,7 @@ test unixEmbed-7.2a {TkpRedirectKeyEvent procedure, don't forward keystroke widt
} -result {{} {{key b}}}
test unixEmbed-8.1 {TkpClaimFocus procedure} -constraints {
- unix notAqua failsOnUbuntu
+ unix notAqua failsOnUbuntu failsOnXQuarz
} -setup {
deleteWindows
} -body {
@@ -1235,7 +1236,7 @@ test unixEmbed-9.2a {EmbedWindowDeleted procedure, check embeddedPtr} -constrain
test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints {
- unix failsOnUbuntu
+ unix failsOnUbuntu failsOnXQuarz
} -setup {
deleteWindows
} -body {
@@ -1251,7 +1252,7 @@ test unixEmbed-10.1 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -con
deleteWindows
} -result {150x80+0+0}
test unixEmbed-10.2 {geometry propagation in tkUnixWm.c/UpdateGeometryInfo} -constraints {
- unix failsOnUbuntu
+ unix failsOnUbuntu failsOnXQuarz
} -setup {
deleteWindows
} -body {
diff --git a/tests/unixFont.test b/tests/unixFont.test
index 86fb5bf..ee9eb02 100644
--- a/tests/unixFont.test
+++ b/tests/unixFont.test
@@ -18,6 +18,7 @@ tcltest::loadTestedCommands
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
if {[tk windowingsystem] eq "x11"} {
set xlsf [auto_execok xlsfonts]
@@ -256,7 +257,7 @@ test unixfont-8.3 {AllocFont procedure: can't parse info from name} x11 {
catch {unset fontArray}
set result
} {-family -overstrike -size -slant -underline -weight}
-test unixfont-8.4 {AllocFont procedure: classify characters} {x11 failsOnUbuntu} {
+test unixfont-8.4 {AllocFont procedure: classify characters} {x11 failsOnUbuntu failsOnXQuarz} {
set x 0
incr x [font measure $courier "\u4000"] ;# 6
incr x [font measure $courier "\002"] ;# 4
@@ -267,7 +268,7 @@ test unixfont-8.4 {AllocFont procedure: classify characters} {x11 failsOnUbuntu}
test unixfont-8.5 {AllocFont procedure: setup widths of normal chars} x11 {
font metrics $courier -fixed
} {1}
-test unixfont-8.6 {AllocFont procedure: setup widths of special chars} {x11 failsOnUbuntu} {
+test unixfont-8.6 {AllocFont procedure: setup widths of special chars} {x11 failsOnUbuntu failsOnXQuarz} {
set x 0
incr x [font measure $courier "\001"] ;# 4
incr x [font measure $courier "\002"] ;# 4
@@ -295,7 +296,7 @@ test unixfont-8.11 {AllocFont procedure: XA_UNDERLINE_POSITION was 0} x11 {
set x {}
} {}
-test unixfont-9.1 {GetControlCharSubst procedure: 2 chars subst} {x11 failsOnUbuntu} {
+test unixfont-9.1 {GetControlCharSubst procedure: 2 chars subst} {x11 failsOnUbuntu failsOnXQuarz} {
.b.c dchars $t 0 end
.b.c insert $t 0 "0\a0"
set x {}
@@ -304,7 +305,7 @@ test unixfont-9.1 {GetControlCharSubst procedure: 2 chars subst} {x11 failsOnUbu
lappend x [.b.c index $t @[expr $ax*2],0]
lappend x [.b.c index $t @[expr $ax*3],0]
} {0 1 1 2}
-test unixfont-9.2 {GetControlCharSubst procedure: 4 chars subst} {x11 failsOnUbuntu} {
+test unixfont-9.2 {GetControlCharSubst procedure: 4 chars subst} {x11 failsOnUbuntu failsOnXQuarz} {
.b.c dchars $t 0 end
.b.c insert $t 0 "0\0010"
set x {}
diff --git a/tests/unixWm.test b/tests/unixWm.test
index bdca89b..47b65fd 100644
--- a/tests/unixWm.test
+++ b/tests/unixWm.test
@@ -14,6 +14,7 @@ tcltest::loadTestedCommands
namespace import -force ::tk::test:loadTkCommand
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
proc sleep ms {
global x
@@ -1552,7 +1553,7 @@ test unixWm-44.6 {UpdateGeometryInfo procedure, negative height} unix {
} {100 1}
destroy .t
toplevel .t -width 80 -height 60
-test unixWm-44.7 {UpdateGeometryInfo procedure, computing position} unix {
+test unixWm-44.7 {UpdateGeometryInfo procedure, computing position} {unix failsOnXQuarz} {
tkwait visibility .t
wm overrideredirect .t 1
update
@@ -1562,7 +1563,7 @@ test unixWm-44.7 {UpdateGeometryInfo procedure, computing position} unix {
} [list 5 [expr [winfo screenheight .t] - 70]]
destroy .t
toplevel .t -width 80 -height 60
-test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} unix {
+test unixWm-44.8 {UpdateGeometryInfo procedure, computing position} {unix failsOnXQuarz} {
tkwait visibility .t
wm overrideredirect .t 1
update
@@ -1612,7 +1613,7 @@ test unixWm-45.1 {UpdateSizeHints procedure, grid information} {unix testwrapper
[expr [lindex $property 7]] [expr [lindex $property 8]] \
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {40 30 320 210 10 5}
-test unixWm-45.2 {UpdateSizeHints procedure} {unix testwrapper failsOnUbuntu} {
+test unixWm-45.2 {UpdateSizeHints procedure} {unix testwrapper failsOnUbuntu failsOnXQuarz} {
destroy .t
toplevel .t -width 80 -height 60
wm minsize .t 30 40
@@ -1640,7 +1641,7 @@ test unixWm-45.3 {UpdateSizeHints procedure, grid with menu} {testmenubar testwr
[expr [lindex $property 7]] [expr [lindex $property 8]] \
[expr [lindex $property 9]] [expr [lindex $property 10]]
} {60 40 53 320 233 10 5}
-test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} {testmenubar testwrapper failsOnUbuntu} {
+test unixWm-45.4 {UpdateSizeHints procedure, not resizable with menu} {testmenubar testwrapper failsOnUbuntu failsOnXQuarz} {
destroy .t
toplevel .t -width 80 -height 60
frame .t.menu -height 23 -width 50
@@ -1794,7 +1795,7 @@ if {[tk windowingsystem] == "aqua"} {
# Windows are assumed to have a border (invisible in Gnome 3).
set result_50_1 {{} {} .t {} .t2 {} .t2 {} .t}
}
-test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords, title bar} {unix failsOnUbuntu} {
+test unixWm-50.1 {Tk_CoordsToWindow procedure, finding a toplevel, x-coords, title bar} {unix failsOnUbuntu failsOnXQuarz} {
update
toplevel .t -width 300 -height 400 -bg green
wm geom .t +100+100
@@ -2051,7 +2052,7 @@ test unixWm-51.6 {TkWmRestackToplevel procedure, window to be stacked isn't mapp
wm geometry .t2 +0+0
winfo containing 100 100
} {.t}
-test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} unix {
+test unixWm-51.7 {TkWmRestackToplevel procedure, other window isn't mapped} {unix failsOnXQuarz} {
foreach w {.t .t2 .t3} {
destroy $w
update
diff --git a/tests/winfo.test b/tests/winfo.test
index 51be80d..b50c70a 100644
--- a/tests/winfo.test
+++ b/tests/winfo.test
@@ -12,6 +12,7 @@ tcltest::configure {*}$argv
tcltest::loadTestedCommands
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# eatColors --
# Creates a toplevel window and allocates enough colors in it to
@@ -322,7 +323,7 @@ test winfo-9.6 {"winfo viewable" command} -setup {
} -cleanup {
deleteWindows
} -result {0 0}
-test winfo-9.7 {"winfo viewable" command} -constraints failsOnUbuntu -setup {
+test winfo-9.7 {"winfo viewable" command} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
deleteWindows
} -body {
frame .f1 -width 100 -height 100 -relief raised -bd 2
diff --git a/tests/wm.test b/tests/wm.test
index 1bf56da..08c7943 100644
--- a/tests/wm.test
+++ b/tests/wm.test
@@ -28,6 +28,7 @@ proc stdWindow {} {
}
testConstraint failsOnUbuntu [expr {![info exists ::env(TRAVIS_OS_NAME)] || ![string match linux $::env(TRAVIS_OS_NAME)]}]
+testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]
# [raise] and [lower] may return before the window manager has completed the
# operation. The raiseDelay procedure idles for a while to give the operation
@@ -1527,7 +1528,7 @@ test wm-stackorder-5.1 {a menu is not a toplevel} -body {
destroy .t
} -result {.t .}
test wm-stackorder-5.2 {A normal toplevel can't be raised above an \
- overrideredirect toplevel on unix} -constraints {x11 failsOnUbuntu} -body {
+ overrideredirect toplevel on unix} -constraints {x11 failsOnUbuntu failsOnXQuarz} -body {
toplevel .t
tkwait visibility .t
wm overrideredirect .t 1
@@ -1551,7 +1552,7 @@ test wm-stackorder-5.2.1 {A normal toplevel can be raised above an \
destroy .t
} -result 1
test wm-stackorder-5.3 {An overrideredirect window\
- can be explicitly lowered} -body {
+ can be explicitly lowered} -constraints failsOnXQuarz -body {
toplevel .t
tkwait visibility .t
wm overrideredirect .t 1
@@ -1726,7 +1727,7 @@ test wm-transient-3.3 {withdraw/deiconify on the toplevel
} -result {withdrawn 0 normal 1}
test wm-transient-4.1 {transient toplevel is withdrawn
- when mapped if toplevel is iconic} -constraints failsOnUbuntu -body {
+ when mapped if toplevel is iconic} -constraints {failsOnUbuntu failsOnXQuarz} -body {
toplevel .top
wm iconify .top
update
@@ -1928,7 +1929,7 @@ test wm-transient-7.5 {Reassign transient, destroy transient} -body {
deleteWindows
}
-test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -constraints failsOnUbuntu -setup {
+test wm-transient-8.1 {transient to withdrawn window, Bug 1163496} -constraints {failsOnUbuntu failsOnXQuarz} -setup {
deleteWindows
set result {}
} -body {
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 234b282..bd83a5e 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -17,8 +17,8 @@
* The preferred font encodings.
*/
-static const char *const encodingList[] = {
- "iso8859-1", "jis0208", "jis0212", NULL
+static const char encodingList[][10] = {
+ "iso8859-1", "jis0208", "jis0212"
};
/*
@@ -193,7 +193,7 @@ static const EncodingAlias encodingAliases[] = {
* Functions used only in this file.
*/
-static void FontPkgCleanup(ClientData clientData);
+static void FontPkgCleanup(void *clientData);
static FontFamily * AllocFontFamily(Display *display,
XFontStruct *fontStructPtr, int base);
static SubFont * CanUseFallback(UnixFont *fontPtr,
@@ -203,7 +203,7 @@ static SubFont * CanUseFallbackWithAliases(UnixFont *fontPtr,
const char *fallbackName, int ch,
Tcl_DString *nameTriedPtr,
SubFont **fixSubFontPtrPtr);
-static int ControlUtfProc(ClientData clientData, const char *src,
+static int ControlUtfProc(void *clientData, const char *src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
@@ -238,11 +238,11 @@ static unsigned RankAttributes(FontAttributes *wantPtr,
static void ReleaseFont(UnixFont *fontPtr);
static void ReleaseSubFont(Display *display, SubFont *subFontPtr);
static int SeenName(const char *name, Tcl_DString *dsPtr);
-static int Ucs2beToUtfProc(ClientData clientData, const char*src,
+static int Ucs2beToUtfProc(void *clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
-static int UtfToUcs2beProc(ClientData clientData, const char*src,
+static int UtfToUcs2beProc(void *clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
@@ -267,9 +267,9 @@ static int UtfToUcs2beProc(ClientData clientData, const char*src,
static void
FontPkgCleanup(
- ClientData clientData)
+ TCL_UNUSED(void *))
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->controlFamily.encoding != NULL) {
@@ -306,9 +306,9 @@ FontPkgCleanup(
void
TkpFontPkgInit(
- TkMainInfo *mainPtr) /* The application being created. */
+ TCL_UNUSED(TkMainInfo *)) /* The application being created. */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
SubFont dummy;
int i;
@@ -362,11 +362,11 @@ TkpFontPkgInit(
static int
ControlUtfProc(
- ClientData clientData, /* Not used. */
+ TCL_UNUSED(void *), /* Not used. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
- int flags, /* Conversion control flags. */
- Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
+ TCL_UNUSED(int), /* Conversion control flags. */
+ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -390,8 +390,8 @@ ControlUtfProc(
const char *srcStart, *srcEnd;
char *dstStart, *dstEnd;
int ch, result;
- static char hexChars[] = "0123456789abcdef";
- static char mapChars[] = {
+ static const char hexChars[] = "0123456789abcdef";
+ static const char mapChars[] = {
0, 0, 0, 0, 0, 0, 0,
'a', 'b', 't', 'n', 'v', 'f', 'r'
};
@@ -460,11 +460,11 @@ ControlUtfProc(
static int
Ucs2beToUtfProc(
- ClientData clientData, /* Not used. */
+ TCL_UNUSED(void *), /* Not used. */
const char *src, /* Source string in Unicode. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
- Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
+ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -556,12 +556,12 @@ Ucs2beToUtfProc(
static int
UtfToUcs2beProc(
- ClientData clientData, /* TableEncodingData that specifies
+ TCL_UNUSED(void *), /* TableEncodingData that specifies
* encoding. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
- Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
+ TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -705,7 +705,7 @@ TkpGetNativeFont(
if (name[0] == '-') {
if (name[1] != '*') {
- char *dash;
+ const char *dash;
dash = strchr(name + 1, '-');
if ((dash == NULL) || (isspace(UCHAR(dash[-1])))) {
@@ -720,7 +720,7 @@ TkpGetNativeFont(
}
fontStructPtr = CreateClosestFont(tkwin, &fa.fa, &fa.xa);
}
- fontPtr = ckalloc(sizeof(UnixFont));
+ fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont));
InitFont(tkwin, fontStructPtr, fontPtr);
return (TkFont *) fontPtr;
@@ -776,7 +776,7 @@ TkpGetFontFromAttributes(
fontPtr = (UnixFont *) tkFontPtr;
if (fontPtr == NULL) {
- fontPtr = ckalloc(sizeof(UnixFont));
+ fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont));
} else {
ReleaseFont(fontPtr);
}
@@ -839,7 +839,7 @@ TkpGetFontFamilies(
Tcl_Interp *interp, /* Interp to hold result. */
Tk_Window tkwin) /* For display to query. */
{
- int i, new, numNames;
+ int i, isNew, numNames;
char *family, **nameList;
Tcl_HashTable familyTable;
Tcl_HashEntry *hPtr;
@@ -868,14 +868,14 @@ TkpGetFontFamilies(
continue; /* See comment above. */
}
*familyEnd = '\0';
- Tcl_CreateHashEntry(&familyTable, family, &new);
+ Tcl_CreateHashEntry(&familyTable, family, &isNew);
}
XFreeFontNames(nameList);
hPtr = Tcl_FirstHashEntry(&familyTable, &search);
resultPtr = Tcl_NewObj();
while (hPtr != NULL) {
- strPtr = Tcl_NewStringObj(Tcl_GetHashKey(&familyTable, hPtr), -1);
+ strPtr = Tcl_NewStringObj((const char *)Tcl_GetHashKey(&familyTable, hPtr), -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
hPtr = Tcl_NextHashEntry(&search);
}
@@ -1203,7 +1203,7 @@ TkpMeasureCharsInContext(
Tk_Font tkfont, /* Font in which characters will be drawn. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. */
- int numBytes, /* Maximum number of bytes to consider from
+ TCL_UNUSED(int), /* Maximum number of bytes to consider from
* source string in all. */
int rangeStart, /* Index of first byte to measure. */
int rangeLength, /* Length of range to measure in bytes. */
@@ -1225,7 +1225,6 @@ TkpMeasureCharsInContext(
int *lengthPtr) /* Filled with x-location just after the
* terminating character. */
{
- (void) numBytes; /*unused*/
return Tk_MeasureChars(tkfont, source + rangeStart, rangeLength,
maxLength, flags, lengthPtr);
}
@@ -1400,7 +1399,7 @@ TkpDrawCharsInContext(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
- int numBytes, /* Number of bytes in string. */
+ TCL_UNUSED(int), /* Number of bytes in string. */
int rangeStart, /* Index of first byte to draw. */
int rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
@@ -1409,8 +1408,6 @@ TkpDrawCharsInContext(
{
int widthUntilStart;
- (void) numBytes; /*unused*/
-
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+widthUntilStart, y);
@@ -1610,7 +1607,7 @@ InitFont(
UnixFont *fontPtr) /* Filled with information constructed from
* the above arguments. */
{
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
unsigned long value;
int minHi, maxHi, minLo, maxLo, fixed, width, limit, i, n;
@@ -1716,7 +1713,7 @@ InitFont(
* 1/3 the width of a capital I.
*/
- fontPtr->barHeight = fontPtr->widths['I'] / 3;
+ fontPtr->barHeight = fontPtr->widths[(unsigned char)'I'] / 3;
if (fontPtr->barHeight == 0) {
fontPtr->barHeight = 1;
}
@@ -1857,13 +1854,13 @@ AllocFontFamily(
Display *display, /* Display in which font will be used. */
XFontStruct *fontStructPtr, /* Screen font whose FontFamily is to be
* returned. */
- int base) /* Non-zero if this font family is to be used
+ TCL_UNUSED(int)) /* Non-zero if this font family is to be used
* in the base font of a font object. */
{
FontFamily *familyPtr;
FontAttributes fa;
Tcl_Encoding encoding;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
GetFontAttributes(display, fontStructPtr, &fa);
@@ -1882,7 +1879,7 @@ AllocFontFamily(
}
}
- familyPtr = ckalloc(sizeof(FontFamily));
+ familyPtr = (FontFamily *)ckalloc(sizeof(FontFamily));
memset(familyPtr, 0, sizeof(FontFamily));
familyPtr->nextPtr = tsdPtr->fontFamilyList;
tsdPtr->fontFamilyList = familyPtr;
@@ -1939,7 +1936,7 @@ FreeFontFamily(
FontFamily *familyPtr) /* The FontFamily to delete. */
{
FontFamily **familyPtrPtr;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int i;
@@ -2252,10 +2249,10 @@ FontMapLoadPage(
Tcl_Encoding encoding;
XFontStruct *fontStructPtr;
XCharStruct *widths;
- ThreadSpecificData *tsdPtr =
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- subFontPtr->fontMap[row] = ckalloc(FONTMAP_BITSPERPAGE / 8);
+ subFontPtr->fontMap[row] = (char *)ckalloc(FONTMAP_BITSPERPAGE / 8);
memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
if (subFontPtr->familyPtr == &tsdPtr->controlFamily) {
@@ -2493,7 +2490,7 @@ CanUseFallback(
numEncodings = 0;
Tcl_DStringInit(&dsEncodings);
- charset = NULL; /* lint, since numNames must be > 0 to get here. */
+ charset = NULL; /* numNames must be > 0 to get here. */
retry:
bestIdx[0] = -1;
@@ -2587,7 +2584,7 @@ CanUseFallback(
* make a copy.
*/
- nameList = ckalloc(numNames * sizeof(char *));
+ nameList = (char **)ckalloc(numNames * sizeof(char *));
memcpy(nameList, nameListOrig, numNames * sizeof(char *));
}
nameList[nameIdx] = NULL;
@@ -2632,7 +2629,7 @@ CanUseFallback(
if (fontPtr->numSubFonts >= SUBFONT_SPACE) {
SubFont *newPtr;
- newPtr = ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
+ newPtr = (SubFont *)ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
memcpy(newPtr, fontPtr->subFontArray,
fontPtr->numSubFonts * sizeof(SubFont));
if (fixSubFontPtrPtr != NULL) {
@@ -2722,7 +2719,7 @@ RankAttributes(
penalty += diff;
}
if (gotPtr->xa.charset != wantPtr->xa.charset) {
- int i;
+ size_t i;
const char *gotAlias, *wantAlias;
penalty += 65000;
@@ -2730,7 +2727,7 @@ RankAttributes(
wantAlias = GetEncodingAlias(wantPtr->xa.charset);
if (strcmp(gotAlias, wantAlias) != 0) {
penalty += 30000;
- for (i = 0; encodingList[i] != NULL; i++) {
+ for (i = 0; i < sizeof(encodingList)/sizeof(encodingList[0]); i++) {
if (strcmp(gotAlias, encodingList[i]) == 0) {
penalty -= 30000;
break;
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c
index cac6f8e..f57eaa5 100644
--- a/unix/tkUnixRFont.c
+++ b/unix/tkUnixRFont.c
@@ -262,9 +262,9 @@ FinishedWithFont(
static int
InitFontErrorProc(
ClientData clientData,
- XErrorEvent *errorPtr)
+ TCL_UNUSED(XErrorEvent *))
{
- int *errorFlagPtr = (int *) clientData;
+ int *errorFlagPtr = (int *)clientData;
if (errorFlagPtr != NULL) {
*errorFlagPtr = 1;
@@ -286,7 +286,7 @@ InitFont(
Tk_ErrorHandler handler;
if (!fontPtr) {
- fontPtr = ckalloc(sizeof(UnixFtFont));
+ fontPtr = (UnixFtFont *)ckalloc(sizeof(UnixFtFont));
}
FcConfigSubstitute(0, pattern, FcMatchPattern);
@@ -304,7 +304,7 @@ InitFont(
fontPtr->fontset = set;
fontPtr->pattern = pattern;
- fontPtr->faces = ckalloc(set->nfont * sizeof(UnixFtFace));
+ fontPtr->faces = (UnixFtFace *)ckalloc(set->nfont * sizeof(UnixFtFace));
fontPtr->nfaces = set->nfont;
/*
@@ -666,7 +666,7 @@ TkpGetSubFonts(
void
TkpGetFontAttrsForChar(
- Tk_Window tkwin, /* Window on the font's display */
+ TCL_UNUSED(Tk_Window), /* Window on the font's display */
Tk_Font tkfont, /* Font to query */
int c, /* Character of interest */
TkFontAttributes *faPtr) /* Output: Font attributes */
@@ -945,7 +945,7 @@ Tk_DrawChars(
}
XGetGCValues(display, gc, GCForeground, &values);
xftcolor = LookUpColor(display, fontPtr, values.foreground);
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
@@ -995,7 +995,7 @@ Tk_DrawChars(
}
doUnderlineStrikeout:
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, NULL);
}
if (fontPtr->font.fa.underline != 0) {
@@ -1087,7 +1087,7 @@ TkDrawAngledChars(
nglyph = 0;
currentFtFont = NULL;
- originX = originY = 0; /* lint */
+ originX = originY = 0;
while (numBytes > 0) {
XftFont *ftFont;
@@ -1189,7 +1189,7 @@ TkDrawAngledChars(
}
XGetGCValues(display, gc, GCForeground, &values);
xftcolor = LookUpColor(display, fontPtr, values.foreground);
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
@@ -1241,7 +1241,7 @@ TkDrawAngledChars(
#endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */
doUnderlineStrikeout:
- if (tsdPtr->clipRegion != None) {
+ if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, NULL);
}
if (fontPtr->font.fa.underline || fontPtr->font.fa.overstrike) {