Skip to content

Commit

Permalink
ansification: remove _VOID_PTR
Browse files Browse the repository at this point in the history
Signed-off-by: Yaakov Selkowitz <[email protected]>
  • Loading branch information
yselkowitz committed Jan 17, 2018
1 parent eea249d commit 0403b9c
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 148 deletions.
24 changes: 12 additions & 12 deletions newlib/libc/iconv/ces/euc.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ typedef struct
int mb_cur_max;
euc_cs_desc_t *desc;

_VOID_PTR data[MAX_CS_NUM];
void *data[MAX_CS_NUM];
} euc_data_t;

#if defined (_ICONV_TO_ENCODING_EUC_JP) \
Expand Down Expand Up @@ -100,7 +100,7 @@ static euc_cs_desc_t euc_kr_cs_desc [] =
#endif

#if defined (ICONV_FROM_UCS_CES_EUC)
static _VOID_PTR
static void *
_DEFUN(euc_from_ucs_init, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
Expand Down Expand Up @@ -160,14 +160,14 @@ _DEFUN(euc_from_ucs_init, (rptr, encoding),
_iconv_from_ucs_ces_handlers_table.close (rptr, data);
return NULL;
error1:
_free_r (rptr, (_VOID_PTR)data);
_free_r (rptr, (void *)data);
return NULL;
}

static size_t
_DEFUN(euc_from_ucs_close, (rptr, data),
struct _reent *rptr,
_VOID_PTR data)
void *data)
{
int i;
size_t res = 0;
Expand All @@ -186,7 +186,7 @@ _DEFUN(euc_from_ucs_close, (rptr, data),

static size_t
_DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data,
void *data,
register ucs4_t in,
unsigned char **outbuf,
size_t *outbytesleft)
Expand Down Expand Up @@ -260,7 +260,7 @@ _DEFUN(euc_convert_from_ucs, (data, in, outbuf, outbytesleft),
#endif /* ICONV_FROM_UCS_CES_EUC */

#if defined (ICONV_TO_UCS_CES_EUC)
static _VOID_PTR
static void *
_DEFUN(euc_to_ucs_init, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
Expand Down Expand Up @@ -320,14 +320,14 @@ _DEFUN(euc_to_ucs_init, (rptr, encoding),
_iconv_to_ucs_ces_handlers_table.close (rptr, data);
return NULL;
error1:
_free_r (rptr, (_VOID_PTR)data);
_free_r (rptr, (void *)data);
return NULL;
}

static size_t
_DEFUN(euc_to_ucs_close, (rptr, data),
struct _reent *rptr,
_VOID_PTR data)
void *data)
{
int i;
size_t res = 0;
Expand All @@ -346,7 +346,7 @@ _DEFUN(euc_to_ucs_close, (rptr, data),

static ucs4_t
_DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data,
void *data,
const unsigned char **inbuf,
size_t *inbytesleft)
{
Expand All @@ -366,8 +366,8 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft),

for (i = 1; d->desc[i].csname != NULL; i++)
{
if (memcmp((const _VOID_PTR)(*inbuf),
(const _VOID_PTR)d->desc[i].prefix,
if (memcmp((const void *)(*inbuf),
(const void *)d->desc[i].prefix,
d->desc[i].prefixbytes) == 0)
{
if (((int)*inbytesleft - d->desc[i].prefixbytes - d->desc[i].bytes) < 0)
Expand Down Expand Up @@ -433,7 +433,7 @@ _DEFUN(euc_convert_to_ucs, (data, inbuf, inbytesleft),

static int
_DEFUN(euc_get_mb_cur_max, (data),
_VOID_PTR data)
void *data)
{
return ((euc_data_t *)data)->mb_cur_max;
}
Expand Down
16 changes: 8 additions & 8 deletions newlib/libc/iconv/ces/table-pcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#if defined (ICONV_FROM_UCS_CES_TABLE_PCS)
static size_t
_DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data,
void *data,
ucs4_t in,
unsigned char **outbuf,
size_t *outbytesleft)
Expand All @@ -64,7 +64,7 @@ _DEFUN(table_pcs_convert_from_ucs, (data, in, outbuf, outbytesleft),
outbytesleft);
}

static _VOID_PTR
static void *
_DEFUN(table_pcs_from_ucs_init, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
Expand All @@ -75,14 +75,14 @@ _DEFUN(table_pcs_from_ucs_init, (rptr, encoding),
static size_t
_DEFUN(table_pcs_from_ucs_close, (rptr, data),
struct _reent *rptr,
_VOID_PTR data)
void *data)
{
return _iconv_from_ucs_ces_handlers_table.close (rptr, data);
}

static int
_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);
}
Expand All @@ -92,7 +92,7 @@ _DEFUN(table_pcs_from_ucs_get_mb_cur_max, (data),
#if defined (ICONV_TO_UCS_CES_TABLE_PCS)
static ucs4_t
_DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data,
void *data,
const unsigned char **inbuf,
size_t *inbytesleft)
{
Expand All @@ -112,7 +112,7 @@ _DEFUN(table_pcs_convert_to_ucs, (data, inbuf, inbytesleft),
inbytesleft);
}

static _VOID_PTR
static void *
_DEFUN(table_pcs_to_ucs_init, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
Expand All @@ -123,14 +123,14 @@ _DEFUN(table_pcs_to_ucs_init, (rptr, encoding),
static size_t
_DEFUN(table_pcs_to_ucs_close, (rptr, data),
struct _reent *rptr,
_VOID_PTR data)
void *data)
{
return _iconv_to_ucs_ces_handlers_table.close (rptr, data);
}

static int
_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);
}
Expand Down
40 changes: 20 additions & 20 deletions newlib/libc/iconv/ces/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ _EXFUN(load_file, (struct _reent *rptr, const char *name, int direction));
static size_t
_DEFUN(table_close, (rptr, data),
struct _reent *rptr,
_VOID_PTR data)
void *data)
{
const iconv_ccs_desc_t *ccsp = (iconv_ccs_desc_t *)data;

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;
}

#if defined (ICONV_FROM_UCS_CES_TABLE)
static _VOID_PTR
static void *
_DEFUN(table_init_from_ucs, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
Expand Down Expand Up @@ -116,19 +116,19 @@ _DEFUN(table_init_from_ucs, (rptr, encoding),
ccsp->optimization = biccsp->from_ucs_type;
ccsp->tbl = biccsp->from_ucs;

return (_VOID_PTR)ccsp;
return (void *)ccsp;
}

#ifdef _ICONV_ENABLE_EXTERNAL_CCS
return (_VOID_PTR)load_file (rptr, encoding, 1);
return (void *)load_file (rptr, encoding, 1);
#else
return NULL;
#endif
}

static size_t
_DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data,
void *data,
ucs4_t in,
unsigned char **outbuf,
size_t *outbytesleft)
Expand Down Expand Up @@ -171,7 +171,7 @@ _DEFUN(table_convert_from_ucs, (data, in, outbuf, outbytesleft),
#endif /* ICONV_FROM_UCS_CES_TABLE */

#if defined (ICONV_TO_UCS_CES_TABLE)
static _VOID_PTR
static void *
_DEFUN(table_init_to_ucs, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
Expand Down Expand Up @@ -199,19 +199,19 @@ _DEFUN(table_init_to_ucs, (rptr, encoding),
ccsp->optimization = biccsp->to_ucs_type;
ccsp->tbl = biccsp->to_ucs;

return (_VOID_PTR)ccsp;
return (void *)ccsp;
}

#ifdef _ICONV_ENABLE_EXTERNAL_CCS
return (_VOID_PTR)load_file (rptr, encoding, 0);
return (void *)load_file (rptr, encoding, 0);
#else
return NULL;
#endif
}

static ucs4_t
_DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data,
void *data,
const unsigned char **inbuf,
size_t *inbytesleft)
{
Expand Down Expand Up @@ -254,7 +254,7 @@ _DEFUN(table_convert_to_ucs, (data, inbuf, inbytesleft),

static int
_DEFUN(table_get_mb_cur_max, (data),
_VOID_PTR data)
void *data)
{
return ((iconv_ccs_desc_t *)data)->bits/8;
}
Expand Down Expand Up @@ -490,7 +490,7 @@ _DEFUN(load_file, (rptr, name, direction),
if ((buf = (const unsigned char *)_malloc_r (rptr, hdrlen)) == NULL)
goto error2;

if (_read_r (rptr, fd, (_VOID_PTR)buf, hdrlen) != hdrlen)
if (_read_r (rptr, fd, (void *)buf, hdrlen) != hdrlen)
goto error3;

if (_16BIT_ELT (EXTTABLE_VERSION_OFF) != TABLE_VERSION_1
Expand Down Expand Up @@ -559,33 +559,33 @@ _DEFUN(load_file, (rptr, name, direction),
goto error4;

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 normal_exit;

error5:
_free_r (rptr, (_VOID_PTR)ccsp->tbl);
_free_r (rptr, (void *)ccsp->tbl);
ccsp->tbl = NULL;
error4:
_free_r (rptr, (_VOID_PTR)ccsp);
_free_r (rptr, (void *)ccsp);
ccsp = NULL;
error3:
normal_exit:
_free_r (rptr, (_VOID_PTR)buf);
_free_r (rptr, (void *)buf);
error2:
if (_close_r (rptr, fd) == -1)
{
if (ccsp != NULL)
{
if (ccsp->tbl != NULL)
_free_r (rptr, (_VOID_PTR)ccsp->tbl);
_free_r (rptr, (_VOID_PTR)ccsp);
_free_r (rptr, (void *)ccsp->tbl);
_free_r (rptr, (void *)ccsp);
}
ccsp = NULL;
}
error1:
_free_r (rptr, (_VOID_PTR)fname);
_free_r (rptr, (void *)fname);
return ccsp;
}
#endif
Expand Down
6 changes: 3 additions & 3 deletions newlib/libc/iconv/ces/ucs-2-internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#if defined (ICONV_FROM_UCS_CES_UCS_2_INTERNAL)
static size_t
_DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data,
void *data,
register ucs4_t in,
unsigned char **outbuf,
size_t *outbytesleft)
Expand All @@ -67,7 +67,7 @@ _DEFUN(ucs_2_internal_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UCS_2_INTERNAL)
static ucs4_t
_DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data,
void *data,
const unsigned char **inbuf,
size_t *inbytesleft)
{
Expand All @@ -90,7 +90,7 @@ _DEFUN(ucs_2_internal_convert_to_ucs, (data, inbuf, inbytesleft),

static int
_DEFUN(ucs_2_internal_get_mb_cur_max, (data),
_VOID_PTR data)
void *data)
{
return 2;
}
Expand Down
14 changes: 7 additions & 7 deletions newlib/libc/iconv/ces/ucs-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,28 @@
#define UCS_2BE "ucs_2be"
#define UCS_2LE "ucs_2le"

static _VOID_PTR
static void *
_DEFUN(ucs_2_init, (rptr, encoding),
struct _reent *rptr,
const char *encoding)
{
int *data;

if ((data = (int *) _malloc_r(rptr, sizeof (int))) == NULL)
return (_VOID_PTR)NULL;
return (void *)NULL;

if (strcmp (encoding, UCS_2LE) == 0)
*data = UCS_2_LITTLE_ENDIAN;
else
*data = UCS_2_BIG_ENDIAN;

return (_VOID_PTR)data;
return (void *)data;
}

static size_t
_DEFUN(ucs_2_close, (rptr, data),
struct _reent *rptr,
_VOID_PTR data)
void *data)
{
_free_r (rptr, data);
return 0;
Expand All @@ -79,7 +79,7 @@ _DEFUN(ucs_2_close, (rptr, data),
#if defined (ICONV_FROM_UCS_CES_UCS_2)
static size_t
_DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft),
_VOID_PTR data,
void *data,
ucs4_t in,
unsigned char **outbuf,
size_t *outbytesleft)
Expand All @@ -106,7 +106,7 @@ _DEFUN(ucs_2_convert_from_ucs, (data, in, outbuf, outbytesleft),
#if defined (ICONV_TO_UCS_CES_UCS_2)
static ucs4_t
_DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft),
_VOID_PTR data,
void *data,
const unsigned char **inbuf,
size_t *inbytesleft)
{
Expand All @@ -133,7 +133,7 @@ _DEFUN(ucs_2_convert_to_ucs, (data, inbuf, inbytesleft),

static int
_DEFUN(ucs_2_get_mb_cur_max, (data),
_VOID_PTR data)
void *data)
{
return 2;
}
Expand Down
Loading

0 comments on commit 0403b9c

Please sign in to comment.