diff --git a/src/basicio.cpp b/src/basicio.cpp index cd28806513..15d0bf7534 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -1420,7 +1420,7 @@ int64_t HttpIo::HttpImpl::getFileLength() { request["verb"] = "HEAD"; int serverCode = http(request, response, errors); if (serverCode < 0 || serverCode >= 400 || !errors.empty()) { - throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), hostInfo_.Path); + throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, hostInfo_.Path); } auto lengthIter = response.find("Content-Length"); @@ -1444,7 +1444,7 @@ void HttpIo::HttpImpl::getDataByRange(size_t lowBlock, size_t highBlock, std::st int serverCode = http(request, responseDic, errors); if (serverCode < 0 || serverCode >= 400 || !errors.empty()) { - throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), hostInfo_.Path); + throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, hostInfo_.Path); } response = responseDic["body"]; } @@ -1497,7 +1497,7 @@ void HttpIo::HttpImpl::writeRemote(const byte* data, size_t size, size_t from, s int serverCode = http(request, response, errors); if (serverCode < 0 || serverCode >= 400 || !errors.empty()) { - throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), hostInfo_.Path); + throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, hostInfo_.Path); } } @@ -1594,7 +1594,7 @@ int64_t CurlIo::CurlImpl::getFileLength() { int serverCode; curl_easy_getinfo(curl_, CURLINFO_RESPONSE_CODE, &serverCode); // get code if (serverCode >= 400 || serverCode < 0) { - throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), path_); + throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, path_); } // get length curl_off_t temp; @@ -1628,7 +1628,7 @@ void CurlIo::CurlImpl::getDataByRange(size_t lowBlock, size_t highBlock, std::st int serverCode; curl_easy_getinfo(curl_, CURLINFO_RESPONSE_CODE, &serverCode); // get code if (serverCode >= 400 || serverCode < 0) { - throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), path_); + throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, path_); } } @@ -1676,7 +1676,7 @@ void CurlIo::CurlImpl::writeRemote(const byte* data, size_t size, size_t from, s int serverCode; curl_easy_getinfo(curl_, CURLINFO_RESPONSE_CODE, &serverCode); if (serverCode >= 400 || serverCode < 0) { - throw Error(ErrorCode::kerFileOpenFailed, "http", Exiv2::Internal::stringFormat("%d", serverCode), path_); + throw Error(ErrorCode::kerFileOpenFailed, "http", serverCode, path_); } } diff --git a/src/rafimage.cpp b/src/rafimage.cpp index 72cc2845aa..495e96920b 100644 --- a/src/rafimage.cpp +++ b/src/rafimage.cpp @@ -71,11 +71,11 @@ void RafImage::printStructure(std::ostream& out, PrintStructureOption option, si if (bPrint) { io_->seek(0, BasicIo::beg); // rewind size_t address = io_->tell(); - const auto format = " %8zu | %8ld | "; + constexpr auto format = " %8zu | %8ld | "; { out << Internal::indent(depth) << "STRUCTURE OF RAF FILE: " << io().path() << std::endl; - out << Internal::indent(depth) << Internal::stringFormat(" Address | Length | Payload") << std::endl; + out << Internal::indent(depth) << " Address | Length | Payload" << std::endl; } byte magicdata[17]; diff --git a/src/webpimage.cpp b/src/webpimage.cpp index 1265731431..f8d0f463ee 100644 --- a/src/webpimage.cpp +++ b/src/webpimage.cpp @@ -419,7 +419,7 @@ void WebPImage::printStructure(std::ostream& out, PrintStructureOption option, s if (bPrint) { out << Internal::indent(depth) << "STRUCTURE OF WEBP FILE: " << io().path() << std::endl; - out << Internal::indent(depth) << Internal::stringFormat(" Chunk | Length | Offset | Payload") << std::endl; + out << Internal::indent(depth) << " Chunk | Length | Offset | Payload" << std::endl; } io_->seek(0, BasicIo::beg); // rewind