mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-25 04:04:26 -04:00
[misc] update msapi_utf8.h for C++ compilation
* Pure C++ compilers may throw cast errors.
This commit is contained in:
parent
c86a62ed69
commit
ffa573ba5c
2 changed files with 12 additions and 12 deletions
|
@ -87,7 +87,7 @@ static __inline char* wchar_to_utf8(const wchar_t* wstr)
|
||||||
|
|
||||||
// Convert the empty string too
|
// Convert the empty string too
|
||||||
if (wstr[0] == 0)
|
if (wstr[0] == 0)
|
||||||
return calloc(1, 1);
|
return (char*)calloc(1, 1);
|
||||||
|
|
||||||
// Find out the size we need to allocate for our converted string
|
// Find out the size we need to allocate for our converted string
|
||||||
size = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
|
size = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, NULL, 0, NULL, NULL);
|
||||||
|
@ -119,7 +119,7 @@ static __inline wchar_t* utf8_to_wchar(const char* str)
|
||||||
|
|
||||||
// Convert the empty string too
|
// Convert the empty string too
|
||||||
if (str[0] == 0)
|
if (str[0] == 0)
|
||||||
return calloc(1, sizeof(wchar_t));
|
return (wchar_t*)calloc(1, sizeof(wchar_t));
|
||||||
|
|
||||||
// Find out the size we need to allocate for our converted string
|
// Find out the size we need to allocate for our converted string
|
||||||
size = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
|
size = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
|
||||||
|
@ -367,7 +367,7 @@ static __inline int GetWindowTextLengthU(HWND hWnd)
|
||||||
ret = GetWindowTextLengthW(hWnd);
|
ret = GetWindowTextLengthW(hWnd);
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
if (ret == 0) goto out;
|
if (ret == 0) goto out;
|
||||||
wbuf = calloc(ret, sizeof(wchar_t));
|
wbuf = (wchar_t* )calloc(ret, sizeof(wchar_t));
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
if (wbuf == NULL) {
|
if (wbuf == NULL) {
|
||||||
err = ERROR_OUTOFMEMORY; ret = 0; goto out;
|
err = ERROR_OUTOFMEMORY; ret = 0; goto out;
|
||||||
|
@ -452,7 +452,7 @@ static __inline int ComboBox_GetLBTextU(HWND hCtrl, int index, char* lpString)
|
||||||
static __inline DWORD CharUpperBuffU(char* lpString, DWORD len)
|
static __inline DWORD CharUpperBuffU(char* lpString, DWORD len)
|
||||||
{
|
{
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
wchar_t *wlpString = calloc(len, sizeof(wchar_t));
|
wchar_t *wlpString = (wchar_t*)calloc(len, sizeof(wchar_t));
|
||||||
if (wlpString == NULL)
|
if (wlpString == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
utf8_to_wchar_no_alloc(lpString, wlpString, len);
|
utf8_to_wchar_no_alloc(lpString, wlpString, len);
|
||||||
|
@ -878,10 +878,10 @@ static __inline BOOL WINAPI GetOpenSaveFileNameU(LPOPENFILENAMEA lpofn, BOOL sav
|
||||||
}
|
}
|
||||||
wofn.nMaxCustFilter = lpofn->nMaxCustFilter;
|
wofn.nMaxCustFilter = lpofn->nMaxCustFilter;
|
||||||
wofn.nFilterIndex = lpofn->nFilterIndex;
|
wofn.nFilterIndex = lpofn->nFilterIndex;
|
||||||
wofn.lpstrFile = calloc(lpofn->nMaxFile, sizeof(wchar_t));
|
wofn.lpstrFile = (LPWSTR)calloc(lpofn->nMaxFile, sizeof(wchar_t));
|
||||||
utf8_to_wchar_no_alloc(lpofn->lpstrFile, wofn.lpstrFile, lpofn->nMaxFile);
|
utf8_to_wchar_no_alloc(lpofn->lpstrFile, wofn.lpstrFile, lpofn->nMaxFile);
|
||||||
wofn.nMaxFile = lpofn->nMaxFile;
|
wofn.nMaxFile = lpofn->nMaxFile;
|
||||||
wofn.lpstrFileTitle = calloc(lpofn->nMaxFileTitle, sizeof(wchar_t));
|
wofn.lpstrFileTitle = (LPWSTR)calloc(lpofn->nMaxFileTitle, sizeof(wchar_t));
|
||||||
utf8_to_wchar_no_alloc(lpofn->lpstrFileTitle, wofn.lpstrFileTitle, lpofn->nMaxFileTitle);
|
utf8_to_wchar_no_alloc(lpofn->lpstrFileTitle, wofn.lpstrFileTitle, lpofn->nMaxFileTitle);
|
||||||
wofn.nMaxFileTitle = lpofn->nMaxFileTitle;
|
wofn.nMaxFileTitle = lpofn->nMaxFileTitle;
|
||||||
wofn.lpstrInitialDir = utf8_to_wchar(lpofn->lpstrInitialDir);
|
wofn.lpstrInitialDir = utf8_to_wchar(lpofn->lpstrInitialDir);
|
||||||
|
@ -1050,7 +1050,7 @@ static __inline char* getenvU(const char* varname)
|
||||||
wchar_t* wbuf = NULL;
|
wchar_t* wbuf = NULL;
|
||||||
// _wgetenv() is *BROKEN* in MS compilers => use GetEnvironmentVariableW()
|
// _wgetenv() is *BROKEN* in MS compilers => use GetEnvironmentVariableW()
|
||||||
DWORD dwSize = GetEnvironmentVariableW(wvarname, wbuf, 0);
|
DWORD dwSize = GetEnvironmentVariableW(wvarname, wbuf, 0);
|
||||||
wbuf = calloc(dwSize, sizeof(wchar_t));
|
wbuf = (wchar_t*)calloc(dwSize, sizeof(wchar_t));
|
||||||
if (wbuf == NULL) {
|
if (wbuf == NULL) {
|
||||||
wfree(varname);
|
wfree(varname);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
IDD_DIALOG DIALOGEX 12, 12, 232, 326
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 3.10.1630"
|
CAPTION "Rufus 3.10.1631"
|
||||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
|
||||||
|
@ -395,8 +395,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 3,10,1630,0
|
FILEVERSION 3,10,1631,0
|
||||||
PRODUCTVERSION 3,10,1630,0
|
PRODUCTVERSION 3,10,1631,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -414,13 +414,13 @@ BEGIN
|
||||||
VALUE "Comments", "https://rufus.ie"
|
VALUE "Comments", "https://rufus.ie"
|
||||||
VALUE "CompanyName", "Akeo Consulting"
|
VALUE "CompanyName", "Akeo Consulting"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "3.10.1630"
|
VALUE "FileVersion", "3.10.1631"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2020 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
|
||||||
VALUE "OriginalFilename", "rufus-3.10.exe"
|
VALUE "OriginalFilename", "rufus-3.10.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "3.10.1630"
|
VALUE "ProductVersion", "3.10.1631"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue