#include <string.h>
#include "cgds/safe_alloc.h"
#include "cgds/types.h"
-#include "cgds/Vector.h"
/**
* @brief Cell of a dictionary.
* Usage: HashTable* hashtable_new(<Type> type, UInt hash_size)
*/
#define hashtable_new(type, hsize) \
-{ \
- _hashtable_new(sizeof(type), hsize); \
-}
+ _hashtable_new(sizeof(type), hsize)
/**
* @brief Copy constructor (shallow copy, ok for basic types).
* @brief Lookup element of given key.
* @param hashTable "this" pointer.
* @param key Key of the element to retrieve..
- * @param data 'out' variable to contain the result.
+ * @param data 'out' variable (ptr) to contain the result.
*
* Usage: void hashtable_get(HashTable* hashTable, char* key, void data)
*/
#define hashtable_get(hashTable, key, data) \
{ \
- void* pData = _hashtable_get(hashTable, key); \
- data = *((typeof(&data))pData); \
+ data = (typeof(data))_hashtable_get(hashTable, key); \
}
/**
*/
#define hashtable_set(hashTable, key, data) \
{ \
- typeof((data)) tmp = data; \
+ typeof(data) tmp = data; \
_hashtable_set(hashTable, key, &tmp); \
}