Compile statistics, thread, users and util as C++
This commit is contained in:
parent
b5c44be4c8
commit
b04e8b93c9
@ -31,7 +31,12 @@ add_library(maxscale-common SHARED
|
||||
service.cc
|
||||
session.cc
|
||||
spinlock.cc
|
||||
thread.c users.c utils.c skygw_utils.cc statistics.c listener.c ssl.c mysql_utils.c mysql_binlog.c modulecmd.c)
|
||||
thread.cc
|
||||
users.cc
|
||||
utils.cc
|
||||
skygw_utils.cc
|
||||
statistics.cc
|
||||
listener.c ssl.c mysql_utils.c mysql_binlog.c modulecmd.c)
|
||||
|
||||
if(WITH_JEMALLOC)
|
||||
target_link_libraries(maxscale-common ${JEMALLOC_LIBRARIES})
|
||||
|
@ -23,7 +23,7 @@
|
||||
* @endverbatim
|
||||
*/
|
||||
|
||||
#include <maxscale/statistics.h>
|
||||
#include "maxscale/statistics.h"
|
||||
#include <string.h>
|
||||
#include <maxscale/alloc.h>
|
||||
#include <maxscale/config.h>
|
@ -37,7 +37,7 @@ USERS *users_alloc()
|
||||
{
|
||||
USERS *rval;
|
||||
|
||||
if ((rval = MXS_CALLOC(1, sizeof(USERS))) == NULL)
|
||||
if ((rval = (USERS*)MXS_CALLOC(1, sizeof(USERS))) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -90,7 +90,7 @@ const char *users_fetch(USERS *users, const char *user)
|
||||
{
|
||||
atomic_add(&users->stats.n_fetches, 1);
|
||||
// TODO: Returning data from the hashtable is not threadsafe.
|
||||
return hashtable_fetch(users->data, (char*)user);
|
||||
return (const char*)hashtable_fetch(users->data, (char*)user);
|
||||
}
|
||||
|
||||
int users_update(USERS *users, const char *user, const char *auth)
|
||||
@ -118,7 +118,7 @@ void users_default_diagnostic(DCB *dcb, SERV_LISTENER *port)
|
||||
if (iter)
|
||||
{
|
||||
dcb_printf(dcb, "User names: ");
|
||||
char *sep = "";
|
||||
const char *sep = "";
|
||||
void *user;
|
||||
|
||||
while ((user = hashtable_next(iter)) != NULL)
|
Loading…
x
Reference in New Issue
Block a user