[TASKMGR] Favor _countof(), no functional change intended (#5757)

Taskmgr used a mixture: Sometimes _countof(), sometimes ARRAYSIZE()
and sometimes it calculated the count plain by sizeof(var)/sizeof(TYPE).
Harmonize everywhere to _countof() as it is the shortest solution.

Fix some formatting sins, like placing comments before else-statement.
Shorten the length of some very long line
intentionally *without introducing additional linebreaks* !

Shorten vertical length of some functions to increase their chance to
fit on the screen without scrolling.

Fix wrong indentation level in TaskManagerWndProc().

*.rc: Remove superfluous and redundant comment in all langs

No functional change intended.
This commit is contained in:
Joachim Henze 2023-10-03 21:00:10 +02:00 committed by GitHub
parent 410b1030c0
commit 46b4b5581d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 91 additions and 194 deletions

View file

@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS Task Manager
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* PURPOSE: Performance Page.
* PURPOSE: Performance Page
* COPYRIGHT: Copyright 1999-2001 Brian Palmer <brianp@reactos.org>
*/
@ -320,9 +320,9 @@ DWORD WINAPI PerformancePageRefreshThread(PVOID Parameter)
WCHAR Text[260];
WCHAR szMemUsage[256], szCpuUsage[256], szProcesses[256];
LoadStringW(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, ARRAYSIZE(szCpuUsage));
LoadStringW(hInst, IDS_STATUS_MEMUSAGE, szMemUsage, ARRAYSIZE(szMemUsage));
LoadStringW(hInst, IDS_STATUS_PROCESSES, szProcesses, ARRAYSIZE(szProcesses));
LoadStringW(hInst, IDS_STATUS_CPUUSAGE, szCpuUsage, _countof(szCpuUsage));
LoadStringW(hInst, IDS_STATUS_MEMUSAGE, szMemUsage, _countof(szMemUsage));
LoadStringW(hInst, IDS_STATUS_PROCESSES, szProcesses, _countof(szProcesses));
while (1)
{
@ -355,11 +355,11 @@ DWORD WINAPI PerformancePageRefreshThread(PVOID Parameter)
StrFormatByteSizeW(CommitChargeTotal * 1024,
szChargeTotalFormat,
ARRAYSIZE(szChargeTotalFormat));
_countof(szChargeTotalFormat));
StrFormatByteSizeW(CommitChargeLimit * 1024,
szChargeLimitFormat,
ARRAYSIZE(szChargeLimitFormat));
_countof(szChargeLimitFormat));
if (!bTrackMenu)
{