Skip to content

Commit

Permalink
remove stringFormat from Error()
Browse files Browse the repository at this point in the history
No need.

Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Oct 19, 2023
1 parent 2865a31 commit b1225ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/basicio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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"];
}
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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_);
}
}

Expand Down Expand Up @@ -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_);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/rafimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion src/webpimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1225ca

Please sign in to comment.