From 9e780eb20b1aa7de8e1f5df78fe19aae5a19bc49 Mon Sep 17 00:00:00 2001 From: Orefkov Aleksander Date: Thu, 23 Sep 2021 09:32:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D0=B8=20core=5Fas=20=D0=BD=D0=B0=20=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D1=83=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/core_as/sstring.h | 163 ++++++++++++------------ src/include/core_as/version.h | 4 +- src/inject/inject.vcxproj | 4 + src/lib/core_as/Debug/x64/core_as.exp | Bin 11597 -> 11597 bytes src/lib/core_as/Debug/x64/core_as.lib | Bin 19484 -> 19484 bytes src/lib/core_as/Debug/x86/core_as.exp | Bin 11345 -> 11345 bytes src/lib/core_as/Debug/x86/core_as.lib | Bin 19052 -> 19052 bytes src/lib/core_as/Release/x64/core_as.exp | Bin 11599 -> 11599 bytes src/lib/core_as/Release/x64/core_as.lib | Bin 19484 -> 19484 bytes src/lib/core_as/Release/x86/core_as.exp | Bin 11347 -> 11347 bytes src/lib/core_as/Release/x86/core_as.lib | Bin 19052 -> 19052 bytes src/runner/runner.vcxproj | 18 ++- src/starter/modules_list.cpp | 27 ++-- src/starter/starter.vcxproj | 8 +- src/wrunner/wrunner.vcxproj | 22 ++-- src/wrunner/wrunner.vcxproj.filters | 4 +- 16 files changed, 131 insertions(+), 119 deletions(-) diff --git a/src/include/core_as/sstring.h b/src/include/core_as/sstring.h index 5a1920d..39bc670 100644 --- a/src/include/core_as/sstring.h +++ b/src/include/core_as/sstring.h @@ -148,7 +148,7 @@ class str_algs { public: using symb_type = K; - using SimpleStr = StrRef; + using StrPiece = StrRef; using traits = char_traits; using uni = unicode_traits; using uns_type = make_unsigned_t; @@ -177,30 +177,30 @@ class str_algs { } // Чтобы быть источником строкового объекта - constexpr operator SimpleStr() const noexcept { - return SimpleStr{ _str(), _len() }; + constexpr operator StrPiece() const noexcept { + return StrPiece{ _str(), _len() }; } - SimpleStr to_str() const noexcept { - return SimpleStr{ _str(), _len() }; + StrPiece to_str() const noexcept { + return StrPiece{ _str(), _len() }; } - constexpr SimpleStr operator () (int from, int len = 0) const noexcept { + constexpr StrPiece operator () (int from, int len = 0) const noexcept { uint myLen = _len(), idxStart = from >= 0 ? from : myLen + from, idxEnd = (len > 0 ? from : myLen) + len; if (idxEnd > myLen) idxEnd = myLen; if (idxStart > idxEnd) idxStart = idxEnd; - return SimpleStr { _str() + idxStart, idxEnd - idxStart }; + return StrPiece { _str() + idxStart, idxEnd - idxStart }; } - constexpr SimpleStr mid(uint from, int len = -1) const noexcept { + constexpr StrPiece mid(uint from, int len = -1) const noexcept { uint myLen = _len(), idxStart = from, idxEnd = len >= 0 ? from + len : myLen; if (idxEnd > myLen) idxEnd = myLen; if (idxStart > idxEnd) idxStart = idxEnd; - return SimpleStr{ _str() + idxStart, idxEnd - idxStart }; + return StrPiece{ _str() + idxStart, idxEnd - idxStart }; } void store(char*& ptr) const noexcept { uint len = (_len() + 1) * sizeof(K); @@ -216,7 +216,7 @@ class str_algs { return _str()[idx >= 0 ? idx : _len() + idx]; } // Сравнение строк - int compare(SimpleStr o) const { + int compare(StrPiece o) const { if (!o.length()) return _isEmpty() ? 0 : 1; uint myLen = _len(), checkLen = min(myLen, o.length()); @@ -224,7 +224,7 @@ class str_algs { return cmp == 0 ? (myLen > o.length() ? 1 : myLen == o.length() ? 0 : -1) : cmp; } - uint find(SimpleStr pattern, uint offset = 0) const noexcept { + uint find(StrPiece pattern, uint offset = 0) const noexcept { uint lenText = _len(), lenPattern = pattern.length(); // Образец, не вмещающийся в строку и пустой образец не находим if (!lenPattern || offset + lenPattern > lenText) @@ -259,25 +259,25 @@ class str_algs { return str_pos::badIdx; } - bool isEqual(SimpleStr other) const noexcept { + bool isEqual(StrPiece other) const noexcept { uint myLen = _len(); return other.length() == myLen && (myLen == 0 || traits::compare(_str(), other.c_str(), myLen) == 0); } - bool operator == (SimpleStr other) const noexcept { + bool operator == (StrPiece other) const noexcept { return isEqual(other); } - bool operator != (SimpleStr other) const noexcept { + bool operator != (StrPiece other) const noexcept { return !isEqual(other); } - bool operator < (SimpleStr other) const { + bool operator < (StrPiece other) const { return compare(other) < 0; } // Сравнение ascii строк без учёта регистра - int compareia(SimpleStr text) const noexcept { + int compareia(StrPiece text) const noexcept { uint otherLen = text.length(); if (!otherLen) return _isEmpty() ? 0 : 1; @@ -297,25 +297,25 @@ class str_algs { return myLen == otherLen ? 0 : myLen > otherLen ? 1 : -1; } - bool isEqualia(SimpleStr text) const noexcept { + bool isEqualia(StrPiece text) const noexcept { return text.length() == _len() && compareia(text) == 0; } - bool isLessia(SimpleStr text) const noexcept { + bool isLessia(StrPiece text) const noexcept { return compareia(text) < 0; } - int compareiu(SimpleStr text) const noexcept { + int compareiu(StrPiece text) const noexcept { if (!text.length()) return _isEmpty() ? 0 : 1; return uni::compareiu(_str(), _len(), text.c_str(), text.length()); } - bool isEqualiu(SimpleStr text) const noexcept { + bool isEqualiu(StrPiece text) const noexcept { return text.length() == _len() && compareiu(text) == 0; } - bool isLessiu(SimpleStr text) const noexcept { + bool isLessiu(StrPiece text) const noexcept { return compareiu(text) < 0; } @@ -326,7 +326,7 @@ class str_algs { return my_type(d().mid(from, len)); } - vector find_all(SimpleStr pattern, uint offset = 0, uint maxCount = 0) const { + vector find_all(StrPiece pattern, uint offset = 0, uint maxCount = 0) const { if (!maxCount) maxCount--; vector result; @@ -341,14 +341,14 @@ class str_algs { } template - T splitf(SimpleStr delimeter, const Op& beforeFunc, uint offset = 0) const { + T splitf(StrPiece delimeter, const Op& beforeFunc, uint offset = 0) const { uint mylen = _len(), lenDelimeter = delimeter.length(); T results; - SimpleStr me{ _str(), _len() }; + StrPiece me{ _str(), _len() }; for (;;) { uint beginOfDelim = find(delimeter, offset); if (beginOfDelim == str_pos::badIdx) { - SimpleStr last = beforeFunc(SimpleStr{ me.c_str() + offset, me.length() - offset }); + StrPiece last = beforeFunc(StrPiece{ me.c_str() + offset, me.length() - offset }); if (last.isSame(me)) { // Пробуем положить весь объект results.emplace_back(d()); @@ -356,7 +356,7 @@ class str_algs { results.emplace_back(last); break; } - results.emplace_back(beforeFunc(SimpleStr{ me.c_str() + offset, beginOfDelim - offset })); + results.emplace_back(beforeFunc(StrPiece{ me.c_str() + offset, beginOfDelim - offset })); offset = beginOfDelim + lenDelimeter; } return results; @@ -364,46 +364,46 @@ class str_algs { // Разбиение строки на части template - T split(SimpleStr delimeter, uint offset = 0) const { - return splitf(delimeter, [](SimpleStr o) {return o; }, offset); + T split(StrPiece delimeter, uint offset = 0) const { + return splitf(delimeter, [](StrPiece o) {return o; }, offset); } // Начинается ли эта строка с указанной подстроки - bool isPrefixed(SimpleStr prefix) const noexcept { + bool isPrefixed(StrPiece prefix) const noexcept { if (!prefix.length() || _len() < prefix.length()) return false; - return 0 == prefix.compare(SimpleStr{ _str(), prefix.length() }); + return 0 == prefix.compare(StrPiece{ _str(), prefix.length() }); } // Начинается ли эта строка с указанной подстроки без учета ascii регистра - bool isPrefixedia(SimpleStr prefix) const noexcept { + bool isPrefixedia(StrPiece prefix) const noexcept { if (!prefix.length() || _len() < prefix.length()) return false; - return 0 == prefix.compareia(SimpleStr{ _str(), prefix.length() }); + return 0 == prefix.compareia(StrPiece{ _str(), prefix.length() }); } // Начинается ли эта строка с указанной подстроки без учета unicode регистра - bool isPrefixediu(SimpleStr prefix) const noexcept { + bool isPrefixediu(StrPiece prefix) const noexcept { if (!prefix.length() || _len() < prefix.length()) return false; return 0 == uni::compareiu(_str(), prefix.length(), prefix.c_str(), prefix.length()); } // Является ли эта строка началом указанной строки - bool isPrefixIn(SimpleStr text) const noexcept { + bool isPrefixIn(StrPiece text) const noexcept { uint myLen = _len(); if (myLen > text.length()) return false; return !myLen || 0 == traits::compare(text.c_str(), _str(), myLen); } // Заканчивается ли строка указанной подстрокой - bool isSuffixed(SimpleStr suffix) { + bool isSuffixed(StrPiece suffix) { return suffix.length() <= _len() && (suffix.length() == 0 || (*this)(-int(suffix.length())).isEqual(suffix)); } // Заканчивается ли строка указанной подстрокой без учета регистра ASCII - bool isSuffixedia(SimpleStr suffix) { + bool isSuffixedia(StrPiece suffix) { return suffix.length() <= _len() && (suffix.length() == 0 || (*this)(-int(suffix.length())).isEqualia(suffix)); } // Заканчивается ли строка указанной подстрокой без учета регистра UNICODE - bool isSuffixediu(SimpleStr suffix) { + bool isSuffixediu(StrPiece suffix) { return suffix.length() <= _len() && (suffix.length() == 0 || (*this)(-int(suffix.length())).isEqualiu(suffix)); } @@ -448,7 +448,7 @@ class str_algs { } template - R replace(SimpleStr pattern, SimpleStr repl, uint offset = 0, uint maxCount = 0) const { + R replace(StrPiece pattern, StrPiece repl, uint offset = 0, uint maxCount = 0) const { return R::replace_s(d(), pattern, repl, offset, maxCount); } @@ -458,13 +458,13 @@ class str_algs { } template - R& replaceTo(R& obj, SimpleStr pattern, SimpleStr repl, uint offset = 0, uint maxCount = 0) const { + R& replaceTo(R& obj, StrPiece pattern, StrPiece repl, uint offset = 0, uint maxCount = 0) const { return R::replaceTo_s(obj, d(), pattern, repl, offset, maxCount); } template = 0, typename Op> static my_type make_trim_op(const From& from, const Op& opTrim) { - SimpleStr sfrom = from, newPos = opTrim(sfrom); + StrPiece sfrom = from, newPos = opTrim(sfrom); return newPos.isSame(sfrom) ? my_type{ from } : my_type{ newPos }; } template = 0> @@ -478,7 +478,7 @@ class str_algs { } template = 0> - static my_type trim_static(const From& from, SimpleStr pattern) { + static my_type trim_static(const From& from, StrPiece pattern) { return make_trim_op(from, trimOperator { pattern}); } // Триминг по пробельным символам - ' ', \t\n\v\f\r @@ -522,28 +522,28 @@ class str_algs { } // Триминг по динамическому источнику template - R trim(SimpleStr pattern) const { + R trim(StrPiece pattern) const { return R::trim_static(d(), pattern); } template - R trim_l(SimpleStr pattern) const { + R trim_l(StrPiece pattern) const { return R::trim_static(d(), pattern); } template - R trim_r(SimpleStr pattern) const { + R trim_r(StrPiece pattern) const { return R::trim_static(d(), pattern); } // Триминг по символам в литерале и пробелам template - R trim_s(SimpleStr pattern) const { + R trim_s(StrPiece pattern) const { return R::trim_static(d(), pattern); } template - R trim_sl(SimpleStr pattern) const { + R trim_sl(StrPiece pattern) const { return R::trim_static(d(), pattern); } template - R trim_sr(SimpleStr pattern) const { + R trim_sr(StrPiece pattern) const { return R::trim_static(d(), pattern); } }; @@ -594,7 +594,7 @@ struct SimpleStr : str_algs, SimpleStr > { }; /* -* Класс, заявлящий, что ссылается на нуль-терминированную строку. +* Класс, заявляющий, что ссылается на нуль-терминированную строку. * Служит для показателя того, что функция параметром хочет получить * строку с нулем в конце, например, ей надо дальше передавать его в * стороннее API. Без этого ей надо было бы либо указывать параметром @@ -657,7 +657,7 @@ static auto e_s(const K* ptr) { // но применять только публичные конструкторы template T return_public(Args&& ...other) { - return T(forward(other)...); + return T{ forward(other)... }; } // Чтобы через ::assign нельзя было вызвать приватные конструкторы класса @@ -774,7 +774,7 @@ struct trimOperator : SymbSelector::type, CheckSpaceTrim { }; template -using SimpleTrim = trimOperator; +using SimpleTrim = trimOperator; using trim_w = SimpleTrim; using trim_a = SimpleTrim; using triml_w = SimpleTrim; @@ -841,17 +841,6 @@ struct utf_convert_selector { COREAS_API static uint convert(const u32symbol* src, uint srcLen, u16symbol* dest); }; -template -struct utf_init { - SimpleStr src; -}; - -template -auto fromUtf(SimpleStr t) { - return utf_init{ t }; -} - - template class from_utf_convertable { protected: @@ -865,19 +854,21 @@ class from_utf_convertable { */ public: template, int> = 0> - from_utf_convertable(utf_init init) { + from_utf_convertable(SimpleStr init) { using worker = utf_convert_selector; Impl* d = static_cast(this); - uint len = init.src.length(); + uint len = init.length(); if (!len) d->createEmpty(); else - d->setSize(worker::convert(init.src.c_str(), len, d->init(worker::maxSpace(len)))); + d->setSize(worker::convert(init.c_str(), len, d->init(worker::maxSpace(len)))); } + template, int> = 0> + from_utf_convertable(const str_algs, I, E>& init) : from_utf_convertable(init.to_str()) {} template, int> = 0> static my_type fromOtherUtf(SimpleStr src) { - return my_type(utf_init{ src }); + return my_type{ src }; } }; @@ -927,7 +918,7 @@ class str_storeable { for (uint l = 0, len = f.length(); l < len; l++, ptr++) { K s = *ptr; if (opCheckWrongCase(s)) { - my_type res(len); + my_type res{ len }; K* pWrite = const_cast(res.c_str()); if (l) { char_traits::copy(pWrite, f.c_str(), l); @@ -952,7 +943,7 @@ class str_storeable { const K* ptr = f.c_str(); uint len = f.length(), first = op1(ptr, len); if (first != str_pos::badIdx) { - my_type res(len); + my_type res{ len }; K* pWrite = const_cast(res.c_str()); if (first > 0) traits::copy(pWrite, ptr, first); @@ -973,7 +964,7 @@ class str_storeable { uint len = f.length(), first = op1(ptr, len); if (first != str_pos::badIdx) { - my_type res(len); + my_type res{ len }; K* pWrite = const_cast(res.c_str()); if (first > 0) @@ -1060,9 +1051,9 @@ class str_storeable { template static my_type join(const T& strings, SimpleStr delimeter, bool tail = false) { if (!strings.size()) - return my_type(); + return my_type{}; if (strings.size() == 1 && (!delimeter.length() || !tail)) - return my_type(strings[0]); + return my_type{ strings[0] }; uint commonLen = 0; for (auto it = strings.begin(), e = strings.end(); it != e;) { commonLen += it->length(); @@ -1071,9 +1062,9 @@ class str_storeable { commonLen += delimeter.length(); } if (!commonLen) - return my_type(); + return my_type{}; - my_type res(commonLen); // выделяется память под все строки + my_type res{ commonLen }; // выделяется память под все строки K* ptr = const_cast(res.c_str()); for (auto it = strings.begin(), e = strings.end(); it != e; ) { uint copyLen = it->length(); @@ -1127,7 +1118,7 @@ class str_storeable { if (!newSize) return my_type{}; - my_type res(newSize); + my_type res{ newSize }; K* ptr = const_cast(res.c_str()); uint from = 0; for (const auto& s: findes) { @@ -1470,7 +1461,8 @@ class str_mutable { if (!o.isEmpty()) { uint size = _len(); K* ptr = d().setSize(size + o.length()); - char_traits::move(ptr + o.length(), ptr, size); + if (size) + char_traits::move(ptr + o.length(), ptr, size); char_traits::copy(ptr, o.c_str(), o.length()); } return d(); @@ -1481,7 +1473,8 @@ class str_mutable { if (len) { uint size = _len(); K* ptr = d().setSize(size + len); - char_traits::move(ptr + len, ptr, size); + if (size) + char_traits::move(ptr + len, ptr, size); expr.place(ptr); } return d(); @@ -1523,7 +1516,7 @@ class str_mutable { char_traits::move(ptr + posWrite, ptr + offset, tailLen); d().setSize(posWrite + tailLen); } else { - // Заменяем на более длинный кусок, длина текста увеличиться, идём справа налево + // Заменяем на более длинный кусок, длина текста увеличится, идём справа налево auto finded = d().find_all(pattern, offset, maxCount); if (finded.size()) { uint delta = repl.length() - pattern.length(); @@ -1679,7 +1672,7 @@ struct SharedStringData { SharedStringData(uint s) : size(s) {} atomic counter{ 1 }; // Счетчик ссылок uint size{ 0 }; // Количество символов - void incr() { counter++; }// counter.fetch_add(1, memory_order_relaxed); } + void incr() { counter++; } // counter.fetch_add(1, memory_order_relaxed); } void decr() { if (!--counter) core_as_free(this); } }; @@ -1716,7 +1709,7 @@ class empty_bases lstring : // Данные uint size; union Buffer { - K local[N + 1] ; + K local[N + 1]; struct { uint bufSize; K* data; @@ -1771,7 +1764,7 @@ class empty_bases lstring : if (other.size) traits::copy(reserve(other.size), other.c_str(), other.size + 1); } - // Перемещение из другой строки с таким же размером буфера + // Перемещени е из другой строки с таким же размером буфера lstring(my_type&& other) { if (other.size) { if (other.size > N) { @@ -2108,7 +2101,7 @@ class empty_bases sstring : // Форматирование строки. template static my_type format(const K* format, T&& ... args) { - return my_type(move(lstring().s_format(format, forward(args)...))); + return my_type(move(lstring{}.s_format(format, forward(args)...))); } }; @@ -2511,7 +2504,7 @@ class hashStrMap { } template auto emplace(const SimpleStr& key, ValArgs&&... args) { - return emplace(StoreType{ key, H()(key) }, forward(args)...); + return emplace(StoreType{ key, H{}(key) }, forward(args)...); } template auto emplace_or_assign(const StoreType& key, ValArgs&&... args) { @@ -2524,19 +2517,19 @@ class hashStrMap { } template auto emplace_or_assign(const SimpleStr& key, ValArgs&&... args) { - return emplace_or_assign(StoreType{ key, H()(key) }, forward(args)...); + return emplace_or_assign(StoreType{ key, H{}(key) }, forward(args)...); } auto find(const StoreType& key) const { return hashStore.find(key); } auto find(const SimpleStr& key) const { - return find(StoreType{ key, H()(key) }); + return find(StoreType{ key, H{}(key) }); } auto find(const StoreType& key) { return hashStore.find(key); } auto find(const SimpleStr& key) { - return find(StoreType{ key, H()(key) }); + return find(StoreType{ key, H{}(key) }); } auto erase(const StoreType& key) { auto it = hashStore.find(key); @@ -2548,7 +2541,7 @@ class hashStrMap { return 0; } auto erase(const SimpleStr& key) { - return erase(StoreType { key, H()(key) }); + return erase(StoreType { key, H{}(key) }); } auto begin() const { return hashStore.begin(); diff --git a/src/include/core_as/version.h b/src/include/core_as/version.h index cb6a330..39abf35 100644 --- a/src/include/core_as/version.h +++ b/src/include/core_as/version.h @@ -1,3 +1,3 @@ -#define F_VERSION 1,0,0,9 -#define P_VERSION "1.0.0.9" +#define F_VERSION 1,0,1,0 +#define P_VERSION "1.0.1.0" #define COPY_RIGHT " , 2021" diff --git a/src/inject/inject.vcxproj b/src/inject/inject.vcxproj index 7f7b3b3..1760752 100644 --- a/src/inject/inject.vcxproj +++ b/src/inject/inject.vcxproj @@ -113,6 +113,7 @@ Use pch.h stdcpp17 + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -139,6 +140,7 @@ MultiThreaded false stdcpp17 + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -167,6 +169,7 @@ Use pch.h stdcpp17 + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -193,6 +196,7 @@ MultiThreaded false stdcpp17 + /Zc:threadSafeInit- %(AdditionalOptions) Windows diff --git a/src/lib/core_as/Debug/x64/core_as.exp b/src/lib/core_as/Debug/x64/core_as.exp index 7b68dd2dc0cb622ab49da30e523d25f1667b7709..2b8b36b4246a8d5597cdf6f64d051f4a779a7481 100644 GIT binary patch delta 31 ncmX>bbv9~4p8)gLQijPB1*R|?8XIrc5d6W#xOKCljE*1x$SMl` delta 31 ncmX>bbv9~4p8#`MDdXgc0#ld`jLkP|2>#$=4BM11zoS$2umze_6F28xDez6Py?PDjT delta 102 zcmbO;gK^Fb#tk0YEHdpYeopq$-oO|(`M<8lWK|s_Aj?2cdUCPOf6nPgf85^5z`(#X vIZ#`A@-*EHuqp$viV7A%gAK75?IQ`xOH=d^i2T(z>^ED delta 31 ncmcZ@aWP_pg#dF{DdS{ofho)e#^#$Z2`uGe4BK2GeNzAcwh9XK diff --git a/src/lib/core_as/Debug/x86/core_as.lib b/src/lib/core_as/Debug/x86/core_as.lib index ffd02c790ded43b4ac727c653db12c1ab0cb6f9b..d9c581da3b1bc2f423ff626152dd73db5577f027 100644 GIT binary patch delta 94 zcmaDeh4IZ4#tnZoS%M$;9G#@KfpP2PjapHRTQ~D)OEI##Eqix(=j23P`N>{78DJ?5 tPKV_D+ycGKl&zC_w52Ei*NJ6GJiPwtBAO4wu`ZRyGXbz)hzeSLLea)K^Mub`d^kOWF>4%CyD0RUKaB#r<8 diff --git a/src/lib/core_as/Release/x64/core_as.exp b/src/lib/core_as/Release/x64/core_as.exp index 248ba5b3907d8e416c62ab9700673623562f668e..1b1a0543660172f2bd9224189c5816d699075a87 100644 GIT binary patch delta 31 ncmX>fbv|mt1Oeu)r3{lN3rt})G&bI>CHRAjaqDJf8680Y$r=j@ delta 31 ncmX>fbv|mt1Oeu-QpU-X1*R|?7@Kd_68yo%7`9niMn@0;zL5$~ diff --git a/src/lib/core_as/Release/x64/core_as.lib b/src/lib/core_as/Release/x64/core_as.lib index a4a608c19cf80ef4d37ef28118bee479cc725c35..58b7b0f828817896082ffb60f314329d5d10254a 100644 GIT binary patch delta 102 zcmbO;gK^Fb#tk0YEQU&xo=*1B-oUtZ@_${8$*MX=K$d}?^yFfl|D2OnWnJINz`(#X vIZ#`A@-*EHuqp$viV7C%J?l11zoS$2umze_6F28xDez6Py?PDjT delta 102 zcmbO;gK^Fb#tk0YEHdpYeopq$-oO|(`M<8lWK|s_Aj?2cdUCPOf6nPgf85^5z`(#X vIZ#`A@-*EHuqp$viV7A%gAKqbBQijR40#ld`jg2>75m?H_xOH=t^i2T(!GjCA delta 31 ncmcZ{aXDgxl>l>CDdS{Yfho)e#^#%^2rT7d4BK2KeNzAcw)zVH diff --git a/src/lib/core_as/Release/x86/core_as.lib b/src/lib/core_as/Release/x86/core_as.lib index 0de709dd73a7044aedb4d5b61fe5af762ed61f9b..9505615903d30b777e3097bcfe8dd4cbb69fd292 100644 GIT binary patch delta 94 zcmaDeh4IZ4#tnZoS%M$;9G#@KfpP2PjapHRTQ~D)OEI##Eqix(=j23P`N>{78DJ?5 tPKV_D+ycGKl&zC_w52Ei*NJ6GJiPwtBAO4wu`ZRyGXbz)hzeSLLea)K^Mub`d^kOWF>4%CyD0RUKaB#r<8 diff --git a/src/runner/runner.vcxproj b/src/runner/runner.vcxproj index 36e77e1..5d20639 100644 --- a/src/runner/runner.vcxproj +++ b/src/runner/runner.vcxproj @@ -74,6 +74,7 @@ true $(SolutionDir)_build\$(Configuration)\lib\$(PlatformTarget)\ $(SolutionDir)_build\objs\$(Configuration)\$(PlatformTarget)\$(ProjectName)\ + coreas_$(ProjectName)_c false @@ -85,6 +86,7 @@ true $(SolutionDir)_build\$(Configuration)\lib\$(PlatformTarget)\ $(SolutionDir)_build\objs\$(Configuration)\$(PlatformTarget)\$(ProjectName)\ + coreas_$(ProjectName)_c false @@ -96,15 +98,16 @@ Level3 false - NDEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions) + _DEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions) true $(ProjectDir)..\include\;%(AdditionalIncludeDirectories) stdcpp17 Default - MultiThreaded + MultiThreadedDebug true Default - false + true + /Zc:threadSafeInit- %(AdditionalOptions) Console @@ -132,6 +135,7 @@ true MultiThreaded false + /Zc:threadSafeInit- %(AdditionalOptions) Console @@ -154,15 +158,16 @@ Level3 false - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true $(ProjectDir)..\include\;%(AdditionalIncludeDirectories) stdcpp17 Default true Default - MultiThreaded - false + MultiThreadedDebug + true + /Zc:threadSafeInit- %(AdditionalOptions) Console @@ -187,6 +192,7 @@ true MultiThreaded false + /Zc:threadSafeInit- %(AdditionalOptions) Console diff --git a/src/starter/modules_list.cpp b/src/starter/modules_list.cpp index 6eaca41..98a91f0 100644 --- a/src/starter/modules_list.cpp +++ b/src/starter/modules_list.cpp @@ -31,45 +31,44 @@ struct LoadModuleInfo { }; stringw parseArguments(ssw args) { - return stringw::join(core_as_parseArguments(args), L"\v").replace(L"\"\"", L"\""); + return stringw{ eew & e_repl(lstringw<500>::join(core_as_parseArguments(args), L"\v").to_str(), L"\"\"", L"\"") }; } void processFile(const wchar_t* filePath, vector& modules) { - lstringw<0x200> sectionNames; - lstringsw<0x200> buffer; - sectionNames << [filePath](wchar_t* p, unsigned s) { + lstringw<0x200> sectionNames{ [filePath](wchar_t* p, unsigned s) { return grow2(GetPrivateProfileString(NULL, NULL, NULL, p, s + 1, filePath), s - 1); - }; + } }; + lstringsw<0x200> buffer; for (const wchar_t* section = sectionNames; *section; section += char_traits::length(section) + 1) { - buffer << [&](wchar_t* p, unsigned s) { + buffer << [&](wchar_t* p, uint s) { return grow2(GetPrivateProfileString(section, L"modul", NULL, p, s + 1, filePath), s); }; if (!buffer) continue; - stringw modulName(move(buffer)); + stringw modulName{ move(buffer) }; - auto procList = (buffer << [&](wchar_t* p, unsigned s) { + auto procList = (buffer << [&](wchar_t* p, uint s) { return grow2(GetPrivateProfileString(section, L"proc", NULL, p, s + 1, filePath), s); - }).splitf>(L",", trim_w()); + }).splitf>(L",", trim_w{}); if (procList.empty()) continue; - LoadModuleInfo info(move(modulName), move(procList)); + LoadModuleInfo info{ move(modulName), move(procList) }; - auto lib = (buffer << [&](wchar_t* p, unsigned s) { + auto lib = (buffer << [&](wchar_t* p, uint s) { return grow2(GetPrivateProfileString(section, L"test", NULL, p, s + 1, filePath), s); - }).splitf>(L",", trim_w()); + }).splitf>(L",", trim_w{}); if (lib.size() == 2) { info.testLib = move(lib[0]); info.testFunc = move(lib[1]); } - info.args = parseArguments(buffer << [&](wchar_t* p, unsigned s) { + info.args = parseArguments(buffer << [&](wchar_t* p, uint s) { return grow2(GetPrivateProfileString(section, L"args", NULL, p, s, filePath), s); }); - info.defs = parseArguments(buffer << [&](wchar_t* p, unsigned s) { + info.defs = parseArguments(buffer << [&](wchar_t* p, uint s) { return grow2(GetPrivateProfileString(section, L"defs", NULL, p, s, filePath), s); }); modules.emplace_back(move(info)); diff --git a/src/starter/starter.vcxproj b/src/starter/starter.vcxproj index 7279ed0..58aa8f4 100644 --- a/src/starter/starter.vcxproj +++ b/src/starter/starter.vcxproj @@ -114,6 +114,7 @@ pch.h stdcpp17 MultiThreadedDebug + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -128,7 +129,7 @@ robocopy ..\modules\starter "$(OutDir)modules\starter" /mir /im /NJH /NJS /NP -runner check starter +$(OutDir)lib\x86\coreas_runner_c check starter exit 0 @@ -157,6 +158,7 @@ exit 0 stdcpp17 Full true + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -181,7 +183,7 @@ exit 0 robocopy ..\modules\starter "$(OutDir)modules\starter" /mir /im /NJH /NJS /NP -coreas_runner_c check starter +$(OutDir)lib\x86\coreas_runner_c check starter exit 0 @@ -201,6 +203,7 @@ exit 0 Use pch.h stdcpp17 + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -225,6 +228,7 @@ exit 0 false stdcpp17 true + /Zc:threadSafeInit- %(AdditionalOptions) Windows diff --git a/src/wrunner/wrunner.vcxproj b/src/wrunner/wrunner.vcxproj index 3dfcb78..b2f7c22 100644 --- a/src/wrunner/wrunner.vcxproj +++ b/src/wrunner/wrunner.vcxproj @@ -74,6 +74,7 @@ true $(SolutionDir)_build\$(Configuration)\lib\$(PlatformTarget)\ $(SolutionDir)_build\objs\$(Configuration)\$(PlatformTarget)\$(ProjectName)\ + coreas_runner_w false @@ -85,6 +86,7 @@ true $(SolutionDir)_build\$(Configuration)\lib\$(PlatformTarget)\ $(SolutionDir)_build\objs\$(Configuration)\$(PlatformTarget)\$(ProjectName)\ + coreas_runner_w false @@ -96,18 +98,19 @@ Level3 false - NDEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions) + _DEBUG;WIN32;_CONSOLE;%(PreprocessorDefinitions) true $(ProjectDir)..\include\;%(AdditionalIncludeDirectories) stdcpp17 Default - MultiThreaded + MultiThreadedDebug true Default - false + true + /Zc:threadSafeInit- %(AdditionalOptions) - Console + Windows true $(SolutionDir)src\lib\core_as\$(Configuration)\$(PlatformTarget) core_as.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -132,6 +135,7 @@ true MultiThreaded false + /Zc:threadSafeInit- %(AdditionalOptions) Windows @@ -154,18 +158,19 @@ Level3 false - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true $(ProjectDir)..\include\;%(AdditionalIncludeDirectories) stdcpp17 Default true Default - MultiThreaded - false + MultiThreadedDebug + true + /Zc:threadSafeInit- %(AdditionalOptions) - Console + Windows true $(SolutionDir)src\lib\core_as\$(Configuration)\$(PlatformTarget) core_as.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -187,6 +192,7 @@ true MultiThreaded false + /Zc:threadSafeInit- %(AdditionalOptions) Windows diff --git a/src/wrunner/wrunner.vcxproj.filters b/src/wrunner/wrunner.vcxproj.filters index f23e4f8..eb3f17e 100644 --- a/src/wrunner/wrunner.vcxproj.filters +++ b/src/wrunner/wrunner.vcxproj.filters @@ -1,12 +1,12 @@  - + - + \ No newline at end of file