[clang,warnings] fix Wjump-misses-init

This commit is contained in:
Armin Novak
2026-01-08 10:32:31 +01:00
parent e5af1cf1d6
commit 3904cc4b12

View File

@@ -134,22 +134,24 @@ static BOOL InitializeThreadpool(PTP_POOL pool)
#error "WINPR_THREADPOOL_DEFAULT_MAX_COUNT must be defined"
#endif
SYSTEM_INFO info = { 0 };
GetSystemInfo(&info);
{
SYSTEM_INFO info = { 0 };
GetSystemInfo(&info);
DWORD min = info.dwNumberOfProcessors;
DWORD max = info.dwNumberOfProcessors;
if (info.dwNumberOfProcessors < WINPR_THREADPOOL_DEFAULT_MIN_COUNT)
min = WINPR_THREADPOOL_DEFAULT_MIN_COUNT;
if (info.dwNumberOfProcessors > WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
max = WINPR_THREADPOOL_DEFAULT_MAX_COUNT;
if (min > max)
min = max;
DWORD min = info.dwNumberOfProcessors;
DWORD max = info.dwNumberOfProcessors;
if (info.dwNumberOfProcessors < WINPR_THREADPOOL_DEFAULT_MIN_COUNT)
min = WINPR_THREADPOOL_DEFAULT_MIN_COUNT;
if (info.dwNumberOfProcessors > WINPR_THREADPOOL_DEFAULT_MAX_COUNT)
max = WINPR_THREADPOOL_DEFAULT_MAX_COUNT;
if (min > max)
min = max;
if (!SetThreadpoolThreadMinimum(pool, min))
goto fail;
if (!SetThreadpoolThreadMinimum(pool, min))
goto fail;
SetThreadpoolThreadMaximum(pool, max);
SetThreadpoolThreadMaximum(pool, max);
}
rc = TRUE;