Commit 32d518c3 authored by Elizabeth Smith's avatar Elizabeth Smith Committed by Sara Golemon

uint isn't portable and makes some compilers angry, change to unsigned int

Summary: As part of the windows port, uint is not defined as a type and is not standard, it makes msvc choke, a simple change to unsigned int fixes the issue

Test Plan: fbmake runtests

Reviewed By: delong.j@fb.com

FB internal diff: D1278487
parent 0c8631dc
......@@ -319,7 +319,7 @@ static string metricReadable(double n, unsigned int decimals) {
static void printBenchmarkResultsAsTable(
const vector<tuple<const char*, const char*, double> >& data) {
// Width available
static const uint columns = 76;
static const unsigned int columns = 76;
// Compute the longest benchmark name
size_t longestName = 0;
......
......@@ -768,21 +768,21 @@ static int64_t handwrittenAtoi(const char* start, const char* end) {
static StringPiece pc1 = "1234567890123456789";
void handwrittenAtoiMeasure(uint n, uint digits) {
void handwrittenAtoiMeasure(unsigned int n, unsigned int digits) {
auto p = pc1.subpiece(pc1.size() - digits, digits);
FOR_EACH_RANGE (i, 0, n) {
doNotOptimizeAway(handwrittenAtoi(p.begin(), p.end()));
}
}
void follyAtoiMeasure(uint n, uint digits) {
void follyAtoiMeasure(unsigned int n, unsigned int digits) {
auto p = pc1.subpiece(pc1.size() - digits, digits);
FOR_EACH_RANGE (i, 0, n) {
doNotOptimizeAway(folly::to<int64_t>(p.begin(), p.end()));
}
}
void clibAtoiMeasure(uint n, uint digits) {
void clibAtoiMeasure(unsigned int n, unsigned int digits) {
auto p = pc1.subpiece(pc1.size() - digits, digits);
assert(*p.end() == 0);
static_assert(sizeof(long) == 8, "64-bit long assumed");
......@@ -791,7 +791,7 @@ void clibAtoiMeasure(uint n, uint digits) {
}
}
void clibStrtoulMeasure(uint n, uint digits) {
void clibStrtoulMeasure(unsigned int n, unsigned int digits) {
auto p = pc1.subpiece(pc1.size() - digits, digits);
assert(*p.end() == 0);
char * endptr;
......@@ -800,7 +800,7 @@ void clibStrtoulMeasure(uint n, uint digits) {
}
}
void lexicalCastMeasure(uint n, uint digits) {
void lexicalCastMeasure(unsigned int n, unsigned int digits) {
auto p = pc1.subpiece(pc1.size() - digits, digits);
assert(*p.end() == 0);
FOR_EACH_RANGE (i, 0, n) {
......@@ -843,7 +843,7 @@ unsigned u64ToAsciiTable(uint64_t value, char* dst) {
return length;
}
void u64ToAsciiTableBM(uint n, uint64_t value) {
void u64ToAsciiTableBM(unsigned int n, uint64_t value) {
// This is too fast, need to do 10 times per iteration
char buf[20];
FOR_EACH_RANGE (i, 0, n) {
......@@ -873,7 +873,7 @@ unsigned u64ToAsciiClassic(uint64_t value, char* dst) {
return length;
}
void u64ToAsciiClassicBM(uint n, uint64_t value) {
void u64ToAsciiClassicBM(unsigned int n, uint64_t value) {
// This is too fast, need to do 10 times per iteration
char buf[20];
FOR_EACH_RANGE (i, 0, n) {
......@@ -881,7 +881,7 @@ void u64ToAsciiClassicBM(uint n, uint64_t value) {
}
}
void u64ToAsciiFollyBM(uint n, uint64_t value) {
void u64ToAsciiFollyBM(unsigned int n, uint64_t value) {
// This is too fast, need to do 10 times per iteration
char buf[20];
FOR_EACH_RANGE (i, 0, n) {
......@@ -891,7 +891,7 @@ void u64ToAsciiFollyBM(uint n, uint64_t value) {
// Benchmark uitoa with string append
void u2aAppendClassicBM(uint n, uint64_t value) {
void u2aAppendClassicBM(unsigned int n, uint64_t value) {
string s;
FOR_EACH_RANGE (i, 0, n) {
// auto buf = &s.back() + 1;
......@@ -901,7 +901,7 @@ void u2aAppendClassicBM(uint n, uint64_t value) {
}
}
void u2aAppendFollyBM(uint n, uint64_t value) {
void u2aAppendFollyBM(unsigned int n, uint64_t value) {
string s;
FOR_EACH_RANGE (i, 0, n) {
// auto buf = &s.back() + 1;
......
......@@ -22,7 +22,7 @@
using folly::Histogram;
void addValue(uint n, int64_t bucketSize, int64_t min, int64_t max) {
void addValue(unsigned int n, int64_t bucketSize, int64_t min, int64_t max) {
Histogram<int64_t> hist(bucketSize, min, max);
int64_t num = min;
FOR_EACH_RANGE (i, 0, n) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment