From f8760ec1a278e4e03109871a714cee5ea269cbd7 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 3 Aug 2019 13:29:03 +0000 Subject: [PATCH] uppsrc: Removed legacy .iml support, fixed clang warnings git-svn-id: svn://ultimatepp.org/upp/trunk@13522 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CodeEditor/TagSyntax.cpp | 5 ----- uppsrc/Draw/Display.cpp | 4 ---- uppsrc/Draw/Image.cpp | 18 ------------------ uppsrc/Draw/Image.h | 11 +---------- uppsrc/Draw/Iml.cpp | 5 ++--- uppsrc/Draw/iml_source.h | 9 +-------- uppsrc/TextDiffCtrl/PatchDiff.cpp | 3 ++- 7 files changed, 6 insertions(+), 49 deletions(-) diff --git a/uppsrc/CodeEditor/TagSyntax.cpp b/uppsrc/CodeEditor/TagSyntax.cpp index aded0bbab..18fc57a4a 100644 --- a/uppsrc/CodeEditor/TagSyntax.cpp +++ b/uppsrc/CodeEditor/TagSyntax.cpp @@ -23,11 +23,6 @@ void TagSyntax::Put0(int ink, int n, int paper) hout->Put(n, hl_style[ink], hl_style[paper]); } -inline static bool IsXmlNameChar(int c) -{ - return IsAlNum(c) || c == '.' || c == '-' || c == '_' || c == ':'; -} - const wchar *TagSyntax::Spaces(const wchar *s, const wchar *e) { while(s < e && IsSpace(*s)) { diff --git a/uppsrc/Draw/Display.cpp b/uppsrc/Draw/Display.cpp index 61084ee81..0a4edb6f2 100644 --- a/uppsrc/Draw/Display.cpp +++ b/uppsrc/Draw/Display.cpp @@ -227,10 +227,6 @@ void SizeTextDisplayCls::Paint(Draw& w, const Rect& r, const Value& q, const Display& SizeTextDisplay() { return Single(); } -static inline int NScale(int sz, int r) { - return sz ? sz < r ? r / sz * sz : r : 0; -} - class CenteredImageDisplayCls : public Display { public: virtual void Paint(Draw& w, const Rect& r, const Value& q, diff --git a/uppsrc/Draw/Image.cpp b/uppsrc/Draw/Image.cpp index 3e45ba652..500180776 100644 --- a/uppsrc/Draw/Image.cpp +++ b/uppsrc/Draw/Image.cpp @@ -321,24 +321,6 @@ Image::~Image() data->Release(); } -Image::Image(const Init& init) -{ // Legacy (before cca 2008) iml support - ASSERT(init.info[0] >= 1); - Size sz; - sz.cx = Peek32le(init.info + 1); - sz.cy = Peek32le(init.info + 5); - ImageBuffer b(sz); - int i = 0; - while(i < init.scan_count) { - UnpackRLE(b[i], (const byte *)init.scans[i], sz.cx); - i++; - } - while(i < sz.cy) - memset(b[i++], 0, sizeof(RGBA) * sz.cx); - b.SetHotSpot(Point(Peek32le(init.info + 9), Peek32le(init.info + 13))); - Set(b); -} - String Image::ToString() const { return String("Image ").Cat() << GetSize(); diff --git a/uppsrc/Draw/Image.h b/uppsrc/Draw/Image.h index 934e598a5..b4a79e5fa 100644 --- a/uppsrc/Draw/Image.h +++ b/uppsrc/Draw/Image.h @@ -246,14 +246,6 @@ public: uint64 GetAuxData() const; - // IML support ("private"), deprecated - legacy .iml - struct Init { - const char *const *scans; - int16 scan_count; - char info[24]; - }; - explicit Image(const Init& init); - // required by system image cache managemenent int GetRefCount() const { return data ? (int)data->refcount : 0; } @@ -298,7 +290,6 @@ class Iml { }; Vector data[4]; // 0 normal, 1 HiDPI - HD, 2 DK - Dark, 3 HDK - HiDPI + dark VectorMap map; - const Image::Init *img_init; const char **name; dword global_flags = 0; bool premultiply; @@ -323,7 +314,7 @@ public: ImageIml GetRaw(int mode, const String& id); // tries to get image for mode by id, can return Null // these methods serve for .iml import - Iml(const Image::Init *img_init, const char **name, int n);//Deprecated - legacy .iml + Iml(const char **name, int n);//Deprecated - legacy .iml void AddData(const byte *data, int len, int count, int mode = 0); void AddId(int mode1, const char *name); void Premultiplied() { premultiply = false; } diff --git a/uppsrc/Draw/Iml.cpp b/uppsrc/Draw/Iml.cpp index 7a1d08879..f3a639416 100644 --- a/uppsrc/Draw/Iml.cpp +++ b/uppsrc/Draw/Iml.cpp @@ -155,9 +155,8 @@ int Iml::GetBinSize() const } #endif -Iml::Iml(const Image::Init *img_init, const char **name, int n) -: img_init(img_init), - name(name) +Iml::Iml(const char **name, int n) +: name(name) { premultiply = true; Init(n); diff --git a/uppsrc/Draw/iml_source.h b/uppsrc/Draw/iml_source.h index 478617894..8e6aa53be 100644 --- a/uppsrc/Draw/iml_source.h +++ b/uppsrc/Draw/iml_source.h @@ -31,13 +31,6 @@ UPP::Iml& IMAGECLASS::Iml() { - static UPP::Image::Init init[] = { // legacy format - #define IMAGE_PACKED(n, d) { COMBINE(COMBINE(IMAGECLASS, _), n##__scans__), __countof(COMBINE(COMBINE(IMAGECLASS, _), n##__scans__)), d }, - #include IMAGEFILE - { NULL } - #undef IMAGE_PACKED - }; - static const char *name[IMAGECLASS::COUNT] = { #define IMAGE_PACKED(n, d) #n, #undef IMAGE_ID @@ -45,7 +38,7 @@ UPP::Iml& IMAGECLASS::Iml() { #include IMAGEFILE }; - static UPP::Iml iml(init, name, COUNT); + static UPP::Iml iml(name, COUNT); #ifdef FIXED_COLORS #undef FIXED_COLORS diff --git a/uppsrc/TextDiffCtrl/PatchDiff.cpp b/uppsrc/TextDiffCtrl/PatchDiff.cpp index 70a22b9ab..575be8e6c 100644 --- a/uppsrc/TextDiffCtrl/PatchDiff.cpp +++ b/uppsrc/TextDiffCtrl/PatchDiff.cpp @@ -50,11 +50,12 @@ PatchDiff::PatchDiff() return; String h = patch.GetPatchedFile(i); String p = patch.GetPath(i); - if(!h.IsVoid()) + if(!h.IsVoid()) { if(IsNull(h)) FileDelete(p); else SaveFile(p, h); + } } Break(IDOK); };