More C++11ification.

This commit is contained in:
Ben Vanik
2014-07-13 22:28:00 -07:00
parent 0a250d5e91
commit e9284dfaed
40 changed files with 211 additions and 152 deletions

View File

@@ -30,12 +30,12 @@ xe_file_ref xe_file_open(const xe_file_mode mode, const xechar_t *path) {
xechar_t mode_string[10];
mode_string[0] = 0;
if (mode & kXEFileModeRead) {
XEIGNORE(xestrcat(mode_string, XECOUNT(mode_string), XT("r")));
XEIGNORE(xestrcat(mode_string, XECOUNT(mode_string), L"r"));
}
if (mode & kXEFileModeWrite) {
XEIGNORE(xestrcat(mode_string, XECOUNT(mode_string), XT("w")));
XEIGNORE(xestrcat(mode_string, XECOUNT(mode_string), L"w"));
}
XEIGNORE(xestrcat(mode_string, XECOUNT(mode_string), XT("b")));
XEIGNORE(xestrcat(mode_string, XECOUNT(mode_string), L"b"));
#if XE_LIKE_WIN32 && XE_WCHAR
XEEXPECTZERO(_wfopen_s((FILE**)&file->handle, path, mode_string));

View File

@@ -75,7 +75,7 @@ int xe_pal_get_system_info(xe_system_info* out_info) {
LPFN_GLPI glpi = NULL;
PSYSTEM_LOGICAL_PROCESSOR_INFORMATION buffer = NULL;
kernel32 = GetModuleHandle(TEXT("kernel32"));
kernel32 = GetModuleHandle(L"kernel32");
XEEXPECTNOTNULL(kernel32);
glpi = (LPFN_GLPI)GetProcAddress(kernel32, "GetLogicalProcessorInformation");
XEEXPECTNOTNULL(glpi);

View File

@@ -13,11 +13,11 @@
void xe_path_join(const xechar_t* left, const xechar_t* right,
xechar_t* out_path, size_t out_path_size) {
#if XE_WCHAR
xesnprintf(out_path, out_path_size, XT("%ls%c%ls"),
left, XE_PATH_SEPARATOR, right);
xesnprintf(out_path, out_path_size, L"%ls%c%ls",
left, poly::path_separator, right);
#else
xesnprintf(out_path, out_path_size, XT("%s%c%s"),
left, XE_PATH_SEPARATOR, right);
xesnprintf(out_path, out_path_size, L"%s%c%s",
left, poly::path_separator, right);
#endif // XE_WCHAR
}