Gitweb links:

...log 
http://git.netsurf-browser.org/libparserutils.git/shortlog/3b26155595049cbb4dfe503de5401cf3ffd720c2
...commit 
http://git.netsurf-browser.org/libparserutils.git/commit/3b26155595049cbb4dfe503de5401cf3ffd720c2
...tree 
http://git.netsurf-browser.org/libparserutils.git/tree/3b26155595049cbb4dfe503de5401cf3ffd720c2

The branch, master has been updated
       via  3b26155595049cbb4dfe503de5401cf3ffd720c2 (commit)
      from  d101b2bb6dc98050f8f1b04d9d2bfeeff5a120c7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libparserutils.git/commit/?id=3b26155595049cbb4dfe503de5401cf3ffd720c2
commit 3b26155595049cbb4dfe503de5401cf3ffd720c2
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Endian: Improve host endian detection for older GCCs.
    
    Co-authored-by: John-Mark Bell <[email protected]>

diff --git a/src/utils/endian.h b/src/utils/endian.h
index 8a4760b..a3bc3d4 100644
--- a/src/utils/endian.h
+++ b/src/utils/endian.h
@@ -10,9 +10,9 @@
 
 static inline bool endian_host_is_le(void)
 {
-       static uint32_t magic = 0x10000002;
+       const uint16_t test = 1;
 
-       return (((uint8_t *) &magic)[0] == 0x02);
+       return ((uint8_t *) &test)[0];
 }
 
 static inline uint32_t endian_swap(uint32_t val)


-----------------------------------------------------------------------

Summary of changes:
 src/utils/endian.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils/endian.h b/src/utils/endian.h
index 8a4760b..a3bc3d4 100644
--- a/src/utils/endian.h
+++ b/src/utils/endian.h
@@ -10,9 +10,9 @@
 
 static inline bool endian_host_is_le(void)
 {
-       static uint32_t magic = 0x10000002;
+       const uint16_t test = 1;
 
-       return (((uint8_t *) &magic)[0] == 0x02);
+       return ((uint8_t *) &test)[0];
 }
 
 static inline uint32_t endian_swap(uint32_t val)


-- 
Lexer/parser utility functions
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to