projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git]
/
opcodes
/
csky-dis.c
diff --git
a/opcodes/csky-dis.c
b/opcodes/csky-dis.c
index f57b9da6bdba1e1ae193398586077abfc3f5039a..bc6820ae0765f0e1404d189811c7008dd98bc9e8 100644
(file)
--- a/
opcodes/csky-dis.c
+++ b/
opcodes/csky-dis.c
@@
-1,5
+1,5
@@
/* C-SKY disassembler.
/* C-SKY disassembler.
- Copyright (C) 1988-20
18
Free Software Foundation, Inc.
+ Copyright (C) 1988-20
20
Free Software Foundation, Inc.
Contributed by C-SKY Microsystems and Mentor Graphics.
This file is part of the GNU opcodes library.
Contributed by C-SKY Microsystems and Mentor Graphics.
This file is part of the GNU opcodes library.
@@
-134,17
+134,15
@@
csky_get_mask (struct csky_opcode_info const *pinfo)
static unsigned int
csky_chars_to_number (unsigned char * buf, int n)
{
static unsigned int
csky_chars_to_number (unsigned char * buf, int n)
{
- if (n == 0)
- abort ();
int i;
int i;
- int val = 0;
+
unsigned
int val = 0;
if (dis_info.info->endian == BFD_ENDIAN_BIG)
if (dis_info.info->endian == BFD_ENDIAN_BIG)
- while (n--)
- val |= buf[n] << (n*8);
- else
for (i = 0; i < n; i++)
for (i = 0; i < n; i++)
- val |= buf[i] << (i*8);
+ val = val << 8 | buf[i];
+ else
+ for (i = n - 1; i >= 0; i--)
+ val = val << 8 | buf[i];
return val;
}
return val;
}
This page took
0.026299 seconds
and
4
git commands to generate.