# HG changeset patch # User Olaf Wintermann # Date 1360157504 -3600 # Node ID cf3757c60c8f5c31c88dc959f21f5363fe0728d3 # Parent af355652f271b27430d505a024fc03d77447f3de fixed macros and ucx_map_store_enc diff -r af355652f271 -r cf3757c60c8f ucx/map.c --- a/ucx/map.c Wed Feb 06 12:55:56 2013 +0100 +++ b/ucx/map.c Wed Feb 06 14:31:44 2013 +0100 @@ -364,7 +364,7 @@ UCX_MAP_FOREACH(v, iter) { k = (char*) iter.cur->key.data; - key = sstr(k); + key = sstrn(k, iter.cur->key.len); if (encoder) { size_t encodedSize; void *encoded = encoder(v, encdata, &encodedSize); diff -r af355652f271 -r cf3757c60c8f ucx/map.h --- a/ucx/map.h Wed Feb 06 12:55:56 2013 +0100 +++ b/ucx/map.h Wed Feb 06 14:31:44 2013 +0100 @@ -72,7 +72,7 @@ #define ucx_map_cstr_put(m, s, d) \ ucx_map_put(m, ucx_key((void*)s, strlen(s)), d) #define ucx_map_int_put(m, i, d) \ - ucx_map_put(m, ucx_key((void*)&i, sizeof(d)), d) + ucx_map_put(m, ucx_key((void*)&i, sizeof(i)), d) #define ucx_map_sstr_get(m, s) \ ucx_map_get(m, ucx_key(s.ptr, s.length)) @@ -86,7 +86,7 @@ #define ucx_map_cstr_remove(m, s) \ ucx_map_remove(m, ucx_key((void*)s, strlen(s))) #define ucx_map_int_remove(m, i) \ - ucx_map_remove(m, ucx_key((void*)&i, sizeof(int))) + ucx_map_remove(m, ucx_key((void*)&i, sizeof(i))) UcxKey ucx_key(void *data, size_t len);