[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libunwind-devel] [PATCH 49/57] Use shared `ARRAY_SIZE' in IA64 tests
From: |
Tommi Rantala |
Subject: |
[Libunwind-devel] [PATCH 49/57] Use shared `ARRAY_SIZE' in IA64 tests |
Date: |
Fri, 21 Sep 2012 14:11:50 +0300 |
---
tests/Gia64-test-nat.c | 7 +++----
tests/Gia64-test-rbs.c | 7 +++----
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/tests/Gia64-test-nat.c b/tests/Gia64-test-nat.c
index 1e9e939..89df54e 100644
--- a/tests/Gia64-test-nat.c
+++ b/tests/Gia64-test-nat.c
@@ -31,6 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#include <string.h>
#include <libunwind.h>
+#include "compiler.h"
#ifdef HAVE_SYS_UC_ACCESS_H
# include <sys/uc_access.h>
@@ -38,8 +39,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#include "tdep-ia64/rse.h"
-#define ARRAY_SIZE(a) ((int) (sizeof (a) / sizeof ((a)[0])))
-
#define NUM_RUNS 1024
//#define NUM_RUNS 1
#define MAX_CHECKS 1024
@@ -588,9 +587,9 @@ run_check (int test)
{
if (test == 1)
/* Make first test once go through each test... */
- index = i % ARRAY_SIZE (all_funcs);
+ index = i % (int) ARRAY_SIZE (all_funcs);
else
- index = random () % ARRAY_SIZE (all_funcs);
+ index = random () % (int) ARRAY_SIZE (all_funcs);
funcs[i] = all_funcs[index].func;
checks[i] = all_funcs[index].check;
}
diff --git a/tests/Gia64-test-rbs.c b/tests/Gia64-test-rbs.c
index ba89f88..2181e70 100644
--- a/tests/Gia64-test-rbs.c
+++ b/tests/Gia64-test-rbs.c
@@ -32,14 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */
#include <stdlib.h>
#include <libunwind.h>
+#include "compiler.h"
#include "ia64-test-rbs.h"
#define panic(args...) \
do { fprintf (stderr, args); ++nerrors; return -9999; } while (0)
-#define ARRAY_SIZE(a) ((int) (sizeof (a) / sizeof ((a)[0])))
-
/* The loadrs field in ar.rsc is 14 bits wide, which limits all ia64
implementations to at most 2048 physical stacked registers
(actually, slightly less than that, because loadrs also counts RNaT
@@ -138,7 +137,7 @@ run_check (int test)
/* First, generate a set of 88 random values which loadup() will load
into loc2-loc89 (r37-r124). */
- for (i = 0; i < ARRAY_SIZE (reg_values); ++i)
+ for (i = 0; i < (int) ARRAY_SIZE (reg_values); ++i)
{
reg_values[i] = random ();
/* Generate NaTs with a reasonably probability (1/16th): */
@@ -150,7 +149,7 @@ run_check (int test)
nfuncs = 0;
do
{
- n = random () % ARRAY_SIZE (spill_funcs);
+ n = random () % (int) ARRAY_SIZE (spill_funcs);
func[nfuncs++] = spill_funcs[n];
nspills += 2 + n;
}
--
1.7.9.5
- [Libunwind-devel] [PATCH 37/57] ppc32: `UNW_PPC32_REGS' fixlet, (continued)
- [Libunwind-devel] [PATCH 37/57] ppc32: `UNW_PPC32_REGS' fixlet, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 38/57] IA64: give prototype for `ia64_find_unwind_table()', Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 39/57] Set `_UPT_reg_offset' read only, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 41/57] Constify `operands' in src/dwarf/Gexpr.c, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 54/57] Replace empty argument lists with `void' in tests, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 51/57] Fix second operand read in dwarf_eval_expr(), Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 50/57] Teach autotools current ARM `ex_tables.h' location, Tommi Rantala, 2012/09/21
- [Libunwind-devel] [PATCH 48/57] Use `UNUSED' in tests, Tommi Rantala, 2012/09/21
- [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 <=
- [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, 2012/09/21
- [Libunwind-devel] [PATCH 57/57] Assign `func' just once in Ltest-nocalloc glibc case, Tommi Rantala, 2012/09/21