From 0ef6a2ffbe78e1031b46a3ba463cd014fb9a995e Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Fri, 23 Jun 2017 02:17:29 -0400 Subject: [PATCH] Fix declarations for C89 compatibility (forgot MSVC needed that...) --- mwparserfromhell/parser/ctokenizer/avl_tree.h | 4 +--- mwparserfromhell/parser/ctokenizer/tok_parse.c | 6 ++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mwparserfromhell/parser/ctokenizer/avl_tree.h b/mwparserfromhell/parser/ctokenizer/avl_tree.h index 8508411..9caa2bc 100644 --- a/mwparserfromhell/parser/ctokenizer/avl_tree.h +++ b/mwparserfromhell/parser/ctokenizer/avl_tree.h @@ -23,9 +23,7 @@ #include -#if defined(_MSC_VER) && (_MSC_VER < 1600) -typedef unsigned long uintptr_t; -#else +#if !defined(_MSC_VER) || (_MSC_VER >= 1600) #include #endif diff --git a/mwparserfromhell/parser/ctokenizer/tok_parse.c b/mwparserfromhell/parser/ctokenizer/tok_parse.c index 27eed67..f8e52ec 100644 --- a/mwparserfromhell/parser/ctokenizer/tok_parse.c +++ b/mwparserfromhell/parser/ctokenizer/tok_parse.c @@ -519,6 +519,7 @@ static int Tokenizer_parse_free_uri_scheme(Tokenizer* self) Unicode chunk; Py_ssize_t i; int slashes, j; + uint64_t new_context; if (!scheme_buffer) return -1; @@ -554,7 +555,7 @@ static int Tokenizer_parse_free_uri_scheme(Tokenizer* self) return 0; } Py_DECREF(scheme); - uint64_t new_context = self->topstack->context | LC_EXT_LINK_URI; + new_context = self->topstack->context | LC_EXT_LINK_URI; if (Tokenizer_check_route(self, new_context) < 0) { Textbuffer_dealloc(scheme_buffer); return 0; @@ -2205,6 +2206,7 @@ static int Tokenizer_parse_table(Tokenizer* self) Py_ssize_t reset = self->head; PyObject *style, *padding, *trash; PyObject *table = NULL; + StackIdent restore_point; self->head += 2; if (Tokenizer_check_route(self, LC_TABLE_OPEN) < 0) @@ -2229,7 +2231,7 @@ static int Tokenizer_parse_table(Tokenizer* self) } self->head++; - StackIdent restore_point = self->topstack->ident; + restore_point = self->topstack->ident; table = Tokenizer_parse(self, LC_TABLE_OPEN, 1); if (BAD_ROUTE) { RESET_ROUTE();