# HG changeset patch # User reimar # Date 1390129984 0 # Node ID 3cd07587a35dd4e8c4b5bd606c8e42274207ff82 # Parent 9b0dae1bf6ea94ab23fbd7b52d029a82cd7c9fdb asxparser: Declare variables in the blocks that need them. diff -r 9b0dae1bf6ea -r 3cd07587a35d asxparser.c --- a/asxparser.c Sun Jan 19 11:13:03 2014 +0000 +++ b/asxparser.c Sun Jan 19 11:13:04 2014 +0000 @@ -98,13 +98,14 @@ int asx_parse_attribs(ASX_Parser_t* parser,char* buffer,char*** _attribs) { - char *ptr1, *ptr2, *ptr3; + char *ptr1; int n_attrib = 0; char **attribs = NULL; - char *attrib, *val; ptr1 = buffer; while(1) { + char *ptr2, *ptr3; + char *attrib, *val; for( ; strchr(SPACE,*ptr1) != NULL; ptr1++) { // Skip space if(*ptr1 == '\0') break; } @@ -481,14 +482,14 @@ static play_tree_t* asx_parse_entry(ASX_Parser_t* parser,char* buffer,char** _attribs) { - char *element,*body,**attribs; - int r,nref=0; + int nref=0; play_tree_t *ref; ref = play_tree_new(); while(buffer && buffer[0] != '\0') { - r = asx_get_element(parser,&buffer,&element,&body,&attribs); + char *element,*body,**attribs; + int r = asx_get_element(parser,&buffer,&element,&body,&attribs); if(r < 0) { asx_warning_body_parse_error(parser,"ENTRY"); return NULL; @@ -516,10 +517,8 @@ static play_tree_t* asx_parse_repeat(ASX_Parser_t* parser,char* buffer,char** _attribs) { - char *element,*body,**attribs; play_tree_t *repeat, *list=NULL, *entry; char* count; - int r; repeat = play_tree_new(); @@ -535,7 +534,8 @@ } while(buffer && buffer[0] != '\0') { - r = asx_get_element(parser,&buffer,&element,&body,&attribs); + char *element,*body,**attribs; + int r = asx_get_element(parser,&buffer,&element,&body,&attribs); if(r < 0) { asx_warning_body_parse_error(parser,"REPEAT"); return NULL;