Skip to content

Commit 4dcf140

Browse files
committed
Resolve errors and warnings in vendor
1 parent 1762b18 commit 4dcf140

File tree

16 files changed

+34
-786
lines changed

16 files changed

+34
-786
lines changed

vendor/bcrypt/crypt_blowfish.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,8 @@ char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
896896
output[1] = '2';
897897
output[2] = prefix[2];
898898
output[3] = '$';
899-
output[4] = '0' + count / 10;
900-
output[5] = '0' + count % 10;
899+
output[4] = (char)('0' + count / 10);
900+
output[5] = (char)('0' + count % 10);
901901
output[6] = '$';
902902

903903
BF_encode(&output[7], (const BF_word *)input, 16);

vendor/detours/4.0.1/src/creatwth.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -949,14 +949,17 @@ VOID CALLBACK DetourFinishHelperProcess(_In_ HWND,
949949
{
950950
LPCSTR * rlpDlls = NULL;
951951
DWORD Result = 9900;
952+
DWORD cSize = 0;
953+
DWORD cOffset = 0;
954+
HANDLE hProcess = NULL;
952955

953956
if (s_pHelper == NULL) {
954957
DETOUR_TRACE(("DetourFinishHelperProcess called with s_pHelper = NULL.\n"));
955958
Result = 9905;
956959
goto Cleanup;
957960
}
958961

959-
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, s_pHelper->pid);
962+
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, s_pHelper->pid);
960963
if (hProcess == NULL) {
961964
DETOUR_TRACE(("OpenProcess(pid=%d) failed: %d\n",
962965
s_pHelper->pid, GetLastError()));
@@ -965,8 +968,8 @@ VOID CALLBACK DetourFinishHelperProcess(_In_ HWND,
965968
}
966969

967970
rlpDlls = new NOTHROW LPCSTR [s_pHelper->nDlls];
968-
DWORD cSize = s_pHelper->cb - sizeof(DETOUR_EXE_HELPER);
969-
DWORD cOffset = 0;
971+
cSize = s_pHelper->cb - sizeof(DETOUR_EXE_HELPER);
972+
cOffset = 0;
970973
for (DWORD n = 0; n < s_pHelper->nDlls; n++) {
971974
size_t cchDest = 0;
972975
HRESULT hr = StringCchLengthA(&s_pHelper->rDlls[cOffset], cSize - cOffset, &cchDest);
@@ -1029,6 +1032,8 @@ BOOL WINAPI AllocExeHelper(_Out_ PDETOUR_EXE_HELPER *pHelper,
10291032
{
10301033
PDETOUR_EXE_HELPER Helper = NULL;
10311034
BOOL Result = FALSE;
1035+
_Field_range_(0, cSize - 4) DWORD cOffset = 0;
1036+
DWORD cSize = 4;
10321037

10331038
if (pHelper == NULL) {
10341039
goto Cleanup;
@@ -1040,7 +1045,6 @@ BOOL WINAPI AllocExeHelper(_Out_ PDETOUR_EXE_HELPER *pHelper,
10401045
goto Cleanup;
10411046
}
10421047

1043-
DWORD cSize = 4;
10441048
for (DWORD n = 0; n < nDlls; n++) {
10451049
HRESULT hr;
10461050
size_t cchDest = 0;
@@ -1061,8 +1065,7 @@ BOOL WINAPI AllocExeHelper(_Out_ PDETOUR_EXE_HELPER *pHelper,
10611065
Helper->cb = sizeof(DETOUR_EXE_HELPER) + cSize;
10621066
Helper->pid = dwTargetPid;
10631067
Helper->nDlls = nDlls;
1064-
1065-
_Field_range_(0, cSize - 4) DWORD cOffset = 0;
1068+
10661069
for (DWORD n = 0; n < nDlls; n++) {
10671070
HRESULT hr;
10681071
size_t cchDest = 0;
@@ -1154,6 +1157,7 @@ BOOL WINAPI DetourProcessViaHelperDllsA(_In_ DWORD dwTargetPid,
11541157
CHAR szCommand[MAX_PATH];
11551158
PDETOUR_EXE_HELPER helper = NULL;
11561159
HRESULT hr;
1160+
DWORD nLen = 0;
11571161

11581162
DETOUR_TRACE(("DetourProcessViaHelperDlls(pid=%d,dlls=%d)\n", dwTargetPid, nDlls));
11591163
if (nDlls < 1 || nDlls > 4096) {
@@ -1164,7 +1168,7 @@ BOOL WINAPI DetourProcessViaHelperDllsA(_In_ DWORD dwTargetPid,
11641168
goto Cleanup;
11651169
}
11661170

1167-
DWORD nLen = GetEnvironmentVariableA("WINDIR", szExe, ARRAYSIZE(szExe));
1171+
nLen = GetEnvironmentVariableA("WINDIR", szExe, ARRAYSIZE(szExe));
11681172
if (nLen == 0 || nLen >= ARRAYSIZE(szExe)) {
11691173
goto Cleanup;
11701174
}
@@ -1250,6 +1254,7 @@ BOOL WINAPI DetourProcessViaHelperDllsW(_In_ DWORD dwTargetPid,
12501254
WCHAR szCommand[MAX_PATH];
12511255
PDETOUR_EXE_HELPER helper = NULL;
12521256
HRESULT hr;
1257+
DWORD nLen = 0;
12531258

12541259
DETOUR_TRACE(("DetourProcessViaHelperDlls(pid=%d,dlls=%d)\n", dwTargetPid, nDlls));
12551260
if (nDlls < 1 || nDlls > 4096) {
@@ -1260,7 +1265,7 @@ BOOL WINAPI DetourProcessViaHelperDllsW(_In_ DWORD dwTargetPid,
12601265
goto Cleanup;
12611266
}
12621267

1263-
DWORD nLen = GetEnvironmentVariableW(L"WINDIR", szExe, ARRAYSIZE(szExe));
1268+
nLen = GetEnvironmentVariableW(L"WINDIR", szExe, ARRAYSIZE(szExe));
12641269
if (nLen == 0 || nLen >= ARRAYSIZE(szExe)) {
12651270
goto Cleanup;
12661271
}

vendor/freetype/src/gxvalid/gxvmort2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@
192192
offset, optdata->ligatureTable - offset * 2 ));
193193

194194
GXV_SET_ERR_IF_PARANOID( FT_INVALID_OFFSET );
195-
} else if ( offset * 2 >
196-
optdata->ligatureTable + optdata->ligatureTable_length )
195+
} else if ( offset * 2u >
196+
(FT_ULong)( optdata->ligatureTable + optdata->ligatureTable_length ) )
197197
{
198198
GXV_TRACE(( "too long offset 0x%08lx:"
199199
" 2 x offset > ligatureTable + ligatureTable_length"

vendor/json-c/premake5.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ project "json-c"
22
language "C++"
33
kind "StaticLib"
44
targetname "json-c"
5+
disablewarnings {
6+
"4244", -- warning C4244: '=': conversion from '?' to '?', possible loss of data
7+
"4018", -- warning C4018: '<': signed/unsigned mismatch
8+
"4996", -- use of symbol with __declspec(deprecated)
9+
}
510

611
includedirs { "." }
712
defines { "_LIB" }

vendor/libspeex/libspeex/testenc.c

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
 (0)