Browse Source

Merge branch 'master' of https://github.com/acplt/open62541

Leon Urbas 11 years ago
parent
commit
163039d46c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/ua_namespace.c

+ 4 - 4
src/ua_namespace.c

@@ -56,9 +56,9 @@ UA_Int32 create_ns(namespace **result, uint32_t size) {
 	uint32_t sizePrimeIndex = higher_prime_index(size);
 	size = prime_tab[sizePrimeIndex].prime;
 
-	if (UA_alloc((void *)&ns, sizeof(namespace)) != UA_SUCCESS) return UA_ERR_NO_MEMORY;
+	if (UA_alloc((void **)&ns, sizeof(namespace)) != UA_SUCCESS) return UA_ERR_NO_MEMORY;
   
-	if (UA_alloc((void *)&ns->entries, sizeof(ns_entry) * size) != UA_SUCCESS) {
+	if (UA_alloc((void **)&ns->entries, sizeof(ns_entry) * size) != UA_SUCCESS) {
 		UA_free(ns);
 		return UA_ERR_NO_MEMORY;
 	}
@@ -83,7 +83,7 @@ void empty_ns(namespace *ns) {
 		int nindex = higher_prime_index (1024 / sizeof (ns_entry));
 		int nsize = prime_tab[nindex].prime;
 		UA_free(ns->entries);
-		UA_alloc((void *)&ns->entries, sizeof(ns_entry) * nsize); //FIXME: Check return value
+		UA_alloc((void **)&ns->entries, sizeof(ns_entry) * nsize); //FIXME: Check return value
 		ns->size = nsize;
 		ns->sizePrimeIndex = nindex;
 	}
@@ -105,7 +105,7 @@ UA_Int32 insert_node(namespace *ns, UA_Node *node) {
 	hash_t h = hash(&node->nodeId);
 	ns_entry *slot = find_empty_slot(ns, h);
 #ifdef MULTITHREADING
-	if (UA_alloc((void *)&slot->lock, sizeof(pthread_rwlock_t)) != UA_SUCCESS)
+	if (UA_alloc((void **)&slot->lock, sizeof(pthread_rwlock_t)) != UA_SUCCESS)
 		return UA_ERR_NO_MEMORY;
 	pthread_rwlock_init((pthread_rwlock_t *)slot->lock, NULL);
 #endif