Commit 23f7c36
committed
Fix endianness conversions for u32, f32 and f64 types
Uses bswap64 by default to handle int64 and uint64 values.
For float and doubles, uses appropriate-size bswap operators by first
bit-casting floats and doubles to their same-size int types. Otherwise,
they will be coerced to an int type before conversion and be returned as
int values.
Signed-off-by: Matt Leon <mattleon@google.com>1 parent 66ea330 commit 23f7c36
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
29 | 37 | | |
30 | 38 | | |
31 | 39 | | |
| |||
0 commit comments