FS-10167: Linux build updated and basic tests work as expected

This commit is contained in:
Shane Bryldt 2017-08-01 17:48:34 -05:00
parent fd3348cafc
commit 077fde224b
6 changed files with 24 additions and 50 deletions

View File

@ -122,7 +122,7 @@ KS_DECLARE(ks_status_t) blade_mastermgr_purge(blade_mastermgr_t *bmmgr, const ch
if (blade_protocol_purge(bp, nodeid)) {
if (!cleanup) ks_hash_create(&cleanup, KS_HASH_MODE_CASE_INSENSITIVE, KS_HASH_FLAG_RWLOCK | KS_HASH_FLAG_DUP_CHECK, bmmgr->pool);
ks_hash_insert(cleanup, key, bp);
ks_hash_insert(cleanup, (void *)key, bp);
}
}
if (cleanup) {
@ -133,7 +133,7 @@ KS_DECLARE(ks_status_t) blade_mastermgr_purge(blade_mastermgr_t *bmmgr, const ch
ks_hash_this(it, (const void **)&key, NULL, (void **)&bp);
ks_log(KS_LOG_DEBUG, "Protocol Removed: %s\n", key);
ks_hash_remove(bmmgr->protocols, key);
ks_hash_remove(bmmgr->protocols, (void *)key);
}
ks_hash_destroy(&cleanup);
}

View File

@ -120,7 +120,7 @@ KS_DECLARE(ks_bool_t) blade_protocol_purge(blade_protocol_t *bp, const char *nod
ks_hash_this(it, (const void **)&key, NULL, (void **)&authorizations);
if (ks_hash_remove(authorizations, nodeid)) {
if (ks_hash_remove(authorizations, (void *)nodeid)) {
ks_log(KS_LOG_DEBUG, "Protocol Channel Authorization Removed: %s from %s@%s/%s\n", nodeid, bp->name, bp->realm, key);
}
}
@ -180,7 +180,7 @@ KS_DECLARE(ks_status_t) blade_protocol_channel_add(blade_protocol_t *bp, const c
ks_hash_write_lock(bp->channels);
if (ks_hash_search(bp->channels, name, KS_UNLOCKED)) {
if (ks_hash_search(bp->channels, (void *)name, KS_UNLOCKED)) {
ret = KS_STATUS_DUPLICATE_OPERATION;
goto done;
}
@ -262,7 +262,7 @@ KS_DECLARE(ks_bool_t) blade_protocol_channel_verify(blade_protocol_t *bp, const
// @todo verify controller, get ks_hash_t* value based on channel, add target to the channels hash
authorizations = (ks_hash_t *)ks_hash_search(bp->channels, (void *)channel, KS_READLOCKED);
if (authorizations) ret = ks_hash_search(authorizations, target, KS_UNLOCKED) != NULL;
if (authorizations) ret = ks_hash_search(authorizations, (void *)target, KS_UNLOCKED) != NULL;
ks_hash_read_unlock(bp->channels);
return ret;

View File

@ -1590,7 +1590,6 @@ done:
ks_bool_t blade_rpcsubscribe_response_handler(blade_rpc_response_t *brpcres, void *data)
{
ks_bool_t ret = KS_FALSE;
blade_rpc_request_t *brpcreq = NULL;
blade_handle_t *bh = NULL;
blade_session_t *bs = NULL;
blade_rpcsubscribe_data_t *temp_data = NULL;
@ -1607,8 +1606,6 @@ ks_bool_t blade_rpcsubscribe_response_handler(blade_rpc_response_t *brpcres, voi
ks_assert(brpcres);
ks_assert(data);
brpcreq = blade_rpc_response_request_get(brpcres);
bh = blade_rpc_response_handle_get(brpcres);
ks_assert(bh);

View File

@ -406,7 +406,6 @@ void command_unsubscribe(blade_handle_t *bh, char *args)
void command_leave(blade_handle_t *bh, char *args)
{
cJSON *params = NULL;
cJSON *channels = NULL;
ks_assert(bh);
ks_assert(args);

View File

@ -45,9 +45,6 @@ extern "C"
KS_DECLARE(cJSON *) cJSON_CreateStringPrintf(const char *fmt, ...);
KS_DECLARE(const char *)cJSON_GetObjectCstr(const cJSON *object, const char *string);
KS_DECLARE(cJSON *) cJSON_CreatePtr(uintptr_t pointer);
KS_DECLARE(uintptr_t) cJSON_GetPtrValue(const cJSON *object);
KS_DECLARE(uintptr_t) cJSON_GetObjectPtr(const cJSON *object, const char *string);
static inline cJSON *ks_json_add_child_obj(cJSON *json, const char *name, cJSON *obj)
{

View File

@ -28,25 +28,6 @@ KS_DECLARE(const char *) cJSON_GetObjectCstr(const cJSON *object, const char *st
return cj->valuestring;
}
KS_DECLARE(cJSON *) cJSON_CreatePtr(uintptr_t pointer)
{
// @todo check for 32bit and use integer storage instead
return cJSON_CreateStringPrintf("%p", (void *)pointer);
}
KS_DECLARE(uintptr_t) cJSON_GetPtrValue(const cJSON *object)
{
// @todo check for 32bit and use integer storage instead
void *pointer = NULL;
if (object && object->type == cJSON_String) sscanf_s(object->valuestring, "%p", &pointer);
return (uintptr_t)pointer;
}
KS_DECLARE(uintptr_t) cJSON_GetObjectPtr(const cJSON *object, const char *string)
{
return cJSON_GetPtrValue(cJSON_GetObjectItem(object, string));
}
/* For Emacs:
* Local Variables:
* mode:c