Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/kernelbase/locale.c | 70 ++++++++++++++++++------------------ dlls/kernelbase/path.c | 2 +- dlls/kernelbase/registry.c | 3 +- dlls/kernelbase/tests/path.c | 12 +++---- dlls/kernelbase/volume.c | 10 +++--- 5 files changed, 47 insertions(+), 50 deletions(-)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 7218a159844..b60bd0dbd98 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -184,41 +184,41 @@ static const struct { UINT cp; const WCHAR *name; } codepage_names[] = /* Unicode expanded ligatures */ static const WCHAR ligatures[][5] = { - { 0x00c6, 'A','E',0 }, - { 0x00de, 'T','H',0 }, - { 0x00df, 's','s',0 }, - { 0x00e6, 'a','e',0 }, - { 0x00fe, 't','h',0 }, - { 0x0132, 'I','J',0 }, - { 0x0133, 'i','j',0 }, - { 0x0152, 'O','E',0 }, - { 0x0153, 'o','e',0 }, - { 0x01c4, 'D',0x017d,0 }, - { 0x01c5, 'D',0x017e,0 }, - { 0x01c6, 'd',0x017e,0 }, - { 0x01c7, 'L','J',0 }, - { 0x01c8, 'L','j',0 }, - { 0x01c9, 'l','j',0 }, - { 0x01ca, 'N','J',0 }, - { 0x01cb, 'N','j',0 }, - { 0x01cc, 'n','j',0 }, - { 0x01e2, 0x0100,0x0112,0 }, - { 0x01e3, 0x0101,0x0113,0 }, - { 0x01f1, 'D','Z',0 }, - { 0x01f2, 'D','z',0 }, - { 0x01f3, 'd','z',0 }, - { 0x01fc, 0x00c1,0x00c9,0 }, - { 0x01fd, 0x00e1,0x00e9,0 }, - { 0x05f0, 0x05d5,0x05d5,0 }, - { 0x05f1, 0x05d5,0x05d9,0 }, - { 0x05f2, 0x05d9,0x05d9,0 }, - { 0xfb00, 'f','f',0 }, - { 0xfb01, 'f','i',0 }, - { 0xfb02, 'f','l',0 }, - { 0xfb03, 'f','f','i',0 }, - { 0xfb04, 'f','f','l',0 }, - { 0xfb05, 0x017f,'t',0 }, - { 0xfb06, 's','t',0 }, + L"\x00c6" "AE", + L"\x00deTH", + L"\x00dfss", + L"\x00e6" "ae", + L"\x00feth", + L"\x0132IJ", + L"\x0133ij", + L"\x0152OE", + L"\x0153oe", + L"\x01c4" "D\x017d", + L"\x01c5" "D\x017e", + L"\x01c6" "d\x017e", + L"\x01c7LJ", + L"\x01c8Lj", + L"\x01c9lj", + L"\x01caNJ", + L"\x01cbNj", + L"\x01ccnj", + L"\x01e2\x0100\x0112", + L"\x01e3\x0101\x0113", + L"\x01f1" "DZ", + L"\x01f2" "Dz", + L"\x01f3" "dz", + L"\x01fc\x00c1\x00c9", + L"\x01fd\x00e1\x00e9", + L"\x05f0\x05d5\x05d5", + L"\x05f1\x05d5\x05d9", + L"\x05f2\x05d9\x05d9", + L"\xfb00" "ff", + L"\xfb01" "fi", + L"\xfb02" "fl", + L"\xfb03" "ffi", + L"\xfb04" "ffl", + L"\xfb05\x017ft", + L"\xfb06st", };
enum locationkind { LOCATION_NATION = 0, LOCATION_REGION, LOCATION_BOTH }; diff --git a/dlls/kernelbase/path.c b/dlls/kernelbase/path.c index d7e2f0a2347..f0c79bcc94c 100644 --- a/dlls/kernelbase/path.c +++ b/dlls/kernelbase/path.c @@ -2944,7 +2944,7 @@ HRESULT WINAPI UrlUnescapeW(WCHAR *url, WCHAR *unescaped, DWORD *unescaped_len, else if (*src == '%' && isxdigit(*(src + 1)) && isxdigit(*(src + 2)) && !stop_unescaping) { INT ih; - WCHAR buf[5] = {'0','x',0}; + WCHAR buf[5] = L"0x"; memcpy(buf + 2, src + 1, 2*sizeof(WCHAR)); buf[4] = 0; StrToIntExW(buf, STIF_SUPPORT_HEX, &ih); diff --git a/dlls/kernelbase/registry.c b/dlls/kernelbase/registry.c index d1588d0b265..574bf2f56b7 100644 --- a/dlls/kernelbase/registry.c +++ b/dlls/kernelbase/registry.c @@ -2775,7 +2775,6 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer /* Parse the value and load the string. */ { WCHAR *pComma = wcsrchr(pwszExpandedBuffer, ','), *pNewBuffer; - const WCHAR backslashW[] = {'\',0}; UINT uiStringId; DWORD baseDirLen; int reqChars; @@ -2802,7 +2801,7 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer if (baseDirLen) { lstrcpyW(pwszTempBuffer, pwszBaseDir); if (pwszBaseDir[baseDirLen - 1] != '\') - lstrcatW(pwszTempBuffer, backslashW); + lstrcatW(pwszTempBuffer, L"\"); } lstrcatW(pwszTempBuffer, pwszExpandedBuffer + 1);
diff --git a/dlls/kernelbase/tests/path.c b/dlls/kernelbase/tests/path.c index 2ee7b512b31..8d85542612f 100644 --- a/dlls/kernelbase/tests/path.c +++ b/dlls/kernelbase/tests/path.c @@ -546,9 +546,9 @@ static void test_PathAllocCombine(void)
static void test_PathCchCombine(void) { - WCHAR expected[PATHCCH_MAX_CCH] = {'C', ':', '\', 'a', 0}; - WCHAR p1[PATHCCH_MAX_CCH] = {'C', ':', '\', 0}; - WCHAR p2[PATHCCH_MAX_CCH] = {'a', 0}; + WCHAR expected[PATHCCH_MAX_CCH] = L"C:\a"; + WCHAR p1[PATHCCH_MAX_CCH] = L"C:\"; + WCHAR p2[PATHCCH_MAX_CCH] = L"a"; WCHAR output[PATHCCH_MAX_CCH]; HRESULT hr; INT i; @@ -607,9 +607,9 @@ static void test_PathCchCombine(void)
static void test_PathCchCombineEx(void) { - WCHAR expected[MAX_PATH] = {'C',':','\','a',0}; - WCHAR p1[MAX_PATH] = {'C',':','\',0}; - WCHAR p2[MAX_PATH] = {'a',0}; + WCHAR expected[MAX_PATH] = L"C:\a"; + WCHAR p1[MAX_PATH] = L"C:\"; + WCHAR p2[MAX_PATH] = L"a"; WCHAR output[MAX_PATH]; HRESULT hr; int i; diff --git a/dlls/kernelbase/volume.c b/dlls/kernelbase/volume.c index 53cc0d49b65..7daf9c98823 100644 --- a/dlls/kernelbase/volume.c +++ b/dlls/kernelbase/volume.c @@ -152,7 +152,6 @@ static DWORD get_mountmgr_drive_type( LPCWSTR root ) /* get the label by reading it from a file at the root of the filesystem */ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DWORD len ) { - static const WCHAR labelW[] = {'.','w','i','n','d','o','w','s','-','l','a','b','e','l',0}; HANDLE handle; UNICODE_STRING name; IO_STATUS_BLOCK io; @@ -167,12 +166,12 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL;
- name.MaximumLength = device->Length + sizeof(labelW); + name.MaximumLength = device->Length + sizeof(L".windows-label"); name.Length = name.MaximumLength - sizeof(WCHAR); if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return;
memcpy( name.Buffer, device->Buffer, device->Length ); - memcpy( name.Buffer + device->Length / sizeof(WCHAR), labelW, sizeof(labelW) ); + memcpy( name.Buffer + device->Length / sizeof(WCHAR), L".windows-label", sizeof(L".windows-label") ); if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT )) { @@ -193,7 +192,6 @@ static void get_filesystem_label( const UNICODE_STRING *device, WCHAR *label, DW /* get the serial number by reading it from a file at the root of the filesystem */ static DWORD get_filesystem_serial( const UNICODE_STRING *device ) { - static const WCHAR serialW[] = {'.','w','i','n','d','o','w','s','-','s','e','r','i','a','l',0}; HANDLE handle; UNICODE_STRING name; IO_STATUS_BLOCK io; @@ -207,12 +205,12 @@ static DWORD get_filesystem_serial( const UNICODE_STRING *device ) attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL;
- name.MaximumLength = device->Length + sizeof(serialW); + name.MaximumLength = device->Length + sizeof(L".windows-serial"); name.Length = name.MaximumLength - sizeof(WCHAR); if (!(name.Buffer = HeapAlloc( GetProcessHeap(), 0, name.MaximumLength ))) return 0;
memcpy( name.Buffer, device->Buffer, device->Length ); - memcpy( name.Buffer + device->Length / sizeof(WCHAR), serialW, sizeof(serialW) ); + memcpy( name.Buffer + device->Length / sizeof(WCHAR), L".windows-serial", sizeof(L".windows-serial") ); if (!NtOpenFile( &handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_SYNCHRONOUS_IO_NONALERT )) {
Michael Stefaniuc mstefani@winehq.org wrote:
/* Unicode expanded ligatures */ static const WCHAR ligatures[][5] = {
- { 0x00c6, 'A','E',0 },
- { 0x00de, 'T','H',0 },
- { 0x00df, 's','s',0 },
- { 0x00e6, 'a','e',0 },
- { 0x00fe, 't','h',0 },
- { 0x0132, 'I','J',0 },
- { 0x0133, 'i','j',0 },
- { 0x0152, 'O','E',0 },
- { 0x0153, 'o','e',0 },
- { 0x01c4, 'D',0x017d,0 },
- { 0x01c5, 'D',0x017e,0 },
- { 0x01c6, 'd',0x017e,0 },
- { 0x01c7, 'L','J',0 },
- { 0x01c8, 'L','j',0 },
- { 0x01c9, 'l','j',0 },
- { 0x01ca, 'N','J',0 },
- { 0x01cb, 'N','j',0 },
- { 0x01cc, 'n','j',0 },
- { 0x01e2, 0x0100,0x0112,0 },
- { 0x01e3, 0x0101,0x0113,0 },
- { 0x01f1, 'D','Z',0 },
- { 0x01f2, 'D','z',0 },
- { 0x01f3, 'd','z',0 },
- { 0x01fc, 0x00c1,0x00c9,0 },
- { 0x01fd, 0x00e1,0x00e9,0 },
- { 0x05f0, 0x05d5,0x05d5,0 },
- { 0x05f1, 0x05d5,0x05d9,0 },
- { 0x05f2, 0x05d9,0x05d9,0 },
- { 0xfb00, 'f','f',0 },
- { 0xfb01, 'f','i',0 },
- { 0xfb02, 'f','l',0 },
- { 0xfb03, 'f','f','i',0 },
- { 0xfb04, 'f','f','l',0 },
- { 0xfb05, 0x017f,'t',0 },
- { 0xfb06, 's','t',0 },
- L"\x00c6" "AE",
- L"\x00deTH",
- L"\x00dfss",
- L"\x00e6" "ae",
- L"\x00feth",
- L"\x0132IJ",
- L"\x0133ij",
- L"\x0152OE",
- L"\x0153oe",
- L"\x01c4" "D\x017d",
- L"\x01c5" "D\x017e",
- L"\x01c6" "d\x017e",
- L"\x01c7LJ",
- L"\x01c8Lj",
- L"\x01c9lj",
- L"\x01caNJ",
- L"\x01cbNj",
- L"\x01ccnj",
- L"\x01e2\x0100\x0112",
- L"\x01e3\x0101\x0113",
- L"\x01f1" "DZ",
- L"\x01f2" "Dz",
- L"\x01f3" "dz",
- L"\x01fc\x00c1\x00c9",
- L"\x01fd\x00e1\x00e9",
- L"\x05f0\x05d5\x05d5",
- L"\x05f1\x05d5\x05d9",
- L"\x05f2\x05d9\x05d9",
- L"\xfb00" "ff",
- L"\xfb01" "fi",
- L"\xfb02" "fl",
- L"\xfb03" "ffi",
- L"\xfb04" "ffl",
- L"\xfb05\x017ft",
- L"\xfb06st",
};
This change defeats the purpose of the table, and makes it unreadble.