aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-n-endian.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-08-30 00:02:19 +0000
committerAndrew Cagney <cagney@redhat.com>1997-08-30 00:02:19 +0000
commitf90b720ba1b70759feea3b3a130a6f8b01709d68 (patch)
treed1fc6c8386824a06ccb4d5d9042110ede99b0f6a /sim/common/sim-n-endian.h
parent4113ba4cd75baf802d84cb32f5d500082673ef41 (diff)
downloadgdb-f90b720ba1b70759feea3b3a130a6f8b01709d68.zip
gdb-f90b720ba1b70759feea3b3a130a6f8b01709d68.tar.gz
gdb-f90b720ba1b70759feea3b3a130a6f8b01709d68.tar.bz2
Passify GCC. Convert 0x0LL to something more portable in the FP code.
Diffstat (limited to 'sim/common/sim-n-endian.h')
-rw-r--r--sim/common/sim-n-endian.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/sim/common/sim-n-endian.h b/sim/common/sim-n-endian.h
index 840b467..1f546df 100644
--- a/sim/common/sim-n-endian.h
+++ b/sim/common/sim-n-endian.h
@@ -23,6 +23,8 @@
#error "N must be #defined"
#endif
+#include "sim-xcat.h"
+
/* NOTE: See end of file for #undef */
#define unsigned_N XCONCAT2(unsigned_,N)
#define endian_t2h_N XCONCAT2(endian_t2h_,N)
@@ -126,22 +128,24 @@ endian_le2h_N(unsigned_N raw_in)
INLINE_SIM_ENDIAN\
(void*)
-offset_N(unsigned_N *x,
- int sizeof_word,
- int word)
+offset_N (unsigned_N *x,
+ unsigned sizeof_word,
+ unsigned word)
{
char *in = (char*)x;
char *out;
- int offset = sizeof_word * word;
- ASSERT(offset + sizeof_word <= sizeof(unsigned_N));
- ASSERT(word < (sizeof_word / sizeof(unsigned_N)));
- ASSERT((sizeof(unsigned_N) % sizeof_word) == 0);
- if (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) {
- out = in + sizeof(unsigned_N) - offset;
- }
- else {
- out = in + offset;
- }
+ unsigned offset = sizeof_word * word;
+ ASSERT (offset + sizeof_word <= sizeof(unsigned_N));
+ ASSERT (word < (sizeof (unsigned_N) / sizeof_word));
+ ASSERT ((sizeof (unsigned_N) % sizeof_word) == 0);
+ if (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN)
+ {
+ out = in + sizeof (unsigned_N) - offset - sizeof_word;
+ }
+ else
+ {
+ out = in + offset;
+ }
return out;
}