gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-610-g6210410
Date: Mon, 01 Aug 2011 07:43:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  621041022c13220d196b14480e74326e7ce69912 (commit)
      from  393ff1cc65e0beffee5ff4de898502ae969ac719 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=621041022c13220d196b14480e74326e7ce69912


commit 621041022c13220d196b14480e74326e7ce69912
Author: Benjamin Wolsey <address@hidden>
Date:   Mon Aug 1 09:41:59 2011 +0200

    Fix RNG for old boost versions.

diff --git a/libcore/asobj/flash/display/BitmapData_as.cpp 
b/libcore/asobj/flash/display/BitmapData_as.cpp
index 9304e74..74ae89d 100644
--- a/libcore/asobj/flash/display/BitmapData_as.cpp
+++ b/libcore/asobj/flash/display/BitmapData_as.cpp
@@ -162,6 +162,10 @@ namespace {
 template<typename RNG = boost::rand48>
 struct Noise
 {
+    typedef RNG Rand;
+    typedef boost::uniform_int<> Dist;
+    typedef boost::variate_generator<Rand, boost::uniform_int<> > Gen;
+
     /// Create a PRNG to supply uniformly distributed numbers.
     //
     /// @param seed     A seed for the pseudo random numbers.
@@ -183,13 +187,16 @@ struct Noise
     //
     /// This is for use by std::random_shuffle().
     int operator()(int val) {
-        return uni(val);
+        // Note: in versions of boost newer than 1.35 or so, we can just call
+        // uni(val), but we still aim to support 1.35 (and 1.34 if possible).
+        typedef boost::random_number_generator<Gen> Adapter;
+        return Adapter(uni)(val);
     }
 
 private:
-    RNG rng;
-    boost::uniform_int<> dist;
-    boost::variate_generator<RNG, boost::uniform_int<> > uni;
+    Rand rng;
+    Dist dist;
+    Gen uni;
 };
 
 template<typename NoiseGenerator>

-----------------------------------------------------------------------

Summary of changes:
 libcore/asobj/flash/display/BitmapData_as.cpp |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]