[PATCH [2/2] Convert the unavailable vector to be bit, not byte, based.
Pedro Alves
palves@redhat.com
Wed Dec 11 18:45:00 GMT 2013
On 12/11/2013 04:28 PM, Andrew Burgess wrote:
> +
> + It is assumed that memory can be accessed from:
> + PTR + (OFFSET_BITS / TARGET_CHAR_BIT)
> + to:
> + PTR + ((OFFSET_BITS + TARGET_CHAR_BIT - 1)/ TARGET_CHAR_BIT) */
The "to:" part doesn't look right -- LENGTH_BITS seems to be
missing somewhere? Also, missing space before second "/".
> + bits = TARGET_CHAR_BIT - (offset1_bits % TARGET_CHAR_BIT);
Unnecessary parens.
> + b1 = *((bfd_byte *) ((uintptr_t) ptr1 + (o1 / TARGET_CHAR_BIT)));
> + b2 = *((bfd_byte *) ((uintptr_t) ptr2 + (o2 / TARGET_CHAR_BIT)));
No need for uintptr_t, nor the rightmost set of parens:
b1 = *((bfd_byte *) ptr1 + o1 / TARGET_CHAR_BIT);
b2 = *((bfd_byte *) ptr2 + o2 / TARGET_CHAR_BIT);
There may be other instances of unneeded parens. I won't point
them all out.
> + return memcmp ((void*) ((uintptr_t) ptr1
> + + (offset1_bits / TARGET_CHAR_BIT)),
> + (void*) ((uintptr_t) ptr2
> + + (offset2_bits / TARGET_CHAR_BIT)),
> + length_bits / TARGET_CHAR_BIT);
Space before *. Parens.
Otherwise looks OK. Thanks a lot for doing this!
--
Pedro Alves
More information about the Gdb-patches
mailing list