[gnome-usage] general: escape all keywords used as identifiers



commit 5d9b8578dae699a086349dc609653dc4b65a043e
Author: Nahuel Gomez <contact nahuelgomez com ar>
Date:   Thu Dec 9 09:57:30 2021 -0300

    general: escape all keywords used as identifiers
    
    Using keywords without escaping them for identifiers in Vala is quite dangerous,
    since even minor changes in the compiler can trigger completely unexpected
    errors.
    
    Some progress has been made in the compiler to minimize possible errors, but it
    is better to simply escape everything.

 src/app-item.vala                  |  2 +-
 src/storage/storage-actionbar.vala |  2 +-
 src/system-monitor.vala            |  2 +-
 src/utils.vala                     | 16 ++++++++--------
 4 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/app-item.vala b/src/app-item.vala
index 89ee8f0..5f751c5 100644
--- a/src/app-item.vala
+++ b/src/app-item.vala
@@ -166,7 +166,7 @@ public class Usage.AppItem : Object {
     }
 
     public Process get_process_by_pid (Pid pid) {
-        return processes.get (pid);
+        return processes.@get (pid);
     }
 
     public void insert_process (Process process) {
diff --git a/src/storage/storage-actionbar.vala b/src/storage/storage-actionbar.vala
index 9d99199..c31d531 100644
--- a/src/storage/storage-actionbar.vala
+++ b/src/storage/storage-actionbar.vala
@@ -77,7 +77,7 @@ public class Usage.StorageActionBar : Gtk.ActionBar {
             }
 
             if (delete_basefile)
-                file.delete ();
+                file.@delete ();
         }
         catch (Error e) {
             stderr.printf ("Error: %s\n", e.message);
diff --git a/src/system-monitor.vala b/src/system-monitor.vala
index 5cc9421..c03b851 100644
--- a/src/system-monitor.vala
+++ b/src/system-monitor.vala
@@ -49,7 +49,7 @@ public class Usage.SystemMonitor : Object {
     }
 
     public unowned AppItem get_app_by_name (string name) {
-        return app_table.get (name);
+        return app_table.@get (name);
     }
 
     public SystemMonitor () {
diff --git a/src/utils.vala b/src/utils.vala
index d3ca9ff..27068e1 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -19,18 +19,18 @@
  */
 
 public class Usage.Utils {
-    public static string format_size_values (uint64 value) {
-        if (value >= 1000)
-            return GLib.format_size (value);
+    public static string format_size_values (uint64 @value) {
+        if (@value >= 1000)
+            return GLib.format_size (@value);
         else
-            return _("%llu B").printf (value);
+            return _("%llu B").printf (@value);
     }
 
-    public static string format_size_speed_values (uint64 value) {
-        if (value >= 1000)
-            return _("%s/s").printf (GLib.format_size (value));
+    public static string format_size_speed_values (uint64 @value) {
+        if (@value >= 1000)
+            return _("%s/s").printf (GLib.format_size (@value));
         else
-            return _("%llu B/s").printf (value);
+            return _("%llu B/s").printf (@value);
     }
 
     public static Gdk.RGBA generate_color (Gdk.RGBA default_color, uint order, uint all_count, bool reverse 
= false) {


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