aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/u_endian.h
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-04-18 16:59:16 +0200
committerlemon <lsof@mailbox.org>2026-04-18 16:59:16 +0200
commit554fb8de87bb2e37715dbcc70efc27274b041014 (patch)
tree8a9083b6fbcc21d46107465401be1150da45d46b /src/u_endian.h
parent7c25529f0a525ec4b4dcf40d847e2734c2349d5d (diff)
frontend: allow folding some non constant expressions as a GNU extension
And also permit zero size objects
Diffstat (limited to 'src/u_endian.h')
-rw-r--r--src/u_endian.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/u_endian.h b/src/u_endian.h
index a020da8..8f931f9 100644
--- a/src/u_endian.h
+++ b/src/u_endian.h
@@ -108,7 +108,7 @@ wr64be(uchar *p, u64int x)
/** target-endian memory read/write **/
static inline ushort
-rd16targ(uchar *p)
+rd16targ(const uchar *p)
{
ushort x;
memcpy(&x, p, sizeof x);
@@ -117,7 +117,7 @@ rd16targ(uchar *p)
}
static inline uint
-rd32targ(uchar *p)
+rd32targ(const uchar *p)
{
uint x;
memcpy(&x, p, sizeof x);
@@ -126,7 +126,7 @@ rd32targ(uchar *p)
}
static inline u64int
-rd64targ(uchar *p)
+rd64targ(const uchar *p)
{
u64int x;
memcpy(&x, p, sizeof x);
@@ -135,14 +135,14 @@ rd64targ(uchar *p)
}
static inline float
-rdf32targ(uchar *p)
+rdf32targ(const uchar *p)
{
union { uint i; float f; } u = { rd32targ(p) };
return u.f;
}
static inline double
-rdf64targ(uchar *p)
+rdf64targ(const uchar *p)
{
union { u64int i; double f; } u = { rd64targ(p) };
return u.f;