Permalink
Browse files

Fix some build warnings.

  • Loading branch information...
1 parent 4b044a0 commit ebfb9ae7fe2af60f9c2b1c1bd56739316c01d097 Peng Huang committed Nov 5, 2012
Showing with 19 additions and 17 deletions.
  1. +0 −2 bus/dbusimpl.c
  2. +5 −5 tools/main.vala
  3. +8 −6 ui/gtk3/candidatearea.vala
  4. +2 −2 ui/gtk3/candidatepanel.vala
  5. +4 −2 ui/gtk3/keybindingmanager.vala
View
@@ -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,
View
@@ -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]);
@@ -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);
@@ -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);
@@ -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;

0 comments on commit ebfb9ae

Please sign in to comment.