Mark htonll() as "const" function
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 10 Mar 2011 11:36:51 +0000 (13:36 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 11 Mar 2011 12:25:45 +0000 (14:25 +0200)
- htonll() is a pure "const" function as it only manipulates the
  value passed to it and only calls htonl() functions which are
  also const.
- Also fix up the function prototype formatting

lib/header.c

index 144ed9b..f2253fe 100644 (file)
@@ -101,7 +101,9 @@ static const size_t headerMaxbytes = (32*1024*1024);
 #define        ENTRY_IN_REGION(_e)     ((_e)->info.offset < 0)
 
 /* Convert a 64bit value to network byte order. */
-static uint64_t htonll( uint64_t n ) {
+RPM_GNUC_CONST
+static uint64_t htonll(uint64_t n)
+{
     uint32_t *i = (uint32_t*)&n;
     uint32_t b = i[0];
     i[0] = htonl(i[1]);