diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2017-12-04 05:45:02 +0300 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2018-01-17 20:47:14 +0300 |
commit | 0403b9c8c40a351ba72f587add10669df225680b (patch) | |
tree | 3221e3eb5fe8558abb249ff0d12f335b384b714f /newlib/libc/iconv/lib | |
parent | eea249da3bc81776246ad5163f5eb887afdd3659 (diff) |
ansification: remove _VOID_PTR
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib/libc/iconv/lib')
-rw-r--r-- | newlib/libc/iconv/lib/aliasesi.c | 2 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/conv.h | 28 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/iconv.c | 18 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/iconvnls.c | 6 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/local.h | 3 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/nullconv.c | 16 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/ucsconv.c | 22 | ||||
-rw-r--r-- | newlib/libc/iconv/lib/ucsconv.h | 46 |
8 files changed, 69 insertions, 72 deletions
diff --git a/newlib/libc/iconv/lib/aliasesi.c b/newlib/libc/iconv/lib/aliasesi.c index 1f4f70ffc..7c932e65c 100644 --- a/newlib/libc/iconv/lib/aliasesi.c +++ b/newlib/libc/iconv/lib/aliasesi.c @@ -163,7 +163,7 @@ _DEFUN(_iconv_resolve_encoding_name, (rptr, cname, path), p = find_alias (rptr, ca, _iconv_aliases, strlen (_iconv_aliases)); - _free_r (rptr, (_VOID_PTR)ca); + _free_r (rptr, (void *)ca); return p; } diff --git a/newlib/libc/iconv/lib/conv.h b/newlib/libc/iconv/lib/conv.h index f0088767e..59b6fe810 100644 --- a/newlib/libc/iconv/lib/conv.h +++ b/newlib/libc/iconv/lib/conv.h @@ -63,7 +63,7 @@ typedef struct * Pointer to conversion-specific data if success. In case of error * returns NULL and sets current thread's/process's errno. */ - _VOID_PTR _EXFNPTR(open, (struct _reent *rptr, + void *_EXFNPTR(open, (struct _reent *rptr, const char *to, const char *from)); @@ -72,7 +72,7 @@ typedef struct * * PARAMETRS: * struct _reent *rptr - reent structure of current thread/process; - * _VOID_PTR data - conversion-specific data. + * void *data - conversion-specific data. * * DESCRIPTION: * This function is called from iconv_close() to close conversion. @@ -82,13 +82,13 @@ typedef struct * thread's/process's errno and returns (size_t)-1 (same as iconv_open()). */ size_t _EXFNPTR(close, (struct _reent *rptr, - _VOID_PTR data)); + void *data)); /* convert - perform encoding conversion. * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process. - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * const unsigned char **inbuf - input data buffer; * size_t *inbytesleft - input buffer's length; * unsigned char **outbuf - output data buffer; @@ -115,7 +115,7 @@ typedef struct * thread's/process's errno and returns (size_t)-1 (same as iconv()). */ size_t _EXFNPTR(convert, (struct _reent *rptr, - _VOID_PTR data, + void *data, const unsigned char **inbuf, size_t *inbytesleft, unsigned char **outbuf, @@ -126,7 +126,7 @@ typedef struct * get_state - get current shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t object where shift state will be written; * int direction - 0-"from", 1-"to". * @@ -135,7 +135,7 @@ typedef struct * If 'direction' is 0, "from" encoding is tested, else * "to" encoding is tested. */ - _VOID _EXFNPTR(get_state, (_VOID_PTR data, + _VOID _EXFNPTR(get_state, (void *data, mbstate_t *state, int direction)); @@ -143,7 +143,7 @@ typedef struct * set_state - set shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t object to which shift state will be set. * int direction - 0-"from", 1-"to". * @@ -154,7 +154,7 @@ typedef struct * "to" encoding is set. * Returns 0 if '*state' object has right format, -1 else. */ - int _EXFNPTR(set_state, (_VOID_PTR data, + int _EXFNPTR(set_state, (void *data, mbstate_t *state, int direction)); @@ -162,7 +162,7 @@ typedef struct * get_mb_cur_max - get maximum character length in bytes. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * int direction - 0-"from", 1-"to". * * DESCRIPTION: @@ -170,14 +170,14 @@ typedef struct * If 'direction' is 0, "from" encoding is tested, else * "to" encoding is tested. */ - int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data, + int _EXFNPTR(get_mb_cur_max, (void *data, int direction)); /* * is_stateful - is encoding stateful or stateless. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * int direction - 0-"from", 1-"to". * * DESCRIPTION: @@ -185,7 +185,7 @@ typedef struct * If 'direction' is 0, "from" encoding is tested, else * "to" encoding is tested. */ - int _EXFNPTR(is_stateful, (_VOID_PTR data, + int _EXFNPTR(is_stateful, (void *data, int direction)); } iconv_conversion_handlers_t; @@ -205,7 +205,7 @@ typedef struct * Conversion-specific data (e.g., points to iconv_ucs_conversion_t * object if UCS-based conversion is used). */ - _VOID_PTR data; + void *data; } iconv_conversion_t; diff --git a/newlib/libc/iconv/lib/iconv.c b/newlib/libc/iconv/lib/iconv.c index 7c9b252f3..0cf3cf5ff 100644 --- a/newlib/libc/iconv/lib/iconv.c +++ b/newlib/libc/iconv/lib/iconv.c @@ -165,7 +165,7 @@ _DEFUN(_iconv_open_r, (rptr, to, from), if ((from = (const char *)_iconv_resolve_encoding_name (rptr, from)) == NULL) { - _free_r (rptr, (_VOID_PTR)to); + _free_r (rptr, (void *)to); return (iconv_t)-1; } @@ -187,16 +187,16 @@ _DEFUN(_iconv_open_r, (rptr, to, from), ic->data = ic->handlers->open (rptr, to, from); } - _free_r (rptr, (_VOID_PTR)to); - _free_r (rptr, (_VOID_PTR)from); + _free_r (rptr, (void *)to); + _free_r (rptr, (void *)from); if (ic->data == NULL) { - _free_r (rptr, (_VOID_PTR)ic); + _free_r (rptr, (void *)ic); return (iconv_t)-1; } - return (_VOID_PTR)ic; + return (void *)ic; } @@ -211,7 +211,7 @@ _DEFUN(_iconv_r, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), { iconv_conversion_t *ic = (iconv_conversion_t *)cd; - if ((_VOID_PTR)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL + if ((void *)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL || (ic->handlers != &_iconv_null_conversion_handlers && ic->handlers != &_iconv_ucs_conversion_handlers)) { @@ -249,7 +249,7 @@ _DEFUN(_iconv_r, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), if (*outbytesleft >= state_null.__count) { - memcpy ((_VOID_PTR)(*outbuf), (_VOID_PTR)&state_null, state_null.__count); + memcpy ((void *)(*outbuf), (void *)&state_null, state_null.__count); *outbuf += state_null.__count; *outbytesleft -= state_null.__count; @@ -295,7 +295,7 @@ _DEFUN(_iconv_close_r, (rptr, cd), int res; iconv_conversion_t *ic = (iconv_conversion_t *)cd; - if ((_VOID_PTR)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL + if ((void *)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL || (ic->handlers != &_iconv_null_conversion_handlers && ic->handlers != &_iconv_ucs_conversion_handlers)) { @@ -305,7 +305,7 @@ _DEFUN(_iconv_close_r, (rptr, cd), res = (int)ic->handlers->close (rptr, ic->data); - _free_r (rptr, (_VOID_PTR)cd); + _free_r (rptr, (void *)cd); return res; } diff --git a/newlib/libc/iconv/lib/iconvnls.c b/newlib/libc/iconv/lib/iconvnls.c index fa35cca1a..1996bdd8f 100644 --- a/newlib/libc/iconv/lib/iconvnls.c +++ b/newlib/libc/iconv/lib/iconvnls.c @@ -177,7 +177,7 @@ _DEFUN(_iconv_nls_conv, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft), iconv_conversion_t *ic = (iconv_conversion_t *)cd; int flags = ICONV_FAIL_BIT; - if ((_VOID_PTR)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL + if ((void *)cd == NULL || cd == (iconv_t)-1 || ic->data == NULL || (ic->handlers != &_iconv_null_conversion_handlers && ic->handlers != &_iconv_ucs_conversion_handlers)) { @@ -289,11 +289,11 @@ _DEFUN(iconv_open1, (rptr, to, from), if (ic->data == NULL) { - _free_r (rptr, (_VOID_PTR)ic); + _free_r (rptr, (void *)ic); return (iconv_t)-1; } - return (_VOID_PTR)ic; + return (void *)ic; } /* diff --git a/newlib/libc/iconv/lib/local.h b/newlib/libc/iconv/lib/local.h index 46428ae17..bd9dcddca 100644 --- a/newlib/libc/iconv/lib/local.h +++ b/newlib/libc/iconv/lib/local.h @@ -30,9 +30,6 @@ #include <sys/types.h> #include <limits.h> -/* void* type for K&R compilers compatibility */ -#define _VOID_PTR _PTR - /* Encodings aliases file */ #define ICONV_ALIASES_FNAME "encoding.aliases" /* iconv CCS data path */ diff --git a/newlib/libc/iconv/lib/nullconv.c b/newlib/libc/iconv/lib/nullconv.c index 729007ab0..3c87cbb83 100644 --- a/newlib/libc/iconv/lib/nullconv.c +++ b/newlib/libc/iconv/lib/nullconv.c @@ -35,20 +35,20 @@ static int null_conversion_dummy_data; -static _VOID_PTR +static void * _DEFUN(null_conversion_open, (rptr, to, from), struct _reent *rptr, const char *to, const char *from) { - return (_VOID_PTR)&null_conversion_dummy_data; + return (void *)&null_conversion_dummy_data; } static size_t _DEFUN(null_conversion_close, (rptr, data), struct _reent *rptr, - _VOID_PTR data) + void *data) { return 0; } @@ -58,7 +58,7 @@ static size_t _DEFUN(null_conversion_convert, (rptr, data, inbuf, inbytesleft, outbuf, outbytesleft), struct _reent *rptr, - _VOID_PTR data, + void *data, const unsigned char **inbuf, size_t *inbytesleft, unsigned char **outbuf, @@ -94,7 +94,7 @@ _DEFUN(null_conversion_convert, static int _DEFUN(null_conversion_get_mb_cur_max, (data, direction), - _VOID_PTR data, + void *data, int direction) { return ICONV_MB_LEN_MAX; @@ -103,7 +103,7 @@ _DEFUN(null_conversion_get_mb_cur_max, (data, direction), static _VOID _DEFUN(null_conversion_get_state, (data, state, size), - _VOID_PTR data, + void *data, mbstate_t *state, int direction) { @@ -113,7 +113,7 @@ _DEFUN(null_conversion_get_state, (data, state, size), static int _DEFUN(null_conversion_set_state, (data, state, direction), - _VOID_PTR data, + void *data, mbstate_t *state, int direction) { @@ -122,7 +122,7 @@ _DEFUN(null_conversion_set_state, (data, state, direction), static int _DEFUN(null_conversion_is_stateful, (data, direction), - _VOID_PTR data, + void *data, int direction) { return 0; diff --git a/newlib/libc/iconv/lib/ucsconv.c b/newlib/libc/iconv/lib/ucsconv.c index 7cc65c86c..c91007209 100644 --- a/newlib/libc/iconv/lib/ucsconv.c +++ b/newlib/libc/iconv/lib/ucsconv.c @@ -44,7 +44,7 @@ _EXFUN(find_encoding_name, (const char *searchee, * UCS-based conversion interface functions implementation. */ -static _VOID_PTR +static void * _DEFUN(ucs_based_conversion_open, (rptr, to, from), struct _reent *rptr, const char *to, @@ -97,7 +97,7 @@ _DEFUN(ucs_based_conversion_open, (rptr, to, from), goto error; } else - uc->to_ucs.data = (_VOID_PTR)&fake_data; + uc->to_ucs.data = (void *)&fake_data; /* Initialize "from UCS" CES converter */ @@ -108,7 +108,7 @@ _DEFUN(ucs_based_conversion_open, (rptr, to, from), goto error; } else - uc->from_ucs.data = (_VOID_PTR)&fake_data; + uc->from_ucs.data = (void *)&fake_data; return uc; @@ -116,7 +116,7 @@ error: if (uc->to_ucs.data != NULL && uc->to_ucs.handlers->close != NULL) uc->to_ucs.handlers->close (rptr, uc->to_ucs.data); - _free_r (rptr, (_VOID_PTR)uc); + _free_r (rptr, (void *)uc); return NULL; } @@ -125,7 +125,7 @@ error: static size_t _DEFUN(ucs_based_conversion_close, (rptr, data), struct _reent *rptr, - _VOID_PTR data) + void *data) { iconv_ucs_conversion_t *uc; size_t res = 0; @@ -137,7 +137,7 @@ _DEFUN(ucs_based_conversion_close, (rptr, data), if (uc->to_ucs.handlers->close != NULL) res |= uc->to_ucs.handlers->close (rptr, uc->to_ucs.data); - _free_r (rptr, (_VOID_PTR)data); + _free_r (rptr, (void *)data); return res; } @@ -147,7 +147,7 @@ static size_t _DEFUN(ucs_based_conversion_convert, (rptr, data, inbuf, inbytesleft, outbuf, outbytesleft, flags), struct _reent *rptr, - _VOID_PTR data, + void *data, const unsigned char **inbuf, size_t *inbytesleft, unsigned char **outbuf, @@ -239,7 +239,7 @@ _DEFUN(ucs_based_conversion_convert, static int _DEFUN(ucs_based_conversion_get_mb_cur_max, (data, direction), - _VOID_PTR data, + void *data, int direction) { iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; @@ -253,7 +253,7 @@ _DEFUN(ucs_based_conversion_get_mb_cur_max, (data, direction), static _VOID _DEFUN(ucs_based_conversion_get_state, (data, state, direction), - _VOID_PTR data, + void *data, mbstate_t *state, int direction) { @@ -281,7 +281,7 @@ _DEFUN(ucs_based_conversion_get_state, (data, state, direction), static int _DEFUN(ucs_based_conversion_set_state, (data, state, direction), - _VOID_PTR data, + void *data, mbstate_t *state, int direction) { @@ -303,7 +303,7 @@ _DEFUN(ucs_based_conversion_set_state, (data, state, direction), static int _DEFUN(ucs_based_conversion_is_stateful, (data, direction), - _VOID_PTR data, + void *data, int direction) { iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; diff --git a/newlib/libc/iconv/lib/ucsconv.h b/newlib/libc/iconv/lib/ucsconv.h index cea6d5aa3..d3333161c 100644 --- a/newlib/libc/iconv/lib/ucsconv.h +++ b/newlib/libc/iconv/lib/ucsconv.h @@ -68,7 +68,7 @@ typedef struct * Returns CES-specific data pointer if success. In case of error returns * NULL and sets current thread's/process's errno. */ - _VOID_PTR _EXFNPTR(init, (struct _reent *rptr, + void *_EXFNPTR(init, (struct _reent *rptr, const char *encoding)); /* @@ -76,7 +76,7 @@ typedef struct * * PARAMETERS: * struct _reent *rptr - reent structure of current thread/process; - * _VOID_PTR data - CES converter-specific data. + * void *data - CES converter-specific data. * * DESCRIPTION: * Preforms CES converter closing. * @@ -85,37 +85,37 @@ typedef struct * sets current thread's/process's errno. */ size_t _EXFNPTR(close, (struct _reent *rptr, - _VOID_PTR data)); + void *data)); /* * get_mb_cur_max - get maximum character length in bytes. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * * DESCRIPTION: * Returns encoding's maximum character length. */ - int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data)); + int _EXFNPTR(get_mb_cur_max, (void *data)); /* * get_state - get current shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t object where shift state will be stored; * * DESCRIPTION: * Returns encoding's current shift sequence. */ - _VOID _EXFNPTR(get_state, (_VOID_PTR data, + _VOID _EXFNPTR(get_state, (void *data, mbstate_t *state)); /* * set_state - set shift state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * mbstate_t *state - mbstate_t value to which shift state will be set. * * DESCRIPTION: @@ -123,25 +123,25 @@ typedef struct * object is zero-object - reset current shift state. * Returns 0 if '*state' object has right format, -1 else. */ - int _EXFNPTR(set_state, (_VOID_PTR data, + int _EXFNPTR(set_state, (void *data, mbstate_t *state)); /* * is_stateful - is encoding stateful state. * * PARAMETERS: - * _VOID_PTR data - conversion-specific data; + * void *data - conversion-specific data; * * DESCRIPTION: * Returns 0 if encoding is stateless, else returns 1. */ - int _EXFNPTR(is_stateful, (_VOID_PTR data)); + int _EXFNPTR(is_stateful, (void *data)); /* * convert_to_ucs - convert character to UCS. * * PARAMETERS: - * _VOID_PTR data - CES converter-specific data; + * void *data - CES converter-specific data; * const unsigned char **inbuf - buffer with input character byte sequence; * size_t *inbytesleft - output buffer bytes count. * @@ -155,7 +155,7 @@ typedef struct * returns ICONV_CES_INVALID_CHARACTER. If invalid or incomplete bytes * sequence was met, returns ICONV_CES_BAD_SEQUENCE. */ - ucs4_t _EXFNPTR(convert_to_ucs, (_VOID_PTR data, + ucs4_t _EXFNPTR(convert_to_ucs, (void *data, const unsigned char **inbuf, size_t *inbytesleft)); } iconv_to_ucs_ces_handlers_t; @@ -172,32 +172,32 @@ typedef struct typedef struct { /* Same as in iconv_to_ucs_ces_handlers_t */ - _VOID_PTR _EXFNPTR(init, (struct _reent *rptr, + void *_EXFNPTR(init, (struct _reent *rptr, const char *encoding)); /* Same as in iconv_to_ucs_ces_handlers_t */ size_t _EXFNPTR(close, (struct _reent *rptr, - _VOID_PTR data)); + void *data)); /* Same as in iconv_to_ucs_ces_handlers_t */ - int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data)); + int _EXFNPTR(get_mb_cur_max, (void *data)); /* Same as in iconv_to_ucs_ces_handlers_t */ - _VOID _EXFNPTR(get_state, (_VOID_PTR data, + _VOID _EXFNPTR(get_state, (void *data, mbstate_t *state)); /* Same as in iconv_to_ucs_ces_handlers_t */ - int _EXFNPTR(set_state, (_VOID_PTR data, + int _EXFNPTR(set_state, (void *data, mbstate_t *state)); /* Same as in iconv_to_ucs_ces_handlers_t */ - int _EXFNPTR(is_stateful, (_VOID_PTR data)); + int _EXFNPTR(is_stateful, (void *data)); /* * convert_from_ucs - convert UCS character to destination encoding. * * PARAMETERS: - * _VOID_PTR data - CES converter-specific data; + * void *data - CES converter-specific data; * ucs4_t in - input UCS-4 character; * unsigned char **outbuf - output buffer for the result; * size_t *outbytesleft - output buffer bytes count. @@ -215,7 +215,7 @@ typedef struct * If there is no corresponding character in destination encoding, returns * ICONV_CES_INVALID_CHARACTER. */ - size_t _EXFNPTR(convert_from_ucs, (_VOID_PTR data, + size_t _EXFNPTR(convert_from_ucs, (void *data, ucs4_t in, unsigned char **outbuf, size_t *outbytesleft)); @@ -234,7 +234,7 @@ typedef struct const iconv_to_ucs_ces_handlers_t *handlers; /* "to_ucs" CES converter-specific data. */ - _VOID_PTR data; + void *data; } iconv_to_ucs_ces_desc_t; @@ -250,7 +250,7 @@ typedef struct const iconv_from_ucs_ces_handlers_t *handlers; /* "from_ucs" CES converter-specific data. */ - _VOID_PTR data; + void *data; } iconv_from_ucs_ces_desc_t; |