From bcafd1c19e628d831cf3eb20229c42ad9db4b29c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 15 Sep 2023 11:56:35 -0600 Subject: Use gdb::checked_static_cast for watchpoints This replaces some casts to 'watchpoint *' with checked_static_cast. In one spot, an unnecessary block is also removed. Approved-By: Simon Marchi --- gdb/python/py-breakpoint.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gdb/python') diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index cb06451..71182cc 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -549,14 +549,13 @@ bppy_get_expression (PyObject *self, void *closure) { const char *str; gdbpy_breakpoint_object *obj = (gdbpy_breakpoint_object *) self; - struct watchpoint *wp; BPPY_REQUIRE_VALID (obj); if (!is_watchpoint (obj->bp)) Py_RETURN_NONE; - wp = (struct watchpoint *) obj->bp; + watchpoint *wp = gdb::checked_static_cast (obj->bp); str = wp->exp_string.get (); if (! str) -- cgit v1.1