From 0eca826cb8307c3db0878a186b221ae1357a6a3f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 10 Mar 2011 13:36:51 +0200 Subject: [PATCH] Mark htonll() as "const" function - 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/header.c b/lib/header.c index 144ed9b..f2253fe 100644 --- a/lib/header.c +++ b/lib/header.c @@ -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]); -- 2.7.4