Commit 4d58ff81 authored by Albert Astals Cid's avatar Albert Astals Cid

Change a few variables to types GooString::format knows about

None of them is problematic, but being more strict let's use enable the
goostring-format-checker clang plugin
parent 6b4f07ad
......@@ -6,7 +6,7 @@
//
// Copyright 2009 Stefan Thomas <thomas@eload24.com>
// Copyright 2010, 2011 Hib Eris <hib@hiberis.nl>
// Copyright 2010, 2019 Albert Astals Cid <aacid@kde.org>
// Copyright 2010, 2019, 2021 Albert Astals Cid <aacid@kde.org>
//
//========================================================================
......@@ -72,12 +72,12 @@ static size_t load_cb(const char *ptr, size_t size, size_t nmemb, void *data)
int CurlCachedFileLoader::load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer)
{
CURLcode r = CURLE_OK;
size_t fromByte, toByte;
unsigned long long fromByte, toByte;
for (const ByteRange &bRange : ranges) {
fromByte = bRange.offset;
toByte = fromByte + bRange.length - 1;
GooString *range = GooString::format("{0:ud}-{1:ud}", fromByte, toByte);
GooString *range = GooString::format("{0:ulld}-{1:ulld}", fromByte, toByte);
curl_easy_setopt(curl, CURLOPT_URL, url->c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, load_cb);
......
......@@ -8,6 +8,7 @@
// Copyright (C) 2015 André Esser <bepandre@hotmail.com>
// Copyright (C) 2016, 2018 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by Technische Universität Dresden
// Copyright (C) 2021 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
......@@ -86,7 +87,7 @@ GooString *timeToDateString(const time_t *timeA)
// calculate time zone offset by comparing local and gmtime time_t value for same
// time.
const time_t timeg = timegm(&localtime_tm);
const time_t offset = difftime(timeg, timet); // find time zone offset in seconds
const int offset = difftime(timeg, timet); // find time zone offset in seconds
if (offset > 0) {
dateString->appendf("+{0:02d}'{1:02d}'", offset / 3600, (offset % 3600) / 60);
} else if (offset < 0) {
......
......@@ -15,7 +15,7 @@
//
// Copyright (C) 2005 Martin Kretzschmar <martink@gnome.org>
// Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2006-2009, 2011-2013, 2015-2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006-2009, 2011-2013, 2015-2021 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2006 Jeff Muizelaar <jeff@infidigm.net>
// Copyright (C) 2007, 2008 Brad Hards <bradh@kde.org>
// Copyright (C) 2008, 2009 Koji Otani <sho@bbr.jp>
......@@ -6601,7 +6601,8 @@ void PSOutputDev::dumpColorSpaceL2(GfxState *state, GfxColorSpace *colorSpace, b
if (validref) {
name = GooString::format("ICCBased-{0:d}-{1:d}-{2:d}", ref.num, ref.gen, intent);
} else {
name = GooString::format("ICCBased-hashed-{0:ullX}-{1:d}", std::hash<GfxLCMSProfilePtr> {}(iccBasedCS->getProfile()), intent);
const unsigned long long hash = std::hash<GfxLCMSProfilePtr> {}(iccBasedCS->getProfile());
name = GooString::format("ICCBased-hashed-{0:ullX}-{1:d}", hash, intent);
}
const auto &it = iccEmitted.find(name->toStr());
if (it != iccEmitted.end()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment