kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/4] incubator-kudu git commit: Fix UniformRandomNumberGenerator concept impl
Date Wed, 09 Mar 2016 22:24:19 GMT
Repository: incubator-kudu
Updated Branches:
  refs/heads/master 044b2c1bd -> 548399849


Fix UniformRandomNumberGenerator concept impl

The previous implementation was fine for libstdc++, but fails to compile on OS X.

Change-Id: I3c1c8766fee491fc3116a0ff28a76d1a41eeaadc
Reviewed-on: http://gerrit.cloudera.org:8080/2489
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/5f2f40df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/5f2f40df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/5f2f40df

Branch: refs/heads/master
Commit: 5f2f40dfe33b31e501b72412c4c6fe7fea9fa9ee
Parents: 044b2c1
Author: Dan Burkert <dan@cloudera.com>
Authored: Tue Mar 8 13:35:35 2016 -0800
Committer: Dan Burkert <dan@cloudera.com>
Committed: Wed Mar 9 02:09:35 2016 +0000

----------------------------------------------------------------------
 src/kudu/util/random.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/5f2f40df/src/kudu/util/random.h
----------------------------------------------------------------------
diff --git a/src/kudu/util/random.h b/src/kudu/util/random.h
index 1b61862..c466229 100644
--- a/src/kudu/util/random.h
+++ b/src/kudu/util/random.h
@@ -4,9 +4,8 @@
 #ifndef KUDU_UTIL_RANDOM_H_
 #define KUDU_UTIL_RANDOM_H_
 
-#include <stdint.h>
-
 #include <cmath>
+#include <cstdint>
 #include <random>
 #include <vector>
 
@@ -232,8 +231,8 @@ class StdUniformRNG {
   uint32_t operator()() {
     return r_->Next32();
   }
-  uint32_t min() const { return 0; }
-  uint32_t max() const { return (1L << 31) - 1; }
+  constexpr static uint32_t min() { return 0; }
+  constexpr static uint32_t max() { return (1L << 31) - 1; }
 
  private:
   R* r_;


Mime
View raw message