summaryrefslogtreecommitdiff
path: root/audio/milkytracker/patches
diff options
context:
space:
mode:
authordholland <dholland>2014-01-02 06:45:47 +0000
committerdholland <dholland>2014-01-02 06:45:47 +0000
commitf883094024c1f26eed29c480d2fdc80974d07cab (patch)
treedc40599c4b3d4dbb871543e2a3a40cc6fe04999c /audio/milkytracker/patches
parent758e79acfdcb732b738bff48b94aaa507c316c20 (diff)
downloadpkgsrc-f883094024c1f26eed29c480d2fdc80974d07cab.tar.gz
Taking the absolute value of the difference of two things doesn't work
if the difference is unsigned. Do something else instead. (It is backup logic for the clock going backwards while fading out the splash screen, so it's not exactly critical.) Caught by the Solaris C++ compiler, which warns if you try to pass an unsigned value to abs(). PKGREVISION++.
Diffstat (limited to 'audio/milkytracker/patches')
-rw-r--r--audio/milkytracker/patches/patch-src_tracker_TrackerStartup.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/audio/milkytracker/patches/patch-src_tracker_TrackerStartup.cpp b/audio/milkytracker/patches/patch-src_tracker_TrackerStartup.cpp
new file mode 100644
index 00000000000..c06b302dc67
--- /dev/null
+++ b/audio/milkytracker/patches/patch-src_tracker_TrackerStartup.cpp
@@ -0,0 +1,27 @@
+$NetBSD: patch-src_tracker_TrackerStartup.cpp,v 1.1 2014/01/02 06:45:48 dholland Exp $
+
+Taking the absolute value of the difference of two values doesn't work
+if the difference is unsigned. Do something else semi-reasonable
+instead for the case when the clock goes backwards.
+
+--- src/tracker/TrackerStartUp.cpp~ 2008-02-23 16:32:45.000000000 +0000
++++ src/tracker/TrackerStartUp.cpp
+@@ -134,14 +134,16 @@ void Tracker::hideSplash()
+ pp_int32 deltaT = 100;
+ while (shade >= 0.0f)
+ {
+- pp_int32 startTime = ::PPGetTickCount();
++ pp_uint32 startTime = ::PPGetTickCount();
+ #if defined(__EXCLUDE_BIGLOGO__) || defined(__LOWRES__)
+ screen->paintSplash(LogoSmall::rawData, LogoSmall::width, LogoSmall::height, LogoSmall::width*4, 4, (int)shade);
+ #else
+ screen->paintSplash(LogoBig::rawData, LogoBig::width, LogoBig::height, LogoBig::width*3, 3, (int)shade);
+ #endif
+ shade-=deltaT * (1.0f/6.25f);
+- deltaT = abs(::PPGetTickCount() - startTime);
++ pp_uint32 nowTime = ::PPGetTickCount();
++ /* just in case the clock goes backwards */
++ deltaT = nowTime > startTime ? nowTime - startTime : 0;
+ if (!deltaT) deltaT++;
+ }
+ screen->clear();