diff --git a/uppsrc/CodeEditor/CSyntax.cpp b/uppsrc/CodeEditor/CSyntax.cpp index decca4948..12526f906 100644 --- a/uppsrc/CodeEditor/CSyntax.cpp +++ b/uppsrc/CodeEditor/CSyntax.cpp @@ -79,7 +79,7 @@ static WString sReadLn(const wchar *p) else wbuf.Cat(*p++); } - return wbuf; + return WString(wbuf); } int LastC(const wchar *b, const wchar *e) diff --git a/uppsrc/Core/CharSet.cpp b/uppsrc/Core/CharSet.cpp index a52b2a206..a6839e385 100644 --- a/uppsrc/Core/CharSet.cpp +++ b/uppsrc/Core/CharSet.cpp @@ -2053,7 +2053,7 @@ WString ToUnicode(const char *src, int l, byte charset) return FromUtf8(src, l); WStringBuffer result(l); ToUnicode(result, src, l, charset); - return result; + return WString(result); } WString ToUnicode(const String& src, byte charset) @@ -2068,7 +2068,7 @@ String FromUnicodeBuffer(const wchar *src, int len, byte charset, int defchar) return ToUtf8(src, len); StringBuffer result(len); FromUnicode(result, src, len, charset, defchar); - return result; + return String(result); } String FromUnicodeBuffer(const wchar *src) @@ -2094,7 +2094,7 @@ String ToCharset(byte charset, const String& src, byte scharset, int def) return ToUtf8(ToUnicode(src, scharset)); StringBuffer result(slen); ConvertCharset(result, charset, src, scharset, slen); - return result; + return String(result); } WString InitCaps(const wchar *s) @@ -2125,7 +2125,7 @@ WString InitCaps(const WString& s) r[i] = ToLower(c); spc = !IsLeNum(c); } - return r; + return WString(r); } WString ToUpper(const WString& w) @@ -2133,7 +2133,7 @@ WString ToUpper(const WString& w) int l = w.GetLength(); WStringBuffer r(l); ToUpper(r, w, l); - return r; + return WString(r); } WString ToLower(const WString& w) @@ -2141,7 +2141,7 @@ WString ToLower(const WString& w) int l = w.GetLength(); WStringBuffer r(l); ToLower(r, w, l); - return r; + return WString(r); } WString ToAscii(const WString& w) @@ -2149,7 +2149,7 @@ WString ToAscii(const WString& w) int l = w.GetLength(); WStringBuffer r(l); ToAscii(r, w, l); - return r; + return WString(r); } String InitCaps(const char *s, byte charset) @@ -2165,7 +2165,7 @@ String ToUpper(const char *s, byte charset) int l = (int)strlen(s); StringBuffer r(l); ToUpper(r, s, l, charset); - return r; + return String(r); } String ToLower(const char *s, byte charset) @@ -2176,7 +2176,7 @@ String ToLower(const char *s, byte charset) int l = (int)strlen(s); StringBuffer r(l); ToLower(r, s, l, charset); - return r; + return String(r); } String ToAscii(const char *s, byte charset) @@ -2187,7 +2187,7 @@ String ToAscii(const char *s, byte charset) int l = (int)strlen(s); StringBuffer r(l); ToAscii(r, s, l, charset); - return r; + return String(r); } String ToUpper(const String& s, byte charset) @@ -2198,7 +2198,7 @@ String ToUpper(const String& s, byte charset) int l = s.GetLength(); StringBuffer r(l); ToUpper(r, s, l, charset); - return r; + return String(r); } String ToLower(const String& s, byte charset) @@ -2209,7 +2209,7 @@ String ToLower(const String& s, byte charset) int l = s.GetLength(); StringBuffer r(l); ToLower(r, s, l, charset); - return r; + return String(r); } String ToAscii(const String& s, byte charset) @@ -2220,7 +2220,7 @@ String ToAscii(const String& s, byte charset) int l = s.GetLength(); StringBuffer r(l); ToAscii(r, s, l, charset); - return r; + return String(r); } String ToUpperAscii(const String& s, byte charset) @@ -2231,7 +2231,7 @@ String ToUpperAscii(const String& s, byte charset) int l = s.GetLength(); StringBuffer r(l); ToAscii(r, s, l, charset); - return r; + return String(r); } String ToLowerAscii(const String& s, byte charset) @@ -2242,7 +2242,7 @@ String ToLowerAscii(const String& s, byte charset) int l = s.GetLength(); StringBuffer r(l); ToAscii(r, s, l, charset); - return r; + return String(r); } bool IsDoubleWidth(int c) diff --git a/uppsrc/Core/Format.cpp b/uppsrc/Core/Format.cpp index a3c05640d..6ab51bd1c 100644 --- a/uppsrc/Core/Format.cpp +++ b/uppsrc/Core/Format.cpp @@ -64,7 +64,7 @@ String FormatIntBase(int i, int base, int width, char lpad, int sign, bool upper if(dwd < width) memset(o, lpad, pad); memcpy8(o + pad, p, dwd); - return out; + return String(out); } String FormatInt(int i) @@ -382,7 +382,7 @@ String FormatDoubleExp(double d, int digits, int flags, int fill_exp) } out.Cat(flags & FD_CAP_E ? 'E' : 'e'); out.Cat(FormatIntDec(exp, fill_exp, '0', flags & FD_SIGN_EXP)); - return out; + return String(out); } String FormatDate(Date date, const char *format, int language) @@ -577,7 +577,7 @@ String IntFormatter(const Formatting& f) StringBuffer q; q.SetLength(1000); q.SetLength(sprintf(q, '%' + f.format + f.id, (int)f.arg)); - return q; + return String(q); } String Int64Formatter(const Formatting& f) @@ -585,7 +585,7 @@ String Int64Formatter(const Formatting& f) StringBuffer q; q.SetLength(1000); q.SetLength(sprintf(q, '%' + f.format + f.id, (int64)f.arg)); - return q; + return String(q); } String IntLowerAlphaFormatter(const Formatting& f) @@ -1148,7 +1148,7 @@ String DeFormat(const char *text) x.Cat('%'); x.Cat(*text++); } - return x; + return String(x); } } diff --git a/uppsrc/Core/Huge.cpp b/uppsrc/Core/Huge.cpp index f69f26a16..7805c6079 100644 --- a/uppsrc/Core/Huge.cpp +++ b/uppsrc/Core/Huge.cpp @@ -41,7 +41,7 @@ String Huge::Get() const Panic("String is too big!"); StringBuffer sb((int)size); Get(~sb, 0, size); - return sb; + return String(sb); } } \ No newline at end of file diff --git a/uppsrc/Core/InetUtil.cpp b/uppsrc/Core/InetUtil.cpp index 326a684e3..a1553c010 100644 --- a/uppsrc/Core/InetUtil.cpp +++ b/uppsrc/Core/InetUtil.cpp @@ -124,7 +124,7 @@ String UrlEncode(const char *p, const char *e) else out << '%' << hex_digits[(*p >> 4) & 15] << hex_digits[*p & 15]; } - return out; + return String(out); } String UrlEncode(const char *s, int len) @@ -156,7 +156,7 @@ String UrlDecode(const char *b, const char *e) } else out.Cat(*p); - return out; + return String(out); } String UrlDecode(const char *s, int len) @@ -179,7 +179,7 @@ String QPEncode(const char* s) r.Cat(s[0]); len++; } - else + else if(s[0] == '\r') ; else @@ -209,7 +209,7 @@ String QPEncode(const char* s) } s++; } - return r; + return String(r); } String QPDecode(const char *s, bool underscore_to_space) @@ -232,7 +232,7 @@ String QPDecode(const char *s, bool underscore_to_space) else r.Cat(c); } - return r; + return String(r); } String Base64Encode(const char *_b, const char *_e) @@ -272,7 +272,7 @@ String Base64Encode(const char *_b, const char *_e) p[2] = encoder[(b[1] << 2) & 0x3C]; p[3] = '='; } - return s; + return String(s); } String Base64Encode(const char *b, int len) @@ -330,7 +330,7 @@ String Base64Decode(const char *b, const char *e) out.Cat((c[2] << 6) | (c[3] >> 0)); } } - return out; + return String(out); } String Base64Decode(const char *s, int len) diff --git a/uppsrc/Core/Socket.cpp b/uppsrc/Core/Socket.cpp index c93b6d307..408b571d5 100644 --- a/uppsrc/Core/Socket.cpp +++ b/uppsrc/Core/Socket.cpp @@ -834,7 +834,7 @@ String TcpSocket::Get(int count) if(!done && IsEof()) return String::GetVoid(); out.SetLength(done); - return out; + return String(out); } bool TcpSocket::GetAll(void *buffer, int len) diff --git a/uppsrc/Core/SplitMerge.cpp b/uppsrc/Core/SplitMerge.cpp index 48618ca7d..7f201381f 100644 --- a/uppsrc/Core/SplitMerge.cpp +++ b/uppsrc/Core/SplitMerge.cpp @@ -173,7 +173,7 @@ T Join_(const Vector& im, const T& delim, bool ignoreempty) { r.Cat(im[i]); next = true; } - return r; + return T(r); } String Join(const Vector& im, const String& delim, bool ignoreempty) { diff --git a/uppsrc/Core/Stream.cpp b/uppsrc/Core/Stream.cpp index e67a0316a..92e9df196 100644 --- a/uppsrc/Core/Stream.cpp +++ b/uppsrc/Core/Stream.cpp @@ -176,7 +176,7 @@ String Stream::Get(int size) StringBuffer b(size); int n = Get(~b, size); b.SetCount(n); - return b; + return String(b); } String Stream::GetAll(int size) @@ -1218,7 +1218,7 @@ String LoadStream(Stream& in) { StringBuffer s((int)size); in.Get(s, (int)size); if(!in.IsError()) - return s; + return String(s); } } return String::GetVoid(); diff --git a/uppsrc/Core/Utf.cpp b/uppsrc/Core/Utf.cpp index 47360b734..3acf1bd32 100644 --- a/uppsrc/Core/Utf.cpp +++ b/uppsrc/Core/Utf.cpp @@ -53,7 +53,7 @@ String ToUtf8(const wchar *s, int len) StringBuffer r; r.Reserve(len); FromUtf16_([&](const wchar *, dword code) { ToUtf8_([&](char c) { r.Cat(c); }, code); }, s, len); - return r; + return String(r); } int Utf16Len(const dword *s, int len) @@ -76,7 +76,7 @@ WString ToUtf16(const dword *s, int len) r.Reserve(len); for(const dword *lim = s + len; s < lim; s++) ToUtf16_([&](wchar c) { r.Cat(c); }, *s); - return r; + return WString(r); } int Utf16Len(const char *s, int len) @@ -95,7 +95,7 @@ WString ToUtf16(const char *s, int len) { WStringBuffer r; FromUtf8_([&](const byte *, dword code) { ToUtf16_([&](wchar c) { r.Cat(c); }, code); }, s, len); - return r; + return WString(r); } int Utf32Len(const char *s, int len) @@ -146,7 +146,7 @@ String Utf8ToAscii(const String& src) while(s < lim) *t++ = (byte)*s < 128 ? *s++ : ToAscii(FetchUtf8(s, lim)); r.SetLength(int(t - ~r)); - return r; + return String(r); } String Utf8ToUpperAscii(const String& src) @@ -160,7 +160,7 @@ String Utf8ToUpperAscii(const String& src) *t++ = (byte)*s <= 'Z' ? *s++ : ToUpperAscii(FetchUtf8(s, lim)); } r.SetLength(int(t - ~r)); - return r; + return String(r); } String Utf8ToLowerAscii(const String& src) @@ -173,7 +173,7 @@ String Utf8ToLowerAscii(const String& src) while(s < lim) *t++ = ToLowerAscii(FetchUtf8(s, lim)); r.SetLength(int(t - ~r)); - return r; + return String(r); } }; diff --git a/uppsrc/Core/Util.cpp b/uppsrc/Core/Util.cpp index f912e622a..f311e3cae 100644 --- a/uppsrc/Core/Util.cpp +++ b/uppsrc/Core/Util.cpp @@ -392,13 +392,13 @@ String HexString(const byte *s, int count, int sep, int sepchr) for(;;) { for(int q = 0; q < sep; q++) { if(i >= count) - return b; + return String(b); *t++ = itoc[(s[i] & 0xf0) >> 4]; *t++ = itoc[s[i] & 0x0f]; i++; } if(i >= count) - return b; + return String(b); *t++ = sepchr; } } @@ -467,7 +467,7 @@ String NormalizeSpaces(const char *s) else r.Cat(*s++); } - return r; + return String(r); } String NormalizeSpaces(const char *s, const char *end) @@ -485,7 +485,7 @@ String NormalizeSpaces(const char *s, const char *end) else r.Cat(*s++); } - return r; + return String(r); } String CsvString(const String& text) @@ -569,7 +569,7 @@ String CompressLog(const char *s) else result.Cat(b, s); } - return result; + return String(result); } int ChNoInvalid(int c) @@ -599,7 +599,7 @@ String ToSystemCharset(const String& src, int cp) if(q <= 0) return src; b.SetCount(q); - return b; + return String(b); } String ToSystemCharset(const String& src) diff --git a/uppsrc/Core/Vcont.cpp b/uppsrc/Core/Vcont.cpp index 1b5070341..5385bd1e2 100644 --- a/uppsrc/Core/Vcont.cpp +++ b/uppsrc/Core/Vcont.cpp @@ -107,7 +107,7 @@ String Bits::ToString() const StringBuffer ss; for(int i = GetLast(); i >= 0; i--) ss << FormatIntHex(bp[i]); - return ss; + return String(ss); } void Bits::Serialize(Stream& s) diff --git a/uppsrc/Core/Win32Util.cpp b/uppsrc/Core/Win32Util.cpp index 97663273b..b2aeebc62 100644 --- a/uppsrc/Core/Win32Util.cpp +++ b/uppsrc/Core/Win32Util.cpp @@ -61,7 +61,7 @@ String AsString(const wchar_t *buffer, int count) { // Convert with code page... StringBuffer temp(count); for(char *p = temp, *e = p + count; p < e;) *p++ = (char)*buffer++; - return temp; + return String(temp); } String AsString(const wchar_t *buffer, const wchar_t *end) { @@ -90,7 +90,7 @@ String GetWinRegString(const char *value, const char *path, HKEY base_key, dword len--; raw_len.SetLength(len); RegCloseKey(key); - return raw_len; + return String(raw_len); } int GetWinRegInt(const char *value, const char *path, HKEY base_key, dword wow) { diff --git a/uppsrc/Core/XML.cpp b/uppsrc/Core/XML.cpp index ebec13fd4..f90bf8d73 100644 --- a/uppsrc/Core/XML.cpp +++ b/uppsrc/Core/XML.cpp @@ -24,7 +24,7 @@ String DeXml(const char *s, byte charset, bool escapelf) StringBuffer result; for(; *s; s++) sDeXmlChar(result, *s, charset, escapelf); - return result; + return String(result); } String DeXml(const char *s, const char *end, byte charset, bool escapelf) @@ -34,7 +34,7 @@ String DeXml(const char *s, const char *end, byte charset, bool escapelf) StringBuffer result; for(; s < end; s++) sDeXmlChar(result, *s, charset, escapelf); - return result; + return String(result); } String DeXml(const String& s, byte charset, bool escapelf) @@ -51,21 +51,21 @@ String XmlHeader(const char *encoding, const char *version, const char *standalo if(standalone) r << " standalone=\"" << standalone << "\""; r << " ?>\r\n"; - return r; + return String(r); } String XmlPI(const char *text) { StringBuffer r; r << "\r\n"; - return r; + return String(r); } String XmlDecl(const char *text) { StringBuffer r; r << "\r\n"; - return r; + return String(r); } String XmlDocType(const char *text) @@ -82,7 +82,7 @@ String XmlComment(const char *text) { StringBuffer out; out << "\r\n"; - return out; + return String(out); } String XmlTag::operator()() @@ -120,7 +120,7 @@ String XmlTag::operator()(const char *text) else if(first) { r << text << end; - return r; + return String(r); } first = false; wasslash = false; @@ -142,7 +142,7 @@ String XmlTag::operator()(const char *text) if(!first) r << "\r\n"; r << end; - return r; + return String(r); } String XmlTag::Text(const char *text, byte charset) @@ -707,7 +707,7 @@ String XmlParser::ReadTextE() out.Cat(t); else if(IsEnd()) { PassEnd(); - return out; + return String(out); } else Skip(); diff --git a/uppsrc/Core/parser.cpp b/uppsrc/Core/parser.cpp index 3171aeb54..89fa1353d 100644 --- a/uppsrc/Core/parser.cpp +++ b/uppsrc/Core/parser.cpp @@ -196,7 +196,7 @@ String CParser::ReadIdt() { result.Cat(*term++); } DoSpaces(); - return result; + return String(result); } bool CParser::IsInt() const { @@ -381,7 +381,7 @@ String CParser::ReadOneString(int delim, bool chkend) { if(*term == delim) { term++; DoSpaces(); - return result; + return String(result); } else if(*term == '\\') { @@ -452,16 +452,16 @@ String CParser::ReadOneString(int delim, bool chkend) { if((byte)*term < ' ' && *term != '\t') { if(chkend) { ThrowError("Unterminated string"); - return result; + return String(result); } if(*term == '\0') - return result; + return String(result); } result.Cat(*term++); } } DoSpaces(); - return result; + return String(result); } String CParser::ReadOneString(bool chkend) @@ -700,7 +700,7 @@ String AsCString(const char *s, const char *lim, int linemax, const char *linepf s++; } t.Cat('\"'); - return t; + return String(t); } String AsCString(const char *s, int linemax, const char *linepfx, dword flags) diff --git a/uppsrc/Core/z.cpp b/uppsrc/Core/z.cpp index 73f058221..18cc13f98 100644 --- a/uppsrc/Core/z.cpp +++ b/uppsrc/Core/z.cpp @@ -490,7 +490,7 @@ String FastCompress(const void *s, int sz) int clen = LZ4_compress_default((const char *)s, ~b + sizeof(int), sz, (int)maxsize); b.SetCount(clen + sizeof(int)); b.Shrink(); - return b; + return String(b); } String FastCompress(const String& s) @@ -503,7 +503,7 @@ String FastDecompress(const String& data) int sz = *(int *)~data; StringBuffer b(sz); LZ4_decompress_safe(~data + sizeof(int), b, data.GetCount() - sizeof(int), sz); - return b; + return String(b); } // following function is used in both plugin/lz4 and plugin/zstd diff --git a/uppsrc/CppBase/Parser.cpp b/uppsrc/CppBase/Parser.cpp index 86f43b9b0..857eb11e7 100644 --- a/uppsrc/CppBase/Parser.cpp +++ b/uppsrc/CppBase/Parser.cpp @@ -483,7 +483,7 @@ String Parser::ReadOper(bool& castoper) { spc = true; p++; } - return r; + return String(r); } String Parser::Name(String& name, bool& castoper, bool& oper) diff --git a/uppsrc/CppBase/cpp.cpp b/uppsrc/CppBase/cpp.cpp index 32c95572e..3de54a7b9 100644 --- a/uppsrc/CppBase/cpp.cpp +++ b/uppsrc/CppBase/cpp.cpp @@ -100,7 +100,7 @@ String Cpp::Expand(const char *s) prefix_macro = bid; else prefix_macro = String(' ', 1) + bid; // do not want to emit grounding in body - return r; + return String(r); } else if(*s == '\"' || *s == '\'') @@ -147,7 +147,7 @@ String Cpp::Expand(const char *s) else r.Cat(*s++); } - return r; + return String(r); } void Cpp::DoFlatInclude(const String& header_path) diff --git a/uppsrc/CtrlCore/MetaFile.cpp b/uppsrc/CtrlCore/MetaFile.cpp index 4557574c6..066ef2df4 100644 --- a/uppsrc/CtrlCore/MetaFile.cpp +++ b/uppsrc/CtrlCore/MetaFile.cpp @@ -130,7 +130,7 @@ String WinMetaFile::Get() const int size = ::GetEnhMetaFileBits(hemf, 0, 0); StringBuffer b(size); ::GetEnhMetaFileBits(hemf, size, (BYTE *)~b); - return b; + return String(b); } void WinMetaFile::Serialize(Stream& s) { diff --git a/uppsrc/CtrlCore/Win32Clip.cpp b/uppsrc/CtrlCore/Win32Clip.cpp index b31c9a7f7..eeadd947a 100644 --- a/uppsrc/CtrlCore/Win32Clip.cpp +++ b/uppsrc/CtrlCore/Win32Clip.cpp @@ -408,7 +408,7 @@ String sDib(const Value& image) byte *p = (byte *)~b; memcpy(p, &header, sizeof(header)); memcpy(p + sizeof(header), ~img, 4 * img.GetLength()); - return b; + return String(b); } String sImage(const Value& image) diff --git a/uppsrc/CtrlLib/ChWin32.cpp b/uppsrc/CtrlLib/ChWin32.cpp index b90ba028a..88e938a67 100644 --- a/uppsrc/CtrlLib/ChWin32.cpp +++ b/uppsrc/CtrlLib/ChWin32.cpp @@ -194,7 +194,7 @@ struct Win32ImageMaker : ImageMaker { RawCat(key, part); RawCat(key, state); RawCat(key, sz); - return key; + return String(key); } virtual Image Make() const { Rect rr(sz); diff --git a/uppsrc/CtrlLib/Text.cpp b/uppsrc/CtrlLib/Text.cpp index 082dfcf1b..f65905011 100644 --- a/uppsrc/CtrlLib/Text.cpp +++ b/uppsrc/CtrlLib/Text.cpp @@ -678,7 +678,7 @@ WString TextCtrl::GetW(int64 pos, int size) const if(size == 0) break; pos = 0; } - return r; + return WString(r); } String TextCtrl::Get(int64 pos, int size, byte charset) const @@ -707,7 +707,7 @@ String TextCtrl::Get(int64 pos, int size, byte charset) const if(size == 0) break; pos = 0; } - return r; + return String(r); } return FromUnicode(GetW(pos, size), charset); } diff --git a/uppsrc/Draw/DrawText.cpp b/uppsrc/Draw/DrawText.cpp index 30ea03b13..9c98a5382 100644 --- a/uppsrc/Draw/DrawText.cpp +++ b/uppsrc/Draw/DrawText.cpp @@ -17,7 +17,7 @@ WString TextUnicode(const char *s, int n, byte cs, Font font) *t++ = *s++; n--; } - return b; + return WString(b); } #endif return ToUnicode(s, n, cs); diff --git a/uppsrc/Draw/ImageBlit.cpp b/uppsrc/Draw/ImageBlit.cpp index e39191220..aa03efbed 100644 --- a/uppsrc/Draw/ImageBlit.cpp +++ b/uppsrc/Draw/ImageBlit.cpp @@ -79,7 +79,7 @@ String PackRLE(const RGBA *s, int len) } } } - return r; + return String(r); } int Premultiply(RGBA *t, const RGBA *s, int len) diff --git a/uppsrc/Draw/MakeCache.cpp b/uppsrc/Draw/MakeCache.cpp index 9d962a382..0d4f437f9 100644 --- a/uppsrc/Draw/MakeCache.cpp +++ b/uppsrc/Draw/MakeCache.cpp @@ -13,7 +13,7 @@ struct scImageMaker : ValueMaker { s.Cat(typeid(*m).name()); RawCat(s, paintonly); s.Cat(m->Key()); - return s; + return String(s); } virtual int Make(Value& object) const { Image img = m->Make(); @@ -140,7 +140,7 @@ struct sCachedRescale : public ImageMaker RawCat(h, sz.cy); RawCat(h, img.GetSerialId()); RawCat(h, filter); - return h; + return String(h); } virtual Image Make() const { @@ -195,7 +195,7 @@ struct sColorize : public ImageMaker StringBuffer h; RawCat(h, color); RawCat(h, img.GetSerialId()); - return h; + return String(h); } virtual Image Make() const { diff --git a/uppsrc/Draw/SDrawText.cpp b/uppsrc/Draw/SDrawText.cpp index b99c32cb1..2f34f6277 100644 --- a/uppsrc/Draw/SDrawText.cpp +++ b/uppsrc/Draw/SDrawText.cpp @@ -28,7 +28,7 @@ struct sMakeTextGlyph : public ImageMaker RawCat(h, angle); RawCat(h, color); RawCat(h, yy); - return h; + return String(h); } virtual Image Make() const { diff --git a/uppsrc/Esc/EscArray.cpp b/uppsrc/Esc/EscArray.cpp index 447fe402c..6b2675745 100644 --- a/uppsrc/Esc/EscArray.cpp +++ b/uppsrc/Esc/EscArray.cpp @@ -106,7 +106,7 @@ EscValue::operator WString() const s.Cat(c); } } - return s; + return WString(s); } void EscValue::InitString(const WString& s) diff --git a/uppsrc/Esc/EscValue.cpp b/uppsrc/Esc/EscValue.cpp index a1c6f8dc8..6b8247207 100644 --- a/uppsrc/Esc/EscValue.cpp +++ b/uppsrc/Esc/EscValue.cpp @@ -280,7 +280,7 @@ String EscValue::ToString(int maxlen, int indent_step, bool hex, int indent) con r << lambda->arg[i]; } r << ")\n" << lambda->code; - return r; + return String(r); case ESC_MAP: r << ind << "{ "; int c = min(map->map.GetCount(), 100); diff --git a/uppsrc/Oracle/Oci8.cpp b/uppsrc/Oracle/Oci8.cpp index d19f310d3..d6bd3eaa8 100644 --- a/uppsrc/Oracle/Oci8.cpp +++ b/uppsrc/Oracle/Oci8.cpp @@ -1707,7 +1707,7 @@ WString OracleClob::Read() out.SetCount(nchars); Seek(0); Stream::Get(out, 2 * nchars); - return out; + return WString(out); } void OracleClob::Write(const WString& w) diff --git a/uppsrc/PdfDraw/PdfDraw.cpp b/uppsrc/PdfDraw/PdfDraw.cpp index ac9af2da6..4ccb066fe 100644 --- a/uppsrc/PdfDraw/PdfDraw.cpp +++ b/uppsrc/PdfDraw/PdfDraw.cpp @@ -277,7 +277,7 @@ String PdfDraw::PdfString(const char *s) b.Cat(*s++); } b.Cat(')'); - return b; + return String(b); } void PdfDraw::PutFontHeight(int fi, double ht) diff --git a/uppsrc/RichText/EncodeHTML.cpp b/uppsrc/RichText/EncodeHTML.cpp index a3de81129..9a86aff25 100644 --- a/uppsrc/RichText/EncodeHTML.cpp +++ b/uppsrc/RichText/EncodeHTML.cpp @@ -363,7 +363,7 @@ String DefaultHtmlObjectSaver::GetHtml(const RichObject& object, const String& l PNGEncoder png; png.SaveFile(AppendFileName(outdir, lname), object.ToImage(psz)); } - return html; + return String(html); } String EncodeHtml(const RichText& text, Index& css, diff --git a/uppsrc/RichText/EncodeQtf.cpp b/uppsrc/RichText/EncodeQtf.cpp index dac483079..43848961b 100644 --- a/uppsrc/RichText/EncodeQtf.cpp +++ b/uppsrc/RichText/EncodeQtf.cpp @@ -562,7 +562,7 @@ String DeQtf(const char *s) { r.Cat(*s); } } - return r; + return String(r); } String DeQtfLf(const char *s) { @@ -580,7 +580,7 @@ String DeQtfLf(const char *s) { r.Cat("-|"); s++; } - return r; + return String(r); } RichText AsRichText(const RichObject& obj) diff --git a/uppsrc/RichText/ParaPaint.cpp b/uppsrc/RichText/ParaPaint.cpp index f75fcdc50..7357ce991 100644 --- a/uppsrc/RichText/ParaPaint.cpp +++ b/uppsrc/RichText/ParaPaint.cpp @@ -141,7 +141,7 @@ String RichObjectImageMaker::Key() const RawCat(b, object.GetSerialId()); RawCat(b, sz); RawCat(b, context); - return b; + return String(b); } Image RichObjectImageMaker::Make() const diff --git a/uppsrc/Sql/SqlCode.cpp b/uppsrc/Sql/SqlCode.cpp index db2b94daa..c170e3cde 100644 --- a/uppsrc/Sql/SqlCode.cpp +++ b/uppsrc/Sql/SqlCode.cpp @@ -10,7 +10,7 @@ String MakeSqlValue(int code, T& value) StringBuffer b(sizeof(T) + 1); b[0] = code; memcpy(~b + 1, &value, sizeof(T)); - return b; + return String(b); } template @@ -327,7 +327,7 @@ String SqlCompile(byte dialect, const String& s) b.Reserve(s.GetLength() + 100); const char *q = s; SqlCompile(q, &b, dialect, NULL); - return b; + return String(b); } #ifndef NOAPPSQL @@ -370,7 +370,7 @@ String SqlFormat0(const char *s, int l, int code) b[0] = code; memcpy(~b + 1, &l, sizeof(int)); memcpy(~b + 1 + sizeof(int), s, l); - return b; + return String(b); } String SqlFormat(const char *s, int l) diff --git a/uppsrc/Sql/SqlSet.cpp b/uppsrc/Sql/SqlSet.cpp index 0869599c8..430dcaa11 100644 --- a/uppsrc/Sql/SqlSet.cpp +++ b/uppsrc/Sql/SqlSet.cpp @@ -48,7 +48,7 @@ String SqlSet::operator()(int at, byte cond) const { return text; StringBuffer out; out << SqlCode(cond, "(")() << text << SqlCode(cond, ")")(); - return out; + return String(out); } SqlSet& SqlSet::Cat(const SqlVal& val) { diff --git a/uppsrc/Sql/SqlVal.cpp b/uppsrc/Sql/SqlVal.cpp index 3a8e320e2..f89895830 100644 --- a/uppsrc/Sql/SqlVal.cpp +++ b/uppsrc/Sql/SqlVal.cpp @@ -77,7 +77,7 @@ String SqlS::operator()(int at, byte cond) const return text; StringBuffer out; out << SqlCode(cond, "(")() << text << SqlCode(cond, ")")(); - return out; + return String(out); } void SqlS::Init(const SqlS& a, const char *o, int olen, const SqlS& b, int pr, int prb) diff --git a/uppsrc/ide/Browser/CodeRef.cpp b/uppsrc/ide/Browser/CodeRef.cpp index 0ccaaf349..f70d1d7b0 100644 --- a/uppsrc/ide/Browser/CodeRef.cpp +++ b/uppsrc/ide/Browser/CodeRef.cpp @@ -158,7 +158,7 @@ String NaturalDeQtf(const char *s) { } s++; } - return r; + return String(r); } static int sSplitT(int c) { diff --git a/uppsrc/ide/Browser/File.cpp b/uppsrc/ide/Browser/File.cpp index 0e97ebe9d..71fbf509a 100644 --- a/uppsrc/ide/Browser/File.cpp +++ b/uppsrc/ide/Browser/File.cpp @@ -97,7 +97,7 @@ String WriteTopic(const char *title, const RichText& text) StringBuffer r; r << "topic " << AsCString(title) << ";\r\n"; r << AsQTF(text, CHARSET_UTF8, QTF_BODY|QTF_ALL_STYLES|QTF_CRLF); - return r; + return String(r); } String WriteTopicI(const char *title, const RichText& text) @@ -121,7 +121,7 @@ String WriteTopicI(const char *title, const RichText& text) r << "\r\n"; } r << "\r\n\r\n"; - return r; + return String(r); } void SaveGroupInc(const String& grouppath) diff --git a/uppsrc/ide/Core/Core.cpp b/uppsrc/ide/Core/Core.cpp index 3f494b168..bd866cde0 100644 --- a/uppsrc/ide/Core/Core.cpp +++ b/uppsrc/ide/Core/Core.cpp @@ -532,7 +532,7 @@ String BrcToC(CParser& binscript, String basedir) "int " << ident << "_length = " << b_length << ";\n\n"; } } - return fo; + return String(fo); } void CopyFile(const String& d, const String& s, bool brc) diff --git a/uppsrc/ide/Core/Package.cpp b/uppsrc/ide/Core/Package.cpp index e05db8f9b..2b83dc836 100644 --- a/uppsrc/ide/Core/Package.cpp +++ b/uppsrc/ide/Core/Package.cpp @@ -14,7 +14,7 @@ String ReadValue(CParser& p) while(IsUppValueChar(p.PeekChar())) v.Cat(p.GetChar()); p.Spaces(); - return v; + return String(v); } static bool sMatchOr(CParser& p, const Vector& flag); diff --git a/uppsrc/ide/idetool.cpp b/uppsrc/ide/idetool.cpp index 79cdc7dd7..512b3d2f9 100644 --- a/uppsrc/ide/idetool.cpp +++ b/uppsrc/ide/idetool.cpp @@ -325,7 +325,7 @@ static WString sSwapCase(const WString& s) r.SetCount(s.GetCount()); for(int i = 0; i < s.GetCount(); i++) r[i] = IsUpper(s[i]) ? ToLower(s[i]) : ToUpper(s[i]); - return r; + return WString(r); } void Ide::SwapCase() diff --git a/uppsrc/plugin/bmp/Icon.cpp b/uppsrc/plugin/bmp/Icon.cpp index 4206e91b0..db5277542 100644 --- a/uppsrc/plugin/bmp/Icon.cpp +++ b/uppsrc/plugin/bmp/Icon.cpp @@ -216,7 +216,7 @@ String WriteIcon(const Vector& icons, int flags) Poke32le(entry + OFFSETOF(BMP_ICONDIRENTRY, dwImageOffset), out_offset); } } - return out; + return String(out); } }