From 1b99fecf8992fe7680c97e62767080dc31d602b0 Mon Sep 17 00:00:00 2001
From: Vyas Giridharan <vyasgiridhar27@gmail.com>
Date: Wed, 30 Aug 2017 01:44:07 +0800
Subject: [PATCH] list-model: use macro for type casting

This patch converts all manual type casting to use
the NAUTILUS_LIST_MODEL macro for converging into a single
style.

https://bugzilla.gnome.org/show_bug.cgi?id=786866
---
 src/nautilus-list-model.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/nautilus-list-model.c b/src/nautilus-list-model.c
index c13cd9268..1a75cb710 100644
--- a/src/nautilus-list-model.c
+++ b/src/nautilus-list-model.c
@@ -207,7 +207,7 @@ nautilus_list_model_get_iter (GtkTreeModel *tree_model,
     FileEntry *file_entry;
     int i, d;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
     ptr = NULL;
 
     files = model->details->files;
@@ -240,7 +240,7 @@ nautilus_list_model_get_path (GtkTreeModel *tree_model,
     FileEntry *file_entry;
 
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     g_return_val_if_fail (iter->stamp == model->details->stamp, NULL);
 
@@ -327,7 +327,7 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model,
     NautilusFileIconFlags flags;
     cairo_surface_t *surface;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     g_return_if_fail (model->details->stamp == iter->stamp);
     g_return_if_fail (!g_sequence_iter_is_end (iter->user_data));
@@ -464,7 +464,7 @@ nautilus_list_model_iter_next (GtkTreeModel *tree_model,
 {
     NautilusListModel *model;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     g_return_val_if_fail (model->details->stamp == iter->stamp, FALSE);
 
@@ -482,7 +482,7 @@ nautilus_list_model_iter_children (GtkTreeModel *tree_model,
     GSequence *files;
     FileEntry *file_entry;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     if (parent == NULL)
     {
@@ -529,7 +529,7 @@ nautilus_list_model_iter_n_children (GtkTreeModel *tree_model,
     GSequence *files;
     FileEntry *file_entry;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     if (iter == NULL)
     {
@@ -555,7 +555,7 @@ nautilus_list_model_iter_nth_child (GtkTreeModel *tree_model,
     GSequence *files;
     FileEntry *file_entry;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     if (parent != NULL)
     {
@@ -588,7 +588,7 @@ nautilus_list_model_iter_parent (GtkTreeModel *tree_model,
     NautilusListModel *model;
     FileEntry *file_entry;
 
-    model = (NautilusListModel *) tree_model;
+    model = NAUTILUS_LIST_MODEL (tree_model);
 
     file_entry = g_sequence_get (child->user_data);
 
@@ -741,7 +741,7 @@ nautilus_list_model_file_entry_compare_func (gconstpointer a,
     NautilusListModel *model;
     int result;
 
-    model = (NautilusListModel *) user_data;
+    model = NAUTILUS_LIST_MODEL (user_data);
 
     file_entry1 = (FileEntry *) a;
     file_entry2 = (FileEntry *) b;
@@ -868,7 +868,7 @@ nautilus_list_model_get_sort_column_id (GtkTreeSortable *sortable,
     NautilusListModel *model;
     int id;
 
-    model = (NautilusListModel *) sortable;
+    model = NAUTILUS_LIST_MODEL (sortable);
 
     id = nautilus_list_model_get_sort_column_id_from_attribute
              (model, model->details->sort_attribute);
@@ -898,7 +898,7 @@ nautilus_list_model_set_sort_column_id (GtkTreeSortable *sortable,
 {
     NautilusListModel *model;
 
-    model = (NautilusListModel *) sortable;
+    model = NAUTILUS_LIST_MODEL (sortable);
 
     model->details->sort_attribute = nautilus_list_model_get_attribute_from_sort_column_id (model, sort_column_id);
 
-- 
2.14.1