diff --git a/include/maxscale/filter.h b/include/maxscale/filter.h index 6a24311bd..077138f25 100644 --- a/include/maxscale/filter.h +++ b/include/maxscale/filter.h @@ -88,7 +88,7 @@ typedef struct mxs_filter_object * * @return New filter instance on NULL on error */ - MXS_FILTER*(*createInstance)(const char* name, MXS_CONFIG_PARAMETER * params); + MXS_FILTER*(*createInstance)(const char* name, MXS_CONFIG_PARAMETER* params); /** * Called to create a new user session within the filter @@ -103,7 +103,7 @@ typedef struct mxs_filter_object * * @return New filter session or NULL on error */ - MXS_FILTER_SESSION*(*newSession)(MXS_FILTER * instance, MXS_SESSION * session); + MXS_FILTER_SESSION*(*newSession)(MXS_FILTER * instance, MXS_SESSION* session); /** * @brief Called when a session is closed @@ -113,7 +113,7 @@ typedef struct mxs_filter_object * @param instance Filter instance * @param fsession Filter session */ - void (* closeSession)(MXS_FILTER * instance, MXS_FILTER_SESSION * fsession); + void (* closeSession)(MXS_FILTER* instance, MXS_FILTER_SESSION* fsession); /** * @brief Called when a session is freed @@ -123,7 +123,7 @@ typedef struct mxs_filter_object * @param instance Filter instance * @param fsession Filter session */ - void (* freeSession)(MXS_FILTER * instance, MXS_FILTER_SESSION * fsession); + void (* freeSession)(MXS_FILTER* instance, MXS_FILTER_SESSION* fsession); /** * @brief Sets the downstream component of the filter pipeline @@ -131,7 +131,7 @@ typedef struct mxs_filter_object * @param instance Filter instance * @param fsession Filter session */ - void (* setDownstream)(MXS_FILTER * instance, MXS_FILTER_SESSION * fsession, MXS_DOWNSTREAM * downstream); + void (* setDownstream)(MXS_FILTER* instance, MXS_FILTER_SESSION* fsession, MXS_DOWNSTREAM* downstream); /** * @brief Sets the upstream component of the filter pipeline @@ -139,7 +139,7 @@ typedef struct mxs_filter_object * @param instance Filter instance * @param fsession Filter session */ - void (* setUpstream)(MXS_FILTER * instance, MXS_FILTER_SESSION * fsession, MXS_UPSTREAM * downstream); + void (* setUpstream)(MXS_FILTER* instance, MXS_FILTER_SESSION* fsession, MXS_UPSTREAM* downstream); /** * @brief Called on each query that requires routing @@ -176,7 +176,7 @@ typedef struct mxs_filter_object * @param fsession Filter session, NULL if general information about the filter is queried * @param dcb DCB where the diagnostic information should be written */ - void (* diagnostics)(MXS_FILTER * instance, MXS_FILTER_SESSION * fsession, DCB * dcb); + void (* diagnostics)(MXS_FILTER* instance, MXS_FILTER_SESSION* fsession, DCB* dcb); /** * @brief Called for diagnostic output @@ -188,7 +188,7 @@ typedef struct mxs_filter_object * * @see jansson.h */ - json_t* (*diagnostics_json)(const MXS_FILTER * instance, const MXS_FILTER_SESSION * fsession); + json_t* (*diagnostics_json)(const MXS_FILTER * instance, const MXS_FILTER_SESSION* fsession); /** * @brief Called to obtain the capabilities of the filter @@ -204,7 +204,7 @@ typedef struct mxs_filter_object * * @param instance Filter instance */ - void (* destroyInstance)(MXS_FILTER * instance); + void (* destroyInstance)(MXS_FILTER* instance); } MXS_FILTER_OBJECT; /** diff --git a/include/maxscale/monitor.h b/include/maxscale/monitor.h index 3fe2de6c1..f7b6a4829 100644 --- a/include/maxscale/monitor.h +++ b/include/maxscale/monitor.h @@ -90,7 +90,7 @@ typedef struct mxs_monitor_api * * @param monitor The monitor object. */ - void (* destroyInstance)(MXS_MONITOR_INSTANCE * monitor); + void (* destroyInstance)(MXS_MONITOR_INSTANCE* monitor); /** * @brief Start the monitor @@ -104,8 +104,8 @@ typedef struct mxs_monitor_api * * @return True, if the monitor could be started, false otherwise. */ - bool (* startMonitor)(MXS_MONITOR_INSTANCE * monitor, - const MXS_CONFIG_PARAMETER * params); + bool (* startMonitor)(MXS_MONITOR_INSTANCE* monitor, + const MXS_CONFIG_PARAMETER* params); /** * @brief Stop the monitor @@ -115,7 +115,7 @@ typedef struct mxs_monitor_api * * @param monitor The monitor object */ - void (* stopMonitor)(MXS_MONITOR_INSTANCE * monitor); + void (* stopMonitor)(MXS_MONITOR_INSTANCE* monitor); /** * @brief Write diagnostic information to a DCB. @@ -123,7 +123,7 @@ typedef struct mxs_monitor_api * @param monitor The monitor object. * @param dcb The dcb to write to. */ - void (* diagnostics)(const MXS_MONITOR_INSTANCE * monitor, DCB * dcb); + void (* diagnostics)(const MXS_MONITOR_INSTANCE* monitor, DCB* dcb); /** * @brief Return diagnostic information about the monitor diff --git a/include/maxscale/protocol/mysql.h b/include/maxscale/protocol/mysql.h index 4ce9cda88..c567c4d7f 100644 --- a/include/maxscale/protocol/mysql.h +++ b/include/maxscale/protocol/mysql.h @@ -219,37 +219,37 @@ typedef enum GW_MYSQL_CAPABILITIES_SSL_VERIFY_SERVER_CERT = (1 << 30), GW_MYSQL_CAPABILITIES_REMEMBER_OPTIONS = (1 << 31), GW_MYSQL_CAPABILITIES_CLIENT = ( - GW_MYSQL_CAPABILITIES_CLIENT_MYSQL - | GW_MYSQL_CAPABILITIES_FOUND_ROWS - | GW_MYSQL_CAPABILITIES_LONG_FLAG - | GW_MYSQL_CAPABILITIES_CONNECT_WITH_DB - | GW_MYSQL_CAPABILITIES_LOCAL_FILES - | GW_MYSQL_CAPABILITIES_PLUGIN_AUTH - | GW_MYSQL_CAPABILITIES_TRANSACTIONS - | GW_MYSQL_CAPABILITIES_PROTOCOL_41 - | GW_MYSQL_CAPABILITIES_MULTI_STATEMENTS - | GW_MYSQL_CAPABILITIES_MULTI_RESULTS - | GW_MYSQL_CAPABILITIES_PS_MULTI_RESULTS - | GW_MYSQL_CAPABILITIES_SECURE_CONNECTION), + GW_MYSQL_CAPABILITIES_CLIENT_MYSQL + | GW_MYSQL_CAPABILITIES_FOUND_ROWS + | GW_MYSQL_CAPABILITIES_LONG_FLAG + | GW_MYSQL_CAPABILITIES_CONNECT_WITH_DB + | GW_MYSQL_CAPABILITIES_LOCAL_FILES + | GW_MYSQL_CAPABILITIES_PLUGIN_AUTH + | GW_MYSQL_CAPABILITIES_TRANSACTIONS + | GW_MYSQL_CAPABILITIES_PROTOCOL_41 + | GW_MYSQL_CAPABILITIES_MULTI_STATEMENTS + | GW_MYSQL_CAPABILITIES_MULTI_RESULTS + | GW_MYSQL_CAPABILITIES_PS_MULTI_RESULTS + | GW_MYSQL_CAPABILITIES_SECURE_CONNECTION), GW_MYSQL_CAPABILITIES_SERVER = ( - GW_MYSQL_CAPABILITIES_CLIENT_MYSQL - | GW_MYSQL_CAPABILITIES_FOUND_ROWS - | GW_MYSQL_CAPABILITIES_LONG_FLAG - | GW_MYSQL_CAPABILITIES_CONNECT_WITH_DB - | GW_MYSQL_CAPABILITIES_NO_SCHEMA - | GW_MYSQL_CAPABILITIES_ODBC - | GW_MYSQL_CAPABILITIES_LOCAL_FILES - | GW_MYSQL_CAPABILITIES_IGNORE_SPACE - | GW_MYSQL_CAPABILITIES_PROTOCOL_41 - | GW_MYSQL_CAPABILITIES_INTERACTIVE - | GW_MYSQL_CAPABILITIES_IGNORE_SIGPIPE - | GW_MYSQL_CAPABILITIES_TRANSACTIONS - | GW_MYSQL_CAPABILITIES_RESERVED - | GW_MYSQL_CAPABILITIES_SECURE_CONNECTION - | GW_MYSQL_CAPABILITIES_MULTI_STATEMENTS - | GW_MYSQL_CAPABILITIES_MULTI_RESULTS - | GW_MYSQL_CAPABILITIES_PS_MULTI_RESULTS - | GW_MYSQL_CAPABILITIES_PLUGIN_AUTH), + GW_MYSQL_CAPABILITIES_CLIENT_MYSQL + | GW_MYSQL_CAPABILITIES_FOUND_ROWS + | GW_MYSQL_CAPABILITIES_LONG_FLAG + | GW_MYSQL_CAPABILITIES_CONNECT_WITH_DB + | GW_MYSQL_CAPABILITIES_NO_SCHEMA + | GW_MYSQL_CAPABILITIES_ODBC + | GW_MYSQL_CAPABILITIES_LOCAL_FILES + | GW_MYSQL_CAPABILITIES_IGNORE_SPACE + | GW_MYSQL_CAPABILITIES_PROTOCOL_41 + | GW_MYSQL_CAPABILITIES_INTERACTIVE + | GW_MYSQL_CAPABILITIES_IGNORE_SIGPIPE + | GW_MYSQL_CAPABILITIES_TRANSACTIONS + | GW_MYSQL_CAPABILITIES_RESERVED + | GW_MYSQL_CAPABILITIES_SECURE_CONNECTION + | GW_MYSQL_CAPABILITIES_MULTI_STATEMENTS + | GW_MYSQL_CAPABILITIES_MULTI_RESULTS + | GW_MYSQL_CAPABILITIES_PS_MULTI_RESULTS + | GW_MYSQL_CAPABILITIES_PLUGIN_AUTH), } gw_mysql_capabilities_t; /** diff --git a/include/maxscale/router.h b/include/maxscale/router.h index 73eb71a0e..29bcd9c3e 100644 --- a/include/maxscale/router.h +++ b/include/maxscale/router.h @@ -94,7 +94,7 @@ typedef struct mxs_router_object * * @return New router instance on NULL on error */ - MXS_ROUTER*(*createInstance)(SERVICE * service, MXS_CONFIG_PARAMETER * params); + MXS_ROUTER*(*createInstance)(SERVICE * service, MXS_CONFIG_PARAMETER* params); /** * Called to create a new user session within the router @@ -109,7 +109,7 @@ typedef struct mxs_router_object * * @return New router session or NULL on error */ - MXS_ROUTER_SESSION*(*newSession)(MXS_ROUTER * instance, MXS_SESSION * session); + MXS_ROUTER_SESSION*(*newSession)(MXS_ROUTER * instance, MXS_SESSION* session); /** * @brief Called when a session is closed @@ -119,7 +119,7 @@ typedef struct mxs_router_object * @param instance Router instance * @param router_session Router session */ - void (* closeSession)(MXS_ROUTER * instance, MXS_ROUTER_SESSION * router_session); + void (* closeSession)(MXS_ROUTER* instance, MXS_ROUTER_SESSION* router_session); /** * @brief Called when a session is freed @@ -129,7 +129,7 @@ typedef struct mxs_router_object * @param instance Router instance * @param router_session Router session */ - void (* freeSession)(MXS_ROUTER * instance, MXS_ROUTER_SESSION * router_session); + void (* freeSession)(MXS_ROUTER* instance, MXS_ROUTER_SESSION* router_session); /** * @brief Called on each query that requires routing @@ -152,7 +152,7 @@ typedef struct mxs_router_object * @param instance Router instance * @param dcb DCB where the diagnostic information should be written */ - void (* diagnostics)(MXS_ROUTER * instance, DCB * dcb); + void (* diagnostics)(MXS_ROUTER* instance, DCB* dcb); /** * @brief Called for diagnostic output @@ -175,10 +175,10 @@ typedef struct mxs_router_object * @param queue Response from the server * @param backend_dcb The backend DCB which responded to the query */ - void (* clientReply)(MXS_ROUTER * instance, - MXS_ROUTER_SESSION * router_session, - GWBUF * queue, - DCB * backend_dcb); + void (* clientReply)(MXS_ROUTER* instance, + MXS_ROUTER_SESSION* router_session, + GWBUF* queue, + DCB* backend_dcb); /** * @brief Called when a backend DCB has failed @@ -191,10 +191,10 @@ typedef struct mxs_router_object * * @param succp Pointer to a `bool` which should be set to true for success or false for error */ - void (* handleError)(MXS_ROUTER * instance, - MXS_ROUTER_SESSION * router_session, - GWBUF * errmsgbuf, - DCB * backend_dcb, + void (* handleError)(MXS_ROUTER* instance, + MXS_ROUTER_SESSION* router_session, + GWBUF* errmsgbuf, + DCB* backend_dcb, mxs_error_action_t action, bool* succp); @@ -212,7 +212,7 @@ typedef struct mxs_router_object * * @param instance Router instance */ - void (* destroyInstance)(MXS_ROUTER * instance); + void (* destroyInstance)(MXS_ROUTER* instance); /** * @brief Configure router instance at runtime @@ -233,7 +233,7 @@ typedef struct mxs_router_object * failed. If reconfiguration failed, the state of the router * instance should not be modified. */ - bool (* configureInstance)(MXS_ROUTER * instance, MXS_CONFIG_PARAMETER * params); + bool (* configureInstance)(MXS_ROUTER* instance, MXS_CONFIG_PARAMETER* params); } MXS_ROUTER_OBJECT; /** diff --git a/maxscale-system-test/testconnections.h b/maxscale-system-test/testconnections.h index 1555bd105..8c88cb166 100644 --- a/maxscale-system-test/testconnections.h +++ b/maxscale-system-test/testconnections.h @@ -262,7 +262,7 @@ public: void add_result(bool result, const char* format, ...); /** Same as add_result() but inverted */ - void expect(bool result, const char *format, ...); + void expect(bool result, const char* format, ...); /** * @brief ReadEnv Reads all Maxscale and Master/Slave and Galera setups info from environmental variables diff --git a/maxutils/maxbase/src/logger.cc b/maxutils/maxbase/src/logger.cc index e733cf3b7..807f3f216 100644 --- a/maxutils/maxbase/src/logger.cc +++ b/maxutils/maxbase/src/logger.cc @@ -211,7 +211,7 @@ bool FileLogger::write_header() asctime_r(&tm, time_string); size_t size = ident.length() + 2 * sizeof(' ') + m_filename.length() + 2 * sizeof(' ') + strlen( - time_string); + time_string); char header[size + 2 + 1]; // For the 2 newlines and the trailing NULL. sprintf(header, "\n\n%s %s %s", ident.c_str(), m_filename.c_str(), time_string); diff --git a/server/core/dcb.cc b/server/core/dcb.cc index 418769333..140c33c95 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -2991,7 +2991,7 @@ public: } private: - bool (* m_func)(DCB * dcb, void* data); + bool (* m_func)(DCB* dcb, void* data); void* m_data; int m_more; }; diff --git a/server/core/queryclassifier.cc b/server/core/queryclassifier.cc index 4f1c50eb0..c25ef1491 100644 --- a/server/core/queryclassifier.cc +++ b/server/core/queryclassifier.cc @@ -156,7 +156,7 @@ std::string get_text_ps_id(GWBUF* buffer) bool foreach_table(QueryClassifier& qc, MXS_SESSION* pSession, GWBUF* querybuf, - bool (* func)(QueryClassifier & qc, const std::string&)) + bool (* func)(QueryClassifier& qc, const std::string&)) { bool rval = true; int n_tables; diff --git a/server/core/test/test_modutil.cc b/server/core/test/test_modutil.cc index db07f0423..3d433ef3f 100644 --- a/server/core/test/test_modutil.cc +++ b/server/core/test/test_modutil.cc @@ -587,7 +587,7 @@ void test_large_packets() GWBUF* buffer = gwbuf_append(create_buffer(0x00ffffff), create_buffer(i)); mxb_assert(gwbuf_length(buffer) == 0xffffffUL + i + 8); GWBUF_RTRIM(buffer->next, 1) - GWBUF * complete = modutil_get_complete_packets(&buffer); + GWBUF* complete = modutil_get_complete_packets(&buffer); mxb_assert_message(buffer, "Incomplete buffer is not NULL"); mxb_assert_message(complete, "The complete buffer is not NULL"); mxb_assert_message(gwbuf_length(complete) == 0xffffff + 4, "Length should be correct"); diff --git a/server/modules/filter/cache/cache_storage_api.h b/server/modules/filter/cache/cache_storage_api.h index 09387ab63..0a4e73133 100644 --- a/server/modules/filter/cache/cache_storage_api.h +++ b/server/modules/filter/cache/cache_storage_api.h @@ -169,7 +169,7 @@ typedef struct cache_storage_api * created. */ CACHE_STORAGE* (*createInstance)(const char* name, - const CACHE_STORAGE_CONFIG * config, + const CACHE_STORAGE_CONFIG* config, int argc, char* argv[]); /** diff --git a/server/modules/filter/cache/rules.cc b/server/modules/filter/cache/rules.cc index 4abce0c10..c0348f48e 100644 --- a/server/modules/filter/cache/rules.cc +++ b/server/modules/filter/cache/rules.cc @@ -161,7 +161,7 @@ static bool cache_rules_parse_json(CACHE_RULES* self, json_t* root); typedef bool (* cache_rules_parse_element_t)(CACHE_RULES* self, json_t* object, size_t index); -static bool cache_rules_parse_array(CACHE_RULES* self, json_t* store, const char* name, +static bool cache_rules_parse_array(CACHE_RULES * self, json_t* store, const char* name, cache_rules_parse_element_t); static bool cache_rules_parse_store_element(CACHE_RULES* self, json_t* object, size_t index); static bool cache_rules_parse_use_element(CACHE_RULES* self, json_t* object, size_t index); diff --git a/server/modules/monitor/mariadbmon/cluster_discovery.cc b/server/modules/monitor/mariadbmon/cluster_discovery.cc index d0aebcecf..4b25485ad 100644 --- a/server/modules/monitor/mariadbmon/cluster_discovery.cc +++ b/server/modules/monitor/mariadbmon/cluster_discovery.cc @@ -26,7 +26,7 @@ using maxscale::string_printf; namespace { -using VisitorFunc = std::function; // Used by graph search +using VisitorFunc = std::function; // Used by graph search /** * Generic depth-first search. Iterates through the root and its child nodes (slaves) and runs diff --git a/server/modules/monitor/mariadbmon/mariadbserver.cc b/server/modules/monitor/mariadbmon/mariadbserver.cc index b06840ff9..0f6088164 100644 --- a/server/modules/monitor/mariadbmon/mariadbserver.cc +++ b/server/modules/monitor/mariadbmon/mariadbserver.cc @@ -1267,12 +1267,12 @@ string SlaveStatus::to_string() const slave_sql_running ? "Yes" : "No"); string rval = string_printf( - " Host: %22s, IO/SQL running: %7s, Master ID: %4" PRId64 ", Gtid_IO_Pos: %s, R.Lag: %d", - host_port.c_str(), - running_states.c_str(), - master_server_id, - gtid_io_pos.to_string().c_str(), - seconds_behind_master); + " Host: %22s, IO/SQL running: %7s, Master ID: %4" PRId64 ", Gtid_IO_Pos: %s, R.Lag: %d", + host_port.c_str(), + running_states.c_str(), + master_server_id, + gtid_io_pos.to_string().c_str(), + seconds_behind_master); return rval; } diff --git a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc index 7e14e6333..968d16ac3 100644 --- a/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc +++ b/server/modules/protocol/MySQL/mariadbclient/mysql_client.cc @@ -69,7 +69,7 @@ static int gw_client_hangup_event(DCB* dcb); static char* gw_default_auth(); static int gw_connection_limit(DCB* dcb, int limit); static int MySQLSendHandshake(DCB* dcb); -static int route_by_statement(MXS_SESSION*, uint64_t, GWBUF * *); +static int route_by_statement(MXS_SESSION*, uint64_t, GWBUF**); static void mysql_client_auth_error_handling(DCB* dcb, int auth_val, int packet_number); static int gw_read_do_authentication(DCB* dcb, GWBUF* read_buffer, int nbytes_read); static int gw_read_normal_data(DCB* dcb, GWBUF* read_buffer, int nbytes_read);