ansification: remove _VOID_PTR

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
This commit is contained in:
Yaakov Selkowitz 2017-12-03 20:45:02 -06:00
parent eea249da3b
commit 0403b9c8c4
18 changed files with 145 additions and 148 deletions

View File

@ -62,7 +62,7 @@ typedef struct
int mb_cur_max; int mb_cur_max;
euc_cs_desc_t *desc; euc_cs_desc_t *desc;
_VOID_PTR data[MAX_CS_NUM]; void *data[MAX_CS_NUM];
} euc_data_t; } euc_data_t;
#if defined (_ICONV_TO_ENCODING_EUC_JP) \ #if defined (_ICONV_TO_ENCODING_EUC_JP) \
@ -100,7 +100,7 @@ static euc_cs_desc_t euc_kr_cs_desc [] =
#endif #endif
#if defined (ICONV_FROM_UCS_CES_EUC) #if defined (ICONV_FROM_UCS_CES_EUC)
static _VOID_PTR static void *
_DEFUN(euc_from_ucs_init, (rptr, encoding), _DEFUN(euc_from_ucs_init, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -160,14 +160,14 @@ error:
_iconv_from_ucs_ces_handlers_table.close (rptr, data); _iconv_from_ucs_ces_handlers_table.close (rptr, data);
return NULL; return NULL;
error1: error1:
_free_r (rptr, (_VOID_PTR)data); _free_r (rptr, (void *)data);
return NULL; return NULL;
} }
static size_t static size_t
_DEFUN(euc_from_ucs_close, (rptr, data), _DEFUN(euc_from_ucs_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
int i; int i;
size_t res = 0; size_t res = 0;
@ -186,7 +186,7 @@ _DEFUN(euc_from_ucs_close, (rptr, data),
static size_t static size_t
_DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
register ucs4_t in, register ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -260,7 +260,7 @@ _DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft),
#endif /* ICONV_FROM_UCS_CES_EUC */ #endif /* ICONV_FROM_UCS_CES_EUC */
#if defined (ICONV_TO_UCS_CES_EUC) #if defined (ICONV_TO_UCS_CES_EUC)
static _VOID_PTR static void *
_DEFUN(euc_to_ucs_init, (rptr, encoding), _DEFUN(euc_to_ucs_init, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -320,14 +320,14 @@ error:
_iconv_to_ucs_ces_handlers_table.close (rptr, data); _iconv_to_ucs_ces_handlers_table.close (rptr, data);
return NULL; return NULL;
error1: error1:
_free_r (rptr, (_VOID_PTR)data); _free_r (rptr, (void *)data);
return NULL; return NULL;
} }
static size_t static size_t
_DEFUN(euc_to_ucs_close, (rptr, data), _DEFUN(euc_to_ucs_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
int i; int i;
size_t res = 0; size_t res = 0;
@ -346,7 +346,7 @@ _DEFUN(euc_to_ucs_close, (rptr, data),
static ucs4_t static ucs4_t
_DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -366,8 +366,8 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft),
for (i = 1; d->desc[i].csname != NULL; i++) for (i = 1; d->desc[i].csname != NULL; i++)
{ {
if (memcmp((const _VOID_PTR)(*inbuf), if (memcmp((const void *)(*inbuf),
(const _VOID_PTR)d->desc[i].prefix, (const void *)d->desc[i].prefix,
d->desc[i].prefixbytes) == 0) d->desc[i].prefixbytes) == 0)
{ {
if (((int)*inbytesleft - d->desc[i].prefixbytes - d->desc[i].bytes) < 0) if (((int)*inbytesleft - d->desc[i].prefixbytes - d->desc[i].bytes) < 0)
@ -433,7 +433,7 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(euc_get_mb_cur_max, (data), _DEFUN(euc_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return ((euc_data_t *)data)->mb_cur_max; return ((euc_data_t *)data)->mb_cur_max;
} }

View File

@ -41,7 +41,7 @@
#if defined (ICONV_FROM_UCS_CES_TABLE_PCS) #if defined (ICONV_FROM_UCS_CES_TABLE_PCS)
static size_t static size_t
_DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
ucs4_t in, ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -64,7 +64,7 @@ _DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft),
outbytesleft); outbytesleft);
} }
static _VOID_PTR static void *
_DEFUN(table_pcs_from_ucs_init, (rptr, encoding), _DEFUN(table_pcs_from_ucs_init, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -75,14 +75,14 @@ _DEFUN(table_pcs_from_ucs_init, (rptr, encoding),
static size_t static size_t
_DEFUN(table_pcs_from_ucs_close, (rptr, data), _DEFUN(table_pcs_from_ucs_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
return _iconv_from_ucs_ces_handlers_table.close (rptr, data); return _iconv_from_ucs_ces_handlers_table.close (rptr, data);
} }
static int static int
_DEFUN(table_pcs_from_ucs_get_mb_cur_max, (data), _DEFUN(table_pcs_from_ucs_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return _iconv_from_ucs_ces_handlers_table.get_mb_cur_max (data); return _iconv_from_ucs_ces_handlers_table.get_mb_cur_max (data);
} }
@ -92,7 +92,7 @@ _DEFUN(table_pcs_from_ucs_get_mb_cur_max, (data),
#if defined (ICONV_TO_UCS_CES_TABLE_PCS) #if defined (ICONV_TO_UCS_CES_TABLE_PCS)
static ucs4_t static ucs4_t
_DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -112,7 +112,7 @@ _DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft),
inbytesleft); inbytesleft);
} }
static _VOID_PTR static void *
_DEFUN(table_pcs_to_ucs_init, (rptr, encoding), _DEFUN(table_pcs_to_ucs_init, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -123,14 +123,14 @@ _DEFUN(table_pcs_to_ucs_init, (rptr, encoding),
static size_t static size_t
_DEFUN(table_pcs_to_ucs_close, (rptr, data), _DEFUN(table_pcs_to_ucs_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
return _iconv_to_ucs_ces_handlers_table.close (rptr, data); return _iconv_to_ucs_ces_handlers_table.close (rptr, data);
} }
static int static int
_DEFUN(table_pcs_to_ucs_get_mb_cur_max, (data), _DEFUN(table_pcs_to_ucs_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return _iconv_to_ucs_ces_handlers_table.get_mb_cur_max (data); return _iconv_to_ucs_ces_handlers_table.get_mb_cur_max (data);
} }

View File

@ -76,19 +76,19 @@ _EXFUN(load_file, (struct _reent *rptr, const char *name, int direction));
static size_t static size_t
_DEFUN(table_close, (rptr, data), _DEFUN(table_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
const iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data; const iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data;
if (ccsp->type == TABLE_EXTERNAL) if (ccsp->type == TABLE_EXTERNAL)
_free_r (rptr, (_VOID_PTR)ccsp->tbl); _free_r (rptr, (void *)ccsp->tbl);
_free_r( rptr, (_VOID_PTR)ccsp); _free_r( rptr, (void *)ccsp);
return 0; return 0;
} }
#if defined (ICONV_FROM_UCS_CES_TABLE) #if defined (ICONV_FROM_UCS_CES_TABLE)
static _VOID_PTR static void *
_DEFUN(table_init_from_ucs, (rptr, encoding), _DEFUN(table_init_from_ucs, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -116,11 +116,11 @@ _DEFUN(table_init_from_ucs, (rptr, encoding),
ccsp->optimization = biccsp->from_ucs_type; ccsp->optimization = biccsp->from_ucs_type;
ccsp->tbl = biccsp->from_ucs; ccsp->tbl = biccsp->from_ucs;
return (_VOID_PTR)ccsp; return (void *)ccsp;
} }
#ifdef _ICONV_ENABLE_EXTERNAL_CCS #ifdef _ICONV_ENABLE_EXTERNAL_CCS
return (_VOID_PTR)load_file (rptr, encoding, 1); return (void *)load_file (rptr, encoding, 1);
#else #else
return NULL; return NULL;
#endif #endif
@ -128,7 +128,7 @@ _DEFUN(table_init_from_ucs, (rptr, encoding),
static size_t static size_t
_DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
ucs4_t in, ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -171,7 +171,7 @@ _DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft),
#endif /* ICONV_FROM_UCS_CES_TABLE */ #endif /* ICONV_FROM_UCS_CES_TABLE */
#if defined (ICONV_TO_UCS_CES_TABLE) #if defined (ICONV_TO_UCS_CES_TABLE)
static _VOID_PTR static void *
_DEFUN(table_init_to_ucs, (rptr, encoding), _DEFUN(table_init_to_ucs, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -199,11 +199,11 @@ _DEFUN(table_init_to_ucs, (rptr, encoding),
ccsp->optimization = biccsp->to_ucs_type; ccsp->optimization = biccsp->to_ucs_type;
ccsp->tbl = biccsp->to_ucs; ccsp->tbl = biccsp->to_ucs;
return (_VOID_PTR)ccsp; return (void *)ccsp;
} }
#ifdef _ICONV_ENABLE_EXTERNAL_CCS #ifdef _ICONV_ENABLE_EXTERNAL_CCS
return (_VOID_PTR)load_file (rptr, encoding, 0); return (void *)load_file (rptr, encoding, 0);
#else #else
return NULL; return NULL;
#endif #endif
@ -211,7 +211,7 @@ _DEFUN(table_init_to_ucs, (rptr, encoding),
static ucs4_t static ucs4_t
_DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -254,7 +254,7 @@ _DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(table_get_mb_cur_max, (data), _DEFUN(table_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return ((iconv_ccs_desc_t *)data)->bits/8; return ((iconv_ccs_desc_t *)data)->bits/8;
} }
@ -490,7 +490,7 @@ _DEFUN(load_file, (rptr, name, direction),
if ((buf = (const unsigned char *)_malloc_r (rptr, hdrlen)) == NULL) if ((buf = (const unsigned char *)_malloc_r (rptr, hdrlen)) == NULL)
goto error2; goto error2;
if (_read_r (rptr, fd, (_VOID_PTR)buf, hdrlen) != hdrlen) if (_read_r (rptr, fd, (void *)buf, hdrlen) != hdrlen)
goto error3; goto error3;
if (_16BIT_ELT (EXTTABLE_VERSION_OFF) != TABLE_VERSION_1 if (_16BIT_ELT (EXTTABLE_VERSION_OFF) != TABLE_VERSION_1
@ -559,33 +559,33 @@ _DEFUN(load_file, (rptr, name, direction),
goto error4; goto error4;
if (_lseek_r (rptr, fd, off, SEEK_SET) == (off_t)-1 if (_lseek_r (rptr, fd, off, SEEK_SET) == (off_t)-1
|| _read_r (rptr, fd, (_VOID_PTR)ccsp->tbl, tbllen) != tbllen) || _read_r (rptr, fd, (void *)ccsp->tbl, tbllen) != tbllen)
goto error5; goto error5;
goto normal_exit; goto normal_exit;
error5: error5:
_free_r (rptr, (_VOID_PTR)ccsp->tbl); _free_r (rptr, (void *)ccsp->tbl);
ccsp->tbl = NULL; ccsp->tbl = NULL;
error4: error4:
_free_r (rptr, (_VOID_PTR)ccsp); _free_r (rptr, (void *)ccsp);
ccsp = NULL; ccsp = NULL;
error3: error3:
normal_exit: normal_exit:
_free_r (rptr, (_VOID_PTR)buf); _free_r (rptr, (void *)buf);
error2: error2:
if (_close_r (rptr, fd) == -1) if (_close_r (rptr, fd) == -1)
{ {
if (ccsp != NULL) if (ccsp != NULL)
{ {
if (ccsp->tbl != NULL) if (ccsp->tbl != NULL)
_free_r (rptr, (_VOID_PTR)ccsp->tbl); _free_r (rptr, (void *)ccsp->tbl);
_free_r (rptr, (_VOID_PTR)ccsp); _free_r (rptr, (void *)ccsp);
} }
ccsp = NULL; ccsp = NULL;
} }
error1: error1:
_free_r (rptr, (_VOID_PTR)fname); _free_r (rptr, (void *)fname);
return ccsp; return ccsp;
} }
#endif #endif

View File

@ -45,7 +45,7 @@
#if defined (ICONV_FROM_UCS_CES_UCS_2_INTERNAL) #if defined (ICONV_FROM_UCS_CES_UCS_2_INTERNAL)
static size_t static size_t
_DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
register ucs4_t in, register ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -67,7 +67,7 @@ _DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UCS_2_INTERNAL) #if defined (ICONV_TO_UCS_CES_UCS_2_INTERNAL)
static ucs4_t static ucs4_t
_DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -90,7 +90,7 @@ _DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(ucs_2_internal_get_mb_cur_max, (data), _DEFUN(ucs_2_internal_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return 2; return 2;
} }

View File

@ -49,7 +49,7 @@
#define UCS_2BE "ucs_2be" #define UCS_2BE "ucs_2be"
#define UCS_2LE "ucs_2le" #define UCS_2LE "ucs_2le"
static _VOID_PTR static void *
_DEFUN(ucs_2_init, (rptr, encoding), _DEFUN(ucs_2_init, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -57,20 +57,20 @@ _DEFUN(ucs_2_init, (rptr, encoding),
int *data; int *data;
if ((data = (int *) _malloc_r(rptr, sizeof (int))) == NULL) if ((data = (int *) _malloc_r(rptr, sizeof (int))) == NULL)
return (_VOID_PTR)NULL; return (void *)NULL;
if (strcmp (encoding, UCS_2LE) == 0) if (strcmp (encoding, UCS_2LE) == 0)
*data = UCS_2_LITTLE_ENDIAN; *data = UCS_2_LITTLE_ENDIAN;
else else
*data = UCS_2_BIG_ENDIAN; *data = UCS_2_BIG_ENDIAN;
return (_VOID_PTR)data; return (void *)data;
} }
static size_t static size_t
_DEFUN(ucs_2_close, (rptr, data), _DEFUN(ucs_2_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
_free_r (rptr, data); _free_r (rptr, data);
return 0; return 0;
@ -79,7 +79,7 @@ _DEFUN(ucs_2_close, (rptr, data),
#if defined (ICONV_FROM_UCS_CES_UCS_2) #if defined (ICONV_FROM_UCS_CES_UCS_2)
static size_t static size_t
_DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
ucs4_t in, ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -106,7 +106,7 @@ _DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UCS_2) #if defined (ICONV_TO_UCS_CES_UCS_2)
static ucs4_t static ucs4_t
_DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -133,7 +133,7 @@ _DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(ucs_2_get_mb_cur_max, (data), _DEFUN(ucs_2_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return 2; return 2;
} }

View File

@ -45,7 +45,7 @@
#if defined (ICONV_FROM_UCS_CES_UCS_4_INTERNAL) #if defined (ICONV_FROM_UCS_CES_UCS_4_INTERNAL)
static size_t static size_t
_DEFUN(ucs_4_internal_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(ucs_4_internal_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
register ucs4_t in, register ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -67,7 +67,7 @@ _DEFUN(ucs_4_internal_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UCS_4_INTERNAL) #if defined (ICONV_TO_UCS_CES_UCS_4_INTERNAL)
static ucs4_t static ucs4_t
_DEFUN(ucs_4_internal_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(ucs_4_internal_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -90,7 +90,7 @@ _DEFUN(ucs_4_internal_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(ucs_4_internal_get_mb_cur_max, (data), _DEFUN(ucs_4_internal_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return 2; return 2;
} }

View File

@ -50,7 +50,7 @@
#define UCS_4BE "ucs_4be" #define UCS_4BE "ucs_4be"
#define UCS_4LE "ucs_4le" #define UCS_4LE "ucs_4le"
static _VOID_PTR static void *
_DEFUN(ucs_4_init, (rptr, encoding), _DEFUN(ucs_4_init, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -58,20 +58,20 @@ _DEFUN(ucs_4_init, (rptr, encoding),
int *data; int *data;
if ((data = (int *)_malloc_r (rptr, sizeof(int))) == NULL) if ((data = (int *)_malloc_r (rptr, sizeof(int))) == NULL)
return (_VOID_PTR)NULL; return (void *)NULL;
if (strcmp (encoding, UCS_4LE) == 0) if (strcmp (encoding, UCS_4LE) == 0)
*data = UCS_4_LITTLE_ENDIAN; *data = UCS_4_LITTLE_ENDIAN;
else else
*data = UCS_4_BIG_ENDIAN; *data = UCS_4_BIG_ENDIAN;
return (_VOID_PTR)data; return (void *)data;
} }
static size_t static size_t
_DEFUN(ucs_4_close, (rptr, data), _DEFUN(ucs_4_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
_free_r(rptr, data); _free_r(rptr, data);
return 0; return 0;
@ -81,7 +81,7 @@ _DEFUN(ucs_4_close, (rptr, data),
#if defined (ICONV_FROM_UCS_CES_UCS_4) #if defined (ICONV_FROM_UCS_CES_UCS_4)
static size_t static size_t
_DEFUN(ucs_4_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(ucs_4_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
ucs4_t in, ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -108,7 +108,7 @@ _DEFUN(ucs_4_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UCS_4) #if defined (ICONV_TO_UCS_CES_UCS_4)
static ucs4_t static ucs4_t
_DEFUN(ucs_4_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(ucs_4_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -135,7 +135,7 @@ _DEFUN(ucs_4_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(ucs_4_get_mb_cur_max, (data), _DEFUN(ucs_4_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return 4; return 4;
} }

View File

@ -41,7 +41,7 @@
#if defined (ICONV_FROM_UCS_CES_US_ASCII) #if defined (ICONV_FROM_UCS_CES_US_ASCII)
static size_t static size_t
_DEFUN(us_ascii_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(us_ascii_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
ucs4_t in, ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -61,7 +61,7 @@ _DEFUN(us_ascii_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_US_ASCII) #if defined (ICONV_TO_UCS_CES_US_ASCII)
static ucs4_t static ucs4_t
_DEFUN(us_ascii_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(us_ascii_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -84,7 +84,7 @@ _DEFUN(us_ascii_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(us_ascii_get_mb_cur_max, (data), _DEFUN(us_ascii_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return 2; return 2;
} }

View File

@ -60,14 +60,14 @@
static size_t static size_t
_DEFUN(utf_16_close, (rptr, data), _DEFUN(utf_16_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
_free_r(rptr, data); _free_r(rptr, data);
return 0; return 0;
} }
#if defined (ICONV_FROM_UCS_CES_UTF_16) #if defined (ICONV_FROM_UCS_CES_UTF_16)
static _VOID_PTR static void *
_DEFUN(utf_16_init_from_ucs, (rptr, encoding), _DEFUN(utf_16_init_from_ucs, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -75,7 +75,7 @@ _DEFUN(utf_16_init_from_ucs, (rptr, encoding),
int *data; int *data;
if ((data = (int *)_malloc_r (rptr, sizeof (int))) == NULL) if ((data = (int *)_malloc_r (rptr, sizeof (int))) == NULL)
return (_VOID_PTR)NULL; return (void *)NULL;
if (strcmp (encoding, UTF_16LE) == 0) if (strcmp (encoding, UTF_16LE) == 0)
*data = UTF16_LITTLE_ENDIAN; *data = UTF16_LITTLE_ENDIAN;
@ -84,12 +84,12 @@ _DEFUN(utf_16_init_from_ucs, (rptr, encoding),
else else
*data = UTF16_SYSTEM_ENDIAN; *data = UTF16_SYSTEM_ENDIAN;
return (_VOID_PTR)data; return (void *)data;
} }
static size_t static size_t
_DEFUN(utf_16_convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(utf_16_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
register ucs4_t in, register ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -169,7 +169,7 @@ _DEFUN(utf_16_convert_from_ucs, (data, in, outbuf, outbytesleft),
#endif /* ICONV_FROM_UCS_CES_UTF_16 */ #endif /* ICONV_FROM_UCS_CES_UTF_16 */
#if defined (ICONV_TO_UCS_CES_UTF_16) #if defined (ICONV_TO_UCS_CES_UTF_16)
static _VOID_PTR static void *
_DEFUN(utf_16_init_to_ucs, (rptr, encoding), _DEFUN(utf_16_init_to_ucs, (rptr, encoding),
struct _reent *rptr, struct _reent *rptr,
const char *encoding) const char *encoding)
@ -177,7 +177,7 @@ _DEFUN(utf_16_init_to_ucs, (rptr, encoding),
int *data; int *data;
if ((data = (int *)_malloc_r (rptr, sizeof (int))) == NULL) if ((data = (int *)_malloc_r (rptr, sizeof (int))) == NULL)
return (_VOID_PTR)NULL; return (void *)NULL;
if (strcmp (encoding, UTF_16BE) == 0) if (strcmp (encoding, UTF_16BE) == 0)
*data = UTF16_BIG_ENDIAN; *data = UTF16_BIG_ENDIAN;
@ -186,12 +186,12 @@ _DEFUN(utf_16_init_to_ucs, (rptr, encoding),
else else
*data = UTF16_UNDEFINED; *data = UTF16_UNDEFINED;
return (_VOID_PTR)data; return (void *)data;
} }
static ucs4_t static ucs4_t
_DEFUN(utf_16_convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(utf_16_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -269,7 +269,7 @@ _DEFUN(utf_16_convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(utf_16_get_mb_cur_max, (data), _DEFUN(utf_16_get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return 6; return 6;
} }

View File

@ -44,7 +44,7 @@
#if defined (ICONV_FROM_UCS_CES_UTF_8) #if defined (ICONV_FROM_UCS_CES_UTF_8)
static size_t static size_t
_DEFUN(convert_from_ucs, (data, in, outbuf, outbytesleft), _DEFUN(convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data, void *data,
register ucs4_t in, register ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft) size_t *outbytesleft)
@ -126,7 +126,7 @@ _DEFUN(convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UTF_8) #if defined (ICONV_TO_UCS_CES_UTF_8)
static ucs4_t static ucs4_t
_DEFUN(convert_to_ucs, (data, inbuf, inbytesleft), _DEFUN(convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft) size_t *inbytesleft)
{ {
@ -260,7 +260,7 @@ _DEFUN(convert_to_ucs, (data, inbuf, inbytesleft),
static int static int
_DEFUN(get_mb_cur_max, (data), _DEFUN(get_mb_cur_max, (data),
_VOID_PTR data) void *data)
{ {
return UTF8_MB_CUR_MAX; return UTF8_MB_CUR_MAX;
} }

View File

@ -163,7 +163,7 @@ _DEFUN(_iconv_resolve_encoding_name, (rptr, cname, path),
p = find_alias (rptr, ca, _iconv_aliases, strlen (_iconv_aliases)); p = find_alias (rptr, ca, _iconv_aliases, strlen (_iconv_aliases));
_free_r (rptr, (_VOID_PTR)ca); _free_r (rptr, (void *)ca);
return p; return p;
} }

View File

@ -63,7 +63,7 @@ typedef struct
* Pointer to conversion-specific data if success. In case of error * Pointer to conversion-specific data if success. In case of error
* returns NULL and sets current thread's/process's errno. * 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 *to,
const char *from)); const char *from));
@ -72,7 +72,7 @@ typedef struct
* *
* PARAMETRS: * PARAMETRS:
* struct _reent *rptr - reent structure of current thread/process; * struct _reent *rptr - reent structure of current thread/process;
* _VOID_PTR data - conversion-specific data. * void *data - conversion-specific data.
* *
* DESCRIPTION: * DESCRIPTION:
* This function is called from iconv_close() to close conversion. * 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()). * thread's/process's errno and returns (size_t)-1 (same as iconv_open()).
*/ */
size_t _EXFNPTR(close, (struct _reent *rptr, size_t _EXFNPTR(close, (struct _reent *rptr,
_VOID_PTR data)); void *data));
/* convert - perform encoding conversion. /* convert - perform encoding conversion.
* *
* PARAMETERS: * PARAMETERS:
* struct _reent *rptr - reent structure of current thread/process. * 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; * const unsigned char **inbuf - input data buffer;
* size_t *inbytesleft - input buffer's length; * size_t *inbytesleft - input buffer's length;
* unsigned char **outbuf - output data buffer; * 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()). * thread's/process's errno and returns (size_t)-1 (same as iconv()).
*/ */
size_t _EXFNPTR(convert, (struct _reent *rptr, size_t _EXFNPTR(convert, (struct _reent *rptr,
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft, size_t *inbytesleft,
unsigned char **outbuf, unsigned char **outbuf,
@ -126,7 +126,7 @@ typedef struct
* get_state - get current shift state. * get_state - get current shift state.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - conversion-specific data; * void *data - conversion-specific data;
* mbstate_t *state - mbstate_t object where shift state will be written; * mbstate_t *state - mbstate_t object where shift state will be written;
* int direction - 0-"from", 1-"to". * int direction - 0-"from", 1-"to".
* *
@ -135,7 +135,7 @@ typedef struct
* If 'direction' is 0, "from" encoding is tested, else * If 'direction' is 0, "from" encoding is tested, else
* "to" encoding is tested. * "to" encoding is tested.
*/ */
_VOID _EXFNPTR(get_state, (_VOID_PTR data, _VOID _EXFNPTR(get_state, (void *data,
mbstate_t *state, mbstate_t *state,
int direction)); int direction));
@ -143,7 +143,7 @@ typedef struct
* set_state - set shift state. * set_state - set shift state.
* *
* PARAMETERS: * 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. * mbstate_t *state - mbstate_t object to which shift state will be set.
* int direction - 0-"from", 1-"to". * int direction - 0-"from", 1-"to".
* *
@ -154,7 +154,7 @@ typedef struct
* "to" encoding is set. * "to" encoding is set.
* Returns 0 if '*state' object has right format, -1 else. * 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, mbstate_t *state,
int direction)); int direction));
@ -162,7 +162,7 @@ typedef struct
* get_mb_cur_max - get maximum character length in bytes. * get_mb_cur_max - get maximum character length in bytes.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - conversion-specific data; * void *data - conversion-specific data;
* int direction - 0-"from", 1-"to". * int direction - 0-"from", 1-"to".
* *
* DESCRIPTION: * DESCRIPTION:
@ -170,14 +170,14 @@ typedef struct
* If 'direction' is 0, "from" encoding is tested, else * If 'direction' is 0, "from" encoding is tested, else
* "to" encoding is tested. * "to" encoding is tested.
*/ */
int _EXFNPTR(get_mb_cur_max, (_VOID_PTR data, int _EXFNPTR(get_mb_cur_max, (void *data,
int direction)); int direction));
/* /*
* is_stateful - is encoding stateful or stateless. * is_stateful - is encoding stateful or stateless.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - conversion-specific data; * void *data - conversion-specific data;
* int direction - 0-"from", 1-"to". * int direction - 0-"from", 1-"to".
* *
* DESCRIPTION: * DESCRIPTION:
@ -185,7 +185,7 @@ typedef struct
* If 'direction' is 0, "from" encoding is tested, else * If 'direction' is 0, "from" encoding is tested, else
* "to" encoding is tested. * "to" encoding is tested.
*/ */
int _EXFNPTR(is_stateful, (_VOID_PTR data, int _EXFNPTR(is_stateful, (void *data,
int direction)); int direction));
} iconv_conversion_handlers_t; } iconv_conversion_handlers_t;
@ -205,7 +205,7 @@ typedef struct
* Conversion-specific data (e.g., points to iconv_ucs_conversion_t * Conversion-specific data (e.g., points to iconv_ucs_conversion_t
* object if UCS-based conversion is used). * object if UCS-based conversion is used).
*/ */
_VOID_PTR data; void *data;
} iconv_conversion_t; } iconv_conversion_t;

View File

@ -165,7 +165,7 @@ _DEFUN(_iconv_open_r, (rptr, to, from),
if ((from = (const char *)_iconv_resolve_encoding_name (rptr, from)) == NULL) 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; return (iconv_t)-1;
} }
@ -187,16 +187,16 @@ _DEFUN(_iconv_open_r, (rptr, to, from),
ic->data = ic->handlers->open (rptr, to, from); ic->data = ic->handlers->open (rptr, to, from);
} }
_free_r (rptr, (_VOID_PTR)to); _free_r (rptr, (void *)to);
_free_r (rptr, (_VOID_PTR)from); _free_r (rptr, (void *)from);
if (ic->data == NULL) if (ic->data == NULL)
{ {
_free_r (rptr, (_VOID_PTR)ic); _free_r (rptr, (void *)ic);
return (iconv_t)-1; 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; 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_null_conversion_handlers
&& ic->handlers != &_iconv_ucs_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) 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; *outbuf += state_null.__count;
*outbytesleft -= state_null.__count; *outbytesleft -= state_null.__count;
@ -295,7 +295,7 @@ _DEFUN(_iconv_close_r, (rptr, cd),
int res; int res;
iconv_conversion_t *ic = (iconv_conversion_t *)cd; 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_null_conversion_handlers
&& ic->handlers != &_iconv_ucs_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); res = (int)ic->handlers->close (rptr, ic->data);
_free_r (rptr, (_VOID_PTR)cd); _free_r (rptr, (void *)cd);
return res; return res;
} }

View File

@ -177,7 +177,7 @@ _DEFUN(_iconv_nls_conv, (rptr, cd, inbuf, inbytesleft, outbuf, outbytesleft),
iconv_conversion_t *ic = (iconv_conversion_t *)cd; iconv_conversion_t *ic = (iconv_conversion_t *)cd;
int flags = ICONV_FAIL_BIT; 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_null_conversion_handlers
&& ic->handlers != &_iconv_ucs_conversion_handlers)) && ic->handlers != &_iconv_ucs_conversion_handlers))
{ {
@ -289,11 +289,11 @@ _DEFUN(iconv_open1, (rptr, to, from),
if (ic->data == NULL) if (ic->data == NULL)
{ {
_free_r (rptr, (_VOID_PTR)ic); _free_r (rptr, (void *)ic);
return (iconv_t)-1; return (iconv_t)-1;
} }
return (_VOID_PTR)ic; return (void *)ic;
} }
/* /*

View File

@ -30,9 +30,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <limits.h> #include <limits.h>
/* void* type for K&R compilers compatibility */
#define _VOID_PTR _PTR
/* Encodings aliases file */ /* Encodings aliases file */
#define ICONV_ALIASES_FNAME "encoding.aliases" #define ICONV_ALIASES_FNAME "encoding.aliases"
/* iconv CCS data path */ /* iconv CCS data path */

View File

@ -35,20 +35,20 @@
static int null_conversion_dummy_data; static int null_conversion_dummy_data;
static _VOID_PTR static void *
_DEFUN(null_conversion_open, (rptr, to, from), _DEFUN(null_conversion_open, (rptr, to, from),
struct _reent *rptr, struct _reent *rptr,
const char *to, const char *to,
const char *from) const char *from)
{ {
return (_VOID_PTR)&null_conversion_dummy_data; return (void *)&null_conversion_dummy_data;
} }
static size_t static size_t
_DEFUN(null_conversion_close, (rptr, data), _DEFUN(null_conversion_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
return 0; return 0;
} }
@ -58,7 +58,7 @@ static size_t
_DEFUN(null_conversion_convert, _DEFUN(null_conversion_convert,
(rptr, data, inbuf, inbytesleft, outbuf, outbytesleft), (rptr, data, inbuf, inbytesleft, outbuf, outbytesleft),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft, size_t *inbytesleft,
unsigned char **outbuf, unsigned char **outbuf,
@ -94,7 +94,7 @@ _DEFUN(null_conversion_convert,
static int static int
_DEFUN(null_conversion_get_mb_cur_max, (data, direction), _DEFUN(null_conversion_get_mb_cur_max, (data, direction),
_VOID_PTR data, void *data,
int direction) int direction)
{ {
return ICONV_MB_LEN_MAX; return ICONV_MB_LEN_MAX;
@ -103,7 +103,7 @@ _DEFUN(null_conversion_get_mb_cur_max, (data, direction),
static _VOID static _VOID
_DEFUN(null_conversion_get_state, (data, state, size), _DEFUN(null_conversion_get_state, (data, state, size),
_VOID_PTR data, void *data,
mbstate_t *state, mbstate_t *state,
int direction) int direction)
{ {
@ -113,7 +113,7 @@ _DEFUN(null_conversion_get_state, (data, state, size),
static int static int
_DEFUN(null_conversion_set_state, (data, state, direction), _DEFUN(null_conversion_set_state, (data, state, direction),
_VOID_PTR data, void *data,
mbstate_t *state, mbstate_t *state,
int direction) int direction)
{ {
@ -122,7 +122,7 @@ _DEFUN(null_conversion_set_state, (data, state, direction),
static int static int
_DEFUN(null_conversion_is_stateful, (data, direction), _DEFUN(null_conversion_is_stateful, (data, direction),
_VOID_PTR data, void *data,
int direction) int direction)
{ {
return 0; return 0;

View File

@ -44,7 +44,7 @@ _EXFUN(find_encoding_name, (const char *searchee,
* UCS-based conversion interface functions implementation. * UCS-based conversion interface functions implementation.
*/ */
static _VOID_PTR static void *
_DEFUN(ucs_based_conversion_open, (rptr, to, from), _DEFUN(ucs_based_conversion_open, (rptr, to, from),
struct _reent *rptr, struct _reent *rptr,
const char *to, const char *to,
@ -97,7 +97,7 @@ _DEFUN(ucs_based_conversion_open, (rptr, to, from),
goto error; goto error;
} }
else else
uc->to_ucs.data = (_VOID_PTR)&fake_data; uc->to_ucs.data = (void *)&fake_data;
/* Initialize "from UCS" CES converter */ /* Initialize "from UCS" CES converter */
@ -108,7 +108,7 @@ _DEFUN(ucs_based_conversion_open, (rptr, to, from),
goto error; goto error;
} }
else else
uc->from_ucs.data = (_VOID_PTR)&fake_data; uc->from_ucs.data = (void *)&fake_data;
return uc; return uc;
@ -116,7 +116,7 @@ error:
if (uc->to_ucs.data != NULL && uc->to_ucs.handlers->close != NULL) if (uc->to_ucs.data != NULL && uc->to_ucs.handlers->close != NULL)
uc->to_ucs.handlers->close (rptr, uc->to_ucs.data); uc->to_ucs.handlers->close (rptr, uc->to_ucs.data);
_free_r (rptr, (_VOID_PTR)uc); _free_r (rptr, (void *)uc);
return NULL; return NULL;
} }
@ -125,7 +125,7 @@ error:
static size_t static size_t
_DEFUN(ucs_based_conversion_close, (rptr, data), _DEFUN(ucs_based_conversion_close, (rptr, data),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data) void *data)
{ {
iconv_ucs_conversion_t *uc; iconv_ucs_conversion_t *uc;
size_t res = 0; size_t res = 0;
@ -137,7 +137,7 @@ _DEFUN(ucs_based_conversion_close, (rptr, data),
if (uc->to_ucs.handlers->close != NULL) if (uc->to_ucs.handlers->close != NULL)
res |= uc->to_ucs.handlers->close (rptr, uc->to_ucs.data); res |= uc->to_ucs.handlers->close (rptr, uc->to_ucs.data);
_free_r (rptr, (_VOID_PTR)data); _free_r (rptr, (void *)data);
return res; return res;
} }
@ -147,7 +147,7 @@ static size_t
_DEFUN(ucs_based_conversion_convert, _DEFUN(ucs_based_conversion_convert,
(rptr, data, inbuf, inbytesleft, outbuf, outbytesleft, flags), (rptr, data, inbuf, inbytesleft, outbuf, outbytesleft, flags),
struct _reent *rptr, struct _reent *rptr,
_VOID_PTR data, void *data,
const unsigned char **inbuf, const unsigned char **inbuf,
size_t *inbytesleft, size_t *inbytesleft,
unsigned char **outbuf, unsigned char **outbuf,
@ -239,7 +239,7 @@ _DEFUN(ucs_based_conversion_convert,
static int static int
_DEFUN(ucs_based_conversion_get_mb_cur_max, (data, direction), _DEFUN(ucs_based_conversion_get_mb_cur_max, (data, direction),
_VOID_PTR data, void *data,
int direction) int direction)
{ {
iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; 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 static _VOID
_DEFUN(ucs_based_conversion_get_state, (data, state, direction), _DEFUN(ucs_based_conversion_get_state, (data, state, direction),
_VOID_PTR data, void *data,
mbstate_t *state, mbstate_t *state,
int direction) int direction)
{ {
@ -281,7 +281,7 @@ _DEFUN(ucs_based_conversion_get_state, (data, state, direction),
static int static int
_DEFUN(ucs_based_conversion_set_state, (data, state, direction), _DEFUN(ucs_based_conversion_set_state, (data, state, direction),
_VOID_PTR data, void *data,
mbstate_t *state, mbstate_t *state,
int direction) int direction)
{ {
@ -303,7 +303,7 @@ _DEFUN(ucs_based_conversion_set_state, (data, state, direction),
static int static int
_DEFUN(ucs_based_conversion_is_stateful, (data, direction), _DEFUN(ucs_based_conversion_is_stateful, (data, direction),
_VOID_PTR data, void *data,
int direction) int direction)
{ {
iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data; iconv_ucs_conversion_t *uc = (iconv_ucs_conversion_t *)data;

View File

@ -68,7 +68,7 @@ typedef struct
* Returns CES-specific data pointer if success. In case of error returns * Returns CES-specific data pointer if success. In case of error returns
* NULL and sets current thread's/process's errno. * 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)); const char *encoding));
/* /*
@ -76,7 +76,7 @@ typedef struct
* *
* PARAMETERS: * PARAMETERS:
* struct _reent *rptr - reent structure of current thread/process; * struct _reent *rptr - reent structure of current thread/process;
* _VOID_PTR data - CES converter-specific data. * void *data - CES converter-specific data.
* *
* DESCRIPTION: * DESCRIPTION:
* Preforms CES converter closing. * * Preforms CES converter closing. *
@ -85,37 +85,37 @@ typedef struct
* sets current thread's/process's errno. * sets current thread's/process's errno.
*/ */
size_t _EXFNPTR(close, (struct _reent *rptr, size_t _EXFNPTR(close, (struct _reent *rptr,
_VOID_PTR data)); void *data));
/* /*
* get_mb_cur_max - get maximum character length in bytes. * get_mb_cur_max - get maximum character length in bytes.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - conversion-specific data; * void *data - conversion-specific data;
* *
* DESCRIPTION: * DESCRIPTION:
* Returns encoding's maximum character length. * 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. * get_state - get current shift state.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - conversion-specific data; * void *data - conversion-specific data;
* mbstate_t *state - mbstate_t object where shift state will be stored; * mbstate_t *state - mbstate_t object where shift state will be stored;
* *
* DESCRIPTION: * DESCRIPTION:
* Returns encoding's current shift sequence. * Returns encoding's current shift sequence.
*/ */
_VOID _EXFNPTR(get_state, (_VOID_PTR data, _VOID _EXFNPTR(get_state, (void *data,
mbstate_t *state)); mbstate_t *state));
/* /*
* set_state - set shift state. * set_state - set shift state.
* *
* PARAMETERS: * 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. * mbstate_t *state - mbstate_t value to which shift state will be set.
* *
* DESCRIPTION: * DESCRIPTION:
@ -123,25 +123,25 @@ typedef struct
* object is zero-object - reset current shift state. * object is zero-object - reset current shift state.
* Returns 0 if '*state' object has right format, -1 else. * 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)); mbstate_t *state));
/* /*
* is_stateful - is encoding stateful state. * is_stateful - is encoding stateful state.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - conversion-specific data; * void *data - conversion-specific data;
* *
* DESCRIPTION: * DESCRIPTION:
* Returns 0 if encoding is stateless, else returns 1. * 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. * convert_to_ucs - convert character to UCS.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - CES converter-specific data; * void *data - CES converter-specific data;
* const unsigned char **inbuf - buffer with input character byte sequence; * const unsigned char **inbuf - buffer with input character byte sequence;
* size_t *inbytesleft - output buffer bytes count. * size_t *inbytesleft - output buffer bytes count.
* *
@ -155,7 +155,7 @@ typedef struct
* returns ICONV_CES_INVALID_CHARACTER. If invalid or incomplete bytes * returns ICONV_CES_INVALID_CHARACTER. If invalid or incomplete bytes
* sequence was met, returns ICONV_CES_BAD_SEQUENCE. * 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, const unsigned char **inbuf,
size_t *inbytesleft)); size_t *inbytesleft));
} iconv_to_ucs_ces_handlers_t; } iconv_to_ucs_ces_handlers_t;
@ -172,32 +172,32 @@ typedef struct
typedef struct typedef struct
{ {
/* Same as in iconv_to_ucs_ces_handlers_t */ /* 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)); const char *encoding));
/* Same as in iconv_to_ucs_ces_handlers_t */ /* Same as in iconv_to_ucs_ces_handlers_t */
size_t _EXFNPTR(close, (struct _reent *rptr, size_t _EXFNPTR(close, (struct _reent *rptr,
_VOID_PTR data)); void *data));
/* Same as in iconv_to_ucs_ces_handlers_t */ /* 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 */ /* 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)); mbstate_t *state));
/* Same as in iconv_to_ucs_ces_handlers_t */ /* 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)); mbstate_t *state));
/* Same as in iconv_to_ucs_ces_handlers_t */ /* 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. * convert_from_ucs - convert UCS character to destination encoding.
* *
* PARAMETERS: * PARAMETERS:
* _VOID_PTR data - CES converter-specific data; * void *data - CES converter-specific data;
* ucs4_t in - input UCS-4 character; * ucs4_t in - input UCS-4 character;
* unsigned char **outbuf - output buffer for the result; * unsigned char **outbuf - output buffer for the result;
* size_t *outbytesleft - output buffer bytes count. * size_t *outbytesleft - output buffer bytes count.
@ -215,7 +215,7 @@ typedef struct
* If there is no corresponding character in destination encoding, returns * If there is no corresponding character in destination encoding, returns
* ICONV_CES_INVALID_CHARACTER. * ICONV_CES_INVALID_CHARACTER.
*/ */
size_t _EXFNPTR(convert_from_ucs, (_VOID_PTR data, size_t _EXFNPTR(convert_from_ucs, (void *data,
ucs4_t in, ucs4_t in,
unsigned char **outbuf, unsigned char **outbuf,
size_t *outbytesleft)); size_t *outbytesleft));
@ -234,7 +234,7 @@ typedef struct
const iconv_to_ucs_ces_handlers_t *handlers; const iconv_to_ucs_ces_handlers_t *handlers;
/* "to_ucs" CES converter-specific data. */ /* "to_ucs" CES converter-specific data. */
_VOID_PTR data; void *data;
} iconv_to_ucs_ces_desc_t; } iconv_to_ucs_ces_desc_t;
@ -250,7 +250,7 @@ typedef struct
const iconv_from_ucs_ces_handlers_t *handlers; const iconv_from_ucs_ces_handlers_t *handlers;
/* "from_ucs" CES converter-specific data. */ /* "from_ucs" CES converter-specific data. */
_VOID_PTR data; void *data;
} iconv_from_ucs_ces_desc_t; } iconv_from_ucs_ces_desc_t;