Skip to content

Commit 4ac09a6

Browse files
author
jan.nijtmans
committed
Optimization: borderPtr->bgColorPtr is never NULL. See: [517165eac]
2 parents c1e591d + fc2c2be commit 4ac09a6

File tree

6 files changed

+47
-50
lines changed

6 files changed

+47
-50
lines changed

generic/tk3d.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,7 @@ Tk_Free3DBorder(
428428

429429
prevPtr = (TkBorder *)Tcl_GetHashValue(borderPtr->hashPtr);
430430
TkpFreeBorder(borderPtr);
431-
if (borderPtr->bgColorPtr != NULL) {
432-
Tk_FreeColor(borderPtr->bgColorPtr);
433-
}
431+
Tk_FreeColor(borderPtr->bgColorPtr);
434432
if (borderPtr->darkColorPtr != NULL) {
435433
Tk_FreeColor(borderPtr->darkColorPtr);
436434
}
@@ -1423,8 +1421,7 @@ Tk_Get3DBorderColors(
14231421
XColor *lightColorPtr)
14241422
{
14251423
TkBorder *borderPtr = (TkBorder *)border;
1426-
static const XColor NOCOLOR = {0, 0, 0, 0, 0, 0};
1427-
const XColor *colorPtr = borderPtr->bgColorPtr ? borderPtr->bgColorPtr : &NOCOLOR;
1424+
const XColor *colorPtr = borderPtr->bgColorPtr ;
14281425

14291426
if (bgColorPtr) {
14301427
*bgColorPtr = *colorPtr;

macosx/Wish-Info.plist.in

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
<array>
4141
<dict>
4242
<key>CFBundleTypeRole</key>
43-
<string>Viewer</string>
44-
<key>CFBundleURLSchemes</key>
45-
<array>
46-
<string>foo</string>
47-
</array>
48-
<key>CFBundleURLName</key>
49-
<string>Get Foo</string>
43+
<string>Viewer</string>
44+
<key>CFBundleURLSchemes</key>
45+
<array>
46+
<string>foo</string>
47+
</array>
48+
<key>CFBundleURLName</key>
49+
<string>Get Foo</string>
5050
</dict>
5151
</array>
5252
<key>CFBundleExecutable</key>
@@ -99,8 +99,8 @@
9999
<string>Wish</string>
100100
<key>NSSendTypes</key>
101101
<array>
102-
<string>NSStringPboardType</string>
103-
<string>NSPasteboardTypeString</string>
102+
<string>NSStringPboardType</string>
103+
<string>NSPasteboardTypeString</string>
104104
</array>
105105
</dict>
106106
</array>

win/rc/tk.rc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ VS_VERSION_INFO VERSIONINFO
3232
BEGIN
3333
BLOCK "StringFileInfo"
3434
BEGIN
35-
BLOCK "040904b0"
36-
BEGIN
37-
VALUE "FileDescription", "Tk DLL\0"
38-
VALUE "OriginalFilename", "tk" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".dll\0"
39-
VALUE "FileVersion", TK_PATCH_LEVEL
40-
VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
41-
VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
42-
VALUE "ProductVersion", TK_PATCH_LEVEL
43-
END
35+
BLOCK "040904b0"
36+
BEGIN
37+
VALUE "FileDescription", "Tk DLL\0"
38+
VALUE "OriginalFilename", "tk" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".dll\0"
39+
VALUE "FileVersion", TK_PATCH_LEVEL
40+
VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
41+
VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
42+
VALUE "ProductVersion", TK_PATCH_LEVEL
43+
END
4444
END
4545
BLOCK "VarFileInfo"
4646
BEGIN
47-
VALUE "Translation", 0x409, 1200
47+
VALUE "Translation", 0x409, 1200
4848
END
4949
END
5050

win/rc/tk_base.rc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ BEGIN
2727
LTEXT "Directory &name:",-1,8,6,118,9
2828
EDITTEXT edt10,8,26,144,12, WS_TABSTOP | ES_AUTOHSCROLL
2929
LISTBOX lst2,8,40,144,64,LBS_SORT | LBS_OWNERDRAWFIXED |
30-
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT |
31-
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
30+
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT |
31+
LBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP
3232
LTEXT "Dri&ves:",stc4,8,106,92,9
3333
COMBOBOX cmb2,8,115,144,68,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
34-
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
35-
WS_VSCROLL | WS_TABSTOP
34+
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
35+
WS_VSCROLL | WS_TABSTOP
3636
DEFPUSHBUTTON "OK",1,160,6,50,14,WS_GROUP
3737
PUSHBUTTON "Cancel",2,160,24,50,14,WS_GROUP
3838
PUSHBUTTON "&Help",psh15,160,42,50,14,WS_GROUP
@@ -43,8 +43,8 @@ BEGIN
4343
EDITTEXT edt1,7,158,135,20,NOT WS_TABSTOP
4444
LISTBOX lst1,8,205,134,42,LBS_NOINTEGRALHEIGHT
4545
COMBOBOX cmb1,8,253,135,21,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED |
46-
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
47-
WS_VSCROLL
46+
CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER |
47+
WS_VSCROLL
4848

4949
END
5050

win/rc/tktest.rc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ VS_VERSION_INFO VERSIONINFO
3838
BEGIN
3939
BLOCK "StringFileInfo"
4040
BEGIN
41-
BLOCK "040904b0"
42-
BEGIN
43-
VALUE "FileDescription", "Tktest Application\0"
44-
VALUE "OriginalFilename", "tktest" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".exe\0"
45-
VALUE "FileVersion", TK_PATCH_LEVEL
46-
VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
47-
VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
48-
VALUE "ProductVersion", TK_PATCH_LEVEL
49-
END
41+
BLOCK "040904b0"
42+
BEGIN
43+
VALUE "FileDescription", "Tktest Application\0"
44+
VALUE "OriginalFilename", "tktest" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".exe\0"
45+
VALUE "FileVersion", TK_PATCH_LEVEL
46+
VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
47+
VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
48+
VALUE "ProductVersion", TK_PATCH_LEVEL
49+
END
5050
END
5151
BLOCK "VarFileInfo"
5252
BEGIN
53-
VALUE "Translation", 0x409, 1200
53+
VALUE "Translation", 0x409, 1200
5454
END
5555
END
5656

win/rc/wish.rc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ VS_VERSION_INFO VERSIONINFO
3838
BEGIN
3939
BLOCK "StringFileInfo"
4040
BEGIN
41-
BLOCK "040904b0"
42-
BEGIN
43-
VALUE "FileDescription", "Wish Application\0"
44-
VALUE "OriginalFilename", "wish" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".exe\0"
45-
VALUE "FileVersion", TK_PATCH_LEVEL
46-
VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
47-
VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
48-
VALUE "ProductVersion", TK_PATCH_LEVEL
49-
END
41+
BLOCK "040904b0"
42+
BEGIN
43+
VALUE "FileDescription", "Wish Application\0"
44+
VALUE "OriginalFilename", "wish" STRINGIFY(TK_MAJOR_VERSION) STRINGIFY(TK_MINOR_VERSION) SUFFIX ".exe\0"
45+
VALUE "FileVersion", TK_PATCH_LEVEL
46+
VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
47+
VALUE "ProductName", "Tk " TK_VERSION " for Windows\0"
48+
VALUE "ProductVersion", TK_PATCH_LEVEL
49+
END
5050
END
5151
BLOCK "VarFileInfo"
5252
BEGIN
53-
VALUE "Translation", 0x409, 1200
53+
VALUE "Translation", 0x409, 1200
5454
END
5555
END
5656

0 commit comments

Comments
 (0)