Updated cmd-launch-association patchset

Fix the compile error or "Invalid pointer type passed to function"

Function GetExitCodeProcess, takes a DWORD as a section paramater,
and the code for the used errorlevel (aka an int).

The old code, used a local for the return value and reassigned it.
I've taken the approach to just change the errorlevel type.
This commit is contained in:
Alistair Leslie-Hughes 2024-06-18 09:17:44 +10:00
parent 813a5dd246
commit 0c3e34dc13

View File

@ -0,0 +1,55 @@
From bbd077ad0ba63001b1a785c2b3c740b5b01d3469 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 18 Jun 2024 09:14:56 +1000
Subject: [PATCH] cmd: Changed errorlevel type to DWORD
This stop the invalid type being passed to GetExitCodeProcess which is being reported
as an error with clang/mingw in the latest version.
---
programs/cmd/builtins.c | 2 +-
programs/cmd/wcmd.h | 2 +-
programs/cmd/wcmdmain.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index f98ac902eba..147f94ac4bb 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -440,7 +440,7 @@ void WCMD_choice (const WCHAR * args) {
SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), oldmode);
errorlevel = (ptr - opt_c) + 1;
- TRACE("answer: %d\n", errorlevel);
+ TRACE("answer: %ld\n", errorlevel);
free(my_command);
return;
}
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
index dde5d1e12ec..f202e6ef9e4 100644
--- a/programs/cmd/wcmd.h
+++ b/programs/cmd/wcmd.h
@@ -306,7 +306,7 @@ void WCMD_set_for_loop_variable(int var_idx, const WCHAR *value);
* variables and batch parameters substitution already done.
*/
extern WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
-extern int errorlevel;
+extern DWORD errorlevel;
extern BATCH_CONTEXT *context;
extern FOR_CONTEXT *forloopcontext;
extern BOOL delayedsubst;
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 702c3657a2b..0f8bdd3df14 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -36,7 +36,7 @@ extern const WCHAR inbuilt[][10];
extern struct env_stack *pushd_directories;
BATCH_CONTEXT *context = NULL;
-int errorlevel;
+DWORD errorlevel;
WCHAR quals[MAXSTRING], param1[MAXSTRING], param2[MAXSTRING];
BOOL interactive;
FOR_CONTEXT *forloopcontext; /* The 'for' loop context */
--
2.43.0