Fix some build warnings.
authorPeng Huang <penghuang@google.com>
Mon, 5 Nov 2012 14:24:15 +0000 (09:24 -0500)
committerPeng Huang <penghuang@google.com>
Mon, 5 Nov 2012 14:24:15 +0000 (09:24 -0500)
BUG=None

Review URL: https://codereview.appspot.com/6775097

bus/dbusimpl.c
tools/main.vala
ui/gtk3/candidatearea.vala
ui/gtk3/candidatepanel.vala
ui/gtk3/keybindingmanager.vala

index 3ff24ca..366a246 100644 (file)
@@ -330,8 +330,6 @@ bus_name_service_new (const gchar *name)
 static void
 bus_name_service_free (BusNameService *service)
 {
-    GSList *list = NULL;
-
     g_assert (service != NULL);
 
     g_slist_free_full (service->owners,
index d053590..28bd336 100644 (file)
@@ -223,8 +223,8 @@ static string program_name;
 void print_usage(FileStream stream) {
     stream.printf(_("Usage: %s COMMAND [OPTION...]\n\n"), program_name);
     stream.printf(_("Commands:\n"));
-    foreach (var command in commands) {
-        stream.printf("  %s\n", command.name);
+    for (int i = 0; i < commands.length; i++) {
+        stream.printf("  %s\n", commands[i].name);
     }
 }
 
@@ -239,9 +239,9 @@ public int main(string[] argv) {
     }
 
     string[] new_argv = argv[1:argv.length];
-    foreach (var command in commands) {
-        if (command.name == argv[1])
-            return command.entry(new_argv);
+    for (int i = 0; i < commands.length; i++) {
+        if (commands[i].name == argv[1])
+            return commands[i].entry(new_argv);
     }
 
     stderr.printf(_("%s is unknown command!\n"), argv[1]);
index 611f810..82e03a7 100644 (file)
@@ -136,10 +136,12 @@ class CandidateArea : Gtk.Box {
 
         if (m_vertical) {
             // Add Candidates
-            Gtk.HBox candidates_hbox = new Gtk.HBox(false, 0);
+            Gtk.Box candidates_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
             pack_start(candidates_hbox, false, false, 0);
-            Gtk.VBox labels_vbox = new Gtk.VBox(true, 0);
-            Gtk.VBox candidates_vbox = new Gtk.VBox(true, 0);
+            Gtk.Box labels_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+            labels_vbox.set_homogeneous(true);
+            Gtk.Box candidates_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+            candidates_vbox.set_homogeneous(true);
             candidates_hbox.pack_start(labels_vbox, false, false, 4);
             candidates_hbox.pack_start(new VSeparator(), false, false, 0);
             candidates_hbox.pack_start(candidates_vbox, true, true, 4);
@@ -148,7 +150,7 @@ class CandidateArea : Gtk.Box {
             pack_start(new HSeparator(), false, false, 0);
 
             // Add buttons
-            Gtk.HBox buttons_hbox = new Gtk.HBox(false, 0);
+            Gtk.Box buttons_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
             Gtk.Label state_label = new Gtk.Label(null);
             state_label.set_size_request(20, -1);
             buttons_hbox.pack_start(state_label, true, true, 0);
@@ -197,7 +199,7 @@ class CandidateArea : Gtk.Box {
                 m_widgets += candidate_ebox;
             }
         } else {
-            Gtk.HBox hbox = new Gtk.HBox(false, 0);
+            Gtk.Box hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
             add(hbox);
 
             m_labels = {};
@@ -214,7 +216,7 @@ class CandidateArea : Gtk.Box {
                 candidate.show();
                 m_candidates += candidate;
 
-                Gtk.HBox candidate_hbox = new Gtk.HBox(false, 0);
+                Gtk.Box candidate_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
                 candidate_hbox.show();
                 candidate_hbox.pack_start(label, false, false, 2);
                 candidate_hbox.pack_start(candidate, false, false, 2);
index ae40b5b..b061e95 100644 (file)
@@ -23,7 +23,7 @@
 public class CandidatePanel : Gtk.HBox{
     private bool m_vertical = true;
     private Gtk.Window m_toplevel;
-    private Gtk.VBox m_vbox;
+    private Gtk.Box m_vbox;
 
     private Gtk.Label m_preedit_label;
     private Gtk.Label m_aux_label;
@@ -60,7 +60,7 @@ public class CandidatePanel : Gtk.HBox{
         handle.set_visible(true);
         pack_start(handle, false, false, 0);
 
-        m_vbox = new Gtk.VBox(false, 0);
+        m_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
         m_vbox.set_visible(true);
         pack_start(m_vbox, false, false, 0);
 
index 5ff0c65..12d731d 100644 (file)
@@ -131,7 +131,8 @@ public class KeybindingManager : GLib.Object {
             Gdk.ModifierType.SHIFT_MASK,
             Gdk.ModifierType.LOCK_MASK
         };
-        foreach (Gdk.ModifierType mask in masks) {
+        for (int i = 0; i < masks.length; i++) {
+            Gdk.ModifierType mask = masks[i];
             if ((binding_mask & mask) == mask)
                 return mask;
         }
@@ -215,7 +216,8 @@ public class KeybindingManager : GLib.Object {
             X.KeyMask.Mod5Mask
         };
         int[] masks = {};
-        foreach (var modifier in ignored_modifiers) {
+        for (int i = 0; i < ignored_modifiers.length; i++) {
+            int modifier = ignored_modifiers[i];
             masks += modifier;
 
             int length = masks.length;