[glib: 1/2] gdbusmessage: Drop redundant uint ≥ 0 checks
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] gdbusmessage: Drop redundant uint ≥ 0 checks
- Date: Tue, 18 Aug 2020 10:25:18 +0000 (UTC)
commit 7afd4071d6e7fe6cde218cf7a1c2b0aab6904cdb
Author: Philip Withnall <withnall endlessm com>
Date: Tue Aug 18 10:39:46 2020 +0100
gdbusmessage: Drop redundant uint ≥ 0 checks
They are always true.
Coverity CID: #1430645, #1430674, #1430884, #1430974
Signed-off-by: Philip Withnall <withnall endlessm com>
gio/gdbusmessage.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
index 3b3a013af..0e4878dfb 100644
--- a/gio/gdbusmessage.c
+++ b/gio/gdbusmessage.c
@@ -877,7 +877,7 @@ g_dbus_message_set_message_type (GDBusMessage *message,
GDBusMessageType type)
{
g_return_if_fail (G_IS_DBUS_MESSAGE (message));
- g_return_if_fail ((guint) type >= 0 && (guint) type < 256);
+ g_return_if_fail ((guint) type < 256);
if (message->locked)
{
@@ -924,7 +924,7 @@ g_dbus_message_set_flags (GDBusMessage *message,
GDBusMessageFlags flags)
{
g_return_if_fail (G_IS_DBUS_MESSAGE (message));
- g_return_if_fail ((guint) flags >= 0 && (guint) flags < 256);
+ g_return_if_fail ((guint) flags < 256);
if (message->locked)
{
@@ -1002,7 +1002,7 @@ g_dbus_message_get_header (GDBusMessage *message,
GDBusMessageHeaderField header_field)
{
g_return_val_if_fail (G_IS_DBUS_MESSAGE (message), NULL);
- g_return_val_if_fail ((guint) header_field >= 0 && (guint) header_field < 256, NULL);
+ g_return_val_if_fail ((guint) header_field < 256, NULL);
return g_hash_table_lookup (message->headers, GUINT_TO_POINTER (header_field));
}
@@ -1024,7 +1024,7 @@ g_dbus_message_set_header (GDBusMessage *message,
GVariant *value)
{
g_return_if_fail (G_IS_DBUS_MESSAGE (message));
- g_return_if_fail ((guint) header_field >= 0 && (guint) header_field < 256);
+ g_return_if_fail ((guint) header_field < 256);
if (message->locked)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]