Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80501 - trunk/boost/uuid
From: atompkins_at_[hidden]
Date: 2012-09-11 21:14:39


Author: atompkins
Date: 2012-09-11 21:14:39 EDT (Tue, 11 Sep 2012)
New Revision: 80501
URL: http://svn.boost.org/trac/boost/changeset/80501

Log:
remove incorrect comment
try ignore_size() function to get rid of warning
initialize m_value in default constructor of generator_iterator
Text files modified:
   trunk/boost/uuid/seed_rng.hpp | 12 ++++--------
   1 files changed, 4 insertions(+), 8 deletions(-)

Modified: trunk/boost/uuid/seed_rng.hpp
==============================================================================
--- trunk/boost/uuid/seed_rng.hpp (original)
+++ trunk/boost/uuid/seed_rng.hpp 2012-09-11 21:14:39 EDT (Tue, 11 Sep 2012)
@@ -109,9 +109,10 @@
     }
 
 private:
+ inline void ignore_size(size_t) {}
+
     static unsigned int * sha1_random_digest_state_()
     {
- // intentionally left uninitialized
         static unsigned int state[ 5 ];
         return state;
     }
@@ -153,12 +154,7 @@
 
             if(random_)
             {
- // the not_used variable is to suppress warnings
-#if defined(__GNUC__)
- __attribute__((unused))
-#endif
- size_t not_used = 0;
- not_used += std::fread( buffer, 1, 20, random_ );
+ ignore_size(std::fread( buffer, 1, 20, random_ ));
             }
 
             // using an uninitialized buffer[] if fopen fails
@@ -218,7 +214,7 @@
> super_t;
     
  public:
- generator_iterator() : m_g(NULL) {}
+ generator_iterator() : m_g(NULL), m_value(0) {}
     generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}
 
     void increment()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk