summaryrefslogtreecommitdiffhomepage
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-05-02 20:53:05 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:18 -0500
commitb5f7f5d364d1546fc1c9eef76f17906aeafd0c13 (patch)
tree3214b7d6420cdf4dd7777250de1c20af19df4aa8 /src/internal
parent057a3a1f027ae998ba200636b40ea98589ac2f86 (diff)
downloadperk-b5f7f5d364d1546fc1c9eef76f17906aeafd0c13.tar.bz2
perk-b5f7f5d364d1546fc1c9eef76f17906aeafd0c13.tar.xz
fix big-endian code path; make the code more -Wall-resistant.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/perk_impl.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/internal/perk_impl.h b/src/internal/perk_impl.h
index 497ddbe..a47391c 100644
--- a/src/internal/perk_impl.h
+++ b/src/internal/perk_impl.h
@@ -37,7 +37,7 @@ static inline uint64_t pe_read_quad(const unsigned char * raw)
#else
-static inline uint16_t pe_read_short(unsigned char * raw)
+static inline uint16_t pe_read_short(const unsigned char * raw)
{
uint16_t x = *(uint16_t *)raw;
return x<<8 | x>>8;
@@ -48,12 +48,12 @@ static inline uint32_t pe_swap_long(uint32_t x)
return x<<24 | (x<<8) & 0xff0000 | (x>>8) & 0xff00 | x>>24;
}
-static inline uint32_t pe_read_long(unsigned char * raw)
+static inline uint32_t pe_read_long(const unsigned char * raw)
{
return pe_swap_long(*(uint32_t *)raw);
}
-static inline uint64_t pe_read_quad(unsigned char * raw)
+static inline uint64_t pe_read_quad(const unsigned char * raw)
{
uint64_t x = *(uint64_t *)raw;
return ((uint64_t)pe_swap_long(x)<<32) | pe_swap_long(x>>32);