This fixes a few minor style issues I found in gdb/python: some
unnecessary casts, the removal of an unnecessary local variable, and
one instance of incorrect formatting.
Tested by rebuilding and re-running gdb.python.
gdb/ChangeLog
2019-01-02 Tom Tromey <tom@tromey.com>
* python/py-inferior.c (gdbpy_initialize_inferior): Fix
indentation.
* python/py-frame.c (frapy_older): Remove cast.
(frapy_newer): Likewise.
* python/py-breakpoint.c (local_setattro): Remove cast.
* python/py-arch.c (archpy_name): Remove local variable.
* python/py-type.c (gdbpy_lookup_type): Remove cast.
+2019-01-02 Tom Tromey <tom@tromey.com>
+
+ * python/py-inferior.c (gdbpy_initialize_inferior): Fix
+ indentation.
+ * python/py-frame.c (frapy_older): Remove cast.
+ (frapy_newer): Likewise.
+ * python/py-breakpoint.c (local_setattro): Remove cast.
+ * python/py-arch.c (archpy_name): Remove local variable.
+ * python/py-type.c (gdbpy_lookup_type): Remove cast.
+
2019-01-02 Joel Brobecker <brobecker@adacore.com>
* unittests/basic_string_view/element_access/char/empty.cc:
2019-01-02 Joel Brobecker <brobecker@adacore.com>
* unittests/basic_string_view/element_access/char/empty.cc:
{
struct gdbarch *gdbarch = NULL;
const char *name;
{
struct gdbarch *gdbarch = NULL;
const char *name;
ARCHPY_REQUIRE_VALID (self, gdbarch);
name = (gdbarch_bfd_arch_info (gdbarch))->printable_name;
ARCHPY_REQUIRE_VALID (self, gdbarch);
name = (gdbarch_bfd_arch_info (gdbarch))->printable_name;
- py_name = PyString_FromString (name);
-
- return py_name;
+ return PyString_FromString (name);
- return PyObject_GenericSetAttr ((PyObject *)self, name, v);
+ return PyObject_GenericSetAttr (self, name, v);
}
static gdb_PyGetSetDef breakpoint_object_getset[] = {
}
static gdb_PyGetSetDef breakpoint_object_getset[] = {
- prev_obj = (PyObject *) frame_info_to_frame_object (prev);
+ prev_obj = frame_info_to_frame_object (prev);
else
{
Py_INCREF (Py_None);
else
{
Py_INCREF (Py_None);
- next_obj = (PyObject *) frame_info_to_frame_object (next);
+ next_obj = frame_info_to_frame_object (next);
else
{
Py_INCREF (Py_None);
else
{
Py_INCREF (Py_None);
if (PyType_Ready (&membuf_object_type) < 0)
return -1;
if (PyType_Ready (&membuf_object_type) < 0)
return -1;
- return gdb_pymodule_addobject (gdb_module, "Membuf", (PyObject *)
- &membuf_object_type);
+ return gdb_pymodule_addobject (gdb_module, "Membuf",
+ (PyObject *) &membuf_object_type);
}
static gdb_PyGetSetDef inferior_object_getset[] =
}
static gdb_PyGetSetDef inferior_object_getset[] =
- return (PyObject *) type_to_type_object (type);
+ return type_to_type_object (type);