diff options
11 files changed, 18 insertions, 16 deletions
diff --git a/config/src/vespa/config/subscription/configsubscriptionset.cpp b/config/src/vespa/config/subscription/configsubscriptionset.cpp index 0b73929c738..949e36c046b 100644 --- a/config/src/vespa/config/subscription/configsubscriptionset.cpp +++ b/config/src/vespa/config/subscription/configsubscriptionset.cpp @@ -40,7 +40,7 @@ ConfigSubscriptionSet::acquireSnapshot(milliseconds timeoutInMillis, bool ignore int64_t lastGeneration = _currentGeneration; bool inSync = false; - LOG(debug, "Going into nextConfig loop, time left is %ld", timeLeft.count()); + LOG(debug, "Going into nextConfig loop, time left is %" PRId64, timeLeft.count()); while (!isClosed() && (timeLeft.count() >= 0) && !inSync) { size_t numChanged = 0; size_t numGenerationChanged = 0; @@ -79,7 +79,7 @@ ConfigSubscriptionSet::acquireSnapshot(milliseconds timeoutInMillis, bool ignore lastGeneration = generation; timeLeft = timeoutInMillis - duration_cast<milliseconds>(steady_clock::now() - startTime); if (!inSync && (timeLeft.count() > 0)) { - std::this_thread::sleep_for(std::chrono::milliseconds(std::min(10l, timeLeft.count()))); + std::this_thread::sleep_for(std::chrono::milliseconds(std::min(INT64_C(10), timeLeft.count()))); } else { break; } diff --git a/eval/src/tests/eval/compile_cache/compile_cache_test.cpp b/eval/src/tests/eval/compile_cache/compile_cache_test.cpp index 63fedb07d14..5176a4b3e94 100644 --- a/eval/src/tests/eval/compile_cache/compile_cache_test.cpp +++ b/eval/src/tests/eval/compile_cache/compile_cache_test.cpp @@ -278,7 +278,7 @@ TEST_F("compile sequentially, then run all conformance tests", test::EvalSpec()) auto t2 = steady_clock::now(); test.verify(); auto t3 = steady_clock::now(); - fprintf(stderr, "sequential (run %zu): setup: %zu ms, wait: %zu ms, verify: %zu us, total: %zu ms\n", + fprintf(stderr, "sequential (run %zu): setup: %" PRIu64 " ms, wait: %" PRIu64 " ms, verify: %" PRIu64 " us, total: %" PRIu64 " ms\n", i, count_ms(t1 - t0), count_ms(t2 - t1), count_us(t3 - t2), count_ms(t3 - t0)); } } @@ -299,7 +299,7 @@ TEST_F("compile concurrently (8 threads), then run all conformance tests", test: auto t2 = steady_clock::now(); test.verify(); auto t3 = steady_clock::now(); - fprintf(stderr, "concurrent (run %zu): setup: %zu ms, wait: %zu ms, verify: %zu us, total: %zu ms\n", + fprintf(stderr, "concurrent (run %zu): setup: %" PRIu64 " ms, wait: %" PRIu64 " ms, verify: %" PRIu64 " us, total: %" PRIu64 " ms\n", i, count_ms(t1 - t0), count_ms(t2 - t1), count_us(t3 - t2), count_ms(t3 - t0)); } } diff --git a/eval/src/vespa/eval/eval/function.cpp b/eval/src/vespa/eval/eval/function.cpp index 3d6e66acf04..03e0ae5c0a2 100644 --- a/eval/src/vespa/eval/eval/function.cpp +++ b/eval/src/vespa/eval/eval/function.cpp @@ -822,7 +822,7 @@ void parse_tensor_peek(ParseContext &ctx) { if (ctx.get() == '(') { auto expr = get_expression(ctx); if (auto num = nodes::as<nodes::Number>(*expr)) { - peek_spec.emplace(dim_name, make_string("%ld", int64_t(round(num->value())))); + peek_spec.emplace(dim_name, make_string("%" PRId64, int64_t(round(num->value())))); } else { peek_spec.emplace(dim_name, std::move(expr)); } diff --git a/eval/src/vespa/eval/eval/tensor_function.cpp b/eval/src/vespa/eval/eval/tensor_function.cpp index 9e429757982..228a723e86a 100644 --- a/eval/src/vespa/eval/eval/tensor_function.cpp +++ b/eval/src/vespa/eval/eval/tensor_function.cpp @@ -175,7 +175,7 @@ void op_tensor_peek(State &state, uint64_t param) { assert(dim_idx != ValueType::Dimension::npos); const auto ¶m_dim = self.param_type().dimensions()[dim_idx]; if (param_dim.is_mapped()) { - addr.emplace(pos->first, vespalib::make_string("%ld", int64_t(index))); + addr.emplace(pos->first, vespalib::make_string("%" PRId64, int64_t(index))); } else { addr.emplace(pos->first, size_t(index)); } @@ -394,7 +394,7 @@ Peek::visit_children(vespalib::ObjectVisitor &visitor) const if (label.is_mapped()) { ::visit(visitor, dim.first, label.name); } else { - ::visit(visitor, dim.first, label.index); + ::visit(visitor, dim.first, static_cast<int64_t>(label.index)); } }, [&](const Child &child) { diff --git a/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp b/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp index 3b61aaaac3e..a8aab279a98 100644 --- a/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp +++ b/searchlib/src/tests/queryeval/sparse_vector_benchmark/sparse_vector_benchmark_test.cpp @@ -325,7 +325,7 @@ struct Result { } } std::string toString() const { - return vespalib::make_string("%u hits, %ld ms", num_hits, vespalib::count_ms(time)); + return vespalib::make_string("%u hits, %" PRId64 " ms", num_hits, vespalib::count_ms(time)); } }; diff --git a/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp b/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp index 576c9abe249..95e4cc8ea79 100644 --- a/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp +++ b/searchlib/src/tests/queryeval/weak_and/wand_bench_setup.hpp @@ -212,7 +212,7 @@ struct Setup { stats.print(); } } - fprintf(stderr, "time (ms): %ld\n", vespalib::count_ms(minTime)); + fprintf(stderr, "time (ms): %" PRId64 "\n", vespalib::count_ms(minTime)); } }; diff --git a/searchlib/src/tests/sortspec/multilevelsort.cpp b/searchlib/src/tests/sortspec/multilevelsort.cpp index 8c4b931a265..2c0b82555b7 100644 --- a/searchlib/src/tests/sortspec/multilevelsort.cpp +++ b/searchlib/src/tests/sortspec/multilevelsort.cpp @@ -265,7 +265,7 @@ MultilevelSortTest::sortAndCheck(const std::vector<Spec> &spec, uint32_t num, vespalib::Timer timer; sorter.sortResults(hits, num, num); - LOG(info, "sort time = %ld ms", vespalib::count_ms(timer.elapsed())); + LOG(info, "sort time = %" PRId64 " ms", vespalib::count_ms(timer.elapsed())); uint32_t *offsets = new uint32_t[num + 1]; char *buf = new char[sorter.getSortDataSize(0, num)]; diff --git a/staging_vespalib/src/tests/clock/clock_benchmark.cpp b/staging_vespalib/src/tests/clock/clock_benchmark.cpp index cbf7275f06e..6728d4cc045 100644 --- a/staging_vespalib/src/tests/clock/clock_benchmark.cpp +++ b/staging_vespalib/src/tests/clock/clock_benchmark.cpp @@ -5,6 +5,7 @@ #include <cassert> #include <vector> #include <atomic> +#include <cinttypes> #include <cstring> #include <condition_variable> #include <mutex> @@ -123,7 +124,7 @@ void benchmark(const char * desc, FastOS_ThreadPool & pool, uint64_t samples, ui count[i] += sampler->_count[i]; } } - printf("%s: Took %ld clock samples in %2.3f with [%ld, %ld, %ld] counts\n", desc, samples, to_s(steady_clock::now() - start), count[0], count[1], count[2]); + printf("%s: Took %" PRId64 " clock samples in %2.3f with [%" PRId64 ", %" PRId64 ", %" PRId64 "] counts\n", desc, samples, to_s(steady_clock::now() - start), count[0], count[1], count[2]); } int diff --git a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp index 471f8b7bb95..70dd215cc1d 100644 --- a/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp +++ b/storage/src/vespa/storage/distributor/operations/external/visitoroperation.cpp @@ -124,7 +124,7 @@ VisitorOperation::timeLeft() const noexcept LOG(spam, - "Checking if visitor has timed out: elapsed=%ld ms, timeout=%ld ms", + "Checking if visitor has timed out: elapsed=%" PRId64 " ms, timeout=%" PRId64 " ms", vespalib::count_ms(elapsed), vespalib::count_ms(_msg->getTimeout())); @@ -624,7 +624,7 @@ VisitorOperation::startNewVisitors(DistributorMessageSender& sender) markOperationAsFailed( api::ReturnCode(api::ReturnCode::ABORTED, vespalib::make_string( - "Timeout of %ld ms is running out", + "Timeout of %" PRId64 " ms is running out", vespalib::count_ms(_msg->getTimeout())))); } diff --git a/storage/src/vespa/storage/storageserver/statemanager.cpp b/storage/src/vespa/storage/storageserver/statemanager.cpp index 9afc8b2d3a5..069ba1b8b92 100644 --- a/storage/src/vespa/storage/storageserver/statemanager.cpp +++ b/storage/src/vespa/storage/storageserver/statemanager.cpp @@ -462,8 +462,8 @@ StateManager::onGetNodeState(const api::GetNodeStateCommand::SP& cmd) { int64_t msTimeout = vespalib::count_ms(cmd->getTimeout()); LOG(debug, "Received get node state request with timeout of " - "%ld milliseconds. Scheduling to be answered in " - "%ld milliseconds unless a node state change " + "%" PRId64 " milliseconds. Scheduling to be answered in " + "%" PRId64 " milliseconds unless a node state change " "happens before that time.", msTimeout, msTimeout * 800 / 1000); TimeStatePair pair( diff --git a/vespalib/src/tests/time/time_test.cpp b/vespalib/src/tests/time/time_test.cpp index ed291adea58..95341219258 100644 --- a/vespalib/src/tests/time/time_test.cpp +++ b/vespalib/src/tests/time/time_test.cpp @@ -2,6 +2,7 @@ #include <vespa/vespalib/util/time.h> #include <vespa/vespalib/gtest/gtest.h> +#include <cinttypes> #include <thread> using namespace vespalib; @@ -21,7 +22,7 @@ TEST(TimeTest, timer_can_measure_elapsed_time) { std::this_thread::sleep_for(10ms); auto elapsed = timer.elapsed(); EXPECT_GE(elapsed, 10ms); - fprintf(stderr, "sleep(10ms) took %ld us\n", count_us(elapsed)); + fprintf(stderr, "sleep(10ms) took %" PRId64 " us\n", count_us(elapsed)); } TEST(TimeTest, double_conversion_works_as_expected) { |