Implemented some sys_prx syscalls

Fixed vm::ptr

Conflicts:
	Utilities/BEType.h
	Utilities/StrFmt.cpp
	rpcs3/Emu/Memory/vm_ptr.h
	rpcs3/Emu/SysCalls/lv2/sys_prx.cpp
	rpcs3/Emu/SysCalls/lv2/sys_prx.h

Cherry-picked commit "Implemented some sys_prx syscalls"
This commit is contained in:
DHrpcs3 2015-04-01 02:49:39 +03:00 committed by Nekotekina
parent b84d831d8f
commit 39e679806b
10 changed files with 273 additions and 172 deletions

View file

@ -874,7 +874,7 @@ template<typename T, typename T1, T1 value> struct _se<be_t<T>, T1, value> : pub
template<typename Tto, typename Tfrom>
struct convert_le_be_t
{
static Tto func(Tfrom&& value)
static Tto func(Tfrom value)
{
return (Tto)value;
}
@ -883,7 +883,7 @@ struct convert_le_be_t
template<typename Tt, typename Tt1, typename Tfrom>
struct convert_le_be_t<be_t<Tt, Tt1>, Tfrom>
{
static be_t<Tt, Tt1> func(Tfrom&& value)
static be_t<Tt, Tt1> func(Tfrom value)
{
return be_t<Tt, Tt1>::make(value);
}
@ -892,7 +892,7 @@ struct convert_le_be_t<be_t<Tt, Tt1>, Tfrom>
template<typename Tt, typename Tt1, typename Tf, typename Tf1>
struct convert_le_be_t<be_t<Tt, Tt1>, be_t<Tf, Tf1>>
{
static be_t<Tt, Tt1> func(be_t<Tf, Tf1>&& value)
static be_t<Tt, Tt1> func(be_t<Tf, Tf1> value)
{
return value;
}
@ -901,20 +901,20 @@ struct convert_le_be_t<be_t<Tt, Tt1>, be_t<Tf, Tf1>>
template<typename Tto, typename Tf, typename Tf1>
struct convert_le_be_t<Tto, be_t<Tf, Tf1>>
{
static Tto func(be_t<Tf, Tf1>&& value)
static Tto func(be_t<Tf, Tf1> value)
{
return value.value();
}
};
template<typename Tto, typename Tfrom>
force_inline Tto convert_le_be(Tfrom&& value)
force_inline Tto convert_le_be(Tfrom value)
{
return convert_le_be_t<Tto, Tfrom>::func(value);
}
template<typename Tto, typename Tfrom>
force_inline void convert_le_be(Tto& dst, Tfrom&& src)
force_inline void convert_le_be(Tto& dst, Tfrom src)
{
dst = convert_le_be_t<Tto, Tfrom>::func(src);
}

View file

@ -208,49 +208,6 @@ std::vector<std::string> fmt::split(const std::string& source, std::initializer_
return std::move(result);
}
std::string fmt::merge(std::vector<std::string> source, const std::string& separator)
{
if (!source.size())
{
return "";
}
std::string result;
for (int i = 0; i < source.size() - 1; ++i)
{
result += source[i] + separator;
}
return result + source.back();
}
std::string fmt::merge(std::initializer_list<std::vector<std::string>> sources, const std::string& separator)
{
if (!sources.size())
{
return "";
}
std::string result;
bool first = true;
for (auto &v : sources)
{
if (first)
{
result = fmt::merge(v, separator);
first = false;
}
else
{
result += separator + fmt::merge(v, separator);
}
}
return result;
}
std::string fmt::tolower(std::string source)
{
std::transform(source.begin(), source.end(), source.begin(), ::tolower);

View file

@ -289,8 +289,54 @@ namespace fmt
std::vector<std::string> rSplit(const std::string& source, const std::string& delim);
std::vector<std::string> split(const std::string& source, std::initializer_list<std::string> separators, bool is_skip_empty = true);
std::string merge(std::vector<std::string> source, const std::string& separator);
std::string merge(std::initializer_list<std::vector<std::string>> sources, const std::string& separator);
template<typename T>
std::string merge(const T& source, const std::string& separator)
{
if (!source.size())
{
return{};
}
std::string result;
auto it = source.begin();
auto end = source.end();
for (--end; it != end; ++it)
{
result += *it + separator;
}
return result + source.back();
}
template<typename T>
std::string merge(std::initializer_list<T> sources, const std::string& separator)
{
if (!sources.size())
{
return{};
}
std::string result;
bool first = true;
for (auto &v : sources)
{
if (first)
{
result = fmt::merge(v, separator);
first = false;
}
else
{
result += separator + fmt::merge(v, separator);
}
}
return result;
}
std::string tolower(std::string source);
std::string toupper(std::string source);
std::string escape(std::string source);