{ "general", "use_system_keyboard_layout", bus_ibus_impl_set_use_sys_layout },
{ "general", "use_global_engine", bus_ibus_impl_set_use_global_engine },
{ "general", "embed_preedit_text", bus_ibus_impl_set_embed_preedit_text },
- { NULL, NULL, NULL },
};
- for (i = 0; entries[i].section != NULL; i++) {
+ for (i = 0; i < G_N_ELEMENTS (entries); i++) {
if (ibus->config != NULL &&
ibus_config_get_value (ibus->config,
entries[i].section,
{ "general", "use_system_keyboard_layout", bus_ibus_impl_set_use_sys_layout },
{ "general", "use_global_engine", bus_ibus_impl_set_use_global_engine },
{ "general", "embed_preedit_text", bus_ibus_impl_set_embed_preedit_text },
- { NULL, NULL, NULL },
};
- for (i = 0; entries[i].section != NULL; i++) {
+ for (i = 0; i < G_N_ELEMENTS (entries); i++) {
if (g_strcmp0 (entries[i].section, section) == 0 &&
g_strcmp0 (entries[i].key, key) == 0) {
entries[i].func (ibus, value);
{ "PageDown", PAGE_DOWN },
{ "CursorUp", CURSOR_UP },
{ "CursorDown", CURSOR_DOWN },
- { NULL, 0},
};
panel = BUS_PANEL_PROXY (proxy);
- for (i = 0; ; i++) {
- if (signals[i].member == NULL)
- break;
+ for (i = 0; i < G_N_ELEMENTS (signals); i++) {
if (ibus_message_is_signal (message, IBUS_INTERFACE_PANEL, signals[i].member)) {
g_signal_emit (panel, panel_signals[signals[i].signal_id], 0);
goto handled;
{ "ShowPreeditText", G_STRUCT_OFFSET (IBusPanelServiceClass, show_preedit_text) },
{ "StartSetup", G_STRUCT_OFFSET (IBusPanelServiceClass, start_setup) },
{ "StateChanged", G_STRUCT_OFFSET (IBusPanelServiceClass, state_changed) },
- { NULL, 0 },
};
IBusMessage *reply = NULL;
gint i;
- for (i = 0; no_arg_methods[i].name != NULL; i++) {
+ for (i = 0; i < G_N_ELEMENTS (no_arg_methods); i++) {
if (!ibus_message_is_method_call (message, IBUS_INTERFACE_PANEL,
no_arg_methods[i].name))
continue;