diff --git a/uppsrc/Core/App.cpp b/uppsrc/Core/App.cpp index 3f527628b..30aedfb87 100644 --- a/uppsrc/Core/App.cpp +++ b/uppsrc/Core/App.cpp @@ -541,11 +541,14 @@ String GetDownloadFolder() String GetPathXdg(String xdgConfigHome, String xdgConfigDirs) { - String ret = ""; - if (FileExists(ret = AppendFileName(xdgConfigHome, "user-dirs.dirs"))) ; - else if (FileExists(ret = AppendFileName(xdgConfigDirs, "user-dirs.defaults"))) ; - else if (FileExists(ret = AppendFileName(xdgConfigDirs, "user-dirs.dirs"))) ; - return ret; + String ret; + if(FileExists(ret = AppendFileName(xdgConfigHome, "user-dirs.dirs"))) + return ret; + if(FileExists(ret = AppendFileName(xdgConfigDirs, "user-dirs.defaults"))) + return ret; + if(FileExists(ret = AppendFileName(xdgConfigDirs, "user-dirs.dirs"))) + return ret; + return Null; } String GetPathDataXdg(String fileConfig, const char *folder) diff --git a/uppsrc/Core/Stream.h b/uppsrc/Core/Stream.h index 3a70e357d..43dcae9c5 100644 --- a/uppsrc/Core/Stream.h +++ b/uppsrc/Core/Stream.h @@ -70,7 +70,7 @@ public: void SetLastError() { SetError(errno); } #endif int GetError() const { return errorcode; } - void ClearError() { style &= ~STRM_ERROR; errorcode = 0; } + void ClearError() { style = style & ~STRM_ERROR; errorcode = 0; } int64 GetPos() const { return dword(ptr - buffer) + pos; } bool IsEof() const { return ptr >= rdlim && _IsEof(); } diff --git a/uppsrc/CtrlCore/CtrlCore.h b/uppsrc/CtrlCore/CtrlCore.h index 06d7227fb..1872f968a 100644 --- a/uppsrc/CtrlCore/CtrlCore.h +++ b/uppsrc/CtrlCore/CtrlCore.h @@ -349,7 +349,7 @@ public: class Logc { dword data; - static int LSGN(dword d) { return int16(d & 0x7fff | ((d & 0x4000) << 1)); } + static int LSGN(dword d) { return int16((d & 0x7fff) | ((d & 0x4000) << 1)); } public: bool operator==(Logc q) const { return data == q.data; } diff --git a/uppsrc/CtrlLib/AKeys.cpp b/uppsrc/CtrlLib/AKeys.cpp index d09f978ad..cf758c197 100644 --- a/uppsrc/CtrlLib/AKeys.cpp +++ b/uppsrc/CtrlLib/AKeys.cpp @@ -254,7 +254,7 @@ dword ParseKeyDesc(CParser& p) } if(p.IsNumber()) { uint32 q = p.ReadNumber(16); - if(q >= 0 && q <= 9) + if(q <= 9) return f | (K_0 + q); return f | q; } diff --git a/uppsrc/CtrlLib/ArrayCtrl.h b/uppsrc/CtrlLib/ArrayCtrl.h index 8e53e8894..df7320416 100644 --- a/uppsrc/CtrlLib/ArrayCtrl.h +++ b/uppsrc/CtrlLib/ArrayCtrl.h @@ -313,6 +313,8 @@ private: int AsNdx(const String& id) { return id_ndx.FindAdd(id); } + using Ctrl::IsModified; + public: // temporary (TRC 06/07/28) // will be removed! Ctrl& SetCtrl(int i, int j, Ctrl *newctrl) { return SetCtrl(i, j, newctrl, true, true); } diff --git a/uppsrc/CtrlLib/Bar.h b/uppsrc/CtrlLib/Bar.h index 0860d1447..d5ade6cbf 100644 --- a/uppsrc/CtrlLib/Bar.h +++ b/uppsrc/CtrlLib/Bar.h @@ -343,7 +343,7 @@ public: static void Execute(Callback1 proc, Point p) { Execute(GetActiveCtrl(), proc, p); } static void Execute(Callback1 proc) { Execute(proc, GetMousePos()); } - bool IsEmpty() { return item.IsEmpty(); } + bool IsEmpty() const { return item.IsEmpty(); } void Clear(); static const Style& StyleDefault(); @@ -364,6 +364,8 @@ public: }; class ToolButton : public Ctrl, public Bar::Item { + using Ctrl::Key; + public: virtual void Paint(Draw& w); virtual void MouseEnter(Point, dword); diff --git a/uppsrc/CtrlLib/FileSel.h b/uppsrc/CtrlLib/FileSel.h index b14cad543..da2f4b552 100644 --- a/uppsrc/CtrlLib/FileSel.h +++ b/uppsrc/CtrlLib/FileSel.h @@ -62,6 +62,9 @@ private: struct FileOrder; + using ColumnList::GetStdSize; + using ColumnList::Paint; + protected: enum { TIMEID_STARTEDIT = ColumnList::TIMEID_COUNT, diff --git a/uppsrc/CtrlLib/MenuImp.h b/uppsrc/CtrlLib/MenuImp.h index e097e43fa..1a8c8ff8b 100644 --- a/uppsrc/CtrlLib/MenuImp.h +++ b/uppsrc/CtrlLib/MenuImp.h @@ -5,8 +5,7 @@ NAMESPACE_UPP -class MenuItemBase : public Ctrl, public Bar::Item -{ +class MenuItemBase : public Ctrl, public Bar::Item { public: virtual Bar::Item& Text(const char *text); virtual Bar::Item& Key(dword key); @@ -23,6 +22,8 @@ public: virtual dword GetAccessKeys() const; virtual void AssignAccessKeys(dword used); + using Ctrl::Key; + protected: enum { NOTHING, CHECK0, CHECK1, RADIO0, RADIO1 @@ -86,6 +87,7 @@ private: void SendHelpLine(); void ClearHelpLine(); + using MenuItemBase::Key; protected: virtual int GetVisualState(); @@ -151,6 +153,7 @@ public: private: int GetState(); + using MenuItemBase::Key; public: TopSubMenuItem() { NoInitFocus(); } @@ -173,6 +176,7 @@ public: private: int GetState(); + using MenuItemBase::Key; public: TopMenuItem() { NoInitFocus(); } diff --git a/uppsrc/CtrlLib/TreeCtrl.h b/uppsrc/CtrlLib/TreeCtrl.h index e990be391..6ed369218 100644 --- a/uppsrc/CtrlLib/TreeCtrl.h +++ b/uppsrc/CtrlLib/TreeCtrl.h @@ -155,6 +155,8 @@ private: void SyncInfo(); void SyncAfterSync(Ptr restorefocus); + using Ctrl::Close; + protected: virtual void SetOption(int id); void SyncTree(); @@ -298,8 +300,6 @@ public: Size GetTreeSize() const { return treesize; } - void Dump(); - TreeCtrl& NoCursor(bool b = true) { nocursor = b; if(b) KillCursor(); return *this; } TreeCtrl& NoRoot(bool b = true) { noroot = b; Dirty(); Refresh(); return *this; } TreeCtrl& LevelCx(int cx) { levelcx = cx; Dirty(); return *this; } diff --git a/uppsrc/RichEdit/RichEdit.h b/uppsrc/RichEdit/RichEdit.h index c393cad10..150369207 100644 --- a/uppsrc/RichEdit/RichEdit.h +++ b/uppsrc/RichEdit/RichEdit.h @@ -621,6 +621,8 @@ private: friend class StyleKeysDlg; friend class StyleManager; + using Ctrl::Accept; + protected: enum { TIMEID_ENDSIZETRACKING = Ctrl::TIMEID_COUNT, diff --git a/uppsrc/TabBar/TabBar.cpp b/uppsrc/TabBar/TabBar.cpp index 181a35e57..ef72b1582 100644 --- a/uppsrc/TabBar/TabBar.cpp +++ b/uppsrc/TabBar/TabBar.cpp @@ -494,12 +494,12 @@ void TabBar::DoStacking() t.stackid = GetStackId(t); } // Create stacks - Vector< Vector > tstack; + Vector< Array > tstack; for (int i = 0; i < tabs.GetCount(); i++) { Tab &ti = tabs[i]; if (ti.stack < 0) { ti.stack = tstack.GetCount(); - Vector &ttabs = tstack.Add(); + Array &ttabs = tstack.Add(); ttabs.Add(ti); for (int j = i + 1; j < tabs.GetCount(); j++) { Tab &tj = tabs[j]; @@ -2136,7 +2136,7 @@ void TabBar::DragAndDrop(Point p, PasteClip& d) count = ix - tab; } // Copy tabs - Vector stacktemp; + Array stacktemp; stacktemp.SetCount(count); //Copy(&stacktemp[0], &tabs[tab], count); for(int i = 0; i < count; i++) diff --git a/uppsrc/TabBar/TabBar.h b/uppsrc/TabBar/TabBar.h index 1a67969ca..ed78ea26c 100644 --- a/uppsrc/TabBar/TabBar.h +++ b/uppsrc/TabBar/TabBar.h @@ -177,7 +177,7 @@ public: virtual void Serialize(Stream& s); - Vector items; + Array items; int itn; Tab() : id(-1), stack(-1), visible(true), itn(0) { items.SetCount(5); } @@ -197,6 +197,7 @@ public: TabItem& AddImage(const Image& img, int side = LEFT); TabItem& AddSpace(int space = 5, int side = LEFT); + virtual ~Tab() {} }; // Tab sorting structures @@ -216,6 +217,8 @@ protected: int last; virtual void Serialize(Stream& s); String ToString() const { return Format("%s - %d", name, count); } + + virtual ~Group() {} }; struct TabValueSort : public TabSort { @@ -230,10 +233,10 @@ protected: protected: TabScrollBar sc; - Vector groups; - Vector tabs; - Vector separators; - int active; + Array groups; + Array tabs; + Array separators; + int active; int id; int highlight; @@ -308,6 +311,9 @@ protected: static int GetStyleHeight(); static Image AlignImage(int align, const Image& img); static Value AlignValue(int align, const Value& v, const Size& isz); + + using Ctrl::GetStdSize; + using Ctrl::Close; protected: virtual void Paint(Draw& w); @@ -438,7 +444,7 @@ public: TabBar& AllowReorder(bool v = true) { allowreorder = v; return *this; } bool IsGrouping() const { return grouping; } - bool HasGroupSeparators() const { return separators; } + bool HasGroupSeparators() const { return separators.GetCount(); } bool IsStacking() const { return stacking; } bool IsShowInactive() const { return inactivedisabled; } diff --git a/uppsrc/TextDiffCtrl/TextCtrl.cpp b/uppsrc/TextDiffCtrl/TextCtrl.cpp index 692ab4f96..2ceeb96c5 100644 --- a/uppsrc/TextDiffCtrl/TextCtrl.cpp +++ b/uppsrc/TextDiffCtrl/TextCtrl.cpp @@ -262,7 +262,7 @@ int TextCompareCtrl::MeasureLength(const char *text) const String TextCompareCtrl::ExpandTabs(const char *text) const { String out; - for(char c; c = *text++;) + for(char c; (c = *text++);) if(c == '\t') out.Cat(' ', tabsize - out.GetLength() % tabsize); else diff --git a/uppsrc/ide/Debuggers/Dbg.cpp b/uppsrc/ide/Debuggers/Dbg.cpp index a9fa271d3..11c8158ed 100644 --- a/uppsrc/ide/Debuggers/Dbg.cpp +++ b/uppsrc/ide/Debuggers/Dbg.cpp @@ -40,7 +40,7 @@ const char *AfterHeading(const char *txt, const char *heading) { while(*heading) if(*txt++ != *heading++) - return false; + return NULL; return txt; } diff --git a/uppsrc/ide/FindInFiles.cpp b/uppsrc/ide/FindInFiles.cpp index af6127585..34f6a943e 100644 --- a/uppsrc/ide/FindInFiles.cpp +++ b/uppsrc/ide/FindInFiles.cpp @@ -167,35 +167,6 @@ bool Ide::SearchInFile(const String& fn, const String& pattern, bool wholeword, return true; } -static bool RawFileMatch(const char *pattern, const char *file, const char *& endptr) -{ - for(char c; (c = *pattern++) != 0;) - if(c == '*') - { - do - if(RawFileMatch(pattern, file, endptr)) - return true; - while(*file++); - endptr = pattern; - return false; - } - else if(c == '?') - { - if(*file++ == 0) - { - endptr = pattern - 1; - return false; - } - } - else if(ToLower(c) != ToLower(*file++)) - { - endptr = pattern - 1; - return false; - } - endptr = file; - return true; -} - int CharFilterFindFileMask(int c) { return ToUpper(ToAscii(c)); diff --git a/uppsrc/ide/Help.cpp b/uppsrc/ide/Help.cpp index f021f6881..b455bdf5e 100644 --- a/uppsrc/ide/Help.cpp +++ b/uppsrc/ide/Help.cpp @@ -578,7 +578,7 @@ struct HelpModule : public IdeModule { d->topic = &ide->doc; return d; } - return false; + return NULL; } virtual void Serialize(Stream& s) { s % recent_topic; diff --git a/uppsrc/ide/IconDes/IdeDes.icpp b/uppsrc/ide/IconDes/IdeDes.icpp index 10483f085..90a5957a7 100644 --- a/uppsrc/ide/IconDes/IdeDes.icpp +++ b/uppsrc/ide/IconDes/IdeDes.icpp @@ -76,7 +76,7 @@ struct IconDesModule : public IdeModule { delete d; return NULL; } - return false; + return NULL; } virtual void Serialize(Stream& s) { int version = 0; diff --git a/uppsrc/ide/SrcUpdater/SrcUpdater.h b/uppsrc/ide/SrcUpdater/SrcUpdater.h index 59b10f7c7..eb6b01db5 100644 --- a/uppsrc/ide/SrcUpdater/SrcUpdater.h +++ b/uppsrc/ide/SrcUpdater/SrcUpdater.h @@ -100,7 +100,7 @@ public: String desc; Color c; Font f; - void operator()(int fa,const String& description,const struct Color& color,bool italic){ + void operator()(int fa,const String& description,const class Color& color,bool italic){ n=fa; desc=description; c=color;