-Wpointer-sign: python/.
This fixes -Wpointer-sign warnings in the python/ code in the manner that seems most appropriate to me. gdb/ 2013-04-19 Pedro Alves <palves@redhat.com> * python/py-inferior.c (infpy_write_memory): Add cast to gdb_byte * python/py-prettyprint.c (print_string_repr): Change type of 'output' local to char *. Add cast to gdb_byte * in LA_PRINT_STRING call. (print_children): Change type of 'output' local to char *. * python/py-value.c (valpy_string): Add cast to const char * in PyUnicode_Decode call.
This commit is contained in:
parent
ce6ec7d8d0
commit
89f6d8377b
|
@ -1,3 +1,13 @@
|
||||||
|
2013-04-19 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* python/py-inferior.c (infpy_write_memory): Add cast to gdb_byte
|
||||||
|
* python/py-prettyprint.c (print_string_repr): Change type of
|
||||||
|
'output' local to char *. Add cast to gdb_byte * in
|
||||||
|
LA_PRINT_STRING call.
|
||||||
|
(print_children): Change type of 'output' local to char *.
|
||||||
|
* python/py-value.c (valpy_string): Add cast to const char * in
|
||||||
|
PyUnicode_Decode call.
|
||||||
|
|
||||||
2013-04-19 Pedro Alves <palves@redhat.com>
|
2013-04-19 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* remote-mips.c (mips_cksum): Rename 'data' parameter to 'datastr'
|
* remote-mips.c (mips_cksum): Rename 'data' parameter to 'datastr'
|
||||||
|
|
|
@ -513,7 +513,7 @@ infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw)
|
||||||
error = 1;
|
error = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
write_memory_with_notification (addr, buffer, length);
|
write_memory_with_notification (addr, (gdb_byte *) buffer, length);
|
||||||
}
|
}
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
PyBuffer_Release (&pybuf);
|
PyBuffer_Release (&pybuf);
|
||||||
|
|
|
@ -343,13 +343,13 @@ print_string_repr (PyObject *printer, const char *hint,
|
||||||
string = python_string_to_target_python_string (py_str);
|
string = python_string_to_target_python_string (py_str);
|
||||||
if (string)
|
if (string)
|
||||||
{
|
{
|
||||||
gdb_byte *output;
|
char *output;
|
||||||
long length;
|
long length;
|
||||||
struct type *type;
|
struct type *type;
|
||||||
|
|
||||||
make_cleanup_py_decref (string);
|
make_cleanup_py_decref (string);
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
output = (gdb_byte *) PyBytes_AS_STRING (string);
|
output = PyBytes_AS_STRING (string);
|
||||||
length = PyBytes_GET_SIZE (string);
|
length = PyBytes_GET_SIZE (string);
|
||||||
#else
|
#else
|
||||||
output = PyString_AsString (string);
|
output = PyString_AsString (string);
|
||||||
|
@ -358,8 +358,8 @@ print_string_repr (PyObject *printer, const char *hint,
|
||||||
type = builtin_type (gdbarch)->builtin_char;
|
type = builtin_type (gdbarch)->builtin_char;
|
||||||
|
|
||||||
if (hint && !strcmp (hint, "string"))
|
if (hint && !strcmp (hint, "string"))
|
||||||
LA_PRINT_STRING (stream, type, output, length, NULL,
|
LA_PRINT_STRING (stream, type, (gdb_byte *) output,
|
||||||
0, options);
|
length, NULL, 0, options);
|
||||||
else
|
else
|
||||||
fputs_filtered (output, stream);
|
fputs_filtered (output, stream);
|
||||||
}
|
}
|
||||||
|
@ -634,7 +634,7 @@ print_children (PyObject *printer, const char *hint,
|
||||||
}
|
}
|
||||||
else if (gdbpy_is_string (py_v))
|
else if (gdbpy_is_string (py_v))
|
||||||
{
|
{
|
||||||
gdb_byte *output;
|
char *output;
|
||||||
|
|
||||||
output = python_string_to_host_string (py_v);
|
output = python_string_to_host_string (py_v);
|
||||||
if (!output)
|
if (!output)
|
||||||
|
|
|
@ -421,7 +421,8 @@ valpy_string (PyObject *self, PyObject *args, PyObject *kw)
|
||||||
GDB_PY_HANDLE_EXCEPTION (except);
|
GDB_PY_HANDLE_EXCEPTION (except);
|
||||||
|
|
||||||
encoding = (user_encoding && *user_encoding) ? user_encoding : la_encoding;
|
encoding = (user_encoding && *user_encoding) ? user_encoding : la_encoding;
|
||||||
unicode = PyUnicode_Decode (buffer, length * TYPE_LENGTH (char_type),
|
unicode = PyUnicode_Decode ((const char *) buffer,
|
||||||
|
length * TYPE_LENGTH (char_type),
|
||||||
encoding, errors);
|
encoding, errors);
|
||||||
xfree (buffer);
|
xfree (buffer);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue