From cd7343e1403e372e6f2139e41d1a5d7088241be3 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 16 Dec 2016 12:57:13 -0800 Subject: [PATCH] one more ragel warning to fix, fixed improper ir.c assignments --- src/ir.c | 22 ++++++---------------- src/lexer_fsm.rl | 8 ++++---- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/ir.c b/src/ir.c index d9b1dc5..281b29a 100644 --- a/src/ir.c +++ b/src/ir.c @@ -51,7 +51,7 @@ curr_map(void); struct set* curr_cdat_set(void); struct set* -curr_set(int); +curr_set(void); struct ref* curr_ref(void); struct model* @@ -290,6 +290,7 @@ struct odat { struct framesheet { int width; int height; + uint8_t filepath[FPATH_MAX]; int num_frames; }; @@ -299,8 +300,7 @@ struct framesheet { /* NAMED spritesheet */ struct model { struct name name; - uint8_t filepath[PATH_MAX]; - struct framesheet spritesheet[8]; //one for each + struct framesheet spritesheet[8]; //one for each }; /* Vdat: Vdats are the video data of each object. They can not be @@ -602,19 +602,9 @@ curr_cdat_set struct set* curr_set -(int depth) -{ int i; - struct set* setp; - - for(i = 0; i <= depth; i++) - { if(!(setp = setp->set_list[setp->num_sets])) - { printf("You are trying to access a set that does not exist irmem.c\n"); - return NULL; - } - } - - - return setp; +() +{ + return CURRENT_SET(); } struct ref* diff --git a/src/lexer_fsm.rl b/src/lexer_fsm.rl index 96d999a..efa6bf3 100644 --- a/src/lexer_fsm.rl +++ b/src/lexer_fsm.rl @@ -83,7 +83,7 @@ int lexer_setstr(uint8_t*, int); action push_width { printf("Lexer_lexstring:: action:push_height p = %s\n", p); PUSHTOK(WIDTH, ttov, val); } - action push_link {yylval.str = (uint8_t*) '#'; lexer_pushtok(LINK),yylval); } + action push_link {yylval.str = (uint8_t*) '#'; lexer_pushtok(LINK,yylval); } #action lex_error { printf("input error: character %c in filename %s is invalid\n p = %s\n", fc, str, p);} action p { printf("Lexer_lexstring:: p = %s\n", p);} @@ -112,9 +112,9 @@ int lexer_setstr(uint8_t*, int); tok = (name | val | ref | dimensions | map | link | SS | direction); - tok_lexer := (tok tok_delimiter)+ tok [\0]; + main := (tok tok_delimiter)+ tok [\0]; - write data; + write data nofinal noerror noprefix; }%% @@ -177,7 +177,7 @@ lexer_lexstring main := direction; - write data; + write data nofinal noprefix noerror; }%% -- 2.18.0