summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-10-22 08:32:21 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-10-22 08:32:21 (GMT)
commitdaf41a1547accd08cb2e0a0ba22c735c7bef663e (patch)
tree0f579affff4112654729367d4381bc7c36c2811d
parentaf8c392558252e9cc2550c8b32e5a254569f29eb (diff)
downloadtk-daf41a1547accd08cb2e0a0ba22c735c7bef663e.zip
tk-daf41a1547accd08cb2e0a0ba22c735c7bef663e.tar.gz
tk-daf41a1547accd08cb2e0a0ba22c735c7bef663e.tar.bz2
Fix [Bug 2883712] by factoring out the problem code.
-rw-r--r--ChangeLog38
-rw-r--r--macosx/ttkMacOSXTheme.c12
2 files changed, 30 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index c137173..f728108 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,13 @@
+2009-10-22 Donal K. Fellows <dkf@users.sf.net>
+
+ * macosx/ttkMacOSXTheme.c (RangeToFactor): [Bug 2883712]: Factor out
+ some common code and make sure that it is 64-bit correct.
+
2009-10-21 Jan Nijtmans <nijtmans@users.sf.net>
- * win/Makefile.in: Bug fix for #2875562
- * win/winMain.c: Make sure that winMain.c and tkAppInit.c
- * unix/tkAppInit.c are never compiled with stubs.
+ * win/Makefile.in: [Bug 2875562]: Make sure that winMain.c and
+ * win/winMain.c: tkAppInit.c are never compiled with stubs.
+ * unix/tkAppInit.c:
2009-10-20 Don Porter <dgp@users.sourceforge.net>
@@ -16,9 +21,8 @@
2009-10-20 Andreas Kupries <andreask@activestate.com>
- * library/msgs/pl.msg: Applied patch to Polish message catalog
- created and submitted by Pawel Pawlak <morris@elysium.pl> (via
- JeffH).
+ * library/msgs/pl.msg: Applied patch to Polish message catalog created
+ and submitted by Pawel Pawlak <morris@elysium.pl> (via JeffH).
2009-10-18 Donal K. Fellows <dkf@users.sf.net>
@@ -333,7 +337,7 @@
2009-06-29 Daniel Steffen <das@users.sourceforge.net>
Merge of TkAqua Cocoa port <http://github.com/das/tcltk/tree/de-carbon>
- *** POTENTIAL INCOMPATIBILITY ***
+ *** POTENTIAL INCOMPATIBILITY ***
* macosx/tkMacOSX.h: Large-scale rewrite of TkAqua migrating
* macosx/tkMacOSXBitmap.c: all use of deprecated Carbon API to
@@ -532,9 +536,9 @@
* library/images/lamp.svg: Added an SVG version of the Tk lamp and
* library/images/lamp.png: a pre-rendered PNG version.
- * win/rc/wish.ico: Wish gets a new icon using the SVG lamp and the
- * win/rc/tk.ico: tk dll gets the tcl rendered feather. This
- provides improved icons for Vista/Windows 7.
+ * win/rc/wish.ico: Wish gets a new icon using the SVG lamp and the tk
+ * win/rc/tk.ico: dll gets the tcl rendered feather. This provides
+ improved icons for Vista/Windows 7.
2009-05-05 Donal K. Fellows <dkf@users.sf.net>
@@ -897,17 +901,17 @@
* unix/tcl.m4: Corrected a typo ($(SHLIB_VERSION) should be
${SHLIB_VERSION}).
* unix/configure: Autoconf 2.59
-
+
2009-01-19 Kevin B. Kenny <kennykb@acm.org>
* unix/Makefile.in: Added a CONFIG_INSTALL_DIR parameter so that
* unix/tcl.m4: distributors can control where tclConfig.sh goes.
Made the installation of 'ldAix' conditional upon actually being on an
AIX system. Allowed for downstream packagers to customize
- SHLIB_VERSION on BSD-derived systems.
+ SHLIB_VERSION on BSD-derived systems.
Thanks to Stuart Cassoff for [Patch 907924].
* unix/configure: Autoconf 2.59
-
+
2009-01-16 Don Porter <dgp@users.sourceforge.net>
* generic/tk.h: Bump patchlevel to 8.6b1.1 to distinguish
@@ -1149,8 +1153,8 @@
* macosx/tkMacOSXFont.h:
* macosx/Wish.xcodeproj/project.pbxproj:
* library/fontchooser.tcl (new):
- * library/tclIndex:
- * library/msgs/de.msg:
+ * library/tclIndex:
+ * library/msgs/de.msg:
* library/msgs/en.msg:
* tests/fontchooser.test (new):
* tests/winDialog.test:
@@ -1247,7 +1251,7 @@
2008-12-04 Donal K. Fellows <dkf@users.sf.net>
- * doc/ttk_button.n, doc/ttk_checkbutton.n, doc/ttk_menubutton.n:
+ * doc/ttk_button.n, doc/ttk_checkbutton.n, doc/ttk_menubutton.n:
* doc/ttk_radiobutton.n: Added mention of the Toolbutton style to all
widgets that can sensibly make use of it.
@@ -1596,7 +1600,7 @@
library/ttk/entry.tcl, library/ttk/paned.tcl, library/ttk/sizegrip.tcl,
library/treeview.tcl:
Add correct platform-specific cursors for OSX [Bug 2054562]
- Expanded set of symbolic cursors. Use correct cursor for
+ Expanded set of symbolic cursors. Use correct cursor for
ttk::entry and ttk::combobox widgets [Bug 1534835]
2008-10-28 Don Porter <dgp@users.sourceforge.net>
diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c
index bc8a35b..fd8f6d3 100644
--- a/macosx/ttkMacOSXTheme.c
+++ b/macosx/ttkMacOSXTheme.c
@@ -29,7 +29,7 @@
* top-level window, not to the Tk_Window. BoxToRect()
* accounts for this.
*
- * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.28 2009/07/15 21:50:40 das Exp $
+ * RCS: @(#) $Id: ttkMacOSXTheme.c,v 1.29 2009/10/22 08:32:23 dkf Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -46,6 +46,12 @@
#define HIOrientation kHIThemeOrientationNormal
+#ifdef __LP64__
+#define RangeToFactor(maximum) (((double) (INT_MAX >> 1)) / (maximum))
+#else
+#define RangeToFactor(maximum) (((double) (LONG_MAX >> 1)) / (maximum))
+#endif /* __LP64__ */
+
/*----------------------------------------------------------------------
* +++ Utilities.
*/
@@ -627,7 +633,7 @@ static void TrackElementDraw(
Tcl_GetDoubleFromObj(NULL, elem->fromObj, &from);
Tcl_GetDoubleFromObj(NULL, elem->toObj, &to);
Tcl_GetDoubleFromObj(NULL, elem->valueObj, &value);
- factor = ((double)(LONG_MAX>>1))/(to - from);
+ factor = RangeToFactor(to - from);
HIThemeTrackDrawInfo info = {
.version = 0,
@@ -739,7 +745,7 @@ static void PbarElementDraw(
Tcl_GetDoubleFromObj(NULL, pbar->valueObj, &value);
Tcl_GetDoubleFromObj(NULL, pbar->maximumObj, &maximum);
Tcl_GetIntFromObj(NULL, pbar->phaseObj, &phase);
- factor = ((double)(LONG_MAX>>1))/maximum;
+ factor = RangeToFactor(maximum);
HIThemeTrackDrawInfo info = {
.version = 0,