]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Drop some (size_t) casts 18891/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Mar 2021 17:02:28 +0000 (18:02 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 5 Mar 2021 18:27:23 +0000 (19:27 +0100)
Upcasts of the same type are automatic, so no need for an explicit cast.

src/libsystemd/sd-bus/bus-message.c
src/shared/format-table.h

index 040206026f1cc4c30f8162bb1a876506b750bf97..b25064b672147dee6c1d2b9ec1fe30cd48360148 100644 (file)
@@ -161,8 +161,7 @@ static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, b
         start = ALIGN_TO(old_size, align);
         new_size = start + sz;
 
-        if (new_size < start ||
-            new_size > (size_t) UINT32_MAX)
+        if (new_size < start || new_size > UINT32_MAX)
                 goto poison;
 
         if (old_size == new_size)
@@ -1337,8 +1336,7 @@ static void *message_extend_body(
         added = padding + sz;
 
         /* Check for 32bit overflows */
-        if (end_body > (size_t) UINT32_MAX ||
-            end_body < start_body) {
+        if (end_body < start_body || end_body > UINT32_MAX) {
                 m->poisoned = true;
                 return NULL;
         }
index 02a85ee94bdb0f0c18a522dffde9d20f5fb9a289..d1935456f0aeabe29f9bd51c0e83483c1038677b 100644 (file)
@@ -102,9 +102,9 @@ void table_set_cell_height_max(Table *t, size_t height);
 int table_set_empty_string(Table *t, const char *empty);
 int table_set_display_all(Table *t);
 int table_set_display_internal(Table *t, size_t first_column, ...);
-#define table_set_display(...) table_set_display_internal(__VA_ARGS__, (size_t) SIZE_MAX)
+#define table_set_display(...) table_set_display_internal(__VA_ARGS__, SIZE_MAX)
 int table_set_sort_internal(Table *t, size_t first_column, ...);
-#define table_set_sort(...) table_set_sort_internal(__VA_ARGS__, (size_t) SIZE_MAX)
+#define table_set_sort(...) table_set_sort_internal(__VA_ARGS__, SIZE_MAX)
 int table_set_reverse(Table *t, size_t column, bool b);
 int table_hide_column_from_display(Table *t, size_t column);