Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: third_party/re2/util/random.h

Issue 10575037: Include RE2 library (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Less intrusive fix for Android Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/re2/util/pcre.cc ('k') | third_party/re2/util/random.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2005-2009 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Modified from Google perftools's tcmalloc_unittest.cc.
6
7 #ifndef RE2_UTIL_RANDOM_H__
8 #define RE2_UTIL_RANDOM_H__
9
10 #include "util/util.h"
11
12 namespace re2 {
13
14 // ACM minimal standard random number generator. (re-entrant.)
15 class ACMRandom {
16 public:
17 ACMRandom(int32 seed) : seed_(seed) {}
18 int32 Next();
19 int32 Uniform(int32);
20
21 void Reset(int32 seed) { seed_ = seed; }
22
23 private:
24 int32 seed_;
25 };
26
27 } // namespace re2
28
29 #endif // RE2_UTIL_RANDOM_H__
OLDNEW
« no previous file with comments | « third_party/re2/util/pcre.cc ('k') | third_party/re2/util/random.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698