Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix some build warnings.

  • Loading branch information...
commit ebfb9ae7fe2af60f9c2b1c1bd56739316c01d097 1 parent 4b044a0
Peng Huang authored
2  bus/dbusimpl.c
@@ -330,8 +330,6 @@ bus_name_service_new (const gchar *name)
330 330 static void
331 331 bus_name_service_free (BusNameService *service)
332 332 {
333   - GSList *list = NULL;
334   -
335 333 g_assert (service != NULL);
336 334
337 335 g_slist_free_full (service->owners,
10 tools/main.vala
@@ -223,8 +223,8 @@ static string program_name;
223 223 void print_usage(FileStream stream) {
224 224 stream.printf(_("Usage: %s COMMAND [OPTION...]\n\n"), program_name);
225 225 stream.printf(_("Commands:\n"));
226   - foreach (var command in commands) {
227   - stream.printf(" %s\n", command.name);
  226 + for (int i = 0; i < commands.length; i++) {
  227 + stream.printf(" %s\n", commands[i].name);
228 228 }
229 229 }
230 230
@@ -239,9 +239,9 @@ public int main(string[] argv) {
239 239 }
240 240
241 241 string[] new_argv = argv[1:argv.length];
242   - foreach (var command in commands) {
243   - if (command.name == argv[1])
244   - return command.entry(new_argv);
  242 + for (int i = 0; i < commands.length; i++) {
  243 + if (commands[i].name == argv[1])
  244 + return commands[i].entry(new_argv);
245 245 }
246 246
247 247 stderr.printf(_("%s is unknown command!\n"), argv[1]);
14 ui/gtk3/candidatearea.vala
@@ -136,10 +136,12 @@ class CandidateArea : Gtk.Box {
136 136
137 137 if (m_vertical) {
138 138 // Add Candidates
139   - Gtk.HBox candidates_hbox = new Gtk.HBox(false, 0);
  139 + Gtk.Box candidates_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
140 140 pack_start(candidates_hbox, false, false, 0);
141   - Gtk.VBox labels_vbox = new Gtk.VBox(true, 0);
142   - Gtk.VBox candidates_vbox = new Gtk.VBox(true, 0);
  141 + Gtk.Box labels_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
  142 + labels_vbox.set_homogeneous(true);
  143 + Gtk.Box candidates_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
  144 + candidates_vbox.set_homogeneous(true);
143 145 candidates_hbox.pack_start(labels_vbox, false, false, 4);
144 146 candidates_hbox.pack_start(new VSeparator(), false, false, 0);
145 147 candidates_hbox.pack_start(candidates_vbox, true, true, 4);
@@ -148,7 +150,7 @@ class CandidateArea : Gtk.Box {
148 150 pack_start(new HSeparator(), false, false, 0);
149 151
150 152 // Add buttons
151   - Gtk.HBox buttons_hbox = new Gtk.HBox(false, 0);
  153 + Gtk.Box buttons_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
152 154 Gtk.Label state_label = new Gtk.Label(null);
153 155 state_label.set_size_request(20, -1);
154 156 buttons_hbox.pack_start(state_label, true, true, 0);
@@ -197,7 +199,7 @@ class CandidateArea : Gtk.Box {
197 199 m_widgets += candidate_ebox;
198 200 }
199 201 } else {
200   - Gtk.HBox hbox = new Gtk.HBox(false, 0);
  202 + Gtk.Box hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
201 203 add(hbox);
202 204
203 205 m_labels = {};
@@ -214,7 +216,7 @@ class CandidateArea : Gtk.Box {
214 216 candidate.show();
215 217 m_candidates += candidate;
216 218
217   - Gtk.HBox candidate_hbox = new Gtk.HBox(false, 0);
  219 + Gtk.Box candidate_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
218 220 candidate_hbox.show();
219 221 candidate_hbox.pack_start(label, false, false, 2);
220 222 candidate_hbox.pack_start(candidate, false, false, 2);
4 ui/gtk3/candidatepanel.vala
@@ -23,7 +23,7 @@
23 23 public class CandidatePanel : Gtk.HBox{
24 24 private bool m_vertical = true;
25 25 private Gtk.Window m_toplevel;
26   - private Gtk.VBox m_vbox;
  26 + private Gtk.Box m_vbox;
27 27
28 28 private Gtk.Label m_preedit_label;
29 29 private Gtk.Label m_aux_label;
@@ -60,7 +60,7 @@ public class CandidatePanel : Gtk.HBox{
60 60 handle.set_visible(true);
61 61 pack_start(handle, false, false, 0);
62 62
63   - m_vbox = new Gtk.VBox(false, 0);
  63 + m_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
64 64 m_vbox.set_visible(true);
65 65 pack_start(m_vbox, false, false, 0);
66 66
6 ui/gtk3/keybindingmanager.vala
@@ -131,7 +131,8 @@ public class KeybindingManager : GLib.Object {
131 131 Gdk.ModifierType.SHIFT_MASK,
132 132 Gdk.ModifierType.LOCK_MASK
133 133 };
134   - foreach (Gdk.ModifierType mask in masks) {
  134 + for (int i = 0; i < masks.length; i++) {
  135 + Gdk.ModifierType mask = masks[i];
135 136 if ((binding_mask & mask) == mask)
136 137 return mask;
137 138 }
@@ -215,7 +216,8 @@ public class KeybindingManager : GLib.Object {
215 216 X.KeyMask.Mod5Mask
216 217 };
217 218 int[] masks = {};
218   - foreach (var modifier in ignored_modifiers) {
  219 + for (int i = 0; i < ignored_modifiers.length; i++) {
  220 + int modifier = ignored_modifiers[i];
219 221 masks += modifier;
220 222
221 223 int length = masks.length;

0 comments on commit ebfb9ae

Please sign in to comment.
Something went wrong with that request. Please try again.