summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-12-17 21:52:25 +0000
committerFreeArtMan <dos21h@gmail.com>2015-12-17 21:52:25 +0000
commit6e2e285142895f3ed4b7e5b99ff1595092d84969 (patch)
treed681a1852b4adc8a2540d893d782c5e10ebef84e
parent02496faab558fa758adf3a24006201cf5ab557fb (diff)
downloaddm-6e2e285142895f3ed4b7e5b99ff1595092d84969.tar.gz
dm-6e2e285142895f3ed4b7e5b99ff1595092d84969.zip
Fixed few warnings
-rw-r--r--dm.c2
-rw-r--r--dm_parser.c20
-rw-r--r--dm_parser.ragel6
-rw-r--r--syntax.c4
-rw-r--r--tokenizer.c8
5 files changed, 12 insertions, 28 deletions
diff --git a/dm.c b/dm.c
index 95a5763..cd6f914 100644
--- a/dm.c
+++ b/dm.c
@@ -72,7 +72,7 @@ int ast2tb( ast_root *ast, mt_table *mt )
/*****************************************************************************/
/* primitive matchin for loop, get table sorted then more advanced solution
* maycome */
-int match( mt_table *mt, unsigned char *buf, size_t size )
+int match( mt_table *mt, char *buf, size_t size )
{
//anonymouse function
int pr(char *str, int sz)
diff --git a/dm_parser.c b/dm_parser.c
index bfd829f..f91eec9 100644
--- a/dm_parser.c
+++ b/dm_parser.c
@@ -120,7 +120,7 @@ int parse_dm( token_list *tl, const char *str )
{
static uint8_t cs;
const int stacksize = 10;
- int res=0, *top=0, *stack=NULL, act=0;
+ int res=0, *stack=NULL, act=0;
stack = malloc( sizeof(stack)*stacksize );
char *p=(char *)str, *pe = (char *)str + strlen( str ), *eof=NULL;
char *ts, *te = 0;
@@ -128,13 +128,9 @@ int parse_dm( token_list *tl, const char *str )
/*
variables used in state machine
*/
- char *token_s=NULL, *token_e=NULL;
- char *value_s=NULL, *value_e=NULL;
- int token_type=0;
- int dm_current_tok = TOK_NONE;
-#line 138 "dm_parser.c"
+#line 134 "dm_parser.c"
{
cs = dm_start;
ts = 0;
@@ -142,9 +138,9 @@ int parse_dm( token_list *tl, const char *str )
act = 0;
}
-#line 83 "dm_parser.ragel"
+#line 79 "dm_parser.ragel"
-#line 148 "dm_parser.c"
+#line 144 "dm_parser.c"
{
int _klen;
unsigned int _trans;
@@ -165,7 +161,7 @@ _resume:
#line 1 "NONE"
{ts = p;}
break;
-#line 169 "dm_parser.c"
+#line 165 "dm_parser.c"
}
}
@@ -275,7 +271,7 @@ _eof_trans:
#line 54 "dm_parser.ragel"
{{p = ((te))-1;}{/*printf("int = ");fwrite(ts,1,te-ts,stdout);printf("\n");*/TADD(TOK_INT,ts,te);}}
break;
-#line 279 "dm_parser.c"
+#line 275 "dm_parser.c"
}
}
@@ -288,7 +284,7 @@ _again:
#line 1 "NONE"
{ts = 0;}
break;
-#line 292 "dm_parser.c"
+#line 288 "dm_parser.c"
}
}
@@ -308,7 +304,7 @@ _again:
_out: {}
}
-#line 84 "dm_parser.ragel"
+#line 80 "dm_parser.ragel"
if ( cs == dm_error )
{
diff --git a/dm_parser.ragel b/dm_parser.ragel
index 80c873b..735b2fd 100644
--- a/dm_parser.ragel
+++ b/dm_parser.ragel
@@ -66,7 +66,7 @@ int parse_dm( token_list *tl, const char *str )
{
static uint8_t cs;
const int stacksize = 10;
- int res=0, *top=0, *stack=NULL, act=0;
+ int res=0, *stack=NULL, act=0;
stack = malloc( sizeof(stack)*stacksize );
char *p=(char *)str, *pe = (char *)str + strlen( str ), *eof=NULL;
char *ts, *te = 0;
@@ -74,10 +74,6 @@ int parse_dm( token_list *tl, const char *str )
/*
variables used in state machine
*/
- char *token_s=NULL, *token_e=NULL;
- char *value_s=NULL, *value_e=NULL;
- int token_type=0;
- int dm_current_tok = TOK_NONE;
%%write init;
%%write exec;
diff --git a/syntax.c b/syntax.c
index 510d735..a9e96d7 100644
--- a/syntax.c
+++ b/syntax.c
@@ -212,7 +212,7 @@ ast_expr_cmp* att_expr_cmp( token_list *tl, int pos )
/*****************************************************************************/
ast_expr_bit* att_expr_bit( token_list *tl, int pos )
{
-
+ return NULL;
}
/*****************************************************************************/
@@ -429,7 +429,7 @@ int ate_a_cmp( ast_expr **expr, ast_expr_cmp *cmp )
/*****************************************************************************/
int ate_eval( ast_expr *expr )
{
-
+ return -1;
}
diff --git a/tokenizer.c b/tokenizer.c
index a7c73e2..f69d404 100644
--- a/tokenizer.c
+++ b/tokenizer.c
@@ -80,13 +80,7 @@ int tl_add_tok( token_list *tl, int t, char *s, char *e )
/*****************************************************************************/
char* tl_str( token_list *tl )
{
- int len = 128;
- int p = 0;
- char *s = NULL;
int i = 0;
- //s = malloc( len );
- //s[p] = 0;
-
for (i=0; i<darr_end(tl->list); i++)
{
@@ -98,8 +92,6 @@ char* tl_str( token_list *tl )
}
}
- return s;
-error:
return NULL;
}