mirror of https://github.com/RPCS3/rpcs3.git
commit
4c52b65374
|
@ -157,7 +157,7 @@ std::string fmt::detail::format(const char* fmt, size_t len)
|
||||||
|
|
||||||
extern const std::string fmt::placeholder = "???";
|
extern const std::string fmt::placeholder = "???";
|
||||||
|
|
||||||
std::string replace_first(const std::string& src, const std::string& from, const std::string& to)
|
std::string fmt::replace_first(const std::string& src, const std::string& from, const std::string& to)
|
||||||
{
|
{
|
||||||
auto pos = src.find(from);
|
auto pos = src.find(from);
|
||||||
|
|
||||||
|
@ -169,11 +169,12 @@ std::string replace_first(const std::string& src, const std::string& from, const
|
||||||
return (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
|
return (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string replace_all(std::string src, const std::string& from, const std::string& to)
|
std::string fmt::replace_all(const std::string &src, const std::string& from, const std::string& to)
|
||||||
{
|
{
|
||||||
for (auto pos = src.find(from); pos != std::string::npos; src.find(from, pos + 1))
|
std::string target = src;
|
||||||
|
for (auto pos = target.find(from); pos != std::string::npos; pos = target.find(from, pos + 1))
|
||||||
{
|
{
|
||||||
src = (pos ? src.substr(0, pos) + to : to) + std::string(src.c_str() + pos + from.length());
|
target = (pos ? target.substr(0, pos) + to : to) + std::string(target.c_str() + pos + from.length());
|
||||||
pos += to.length();
|
pos += to.length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace fmt
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);
|
std::string replace_first(const std::string& src, const std::string& from, const std::string& to);
|
||||||
std::string replace_all(std::string src, const std::string& from, const std::string& to);
|
std::string replace_all(const std::string &src, const std::string& from, const std::string& to);
|
||||||
|
|
||||||
template<size_t list_size>
|
template<size_t list_size>
|
||||||
std::string replace_all(std::string src, const std::pair<std::string, std::string>(&list)[list_size])
|
std::string replace_all(std::string src, const std::pair<std::string, std::string>(&list)[list_size])
|
||||||
|
|
|
@ -1004,6 +1004,7 @@ s32 cellGcmUnmapIoAddress(u64 io)
|
||||||
{
|
{
|
||||||
u64 ea;
|
u64 ea;
|
||||||
io = io >> 20;
|
io = io >> 20;
|
||||||
|
size = size >> 20;
|
||||||
ea = offsetTable.eaAddress[io];
|
ea = offsetTable.eaAddress[io];
|
||||||
|
|
||||||
for (u32 i = 0; i<size; i++)
|
for (u32 i = 0; i<size; i++)
|
||||||
|
|
|
@ -235,11 +235,17 @@ s32 cellFsStat(vm::ptr<const char> path, vm::ptr<CellFsStat> sb)
|
||||||
|
|
||||||
Emu.GetVFS().GetDevice(_path, real_path);
|
Emu.GetVFS().GetDevice(_path, real_path);
|
||||||
|
|
||||||
|
int stat_result;
|
||||||
|
#ifdef _WIN32
|
||||||
|
struct _stat64 buf;
|
||||||
|
stat_result = _stat64(real_path.c_str(), &buf);
|
||||||
|
#elif
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
stat_result = stat(real_path.c_str(), &buf);
|
||||||
if (int result = stat(real_path.c_str(), &buf))
|
#endif
|
||||||
|
if (stat_result)
|
||||||
{
|
{
|
||||||
sys_fs->Error("cellFsStat(): stat('%s') failed -> 0x%x", real_path.c_str(), result);
|
sys_fs->Error("cellFsStat(): stat('%s') failed -> 0x%x", real_path.c_str(), stat_result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue