[PATCH v2 1/3] Use unsigned ints in regcache_map_entry

Alan Hayward
2018-06-21T09:38:59Z

All current uses of regcache_map_entry use static hard coded values.
Update transfer_regset which uses those values.

2018-06-21 Alan Hayward <alan.hayward@arm.com>

* regcache.c (transfer_regset): Use unsigned ints.
* regcache.h (regcache_map_entry): Likewise.
---
gdb/regcache.c | 4 ++--
gdb/regcache.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdb/regcache.c b/gdb/regcache.c
index 25436bb456..6276b149a2 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -988,14 +988,14 @@ regcache::transfer_regset (const struct regset *regset,
void *out_buf, size_t size) const
{
const struct regcache_map_entry *map;
- int offs = 0, count;
+ unsigned int offs = 0, count;

for (map = (const struct regcache_map_entry *) regset->regmap;
(count = map->count) != 0;
map++)
{
int regno = map->regno;
- int slot_size = map->size;
+ unsigned int slot_size = map->size;

if (slot_size == 0 && regno != REGCACHE_MAP_SKIP)
slot_size = m_descr->sizeof_register[regno];
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 74ac8583bc..35c41888a7 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -83,9 +83,9 @@ extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);

struct regcache_map_entry
{
- int count;
+ unsigned int count;
int regno;
- int size;
+ unsigned int size;
};

/* Special value for the 'regno' field in the struct above. */
--
2.15.2 (Apple Git-101.1)