Skip to content

Commit

Permalink
Fix loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinH committed Nov 18, 2024
1 parent 77b08fb commit 307ef21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/tao/pegtl/internal/endian_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/example/pegtl/abnf2pegtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 307ef21

Please sign in to comment.