forked from H-uru/Plasma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request H-uru#1378 from dgelessus/remove_headspin_wstring_…
…functions Remove last uses of `hsStringToWString` and `hsWStringToString`
- Loading branch information
Showing
8 changed files
with
4 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email [email protected] | |
*==LICENSE==*/ | ||
#include "HeadSpin.h" | ||
#include "hsWindows.h" | ||
#include <wchar.h> | ||
|
||
#ifdef _MSC_VER | ||
# include <crtdbg.h> | ||
|
@@ -437,42 +436,3 @@ char* hsStrcpy(char* dst, const char* src) | |
|
||
return dst; | ||
} | ||
|
||
//// IStringToWString ///////////////////////////////////////////////////////// | ||
// Converts a char * string to a wchar_t * string | ||
|
||
wchar_t *hsStringToWString( const char *str ) | ||
{ | ||
// convert the char string to a wchar_t string | ||
size_t len = strlen(str); | ||
wchar_t *wideString = new wchar_t[len+1]; | ||
for (size_t i = 0; i < len; i++) | ||
wideString[i] = btowc(str[i]); | ||
wideString[len] = L'\0'; | ||
return wideString; | ||
} | ||
|
||
//// IWStringToString ///////////////////////////////////////////////////////// | ||
// Converts a wchar_t * string to a char * string | ||
|
||
char *hsWStringToString( const wchar_t *str ) | ||
{ | ||
// convert the wchar_t string to a char string | ||
size_t len = wcslen(str); | ||
char *sStr = new char[len+1]; | ||
|
||
for (size_t i = 0; i < len; i++) | ||
{ | ||
char temp = wctob(str[i]); | ||
if (temp == EOF) | ||
{ | ||
sStr[i] = '\0'; | ||
i = len; | ||
} | ||
else | ||
sStr[i] = temp; | ||
} | ||
sStr[len] = '\0'; | ||
|
||
return sStr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters