From 10a51ce47816bb6dc9219d632a50fb94ddde7236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 28 Mar 2026 12:39:05 +0100 Subject: [PATCH] [MORE] Improve imports, adjust code --- .../applications/cmdutils/more/CMakeLists.txt | 4 +--- base/applications/cmdutils/more/more.c | 19 +++++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/base/applications/cmdutils/more/CMakeLists.txt b/base/applications/cmdutils/more/CMakeLists.txt index 2ad6d2e6216..c6953a25593 100644 --- a/base/applications/cmdutils/more/CMakeLists.txt +++ b/base/applications/cmdutils/more/CMakeLists.txt @@ -1,11 +1,9 @@ PROJECT(more) -include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils) - add_executable(more more.c more.rc) set_module_type(more win32cui UNICODE) -target_link_libraries(more conutils ${PSEH_LIB}) +target_link_libraries(more conutils) add_importlibs(more advapi32 msvcrt kernel32) set_target_properties(more PROPERTIES SUFFIX ".com") add_cd_file(TARGET more DESTINATION reactos/system32 FOR all) diff --git a/base/applications/cmdutils/more/more.c b/base/applications/cmdutils/more/more.c index c05c21f313b..64cb94ab68e 100644 --- a/base/applications/cmdutils/more/more.c +++ b/base/applications/cmdutils/more/more.c @@ -26,10 +26,9 @@ #include #include -#include #include #include -#include +#include #include #include @@ -74,9 +73,9 @@ static BOOL s_bPrevLineIsBlank = FALSE; static WORD s_fPrompt = 0; static BOOL s_bDoNextFile = FALSE; -static BOOL IsBlankLine(IN PCWCH line, IN DWORD cch) +static BOOL IsBlankLine(IN PCWCH line, IN SIZE_T cch) { - DWORD ich; + SIZE_T ich; WORD wType; for (ich = 0; ich < cch; ++ich) { @@ -106,7 +105,7 @@ __stdcall MorePagerLine( IN OUT PCON_PAGER Pager, IN PCWCH line, - IN DWORD cch) + IN SIZE_T cch) { if (s_dwFlags & FLAG_PLUSn) /* Skip lines */ { @@ -184,10 +183,10 @@ PagePrompt(PCON_PAGER Pager, DWORD Done, DWORD Total) /* Load the prompt strings */ if (!AreStrLoaded) { - K32LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent)); - K32LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt)); - K32LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions)); - K32LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines)); + LoadStringW(NULL, IDS_CONTINUE_PERCENT, StrPercent, ARRAYSIZE(StrPercent)); + LoadStringW(NULL, IDS_CONTINUE_LINE_AT, StrLineAt, ARRAYSIZE(StrLineAt)); + LoadStringW(NULL, IDS_CONTINUE_OPTIONS, StrOptions, ARRAYSIZE(StrOptions)); + LoadStringW(NULL, IDS_CONTINUE_LINES, StrLines, ARRAYSIZE(StrLines)); AreStrLoaded = TRUE; } @@ -219,7 +218,7 @@ Restart: * the bytes read to the character string for a given encoding. * Therefore the number of characters displayed on screen is equal to: * dwSumReadChars - Total + Done , - * but the best corresponding approximed number of bytes would be: + * but the best corresponding approximated number of bytes would be: * dwSumReadBytes - (Total - Done) * (dwSumReadBytes / dwSumReadChars) , * where the ratio is the average number of bytes per character. * The percentage is then computed relative to the total file size.