[baobab] Fix a few warnings



commit 2ed6978cec712171a8197ee054a7edce914ed86a
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu May 28 19:07:33 2020 +0200

    Fix a few warnings

 src/baobab-cellrenderers.vala | 2 ++
 src/baobab-chart.vala         | 6 +++---
 src/baobab-treemap.vala       | 8 ++++----
 3 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/baobab-cellrenderers.vala b/src/baobab-cellrenderers.vala
index 95c02eb..aeaa943 100644
--- a/src/baobab-cellrenderers.vala
+++ b/src/baobab-cellrenderers.vala
@@ -52,6 +52,8 @@ namespace Baobab {
             case Scanner.State.CHILD_ERROR:
                 context.add_class ("baobab-cell-warning");
                 break;
+            default:
+                break;
             }
 
             base.render (cr, widget, background_area, cell_area, flags);
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index 703a734..4c0e24c 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -536,15 +536,15 @@ namespace Baobab {
         }
 
         public void open_file () {
-            (get_toplevel () as Window).open_item (highlighted_item.iter);
+            ((Window) get_toplevel ()).open_item (highlighted_item.iter);
         }
 
         public void copy_path () {
-            (get_toplevel () as Window).copy_path (highlighted_item.iter);
+            ((Window) get_toplevel ()).copy_path (highlighted_item.iter);
         }
 
         public void trash_file () {
-            (get_toplevel () as Window).trash_file (highlighted_item.iter);
+            ((Window) get_toplevel ()).trash_file (highlighted_item.iter);
         }
 
         protected bool can_move_up_root () {
diff --git a/src/baobab-treemap.vala b/src/baobab-treemap.vala
index 2788a3e..6db9fcf 100644
--- a/src/baobab-treemap.vala
+++ b/src/baobab-treemap.vala
@@ -93,7 +93,7 @@ namespace Baobab {
             Gtk.Allocation allocation;
             double width = 0, height = 0;
 
-            rect = (item as TreemapItem).cr_rect;
+            rect = ((TreemapItem) item).cr_rect;
             get_allocation (out allocation);
 
             if ((item.depth % 2) != 0) {
@@ -112,7 +112,7 @@ namespace Baobab {
         }
 
         protected override void calculate_item_geometry (ChartItem item) {
-            TreemapItem treemapitem = item as TreemapItem;
+            TreemapItem treemapitem = (TreemapItem) item;
             Cairo.Rectangle p_area = Cairo.Rectangle ();
 
             if (item.depth == 0) {
@@ -129,7 +129,7 @@ namespace Baobab {
                 p_area.width = allocation.width + ITEM_PADDING * 2;
                 p_area.height = allocation.height + ITEM_PADDING * 2;
             } else {
-                p_area = (item.parent.data as TreemapItem).cr_rect;
+                p_area = ((TreemapItem) item.parent.data).cr_rect;
             }
 
             if (item.depth % 2 != 0) {
@@ -173,7 +173,7 @@ namespace Baobab {
         }
 
         protected override void get_item_rectangle (ChartItem item) {
-            var crect = (item as TreemapItem).cr_rect;
+            var crect = ((TreemapItem) item).cr_rect;
 
             item.rect.x = (int) crect.x;
             item.rect.y = (int) crect.y;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]