Fix pointer assignment errors

Without this patch, the following error is emitted when compiling with the latest LLVM/Clang 8.x:

```text
src/stdio/vfwscanf.c:218:9: error: assigning to 'const wchar_t *' (aka 'const unsigned int *') from 'int [1]' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
                                set = L"";
                                    ^ ~~~
1 error generated.
```
This commit is contained in:
Linus Unnebäck 2018-10-08 17:51:26 +02:00
parent 2f9ae7b7a7
commit 635de63a8a
No known key found for this signature in database
GPG Key ID: CE70CEAE9C0FA66F
3 changed files with 6 additions and 3 deletions

View File

@ -215,7 +215,8 @@ int vfwscanf(FILE *restrict f, const wchar_t *restrict fmt, va_list ap)
if (t == 'c') {
if (width<1) width = 1;
invert = 1;
set = L"";
static const wchar_t empty[] = { 0 };
set = empty;
} else if (t == 's') {
invert = 1;
static const wchar_t spaces[] = {

View File

@ -12,8 +12,9 @@ static size_t do_read(FILE *f, unsigned char *buf, size_t len)
{
size_t i;
const wchar_t *wcs = f->cookie;
static const wchar_t strudel[] = { '@', 0 };
if (!wcs[0]) wcs=L"@";
if (!wcs[0]) wcs=strudel;
for (i=0; i<f->buf_size && wcs[i]; i++)
f->buf[i] = wcs[i] < 128 ? wcs[i] : '@';
f->rpos = f->buf;

View File

@ -14,8 +14,9 @@ static size_t do_read(FILE *f, unsigned char *buf, size_t len)
{
size_t i;
const wchar_t *wcs = f->cookie;
static const wchar_t strudel[] = { '@', 0 };
if (!wcs[0]) wcs=L"@";
if (!wcs[0]) wcs=strudel;
for (i=0; i<f->buf_size && wcs[i]; i++)
f->buf[i] = wcs[i] < 128 ? wcs[i] : '@';
f->rpos = f->buf;