File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -748,26 +748,23 @@ inline v8::MaybeLocal<v8::Value> ToV8Value(v8::Local<v8::Context> context,
748748 .Check (); \
749749 } while (0 )
750750
751- enum Endianness {
752- kLittleEndian , // _Not_ LITTLE_ENDIAN, clashes with endian.h.
753- kBigEndian
754- };
751+ enum class Endianness { LITTLE, BIG };
755752
756- inline enum Endianness GetEndianness () {
753+ inline Endianness GetEndianness () {
757754 // Constant-folded by the compiler.
758755 const union {
759756 uint8_t u8 [2 ];
760757 uint16_t u16 ;
761758 } u = {{1 , 0 }};
762- return u.u16 == 1 ? kLittleEndian : kBigEndian ;
759+ return u.u16 == 1 ? Endianness::LITTLE : Endianness::BIG ;
763760}
764761
765762inline bool IsLittleEndian () {
766- return GetEndianness () == kLittleEndian ;
763+ return GetEndianness () == Endianness::LITTLE ;
767764}
768765
769766inline bool IsBigEndian () {
770- return GetEndianness () == kBigEndian ;
767+ return GetEndianness () == Endianness::BIG ;
771768}
772769
773770// Round up a to the next highest multiple of b.
You can’t perform that action at this time.
0 commit comments