From 4ba011266843857bbd3201e5b925a47e88e1808f Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Wed, 12 Sep 2018 17:33:23 +0300 Subject: [PATCH] Deactive some uncrustify settings This only deactivates some of the more heavy-handed features. All files have been formatted with the new settings, which seems to have only affected lines which were not formatted before. --- maxscale-system-test/bug601.cpp | 8 ++++--- .../open_close_connections.cpp | 22 ++++++++++++------- maxscale-system-test/testconnections.h | 4 ++-- .../routing/binlogrouter/blr_master.cc | 2 +- uncrustify.cfg | 16 +++++++------- 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/maxscale-system-test/bug601.cpp b/maxscale-system-test/bug601.cpp index ea3e606cc..57a0f44c7 100644 --- a/maxscale-system-test/bug601.cpp +++ b/maxscale-system-test/bug601.cpp @@ -93,10 +93,12 @@ int main(int argc, char* argv[]) for (int i = 0; i < iterations; i++) { Test->set_timeout(15); - Test->add_result(mysql_change_user(Test->maxscales->conn_rwsplit[0], "user", "pass2", (char *) "test"), + Test->add_result(mysql_change_user(Test->maxscales->conn_rwsplit[0], "user", "pass2", (char*) "test"), "change_user failed! %s", mysql_error(Test->maxscales->conn_rwsplit[0])); - Test->add_result(mysql_change_user(Test->maxscales->conn_rwsplit[0], Test->maxscales->user_name, Test->maxscales->password, - (char *) "test"), "change_user failed! %s", mysql_error(Test->maxscales->conn_rwsplit[0])); + Test->add_result(mysql_change_user(Test->maxscales->conn_rwsplit[0], Test->maxscales->user_name, + Test->maxscales->password, + (char*) "test"), "change_user failed! %s", + mysql_error(Test->maxscales->conn_rwsplit[0])); } Test->tprintf("Waiting for all threads to finish"); diff --git a/maxscale-system-test/open_close_connections.cpp b/maxscale-system-test/open_close_connections.cpp index e4eb53b60..167a8bd9b 100644 --- a/maxscale-system-test/open_close_connections.cpp +++ b/maxscale-system-test/open_close_connections.cpp @@ -79,14 +79,20 @@ void* query_thread1(void* ptr) data->Test->add_result(mysql_errno(conn1), "Error opening RWsplit conn, thread num is %d, iteration %li, error is: %s\n", data->thread_id, data->i, mysql_error(conn1)); - MYSQL *conn2 = data->Test->maxscales->open_readconn_master_connection(0); - data->Test->add_result(mysql_errno(conn2), - "Error opening ReadConn master conn, thread num is %d, iteration %li, error is: %s\n", data->thread_id, - data->i, mysql_error(conn2)); - MYSQL *conn3 = data->Test->maxscales->open_readconn_slave_connection(0); - data->Test->add_result(mysql_errno(conn3), - "Error opening ReadConn master conn, thread num is %d, iteration %li, error is: %s\n", data->thread_id, - data->i, mysql_error(conn3)); + MYSQL* conn2 = data->Test->maxscales->open_readconn_master_connection(0); + data->Test->add_result(mysql_errno( + conn2), + "Error opening ReadConn master conn, thread num is %d, iteration %li, error is: %s\n", + data->thread_id, + data->i, + mysql_error(conn2)); + MYSQL* conn3 = data->Test->maxscales->open_readconn_slave_connection(0); + data->Test->add_result(mysql_errno( + conn3), + "Error opening ReadConn master conn, thread num is %d, iteration %li, error is: %s\n", + data->thread_id, + data->i, + mysql_error(conn3)); // USE test here is a hack to prevent Maxscale from failure; should be removed when fixed if (conn1 != NULL) { diff --git a/maxscale-system-test/testconnections.h b/maxscale-system-test/testconnections.h index 7c87f7694..6739d4a02 100644 --- a/maxscale-system-test/testconnections.h +++ b/maxscale-system-test/testconnections.h @@ -274,10 +274,10 @@ public: * @param result 0 if step PASSED * @param format ... message to pring if result is not 0 */ - void add_result(bool result, const char *format, ...) __attribute__((format(printf, 3, 4))); + void add_result(bool result, const char* format, ...) __attribute__ ((format(printf, 3, 4))); /** Same as add_result() but inverted */ - void expect(bool result, const char *format, ...) __attribute__((format(printf, 3, 4))); + void expect(bool result, const char* format, ...) __attribute__ ((format(printf, 3, 4))); /** * @brief ReadEnv Reads all Maxscale and Master/Slave and Galera setups info from environmental variables diff --git a/server/modules/routing/binlogrouter/blr_master.cc b/server/modules/routing/binlogrouter/blr_master.cc index b9fd95843..fef022014 100644 --- a/server/modules/routing/binlogrouter/blr_master.cc +++ b/server/modules/routing/binlogrouter/blr_master.cc @@ -1535,7 +1535,7 @@ static void blr_log_identity(ROUTER_INSTANCE* router) if (router->set_master_hostname) { - master_hostname = MXS_STRDUP(router->set_master_hostname); + master_hostname = MXS_STRDUP(router->set_master_hostname); } else { diff --git a/uncrustify.cfg b/uncrustify.cfg index 6a6bc2925..07d29caf8 100644 --- a/uncrustify.cfg +++ b/uncrustify.cfg @@ -1115,10 +1115,10 @@ nl_func_decl_args = ignore # ignore/add/remove/force nl_func_def_args = ignore # ignore/add/remove/force # Whether to add newline after each ',' in a function declaration if '(' and ')' are in different lines. -nl_func_decl_args_multi_line = true # false/true +nl_func_decl_args_multi_line = false # false/true # Whether to add newline after each ',' in a function definition if '(' and ')' are in different lines. -nl_func_def_args_multi_line = true # false/true +nl_func_def_args_multi_line = false # false/true # Add or remove newline before the ')' in a function declaration. nl_func_decl_end = ignore # ignore/add/remove/force @@ -1151,7 +1151,7 @@ nl_func_call_empty = remove # ignore/add/remove/force nl_func_call_start_multi_line = false # false/true # Whether to add newline after each ',' in a function call if '(' and ')' are in different lines. -nl_func_call_args_multi_line = true # false/true +nl_func_call_args_multi_line = false # false/true # Whether to add newline before ')' in a function call if '(' and ')' are in different lines. nl_func_call_end_multi_line = false # false/true @@ -1429,20 +1429,20 @@ nl_between_annotation = ignore # ignore/add/remove/force # # The position of arithmetic operators in wrapped expressions. -pos_arith = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_arith = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of assignment in wrapped expressions. # Do not affect '=' followed by '{'. -pos_assign = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_assign = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of boolean operators in wrapped expressions. -pos_bool = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_bool = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of comparison operators in wrapped expressions. -pos_compare = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_compare = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of conditional (b ? t : f) operators in wrapped expressions. -pos_conditional = lead # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force +pos_conditional = ignore # ignore/join/lead/lead_break/lead_force/trail/trail_break/trail_force # The position of the comma in wrapped expressions. # nantti: found a bug here. If pos_comma=lead, and long functions are split (ls_func_split_full), comma goes to