diff options
author | Nick Clifton <nickc@redhat.com> | 2007-01-11 08:58:56 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2007-01-11 08:58:56 +0000 |
commit | 04f8d83b9a623f43de70002a8e40ca295f954c0a (patch) | |
tree | c52241be5a9fc69fc100291a1141578e30549f8a /gas/config | |
parent | 669a9a2af6922f748d451486770ea70ce02385ba (diff) | |
download | gdb-04f8d83b9a623f43de70002a8e40ca295f954c0a.zip gdb-04f8d83b9a623f43de70002a8e40ca295f954c0a.tar.gz gdb-04f8d83b9a623f43de70002a8e40ca295f954c0a.tar.bz2 |
* config/tc-mcore.c (md_number_to_chars): Use number_to_chars_{big|little}endian.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mcore.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/gas/config/tc-mcore.c b/gas/config/tc-mcore.c index d84f0c8..e4adf05 100644 --- a/gas/config/tc-mcore.c +++ b/gas/config/tc-mcore.c @@ -1,5 +1,5 @@ /* tc-mcore.c -- Assemble code for M*Core - Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006 + Copyright 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -2170,24 +2170,10 @@ md_estimate_size_before_relax (fragS * fragP, segT segment_type) void md_number_to_chars (char * ptr, valueT use, int nbytes) { - if (! target_big_endian) - switch (nbytes) - { - case 4: ptr[3] = (use >> 24) & 0xff; /* Fall through. */ - case 3: ptr[2] = (use >> 16) & 0xff; /* Fall through. */ - case 2: ptr[1] = (use >> 8) & 0xff; /* Fall through. */ - case 1: ptr[0] = (use >> 0) & 0xff; break; - default: abort (); - } + if (target_big_endian) + number_to_chars_bigendian (ptr, use, nbytes); else - switch (nbytes) - { - case 4: *ptr++ = (use >> 24) & 0xff; /* Fall through. */ - case 3: *ptr++ = (use >> 16) & 0xff; /* Fall through. */ - case 2: *ptr++ = (use >> 8) & 0xff; /* Fall through. */ - case 1: *ptr++ = (use >> 0) & 0xff; break; - default: abort (); - } + number_to_chars_littleendian (ptr, use, nbytes); } /* Round up a section size to the appropriate boundary. */ |