diff --git a/src/EbookDoc.cpp b/src/EbookDoc.cpp index f28d9f1db6a..e3d78bae9ce 100644 --- a/src/EbookDoc.cpp +++ b/src/EbookDoc.cpp @@ -127,8 +127,8 @@ char* NormalizeURL(const char* url, const char* base) { } else { baseEnd = base; } - AutoFreeStr basePath = str::Dup(base, baseEnd - base); - AutoFreeStr norm = str::Join(basePath, url); + TempStr basePath = str::DupTemp(base, baseEnd - base); + char* norm = str::Join(basePath, url); char* dst = norm; for (char* src = norm; *src; src++) { @@ -146,7 +146,7 @@ char* NormalizeURL(const char* url, const char* base) { } } *dst = '\0'; - return norm.Release(); + return norm; } inline char decode64(char c) { diff --git a/src/EngineMupdf.cpp b/src/EngineMupdf.cpp index 6604dd51ca3..559a6727de8 100644 --- a/src/EngineMupdf.cpp +++ b/src/EngineMupdf.cpp @@ -1844,7 +1844,7 @@ bool EngineMupdf::Load(const char* path, PasswordUI* pwdUI) { fz_stream* file = fz_open_buffer(ctx, buf); fz_drop_buffer(ctx, buf); str::Free(d); - char* nameHint = str::Join(path, ".html"); + TempStr nameHint = str::JoinTemp(path, ".html"); if (!LoadFromStream(file, nameHint, pwdUI)) { return false; } diff --git a/src/PdfSync.cpp b/src/PdfSync.cpp index fd5a7b5e95f..915249335b5 100644 --- a/src/PdfSync.cpp +++ b/src/PdfSync.cpp @@ -111,13 +111,13 @@ bool Synchronizer::NeedsToRebuildIndex() const { int Synchronizer::MarkIndexWasRebuilt() { needsToRebuildIndex = false; - WCHAR* path = ToWStrTemp(syncFilePath); + TempWStr path = ToWStrTemp(syncFilePath); _wstat(path, &syncfileTimestamp); return PDFSYNCERR_SUCCESS; } char* Synchronizer::PrependDir(const char* filename) const { - char* dir = path::GetDirTemp(syncFilePath); + TempStr dir = path::GetDirTemp(syncFilePath); return path::Join(dir, filename); } diff --git a/src/Translations.cpp b/src/Translations.cpp index a4fa95bdd33..b19233e44ed 100644 --- a/src/Translations.cpp +++ b/src/Translations.cpp @@ -88,7 +88,7 @@ static void ParseTranslationsTxt(const ByteSlice& d, const char* langCode) { // parse into lines char* s = (char*)d.data(); - StrVec lines; + StrVec2 lines; Split(lines, s, "\n", true); int nStrings = 0; for (char* l : lines) { diff --git a/src/scratch.txt b/src/scratch.txt index 71983b0fc7a..45b869f4199 100644 --- a/src/scratch.txt +++ b/src/scratch.txt @@ -1,7 +1,6 @@ Ideas for refactorings: - change all size_t => int -- remove all use of _TR( : 26 matches (was 48, 61, 74, 94, 141) - change use of Str::Get() => Str::CStr() (or maybe make it Str() as in StrSpan?) - audit all str::Join() and path::Join() to see if could / should be *Temp()