[FIX] Make Parsee build on GCC without warns

This commit is contained in:
LDA 2024-09-10 22:20:13 +02:00
commit 907ac13da9
20 changed files with 72 additions and 20 deletions

View file

@ -10,10 +10,10 @@
Stream *
StrStreamReaderN(char *buffer, int n)
{
if (!buffer)
if (!buffer || n < 0)
{
return NULL;
}
return StreamFile(fmemopen(buffer, n ? n : strlen(buffer), "rb"));
return StreamFile(fmemopen(buffer, n ? (size_t) n : strlen(buffer), "rb"));
}

View file

@ -11,6 +11,9 @@ static ssize_t
ReadStreamWriter(void *coop, void *to, size_t n)
{
/* Reading from a stream writer is silly. */
(void) coop;
(void) to;
(void) n;
return 0;
}
static ssize_t
@ -33,6 +36,9 @@ static off_t
SeekStreamWriter(void *coop, off_t mag, int sgn)
{
/* TODO: Seeking would be useful, though not supported yet. */
(void) coop;
(void) mag;
(void) sgn;
return 0;
}
@ -40,10 +46,11 @@ static int
CloseStreamWriter(void *coop)
{
/* Nothing to free as of now. */
(void) coop;
return 0;
}
const static IoFunctions Functions = {
static const IoFunctions Functions = {
.read = ReadStreamWriter,
.seek = SeekStreamWriter,
.write = WriteStreamWriter,