diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-12 06:15:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-12 06:15:33 +0400 |
commit | cc1259178b95d084a7ca9e83c90ef0ab97b7fa86 (patch) | |
tree | fb6b69a28ea45fb30373bdc4e387b0eebde4b3ce /intern/utfconv/utfconv.h | |
parent | 5aaf3ede76c91a062d09360301083b6f75a6a89f (diff) |
code cleanup: utfconv library had some quite confusing formatting, also cleared som warnings.
Diffstat (limited to 'intern/utfconv/utfconv.h')
-rw-r--r-- | intern/utfconv/utfconv.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/intern/utfconv/utfconv.h b/intern/utfconv/utfconv.h index 30c0c8a9069..f5ab32cce3e 100644 --- a/intern/utfconv/utfconv.h +++ b/intern/utfconv/utfconv.h @@ -30,7 +30,7 @@ #ifdef __cplusplus -extern "C" { +extern "C" { #endif /** @@ -38,22 +38,22 @@ extern "C" { * @param string-16 pointer to working utf-16 string * @return How many bytes must be allocated includeng NULL. */ -size_t count_utf_8_from_16(const wchar_t * string16); +size_t count_utf_8_from_16(const wchar_t *string16); /** * Counts how many wchar_t (two byte) is requered for for future utf-16 string using utf-8 * @param string-8 pointer to working utf-8 string * @return How many bytes must be allocated includeng NULL. */ -size_t count_utf_16_from_8(const char * string8); +size_t count_utf_16_from_8(const char *string8); /** * conv_utf_*** errors */ -#define UTF_ERROR_NULL_IN 1<<0 /* Error occures when requered parameter is missing*/ -#define UTF_ERROR_ILLCHAR 1<<1 /* Error if character is in illigal UTF rage*/ -#define UTF_ERROR_SMALL 1<<2 /* Passed size is to small. It gives legal string with character missing at the end*/ -#define UTF_ERROR_ILLSEQ 1<<3 /* Error if sequence is broken and doesn't finish*/ +#define UTF_ERROR_NULL_IN 1 << 0 /* Error occures when requered parameter is missing*/ +#define UTF_ERROR_ILLCHAR 1 << 1 /* Error if character is in illigal UTF rage*/ +#define UTF_ERROR_SMALL 1 << 2 /* Passed size is to small. It gives legal string with character missing at the end*/ +#define UTF_ERROR_ILLSEQ 1 << 3 /* Error if sequence is broken and doesn't finish*/ /** * Converts utf-16 string to allocated utf-8 string @@ -62,7 +62,7 @@ size_t count_utf_16_from_8(const char * string8); * @params size8 the allocated size in bytes of out8 * @return Returns any errors occured during conversion. See the block above, */ -int conv_utf_16_to_8(const wchar_t * in16, char * out8, size_t size8); +int conv_utf_16_to_8(const wchar_t *in16, char *out8, size_t size8); /** * Converts utf-8 string to allocated utf-16 string @@ -71,7 +71,7 @@ int conv_utf_16_to_8(const wchar_t * in16, char * out8, size_t size8); * @params size16 the allocated size in wchar_t (two byte) of out16 * @return Returns any errors occured during conversion. See the block above, */ -int conv_utf_8_to_16(const char * in8, wchar_t * out16, size_t size16); +int conv_utf_8_to_16(const char *in8, wchar_t *out16, size_t size16); /** @@ -80,7 +80,7 @@ int conv_utf_8_to_16(const char * in8, wchar_t * out16, size_t size16); * @params add any additional size which will be allocated for new utf-8 string in bytes * @return New allocated and converted utf-8 string or NULL if in16 is 0. */ -char * alloc_utf_8_from_16(const wchar_t * in16, size_t add); +char *alloc_utf_8_from_16(const wchar_t *in16, size_t add); /** * Allocates and converts the utf-16 string from utf-8 @@ -88,14 +88,14 @@ char * alloc_utf_8_from_16(const wchar_t * in16, size_t add); * @params add any additional size which will be allocated for new utf-16 string in wchar_t (two bytes) * @return New allocated and converted utf-16 string or NULL if in8 is 0. */ -wchar_t * alloc_utf16_from_8(const char * in8, size_t add); +wchar_t *alloc_utf16_from_8(const char *in8, size_t add); /* Easy allocation and conversion of new utf-16 string. New string has _16 suffix. Must be deallocated with UTF16_UN_ENCODE in right order*/ -#define UTF16_ENCODE(in8str) if(1){\ - wchar_t * in8str ## _16 = alloc_utf16_from_8((char*)in8str, 0); +#define UTF16_ENCODE(in8str) if (1) { \ + wchar_t *in8str ## _16 = alloc_utf16_from_8((char *)in8str, 0) #define UTF16_UN_ENCODE(in8str) \ - free(in8str ## _16 ); }; + free(in8str ## _16); } (void)0 #ifdef __cplusplus } |