From 0b8f08921d96418942de4b87ff7e5e77642d9686 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Thu, 1 Jul 2010 08:36:46 +0000 Subject: [PATCH] Update SCEW to 1.1.2 --- Docs/Users/ChangeLog.txt | 1 + Externals/scew/NEWS | 134 ++++++++++++---------- Externals/scew/THANKS | 9 +- Externals/scew/configure.ac | 4 +- Externals/scew/doc/Doxyfile.in | 4 +- Externals/scew/etc/autoconf/doxygen.m4 | 27 +++-- Externals/scew/examples/scew_print/scew_print.c | 38 +++--- Externals/scew/examples/scew_stream/scew_stream.c | 20 ++-- Externals/scew/examples/scew_write/scew_write.c | 30 ++--- Externals/scew/scew/attribute.c | 8 +- Externals/scew/scew/element.c | 14 +-- Externals/scew/scew/error.c | 8 +- Externals/scew/scew/parser.c | 34 +++--- Externals/scew/scew/str.c | 4 +- Externals/scew/scew/str.h | 8 +- Externals/scew/scew/tree.c | 12 +- Externals/scew/scew/xerror.c | 6 +- Externals/scew/scew/xparser.c | 13 ++- Externals/versions.txt | 2 +- 19 files changed, 199 insertions(+), 177 deletions(-) diff --git a/Docs/Users/ChangeLog.txt b/Docs/Users/ChangeLog.txt index 55e89ba96..664fc937a 100644 --- a/Docs/Users/ChangeLog.txt +++ b/Docs/Users/ChangeLog.txt @@ -5,6 +5,7 @@ http://winmerge.org/tracker/[tracker-id] WinMerge 2.13.14 Update to PCRE 8.10 (r7210) + Update SCEW to 1.1.2 (r7212) WinMerge 2.13.13 - 2010-06-19 (r7205) Improve editing of linefilter regular expressions (#3015416) diff --git a/Externals/scew/NEWS b/Externals/scew/NEWS index 55aceb8e9..c01eb2bb8 100644 --- a/Externals/scew/NEWS +++ b/Externals/scew/NEWS @@ -1,11 +1,21 @@ SCEW -- History of visible changes. -Copyright (C) 2002-2009 Aleix Conchillo Flaqué +Copyright (C) 2002-2010 Aleix Conchillo Flaqué See the end for copying conditions. ------------------------------------------------------------------------ +* Version 1.1.2 (2010/06/04) + +** Fixes: + + - Precondition violation when assigning preamble to tree after + trimming and becoming NULL (scew/xparser.c). + (reported by Rudolf Alexander Kerbitz) + +------------------------------------------------------------------------ + * Version 1.1.1 (2009/12/11) ** Changes: @@ -135,25 +145,25 @@ See the end for copying conditions. ** Changes: - - Ability to load and XML document from an stream has been - added. The stream may not be completed, so it will just load + - Ability to load and XML document from an stream has been + added. The stream may not be completed, so it will just load correct XML pieces. A callback, set by the user, will be called each time an element is available. - (thanks to Gord Shier) + (thanks to Gord Shier) ** Fixes: - - Fixed indentation level when document contains multiple - consecutive empty elements. - (thanks to Tom Probasco) + - Fixed indentation level when document contains multiple + consecutive empty elements. + (thanks to Tom Probasco) - - scew_element_add_attr_pair() did not add a new attribute - correctly if the attribute already existed. - (reported by Matthew Peltzer) + - scew_element_add_attr_pair() did not add a new attribute + correctly if the attribute already existed. + (reported by Matthew Peltzer) - - Compiltaion fixes in MSVC. Compiler interpreted a function - argument called list as the std::list. - (reported by Renaud Dumont) + - Compiltaion fixes in MSVC. Compiler interpreted a function + argument called list as the std::list. + (reported by Renaud Dumont) ------------------------------------------------------------------------ @@ -161,23 +171,23 @@ See the end for copying conditions. ** Changes: - - A new "Unknown error code" message has been added. - (thanks to Brodie Thiesfield) + - A new "Unknown error code" message has been added. + (thanks to Brodie Thiesfield) - - Improved support for Windows and Unix compilation. - (thanks to Brodie Thiesfield) + - Improved support for Windows and Unix compilation. + (thanks to Brodie Thiesfield) - - Added improvements in str functions. mem.* has been removed. - (thanks to Brodie Thiesfield) + - Added improvements in str functions. mem.* has been removed. + (thanks to Brodie Thiesfield) - Write functions have been moved from tree to new writer.* files. - - Added a preamble section to the XML declaration. + - Added a preamble section to the XML declaration. ** Fixes: - - Allow building in a separate directory. - (thanks to Kalle Valo) + - Allow building in a separate directory. + (thanks to Kalle Valo) ------------------------------------------------------------------------ @@ -187,40 +197,40 @@ See the end for copying conditions. - Added missing performace improvements by using the linked list in element and attribute iterations. - (thanks to Brodie Thiesfield) + (thanks to Brodie Thiesfield) - - Added exponentially growing buffer to avoid many realloc calls - which are slow and fragment memory in scew_element_list. - (thanks to Brodie Thiesfield) + - Added exponentially growing buffer to avoid many realloc calls + which are slow and fragment memory in scew_element_list. + (thanks to Brodie Thiesfield) - - Performance improvements in file loading by using a static - buffer. - (thanks to Brodie Thiesfield) + - Performance improvements in file loading by using a static + buffer. + (thanks to Brodie Thiesfield) - - Added scew_parser_load_file_fp(). - (thanks to Brodie Thiesfield) + - Added scew_parser_load_file_fp(). + (thanks to Brodie Thiesfield) - - Some other minor changes. - (thanks to Brodie Thiesfield) + - Some other minor changes. + (thanks to Brodie Thiesfield) ** Fixes: - - scew_isxdigit() was calling isdigit() instead of isxdigit(). + - scew_isxdigit() was calling isdigit() instead of isxdigit(). - - scew_isxxxx() fixed. - (thanks to Brodie Thiesfield) + - scew_isxxxx() fixed. + (thanks to Brodie Thiesfield) - - strdup() is a GNU extension, replaced it by own version. + - strdup() is a GNU extension, replaced it by own version. - - Fixed scew_element_by_name. - (reported by Eric Fronheiser) + - Fixed scew_element_by_name. + (reported by Eric Fronheiser) - - Warning fixes (level 4) in Microsoft Visual C++ 7. - (thanks to Brodie Thiesfield) + - Warning fixes (level 4) in Microsoft Visual C++ 7. + (thanks to Brodie Thiesfield) - - Multi-thread support fixed in Microsoft Visual + - Multi-thread support fixed in Microsoft Visual C++. __declspec(thread) did not work, use TLS functions instead. - (thanks to Brodie Thiesfield) + (thanks to Brodie Thiesfield) ------------------------------------------------------------------------ @@ -231,34 +241,34 @@ See the end for copying conditions. - Added more string functions. New memory functions have also been added. - - Performance improved in element and attribute iteration. - (thanks to Sanzo Miyazawa) + - Performance improved in element and attribute iteration. + (thanks to Sanzo Miyazawa) - Support for XML declaration attributes has been added (version, encoding, standalone). This attributes can be changed using SCEW tree functions. - - Improved white spaces treatment in XML element contents. + - Improved white spaces treatment in XML element contents. - - Added error system. See documentation for more details. + - Added error system. See documentation for more details. - - Added pkg-config file. - (thanks to Neil Harvey) + - Added pkg-config file. + (thanks to Neil Harvey) - - Added 'make doc'. If you have doxygen installed (which will be + - Added 'make doc'. If you have doxygen installed (which will be automatically detected), it will create SCEW documentation. Execute './configure --help' to see more documentation options. - - 'make install' does not install example binaries anymore. + - 'make install' does not install example binaries anymore. ** Fixes: - - scew_tree_save_file() did not fclose output file. - (reported by Paul Bohme) + - scew_tree_save_file() did not fclose output file. + (reported by Paul Bohme) - scew_element_free() did not decrement parent number of children. - (reported by anonymous) + (reported by anonymous) ------------------------------------------------------------------------ @@ -266,16 +276,16 @@ See the end for copying conditions. ** Changes: - - Added --enable-debug flag to the configure script. + - Added --enable-debug flag to the configure script. ** Fixes: - - Added compatibilized headers with C++ (ifdef __cplusplus). + - Added compatibilized headers with C++ (ifdef __cplusplus). - - Compilation warnings fixed. + - Compilation warnings fixed. - - scew_element_del_attr() segmentation fault fixed. - (reported by Jussi Mäki) + - scew_element_del_attr() segmentation fault fixed. + (reported by Jussi Mäki) ------------------------------------------------------------------------ @@ -283,7 +293,7 @@ See the end for copying conditions. ** Changes: - - Functions to create and save XML files have been added. + - Functions to create and save XML files have been added. - A lot of cleanup and rewriting has been done. Internal structures have changed. @@ -300,7 +310,7 @@ See the end for copying conditions. - scew_get_element_by_name() and scew_get_attribute_by_name() did not return NULL if an element/attribute was not found. - (reported by Stuart R. Anderson) + (reported by Stuart R. Anderson) ------------------------------------------------------------------------ @@ -312,7 +322,7 @@ See the end for copying conditions. * Copying information: -Copyright (C) 2002-2009 Aleix Conchillo Flaqué +Copyright (C) 2002-2010 Aleix Conchillo Flaqué Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that diff --git a/Externals/scew/THANKS b/Externals/scew/THANKS index db94ed4d1..c70138ff4 100644 --- a/Externals/scew/THANKS +++ b/Externals/scew/THANKS @@ -6,7 +6,7 @@ people have contributed to SCEW by reporting problems, suggesting improvements, or submitting actual code. Here is a list of these people. Help me keep it complete and exempt of errors. -* Jose A. Ortega suggested some important C implementation details. As +* Jose A. Ortega suggested some important C implementation details. As usual, he has helped me in many other ways. Thanks jao! * Brodie Thiesfield has submitted lots of fixes and improvements. He @@ -28,6 +28,7 @@ people. Help me keep it complete and exempt of errors. * Bug reporting and others (in alphabetical order): Anonymous reporters, Stuart R. Anderson, Paul Bohme, Eric - Fronheiser, Alex Katebi, Aaron S. Kurland, Christopher Layne, Jussi - Mäki, Sanzo Miyazawa, George Neill, Gord Shier, Brodie Thiesfield, - Andrew Thomas, Kalle Vallo, Michal Wozniak and Mark Zieg. + Fronheiser, Alex Katebi, Rudolf Alexander Kerbitz, Aaron S. Kurland, + Christopher Layne, Jussi Mäki, Sanzo Miyazawa, George Neill, Gord + Shier, Brodie Thiesfield, Andrew Thomas, Kalle Vallo, Michal Wozniak + and Mark Zieg. diff --git a/Externals/scew/configure.ac b/Externals/scew/configure.ac index 45d984383..43143adc6 100644 --- a/Externals/scew/configure.ac +++ b/Externals/scew/configure.ac @@ -2,12 +2,12 @@ # Author: Aleix Conchillo Flaque # Date: Mon Oct 07, 2002 01:56 # -# Copyright (C) 2002-2009 Aleix Conchillo Flaque +# Copyright (C) 2002-2010 Aleix Conchillo Flaque # #### boilerplate and flags -define([scew_version], [1.1.1]) +define([scew_version], [1.1.2]) AC_INIT(scew/scew.h, scew_version) AM_INIT_AUTOMAKE(scew, scew_version) diff --git a/Externals/scew/doc/Doxyfile.in b/Externals/scew/doc/Doxyfile.in index 68265e666..fbbcb6063 100644 --- a/Externals/scew/doc/Doxyfile.in +++ b/Externals/scew/doc/Doxyfile.in @@ -749,13 +749,13 @@ LATEX_HEADER = # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. -PDF_HYPERLINKS = NO +PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. -USE_PDFLATEX = NO +USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep diff --git a/Externals/scew/etc/autoconf/doxygen.m4 b/Externals/scew/etc/autoconf/doxygen.m4 index 1e0a4d88a..140352d93 100644 --- a/Externals/scew/etc/autoconf/doxygen.m4 +++ b/Externals/scew/etc/autoconf/doxygen.m4 @@ -2,7 +2,7 @@ # Author: Aleix Conchillo Flaque # Start date: Sun Jul 06, 2003 04:41 # -# Copyright (C) 2003-2008 Aleix Conchillo Flaque +# Copyright (C) 2003-2010 Aleix Conchillo Flaque # # Locate doxygen and auxiliary programs. @@ -30,22 +30,29 @@ AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX documentation generation with doxygen (no)], [], [enable_latex_docs=no]) if test "x$enable_doxygen" = xno; then - enable_doc=no + enable_doc=no else - AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) - if test x$DOXYGEN = x; then + AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) + if test x$DOXYGEN = x; then AC_MSG_WARN(Could not find 'doxygen' (documentation disabled).) - enable_doc=no - else - enable_doc=yes + enable_doc=no + else + enable_doc=yes + if test "x$enable_latex_docs" = xyes; then + AC_PATH_PROG(LATEX, latex, , $PATH) + if test x$LATEX = x; then + AC_MSG_WARN(Could not find 'latex'.) + enable_latex_docs=no + fi + fi if test "x$enable_dot" = xyes; then - AC_PATH_PROG(DOT, dot, , $PATH) + AC_PATH_PROG(DOT, dot, , $PATH) if test x$DOT = x; then AC_MSG_WARN(Could not find 'dot'.) enable_dot=no fi - fi - fi + fi + fi fi AC_SUBST(enable_dot) diff --git a/Externals/scew/examples/scew_print/scew_print.c b/Externals/scew/examples/scew_print/scew_print.c index c9103bcd4..7b09d1d5d 100644 --- a/Externals/scew/examples/scew_print/scew_print.c +++ b/Externals/scew/examples/scew_print/scew_print.c @@ -44,7 +44,7 @@ print_indent (unsigned int indent) /* Indentation size (in whitespaces). */ static unsigned int const INDENT_SIZE = 4; - if (indent > 0) + if (indent > 0) { scew_printf (_XT("%*s"), indent * INDENT_SIZE, " "); } @@ -53,12 +53,12 @@ print_indent (unsigned int indent) static void print_attributes (scew_element *element) { - if (element != NULL) + if (element != NULL) { - /** - * Iterates through the element's attribute list, printing the - * pair name-value. - */ + /** + * Iterates through the element's attribute list, printing the + * pair name-value. + */ scew_list *list = scew_element_attributes (element); while (list != NULL) { @@ -77,9 +77,9 @@ print_element (scew_element *element, unsigned int indent) XML_Char const *contents = NULL; scew_list *list = NULL; - if (element == NULL) + if (element == NULL) { - return; + return; } /* Prints the starting element tag with its attributes. */ @@ -90,15 +90,15 @@ print_element (scew_element *element, unsigned int indent) contents = scew_element_contents (element); - if (contents == NULL) + if (contents == NULL) { scew_printf (_XT("\n")); } - /** + /** * Call print_element function again for each child of the current * element. - */ + */ list = scew_element_children (element); while (list != NULL) { @@ -107,12 +107,12 @@ print_element (scew_element *element, unsigned int indent) list = scew_list_next (list); } - /* Prints element's content. */ - if (contents != NULL) + /* Prints element's content. */ + if (contents != NULL) { scew_printf (_XT("%s"), contents); } - else + else { print_indent (indent); } @@ -135,10 +135,10 @@ main (int argc, char *argv[]) _setmode(_fileno(stdout), _O_U16TEXT); #endif /* _MSC_VER && XML_UNICODE_WCHAR_T */ - if (argc < 2) + if (argc < 2) { scew_printf (_XT("Usage: scew_print file.xml\n")); - return EXIT_FAILURE; + return EXIT_FAILURE; } /* Creates an SCEW parser. This is the first function to call. */ @@ -161,7 +161,7 @@ main (int argc, char *argv[]) scew_error code = scew_error_code (); scew_printf (_XT("Unable to parse file (error #%d: %s)\n"), code, scew_error_string (code)); - if (code == scew_error_expat) + if (code == scew_error_expat) { enum XML_Error expat_code = scew_error_expat_code (parser); scew_printf (_XT("Expat error #%d (line %d, column %d): %s\n"), @@ -169,7 +169,7 @@ main (int argc, char *argv[]) scew_error_expat_line (parser), scew_error_expat_column (parser), scew_error_expat_string (expat_code)); - } + } /* Frees the SCEW parser and reader. */ scew_reader_free (reader); @@ -201,5 +201,5 @@ main (int argc, char *argv[]) scew_reader_free (reader); scew_parser_free (parser); - return 0; + return 0; } diff --git a/Externals/scew/examples/scew_stream/scew_stream.c b/Externals/scew/examples/scew_stream/scew_stream.c index c81daf1c8..7d6b9d76d 100644 --- a/Externals/scew/examples/scew_stream/scew_stream.c +++ b/Externals/scew/examples/scew_stream/scew_stream.c @@ -94,10 +94,10 @@ main (int argc, char *argv[]) _setmode(_fileno(stdout), _O_U16TEXT); #endif /* _MSC_VER && XML_UNICODE_WCHAR_T */ - if (argc < 2) + if (argc < 2) { scew_printf (_XT("Usage: scew_stream file.xml\n")); - return EXIT_FAILURE; + return EXIT_FAILURE; } /* Create a writer for the standard output. */ @@ -124,19 +124,19 @@ main (int argc, char *argv[]) scew_parser_set_tree_hook (parser, tree_hook_, NULL); scew_parser_set_element_hook (parser, element_hook_, NULL); if (!scew_parser_load_stream (parser, reader)) - { + { scew_error code = scew_error_code (); scew_printf (_XT("Unable to load file (error #%d: %s)\n"), code, scew_error_string (code)); - if (code == scew_error_expat) - { + if (code == scew_error_expat) + { enum XML_Error expat_code = scew_error_expat_code (parser); scew_printf (_XT("Expat error #%d (line %d, column %d): %s\n"), - expat_code, + expat_code, scew_error_expat_line (parser), scew_error_expat_column (parser), scew_error_expat_string (expat_code)); - } + } /* Frees the SCEW parser, printer, reader and writer. */ scew_reader_free (reader); @@ -144,8 +144,8 @@ main (int argc, char *argv[]) scew_writer_free (stdout_writer_); scew_printer_free (stdout_printer_); - return EXIT_FAILURE; - } + return EXIT_FAILURE; + } /* Frees the SCEW parser, printer, reader and writer. */ scew_reader_free (reader); @@ -153,5 +153,5 @@ main (int argc, char *argv[]) scew_writer_free (stdout_writer_); scew_printer_free (stdout_printer_); - return 0; + return 0; } diff --git a/Externals/scew/examples/scew_write/scew_write.c b/Externals/scew/examples/scew_write/scew_write.c index d3c16cb00..0fa74a9b3 100644 --- a/Externals/scew/examples/scew_write/scew_write.c +++ b/Externals/scew/examples/scew_write/scew_write.c @@ -76,37 +76,37 @@ main(int argc, char *argv[]) _setmode(_fileno(stdout), _O_U16TEXT); #endif /* _MSC_VER && XML_UNICODE_WCHAR_T */ - if (argc < 2) + if (argc < 2) { scew_printf (_XT("Usage: scew_write new_file.xml\n")); - return EXIT_FAILURE; + return EXIT_FAILURE; } - /** - * Create an empty XML tree in memory, and add a root element - * "scew_test". - */ + /** + * Create an empty XML tree in memory, and add a root element + * "scew_test". + */ tree = scew_tree_create (); #ifdef XML_UNICODE_WCHAR_T scew_tree_set_xml_encoding(tree, _XT("UTF-16")); #endif /* XML_UNICODE_WCHAR_T */ root = scew_tree_set_root (tree, _XT("test")); - /* Add an element and set element contents. */ + /* Add an element and set element contents. */ element = scew_element_add (root, _XT("element")); scew_element_set_contents (element, _XT("element contents")); - /* Add an element with an attribute pair (name, value). */ + /* Add an element with an attribute pair (name, value). */ element = scew_element_add (root, _XT("element")); scew_element_add_attribute_pair (element, _XT("attribute"), _XT("value")); element = scew_element_add (root, _XT("element")); scew_element_add_attribute_pair (element, _XT("attribute1"), _XT("value1")); - /** - * Another way to add an attribute. You loose attribute ownership, - * so there is no need to free it. - */ + /** + * Another way to add an attribute. You loose attribute ownership, + * so there is no need to free it. + */ attribute = scew_attribute_create (_XT("attribute2"), _XT("value2")); scew_element_add_attribute (element, attribute); @@ -128,7 +128,7 @@ main(int argc, char *argv[]) _XT("attribute2"), _XT("value2")); scew_element_add_attribute_pair (sub_sub_element, _XT("attribute3"), _XT("value3")); - /* Check attribute2 replacement. */ + /* Check attribute2 replacement. */ scew_element_add_attribute_pair (sub_sub_element, _XT("attribute2"), _XT("new_value2")); scew_element_set_contents (sub_sub_element, @@ -146,7 +146,7 @@ main(int argc, char *argv[]) if (printer == NULL) { printf ("Unable to create printer\n"); - return EXIT_FAILURE; + return EXIT_FAILURE; } /* We should check for errors here. */ @@ -175,5 +175,5 @@ main(int argc, char *argv[]) scew_printer_free (printer); scew_tree_free (tree); - return 0; + return 0; } diff --git a/Externals/scew/scew/attribute.c b/Externals/scew/scew/attribute.c index e46389ff1..de1d22e1e 100644 --- a/Externals/scew/scew/attribute.c +++ b/Externals/scew/scew/attribute.c @@ -81,10 +81,10 @@ scew_attribute_copy (scew_attribute const *attribute) && (scew_attribute_set_value (new_attr, attribute->value) != NULL); if (!copied) - { + { scew_attribute_free (new_attr); new_attr = NULL; - } + } } return new_attr; @@ -122,7 +122,7 @@ scew_attribute_name (scew_attribute const *attribute) { assert (attribute != NULL); - return attribute->name; + return attribute->name; } XML_Char const* @@ -130,7 +130,7 @@ scew_attribute_value (scew_attribute const *attribute) { assert (attribute != NULL); - return attribute->value; + return attribute->value; } XML_Char const* diff --git a/Externals/scew/scew/element.c b/Externals/scew/scew/element.c index 65a87a373..b8b11bf58 100644 --- a/Externals/scew/scew/element.c +++ b/Externals/scew/scew/element.c @@ -50,16 +50,16 @@ scew_element_create (XML_Char const *name) element = calloc (1, sizeof (scew_element)); - if (element != NULL) + if (element != NULL) { scew_element_set_name (element, name); } - else + else { scew_error_set_last_error_ (scew_error_no_memory); } - return element; + return element; } void @@ -106,11 +106,11 @@ scew_element_set_name (scew_element *element, XML_Char const *name) new_name = scew_strdup (name); if (new_name != NULL) - { + { free (element->name); element->name = new_name; } - else + else { scew_error_set_last_error_ (scew_error_no_memory); } @@ -149,7 +149,7 @@ scew_element_free_contents (scew_element *element) { free (element->contents); element->contents = NULL; - } + } } @@ -274,7 +274,7 @@ scew_element_add_element (scew_element *element, scew_element *child) element->last_child = item; element->n_children += 1; } - else + else { scew_error_set_last_error_ (scew_error_no_memory); child = NULL; diff --git a/Externals/scew/scew/error.c b/Externals/scew/scew/error.c index 263aa1766..27dd4c07d 100644 --- a/Externals/scew/scew/error.c +++ b/Externals/scew/scew/error.c @@ -47,9 +47,9 @@ scew_error_string (scew_error code) { static XML_Char const *message[] = { - _XT("No error"), - _XT("Out of memory"), - _XT("Input/Output error"), + _XT("No error"), + _XT("Out of memory"), + _XT("Input/Output error"), _XT("Error while calling hook"), _XT("Internal Expat parser error"), _XT("Internal SCEW error") @@ -61,7 +61,7 @@ scew_error_string (scew_error code) { return message[code]; } - else + else { static XML_Char const *unk_message = _XT("Unknown error code"); diff --git a/Externals/scew/scew/parser.c b/Externals/scew/scew/parser.c index 95606c9f0..84c96c493 100644 --- a/Externals/scew/scew/parser.c +++ b/Externals/scew/scew/parser.c @@ -79,13 +79,13 @@ scew_parser_namespace_create (XML_Char separator) void scew_parser_free (scew_parser *parser) { - if (parser != NULL) + if (parser != NULL) { /* Free all intermediate parser data (if used before). */ scew_parser_reset (parser); /* Free Expat parser. */ - if (parser->parser) + if (parser->parser) { XML_ParserFree (parser->parser); } @@ -235,11 +235,11 @@ parser_create_ (scew_bool namespace, XML_Char separator) scew_parser_reset (parser); } else - { + { scew_error_set_last_error_ (scew_error_no_memory); scew_parser_free (parser); parser = NULL; - } + } return parser; } @@ -301,7 +301,7 @@ parse_stream_reader_ (scew_parser *parser, scew_reader *reader) scew_bool done = SCEW_FALSE; scew_bool result = SCEW_TRUE; - assert(parser != NULL); + assert(parser != NULL); assert(reader != NULL); while (!done && result) @@ -316,7 +316,7 @@ parse_stream_reader_ (scew_parser *parser, scew_reader *reader) result = SCEW_FALSE; } else - { + { result = parse_stream_buffer_ (parser, buffer, length); done = ((0 == length) || scew_reader_end (reader)); } @@ -332,15 +332,15 @@ parse_stream_buffer_ (scew_parser *parser, XML_Char const *buffer, size_t size) unsigned int end = 0; unsigned int length = 0; - assert(parser != NULL); - assert(buffer != NULL); + assert(parser != NULL); + assert(buffer != NULL); - /** + /** * Loop through the buffer and: - * if we encounter a '>', send the chunk to Expat. - * if we hit the end of the buffer, send whatever remains to Expat. - */ - while ((start < size) && (end <= size)) + * if we encounter a '>', send the chunk to Expat. + * if we hit the end of the buffer, send whatever remains to Expat. + */ + while ((start < size) && (end <= size)) { /* Skip initial whitespaces. */ while ((start < size) && scew_isspace (buffer[start])) @@ -351,8 +351,8 @@ parse_stream_buffer_ (scew_parser *parser, XML_Char const *buffer, size_t size) if ((end == size) || (buffer[end] == _XT('>'))) { - length = end - start; - if (end < size) + length = end - start; + if (end < size) { length += 1; } @@ -376,12 +376,12 @@ parse_stream_buffer_ (scew_parser *parser, XML_Char const *buffer, size_t size) * We don't need to free last loaded XML, as it's the * users responsibility. */ - parser->tree = NULL; + parser->tree = NULL; /* Reset parser to continue using it. */ scew_parser_reset (parser); } - start = end + 1; + start = end + 1; } end += 1; } diff --git a/Externals/scew/scew/str.c b/Externals/scew/scew/str.c index d38775d19..f35360c04 100644 --- a/Externals/scew/scew/str.c +++ b/Externals/scew/scew/str.c @@ -129,9 +129,9 @@ scew_strtrim (XML_Char *src) /* Strip leading whitespace. */ start = scew_strspn (src, _XT(" \n\r\t\v")); - total = end - start; + total = end - start; scew_memmove (src, &src[start], total); - src[total] = _XT('\0'); + src[total] = _XT('\0'); } scew_bool diff --git a/Externals/scew/scew/str.h b/Externals/scew/scew/str.h index e1b082373..bc351b639 100644 --- a/Externals/scew/scew/str.h +++ b/Externals/scew/scew/str.h @@ -73,10 +73,10 @@ #include #include -#define _XT(str) L##str +#define _XT(str) L##str #define scew_printf wprintf -#define scew_fprintf fwprintf +#define scew_fprintf fwprintf #define scew_vfprintf vfwprintf #define scew_fputs fputws #define scew_fgets fgetws @@ -109,7 +109,7 @@ /** * Creates a regular string or a wide character string. */ -#define _XT(str) str +#define _XT(str) str /** * See standard @a printf documentation. @@ -119,7 +119,7 @@ /** * See standard @a fprintf documentation. */ -#define scew_fprintf fprintf +#define scew_fprintf fprintf /** * See standard @a vfprintf documentation. diff --git a/Externals/scew/scew/tree.c b/Externals/scew/scew/tree.c index 362021d06..5cc979930 100644 --- a/Externals/scew/scew/tree.c +++ b/Externals/scew/scew/tree.c @@ -71,7 +71,7 @@ scew_tree_create (void) scew_error_set_last_error_ (scew_error_no_memory); } - return tree; + return tree; } scew_tree* @@ -112,7 +112,7 @@ scew_tree_copy (scew_tree const *tree) void scew_tree_free (scew_tree *tree) { - if (tree != NULL) + if (tree != NULL) { free (tree->version); free (tree->encoding); @@ -146,7 +146,7 @@ scew_tree_compare (scew_tree const *a, XML_Char const* scew_tree_xml_version (scew_tree const *tree) { - assert(tree != NULL); + assert(tree != NULL); return tree->version; } @@ -165,7 +165,7 @@ scew_tree_set_xml_version (scew_tree *tree, XML_Char const *version) XML_Char const* scew_tree_xml_encoding (scew_tree const *tree) { - assert(tree != NULL); + assert(tree != NULL); return tree->encoding; } @@ -192,9 +192,9 @@ scew_tree_xml_standalone (scew_tree const *tree) void scew_tree_set_xml_standalone (scew_tree *tree, scew_tree_standalone standalone) { - assert(tree != NULL); + assert(tree != NULL); - tree->standalone = standalone; + tree->standalone = standalone; } diff --git a/Externals/scew/scew/xerror.c b/Externals/scew/scew/xerror.c index ae1996630..f15cac03f 100644 --- a/Externals/scew/scew/xerror.c +++ b/Externals/scew/scew/xerror.c @@ -48,13 +48,13 @@ static scew_error last_error = scew_error_none; void scew_error_set_last_error_ (scew_error code) { - last_error = code; + last_error = code; } scew_error scew_error_last_error_ (void) { - return last_error; + return last_error; } #else /* SINGLE_THREADED */ @@ -148,7 +148,7 @@ scew_error_last_error_ (void) error = (scew_error*) pthread_getspecific (key_error_); if (NULL == error) { - return scew_error_none; + return scew_error_none; } return *error; diff --git a/Externals/scew/scew/xparser.c b/Externals/scew/scew/xparser.c index b40b56dc2..be9558510 100644 --- a/Externals/scew/scew/xparser.c +++ b/Externals/scew/scew/xparser.c @@ -113,10 +113,10 @@ scew_parser_stack_free_ (scew_parser *parser) { scew_element *element = parser_stack_pop_ (parser); while (element != NULL) - { + { scew_element_free (element); element = parser_stack_pop_ (parser); - } + } } } @@ -325,7 +325,10 @@ expat_end_handler_ (void *data, XML_Char const *elem) free (parser->preamble); parser->preamble = NULL; } - scew_tree_set_xml_preamble (parser->tree, parser->preamble); + else + { + scew_tree_set_xml_preamble (parser->tree, parser->preamble); + } } scew_tree_set_root_element (parser->tree, current); @@ -454,7 +457,7 @@ parser_stack_push_ (scew_parser *parser, scew_element *element) stack = calloc (1, sizeof (stack_element)); - if (stack != NULL) + if (stack != NULL) { stack->element = element; if (parser->stack != NULL) @@ -483,5 +486,5 @@ parser_stack_pop_ (scew_parser *parser) free (stack); } - return element; + return element; } diff --git a/Externals/versions.txt b/Externals/versions.txt index e98091dd8..7ef1966c1 100644 --- a/Externals/versions.txt +++ b/Externals/versions.txt @@ -5,4 +5,4 @@ This file lists versions of the external components we are using. Expat: 2.0.1 PCRE: 8.10 -SCEW: 1.1.1 +SCEW: 1.1.2 -- 2.11.0