Make C90 happy.

This commit is contained in:
Yorick Peterse 2015-03-04 00:10:24 +01:00
parent 33c46a1841
commit 7e847a0ae9
1 changed files with 5 additions and 4 deletions

View File

@ -73,14 +73,13 @@ void liboga_xml_lexer_callback_simple(VALUE self, VALUE name)
VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
{
OgaLexerState *state;
int lines;
/* Make sure that all data passed back to Ruby has the proper encoding. */
rb_encoding *encoding = rb_enc_get(data_block);
char *data_str_val = StringValueCStr(data_block);
Data_Get_Struct(self, OgaLexerState, state);
const char *p = data_str_val;
const char *pe = data_str_val + strlen(data_str_val);
const char *eof = pe;
@ -88,8 +87,6 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
const char *te = 0;
const char *mark = 0;
int lines = state->lines;
ID id_advance_line = rb_intern("advance_line");
ID id_on_attribute = rb_intern("on_attribute");
ID id_on_attribute_ns = rb_intern("on_attribute_ns");
@ -115,6 +112,10 @@ VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
ID id_on_xml_decl_end = rb_intern("on_xml_decl_end");
ID id_on_xml_decl_start = rb_intern("on_xml_decl_start");
Data_Get_Struct(self, OgaLexerState, state);
lines = state->lines;
%% write exec;
state->lines = lines;