diff options
Diffstat (limited to 'C/Util')
| -rw-r--r-- | C/Util/7z/7zMain.c | 7 | ||||
| -rw-r--r-- | C/Util/7zipInstall/7zipInstall.c | 38 | ||||
| -rw-r--r-- | C/Util/7zipUninstall/7zipUninstall.c | 58 | ||||
| -rw-r--r-- | C/Util/SfxSetup/SfxSetup.c | 14 |
4 files changed, 61 insertions, 56 deletions
diff --git a/C/Util/7z/7zMain.c b/C/Util/7z/7zMain.c index 7048b66..300c363 100644 --- a/C/Util/7z/7zMain.c +++ b/C/Util/7z/7zMain.c | |||
| @@ -960,7 +960,12 @@ int Z7_CDECL main(int numargs, char *args[]) | |||
| 960 | if (listCommand == 0 && isDir && !fullPaths) | 960 | if (listCommand == 0 && isDir && !fullPaths) |
| 961 | continue; | 961 | continue; |
| 962 | len = SzArEx_GetFileNameUtf16(&db, i, NULL); | 962 | len = SzArEx_GetFileNameUtf16(&db, i, NULL); |
| 963 | // len = SzArEx_GetFullNameLen(&db, i); | 963 | |
| 964 | if (len > (1u << 20)) | ||
| 965 | { | ||
| 966 | res = SZ_ERROR_UNSUPPORTED; | ||
| 967 | break; | ||
| 968 | } | ||
| 964 | 969 | ||
| 965 | if (len > tempSize) | 970 | if (len > tempSize) |
| 966 | { | 971 | { |
diff --git a/C/Util/7zipInstall/7zipInstall.c b/C/Util/7zipInstall/7zipInstall.c index 7d8e8c4..ce30732 100644 --- a/C/Util/7zipInstall/7zipInstall.c +++ b/C/Util/7zipInstall/7zipInstall.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* 7zipInstall.c - 7-Zip Installer | 1 | /* 7zipInstall.c - 7-Zip Installer |
| 2 | 2024-04-05 : Igor Pavlov : Public domain */ | 2 | : Igor Pavlov : Public domain */ |
| 3 | 3 | ||
| 4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
| 5 | 5 | ||
| @@ -142,7 +142,7 @@ static WCHAR path[MAX_PATH * 2 + 40]; | |||
| 142 | 142 | ||
| 143 | 143 | ||
| 144 | 144 | ||
| 145 | static void CpyAscii(wchar_t *dest, const char *s) | 145 | static void CpyAscii(WCHAR *dest, const char *s) |
| 146 | { | 146 | { |
| 147 | for (;;) | 147 | for (;;) |
| 148 | { | 148 | { |
| @@ -153,13 +153,13 @@ static void CpyAscii(wchar_t *dest, const char *s) | |||
| 153 | } | 153 | } |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | static void CatAscii(wchar_t *dest, const char *s) | 156 | static void CatAscii(WCHAR *dest, const char *s) |
| 157 | { | 157 | { |
| 158 | dest += wcslen(dest); | 158 | dest += wcslen(dest); |
| 159 | CpyAscii(dest, s); | 159 | CpyAscii(dest, s); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | static void PrintErrorMessage(const char *s1, const wchar_t *s2) | 162 | static void PrintErrorMessage(const char *s1, const WCHAR *s2) |
| 163 | { | 163 | { |
| 164 | WCHAR m[MAX_PATH + 512]; | 164 | WCHAR m[MAX_PATH + 512]; |
| 165 | m[0] = 0; | 165 | m[0] = 0; |
| @@ -196,7 +196,7 @@ static DWORD GetFileVersion(LPCWSTR s) | |||
| 196 | 196 | ||
| 197 | if (!g_version_dll_hModule) | 197 | if (!g_version_dll_hModule) |
| 198 | { | 198 | { |
| 199 | wchar_t buf[MAX_PATH + 100]; | 199 | WCHAR buf[MAX_PATH + 100]; |
| 200 | { | 200 | { |
| 201 | unsigned len = GetSystemDirectoryW(buf, MAX_PATH + 2); | 201 | unsigned len = GetSystemDirectoryW(buf, MAX_PATH + 2); |
| 202 | if (len == 0 || len > MAX_PATH) | 202 | if (len == 0 || len > MAX_PATH) |
| @@ -255,13 +255,13 @@ static WRes MyCreateDir(LPCWSTR name) | |||
| 255 | #define IS_LETTER_CHAR(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) | 255 | #define IS_LETTER_CHAR(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) |
| 256 | #define IS_DRIVE_PATH(s) (IS_LETTER_CHAR(s[0]) && s[1] == ':' && IS_SEPAR(s[2])) | 256 | #define IS_DRIVE_PATH(s) (IS_LETTER_CHAR(s[0]) && s[1] == ':' && IS_SEPAR(s[2])) |
| 257 | 257 | ||
| 258 | static int ReverseFind_PathSepar(const wchar_t *s) | 258 | static int ReverseFind_PathSepar(const WCHAR *s) |
| 259 | { | 259 | { |
| 260 | int separ = -1; | 260 | int separ = -1; |
| 261 | int i; | 261 | int i; |
| 262 | for (i = 0;; i++) | 262 | for (i = 0;; i++) |
| 263 | { | 263 | { |
| 264 | wchar_t c = s[i]; | 264 | WCHAR c = s[i]; |
| 265 | if (c == 0) | 265 | if (c == 0) |
| 266 | return separ; | 266 | return separ; |
| 267 | if (IS_SEPAR(c)) | 267 | if (IS_SEPAR(c)) |
| @@ -566,7 +566,7 @@ static void NormalizePrefix(WCHAR *s) | |||
| 566 | 566 | ||
| 567 | for (;; i++) | 567 | for (;; i++) |
| 568 | { | 568 | { |
| 569 | const wchar_t c = s[i]; | 569 | const WCHAR c = s[i]; |
| 570 | if (c == 0) | 570 | if (c == 0) |
| 571 | break; | 571 | break; |
| 572 | if (c == '/') | 572 | if (c == '/') |
| @@ -587,10 +587,10 @@ static char MyCharLower_Ascii(char c) | |||
| 587 | return c; | 587 | return c; |
| 588 | } | 588 | } |
| 589 | 589 | ||
| 590 | static wchar_t MyWCharLower_Ascii(wchar_t c) | 590 | static WCHAR MyWCharLower_Ascii(WCHAR c) |
| 591 | { | 591 | { |
| 592 | if (c >= 'A' && c <= 'Z') | 592 | if (c >= 'A' && c <= 'Z') |
| 593 | return (wchar_t)(c + 0x20); | 593 | return (WCHAR)(c + 0x20); |
| 594 | return c; | 594 | return c; |
| 595 | } | 595 | } |
| 596 | 596 | ||
| @@ -976,13 +976,13 @@ static void WriteShellEx(void) | |||
| 976 | } | 976 | } |
| 977 | 977 | ||
| 978 | 978 | ||
| 979 | static const wchar_t *GetCmdParam(const wchar_t *s) | 979 | static const WCHAR *GetCmdParam(const WCHAR *s) |
| 980 | { | 980 | { |
| 981 | unsigned pos = 0; | 981 | unsigned pos = 0; |
| 982 | BoolInt quoteMode = False; | 982 | BoolInt quoteMode = False; |
| 983 | for (;; s++) | 983 | for (;; s++) |
| 984 | { | 984 | { |
| 985 | wchar_t c = *s; | 985 | WCHAR c = *s; |
| 986 | if (c == 0 || (c == L' ' && !quoteMode)) | 986 | if (c == 0 || (c == L' ' && !quoteMode)) |
| 987 | break; | 987 | break; |
| 988 | if (c == L'\"') | 988 | if (c == L'\"') |
| @@ -999,12 +999,12 @@ static const wchar_t *GetCmdParam(const wchar_t *s) | |||
| 999 | } | 999 | } |
| 1000 | 1000 | ||
| 1001 | 1001 | ||
| 1002 | static void RemoveQuotes(wchar_t *s) | 1002 | static void RemoveQuotes(WCHAR *s) |
| 1003 | { | 1003 | { |
| 1004 | const wchar_t *src = s; | 1004 | const WCHAR *src = s; |
| 1005 | for (;;) | 1005 | for (;;) |
| 1006 | { | 1006 | { |
| 1007 | wchar_t c = *src++; | 1007 | WCHAR c = *src++; |
| 1008 | if (c == '\"') | 1008 | if (c == '\"') |
| 1009 | continue; | 1009 | continue; |
| 1010 | *s++ = c; | 1010 | *s++ = c; |
| @@ -1039,7 +1039,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1039 | CrcGenerateTable(); | 1039 | CrcGenerateTable(); |
| 1040 | 1040 | ||
| 1041 | { | 1041 | { |
| 1042 | const wchar_t *s = GetCommandLineW(); | 1042 | const WCHAR *s = GetCommandLineW(); |
| 1043 | 1043 | ||
| 1044 | #ifndef UNDER_CE | 1044 | #ifndef UNDER_CE |
| 1045 | s = GetCmdParam(s); | 1045 | s = GetCmdParam(s); |
| @@ -1048,7 +1048,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1048 | for (;;) | 1048 | for (;;) |
| 1049 | { | 1049 | { |
| 1050 | { | 1050 | { |
| 1051 | const wchar_t c = *s; | 1051 | const WCHAR c = *s; |
| 1052 | if (c == 0) | 1052 | if (c == 0) |
| 1053 | break; | 1053 | break; |
| 1054 | if (c == ' ') | 1054 | if (c == ' ') |
| @@ -1059,7 +1059,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1059 | } | 1059 | } |
| 1060 | 1060 | ||
| 1061 | { | 1061 | { |
| 1062 | const wchar_t *s2 = GetCmdParam(s); | 1062 | const WCHAR *s2 = GetCmdParam(s); |
| 1063 | BoolInt error = True; | 1063 | BoolInt error = True; |
| 1064 | if (cmd[0] == '/') | 1064 | if (cmd[0] == '/') |
| 1065 | { | 1065 | { |
| @@ -1315,7 +1315,7 @@ if (res == SZ_OK) | |||
| 1315 | 1315 | ||
| 1316 | for (;;) | 1316 | for (;;) |
| 1317 | { | 1317 | { |
| 1318 | const wchar_t c = path[i++]; | 1318 | const WCHAR c = path[i++]; |
| 1319 | if (c == 0) | 1319 | if (c == 0) |
| 1320 | break; | 1320 | break; |
| 1321 | if (c != ' ') | 1321 | if (c != ' ') |
diff --git a/C/Util/7zipUninstall/7zipUninstall.c b/C/Util/7zipUninstall/7zipUninstall.c index e7051e2..2c1333b 100644 --- a/C/Util/7zipUninstall/7zipUninstall.c +++ b/C/Util/7zipUninstall/7zipUninstall.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* 7zipUninstall.c - 7-Zip Uninstaller | 1 | /* 7zipUninstall.c - 7-Zip Uninstaller |
| 2 | 2024-03-21 : Igor Pavlov : Public domain */ | 2 | : Igor Pavlov : Public domain */ |
| 3 | 3 | ||
| 4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
| 5 | 5 | ||
| @@ -147,7 +147,7 @@ static LPCWSTR const kUninstallExe = L"Uninstall.exe"; | |||
| 147 | #define MAKE_CHAR_UPPER(c) ((((c) >= 'a' && (c) <= 'z') ? (c) - 0x20 : (c))) | 147 | #define MAKE_CHAR_UPPER(c) ((((c) >= 'a' && (c) <= 'z') ? (c) - 0x20 : (c))) |
| 148 | 148 | ||
| 149 | 149 | ||
| 150 | static void CpyAscii(wchar_t *dest, const char *s) | 150 | static void CpyAscii(WCHAR *dest, const char *s) |
| 151 | { | 151 | { |
| 152 | for (;;) | 152 | for (;;) |
| 153 | { | 153 | { |
| @@ -158,13 +158,13 @@ static void CpyAscii(wchar_t *dest, const char *s) | |||
| 158 | } | 158 | } |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | static void CatAscii(wchar_t *dest, const char *s) | 161 | static void CatAscii(WCHAR *dest, const char *s) |
| 162 | { | 162 | { |
| 163 | dest += wcslen(dest); | 163 | dest += wcslen(dest); |
| 164 | CpyAscii(dest, s); | 164 | CpyAscii(dest, s); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | static void PrintErrorMessage(const char *s1, const wchar_t *s2) | 167 | static void PrintErrorMessage(const char *s1, const WCHAR *s2) |
| 168 | { | 168 | { |
| 169 | WCHAR m[MAX_PATH + 512]; | 169 | WCHAR m[MAX_PATH + 512]; |
| 170 | m[0] = 0; | 170 | m[0] = 0; |
| @@ -183,12 +183,12 @@ static void PrintErrorMessage(const char *s1, const wchar_t *s2) | |||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | 185 | ||
| 186 | static BoolInt AreStringsEqual_NoCase(const wchar_t *s1, const wchar_t *s2) | 186 | static BoolInt AreStringsEqual_NoCase(const WCHAR *s1, const WCHAR *s2) |
| 187 | { | 187 | { |
| 188 | for (;;) | 188 | for (;;) |
| 189 | { | 189 | { |
| 190 | wchar_t c1 = *s1++; | 190 | WCHAR c1 = *s1++; |
| 191 | wchar_t c2 = *s2++; | 191 | WCHAR c2 = *s2++; |
| 192 | if (c1 != c2 && MAKE_CHAR_UPPER(c1) != MAKE_CHAR_UPPER(c2)) | 192 | if (c1 != c2 && MAKE_CHAR_UPPER(c1) != MAKE_CHAR_UPPER(c2)) |
| 193 | return False; | 193 | return False; |
| 194 | if (c2 == 0) | 194 | if (c2 == 0) |
| @@ -196,12 +196,12 @@ static BoolInt AreStringsEqual_NoCase(const wchar_t *s1, const wchar_t *s2) | |||
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | static BoolInt IsString1PrefixedByString2_NoCase(const wchar_t *s1, const wchar_t *s2) | 199 | static BoolInt IsString1PrefixedByString2_NoCase(const WCHAR *s1, const WCHAR *s2) |
| 200 | { | 200 | { |
| 201 | for (;;) | 201 | for (;;) |
| 202 | { | 202 | { |
| 203 | wchar_t c1; | 203 | WCHAR c1; |
| 204 | const wchar_t c2 = *s2++; | 204 | const WCHAR c2 = *s2++; |
| 205 | if (c2 == 0) | 205 | if (c2 == 0) |
| 206 | return True; | 206 | return True; |
| 207 | c1 = *s1++; | 207 | c1 = *s1++; |
| @@ -446,7 +446,7 @@ static LPCWSTR const k_AppPaths_7zFm = L"Software\\Microsoft\\Windows\\CurrentVe | |||
| 446 | static LPCWSTR const k_Uninstall_7zip = k_REG_Uninstall L"7-Zip"; | 446 | static LPCWSTR const k_Uninstall_7zip = k_REG_Uninstall L"7-Zip"; |
| 447 | 447 | ||
| 448 | 448 | ||
| 449 | static void RemoveQuotes(wchar_t *s) | 449 | static void RemoveQuotes(WCHAR *s) |
| 450 | { | 450 | { |
| 451 | const size_t len = wcslen(s); | 451 | const size_t len = wcslen(s); |
| 452 | size_t i; | 452 | size_t i; |
| @@ -457,7 +457,7 @@ static void RemoveQuotes(wchar_t *s) | |||
| 457 | s[len - 2] = 0; | 457 | s[len - 2] = 0; |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | static BoolInt AreEqual_Path_PrefixName(const wchar_t *s, const wchar_t *prefix, const wchar_t *name) | 460 | static BoolInt AreEqual_Path_PrefixName(const WCHAR *s, const WCHAR *prefix, const WCHAR *name) |
| 461 | { | 461 | { |
| 462 | if (!IsString1PrefixedByString2_NoCase(s, prefix)) | 462 | if (!IsString1PrefixedByString2_NoCase(s, prefix)) |
| 463 | return False; | 463 | return False; |
| @@ -558,13 +558,13 @@ static void WriteCLSID(void) | |||
| 558 | } | 558 | } |
| 559 | 559 | ||
| 560 | 560 | ||
| 561 | static const wchar_t *GetCmdParam(const wchar_t *s) | 561 | static const WCHAR *GetCmdParam(const WCHAR *s) |
| 562 | { | 562 | { |
| 563 | unsigned pos = 0; | 563 | unsigned pos = 0; |
| 564 | BoolInt quoteMode = False; | 564 | BoolInt quoteMode = False; |
| 565 | for (;; s++) | 565 | for (;; s++) |
| 566 | { | 566 | { |
| 567 | const wchar_t c = *s; | 567 | const WCHAR c = *s; |
| 568 | if (c == 0 || (c == L' ' && !quoteMode)) | 568 | if (c == 0 || (c == L' ' && !quoteMode)) |
| 569 | break; | 569 | break; |
| 570 | if (c == L'\"') | 570 | if (c == L'\"') |
| @@ -581,12 +581,12 @@ static const wchar_t *GetCmdParam(const wchar_t *s) | |||
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | /* | 583 | /* |
| 584 | static void RemoveQuotes(wchar_t *s) | 584 | static void RemoveQuotes(WCHAR *s) |
| 585 | { | 585 | { |
| 586 | const wchar_t *src = s; | 586 | const WCHAR *src = s; |
| 587 | for (;;) | 587 | for (;;) |
| 588 | { | 588 | { |
| 589 | wchar_t c = *src++; | 589 | WCHAR c = *src++; |
| 590 | if (c == '\"') | 590 | if (c == '\"') |
| 591 | continue; | 591 | continue; |
| 592 | *s++ = c; | 592 | *s++ = c; |
| @@ -618,11 +618,11 @@ static BOOL RemoveFileAfterReboot(void) | |||
| 618 | 618 | ||
| 619 | // #define IS_LIMIT_CHAR(c) (c == 0 || c == ' ') | 619 | // #define IS_LIMIT_CHAR(c) (c == 0 || c == ' ') |
| 620 | 620 | ||
| 621 | static BoolInt IsThereSpace(const wchar_t *s) | 621 | static BoolInt IsThereSpace(const WCHAR *s) |
| 622 | { | 622 | { |
| 623 | for (;;) | 623 | for (;;) |
| 624 | { | 624 | { |
| 625 | const wchar_t c = *s++; | 625 | const WCHAR c = *s++; |
| 626 | if (c == 0) | 626 | if (c == 0) |
| 627 | return False; | 627 | return False; |
| 628 | if (c == ' ') | 628 | if (c == ' ') |
| @@ -630,7 +630,7 @@ static BoolInt IsThereSpace(const wchar_t *s) | |||
| 630 | } | 630 | } |
| 631 | } | 631 | } |
| 632 | 632 | ||
| 633 | static void AddPathParam(wchar_t *dest, const wchar_t *src) | 633 | static void AddPathParam(WCHAR *dest, const WCHAR *src) |
| 634 | { | 634 | { |
| 635 | const BoolInt needQuote = IsThereSpace(src); | 635 | const BoolInt needQuote = IsThereSpace(src); |
| 636 | if (needQuote) | 636 | if (needQuote) |
| @@ -937,7 +937,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 937 | #endif | 937 | #endif |
| 938 | lpCmdLine, int nCmdShow) | 938 | lpCmdLine, int nCmdShow) |
| 939 | { | 939 | { |
| 940 | const wchar_t *cmdParams; | 940 | const WCHAR *cmdParams; |
| 941 | BoolInt useTemp = True; | 941 | BoolInt useTemp = True; |
| 942 | 942 | ||
| 943 | UNUSED_VAR(hPrevInstance) | 943 | UNUSED_VAR(hPrevInstance) |
| @@ -957,7 +957,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 957 | #endif | 957 | #endif |
| 958 | 958 | ||
| 959 | { | 959 | { |
| 960 | const wchar_t *s = GetCommandLineW(); | 960 | const WCHAR *s = GetCommandLineW(); |
| 961 | 961 | ||
| 962 | #ifndef UNDER_CE | 962 | #ifndef UNDER_CE |
| 963 | s = GetCmdParam(s); | 963 | s = GetCmdParam(s); |
| @@ -968,7 +968,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 968 | for (;;) | 968 | for (;;) |
| 969 | { | 969 | { |
| 970 | { | 970 | { |
| 971 | wchar_t c = *s; | 971 | WCHAR c = *s; |
| 972 | if (c == 0) | 972 | if (c == 0) |
| 973 | break; | 973 | break; |
| 974 | if (c == ' ') | 974 | if (c == ' ') |
| @@ -979,7 +979,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 979 | } | 979 | } |
| 980 | 980 | ||
| 981 | { | 981 | { |
| 982 | const wchar_t *s2 = GetCmdParam(s); | 982 | const WCHAR *s2 = GetCmdParam(s); |
| 983 | BoolInt error = True; | 983 | BoolInt error = True; |
| 984 | if (cmd[0] == '/') | 984 | if (cmd[0] == '/') |
| 985 | { | 985 | { |
| @@ -1022,7 +1022,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1022 | } | 1022 | } |
| 1023 | 1023 | ||
| 1024 | { | 1024 | { |
| 1025 | wchar_t *name; | 1025 | WCHAR *name; |
| 1026 | const DWORD len = GetModuleFileNameW(NULL, modulePath, MAX_PATH); | 1026 | const DWORD len = GetModuleFileNameW(NULL, modulePath, MAX_PATH); |
| 1027 | if (len == 0 || len > MAX_PATH) | 1027 | if (len == 0 || len > MAX_PATH) |
| 1028 | return 1; | 1028 | return 1; |
| @@ -1031,10 +1031,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1031 | wcscpy(modulePrefix, modulePath); | 1031 | wcscpy(modulePrefix, modulePath); |
| 1032 | 1032 | ||
| 1033 | { | 1033 | { |
| 1034 | wchar_t *s = modulePrefix; | 1034 | WCHAR *s = modulePrefix; |
| 1035 | for (;;) | 1035 | for (;;) |
| 1036 | { | 1036 | { |
| 1037 | const wchar_t c = *s++; | 1037 | const WCHAR c = *s++; |
| 1038 | if (c == 0) | 1038 | if (c == 0) |
| 1039 | break; | 1039 | break; |
| 1040 | if (c == WCHAR_PATH_SEPARATOR) | 1040 | if (c == WCHAR_PATH_SEPARATOR) |
| @@ -1079,14 +1079,14 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 1079 | CpyAscii(path + pathLen, "7z"); | 1079 | CpyAscii(path + pathLen, "7z"); |
| 1080 | 1080 | ||
| 1081 | { | 1081 | { |
| 1082 | wchar_t *s = path + wcslen(path); | 1082 | WCHAR *s = path + wcslen(path); |
| 1083 | UInt32 value = d; | 1083 | UInt32 value = d; |
| 1084 | unsigned k; | 1084 | unsigned k; |
| 1085 | for (k = 0; k < 8; k++) | 1085 | for (k = 0; k < 8; k++) |
| 1086 | { | 1086 | { |
| 1087 | const unsigned t = value & 0xF; | 1087 | const unsigned t = value & 0xF; |
| 1088 | value >>= 4; | 1088 | value >>= 4; |
| 1089 | s[7 - k] = (wchar_t)((t < 10) ? ('0' + t) : ('A' + (t - 10))); | 1089 | s[7 - k] = (WCHAR)((t < 10) ? ('0' + t) : ('A' + (t - 10))); |
| 1090 | } | 1090 | } |
| 1091 | s[k] = 0; | 1091 | s[k] = 0; |
| 1092 | } | 1092 | } |
diff --git a/C/Util/SfxSetup/SfxSetup.c b/C/Util/SfxSetup/SfxSetup.c index 9b5c1f9..344aa73 100644 --- a/C/Util/SfxSetup/SfxSetup.c +++ b/C/Util/SfxSetup/SfxSetup.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* SfxSetup.c - 7z SFX Setup | 1 | /* SfxSetup.c - 7z SFX Setup |
| 2 | 2024-01-24 : Igor Pavlov : Public domain */ | 2 | : Igor Pavlov : Public domain */ |
| 3 | 3 | ||
| 4 | #include "Precomp.h" | 4 | #include "Precomp.h" |
| 5 | 5 | ||
| @@ -54,7 +54,7 @@ static const char * const kNames[] = | |||
| 54 | , "start" | 54 | , "start" |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | static unsigned FindExt(const wchar_t *s, unsigned *extLen) | 57 | static unsigned FindExt(const WCHAR *s, unsigned *extLen) |
| 58 | { | 58 | { |
| 59 | unsigned len = (unsigned)wcslen(s); | 59 | unsigned len = (unsigned)wcslen(s); |
| 60 | unsigned i; | 60 | unsigned i; |
| @@ -72,7 +72,7 @@ static unsigned FindExt(const wchar_t *s, unsigned *extLen) | |||
| 72 | 72 | ||
| 73 | #define MAKE_CHAR_UPPER(c) ((((c) >= 'a' && (c) <= 'z') ? (c) - 0x20 : (c))) | 73 | #define MAKE_CHAR_UPPER(c) ((((c) >= 'a' && (c) <= 'z') ? (c) - 0x20 : (c))) |
| 74 | 74 | ||
| 75 | static unsigned FindItem(const char * const *items, unsigned num, const wchar_t *s, unsigned len) | 75 | static unsigned FindItem(const char * const *items, unsigned num, const WCHAR *s, unsigned len) |
| 76 | { | 76 | { |
| 77 | unsigned i; | 77 | unsigned i; |
| 78 | for (i = 0; i < num; i++) | 78 | for (i = 0; i < num; i++) |
| @@ -268,7 +268,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 268 | #endif | 268 | #endif |
| 269 | size_t pathLen; | 269 | size_t pathLen; |
| 270 | DWORD winRes; | 270 | DWORD winRes; |
| 271 | const wchar_t *cmdLineParams; | 271 | const WCHAR *cmdLineParams; |
| 272 | const char *errorMessage = NULL; | 272 | const char *errorMessage = NULL; |
| 273 | BoolInt useShellExecute = True; | 273 | BoolInt useShellExecute = True; |
| 274 | DWORD exitCode = 0; | 274 | DWORD exitCode = 0; |
| @@ -306,7 +306,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 306 | BoolInt quoteMode = False; | 306 | BoolInt quoteMode = False; |
| 307 | for (;; cmdLineParams++) | 307 | for (;; cmdLineParams++) |
| 308 | { | 308 | { |
| 309 | const wchar_t c = *cmdLineParams; | 309 | const WCHAR c = *cmdLineParams; |
| 310 | if (c == L'\"') | 310 | if (c == L'\"') |
| 311 | quoteMode = !quoteMode; | 311 | quoteMode = !quoteMode; |
| 312 | else if (c == 0 || (c == L' ' && !quoteMode)) | 312 | else if (c == 0 || (c == L' ' && !quoteMode)) |
| @@ -335,14 +335,14 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | |||
| 335 | wcscpy(path + pathLen, L"7z"); | 335 | wcscpy(path + pathLen, L"7z"); |
| 336 | 336 | ||
| 337 | { | 337 | { |
| 338 | wchar_t *s = path + wcslen(path); | 338 | WCHAR *s = path + wcslen(path); |
| 339 | UInt32 value = d; | 339 | UInt32 value = d; |
| 340 | unsigned k; | 340 | unsigned k; |
| 341 | for (k = 0; k < 8; k++) | 341 | for (k = 0; k < 8; k++) |
| 342 | { | 342 | { |
| 343 | const unsigned t = value & 0xF; | 343 | const unsigned t = value & 0xF; |
| 344 | value >>= 4; | 344 | value >>= 4; |
| 345 | s[7 - k] = (wchar_t)((t < 10) ? ('0' + t) : ('A' + (t - 10))); | 345 | s[7 - k] = (WCHAR)((t < 10) ? ('0' + t) : ('A' + (t - 10))); |
| 346 | } | 346 | } |
| 347 | s[k] = '\0'; | 347 | s[k] = '\0'; |
| 348 | } | 348 | } |
