From 0e4ceb9a8dde88cd23bcad62fe0b874bf8267a93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Thu, 29 Mar 2012 18:05:59 +0200 Subject: [PATCH] cmd: Use BOOL instead of int for boolean variables. --- programs/cmd/batch.c | 8 ++++---- programs/cmd/builtins.c | 2 +- programs/cmd/wcmd.h | 4 ++-- programs/cmd/wcmdmain.c | 23 +++++++++++------------ 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c index 2b33b69a2a5..05314f4aa04 100644 --- a/programs/cmd/batch.c +++ b/programs/cmd/batch.c @@ -40,8 +40,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(cmd); * a label to goto once opened. */ -void WCMD_batch (WCHAR *file, WCHAR *command, int called, WCHAR *startLabel, HANDLE pgmHandle) { - +void WCMD_batch (WCHAR *file, WCHAR *command, BOOL called, WCHAR *startLabel, HANDLE pgmHandle) +{ HANDLE h = INVALID_HANDLE_VALUE; BATCH_CONTEXT *prev_context; @@ -583,7 +583,7 @@ void WCMD_call (WCHAR *command) { /* Run other program if no leading ':' */ if (*command != ':') { - WCMD_run_program(command, 1); + WCMD_run_program(command, TRUE); } else { WCHAR gotoLabel[MAX_PATH]; @@ -600,7 +600,7 @@ void WCMD_call (WCHAR *command) { li.u.LowPart = SetFilePointer(context -> h, li.u.LowPart, &li.u.HighPart, FILE_CURRENT); - WCMD_batch (param1, command, 1, gotoLabel, context->h); + WCMD_batch (param1, command, TRUE, gotoLabel, context->h); SetFilePointer(context -> h, li.u.LowPart, &li.u.HighPart, FILE_BEGIN); diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 7e6bd778682..ebb1c801103 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -1416,7 +1416,7 @@ void WCMD_give_help (const WCHAR *command) static const WCHAR helpW[] = {' ', '/','?','\0'}; strcpyW(cmd, command); strcatW(cmd, helpW); - WCMD_run_program(cmd, 0); + WCMD_run_program(cmd, FALSE); return; } } diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index 3623213a7cd..4e021d9b4ff 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -54,7 +54,7 @@ typedef struct _CMD_LIST { } CMD_LIST; void WCMD_assoc (const WCHAR *, BOOL); -void WCMD_batch (WCHAR *, WCHAR *, int, WCHAR *, HANDLE); +void WCMD_batch (WCHAR *, WCHAR *, BOOL, WCHAR *, HANDLE); void WCMD_call (WCHAR *command); void WCMD_change_tty (void); void WCMD_choice (const WCHAR *); @@ -86,7 +86,7 @@ void WCMD_print_error (void); void WCMD_pushd (const WCHAR *command); void WCMD_remove_dir (WCHAR *command); void WCMD_rename (void); -void WCMD_run_program (WCHAR *command, int called); +void WCMD_run_program (WCHAR *command, BOOL called); void WCMD_setlocal (const WCHAR *command); void WCMD_setshow_date (void); void WCMD_setshow_default (const WCHAR *command); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index c6c3e0e4bb0..93a2bb845d7 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -993,8 +993,8 @@ static void init_msvcrt_io_block(STARTUPINFOW* st) * findexecutable to achieve this which is left untouched. */ -void WCMD_run_program (WCHAR *command, int called) { - +void WCMD_run_program (WCHAR *command, BOOL called) +{ WCHAR temp[MAX_PATH]; WCHAR pathtosearch[MAXSTRING]; WCHAR *pathposn; @@ -1585,7 +1585,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects, break; default: prev_echo_mode = echo_mode; - WCMD_run_program (whichcmd, 0); + WCMD_run_program (whichcmd, FALSE); echo_mode = prev_echo_mode; } HeapFree( GetProcessHeap(), 0, cmd ); @@ -2336,19 +2336,19 @@ int wmain (int argc, WCHAR *argvW[]) argsLeft = args; for (arg = argvW; argsLeft>0; arg++,argsLeft--) { - int has_space,bcount; + BOOL has_space = FALSE; + int bcount; WCHAR* a; - has_space=0; bcount=0; a=*arg; - if( !*a ) has_space=1; + if( !*a ) has_space = TRUE; while (*a!='\0') { if (*a=='\\') { bcount++; } else { if (*a==' ' || *a=='\t') { - has_space=1; + has_space = TRUE; } else if (*a=='"') { /* doubling of '\' preceding a '"', * plus escaping of said '"' @@ -2395,20 +2395,19 @@ int wmain (int argc, WCHAR *argvW[]) argsLeft = args; for (arg = argvW; argsLeft>0; arg++,argsLeft--) { - int has_space,has_quote; + BOOL has_space = FALSE, has_quote = FALSE; WCHAR* a; /* Check for quotes and spaces in this argument */ - has_space=has_quote=0; a=*arg; - if( !*a ) has_space=1; + if( !*a ) has_space = TRUE; while (*a!='\0') { if (*a==' ' || *a=='\t') { - has_space=1; + has_space = TRUE; if (has_quote) break; } else if (*a=='"') { - has_quote=1; + has_quote = TRUE; if (has_space) break; } -- 2.11.4.GIT