Move htonll() into header.c and make static, not needed elsewhere
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 22 Dec 2009 10:33:16 +0000 (12:33 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 22 Dec 2009 10:33:16 +0000 (12:33 +0200)
lib/header.c
lib/header_internal.c
lib/header_internal.h

index a88f205..893d6f9 100644 (file)
@@ -86,6 +86,15 @@ typedef int (*headerTagTagFunction) (Header h, rpmtd td, headerGetFlags hgflags)
 
 extern void *rpmHeaderTagFunc(rpmTag tag);
 
+/* Convert a 64bit value to network byte order. */
+static uint64_t htonll( uint64_t n ) {
+    uint32_t *i = (uint32_t*)&n;
+    uint32_t b = i[0];
+    i[0] = htonl(i[1]);
+    i[1] = htonl(b);
+    return n;
+}
+
 Header headerLink(Header h)
 {
     if (h == NULL) return NULL;
index 44578d7..d3537f9 100644 (file)
@@ -9,11 +9,4 @@
 
 #include "debug.h"
 
-uint64_t htonll( uint64_t n ) {
-    uint32_t *i = (uint32_t*)&n;
-    uint32_t b = i[0];
-    i[0] = htonl(i[1]);
-    i[1] = htonl(b);
-    return n;
-}
 
index a228603..d9cb67e 100644 (file)
@@ -92,14 +92,6 @@ extern "C" {
 #endif
 
 /** \ingroup header
- * Conver a 64bit value to network byte order.
- * @param n            a number
- * @return             number in network byte order
- */
-RPM_GNUC_INTERNAL
-uint64_t htonll( uint64_t n );
-
-/** \ingroup header
  * Set header instance (rpmdb record number)
  * @param h            header
  * @param instance     record number