Import some minor cleanups from Google's copy.
Change-Id: Ib32933e9cd85d72da254cb4c53ffc5ea85497c7b
Reviewed-on: https://code-review.googlesource.com/2260
Reviewed-by: Perry Lorier <perryl@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/onepass.cc b/re2/onepass.cc
index 1c49988..d2db071 100644
--- a/re2/onepass.cc
+++ b/re2/onepass.cc
@@ -126,9 +126,6 @@
// whether a set of conditions required to finish a match at that
// point in the input rather than process the next byte.
-// A state in the one-pass NFA (aka DFA) - just an array of actions.
-struct OneState;
-
// A state in the one-pass NFA - just an array of actions indexed
// by the bytemap_[] of the next input byte. (The bytemap
// maps next input bytes into equivalence classes, to reduce
diff --git a/re2/prefilter_tree.h b/re2/prefilter_tree.h
index 4facb70..abea55d 100644
--- a/re2/prefilter_tree.h
+++ b/re2/prefilter_tree.h
@@ -22,7 +22,7 @@
namespace re2 {
typedef SparseArray<int> IntMap;
-typedef map<int,int> StdIntMap;
+typedef map<int, int> StdIntMap;
class Prefilter;
diff --git a/re2/re2.cc b/re2/re2.cc
index fa30b14..2283f69 100644
--- a/re2/re2.cc
+++ b/re2/re2.cc
@@ -541,7 +541,10 @@
if (startpos < 0 || startpos > endpos || endpos > text.size()) {
if (options_.log_errors())
- LOG(ERROR) << "RE2: invalid startpos, endpos pair.";
+ LOG(ERROR) << "RE2: invalid startpos, endpos pair. ["
+ << "startpos: " << startpos << ", "
+ << "endpos: " << endpos << ", "
+ << "text size: " << text.size() << "]";
return false;
}
@@ -842,7 +845,7 @@
if (!args[i]->Parse(s.data(), s.size())) {
// TODO: Should we indicate what the error was?
VLOG(1) << "Parse error on #" << i << " " << s << " "
- << (void*)s.data() << "/" << s.size();
+ << (void*)s.data() << "/" << s.size();
delete[] heapvec;
return false;
}
diff --git a/util/atomicops.h b/util/atomicops.h
index f2a0867..d69b075 100644
--- a/util/atomicops.h
+++ b/util/atomicops.h
@@ -113,16 +113,6 @@
re2::MutexLock l(&mu);
}
-/*
-#error Need WriteMemoryBarrier for architecture.
-
-// Windows
-inline void WriteMemoryBarrier() {
- LONG x;
- ::InterlockedExchange(&x, 0);
-}
-*/
-
#endif
// Alpha has very weak memory ordering. If relying on WriteBarriers, one must