From b2e37d9ce12627883ff18ab22ed9d3b6233f6baf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 8 Apr 2011 12:55:28 +1000 Subject: lib/util ucs2_align is identical, put it in common Signed-off-by: Andrew Tridgell --- lib/util/util_str.c | 7 ------- lib/util/util_str_common.c | 7 +++++++ source3/lib/charcnv.c | 7 ------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lib/util/util_str.c b/lib/util/util_str.c index f31a8c5598..7fa531f0e4 100644 --- a/lib/util/util_str.c +++ b/lib/util/util_str.c @@ -249,13 +249,6 @@ _PUBLIC_ bool strequal(const char *s1, const char *s2) return strcasecmp(s1,s2) == 0; } -_PUBLIC_ size_t ucs2_align(const void *base_ptr, const void *p, int flags) -{ - if (flags & (STR_NOALIGN|STR_ASCII)) - return 0; - return PTR_DIFF(p, base_ptr) & 1; -} - /** String replace. **/ diff --git a/lib/util/util_str_common.c b/lib/util/util_str_common.c index e003d73d74..9999ee440e 100644 --- a/lib/util/util_str_common.c +++ b/lib/util/util_str_common.c @@ -52,3 +52,10 @@ _PUBLIC_ int strwicmp(const char *psz1, const char *psz2) } return (*psz1 - *psz2); } + +_PUBLIC_ size_t ucs2_align(const void *base_ptr, const void *p, int flags) +{ + if (flags & (STR_NOALIGN|STR_ASCII)) + return 0; + return PTR_DIFF(p, base_ptr) & 1; +} diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index edcccc25e7..a8719070c3 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -632,13 +632,6 @@ char *strlower_talloc(TALLOC_CTX *ctx, const char *s) { return talloc_strdup_lower(ctx, s); } -size_t ucs2_align(const void *base_ptr, const void *p, int flags) -{ - if (flags & (STR_NOALIGN|STR_ASCII)) - return 0; - return PTR_DIFF(p, base_ptr) & 1; -} - /** * Copy a string from a char* unix src to a dos codepage string destination. -- cgit