projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaz_xml_to_opac: OID for embedded MARC may be given
[yaz-moved-to-github.git]
/
src
/
icu_utf16.c
diff --git
a/src/icu_utf16.c
b/src/icu_utf16.c
index
466f7af
..
3036d0a
100644
(file)
--- a/
src/icu_utf16.c
+++ b/
src/icu_utf16.c
@@
-27,25
+27,24
@@
#include <unicode/ustring.h> /* some more string fcns*/
#include <unicode/uchar.h> /* char names */
#include <unicode/ustring.h> /* some more string fcns*/
#include <unicode/uchar.h> /* char names */
-struct icu_buf_utf16 * icu_buf_utf16_create(size_t capacity)
+struct icu_buf_utf16 *icu_buf_utf16_create(size_t capacity)
{
{
- struct icu_buf_utf16 * buf16
+ struct icu_buf_utf16 *buf16
= (struct icu_buf_utf16 *) xmalloc(sizeof(struct icu_buf_utf16));
= (struct icu_buf_utf16 *) xmalloc(sizeof(struct icu_buf_utf16));
- buf16->utf16 = 0;
buf16->utf16_len = 0;
buf16->utf16_len = 0;
- buf16->utf16_cap = 0;
-
+ buf16->utf16_cap = capacity;
if (capacity > 0)
{
buf16->utf16 = (UChar *) xmalloc(sizeof(UChar) * capacity);
buf16->utf16[0] = (UChar) 0;
if (capacity > 0)
{
buf16->utf16 = (UChar *) xmalloc(sizeof(UChar) * capacity);
buf16->utf16[0] = (UChar) 0;
- buf16->utf16_cap = capacity;
}
}
+ else
+ buf16->utf16 = 0;
return buf16;
}
return buf16;
}
-struct icu_buf_utf16 * icu_buf_utf16_clear(struct icu_buf_utf16 * buf16)
+struct icu_buf_utf16 *icu_buf_utf16_clear(struct icu_buf_utf16 *buf16)
{
if (buf16)
{
{
if (buf16)
{
@@
-56,8
+55,8
@@
struct icu_buf_utf16 * icu_buf_utf16_clear(struct icu_buf_utf16 * buf16)
return buf16;
}
return buf16;
}
-struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16,
- size_t capacity)
+struct icu_buf_utf16 *icu_buf_utf16_resize(struct icu_buf_utf16 *buf16,
+ size_t capacity)
{
if (!buf16)
return 0;
{
if (!buf16)
return 0;
@@
-74,15
+73,14
@@
struct icu_buf_utf16 * icu_buf_utf16_resize(struct icu_buf_utf16 * buf16,
{
xfree(buf16->utf16);
buf16->utf16 = 0;
{
xfree(buf16->utf16);
buf16->utf16 = 0;
- buf16->utf16_len = 0;
}
buf16->utf16_cap = capacity;
return buf16;
}
}
buf16->utf16_cap = capacity;
return buf16;
}
-struct icu_buf_utf16 * icu_buf_utf16_copy(struct icu_buf_utf16 * dest16,
- const struct icu_buf_utf16 * src16)
+struct icu_buf_utf16 *icu_buf_utf16_copy(struct icu_buf_utf16 *dest16,
+ const struct icu_buf_utf16 *src16)
{
if (!dest16 || !src16 || dest16 == src16)
return 0;
{
if (!dest16 || !src16 || dest16 == src16)
return 0;
@@
-98,7
+96,7
@@
struct icu_buf_utf16 * icu_buf_utf16_copy(struct icu_buf_utf16 * dest16,
struct icu_buf_utf16 *icu_buf_utf16_append(struct icu_buf_utf16 *dest16,
struct icu_buf_utf16 *icu_buf_utf16_append(struct icu_buf_utf16 *dest16,
- const struct icu_buf_utf16 * src16)
+ const struct icu_buf_utf16 *src16)
{
assert(dest16);
if (!src16)
{
assert(dest16);
if (!src16)
@@
-117,7
+115,7
@@
struct icu_buf_utf16 *icu_buf_utf16_append(struct icu_buf_utf16 *dest16,
}
}
-void icu_buf_utf16_destroy(struct icu_buf_utf16 * buf16)
+void icu_buf_utf16_destroy(struct icu_buf_utf16 *buf16)
{
if (buf16)
xfree(buf16->utf16);
{
if (buf16)
xfree(buf16->utf16);