Fix warnings
This commit is contained in:
@@ -69,12 +69,14 @@ static bool is_hex_digit(char c)
|
|||||||
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
|
return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static char to_lower(char c)
|
static char to_lower(char c)
|
||||||
{
|
{
|
||||||
if (c >= 'A' && c <= 'Z')
|
if (c >= 'A' && c <= 'Z')
|
||||||
return c - 'A' + 'a';
|
return c - 'A' + 'a';
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int hex_digit_to_int(char c)
|
static int hex_digit_to_int(char c)
|
||||||
{
|
{
|
||||||
@@ -97,6 +99,7 @@ static bool streq(String a, String b)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static bool streqcase(String a, String b)
|
static bool streqcase(String a, String b)
|
||||||
{
|
{
|
||||||
if (a.len != b.len)
|
if (a.len != b.len)
|
||||||
@@ -106,7 +109,7 @@ static bool streqcase(String a, String b)
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define REPORT(err, fmt, ...) report((err), __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
#define REPORT(err, fmt, ...) report((err), __FILE__, __LINE__, fmt, ## __VA_ARGS__)
|
||||||
static void report(Error *err, char *file, int line, char *fmt, ...)
|
static void report(Error *err, char *file, int line, char *fmt, ...)
|
||||||
@@ -159,6 +162,7 @@ static bool grow_alloc(WL_Arena *a, char *p, int new_len)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static String copystr(String s, WL_Arena *a)
|
static String copystr(String s, WL_Arena *a)
|
||||||
{
|
{
|
||||||
char *p = alloc(a, s.len, 1);
|
char *p = alloc(a, s.len, 1);
|
||||||
@@ -167,6 +171,7 @@ static String copystr(String s, WL_Arena *a)
|
|||||||
memcpy(p, s.ptr, s.len);
|
memcpy(p, s.ptr, s.len);
|
||||||
return (String) { p, s.len };
|
return (String) { p, s.len };
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
// WRITER
|
// WRITER
|
||||||
@@ -189,14 +194,14 @@ static void write_raw_mem(Writer *w, void *ptr, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void write_raw_u8 (Writer *w, uint8_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
static void write_raw_u8 (Writer *w, uint8_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_u16(Writer *w, uint16_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
//static void write_raw_u16(Writer *w, uint16_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_u32(Writer *w, uint32_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
static void write_raw_u32(Writer *w, uint32_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_u64(Writer *w, uint64_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
//static void write_raw_u64(Writer *w, uint64_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_s8 (Writer *w, int8_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
//static void write_raw_s8 (Writer *w, int8_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_s16(Writer *w, int16_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
//static void write_raw_s16(Writer *w, int16_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_s32(Writer *w, int32_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
//static void write_raw_s32(Writer *w, int32_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_s64(Writer *w, int64_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
static void write_raw_s64(Writer *w, int64_t x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_f32(Writer *w, float x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
//static void write_raw_f32(Writer *w, float x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
static void write_raw_f64(Writer *w, double x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
static void write_raw_f64(Writer *w, double x) { write_raw_mem(w, &x, SIZEOF(x)); }
|
||||||
|
|
||||||
static void write_text(Writer *w, String str)
|
static void write_text(Writer *w, String str)
|
||||||
@@ -413,6 +418,7 @@ static bool consume_str(Scanner *s, String x)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void write_token(Writer *w, Token token)
|
static void write_token(Writer *w, Token token)
|
||||||
{
|
{
|
||||||
switch (token.type) {
|
switch (token.type) {
|
||||||
@@ -467,6 +473,7 @@ static void write_token(Writer *w, Token token)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void parser_report(Parser *p, char *fmt, ...)
|
static void parser_report(Parser *p, char *fmt, ...)
|
||||||
{
|
{
|
||||||
@@ -2018,6 +2025,14 @@ static void write_node(Writer *w, Node *node)
|
|||||||
write_text(w, S(")"));
|
write_text(w, S(")"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NODE_OPER_SHOVEL:
|
||||||
|
write_text(w, S("("));
|
||||||
|
write_node(w, node->left);
|
||||||
|
write_text(w, S("<<"));
|
||||||
|
write_node(w, node->right);
|
||||||
|
write_text(w, S(")"));
|
||||||
|
break;
|
||||||
|
|
||||||
case NODE_VALUE_INT:
|
case NODE_VALUE_INT:
|
||||||
write_text_s64(w, node->ival);
|
write_text_s64(w, node->ival);
|
||||||
break;
|
break;
|
||||||
@@ -2717,9 +2732,6 @@ static void walk_expr_node(Codegen *cg, Node *node, bool one)
|
|||||||
|
|
||||||
case NODE_OPER_SHOVEL:
|
case NODE_OPER_SHOVEL:
|
||||||
{
|
{
|
||||||
Node *dst = node->left;
|
|
||||||
Node *src = node->right;
|
|
||||||
|
|
||||||
walk_expr_node(cg, node->left, true);
|
walk_expr_node(cg, node->left, true);
|
||||||
|
|
||||||
cg_push_scope(cg, SCOPE_ASSIGNMENT);
|
cg_push_scope(cg, SCOPE_ASSIGNMENT);
|
||||||
@@ -4783,7 +4795,7 @@ static String rt_read_str(WL_Runtime *rt)
|
|||||||
ASSERT(rt->state == RUNTIME_LOOP);
|
ASSERT(rt->state == RUNTIME_LOOP);
|
||||||
uint32_t off = rt_read_u32(rt);
|
uint32_t off = rt_read_u32(rt);
|
||||||
uint32_t len = rt_read_u32(rt);
|
uint32_t len = rt_read_u32(rt);
|
||||||
ASSERT(off + len <= rt->data.len);
|
ASSERT(off + len <= (uint32_t) rt->data.len);
|
||||||
return (String) { rt->data.ptr + off, len };
|
return (String) { rt->data.ptr + off, len };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5325,6 +5337,7 @@ WL_EvalResult wl_runtime_eval(WL_Runtime *rt)
|
|||||||
|
|
||||||
switch (rt->state) {
|
switch (rt->state) {
|
||||||
|
|
||||||
|
case RUNTIME_BEGIN:
|
||||||
case RUNTIME_LOOP:
|
case RUNTIME_LOOP:
|
||||||
UNREACHABLE;
|
UNREACHABLE;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user