From 4ec342f812b65d3b3b3271da70f6ccbbf523ccff Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 11 Jun 2016 16:05:36 +0000 Subject: [PATCH] ide: fixed for previous ambiguity fix, some r-value fixes (thanks Novo!) git-svn-id: svn://ultimatepp.org/upp/trunk@9923 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/BiCont.h | 12 ++++++------ uppsrc/Core/Callback.h | 4 ++-- uppsrc/Core/CoWork.h | 2 +- uppsrc/Core/FixedMap.h | 8 ++++---- uppsrc/Core/Other.h | 2 +- uppsrc/ide/BaseDlg.cpp | 2 +- uppsrc/ide/Debug.cpp | 2 +- uppsrc/ide/FindInFiles.cpp | 5 ++--- uppsrc/ide/Setup.cpp | 2 +- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/uppsrc/Core/BiCont.h b/uppsrc/Core/BiCont.h index a738dbc1f..c363867e3 100644 --- a/uppsrc/Core/BiCont.h +++ b/uppsrc/Core/BiCont.h @@ -29,8 +29,8 @@ public: T& AddTail() { return *new(AddTail0()) T; } void AddHead(const T& x) { new(AddHead0()) T(x); } void AddTail(const T& x) { new(AddTail0()) T(x); } - void AddHead(T&& x) { new(AddHead0()) T(x); } - void AddTail(T&& x) { new(AddTail0()) T(x); } + void AddHead(T&& x) { new(AddHead0()) T(pick(x)); } + void AddTail(T&& x) { new(AddTail0()) T(pick(x)); } T& Head() { ASSERT(items > 0); return vector[start]; } T& Tail() { ASSERT(items > 0); return vector[EI()]; } const T& Head() const { ASSERT(items > 0); return vector[start]; } @@ -79,8 +79,8 @@ public: UPP::Swap(a.alloc, b.alloc); } #ifdef DEPRECATED - void AddHeadPick(T&& x) { new(AddHead0()) T(x); } - void AddTailPick(T&& x) { new(AddTail0()) T(x); } + void AddHeadPick(T&& x) { new(AddHead0()) T(pick(x)); } + void AddTailPick(T&& x) { new(AddTail0()) T(pick(x)); } ConstIterator GetIter(int pos) const { return ConstIterator(*this, pos); } Iterator GetIter(int pos) { return Iterator(*this, pos); } typedef T ValueType; @@ -155,8 +155,8 @@ public: friend void Swap(BiArray& a, BiArray& b) { UPP::Swap(a.bv, b.bv); } #ifdef DEPRECATED - void AddHeadPick(T&& x) { bv.AddHead(new T(x)); } - void AddTailPick(T&& x) { bv.AddTail(new T(x)); } + void AddHeadPick(T&& x) { bv.AddHead(new T(pick(x))); } + void AddTailPick(T&& x) { bv.AddTail(new T(pick(x))); } ConstIterator GetIter(int pos) const { return ConstIterator(*this, pos); } Iterator GetIter(int pos) { return Iterator(*this, pos); } typedef T ValueType; diff --git a/uppsrc/Core/Callback.h b/uppsrc/Core/Callback.h index 7836a8fd3..f13fec1ed 100644 --- a/uppsrc/Core/Callback.h +++ b/uppsrc/Core/Callback.h @@ -91,7 +91,7 @@ public: Event(const Event& src) : fn(src.fn) {} Event& operator=(const Event& src) { fn = src.fn; return *this; } - Event(Fn&& src, int) : fn(src) {} // Helper for callback compatibility code + Event(Fn&& src, int) : fn(pick(src)) {} // Helper for callback compatibility code template Event(F src, int) : fn(src) {} // Helper for callback compatibility code @@ -137,7 +137,7 @@ public: EventGate(const EventGate& a) : fn(a.fn) {} EventGate& operator=(const EventGate& a) { fn = a.fn; return *this; } - EventGate(Fn&& src, int) : fn(src) {} + EventGate(Fn&& src, int) : fn(pick(src)) {} EventGate& operator=(EventGate&& a) { fn = pick(a.fn); return *this; } EventGate(CNULLer) {} diff --git a/uppsrc/Core/CoWork.h b/uppsrc/Core/CoWork.h index bd7d234c6..cffa24d84 100644 --- a/uppsrc/Core/CoWork.h +++ b/uppsrc/Core/CoWork.h @@ -51,7 +51,7 @@ public: CoWork& operator&(const Callback& cb) { Do(cb); return *this; } CoWork& operator&(const Function& fn) { Do(fn); return *this; } - CoWork& operator&(Function&& fn) { Do(fn); return *this; } + CoWork& operator&(Function&& fn) { Do(pick(fn)); return *this; } void Pipe(int stepi, Function&& lambda); diff --git a/uppsrc/Core/FixedMap.h b/uppsrc/Core/FixedMap.h index cc930ef2a..7cc3ae573 100644 --- a/uppsrc/Core/FixedMap.h +++ b/uppsrc/Core/FixedMap.h @@ -6,7 +6,7 @@ protected: public: T& Add(const K& k, const T& x) { key.Add(k); return value.Add(x); } - T& AddPick(const K& k, T&& x) { key.Add(k); return value.AddPick(x); } + T& AddPick(const K& k, T&& x) { key.Add(k); return value.AddPick(pick(x)); } T& Add(const K& k) { key.Add(k); return value.Add(); } void Finish() { IndexSort(key, value, Less()); Shrink(); } @@ -52,7 +52,7 @@ public: FixedAMap() {} FixedAMap(const FixedAMap& s, int) : key(s.key, 0), value(s.value, 0) {} - FixedAMap(Vector&& key, V&& val) : key(key), value(val) {} + FixedAMap(Vector&& key, V&& val) : key(pick(key)), value(val) {} typedef ConstIteratorOf ConstIterator; typedef IteratorOf Iterator; @@ -85,7 +85,7 @@ class FixedVectorMap : public MoveableAndDeepCopyOption, Less > B; public: FixedVectorMap(const FixedVectorMap& s, int) : FixedAMap, Less>(s, 1) {} - FixedVectorMap(Vector&& key, Vector&& val) : FixedAMap, Less>(key, val) {} + FixedVectorMap(Vector&& key, Vector&& val) : FixedAMap, Less>(pick(key), pick(val)) {} FixedVectorMap() {} friend void Swap(FixedVectorMap& a, FixedVectorMap& b) { a.B::Swap(b); } @@ -107,7 +107,7 @@ public: TT& Create(const K& k, Args... args) { TT *q = new TT(args...); B::key.Add(k); return static_cast(B::value.Add(q)); } FixedArrayMap(const FixedArrayMap& s, int) : FixedAMap, Less>(s, 1) {} - FixedArrayMap(Vector&& ndx, Array&& val) : FixedAMap, Less>(ndx, val) {} + FixedArrayMap(Vector&& ndx, Array&& val) : FixedAMap, Less>(pick(ndx), pick(val)) {} FixedArrayMap() {} friend void Swap(FixedArrayMap& a, FixedArrayMap& b) { a.B::Swap(b); } diff --git a/uppsrc/Core/Other.h b/uppsrc/Core/Other.h index 7ee7a2b70..c25a39444 100644 --- a/uppsrc/Core/Other.h +++ b/uppsrc/Core/Other.h @@ -138,7 +138,7 @@ public: void Clear(); void Shrink(); - Mitor(Mitor&& m) { Pick(m); } + Mitor(Mitor&& m) { Pick(pick(m)); } void operator=(Mitor&& m) { if(this != &m) { Clear(); Pick(pick(m)); } } Mitor(Mitor& m, int) { Copy(m); } diff --git a/uppsrc/ide/BaseDlg.cpp b/uppsrc/ide/BaseDlg.cpp index 8eca63b10..0aa0fd521 100644 --- a/uppsrc/ide/BaseDlg.cpp +++ b/uppsrc/ide/BaseDlg.cpp @@ -71,7 +71,7 @@ bool BaseSetupDlg::Run(String& vars) Vector paths = SplitDirs(upp.GetText().ToString()); for(int i = 0; i < paths.GetCount(); i++) RealizeDirectory(paths[i]); - RealizeDirectory(output); + RealizeDirectory(~output); vars = varname; return true; } diff --git a/uppsrc/ide/Debug.cpp b/uppsrc/ide/Debug.cpp index c417dec94..53f16a035 100644 --- a/uppsrc/ide/Debug.cpp +++ b/uppsrc/ide/Debug.cpp @@ -46,7 +46,7 @@ void Ide::RunArgs() { dlg.utf8.Enable(rm != RUN_WINDOW); switch(dlg.Run()) { case IDOK: - rundir = dlg.dir; + rundir = ~dlg.dir; runarg = ~dlg.arg; runmode = ~dlg.runmode; runexternal = dlg.external; diff --git a/uppsrc/ide/FindInFiles.cpp b/uppsrc/ide/FindInFiles.cpp index f11903194..03a9bb6ed 100644 --- a/uppsrc/ide/FindInFiles.cpp +++ b/uppsrc/ide/FindInFiles.cpp @@ -244,7 +244,7 @@ void Ide::FindInFiles(bool replace) { WriteList(ff.find, d.find_list); WriteList(ff.replace, d.replace_list); ff.Sync(); - if(String(ff.folder).IsEmpty()) + if(IsNull(~ff.folder)) ff.folder <<= GetUppDir(); ff.style <<= STYLE_NO_REPLACE; ff.Sync(); @@ -278,8 +278,7 @@ void Ide::FindInFiles(bool replace) { ~ff.files, ~ff.readonly, pi); } else - SearchForFiles(files, NormalizePath((String)ff.folder, GetUppDir()), - ~ff.files, ~ff.readonly, pi); + SearchForFiles(files, NormalizePath(~~ff.folder, GetUppDir()), ~ff.files, ~ff.readonly, pi); if(!pi.Canceled()) { String pattern; RegExp rx, *regexp = NULL; diff --git a/uppsrc/ide/Setup.cpp b/uppsrc/ide/Setup.cpp index f143857ae..a3f4336f2 100644 --- a/uppsrc/ide/Setup.cpp +++ b/uppsrc/ide/Setup.cpp @@ -595,7 +595,7 @@ void MainConfigDlg::FlagDlg() WithConfLayout cfg; CtrlLayoutOKCancel(cfg, "Configuration flags"); cfg.Sizeable().MaximizeBox(); - Vector flg = SplitFlags0(String(fe)); + Vector flg = SplitFlags0(~~fe); Vector accepts = wspc.GetAllAccepts(0); Sort(accepts, GetLanguageInfo()); enum { CC_SET, CC_NAME, CC_PACKAGES, CC_COUNT };