diff options
| author | 2023-06-29 09:59:30 +0200 | |
|---|---|---|
| committer | 2023-06-29 09:59:30 +0200 | |
| commit | f453b313f62ba42d748f00628be7b3750c797c86 (patch) | |
| tree | e654029d425dee2adf30c0fa2adba31d0266db1c /endian.h | |
| parent | 3b96204593b9812674126bad8de14419009682c8 (diff) | |
add initializers (only static for initialier list rn)
and other fixes
Diffstat (limited to 'endian.h')
| -rw-r--r-- | endian.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -128,6 +128,20 @@ wr64targ(uchar *p, uvlong x) memcpy(p, &x, sizeof x); } +static inline void +wrf32targ(uchar *p, float x) +{ + union { float f; uint i; } u = { x }; + wr32targ(p, u.i); +} + +static inline void +wrf64targ(uchar *p, double x) +{ + union { double f; uvlong i; } u = { x }; + wr64targ(p, u.i); +} + #endif /* ENDIAN_H_ */ /* vim:set ts=3 sw=3 expandtab: */ |