diff --git a/include/tao/pegtl/internal/endian_system.hpp b/include/tao/pegtl/internal/endian_system.hpp index 549251c6e..9e1d86834 100644 --- a/include/tao/pegtl/internal/endian_system.hpp +++ b/include/tao/pegtl/internal/endian_system.hpp @@ -14,12 +14,12 @@ # if !defined( __ORDER_LITTLE_ENDIAN__ ) # define __ORDER_LITTLE_ENDIAN__ 1234 # endif -# if !defined( __BYTE__ORDER__ ) +# if !defined( __BYTE_ORDER__ ) # define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ # endif // I'm pretty sure that all Windows versions ever released -// are little endian, including on Alpha, Mips and Itanium... +// are little endian, including on Alpha, Mips and Itanium. # define TAO_PEGTL_BIG_ENDIAN_TYPE byteswap_endian # define TAO_PEGTL_LITTLE_ENDIAN_TYPE identity_endian diff --git a/src/example/pegtl/abnf2pegtl.cpp b/src/example/pegtl/abnf2pegtl.cpp index 10004f7a8..b3a9545ac 100644 --- a/src/example/pegtl/abnf2pegtl.cpp +++ b/src/example/pegtl/abnf2pegtl.cpp @@ -636,9 +636,9 @@ namespace TAO_PEGTL_NAMESPACE nrv.add< grammar::bin_val::value >( []( const node_ptr& n ) { unsigned long long v = 0; // TODO: Detect overflow - for( std::size_t i = 0; i < n->data.size(); ++i ) { + for( const char t : n->data ) { v <<= 1; - v |= ( n->data[ i ] & 1 ); + v |= ( t & 1 ); } std::ostringstream oss; oss << v;