From 3b08038375d13a8a2f82e8cbd9cc95b951cafef2 Mon Sep 17 00:00:00 2001 From: Mirek Fidler Date: Sun, 6 Mar 2022 15:26:36 +0100 Subject: [PATCH] Core, ide: Fixed some warnings --- uppsrc/Core/App.cpp | 1 - uppsrc/Core/WString.cpp | 4 +--- uppsrc/TextDiffCtrl/TextCtrl.cpp | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/uppsrc/Core/App.cpp b/uppsrc/Core/App.cpp index b2a653a11..889f26211 100644 --- a/uppsrc/Core/App.cpp +++ b/uppsrc/Core/App.cpp @@ -645,7 +645,6 @@ String GetUserName() ::GetUserNameW(temp, &w); return temp; #else - char temp[256]; return Nvl(GetEnv("USER"), "root"); #endif } diff --git a/uppsrc/Core/WString.cpp b/uppsrc/Core/WString.cpp index f9d6dade7..87eee8d2f 100644 --- a/uppsrc/Core/WString.cpp +++ b/uppsrc/Core/WString.cpp @@ -260,10 +260,8 @@ WString::WString(const std::wstring& s) std::wstring WString::ToStd() const { - if(sizeof(wchar_t) == 4) { - const wchar *s = begin(); + if(sizeof(wchar_t) == 4) return std::wstring((const wchar_t *)begin(), GetCount()); - } if(sizeof(wchar_t) == 2) { Vector h = ToUtf16(*this); return std::wstring((const wchar_t *)h.begin(), h.GetCount()); diff --git a/uppsrc/TextDiffCtrl/TextCtrl.cpp b/uppsrc/TextDiffCtrl/TextCtrl.cpp index 3ddcf2c8a..3178199a8 100644 --- a/uppsrc/TextDiffCtrl/TextCtrl.cpp +++ b/uppsrc/TextDiffCtrl/TextCtrl.cpp @@ -376,7 +376,6 @@ void TextCompareCtrl::Paint(Draw& draw) int x = 0; int ii = 0; while(ii < hln.GetCount() - 1) { - Font fnt = font; LineEdit::Highlight& h = hln[ii]; int l = 1; while(ii + l < hln.GetCount() - 1 && hln[ii + l].paper == h.paper)