Update monitor APIs

No need to use void* as the types of the arguments in the monitor
functions as the types are known and will always be the same.
This commit is contained in:
Johan Wikman
2016-08-19 11:18:28 +03:00
parent edb5236e2c
commit 3eb25df676
5 changed files with 35 additions and 47 deletions

View File

@ -69,9 +69,9 @@ MODULE_INFO info =
};
/*lint +e14 */
static void *startMonitor(void *, void*);
static void stopMonitor(void *);
static void diagnostics(DCB *, void *);
static void *startMonitor(MONITOR *, const CONFIG_PARAMETER*);
static void stopMonitor(MONITOR *);
static void diagnostics(DCB *, const MONITOR *);
static MONITOR_SERVERS *getServerByNodeId(MONITOR_SERVERS *, long);
static MONITOR_SERVERS *getSlaveOfNodeId(MONITOR_SERVERS *, long);
static MONITOR_SERVERS *get_replication_tree(MONITOR *, int);
@ -140,11 +140,9 @@ GetModuleObject()
* @return A handle to use when interacting with the monitor
*/
static void *
startMonitor(void *arg, void* opt)
startMonitor(MONITOR *monitor, const CONFIG_PARAMETER* params)
{
MONITOR* monitor = (MONITOR*) arg;
MYSQL_MONITOR *handle = (MYSQL_MONITOR*) monitor->handle;
CONFIG_PARAMETER* params = (CONFIG_PARAMETER*) opt;
bool have_events = false, script_error = false;
if (handle)
@ -248,9 +246,8 @@ startMonitor(void *arg, void* opt)
* @param arg Handle on thr running monior
*/
static void
stopMonitor(void *arg)
stopMonitor(MONITOR *mon)
{
MONITOR* mon = (MONITOR*) arg;
MYSQL_MONITOR *handle = (MYSQL_MONITOR *) mon->handle;
handle->shutdown = 1;
@ -263,10 +260,9 @@ stopMonitor(void *arg)
* @param dcb DCB to print diagnostics
* @param arg The monitor handle
*/
static void diagnostics(DCB *dcb, void *arg)
static void diagnostics(DCB *dcb, const MONITOR *mon)
{
MONITOR* mon = (MONITOR*) arg;
MYSQL_MONITOR *handle = (MYSQL_MONITOR *) mon->handle;
const MYSQL_MONITOR *handle = (const MYSQL_MONITOR *) mon->handle;
MONITOR_SERVERS *db;
char *sep;