From e661493bb0440e66b4c8af56a81c88e878dd1365 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 10 Nov 2019 21:16:23 -0500 Subject: Bug 1442648 - Fix mismatched types in mingw-w64 builds (const char16_t*/char16ptr_t). When cross-compiling for Windows on Linux, fix mismatched types in nsMsgImapSearch.cpp. nsString::get() returns a char16ptr_t (with MOZ_USE_CHAR16_WRAPPER) and that causes a mismatch so we cast it to a const char16_t*. usAsciiCharSet is declared as a nsAutoString so we instead declare it as a char16_t* to avoid subsequent type mismatches. Tag #1273 --- mailnews/base/search/src/nsMsgImapSearch.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mailnews/base') diff --git a/mailnews/base/search/src/nsMsgImapSearch.cpp b/mailnews/base/search/src/nsMsgImapSearch.cpp index 5b3b2698ad..09442aeeaa 100644 --- a/mailnews/base/search/src/nsMsgImapSearch.cpp +++ b/mailnews/base/search/src/nsMsgImapSearch.cpp @@ -119,22 +119,22 @@ nsresult nsMsgSearchOnlineMail::Encode (nsCString& pEncoding, rv = searchValue->GetStr(pchar); if (NS_FAILED(rv) || pchar.IsEmpty()) continue; - asciiOnly = NS_IsAscii(pchar.get()); + asciiOnly = NS_IsAscii(static_cast(pchar.get())); } } } // else // asciiOnly = false; // TODO: enable this line when the condition is not a plain "true" in the if(). - nsAutoString usAsciiCharSet(NS_LITERAL_STRING("us-ascii")); + const char16_t* usAsciiCharSet = u"us-ascii"; // Get the optional CHARSET parameter, in case we need it. - char *csname = GetImapCharsetParam(asciiOnly ? usAsciiCharSet.get() : destCharset); + char *csname = GetImapCharsetParam(asciiOnly ? usAsciiCharSet : destCharset); // We do not need "srcCharset" since the search term in always unicode. // I just pass destCharset for both src and dest charset instead of removing srcCharst from the arguemnt. nsresult err = nsMsgSearchAdapter::EncodeImap (getter_Copies(imapTerms), searchTerms, - asciiOnly ? usAsciiCharSet.get(): destCharset, - asciiOnly ? usAsciiCharSet.get(): destCharset, false); + asciiOnly ? usAsciiCharSet : destCharset, + asciiOnly ? usAsciiCharSet : destCharset, false); if (NS_SUCCEEDED(err)) { pEncoding.Append("SEARCH"); -- cgit v1.2.3