aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-micmd.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2026-03-16 11:23:19 -0400
committerSimon Marchi <simon.marchi@efficios.com>2026-03-16 13:24:00 -0400
commitb73d92e2c547f29caece9ea0de904d874a6fffab (patch)
tree4af89bcd433165cb81cda731a36e5a3fca4afa98 /gdb/python/py-micmd.c
parent07caff21f90c2f0c9b7b0e79b00b774be668594c (diff)
downloadbinutils-b73d92e2c547f29caece9ea0de904d874a6fffab.tar.gz
binutils-b73d92e2c547f29caece9ea0de904d874a6fffab.tar.bz2
binutils-b73d92e2c547f29caece9ea0de904d874a6fffab.zip
gdb, gdbserver, gdbsupport: replace many uses of strcmp with streq
Replace all occurrences of: strcmp (...) == 0 strcmp (...) != 0 !strcmp (...) 0 == strcmp (...) strcmp (...) directly used as a boolean predicate with the equivalent expression using streq. This is for consistency (we already use streq as some places in the testsuite) but also for clarity. I think that streq is clearer on the intent than strcmp. It's also a bit shorter. Change-Id: Ibbf5261b1872c240bc0c982c147f6a5477275a91 Approved-By: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/python/py-micmd.c')
-rw-r--r--gdb/python/py-micmd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/python/py-micmd.c b/gdb/python/py-micmd.c
index 0c820751c56..ab06e197d84 100644
--- a/gdb/python/py-micmd.c
+++ b/gdb/python/py-micmd.c
@@ -144,8 +144,7 @@ struct mi_command_py : public mi_command
than changing the value of mi_command::m_name (which is not accessible
from here) to point to the name owned by the new object, swap the names
of the two objects, since we know they are identical strings. */
- gdb_assert (strcmp (new_pyobj->mi_command_name,
- m_pyobj->mi_command_name) == 0);
+ gdb_assert (streq (new_pyobj->mi_command_name, m_pyobj->mi_command_name));
std::swap (new_pyobj->mi_command_name, m_pyobj->mi_command_name);
/* Take a reference to the new object, drop the reference to the current
@@ -385,7 +384,7 @@ micmdpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
So, for now at least, we don't allow this. This doesn't seem like
an excessive restriction. */
- if (strcmp (cmd->mi_command_name, name) != 0)
+ if (!streq (cmd->mi_command_name, name))
{
PyErr_SetString
(PyExc_ValueError,