Skip to content

Commit

Permalink
Bug #25597667: REMOVE MY_BOOL
Browse files Browse the repository at this point in the history
Replace my_bool with bool everywhere.

Change-Id: Ibfe9f9b4a05d8ee82d09ffdc4f1f038ec4555b89
  • Loading branch information
Steinar H. Gunderson committed Feb 24, 2017
1 parent 2f7da62 commit 6c174bd
Show file tree
Hide file tree
Showing 451 changed files with 2,730 additions and 2,777 deletions.
4 changes: 2 additions & 2 deletions client/base/abstract_program.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -28,7 +28,7 @@ using std::vector;

extern const char *load_default_groups[];

my_bool Abstract_program::callback_option_parsed(
bool Abstract_program::callback_option_parsed(
int optid,
const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
Expand Down
2 changes: 1 addition & 1 deletion client/base/abstract_program.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Abstract_program : public Options::Composite_options_provider
Redirects call to option_parsed of main Abstract_program instance.
If we have anonymous functions or binding this should be removed.
*/
static my_bool callback_option_parsed(int optid,
static bool callback_option_parsed(int optid,
const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument);

Expand Down
18 changes: 9 additions & 9 deletions client/check/mysqlcheck.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ using std::vector;
#define EX_MYSQLERR 2

static MYSQL mysql_connection, *sock = 0;
static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0,
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1, opt_secure_auth=TRUE;
static bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0,
opt_compress = 0, opt_databases = 0, opt_fast = 0,
opt_medium_check = 0, opt_quick = 0, opt_all_in_1 = 0,
opt_silent = 0, opt_auto_repair = 0, ignore_errors = 0,
tty_password= 0, opt_frm= 0, debug_info_flag= 0, debug_check_flag= 0,
opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1, opt_secure_auth=TRUE;
static uint verbose = 0, opt_mysql_port=0;
static uint opt_enable_cleartext_plugin= 0;
static my_bool using_opt_enable_cleartext_plugin= 0;
static bool using_opt_enable_cleartext_plugin= 0;
static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
Expand Down Expand Up @@ -266,7 +266,7 @@ static void usage(void)


extern "C" {
static my_bool
static bool
get_one_option(int optid, const struct my_option *opt,
char *argument)
{
Expand Down
18 changes: 9 additions & 9 deletions client/check/mysqlcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ namespace Check{

enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };

extern void mysql_check(MYSQL* connection, int what_to_do, my_bool opt_alldbs,
my_bool opt_check_only_changed, my_bool opt_extended,
my_bool opt_databases, my_bool opt_fast,
my_bool opt_medium_check, my_bool opt_quick,
my_bool opt_all_in_1, my_bool opt_silent,
my_bool opt_auto_repair, my_bool ignore_errors,
my_bool opt_frm, my_bool opt_fix_table_names,
my_bool opt_fix_db_names, my_bool opt_upgrade,
my_bool opt_write_binlog, uint verbose,
extern void mysql_check(MYSQL* connection, int what_to_do, bool opt_alldbs,
bool opt_check_only_changed, bool opt_extended,
bool opt_databases, bool opt_fast,
bool opt_medium_check, bool opt_quick,
bool opt_all_in_1, bool opt_silent,
bool opt_auto_repair, bool ignore_errors,
bool opt_frm, bool opt_fix_table_names,
bool opt_fix_db_names, bool opt_upgrade,
bool opt_write_binlog, uint verbose,
std::string opt_skip_database,
std::vector<std::string> arguments,
void (*dberror)(MYSQL *mysql, std::string when));
Expand Down
34 changes: 17 additions & 17 deletions client/check/mysqlcheck_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ using std::vector;
#define KEY_PARTITIONING_CHANGED_STR "KEY () partitioning changed"

static MYSQL *sock= 0;
static my_bool opt_alldbs= 0, opt_check_only_changed= 0, opt_extended= 0,
opt_databases= 0, opt_fast= 0,
opt_medium_check = 0, opt_quick= 0, opt_all_in_1= 0,
opt_silent= 0, opt_auto_repair= 0, ignore_errors= 0,
opt_frm= 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1;
static bool opt_alldbs= 0, opt_check_only_changed= 0, opt_extended= 0,
opt_databases= 0, opt_fast= 0,
opt_medium_check = 0, opt_quick= 0, opt_all_in_1= 0,
opt_silent= 0, opt_auto_repair= 0, ignore_errors= 0,
opt_frm= 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0,
opt_write_binlog= 1;
static uint verbose = 0;
static string opt_skip_database;
int what_to_do = 0;
Expand Down Expand Up @@ -308,7 +308,7 @@ static void print_result()
char prev_alter[MAX_ALTER_STR_SIZE];
uint i;
size_t dot_pos;
my_bool found_error=0, table_rebuild=0;
bool found_error=0, table_rebuild=0;

res = mysql_use_result(sock);
dot_pos= strlen(sock->db) + 1;
Expand All @@ -319,7 +319,7 @@ static void print_result()
for (i = 0; (row = mysql_fetch_row(res)); i++)
{
int changed = strcmp(prev, row[0]);
my_bool status = !strcmp(row[2], "status");
bool status = !strcmp(row[2], "status");

if (status)
{
Expand Down Expand Up @@ -415,15 +415,15 @@ static void print_result()
}

void Mysql::Tools::Check::mysql_check(MYSQL* connection, int what_to_do,
my_bool opt_alldbs,
my_bool opt_check_only_changed, my_bool opt_extended,
my_bool opt_databases, my_bool opt_fast,
my_bool opt_medium_check, my_bool opt_quick,
my_bool opt_all_in_1, my_bool opt_silent,
my_bool opt_auto_repair, my_bool ignore_errors,
my_bool opt_frm, my_bool opt_fix_table_names,
my_bool opt_fix_db_names, my_bool opt_upgrade,
my_bool opt_write_binlog, uint verbose,
bool opt_alldbs,
bool opt_check_only_changed, bool opt_extended,
bool opt_databases, bool opt_fast,
bool opt_medium_check, bool opt_quick,
bool opt_all_in_1, bool opt_silent,
bool opt_auto_repair, bool ignore_errors,
bool opt_frm, bool opt_fix_table_names,
bool opt_fix_db_names, bool opt_upgrade,
bool opt_write_binlog, uint verbose,
std::string opt_skip_database,
std::vector<std::string> arguments,
void (*dberror)(MYSQL *mysql, std::string when))
Expand Down
2 changes: 1 addition & 1 deletion client/get_password.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ char *get_tty_password_ext(const char *opt_message,
* to will not include the eol characters.
*/

static void get_password(char *to,uint length,int fd, my_bool echo)
static void get_password(char *to,uint length,int fd, bool echo)
{
char *pos=to,*end=to+length;

Expand Down
70 changes: 35 additions & 35 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,31 +147,31 @@ enum enum_info_type { INFO_INFO,INFO_ERROR,INFO_RESULT};
typedef enum enum_info_type INFO_TYPE;

static MYSQL mysql; /* The connection */
static my_bool ignore_errors=0,wait_flag=0,quick=0,
connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0,
opt_compress=0, using_opt_local_infile=0,
vertical=0, line_numbers=1, column_names=1,opt_html=0,
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
opt_secure_auth= TRUE,
default_pager_set= 0, opt_sigint_ignore= 0,
auto_vertical_output= 0,
show_warnings= 0, executing_query= 0, interrupted_query= 0,
ignore_spaces= 0, sigint_received= 0, opt_syslog= 0;
static my_bool debug_info_flag, debug_check_flag;
static my_bool column_types_flag;
static my_bool preserve_comments= 0;
static bool ignore_errors=0,wait_flag=0,quick=0,
connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0,
opt_compress=0, using_opt_local_infile=0,
vertical=0, line_numbers=1, column_names=1,opt_html=0,
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
opt_secure_auth= TRUE,
default_pager_set= 0, opt_sigint_ignore= 0,
auto_vertical_output= 0,
show_warnings= 0, executing_query= 0, interrupted_query= 0,
ignore_spaces= 0, sigint_received= 0, opt_syslog= 0;
static bool debug_info_flag, debug_check_flag;
static bool column_types_flag;
static bool preserve_comments= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static uint opt_enable_cleartext_plugin= 0;
static my_bool using_opt_enable_cleartext_plugin= 0;
static bool using_opt_enable_cleartext_plugin= 0;
static uint my_end_arg;
static char * opt_mysql_unix_port=0;
static char *opt_bind_addr = NULL;
static int connect_flag=CLIENT_INTERACTIVE;
static my_bool opt_binary_mode= FALSE;
static my_bool opt_connect_expired_password= FALSE;
static bool opt_binary_mode= FALSE;
static bool opt_connect_expired_password= FALSE;
static char *current_host,*current_db,*current_user=0,*opt_password=0,
*current_prompt=0, *delimiter_str= 0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME,
Expand Down Expand Up @@ -239,15 +239,15 @@ const char *default_dbug_option="d:t:o,/tmp/mysql.trace";
For using this feature in test case, we add the option in debug code.
*/
#ifndef DBUG_OFF
static my_bool opt_build_completion_hash = FALSE;
static bool opt_build_completion_hash = FALSE;
#endif

#ifdef _WIN32
/*
A flag that indicates if --execute buffer has already been converted,
to avoid double conversion on reconnect.
*/
static my_bool execute_buffer_conversion_done= 0;
static bool execute_buffer_conversion_done= 0;

/*
my_win_is_console(...) is quite slow.
Expand All @@ -264,7 +264,7 @@ static uint win_is_console_cache=
(MY_TEST(my_win_is_console(stdout)) * (1 << _fileno(stdout))) |
(MY_TEST(my_win_is_console(stderr)) * (1 << _fileno(stderr)));

static inline my_bool
static inline bool
my_win_is_console_cached(FILE *file)
{
return win_is_console_cache & (1 << _fileno(file));
Expand All @@ -287,8 +287,8 @@ void tee_putc(int c, FILE *file);
static void tee_print_sized_data(const char *, unsigned int, unsigned int, bool);
/* The names of functions that actually do the manipulation. */
static int get_options(int argc,char **argv);
extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
char *argument);
extern "C" bool get_one_option(int optid, const struct my_option *opt,
char *argument);
static int com_quit(String *str,char*),
com_go(String *str,char*), com_ego(String *str,char*),
com_print(String *str,char*),
Expand Down Expand Up @@ -322,7 +322,7 @@ static void init_tee(const char *);
static void end_tee();
static const char* construct_prompt();
static inline void reset_prompt(char *in_string, bool *ml_comment);
static char *get_arg(char *line, my_bool get_next_arg);
static char *get_arg(char *line, bool get_next_arg);
static void init_username();
static void add_int_to_prompt(int toadd);
static int get_result_width(MYSQL_RES *res);
Expand All @@ -333,9 +333,9 @@ static int get_quote_count(const char *line);
typedef Prealloced_array<LEX_STRING, 16> Histignore_patterns;
Histignore_patterns *histignore_patterns;

static my_bool check_histignore(const char *string);
static my_bool parse_histignore();
static my_bool init_hist_patterns();
static bool check_histignore(const char *string);
static bool parse_histignore();
static bool init_hist_patterns();
static void free_hist_patterns();

static void add_filtered_history(const char *string);
Expand Down Expand Up @@ -1939,7 +1939,7 @@ static void usage(int version)
}


my_bool
bool
get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
char *argument)
{
Expand Down Expand Up @@ -3189,7 +3189,7 @@ static void add_filtered_history(const char *string)
*/

static
my_bool check_histignore(const char *string)
bool check_histignore(const char *string)
{
int rc;

Expand Down Expand Up @@ -3220,7 +3220,7 @@ my_bool check_histignore(const char *string)
*/

static
my_bool parse_histignore()
bool parse_histignore()
{
LEX_STRING pattern;

Expand All @@ -3245,7 +3245,7 @@ my_bool parse_histignore()
}

static
my_bool init_hist_patterns()
bool init_hist_patterns()
{
histignore_patterns=
new (std::nothrow) Histignore_patterns(PSI_NOT_INSTRUMENTED);
Expand Down Expand Up @@ -4849,10 +4849,10 @@ com_nowarnings(String *buffer MY_ATTRIBUTE((unused)),
items in the array to zero first.
*/

char *get_arg(char *line, my_bool get_next_arg)
char *get_arg(char *line, bool get_next_arg)
{
char *ptr, *start;
my_bool quoted= 0, valid_arg= 0;
bool quoted= 0, valid_arg= 0;
char qtype= 0;

ptr= line;
Expand Down Expand Up @@ -5019,7 +5019,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
static void
init_connection_options(MYSQL *mysql)
{
my_bool handle_expired= (opt_connect_expired_password || !status.batch) ?
bool handle_expired= (opt_connect_expired_password || !status.batch) ?
TRUE : FALSE;

if (opt_init_command)
Expand Down Expand Up @@ -5374,7 +5374,7 @@ static void remove_cntrl(String &buffer)
void tee_write(FILE *file, const char *s, size_t slen, int flags)
{
#ifdef _WIN32
my_bool is_console= my_win_is_console_cached(file);
bool is_console= my_win_is_console_cached(file);
#endif
const char *se;
for (se= s + slen; s < se; s++)
Expand Down
Loading

0 comments on commit 6c174bd

Please sign in to comment.