gluon-web: compile with -std=c99 -Wall -Wextra
Also fix all warnings.
This commit is contained in:
parent
56a10e03b3
commit
624d969c52
@ -1,7 +1,7 @@
|
|||||||
all: compile
|
all: compile
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -D_GNU_SOURCE -fPIC -c -o $@ $<
|
$(CC) $(CPPFLAGS) $(CFLAGS) -D_GNU_SOURCE -std=c99 -Wall -Wextra -fPIC -c -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f parser.so *.o
|
rm -f parser.so *.o
|
||||||
|
@ -27,8 +27,9 @@ static inline uint16_t get_le16(const uint8_t *d) {
|
|||||||
return (((uint16_t)d[1]) << 8) | d[0];
|
return (((uint16_t)d[1]) << 8) | d[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t sfh_hash(const uint8_t *data, int len)
|
static uint32_t sfh_hash(const void *input, int len)
|
||||||
{
|
{
|
||||||
|
const uint8_t *data = input;
|
||||||
uint32_t hash = len, tmp;
|
uint32_t hash = len, tmp;
|
||||||
|
|
||||||
/* Main loop */
|
/* Main loop */
|
||||||
|
@ -291,7 +291,7 @@ template_format_chunk(struct template_parser *parser, size_t *sz)
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *template_reader(lua_State *L, void *ud, size_t *sz)
|
const char *template_reader(lua_State *L __attribute__((unused)), void *ud, size_t *sz)
|
||||||
{
|
{
|
||||||
struct template_parser *parser = ud;
|
struct template_parser *parser = ud;
|
||||||
int rem = parser->size - (parser->off - parser->data);
|
int rem = parser->size - (parser->off - parser->data);
|
||||||
|
@ -200,7 +200,7 @@ static inline int mb_is_illegal(unsigned char *s, int n)
|
|||||||
|
|
||||||
/* scan given source string, validate UTF-8 sequence and store result
|
/* scan given source string, validate UTF-8 sequence and store result
|
||||||
* in given buffer object */
|
* in given buffer object */
|
||||||
static int validate_utf8(unsigned char **s, int l, struct template_buffer *buf)
|
static int validate_utf8(unsigned char **s, unsigned int l, struct template_buffer *buf)
|
||||||
{
|
{
|
||||||
unsigned char *ptr = *s;
|
unsigned char *ptr = *s;
|
||||||
unsigned int o = 0, v, n;
|
unsigned int o = 0, v, n;
|
||||||
@ -289,7 +289,7 @@ char * pcdata(const char *s, unsigned int l)
|
|||||||
for (o = 0; o < l; o++)
|
for (o = 0; o < l; o++)
|
||||||
{
|
{
|
||||||
/* Invalid XML bytes */
|
/* Invalid XML bytes */
|
||||||
if (((*ptr >= 0x00) && (*ptr <= 0x08)) ||
|
if ((*ptr <= 0x08) ||
|
||||||
((*ptr >= 0x0B) && (*ptr <= 0x0C)) ||
|
((*ptr >= 0x0B) && (*ptr <= 0x0C)) ||
|
||||||
((*ptr >= 0x0E) && (*ptr <= 0x1F)) ||
|
((*ptr >= 0x0E) && (*ptr <= 0x1F)) ||
|
||||||
(*ptr == 0x7F))
|
(*ptr == 0x7F))
|
||||||
|
Loading…
Reference in New Issue
Block a user