diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2019-03-12 19:00:46 +0100 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2019-03-12 19:01:05 +0100 |
commit | 54f83cf7ca44e00f94e42e1c774c3ac4cc7d2a0a (patch) | |
tree | b275610fef77e3f4daec6807cc0de6b5676ca5ac | |
parent | 0883ca7c8081ea10add6dd332ddfe5c7e0ffdd2e (diff) |
Fix format strings in config module.
5 files changed, 11 insertions, 11 deletions
diff --git a/config/src/tests/functiontest/functiontest.cpp b/config/src/tests/functiontest/functiontest.cpp index 257e131534b..7fe87775f74 100644 --- a/config/src/tests/functiontest/functiontest.cpp +++ b/config/src/tests/functiontest/functiontest.cpp @@ -37,8 +37,8 @@ checkVariableAccess(const FunctionTestConfig & config) EXPECT_EQUAL(1u, config.boolarr.size()); EXPECT_EQUAL(0u, config.intarr.size()); EXPECT_EQUAL(2u, config.longarr.size()); - LOG(error, "0: %ld", config.longarr[0]); - LOG(error, "1: %ld", config.longarr[1]); + LOG(error, "0: %" PRId64, config.longarr[0]); + LOG(error, "1: %" PRId64, config.longarr[1]); EXPECT_EQUAL(std::numeric_limits<int64_t>::max(), config.longarr[0]); EXPECT_EQUAL(std::numeric_limits<int64_t>::min(), config.longarr[1]); EXPECT_EQUAL(2u, config.doublearr.size()); diff --git a/config/src/vespa/config/frt/frtconfigagent.cpp b/config/src/vespa/config/frt/frtconfigagent.cpp index c1516a7de11..59281db5833 100644 --- a/config/src/vespa/config/frt/frtconfigagent.cpp +++ b/config/src/vespa/config/frt/frtconfigagent.cpp @@ -27,7 +27,7 @@ FRTConfigAgent::handleResponse(const ConfigRequest & request, ConfigResponse::UP { if (LOG_WOULD_LOG(spam)) { const ConfigKey & key(request.getKey()); - LOG(spam, "current state for %s: generation %ld md5 %s", key.toString().c_str(), _configState.generation, _configState.md5.c_str()); + LOG(spam, "current state for %s: generation %" PRId64 " md5 %s", key.toString().c_str(), _configState.generation, _configState.md5.c_str()); } if (response->validateResponse() && !response->isError()) { handleOKResponse(request, std::move(response)); @@ -57,7 +57,7 @@ void FRTConfigAgent::handleUpdatedGeneration(const ConfigKey & key, const ConfigState & newState, const ConfigValue & configValue) { if (LOG_WOULD_LOG(spam)) { - LOG(spam, "new generation %ld md5:%s for key %s", newState.generation, newState.md5.c_str(), key.toString().c_str()); + LOG(spam, "new generation %" PRId64 " md5:%s for key %s", newState.generation, newState.md5.c_str(), key.toString().c_str()); LOG(spam, "Old config: md5:%s \n%s", _latest.getMd5().c_str(), _latest.asJson().c_str()); LOG(spam, "New config: md5:%s \n%s", configValue.getMd5().c_str(), configValue.asJson().c_str()); } @@ -83,7 +83,7 @@ FRTConfigAgent::handleErrorResponse(const ConfigRequest & request, ConfigRespons setWaitTime(_numConfigured > 0 ? _timingValues.configuredErrorDelay : _timingValues.unconfiguredDelay, multiplier); _nextTimeout = _timingValues.errorTimeout; const ConfigKey & key(request.getKey()); - LOG(info, "Error response or no response from config server (key: %s) (errcode=%d, validresponse:%d), trying again in %ld milliseconds", key.toString().c_str(), response->errorCode(), response->hasValidResponse() ? 1 : 0, _waitTime); + LOG(info, "Error response or no response from config server (key: %s) (errcode=%d, validresponse:%d), trying again in %" PRIu64 " milliseconds", key.toString().c_str(), response->errorCode(), response->hasValidResponse() ? 1 : 0, _waitTime); } void @@ -91,7 +91,7 @@ FRTConfigAgent::setWaitTime(uint64_t delay, int multiplier) { uint64_t prevWait = _waitTime; _waitTime = _timingValues.fixedDelay + (multiplier * delay); - LOG(spam, "Adjusting waittime from %ld to %ld", prevWait, _waitTime); + LOG(spam, "Adjusting waittime from %" PRIu64 " to %" PRIu64, prevWait, _waitTime); } uint64_t FRTConfigAgent::getTimeout() const { return _nextTimeout; } diff --git a/config/src/vespa/config/print/fileconfigformatter.cpp b/config/src/vespa/config/print/fileconfigformatter.cpp index e4071474760..85e938dee8f 100644 --- a/config/src/vespa/config/print/fileconfigformatter.cpp +++ b/config/src/vespa/config/print/fileconfigformatter.cpp @@ -49,7 +49,7 @@ struct ConfigEncoder : public ArrayTraverser, } } void encodeLONG(int64_t value) { - out.printf("%ld", value); + out.printf("%" PRId64, value); } void encodeDOUBLE(double value) { out.printf("%g", value); diff --git a/config/src/vespa/config/set/configsetsource.cpp b/config/src/vespa/config/set/configsetsource.cpp index 99d8451556a..e6ab890a9df 100644 --- a/config/src/vespa/config/set/configsetsource.cpp +++ b/config/src/vespa/config/set/configsetsource.cpp @@ -47,7 +47,7 @@ ConfigSetSource::getConfig() void ConfigSetSource::reload(int64_t generation) { - LOG(debug, "Running update with generation(%zd)", generation); + LOG(debug, "Running update with generation(%" PRId64 ")", generation); _generation = generation; } diff --git a/config/src/vespa/config/subscription/configsubscriptionset.cpp b/config/src/vespa/config/subscription/configsubscriptionset.cpp index 9b3ef32a128..f00b7048416 100644 --- a/config/src/vespa/config/subscription/configsubscriptionset.cpp +++ b/config/src/vespa/config/subscription/configsubscriptionset.cpp @@ -63,7 +63,7 @@ ConfigSubscriptionSet::acquireSnapshot(uint64_t timeoutInMillis, bool ignoreChan } else { LOG(spam, "Config subscription did not change, id(%s), defname(%s)", key.getConfigId().c_str(), key.getDefName().c_str()); } - LOG(spam, "Previous generation is %ld, updates is %ld", generation, subscription->getGeneration()); + LOG(spam, "Previous generation is %" PRId64 ", updates is %" PRId64, generation, subscription->getGeneration()); if (isGenerationNewer(subscription->getGeneration(), _currentGeneration)) { numGenerationChanged++; } @@ -88,12 +88,12 @@ ConfigSubscriptionSet::acquireSnapshot(uint64_t timeoutInMillis, bool ignoreChan bool updated = inSync && isGenerationNewer(lastGeneration, _currentGeneration); if (updated) { - LOG(spam, "Config was updated from %ld to %ld", _currentGeneration, lastGeneration); + LOG(spam, "Config was updated from %" PRId64 " to %" PRId64, _currentGeneration, lastGeneration); _currentGeneration = lastGeneration; _state = CONFIGURED; for (const auto & subscription : _subscriptionList) { const ConfigKey & key(subscription->getKey()); - LOG(debug, "Updated config id(%s), defname(%s), has changed: %s, lastGenerationChanged: %ld", + LOG(debug, "Updated config id(%s), defname(%s), has changed: %s, lastGenerationChanged: %" PRId64, key.getConfigId().c_str(), key.getDefName().c_str(), (subscription->hasChanged() ? "true" : "false"), |