From 74732c541228ebb9f0a15b0a22132a85b32de89b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 7 Apr 2019 11:36:50 -0700 Subject: [PATCH] Help the compiler with byte order * src/xsettings.c (parse_settings): Help the compiler by letting it deduce the native endianness at compile-time. --- src/xsettings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xsettings.c b/src/xsettings.c index 0c5e36d9d69..947d5cfb7b6 100644 --- a/src/xsettings.c +++ b/src/xsettings.c @@ -393,8 +393,8 @@ parse_settings (unsigned char *prop, unsigned long bytes, struct xsettings *settings) { - Lisp_Object byteorder = Fbyteorder (); - int my_bo = XFIXNAT (byteorder) == 'B' ? MSBFirst : LSBFirst; + int int1 = 1; + int my_bo = *(char *) &int1 == 1 ? LSBFirst : MSBFirst; int that_bo = prop[0]; CARD32 n_settings; int bytes_parsed = 0; -- 2.39.2