[glib] Avoid htole64 altogether



commit 496c52ec7908701f1d9506114776c645df0a5c4b
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jul 25 12:31:52 2016 -0400

    Avoid htole64 altogether
    
    GLib ships its own api for this, lets use it.

 glib/gmessages.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/glib/gmessages.c b/glib/gmessages.c
index 9e192f7..6b431ab 100644
--- a/glib/gmessages.c
+++ b/glib/gmessages.c
@@ -106,7 +106,6 @@
 #include <sys/un.h>
 #include <fcntl.h>
 #include <sys/uio.h>
-#include <endian.h>
 
 #include "glib-init.h"
 #include "galloca.h"
@@ -1923,7 +1922,7 @@ g_log_writer_journald (GLogLevelFlags   log_level,
   v = iov;
   for (i = 0; i < n_fields; i++)
     {
-      gsize length;
+      guint64 length;
       gboolean binary;
 
       if (fields[i].length < 0)
@@ -1947,7 +1946,7 @@ g_log_writer_journald (GLogLevelFlags   log_level,
           v[1].iov_base = (gpointer)&newline;
           v[1].iov_len = 1;
 
-          nstr = htole64 (length);
+          nstr = GUINT64_TO_LE(length);
           memcpy (&buf[k], &nstr, sizeof (nstr));
 
           v[2].iov_base = &buf[k];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]