From: Markus Koschany Date: Wed, 25 Mar 2015 11:17:50 +0100 Subject: unbundle tinyxml library Forwarded: https://sourceforge.net/p/opencity/bugs/49/ --- src/Makefile.am | 6 +++--- src/tinyxml/Makefile.am | 12 +++--------- src/tinyxpath/Makefile.am | 2 +- src/tinyxpath/node_set.cpp | 8 ++++---- src/tinyxpath/xpath_processor.cpp | 10 +++++----- src/tinyxpath/xpath_stream.h | 1 - src/zen.cpp | 2 +- viewer/Makefile.am | 4 ++-- 8 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index f4b597f..177f566 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,7 +17,7 @@ AM_CPPFLAGS = \ -I@top_srcdir@/src/pngfuncs \ -I@top_srcdir@/src/simulator \ -I@top_srcdir@/src/structure \ - -I@top_srcdir@/src/tinyxml \ + -ltinyxml \ -I@top_srcdir@/src/tinyxpath \ -I@top_srcdir@/src/triangulation \ -DDATADIR=\"@datadir@\" \ @@ -51,7 +51,7 @@ opencity_LDADD = \ pngfuncs/libpngfuncs.a \ simulator/libsim.a \ structure/libstruct.a \ - tinyxml/libtinyxml.a \ + -ltinyxml \ tinyxpath/libtinyxpath.a \ triangulation/libtriangulation.a @@ -143,7 +143,7 @@ oczen_LDADD = \ pngfuncs/libpngfuncs.a \ simulator/libsim.a \ structure/libstruct.a \ - tinyxml/libtinyxml.a \ + -ltinyxml \ tinyxpath/libtinyxpath.a \ triangulation/libtriangulation.a diff --git a/src/tinyxml/Makefile.am b/src/tinyxml/Makefile.am index e2b13b4..645c277 100644 --- a/src/tinyxml/Makefile.am +++ b/src/tinyxml/Makefile.am @@ -1,16 +1,10 @@ -noinst_LIBRARIES = libtinyxml.a +noinst_LIBRARIES = -libtinyxml_a_SOURCES = \ -tinystr.cpp \ -tinyxml.cpp \ -tinyxmlerror.cpp \ -tinyxmlparser.cpp +libtinyxml_a_SOURCES = -noinst_HEADERS = \ -tinystr.h \ -tinyxml.h +noinst_HEADERS = diff --git a/src/tinyxpath/Makefile.am b/src/tinyxpath/Makefile.am index 8a6a9c7..6d2cc96 100644 --- a/src/tinyxpath/Makefile.am +++ b/src/tinyxpath/Makefile.am @@ -3,7 +3,7 @@ # $Id: Makefile.am 427 2009-11-23 22:48:26Z neoneurone $ #============================================================================== AM_CPPFLAGS = \ - -I@top_srcdir@/src/tinyxml/ + -ltinyxml noinst_LIBRARIES = libtinyxpath.a diff --git a/src/tinyxpath/node_set.cpp b/src/tinyxpath/node_set.cpp index cc154d7..514caca 100644 --- a/src/tinyxpath/node_set.cpp +++ b/src/tinyxpath/node_set.cpp @@ -100,7 +100,7 @@ void node_set::v_copy_selected_node_recursive ( if ((! cp_lookup) || ! strcmp (XNp_root -> Value (), cp_lookup)) v_add_node_in_set (XNp_root); - if (XNp_root -> Type () == TiXmlNode::ELEMENT) + if (XNp_root -> Type () == TiXmlNode::TINYXML_ELEMENT) { XAp_attrib = XNp_root -> ToElement () -> FirstAttribute (); while (XAp_attrib) @@ -147,7 +147,7 @@ TIXML_STRING node_set::S_get_string_value () const if (! op_attrib [u_node]) { XNp_node = (const TiXmlNode *) vpp_node_set [u_node]; - if (XNp_node -> Type () == TiXmlNode::TEXT) + if (XNp_node -> Type () == TiXmlNode::TINYXML_TEXT) S_res += XNp_node -> Value (); } } @@ -216,7 +216,7 @@ void node_set::v_add_all_foll_node ( XNp_ptr = XNp_ptr -> NextSiblingElement (); } XNp_ptr = XNp_node -> Parent (); - if (XNp_ptr && XNp_ptr -> Type () == TiXmlNode::ELEMENT) + if (XNp_ptr && XNp_ptr -> Type () == TiXmlNode::TINYXML_ELEMENT) v_add_all_foll_node (XNp_ptr, S_name); } @@ -239,7 +239,7 @@ void node_set::v_add_all_prec_node ( XNp_ptr = XNp_node -> PreviousSibling (); while (XNp_ptr) { - if (XNp_ptr -> Type () == TiXmlNode::ELEMENT) + if (XNp_ptr -> Type () == TiXmlNode::TINYXML_ELEMENT) { v_add_node_in_set_if_name_or_star (XNp_ptr, S_name); v_copy_node_children (XNp_ptr, cp_lookup); diff --git a/src/tinyxpath/xpath_processor.cpp b/src/tinyxpath/xpath_processor.cpp index c559c55..e8fa31f 100644 --- a/src/tinyxpath/xpath_processor.cpp +++ b/src/tinyxpath/xpath_processor.cpp @@ -49,7 +49,7 @@ public : class TiXmlNodeManip : public TiXmlNode { public : - TiXmlNodeManip () : TiXmlNode (TiXmlNode::UNKNOWN) {} + TiXmlNodeManip () : TiXmlNode (TiXmlNode::TINYXML_UNKNOWN) {} void v_reset (const TiXmlNode * XNp_parent, const TiXmlNode * XNp_next, const TiXmlNode * XNp_prev) { parent = (TiXmlNode *) XNp_parent; @@ -1196,7 +1196,7 @@ void xpath_processor ::v_execute_step ( XNp_next = XEp_father -> PreviousSibling (); while (XNp_next) { - if (XNp_next -> Type () == TiXmlNode::ELEMENT) + if (XNp_next -> Type () == TiXmlNode::TINYXML_ELEMENT) ns_target . v_add_node_in_set_if_name_or_star (XNp_next, S_name); XNp_next = XNp_next -> PreviousSibling (); } @@ -1229,7 +1229,7 @@ void xpath_processor ::v_execute_step ( XNp_next = XEp_father -> FirstChild (); while (XNp_next) { - if (XNp_next -> Type () == TiXmlNode::COMMENT) + if (XNp_next -> Type () == TiXmlNode::TINYXML_COMMENT) ns_target . v_add_node_in_set (XNp_next); XNp_next = XNp_next -> NextSibling (); } @@ -1238,7 +1238,7 @@ void xpath_processor ::v_execute_step ( XNp_next = XEp_father -> FirstChild (); while (XNp_next) { - if (XNp_next -> Type () == TiXmlNode::TEXT) + if (XNp_next -> Type () == TiXmlNode::TINYXML_TEXT) ns_target . v_add_node_in_set (XNp_next); XNp_next = XNp_next -> NextSibling (); } @@ -1728,7 +1728,7 @@ void xpath_processor::v_function_text ( XNp_child = XEp_context -> FirstChild (); while (XNp_child) { - if (XNp_child -> Type () == TiXmlNode::TEXT) + if (XNp_child -> Type () == TiXmlNode::TINYXML_TEXT) S_res += XNp_child -> Value (); XNp_child = XNp_child -> NextSibling (); } diff --git a/src/tinyxpath/xpath_stream.h b/src/tinyxpath/xpath_stream.h index 46fb376..7fd10ef 100644 --- a/src/tinyxpath/xpath_stream.h +++ b/src/tinyxpath/xpath_stream.h @@ -34,7 +34,6 @@ distribution. #include "byte_stream.h" #include "xpath_syntax.h" #include "tinyxml.h" -#include "tinystr.h" namespace TinyXPath { diff --git a/src/zen.cpp b/src/zen.cpp index 8dfe42d..b0a26a2 100644 --- a/src/zen.cpp +++ b/src/zen.cpp @@ -37,7 +37,7 @@ extern GlobalVar gVars; // Libraries headers #include "SDL_image.h" #include "binreloc.h" // BinReloc routines from AutoPackage -#include "tinyxml/tinyxml.h" +#include "tinyxml.h" #include "SimpleOpt.h" // Simple command line argument parser // Standard headers diff --git a/viewer/Makefile.am b/viewer/Makefile.am index 08dcecc..5e4f463 100644 --- a/viewer/Makefile.am +++ b/viewer/Makefile.am @@ -10,7 +10,7 @@ AM_CPPFLAGS = \ -I@top_srcdir@/src/networking \ -I@top_srcdir@/src/pngfuncs \ -I@top_srcdir@/src/structure \ - -I@top_srcdir@/src/tinyxml \ + -ltinyxml \ -I@top_srcdir@/src/tinyxpath noinst_PROGRAMS = viewer @@ -20,7 +20,7 @@ viewer_LDADD = \ ../src/pngfuncs/libpngfuncs.a \ ../src/structure/libstruct.a \ ../src/triangulation/libtriangulation.a \ - ../src/tinyxml/libtinyxml.a \ + -ltinyxml \ ../src/tinyxpath/libtinyxpath.a