diff options
author | Tom Tromey <tromey@adacore.com> | 2020-09-15 11:08:56 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-09-15 11:08:56 -0600 |
commit | 062534d44f3eeb81903cc01ef0230cee5b3e4eb2 (patch) | |
tree | 9ec64c54b962a8f2bb8e7a4fd2977aa74f76e4fd /gdb/python/py-tui.c | |
parent | d1cab9876d72d867b2de82688f5f5a2a4b655edb (diff) | |
download | binutils-062534d44f3eeb81903cc01ef0230cee5b3e4eb2.zip binutils-062534d44f3eeb81903cc01ef0230cee5b3e4eb2.tar.gz binutils-062534d44f3eeb81903cc01ef0230cee5b3e4eb2.tar.bz2 |
Don't use PyLong_FromLong
This changes gdb to avoid PyLong_FromLong, preferring to
gdb_py_object_from_longest instead.
gdb/ChangeLog
2020-09-15 Tom Tromey <tromey@adacore.com>
* python/python.c (gdbpy_parameter_value): Use
gdb_py_object_from_longest.
* python/py-type.c (convert_field, typy_range): Use
gdb_py_object_from_longest.
* python/py-tui.c (gdbpy_tui_width, gdbpy_tui_height): Use
gdb_py_object_from_longest.
* python/py-lazy-string.c (stpy_get_length): Use
gdb_py_object_from_longest.
* python/py-infthread.c (thpy_get_num, thpy_get_global_num): Use
gdb_py_object_from_longest.
* python/py-infevents.c (create_memory_changed_event_object): Use
gdb_py_object_from_longest.
* python/py-inferior.c (infpy_get_num): Use
gdb_py_object_from_longest.
(infpy_get_pid): Likewise.
Diffstat (limited to 'gdb/python/py-tui.c')
-rw-r--r-- | gdb/python/py-tui.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/python/py-tui.c b/gdb/python/py-tui.c index 95c71f1..8a24f2f 100644 --- a/gdb/python/py-tui.c +++ b/gdb/python/py-tui.c @@ -392,7 +392,9 @@ gdbpy_tui_width (PyObject *self, void *closure) { gdbpy_tui_window *win = (gdbpy_tui_window *) self; REQUIRE_WINDOW (win); - return PyLong_FromLong (win->window->viewport_width ()); + gdbpy_ref<> result + = gdb_py_object_from_longest (win->window->viewport_width ()); + return result.release (); } /* Return the height of the TUI window. */ @@ -401,7 +403,9 @@ gdbpy_tui_height (PyObject *self, void *closure) { gdbpy_tui_window *win = (gdbpy_tui_window *) self; REQUIRE_WINDOW (win); - return PyLong_FromLong (win->window->viewport_height ()); + gdbpy_ref<> result + = gdb_py_object_from_longest (win->window->viewport_height ()); + return result.release (); } /* Return the title of the TUI window. */ |