mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-05 21:50:21 +08:00
sim: use ARRAY_SIZE instead of ad-hoc sizeof calculations
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2017-02-13 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* srcdest.c: Include libiberty.h.
|
||||
(decode_sd23): Use ARRAY_SIZE.
|
||||
|
||||
2016-01-10 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* config.in, configure: Regenerate.
|
||||
|
@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "libiberty.h"
|
||||
#include "cpu.h"
|
||||
#include "mem.h"
|
||||
|
||||
@ -354,7 +355,7 @@ decode_sd23 (int bbb, int bb, int bytes, int ind, int add)
|
||||
srcdest sd;
|
||||
int code = (bbb << 2) | bb;
|
||||
|
||||
if (code >= sizeof (modes23) / sizeof (modes23[0]))
|
||||
if (code >= ARRAY_SIZE (modes23))
|
||||
abort ();
|
||||
|
||||
if (trace)
|
||||
|
Reference in New Issue
Block a user