| Index: third_party/re2/re2/testing/regexp_generator.cc
|
| diff --git a/third_party/re2/re2/testing/regexp_generator.cc b/third_party/re2/re2/testing/regexp_generator.cc
|
| index fd085dbfc13b9447d4d43e56f390fd737b550648..cf2db11855f5ab12d3068adb4c3cd900352189a5 100644
|
| --- a/third_party/re2/re2/testing/regexp_generator.cc
|
| +++ b/third_party/re2/re2/testing/regexp_generator.cc
|
| @@ -111,7 +111,7 @@
|
|
|
| // Add atoms if there is room.
|
| if (atoms < maxatoms_) {
|
| - for (size_t i = 0; i < atoms_.size(); i++) {
|
| + for (int i = 0; i < atoms_.size(); i++) {
|
| post->push_back(atoms_[i]);
|
| GeneratePostfix(post, nstk + 1, ops, atoms + 1);
|
| post->pop_back();
|
| @@ -120,7 +120,7 @@
|
|
|
| // Add operators if there are enough arguments.
|
| if (ops < maxops_) {
|
| - for (size_t i = 0; i < ops_.size(); i++) {
|
| + for (int i = 0; i < ops_.size(); i++) {
|
| const string& fmt = ops_[i];
|
| int nargs = CountArgs(fmt);
|
| if (nargs <= nstk) {
|
| @@ -134,7 +134,7 @@
|
|
|
| // Generates a random postfix command sequence.
|
| // Stops and returns true once a single sequence has been generated.
|
| -bool RegexpGenerator::GenerateRandomPostfix(vector<string>* post, int nstk,
|
| +bool RegexpGenerator::GenerateRandomPostfix(vector<string> *post, int nstk,
|
| int ops, int atoms) {
|
| for (;;) {
|
| // Stop if we get to a single element, but only sometimes.
|
| @@ -151,7 +151,7 @@
|
|
|
| // Add operators if there are enough arguments.
|
| if (ops < maxops_ && acm_->Uniform(2) == 0) {
|
| - const string& fmt = ops_[acm_->Uniform(static_cast<int32>(ops_.size()))];
|
| + const string& fmt = ops_[acm_->Uniform(ops_.size())];
|
| int nargs = CountArgs(fmt);
|
| if (nargs <= nstk) {
|
| post->push_back(fmt);
|
| @@ -165,7 +165,7 @@
|
|
|
| // Add atoms if there is room.
|
| if (atoms < maxatoms_ && acm_->Uniform(2) == 0) {
|
| - post->push_back(atoms_[acm_->Uniform(static_cast<int32>(atoms_.size()))]);
|
| + post->push_back(atoms_[acm_->Uniform(atoms_.size())]);
|
| bool ret = GenerateRandomPostfix(post, nstk + 1, ops, atoms + 1);
|
| post->pop_back();
|
| if (ret)
|
| @@ -179,7 +179,7 @@
|
| // in (?: ) to avoid needing to maintain a precedence table.
|
| void RegexpGenerator::RunPostfix(const vector<string>& post) {
|
| stack<string> regexps;
|
| - for (size_t i = 0; i < post.size(); i++) {
|
| + for (int i = 0; i < post.size(); i++) {
|
| switch (CountArgs(post[i])) {
|
| default:
|
| LOG(FATAL) << "Bad operator: " << post[i];
|
| @@ -208,7 +208,7 @@
|
| if (regexps.size() != 1) {
|
| // Internal error - should never happen.
|
| printf("Bad regexp program:\n");
|
| - for (size_t i = 0; i < post.size(); i++) {
|
| + for (int i = 0; i < post.size(); i++) {
|
| printf(" %s\n", CEscape(post[i]).c_str());
|
| }
|
| printf("Stack after running program:\n");
|
|
|