diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-03-29 22:41:14 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-03-29 22:41:14 -0400 |
commit | 5aedb83b9cbf22ce09719584479a21d905f438ff (patch) | |
tree | a209ea6cf198acbcbf3d2fd56929c37a564c86e0 /sim/cr16/endian.c | |
parent | ca968da465a0d1fd153b158b7aa69730709f43db (diff) | |
download | gdb-5aedb83b9cbf22ce09719584479a21d905f438ff.zip gdb-5aedb83b9cbf22ce09719584479a21d905f438ff.tar.gz gdb-5aedb83b9cbf22ce09719584479a21d905f438ff.tar.bz2 |
sim: cr16: clean up misc warnings
Diffstat (limited to 'sim/cr16/endian.c')
-rw-r--r-- | sim/cr16/endian.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/sim/cr16/endian.c b/sim/cr16/endian.c index 4a4e9c2..3cf2f22 100644 --- a/sim/cr16/endian.c +++ b/sim/cr16/endian.c @@ -28,22 +28,19 @@ #endif ENDIAN_INLINE uint16 -get_word (x) - uint8 *x; +get_word (uint8 *x) { return *(uint16 *)x; } ENDIAN_INLINE uint32 -get_longword (x) - uint8 *x; +get_longword (uint8 *x) { return (((uint32) *(uint16 *)x) << 16) | ((uint32) *(uint16 *)(x+2)); } ENDIAN_INLINE int64 -get_longlong (x) - uint8 *x; +get_longlong (uint8 *x) { uint32 top = get_longword (x); uint32 bottom = get_longword (x+4); @@ -51,9 +48,7 @@ get_longlong (x) } ENDIAN_INLINE void -write_word (addr, data) - uint8 *addr; - uint16 data; +write_word (uint8 *addr, uint16 data) { addr[1] = (data >> 8) & 0xff; addr[0] = data & 0xff; @@ -61,18 +56,14 @@ write_word (addr, data) } ENDIAN_INLINE void -write_longword (addr, data) - uint8 *addr; - uint32 data; +write_longword (uint8 *addr, uint32 data) { *(uint16 *)(addr + 2) = (uint16)(data >> 16); *(uint16 *)(addr) = (uint16)data; } ENDIAN_INLINE void -write_longlong (addr, data) - uint8 *addr; - int64 data; +write_longlong (uint8 *addr, int64 data) { write_longword (addr+4, (uint32)(data >> 32)); write_longword (addr, (uint32)data); |