From a5927a649036facb6a604f973758546f577b70db Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 29 Jan 2010 08:39:13 +0000 Subject: [PATCH] unify duplicate defines of the ARRAY_SIZE macro git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1745 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 +++ urjtag/src/cmd/cmd_bfin.c | 2 -- urjtag/src/flash/detectflash.c | 2 -- urjtag/sysdep.h | 2 ++ 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index a1b5b1b9..bec73771 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -10,6 +10,9 @@ src/tap/usbconn/libftdi.c, src/tap/usbconn/libusb.c, sysdep.h: Unify system checks in the common sysdep.h header. + * src/cmd/cmd_bfin.c, src/flash/detectflash.c, sysdep.h: Unify ARRAY_SIZE + helper macro here. + 2010-01-28 Mike Frysinger * src/cmd/cmd_bfin.c: Replace one-insn-a-file option with dynamic instruction diff --git a/urjtag/src/cmd/cmd_bfin.c b/urjtag/src/cmd/cmd_bfin.c index 26331674..ede3ca09 100644 --- a/urjtag/src/cmd/cmd_bfin.c +++ b/urjtag/src/cmd/cmd_bfin.c @@ -34,8 +34,6 @@ #include "cmd.h" -#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) - static int cmd_bfin_run (urj_chain_t *chain, char *params[]) { diff --git a/urjtag/src/flash/detectflash.c b/urjtag/src/flash/detectflash.c index cd1967f5..771d4199 100644 --- a/urjtag/src/flash/detectflash.c +++ b/urjtag/src/flash/detectflash.c @@ -297,8 +297,6 @@ urj_flash_detectflash (urj_log_level_t ll, urj_bus_t *bus, uint32_t adr) }; const char *bad_value = N_("Bad value"); -#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) - pri_vendor_tbl = cfi->identification_string.pri_vendor_tbl; major_version = pri_vendor_tbl->major_version; minor_version = pri_vendor_tbl->minor_version; diff --git a/urjtag/sysdep.h b/urjtag/sysdep.h index 6ed604d7..d74bf596 100644 --- a/urjtag/sysdep.h +++ b/urjtag/sysdep.h @@ -72,4 +72,6 @@ struct timespec { unsigned long tv_sec, tv_nsec; }; #define nanosleep(req, rem) usleep((req)->tv_sec * 1000 * 1000 + (req)->tv_nsec / 1000) #endif +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) + #endif /* SYSDEP_H */