Commit c6cd61a5 authored by anozdrin/alik@alik's avatar anozdrin/alik@alik

Polishing: generate more warnings and make code warnings-free.

parent 8c55f474
......@@ -61,7 +61,7 @@ client_settings.h:
libexec_PROGRAMS= mysqlmanager
mysqlmanager_CXXFLAGS= -Werror
mysqlmanager_CXXFLAGS= -Wall -Wextra -Werror
mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \
manager.h manager.cc log.h log.cc \
......
......@@ -130,7 +130,7 @@ Instance_name::Instance_name(const LEX_STRING *name)
ER_OUT_OF_RESOURCES Not enough resources to complete the operation
*/
int Show_instances::execute(st_net *net, ulong connection_id)
int Show_instances::execute(st_net *net, ulong /* connection_id */)
{
int err_code;
......@@ -309,7 +309,8 @@ int Show_instance_status::execute_impl(st_net *net, Instance *instance)
}
int Show_instance_status::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_status::send_ok_response(st_net *net,
ulong /* connection_id */)
{
if (send_eof(net) || net_flush(net))
return ER_OUT_OF_RESOURCES;
......@@ -429,7 +430,8 @@ int Show_instance_options::execute_impl(st_net *net, Instance *instance)
}
int Show_instance_options::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_options::send_ok_response(st_net *net,
ulong /* connection_id */)
{
if (send_eof(net) || net_flush(net))
return ER_OUT_OF_RESOURCES;
......@@ -512,7 +514,7 @@ Start_instance::Start_instance(const LEX_STRING *instance_name_arg)
ER_OUT_OF_RESOURCES Not enough resources to complete the operation
*/
int Start_instance::execute_impl(st_net *net, Instance *instance)
int Start_instance::execute_impl(st_net * /* net */, Instance *instance)
{
int err_code;
......@@ -553,7 +555,7 @@ Stop_instance::Stop_instance(const LEX_STRING *instance_name_arg)
ER_OUT_OF_RESOURCES Not enough resources to complete the operation
*/
int Stop_instance::execute_impl(st_net *net, Instance *instance)
int Stop_instance::execute_impl(st_net * /* net */, Instance *instance)
{
int err_code;
......@@ -803,7 +805,7 @@ Drop_instance::Drop_instance(const LEX_STRING *instance_name_arg)
ER_OUT_OF_RESOURCES Not enough resources to complete the operation
*/
int Drop_instance::execute_impl(st_net *net, Instance *instance)
int Drop_instance::execute_impl(st_net * /* net */, Instance *instance)
{
int err_code;
......@@ -899,7 +901,8 @@ int Show_instance_log::execute_impl(st_net *net, Instance *instance)
}
int Show_instance_log::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_log::send_ok_response(st_net *net,
ulong /* connection_id */)
{
if (send_eof(net) || net_flush(net))
return ER_OUT_OF_RESOURCES;
......@@ -1030,7 +1033,8 @@ int Show_instance_log_files::execute_impl(st_net *net, Instance *instance)
}
int Show_instance_log_files::send_ok_response(st_net *net, ulong connection_id)
int Show_instance_log_files::send_ok_response(st_net *net,
ulong /* connection_id */)
{
if (send_eof(net) || net_flush(net))
return ER_OUT_OF_RESOURCES;
......@@ -1689,7 +1693,7 @@ int Unset_option::process_option(Instance *instance, Named_value *option)
Implementation of Syntax_error.
**************************************************************************/
int Syntax_error::execute(st_net *net, ulong connection_id)
int Syntax_error::execute(st_net * /* net */, ulong /* connection_id */)
{
return ER_SYNTAX_ERROR;
}
......@@ -37,6 +37,10 @@
class Show_instances : public Command
{
public:
Show_instances()
{ }
public:
int execute(st_net *net, ulong connection_id);
......@@ -53,6 +57,10 @@ class Show_instances : public Command
class Flush_instances : public Command
{
public:
Flush_instances()
{ }
public:
int execute(st_net *net, ulong connection_id);
};
......@@ -311,6 +319,10 @@ class Abstract_option_cmd : public Command
class Set_option : public Abstract_option_cmd
{
public:
Set_option()
{ }
protected:
virtual bool parse_args(const char **text);
virtual int process_option(Instance *instance, Named_value *option);
......@@ -324,6 +336,10 @@ class Set_option : public Abstract_option_cmd
class Unset_option: public Abstract_option_cmd
{
public:
Unset_option()
{ }
protected:
virtual bool parse_args(const char **text);
virtual int process_option(Instance *instance, Named_value *option);
......@@ -341,6 +357,10 @@ class Unset_option: public Abstract_option_cmd
class Syntax_error : public Command
{
public:
Syntax_error()
{ }
public:
int execute(st_net *net, ulong connection_id);
};
......
......@@ -429,7 +429,7 @@ void Instance::set_crash_flag_n_wake_all()
Instance::Instance(Thread_registry &thread_registry_arg):
crashed(FALSE), configured(FALSE), thread_registry(thread_registry_arg)
thread_registry(thread_registry_arg), crashed(FALSE), configured(FALSE)
{
pthread_mutex_init(&LOCK_instance, 0);
pthread_cond_init(&COND_instance_stopped, 0);
......
......@@ -86,7 +86,7 @@ class Mysql_connection_thread: public Mysql_connection_thread_args
int check_connection();
int do_command();
int dispatch_command(enum enum_server_command command,
const char *text, uint len);
const char *text);
};
......@@ -317,12 +317,12 @@ int Mysql_connection_thread::do_command()
(uchar) *packet;
log_info("connection %d: packet_length=%d, command=%d",
(int) connection_id, (int) packet_length, (int) command);
return dispatch_command(command, packet + 1, packet_length - 1);
return dispatch_command(command, packet + 1);
}
}
int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
const char *packet, uint len)
const char *packet)
{
switch (command) {
case COM_QUIT: // client exit
......
......@@ -274,7 +274,6 @@ Command *parse_command(const char *text)
uint word_len;
LEX_STRING instance_name;
Command *command= 0;
const char *saved_text= text;
Token tok1= shift_token(&text, &word_len);
......
......@@ -186,7 +186,6 @@ int User_map::load(const char *password_file_name, const char **err_msg)
2 + /* for newline */
1]; /* for trailing zero */
User *user;
int rc= 1;
if (my_access(password_file_name, F_OK) != 0)
{
......
......@@ -60,7 +60,7 @@ class User_map
{
public:
Iterator(User_map *user_map_arg) :
cur_idx(0), user_map(user_map_arg)
user_map(user_map_arg), cur_idx(0)
{ }
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment