Skip to content

Commit

Permalink
Get rid of using-directives.
Browse files Browse the repository at this point in the history
Change-Id: I36187cd0246a239a23c094d83bbc95ebb9699fee
Reviewed-on: https://code-review.googlesource.com/5550
Reviewed-by: Paul Wankadia <[email protected]>
  • Loading branch information
junyer committed Aug 7, 2016
1 parent 6e74bfc commit 336696a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 3 additions & 1 deletion re2/set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "re2/re2.h"
#include "re2/regexp.h"

using namespace re2;
namespace re2 {

RE2::Set::Set(const RE2::Options& options, RE2::Anchor anchor) {
options_.Copy(options);
Expand Down Expand Up @@ -114,3 +114,5 @@ bool RE2::Set::Match(const StringPiece& text, std::vector<int>* v) const {
}
return true;
}

} // namespace re2
6 changes: 2 additions & 4 deletions testinstall.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
#include <re2/filtered_re2.h>
#include <stdio.h>

using namespace re2;

int main(void) {
FilteredRE2 f;
re2::FilteredRE2 f;
int id;
f.Add("a.*b.*c", RE2::DefaultOptions, &id);
std::vector<string> v;
std::vector<std::string> v;
f.Compile(&v);
std::vector<int> ids;
f.FirstMatch("abbccc", ids);
Expand Down
18 changes: 9 additions & 9 deletions util/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#include <stdint.h>
#if defined(__APPLE__)
#include <sys/time.h>
#elif defined(_WIN32)
Expand All @@ -19,7 +20,6 @@
DEFINE_string(test_tmpdir, "/var/tmp", "temp directory");

using testing::Benchmark;
using namespace re2;

static Benchmark* benchmarks[10000];
static int nbenchmarks;
Expand All @@ -33,17 +33,17 @@ void Benchmark::Register() {
nbenchmarks++;
}

static int64 nsec() {
static int64_t nsec() {
#if defined(__APPLE__)
struct timeval tv;
if(gettimeofday(&tv, 0) < 0)
return -1;
return (int64)tv.tv_sec*1000*1000*1000 + tv.tv_usec*1000;
return (int64_t)tv.tv_sec*1000*1000*1000 + tv.tv_usec*1000;
#elif defined(_WIN32)
// https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408.aspx
// describes how to query ticks and convert to microseconds. Of course,
// what we want in this case are nanoseconds. Also, note that .QuadPart
// is a signed 64-bit integer, so casting to int64 shouldn't be needed.
// is a signed 64-bit integer, so casting to int64_t shouldn't be needed.
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
LARGE_INTEGER ticks;
Expand All @@ -59,14 +59,14 @@ static int64 nsec() {
if(clock_gettime(CLOCK_REALTIME, &tp) < 0)
#endif
return -1;
return (int64)tp.tv_sec*1000*1000*1000 + tp.tv_nsec;
return (int64_t)tp.tv_sec*1000*1000*1000 + tp.tv_nsec;
#endif
}

static int64 bytes;
static int64 ns;
static int64 t0;
static int64 items;
static int64_t bytes;
static int64_t ns;
static int64_t t0;
static int64_t items;

void SetBenchmarkBytesProcessed(long long x) {
bytes = x;
Expand Down

0 comments on commit 336696a

Please sign in to comment.