From: Adam Dickmeiss Date: Mon, 30 Nov 2009 14:14:49 +0000 (+0100) Subject: Add const modifier for two ICU utils X-Git-Tag: v4.0.0~101 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=9c0e939209ea21db376876168faa4e6563d3ac16;p=yaz-moved-to-github.git Add const modifier for two ICU utils --- diff --git a/include/yaz/icu_I18N.h b/include/yaz/icu_I18N.h index 303fb67..f50b60a 100644 --- a/include/yaz/icu_I18N.h +++ b/include/yaz/icu_I18N.h @@ -63,8 +63,8 @@ struct icu_buf_utf16 * icu_buf_utf16_clear(struct icu_buf_utf16 * buf16); struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16, size_t capacity); -struct icu_buf_utf16 * icu_buf_utf16_copy(struct icu_buf_utf16 * dest16, - struct icu_buf_utf16 * src16); +struct icu_buf_utf16 *icu_buf_utf16_copy(struct icu_buf_utf16 * dest16, + const struct icu_buf_utf16 * src16); void icu_buf_utf16_destroy(struct icu_buf_utf16 * buf16); @@ -94,8 +94,8 @@ UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16, const char *icu_buf_utf8_to_cstr(struct icu_buf_utf8 *src8); -UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 * dest8, - struct icu_buf_utf16 * src16, +UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 *dest8, + const struct icu_buf_utf16 *src16, UErrorCode * status); struct icu_casemap; diff --git a/src/icu_utf16.c b/src/icu_utf16.c index 55766a2..66f584e 100644 --- a/src/icu_utf16.c +++ b/src/icu_utf16.c @@ -85,7 +85,7 @@ struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16, struct icu_buf_utf16 * icu_buf_utf16_copy(struct icu_buf_utf16 * dest16, - struct icu_buf_utf16 * src16) + const struct icu_buf_utf16 * src16) { if (!dest16 || !src16 || dest16 == src16) return 0; diff --git a/src/icu_utf8.c b/src/icu_utf8.c index 1a4ce74..dda6231 100644 --- a/src/icu_utf8.c +++ b/src/icu_utf8.c @@ -61,7 +61,8 @@ struct icu_buf_utf8 * icu_buf_utf8_resize(struct icu_buf_utf8 * buf8, if (!buf8) return 0; - if (capacity > 0){ + if (capacity > 0) + { if (0 == buf8->utf8) buf8->utf8 = (uint8_t *) xmalloc(sizeof(uint8_t) * capacity); else @@ -133,8 +134,8 @@ UErrorCode icu_utf16_from_utf8_cstr(struct icu_buf_utf16 * dest16, return *status; } -UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 * dest8, - struct icu_buf_utf16 * src16, +UErrorCode icu_utf16_to_utf8(struct icu_buf_utf8 *dest8, + const struct icu_buf_utf16 *src16, UErrorCode * status) { int32_t utf8_len = 0;