Fix c++ cmpiler warnings
authorColin Clark <colin.clark@cclark.uk>
Fri, 31 Mar 2023 17:28:34 +0000 (18:28 +0100)
committerColin Clark <colin.clark@cclark.uk>
Fri, 31 Mar 2023 17:28:34 +0000 (18:28 +0100)
Include the gconstpointer casts missed from the previous commit

src/collect-io.cc
src/collect.cc
src/dupe.cc
src/editors.cc
src/filedata.cc
src/layout-util.cc

index 6997cea..2a7de39 100644 (file)
@@ -1020,8 +1020,8 @@ void collect_manager_notify_cb(FileData *fd, NotifyType type, gpointer UNUSED(da
 
 static gint collection_manager_sort_cb(gconstpointer a, gconstpointer b)
 {
-       const gchar *char_a = a;
-       const gchar *char_b = b;
+       const gchar *char_a = static_cast<const gchar *>(a);
+       const gchar *char_b = static_cast<const gchar *>(b);
 
        return g_strcmp0(char_a, char_b);
 }
index f32b4db..6af2513 100644 (file)
@@ -139,8 +139,8 @@ static SortType collection_list_sort_method = SORT_NAME;
 
 static gint collection_list_sort_cb(gconstpointer a, gconstpointer b)
 {
-       const CollectInfo *cia = a;
-       const CollectInfo *cib = b;
+       const CollectInfo *cia = static_cast<const CollectInfo *>(a);
+       const CollectInfo *cib = static_cast<const CollectInfo *>(b);
 
        switch (collection_list_sort_method)
                {
index edc8e3a..4e55413 100644 (file)
@@ -1734,7 +1734,7 @@ static DUPE_CHECK_RESULT dupe_match_check(DupeItem *di1, DupeItem *di2, gpointer
 static gint dupe_match_binary_search_cb(gconstpointer a, gconstpointer b)
 {
        const DupeItem *di1 = *((DupeItem **) a);
-       const DupeItem *di2 = b;
+       const DupeItem *di2 = static_cast<const DupeItem *>(b);
        DupeMatchType mask = param_match_mask;
 
        if (mask & DUPE_MATCH_ALL)
index 6e59dfc..48c62a7 100644 (file)
@@ -495,8 +495,8 @@ static void editor_list_add_cb(gpointer UNUSED(key), gpointer value, gpointer da
 
 static gint editor_sort(gconstpointer a, gconstpointer b)
 {
-       const EditorDescription *ea = a;
-       const EditorDescription *eb = b;
+       const EditorDescription *ea = static_cast<const EditorDescription *>(a);
+       const EditorDescription *eb = static_cast<const EditorDescription *>(b);
        gchar *caseless_name_ea;
        gchar *caseless_name_eb;
        gchar *collate_key_ea;
index 84390e2..0f94c6f 100644 (file)
@@ -912,8 +912,8 @@ void file_data_unlock_list(GList *list)
 
 static gint file_data_sort_by_ext(gconstpointer a, gconstpointer b)
 {
-       const FileData *fda = a;
-       const FileData *fdb = b;
+       const FileData *fda = static_cast<const FileData *>(a);
+       const FileData *fdb = static_cast<const FileData *>(b);
 
        if (fda->sidecar_priority < fdb->sidecar_priority) return -1;
        if (fda->sidecar_priority > fdb->sidecar_priority) return 1;
index e1c4e41..503c48a 100644 (file)
@@ -1994,8 +1994,8 @@ struct _DeleteWindow
 
 static gint layout_window_menu_list_sort_cb(gconstpointer a, gconstpointer b)
 {
-       const WindowNames *wna = a;
-       const WindowNames *wnb = b;
+       const WindowNames *wna = static_cast<const WindowNames *>(a);
+       const WindowNames *wnb = static_cast<const WindowNames *>(b);
 
        return g_strcmp0((gchar *)wna->name, (gchar *)wnb->name);
 }