aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Wankadia <junyer@google.com>2018-08-30 06:51:14 -0700
committerPaul Wankadia <junyer@google.com>2018-08-30 13:52:20 +0000
commitee1f6d20207caa0bcfe1b466d241757555c7f796 (patch)
treeb145d53b2885c7441bcc9b7d0ec8b3fb4f2bbf33
parent75c7788474ee91fb7db2bc43f8bc1afda36ed579 (diff)
downloadregex-re2-ee1f6d20207caa0bcfe1b466d241757555c7f796.tar.gz
Address MSVC error and warnings. Sigh.
Change-Id: Ife0b0cf6dac9341397c15624912bb86372056970 Reviewed-on: https://code-review.googlesource.com/32390 Reviewed-by: Paul Wankadia <junyer@google.com>
-rw-r--r--re2/bitstate.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/re2/bitstate.cc b/re2/bitstate.cc
index c9b4cad..fcb2460 100644
--- a/re2/bitstate.cc
+++ b/re2/bitstate.cc
@@ -76,6 +76,7 @@ BitState::BitState(Prog* prog)
endmatch_(false),
submatch_(NULL),
nsubmatch_(0),
+ job_(256), // allocates 4KiB when sizeof(Job) == 16 :)
njob_(0) {
}
@@ -83,7 +84,8 @@ BitState::BitState(Prog* prog)
// If so, remember that it was visited so that the next time,
// we don't repeat the visit.
bool BitState::ShouldVisit(int id, const char* p) {
- size_t n = id * (text_.size() + 1) + (p - text_.begin());
+ int n = id * static_cast<int>(text_.size()+1) +
+ static_cast<int>(p-text_.begin());
if (visited_[n/VisitedBits] & (1 << (n & (VisitedBits-1))))
return false;
visited_[n/VisitedBits] |= 1 << (n & (VisitedBits-1));
@@ -320,9 +322,6 @@ bool BitState::Search(const StringPiece& text, const StringPiece& context,
cap_ = PODArray<const char*>(ncap);
memset(cap_.data(), 0, ncap*sizeof cap_[0]);
- // When sizeof(Job) == 16, we start with a nice round 4KiB. :)
- job_ = PODArray<Job>(256);
-
// Anchored search must start at text.begin().
if (anchored_) {
cap_[0] = text.begin();