diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-01-31 15:59:06 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-02-02 15:19:03 +1100 |
commit | 2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2 (patch) | |
tree | ce681728eb91875b60b70d34247a0f07772ec411 /source4/heimdal/base | |
parent | 3d4a9ddc244bd4937af9ff1c6e898ab45a7d28b5 (diff) | |
download | samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.tar.gz samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.tar.bz2 samba-2d9bcc861d6b2cd67d7c6439e90d9ac4a600f0f2.zip |
s4:heimdal: import lorikeet-heimdal-201101310455 (commit aa88eb1a05c4985cc23fb65fc1bad75bdce01c1f)
Diffstat (limited to 'source4/heimdal/base')
-rw-r--r-- | source4/heimdal/base/baselocl.h | 5 | ||||
-rw-r--r-- | source4/heimdal/base/heimbase.c | 2 | ||||
-rw-r--r-- | source4/heimdal/base/heimbase.h | 1 | ||||
-rw-r--r-- | source4/heimdal/base/string.c | 33 | ||||
-rw-r--r-- | source4/heimdal/base/version-script.map | 2 |
5 files changed, 2 insertions, 41 deletions
diff --git a/source4/heimdal/base/baselocl.h b/source4/heimdal/base/baselocl.h index 5f157264c1..b3c81b9460 100644 --- a/source4/heimdal/base/baselocl.h +++ b/source4/heimdal/base/baselocl.h @@ -106,11 +106,6 @@ heim_base_atomic_dec(heim_base_atomic_type *x) /* tagged strings/object/XXX */ #define heim_base_is_tagged(x) (((uintptr_t)(x)) & 0x3) -#define heim_base_is_tagged_string(x) ((((uintptr_t)(x)) & 0x3) == 2) -#define heim_base_make_tagged_string_ptr(x) ((heim_object_t)(((uintptr_t)(x)) | 2)) -#define heim_base_tagged_string_ptr(x) ((char *)(((uintptr_t)(x)) & (~3))) - - #define heim_base_is_tagged_object(x) ((((uintptr_t)(x)) & 0x3) == 1) #define heim_base_make_tagged_object(x, tid) \ ((heim_object_t)((((uintptr_t)(x)) << 5) | ((tid) << 2) | 0x1)) diff --git a/source4/heimdal/base/heimbase.c b/source4/heimdal/base/heimbase.c index b8d5d74a9a..7031af9e49 100644 --- a/source4/heimdal/base/heimbase.c +++ b/source4/heimdal/base/heimbase.c @@ -159,8 +159,6 @@ _heim_get_isa(heim_object_t ptr) if (heim_base_is_tagged(ptr)) { if (heim_base_is_tagged_object(ptr)) return tagged_isa[heim_base_tagged_object_tid(ptr)]; - if (heim_base_is_tagged_string(ptr)) - return &_heim_string_object; heim_abort("not a supported tagged type"); } p = PTR2BASE(ptr); diff --git a/source4/heimdal/base/heimbase.h b/source4/heimdal/base/heimbase.h index 17eb12ea5e..d1ca5aa899 100644 --- a/source4/heimdal/base/heimbase.h +++ b/source4/heimdal/base/heimbase.h @@ -146,7 +146,6 @@ void heim_dict_delete_key(heim_dict_t, heim_object_t); typedef struct heim_string_data *heim_string_t; heim_string_t heim_string_create(const char *); -heim_string_t heim_string_create_with_static(const char *); heim_tid_t heim_string_get_type_id(void); const char * heim_string_get_utf8(heim_string_t); diff --git a/source4/heimdal/base/string.c b/source4/heimdal/base/string.c index 414a9161fa..11e8841153 100644 --- a/source4/heimdal/base/string.c +++ b/source4/heimdal/base/string.c @@ -44,31 +44,20 @@ string_dealloc(void *ptr) static int string_cmp(void *a, void *b) { - if (heim_base_is_tagged_string(a)) - a = heim_base_tagged_string_ptr(a); - if (heim_base_is_tagged_string(b)) - b = heim_base_tagged_string_ptr(b); - return strcmp(a, b); } static unsigned long string_hash(void *ptr) { - const char *s; + const char *s = ptr; unsigned long n; - if (heim_base_is_tagged_string(ptr)) - s = heim_base_tagged_string_ptr(ptr); - else - s = ptr; - for (n = 0; *s; ++s) n += *s; return n; } - struct heim_type_data _heim_string_object = { HEIM_TID_STRING, "string-object", @@ -100,26 +89,6 @@ heim_string_create(const char *string) } /** - * Create a string object from a strings allocated in the text segment. - * - * Note that static string object wont be auto released with - * heim_auto_release(), the allocation policy of the string must - * be manged separately from the returned object. This make this - * function not very useful for strings in allocated from heap or - * stack. In that case you should use heim_string_create(). - * - * @param string the string to create, must be an utf8 string - * - * @return string object - */ - -heim_string_t -heim_string_create_with_static(const char *string) -{ - return heim_base_make_tagged_string_ptr(string); -} - -/** * Return the type ID of string objects * * @return type id of string objects diff --git a/source4/heimdal/base/version-script.map b/source4/heimdal/base/version-script.map index 9886943df1..007052baeb 100644 --- a/source4/heimdal/base/version-script.map +++ b/source4/heimdal/base/version-script.map @@ -12,6 +12,7 @@ HEIMDAL_BASE_1.0 { heim_auto_release_create; heim_auto_release_drain; heim_base_once_f; + heim_cmp; heim_dict_add_value; heim_dict_copy_value; heim_dict_create; @@ -22,7 +23,6 @@ HEIMDAL_BASE_1.0 { heim_string_create; heim_string_get_utf8; heim_number_create; - heim_string_create_with_static; local: *; }; |