[Cmake-commits] CMake branch, master, updated. a170690fd2490fb84c87d7897f5ceac78da8f512
cmake-commits at cmake.org
cmake-commits at cmake.org
Wed Apr 28 17:50:04 EDT 2010
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 "CMake".
The branch, master has been updated
via a170690fd2490fb84c87d7897f5ceac78da8f512 (commit)
from 9e99ac58793d8e99df37bda06097c76a0649702e (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://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a170690fd2490fb84c87d7897f5ceac78da8f512
commit a170690fd2490fb84c87d7897f5ceac78da8f512
Author: Bill Hoffman <bill.hoffman at kitware.com>
Date: Wed Apr 28 17:42:22 2010 -0400
Fix for bug #10550, work around instantiation out of scope
diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in
index b36c975..2b80f4b 100644
--- a/Source/kwsys/hashtable.hxx.in
+++ b/Source/kwsys/hashtable.hxx.in
@@ -388,6 +388,10 @@ struct _Hashtable_const_iterator {
// Note: assumes long is at least 32 bits.
enum { _stl_num_primes = 31 };
+// create a function with a static local to that function that returns
+// the static
+const unsigned long* get_stl_prime_list() {
+
static const unsigned long _stl_prime_list[_stl_num_primes] =
{
5ul, 11ul, 23ul,
@@ -399,10 +403,12 @@ static const unsigned long _stl_prime_list[_stl_num_primes] =
1610612741ul, 3221225473ul, 4294967291ul
};
+return &_stl_prime_list[0]; }
+
inline size_t _stl_next_prime(size_t __n)
{
- const unsigned long* __first = _stl_prime_list;
- const unsigned long* __last = _stl_prime_list + (int)_stl_num_primes;
+ const unsigned long* __first = get_stl_prime_list();
+ const unsigned long* __last = get_stl_prime_list() + (int)_stl_num_primes;
const unsigned long* pos = @KWSYS_NAMESPACE at _stl::lower_bound(__first, __last, __n);
return pos == __last ? *(__last - 1) : *pos;
}
@@ -587,7 +593,7 @@ public:
size_type bucket_count() const { return _M_buckets.size(); }
size_type max_bucket_count() const
- { return _stl_prime_list[(int)_stl_num_primes - 1]; }
+ { return get_stl_prime_list()[(int)_stl_num_primes - 1]; }
size_type elems_in_bucket(size_type __bucket) const
{
diff --git a/Source/kwsys/testAutoPtr.cxx b/Source/kwsys/testAutoPtr.cxx
index 747d869..ed75ff4 100644
--- a/Source/kwsys/testAutoPtr.cxx
+++ b/Source/kwsys/testAutoPtr.cxx
@@ -25,7 +25,7 @@
#define ASSERT(x,y) if (!(x)) { printf("FAIL: " y "\n"); status = 1; }
-static int instances = 0;
+int instances = 0; // don't declare as static
struct A
{
-----------------------------------------------------------------------
Summary of changes:
Source/kwsys/hashtable.hxx.in | 12 +++++++++---
Source/kwsys/testAutoPtr.cxx | 2 +-
2 files changed, 10 insertions(+), 4 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list