Changeset: bfa36c72e0d3 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bfa36c72e0d3 Modified Files: clients/mapiclient/ReadlineTools.c clients/mapiclient/ReadlineTools.h clients/mapiclient/mclient.c Branch: default Log Message:
Use bool type for boolean variables diffs (81 lines): diff --git a/clients/mapiclient/ReadlineTools.c b/clients/mapiclient/ReadlineTools.c --- a/clients/mapiclient/ReadlineTools.c +++ b/clients/mapiclient/ReadlineTools.c @@ -39,7 +39,7 @@ static const char *sql_commands[] = { static Mapi _mid; static char _history_file[FILENAME_MAX]; -static int _save_history = 0; +static bool _save_history = false; static const char *language; static char * @@ -290,7 +290,7 @@ continue_completion(rl_completion_func_t } void -init_readline(Mapi mid, const char *lang, int save_history) +init_readline(Mapi mid, const char *lang, bool save_history) { language = lang; _mid = mid; @@ -317,7 +317,7 @@ init_readline(Mapi mid, const char *lang if (len == -1 || len >= FILENAME_MAX) fprintf(stderr, "Warning: history filename path is too large\n"); else - _save_history = 1; + _save_history = true; } if (_save_history) { FILE *f; diff --git a/clients/mapiclient/ReadlineTools.h b/clients/mapiclient/ReadlineTools.h --- a/clients/mapiclient/ReadlineTools.h +++ b/clients/mapiclient/ReadlineTools.h @@ -13,7 +13,7 @@ #include "mapi.h" -void init_readline(Mapi mid, const char *language, int save_history); +void init_readline(Mapi mid, const char *language, bool save_history); void deinit_readline(void); void save_line(const char *s); rl_completion_func_t *suspend_completion(void); diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2207,7 +2207,7 @@ mydestroy(void *private) #endif static bool -doFile(Mapi mid, stream *fp, bool useinserts, bool interactive, int save_history) +doFile(Mapi mid, stream *fp, bool useinserts, bool interactive, bool save_history) { char *line = NULL; char *buf = NULL; @@ -3173,7 +3173,7 @@ main(int argc, char **argv) bool useinserts = false; int c = 0; Mapi mid; - int save_history = 0; + bool save_history = false; bool interactive = false; bool has_fileargs = false; int option_index = 0; @@ -3252,7 +3252,7 @@ main(int argc, char **argv) dbname = dotfile.dbname; language = dotfile.language; host = dotfile.host; - save_history = (int)dotfile.save_history; + save_history = dotfile.save_history; output = dotfile.output; pagewidth = dotfile.pagewidth; port = dotfile.port; @@ -3315,7 +3315,7 @@ main(int argc, char **argv) host = optarg; break; case 'H': - save_history = 1; + save_history = true; break; case 'i': interactive = true; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list