From 22e1b04debe9a209bfddc0449de661400050de94 Mon Sep 17 00:00:00 2001 From: Kai Liu Date: Tue, 12 Nov 2013 21:15:49 -0800 Subject: [PATCH] Quick fix for a string format Summary: Fix one more string format issue that throws warning in mac --- tools/sst_dump.cc | 4 +++- util/histogram.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/sst_dump.cc b/tools/sst_dump.cc index c89b8e372..903889556 100644 --- a/tools/sst_dump.cc +++ b/tools/sst_dump.cc @@ -180,7 +180,9 @@ int main(int argc, char** argv) { output_hex = true; } else if (strcmp(argv[i], "--input_key_hex") == 0) { input_key_hex = true; - } else if (sscanf(argv[i], "--read_num=%ld%c", &n, &junk) == 1) { + } else if (sscanf(argv[i], + "--read_num=%lu%c", + (unsigned long*)&n, &junk) == 1) { read_num = n; } else if (strcmp(argv[i], "--verify_checksum") == 0) { verify_checksum = true; diff --git a/util/histogram.cc b/util/histogram.cc index 19b6189d6..e83998014 100644 --- a/util/histogram.cc +++ b/util/histogram.cc @@ -169,7 +169,7 @@ std::string HistogramImpl::ToString() const { // left (unsigned long)((b == 0) ? 0 : bucketMapper.BucketLimit(b-1)), (unsigned long)bucketMapper.BucketLimit(b), // right - buckets_[b], // count + (unsigned long)buckets_[b], // count (mult * buckets_[b]), // percentage (mult * sum)); // cumulative percentage r.append(buf);