1
0
mirror of https://github.com/leethomason/tinyxml2.git synced 2026-07-23 12:13:00 +04:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Lee Thomason 7589178395 minor readme fixes 2025-11-22 16:23:12 -08:00
LuridHound c4e29afeaf Fix issue 1000 (#1040)
* fix compilation warnings produced by -Wold-style-cast

* remove incorrect cast
2025-11-22 16:08:17 -08:00
Lee Thomason 5c9a452c73 Merge fallthrough to cpp (#1052)
Fix warnings on merge fallthroughs
2025-11-22 16:02:49 -08:00
2 changed files with 16 additions and 34 deletions
+4 -4
View File
@@ -59,7 +59,7 @@ browsers or have more complete XML needs, TinyXML-2 is not the parser for you.
TinyXML-1 vs. TinyXML-2
-----------------------
TinyXML-2 long been the focus of all development. It is well tested
TinyXML-2 has long been the focus of all development. It is well tested
and should be used instead of TinyXML-1.
TinyXML-2 uses a similar API to TinyXML-1 and the same
@@ -145,7 +145,7 @@ It essentially causes the XML to be parsed twice.
For applications that need to know about text nodes that are composed entirely of
whitespace, PEDANTIC_WHITESPACE is available. PEDANTIC_WHITESPACE maintains all the
whilespace between elements.
whitespace between elements.
PEDANTIC_WHITESPACE is a new mode and not as tested as the other whitespace modes.
@@ -178,7 +178,7 @@ will have the Value() of "Far & Away" when queried from the XMLText object,
and will be written back to the XML stream/file as an ampersand.
Additionally, any character can be specified by its Unicode code point:
The syntax ` ` or ` ` are both to the non-breaking space character.
The syntax ` ` or ` ` both refer to the non-breaking space character.
This is called a 'numeric character reference'. Any numeric character reference
that isn't one of the special entities above, will be read, but written as a
regular code point. The output is correct, but the entity syntax isn't preserved.
@@ -270,7 +270,7 @@ tinyxml2.h files in your project and build with your other source code.
There is also a CMake build included. CMake is the general build for TinyXML-2.
(Additional build systems are costly to maintain, and tend to bit-rot. They are
(Additional build systems are costly to maintain, and tend to become outdated. They are
being removed over time.)
Building TinyXML-2 - Using vcpkg
+12 -30
View File
@@ -36,38 +36,20 @@ distribution.
#ifndef __has_attribute
# define __has_attribute(x) 0
#endif
#ifdef __cplusplus
# ifndef __has_cpp_attribute
# define __has_cpp_attribute(x) 0
# endif
#else
# ifndef __has_c_attribute
# define __has_c_attribute(x) 0
# endif
#ifndef __has_cpp_attribute
# define __has_cpp_attribute(x) 0
#endif
#ifdef __cplusplus
# if defined(_MSC_VER)
# define TIXML_FALLTHROUGH (void(0))
# elif (__cplusplus >= 201703L && __has_cpp_attribute(fallthrough))
# define TIXML_FALLTHROUGH [[fallthrough]]
# elif __has_cpp_attribute(clang::fallthrough)
# define TIXML_FALLTHROUGH [[clang::fallthrough]]
# elif __has_attribute(fallthrough)
# define TIXML_FALLTHROUGH __attribute__((fallthrough))
# else
# define TIXML_FALLTHROUGH (void(0))
# endif
#if defined(_MSC_VER)
# define TIXML_FALLTHROUGH (void(0))
#elif (__cplusplus >= 201703L && __has_cpp_attribute(fallthrough))
# define TIXML_FALLTHROUGH [[fallthrough]]
#elif __has_cpp_attribute(clang::fallthrough)
# define TIXML_FALLTHROUGH [[clang::fallthrough]]
#elif __has_attribute(fallthrough)
# define TIXML_FALLTHROUGH __attribute__((fallthrough))
#else
# if defined(_MSC_VER)
# define TIXML_FALLTHROUGH (void(0))
# elif __has_c_attribute(fallthrough)
# define TIXML_FALLTHROUGH [[fallthrough]]
# elif __has_attribute(fallthrough)
# define TIXML_FALLTHROUGH __attribute__((fallthrough))
# else
# define TIXML_FALLTHROUGH (void(0))
# endif
# define TIXML_FALLTHROUGH (void(0))
#endif
@@ -2674,7 +2656,7 @@ void XMLPrinter::Write( const char* data, size_t size )
fwrite ( data , sizeof(char), size, _fp);
}
else {
char* p = _buffer.PushArr( static_cast<int>(size) ) - 1; // back up over the null terminator.
char* p = _buffer.PushArr( size ) - 1; // back up over the null terminator.
memcpy( p, data, size );
p[size] = 0;
}