iconv: Make it possible to build iconv(3) test suite.
It was broken after 1243a98e38
.
Reviewed By: allanjude
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D31816
This commit is contained in:
parent
c86a43f1c7
commit
efe014e6b1
@ -243,8 +243,8 @@ ctl_uc_hook(void)
|
||||
struct iconv_hooks hooks;
|
||||
iconv_t cd;
|
||||
size_t inbytesleft = 15, outbytesleft = 40;
|
||||
const char **inptr;
|
||||
const char *s = "Hello World!";
|
||||
char **inptr;
|
||||
char *s = "Hello World!";
|
||||
char **outptr;
|
||||
char *outbuf;
|
||||
|
||||
@ -273,8 +273,8 @@ ctl_wc_hook(void)
|
||||
struct iconv_hooks hooks;
|
||||
iconv_t cd;
|
||||
size_t inbytesleft, outbytesleft = 40;
|
||||
const char **inptr;
|
||||
const char *s = "Hello World!";
|
||||
char **inptr;
|
||||
char *s = "Hello World!";
|
||||
char **outptr;
|
||||
char *outbuf;
|
||||
|
||||
@ -350,7 +350,7 @@ ctl_mb_to_uc_fb(void)
|
||||
size_t inbytesleft, outbytesleft;
|
||||
uint16_t inbuf[1] = { 0xF187 };
|
||||
uint8_t outbuf[4] = { 0x00, 0x00, 0x00, 0x00 };
|
||||
const char *inptr;
|
||||
char *inptr;
|
||||
char *outptr;
|
||||
int ret;
|
||||
|
||||
@ -366,7 +366,7 @@ ctl_mb_to_uc_fb(void)
|
||||
if (iconvctl(cd, ICONV_SET_FALLBACKS, (void *)&fb) != 0)
|
||||
return (1);
|
||||
|
||||
inptr = (const char *)inbuf;
|
||||
inptr = (char *)inbuf;
|
||||
outptr = (char *)outbuf;
|
||||
inbytesleft = 2;
|
||||
outbytesleft = 4;
|
||||
@ -389,7 +389,7 @@ gnu_openinto(void)
|
||||
{
|
||||
iconv_allocation_t *myspace;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
const char *inptr;
|
||||
char *inptr;
|
||||
char *inbuf = "works!", *outptr;
|
||||
char outbuf[6];
|
||||
|
||||
@ -398,7 +398,7 @@ gnu_openinto(void)
|
||||
if (iconv_open_into("ASCII", "ASCII", myspace) == -1)
|
||||
return (1);
|
||||
|
||||
inptr = (const char *)inbuf;
|
||||
inptr = (char *)inbuf;
|
||||
outptr = (char *)outbuf;
|
||||
inbytesleft = 6;
|
||||
outbytesleft = 6;
|
||||
|
@ -108,7 +108,7 @@ conv_ret(void)
|
||||
{
|
||||
iconv_t cd;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
const char *inptr;
|
||||
char *inptr;
|
||||
char *outptr;
|
||||
uint32_t outbuf[4];
|
||||
uint32_t inbuf[2] = { 0x00000151, 0x00000171 };
|
||||
@ -116,7 +116,7 @@ conv_ret(void)
|
||||
if ((cd = iconv_open("ASCII", "UTF-32LE")) == (iconv_t)-1)
|
||||
return (1);
|
||||
|
||||
inptr = (const char *)inbuf;
|
||||
inptr = (char *)inbuf;
|
||||
outptr = (char *)outbuf;
|
||||
inbytesleft = 8;
|
||||
outbytesleft = 16;
|
||||
@ -129,7 +129,7 @@ conv_2big(void)
|
||||
{
|
||||
iconv_t cd;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
const char *inptr;
|
||||
char *inptr;
|
||||
char *outptr;
|
||||
uint32_t inbuf[4];
|
||||
uint32_t outbuf[2];
|
||||
@ -138,7 +138,7 @@ conv_2big(void)
|
||||
if ((cd = iconv_open("ASCII", "ASCII")) == (iconv_t)-1)
|
||||
return (1);
|
||||
|
||||
inptr = (const char *)inbuf;
|
||||
inptr = (char *)inbuf;
|
||||
outptr = (char *)outbuf;
|
||||
inbytesleft = 16;
|
||||
outbytesleft = 8;
|
||||
@ -168,7 +168,7 @@ conv_einval(void)
|
||||
{
|
||||
iconv_t cd;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
const char *inptr;
|
||||
char *inptr;
|
||||
char *outptr;
|
||||
uint32_t outbuf[4];
|
||||
uint16_t inbuf[1] = { 0xEA42 };
|
||||
@ -177,7 +177,7 @@ conv_einval(void)
|
||||
if ((cd = iconv_open("UTF-32", "BIG5")) == (iconv_t)-1)
|
||||
return (1);
|
||||
|
||||
inptr = (const char *)inbuf;
|
||||
inptr = (char *)inbuf;
|
||||
outptr = (char *)outbuf;
|
||||
inbytesleft = 2;
|
||||
outbytesleft = 16;
|
||||
@ -207,7 +207,7 @@ conv_eilseq(void)
|
||||
{
|
||||
iconv_t cd;
|
||||
size_t inbytesleft, outbytesleft;
|
||||
const char *inptr;
|
||||
char *inptr;
|
||||
char *outptr;
|
||||
uint32_t outbuf[4];
|
||||
uint16_t inbuf[1] = { 0x8AC0 };
|
||||
@ -216,7 +216,7 @@ conv_eilseq(void)
|
||||
if ((cd = iconv_open("Latin2", "UTF-16LE")) == (iconv_t)-1)
|
||||
return (1);
|
||||
|
||||
inptr = (const char *)inbuf;
|
||||
inptr = (char *)inbuf;
|
||||
outptr = (char *)outbuf;
|
||||
inbytesleft = 4;
|
||||
outbytesleft = 16;
|
||||
|
@ -287,7 +287,7 @@ do_conv(iconv_t cd, bool uniinput) {
|
||||
size_t inbytesleft, outbytesleft, ret;
|
||||
uint32_t outbuf;
|
||||
uint32_t inbuf;
|
||||
const char *inbuf_;
|
||||
char *inbuf_;
|
||||
char *outbuf_;
|
||||
|
||||
for (inbuf = 0; inbuf < (lflag ? 0x100000 : 0x10000); inbuf += 1) {
|
||||
@ -297,7 +297,7 @@ do_conv(iconv_t cd, bool uniinput) {
|
||||
outbytesleft = 4;
|
||||
outbuf = 0x00000000;
|
||||
outbuf_ = (char *)&outbuf;
|
||||
inbuf_ = (const char *)&inbuf;
|
||||
inbuf_ = (char *)&inbuf;
|
||||
iconv(cd, NULL, NULL, NULL, NULL);
|
||||
fb_flags = 0;
|
||||
errno = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user