[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 43/57] Plug in `ARRAY_SIZE' in ptrace code
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 43/57] Plug in `ARRAY_SIZE' in ptrace code |
Date: |
Fri, 21 Sep 2012 14:11:44 +0300 |
---
src/ptrace/_UPT_access_fpreg.c | 4 ++--
src/ptrace/_UPT_access_reg.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ptrace/_UPT_access_fpreg.c b/src/ptrace/_UPT_access_fpreg.c
index 283dcd4..4014377 100644
--- a/src/ptrace/_UPT_access_fpreg.c
+++ b/src/ptrace/_UPT_access_fpreg.c
@@ -36,7 +36,7 @@ _UPT_access_fpreg (unw_addr_space_t as, unw_regnum_t reg,
unw_fpreg_t *val,
pid_t pid = ui->pid;
int i;
- if ((unsigned) reg >= sizeof (_UPT_reg_offset) / sizeof (_UPT_reg_offset[0]))
+ if ((unsigned) reg >= ARRAY_SIZE (_UPT_reg_offset))
return -UNW_EBADREG;
errno = 0;
@@ -75,7 +75,7 @@ _UPT_access_fpreg (unw_addr_space_t as, unw_regnum_t reg,
unw_fpreg_t *val,
pid_t pid = ui->pid;
fpregset_t fpreg;
- if ((unsigned) reg >= sizeof (_UPT_reg_offset) / sizeof (_UPT_reg_offset[0]))
+ if ((unsigned) reg >= ARRAY_SIZE (_UPT_reg_offset))
return -UNW_EBADREG;
if (ptrace(PT_GETFPREGS, pid, (caddr_t)&fpreg, 0) == -1)
diff --git a/src/ptrace/_UPT_access_reg.c b/src/ptrace/_UPT_access_reg.c
index ed259d8..782eeb7 100644
--- a/src/ptrace/_UPT_access_reg.c
+++ b/src/ptrace/_UPT_access_reg.c
@@ -225,7 +225,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg,
unw_word_t *val,
}
#endif /* End of IA64 */
- if ((unsigned) reg >= sizeof (_UPT_reg_offset) / sizeof (_UPT_reg_offset[0]))
+ if ((unsigned) reg >= ARRAY_SIZE (_UPT_reg_offset))
{
#if UNW_DEBUG
Debug(2, "register out of range: >= %zu / %zu\n",
sizeof(_UPT_reg_offset), sizeof(_UPT_reg_offset[0]));
@@ -284,7 +284,7 @@ _UPT_access_reg (unw_addr_space_t as, unw_regnum_t reg,
unw_word_t *val,
if (write)
Debug (16, "%s [%u] <- %lx\n", unw_regname (reg), (unsigned) reg, (long)
*val);
#endif
- if ((unsigned) reg >= sizeof (_UPT_reg_offset) / sizeof (_UPT_reg_offset[0]))
+ if ((unsigned) reg >= ARRAY_SIZE (_UPT_reg_offset))
{
errno = EINVAL;
goto badreg;
--
1.7.9.5
- [Libunwind-devel] [PATCH 52/57] Apply `define_lock()', (continued)
- [Libunwind-devel] [PATCH 52/57] Apply `define_lock()', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 49/57] Use shared `ARRAY_SIZE' in IA64 tests, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 56/57] Add arguments to malloc and calloc prototypes in Ltest-nocalloc, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 55/57] Remove unused variable in Ltest-nocalloc, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 53/57] Prefer NULL over zero, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 35/57] SuperH port, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 47/57] Plug in `ALIAS' attribute, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 42/57] IA64: constify read only arrays in `tdep_init()', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 45/57] Define and use `WEAK', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 46/57] Define and use `CONST_ATTR', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 43/57] Plug in `ARRAY_SIZE' in ptrace code,
Tommi Rantala <=
- [Libunwind-devel] [PATCH 57/57] Assign `func' just once in Ltest-nocalloc glibc case, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 44/57] Define and use `NOINLINE', Tommi Rantala, 2012/09/21