mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-20 16:37:03 +00:00
Replace basic_string<> of betype with std::vector (#1601)
This commit is contained in:
parent
2f02fda9ea
commit
c8ffff8f41
6 changed files with 25 additions and 17 deletions
|
|
@ -132,7 +132,7 @@ namespace iosu
|
|||
|
||||
void convertMultiByteStringToBigEndianWidechar(const char* input, uint16be* output, sint32 maxOutputLength)
|
||||
{
|
||||
std::basic_string<uint16be> beStr = StringHelpers::FromUtf8(input);
|
||||
std::vector<uint16be> beStr = StringHelpers::FromUtf8(input);
|
||||
if (beStr.size() >= maxOutputLength - 1)
|
||||
beStr.resize(maxOutputLength-1);
|
||||
for (size_t i = 0; i < beStr.size(); i++)
|
||||
|
|
@ -723,7 +723,7 @@ namespace iosu
|
|||
{
|
||||
if(numVecIn != 0 || numVecOut != 1)
|
||||
return FPResult_InvalidIPCParam;
|
||||
std::basic_string<uint16be> myComment;
|
||||
std::vector<uint16be> myComment;
|
||||
if(g_fpd.nexFriendSession)
|
||||
{
|
||||
if(vecOut->size != MY_COMMENT_LENGTH * sizeof(uint16be))
|
||||
|
|
@ -735,8 +735,8 @@ namespace iosu
|
|||
g_fpd.nexFriendSession->getMyComment(myNexComment);
|
||||
myComment = StringHelpers::FromUtf8(myNexComment.commentString);
|
||||
}
|
||||
myComment.insert(0, 1, '\0');
|
||||
memcpy(vecOut->basePhys.GetPtr(), myComment.c_str(), MY_COMMENT_LENGTH * sizeof(uint16be));
|
||||
myComment.insert(myComment.begin(), '\0');
|
||||
memcpy(vecOut->basePhys.GetPtr(), myComment.data(), MY_COMMENT_LENGTH * sizeof(uint16be));
|
||||
return FPResult_Ok;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue