summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/dict.h
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-07-18 12:55:39 +0200
committerNiels de Vos <ndevos@redhat.com>2015-07-24 08:08:24 -0700
commit8a4f0de2a6dc5d1a9cbc54bbe9aa25d7e38d4ae7 (patch)
treefa832968c2076b97e8ae83e1b8e9da3c5a75c6d8 /libglusterfs/src/dict.h
parent996926530bc2da34f616d01b8f94c0ed7884aaeb (diff)
dict: merge static/non-static dict_set_* variations
Copy/pasting complete functions for setting one boolean is rather ugly, this can easily be solved with a helper function that gets the boolean as an extra parameter. Also removing dict_set_dynmstr() because there are no callers, and using GF_MALLOC() or GF_CALLOC() to allocate memory for strings is much more preferred. And, as Kaleb pointed out, prefixing functions with an underscore '_' is reserved for libc internals. Renaming the _dict_*() functions for that reason. Change-Id: I8e681954502f17e59c8f5e8a294d3db238d3e5f3 BUG: 1232304 Reported-by: Kaleb KEITHLEY <kkeithle@redhat.com> Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/11716 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/dict.h')
-rw-r--r--libglusterfs/src/dict.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h
index 30c12bd3209..c5b82677e2e 100644
--- a/libglusterfs/src/dict.h
+++ b/libglusterfs/src/dict.h
@@ -63,7 +63,6 @@ typedef struct _data_pair data_pair_t;
struct _data {
unsigned char is_static:1;
unsigned char is_const:1;
- unsigned char is_stdalloc:1;
int32_t len;
char *data;
int32_t refcount;
@@ -142,9 +141,6 @@ uint32_t data_to_uint32 (data_t *data);
uint16_t data_to_uint16 (data_t *data);
uint8_t data_to_uint8 (data_t *data);
-data_t *data_from_ptr (void *value);
-data_t *data_from_static_ptr (void *value);
-
data_t *data_from_int64 (int64_t value);
data_t *data_from_int32 (int32_t value);
data_t *data_from_int16 (int16_t value);
@@ -239,7 +235,6 @@ GF_MUST_CHECK int dict_set_bin (dict_t *this, char *key, void *ptr, size_t size)
GF_MUST_CHECK int dict_set_static_bin (dict_t *this, char *key, void *ptr, size_t size);
GF_MUST_CHECK int dict_set_str (dict_t *this, char *key, char *str);
-GF_MUST_CHECK int dict_set_dynmstr (dict_t *this, char *key, char *str);
GF_MUST_CHECK int dict_set_dynstr (dict_t *this, char *key, char *str);
GF_MUST_CHECK int dict_set_dynstr_with_alloc (dict_t *this, char *key, const char *str);
GF_MUST_CHECK int dict_add_dynstr_with_alloc (dict_t *this, char *key, char *str);