charset.c: fix -Wpointer-sign
authorPedro Alves <palves@redhat.com>
Thu, 7 Mar 2013 19:10:46 +0000 (19:10 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 7 Mar 2013 19:10:46 +0000 (19:10 +0000)
commit2898e56054c7a35f85908729b01c6eb763317269
tree0fdd7210d07f603d9e91c1531feb2f27fca8f620
parenta09b444817a6a61ec6323e7e6dcc4ccbf465826f
charset.c: fix -Wpointer-sign

$ make WERROR_CFLAGS="-Wpointer-sign -Werror" charset.o 2>&1 1>/dev/null
../../src/gdb/charset.c: In function ‘wchar_iterate’:
../../src/gdb/charset.c:665:13: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
../../src/gdb/charset.c:691:13: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
../../src/gdb/charset.c:706:12: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]

The encoding conversion code works with gdb_byte arrays as the generic
buffers that hold strings of any encoding/width.  Changing the type of
this field to gdb_byte* removes the need for one cast, and makes
everything work with the same types.  That's good -- WRT to strings,
"char *" is (almost) consistently throughout GDB only used for
ascii-ish strings.

gdb/
2013-03-07  Pedro Alves  <palves@redhat.com>

* charset.c (struct wchar_iterator) <input>: Change type to 'const
gdb_byte *'.
(make_wchar_iterator): Remove cast to char*.
(wchar_iterate): Change type of local.
gdb/ChangeLog
gdb/charset.c
This page took 0.023972 seconds and 4 git commands to generate.