diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-09 01:24:42 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-09 01:37:20 +0800 |
commit | 8a186c3588d3598857c36e2122fa68d01eba30fd (patch) | |
tree | 731078659d4e04af8346c5ca68512d8537b3707a /filter | |
parent | 2bf3460cd3eb0853a1d10a6e36f5091898a5533f (diff) | |
download | gsoc2013-evolution-8a186c3588d3598857c36e2122fa68d01eba30fd.tar.gz gsoc2013-evolution-8a186c3588d3598857c36e2122fa68d01eba30fd.tar.zst gsoc2013-evolution-8a186c3588d3598857c36e2122fa68d01eba30fd.zip |
Coding style cleanups.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/e-filter-code.c | 4 | ||||
-rw-r--r-- | filter/e-filter-color.c | 2 | ||||
-rw-r--r-- | filter/e-filter-datespec.c | 20 | ||||
-rw-r--r-- | filter/e-filter-file.c | 10 | ||||
-rw-r--r-- | filter/e-filter-input.c | 10 | ||||
-rw-r--r-- | filter/e-filter-int.c | 4 | ||||
-rw-r--r-- | filter/e-filter-option.c | 8 | ||||
-rw-r--r-- | filter/e-filter-part.c | 4 | ||||
-rw-r--r-- | filter/e-filter-rule.c | 10 | ||||
-rw-r--r-- | filter/e-rule-context.c | 16 | ||||
-rw-r--r-- | filter/e-rule-editor.c | 4 |
11 files changed, 46 insertions, 46 deletions
diff --git a/filter/e-filter-code.c b/filter/e-filter-code.c index 510d4a8808..02d8c0cccf 100644 --- a/filter/e-filter-code.c +++ b/filter/e-filter-code.c @@ -39,7 +39,7 @@ filter_code_build_code (EFilterElement *element, struct _EFilterPart *part) { GList *l; - EFilterInput *fi = (EFilterInput *)element; + EFilterInput *fi = (EFilterInput *) element; gboolean is_rawcode = fi && fi->type && g_str_equal (fi->type, "rawcode"); if (!is_rawcode) @@ -47,7 +47,7 @@ filter_code_build_code (EFilterElement *element, l = fi->values; while (l) { - g_string_append (out, (gchar *)l->data); + g_string_append (out, (gchar *) l->data); l = g_list_next (l); } diff --git a/filter/e-filter-color.c b/filter/e-filter-color.c index 63aa2ca689..64272d8f30 100644 --- a/filter/e-filter-color.c +++ b/filter/e-filter-color.c @@ -83,7 +83,7 @@ filter_color_xml_decode (EFilterElement *element, prop = xmlGetProp(node, (xmlChar *)"spec"); if (prop != NULL) { - gdk_color_parse ((gchar *)prop, &fc->color); + gdk_color_parse ((gchar *) prop, &fc->color); xmlFree (prop); } else { /* try reading the old RGB properties */ diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c index 34155f8073..d7aa93adc1 100644 --- a/filter/e-filter-datespec.c +++ b/filter/e-filter-datespec.c @@ -162,7 +162,7 @@ set_button (EFilterDatespec *fds) break; } - gtk_label_set_text ((GtkLabel *)fds->priv->label_button, label); + gtk_label_set_text ((GtkLabel *) fds->priv->label_button, label); } static void @@ -175,7 +175,7 @@ get_values (EFilterDatespec *fds) guint year, month, day; struct tm tm; - gtk_calendar_get_date ((GtkCalendar *)p->calendar_specify, &year, &month, &day); + gtk_calendar_get_date ((GtkCalendar *) p->calendar_specify, &year, &month, &day); memset (&tm, 0, sizeof (tm)); tm.tm_mday = day; tm.tm_year = year - 1900; @@ -187,7 +187,7 @@ get_values (EFilterDatespec *fds) case FDST_X_AGO: { gint val; - val = gtk_spin_button_get_value_as_int ((GtkSpinButton *)p->spin_relative); + val = gtk_spin_button_get_value_as_int ((GtkSpinButton *) p->spin_relative); fds->value = timespans[p->span].seconds * val; break; } case FDST_NOW: @@ -219,19 +219,19 @@ set_values (EFilterDatespec *fds) struct tm tm; localtime_r (&fds->value, &tm); - gtk_calendar_select_month ((GtkCalendar*)p->calendar_specify, tm.tm_mon, tm.tm_year + 1900); - gtk_calendar_select_day ((GtkCalendar*)p->calendar_specify, tm.tm_mday); + gtk_calendar_select_month ((GtkCalendar*) p->calendar_specify, tm.tm_mon, tm.tm_year + 1900); + gtk_calendar_select_day ((GtkCalendar*) p->calendar_specify, tm.tm_mday); break; } case FDST_X_AGO: p->span = get_best_span (fds->value); - gtk_spin_button_set_value ((GtkSpinButton*)p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 0); break; case FDST_X_FUTURE: p->span = get_best_span (fds->value); - gtk_spin_button_set_value ((GtkSpinButton*)p->spin_relative, fds->value/timespans[p->span].seconds); + gtk_spin_button_set_value ((GtkSpinButton*) p->spin_relative, fds->value/timespans[p->span].seconds); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_relative), p->span); gtk_combo_box_set_active (GTK_COMBO_BOX (p->combobox_past_future), 1); break; @@ -306,7 +306,7 @@ button_clicked (GtkButton *button, EFilterDatespec *fds) set_button (fds); } - gtk_widget_destroy ((GtkWidget *)dialog); + gtk_widget_destroy ((GtkWidget *) dialog); } static gboolean @@ -382,10 +382,10 @@ filter_datespec_xml_decode (EFilterElement *element, while (n) { if (!strcmp ((gchar *)n->name, "datespec")) { val = xmlGetProp (n, (xmlChar *)"type"); - fds->type = atoi ((gchar *)val); + fds->type = atoi ((gchar *) val); xmlFree (val); val = xmlGetProp (n, (xmlChar *)"value"); - fds->value = atoi ((gchar *)val); + fds->value = atoi ((gchar *) val); xmlFree (val); break; } diff --git a/filter/e-filter-file.c b/filter/e-filter-file.c index 91942ec6f6..d9f87ce9c8 100644 --- a/filter/e-filter-file.c +++ b/filter/e-filter-file.c @@ -132,8 +132,8 @@ filter_file_xml_encode (EFilterElement *element) xmlSetProp (value, (xmlChar *) "name", (xmlChar *) element->name); xmlSetProp (value, (xmlChar *) "type", (xmlChar *) type); - cur = xmlNewChild (value, NULL, (xmlChar *)type, NULL); - xmlNodeSetContent (cur, (xmlChar *)file->path); + cur = xmlNewChild (value, NULL, (xmlChar *) type, NULL); + xmlNodeSetContent (cur, (xmlChar *) file->path); return value; } @@ -160,8 +160,8 @@ filter_file_xml_decode (EFilterElement *element, child = node->children; while (child != NULL) { - if (!strcmp ((gchar *)child->name, type)) { - str = (gchar *)xmlNodeGetContent (child); + if (!strcmp ((gchar *) child->name, type)) { + str = (gchar *) xmlNodeGetContent (child); file->path = g_strdup (str ? str : ""); xmlFree (str); @@ -246,7 +246,7 @@ e_filter_file_new_type_name (const gchar *type) EFilterFile *file; file = e_filter_file_new (); - file->type = (gchar *) xmlStrdup ((xmlChar *)type); + file->type = (gchar *) xmlStrdup ((xmlChar *) type); return file; } diff --git a/filter/e-filter-input.c b/filter/e-filter-input.c index 84a9ad83c4..9842a5d5ea 100644 --- a/filter/e-filter-input.c +++ b/filter/e-filter-input.c @@ -64,7 +64,7 @@ filter_input_finalize (GObject *object) xmlFree (input->type); - g_list_foreach (input->values, (GFunc)g_free, NULL); + g_list_foreach (input->values, (GFunc) g_free, NULL); g_list_free (input->values); /* Chain up to parent's finalize() method. */ @@ -167,7 +167,7 @@ filter_input_xml_encode (EFilterElement *element) xmlChar *str = link->data; xmlNodePtr cur; - cur = xmlNewChild (value, NULL, (xmlChar *)type, NULL); + cur = xmlNewChild (value, NULL, (xmlChar *) type, NULL); str = xmlEncodeEntitiesReentrant (NULL, str); xmlNodeSetContent (cur, str); @@ -180,7 +180,7 @@ filter_input_xml_encode (EFilterElement *element) static gint filter_input_xml_decode (EFilterElement *element, xmlNodePtr node) { - EFilterInput *input = (EFilterInput *)element; + EFilterInput *input = (EFilterInput *) element; gchar *name, *str, *type; xmlNodePtr child; @@ -199,8 +199,8 @@ filter_input_xml_decode (EFilterElement *element, xmlNodePtr node) child = node->children; while (child != NULL) { - if (!strcmp ((gchar *)child->name, type)) { - if (!(str = (gchar *)xmlNodeGetContent (child))) + if (!strcmp ((gchar *) child->name, type)) { + if (!(str = (gchar *) xmlNodeGetContent (child))) str = (gchar *)xmlStrdup ((xmlChar *)""); input->values = g_list_append (input->values, g_strdup (str)); diff --git a/filter/e-filter-int.c b/filter/e-filter-int.c index d82b36efda..dcb9b18fba 100644 --- a/filter/e-filter-int.c +++ b/filter/e-filter-int.c @@ -101,7 +101,7 @@ filter_int_xml_encode (EFilterElement *element) xmlSetProp (value, (xmlChar *) "type", (xmlChar *) type); sprintf (intval, "%d", filter_int->val); - xmlSetProp (value, (xmlChar *)type, (xmlChar *)intval); + xmlSetProp (value, (xmlChar *) type, (xmlChar *) intval); return value; } @@ -123,7 +123,7 @@ filter_int_xml_decode (EFilterElement *element, filter_int->type = g_strdup (type); xmlFree (type); - intval = (gchar *)xmlGetProp ( + intval = (gchar *) xmlGetProp ( node, (xmlChar *) (filter_int->type ? filter_int->type : "integer")); if (intval) { diff --git a/filter/e-filter-option.c b/filter/e-filter-option.c index 7eaa4324d5..25a979794b 100644 --- a/filter/e-filter-option.c +++ b/filter/e-filter-option.c @@ -159,7 +159,7 @@ filter_option_xml_create (EFilterElement *element, if (!strcmp ((gchar *)work->name, "title") || !strcmp ((gchar *)work->name, "_title")) { if (!title) { - if (!(tmp = (gchar *)xmlNodeGetContent (work))) + if (!(tmp = (gchar *) xmlNodeGetContent (work))) tmp = (gchar *)xmlStrdup ((xmlChar *)""); title = g_strdup (tmp); @@ -167,7 +167,7 @@ filter_option_xml_create (EFilterElement *element, } } else if (!strcmp ((gchar *)work->name, "code")) { if (!code) { - if (!(tmp = (gchar *)xmlNodeGetContent (work))) + if (!(tmp = (gchar *) xmlNodeGetContent (work))) tmp = (gchar *)xmlStrdup ((xmlChar *)""); code = g_strdup (tmp); @@ -204,7 +204,7 @@ filter_option_xml_create (EFilterElement *element, GSList *items, *i; struct _filter_option *op; - option->dynamic_func = g_strdup ((const gchar *)fn); + option->dynamic_func = g_strdup ((const gchar *) fn); /* get options now, to have them available when reading saved rules */ items = filter_option_get_dynamic_options (option); @@ -357,7 +357,7 @@ filter_option_get_widget (EFilterElement *element) e_filter_option_set_current (option, old_cur->value); /* free old list */ - g_list_foreach (old_ops, (GFunc)free_option, NULL); + g_list_foreach (old_ops, (GFunc) free_option, NULL); g_list_free (old_ops); } diff --git a/filter/e-filter-part.c b/filter/e-filter-part.c index 2b75b30235..521c0781aa 100644 --- a/filter/e-filter-part.c +++ b/filter/e-filter-part.c @@ -173,14 +173,14 @@ e_filter_part_xml_create (EFilterPart *part, } else if (!strcmp ((gchar *)n->name, "title") || !strcmp ((gchar *)n->name, "_title")) { if (!part->title) { - str = (gchar *)xmlNodeGetContent (n); + str = (gchar *) xmlNodeGetContent (n); part->title = g_strdup (str); if (str) xmlFree (str); } } else if (!strcmp ((gchar *)n->name, "code")) { if (!part->code) { - str = (gchar *)xmlNodeGetContent (n); + str = (gchar *) xmlNodeGetContent (n); part->code = g_strdup (str); if (str) xmlFree (str); diff --git a/filter/e-filter-rule.c b/filter/e-filter-rule.c index 18fd63b850..590ed597ee 100644 --- a/filter/e-filter-rule.c +++ b/filter/e-filter-rule.c @@ -476,7 +476,7 @@ filter_rule_xml_encode (EFilterRule *rule) gchar *escaped = g_markup_escape_text (rule->name, -1); work = xmlNewNode (NULL, (xmlChar *)"title"); - xmlNodeSetContent (work, (xmlChar *)escaped); + xmlNodeSetContent (work, (xmlChar *) escaped); xmlAddChild (node, work); g_free (escaped); @@ -555,7 +555,7 @@ filter_rule_xml_decode (EFilterRule *rule, if (!rule->name) { gchar *str, *decstr = NULL; - str = (gchar *)xmlNodeGetContent (work); + str = (gchar *) xmlNodeGetContent (work); if (str) { decstr = g_strdup (_(str)); xmlFree (str); @@ -661,7 +661,7 @@ filter_rule_get_widget (EFilterRule *rule, label = gtk_label_new_with_mnemonic (_("R_ule name:")); name = gtk_entry_new (); - gtk_label_set_mnemonic_widget ((GtkLabel *)label, name); + gtk_label_set_mnemonic_widget ((GtkLabel *) label, name); if (!rule->name) { rule->name = g_strdup (_("Untitled")); @@ -727,7 +727,7 @@ filter_rule_get_widget (EFilterRule *rule, _(thread_types[i])); } - gtk_label_set_mnemonic_widget ((GtkLabel *)label, combobox); + gtk_label_set_mnemonic_widget ((GtkLabel *) label, combobox); gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), rule->grouping); gtk_widget_show (combobox); @@ -763,7 +763,7 @@ filter_rule_get_widget (EFilterRule *rule, _(thread_types[i])); } - gtk_label_set_mnemonic_widget ((GtkLabel *)label, combobox); + gtk_label_set_mnemonic_widget ((GtkLabel *) label, combobox); gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), rule->threading); gtk_widget_show (combobox); diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c index fac44fa8b9..99378242ee 100644 --- a/filter/e-rule-context.c +++ b/filter/e-rule-context.c @@ -101,7 +101,7 @@ new_rule_response (GtkWidget *dialog, } if (e_rule_context_find_rule (context, rule->name, rule->source)) { - e_alert_run_dialog_for_args ((GtkWindow *)dialog, + e_alert_run_dialog_for_args ((GtkWindow *) dialog, "filter:bad-name-notunique", rule->name, NULL); @@ -169,20 +169,20 @@ rule_context_finalize (GObject *obj) { ERuleContext *context =(ERuleContext *) obj; - g_list_foreach (context->rule_set_list, (GFunc)free_rule_set, NULL); + g_list_foreach (context->rule_set_list, (GFunc) free_rule_set, NULL); g_list_free (context->rule_set_list); g_hash_table_destroy (context->rule_set_map); - g_list_foreach (context->part_set_list, (GFunc)free_part_set, NULL); + g_list_foreach (context->part_set_list, (GFunc) free_part_set, NULL); g_list_free (context->part_set_list); g_hash_table_destroy (context->part_set_map); g_free (context->error); - g_list_foreach (context->parts, (GFunc)g_object_unref, NULL); + g_list_foreach (context->parts, (GFunc) g_object_unref, NULL); g_list_free (context->parts); - g_list_foreach (context->rules, (GFunc)g_object_unref, NULL); + g_list_foreach (context->rules, (GFunc) g_object_unref, NULL); g_list_free (context->rules); G_OBJECT_CLASS (e_rule_context_parent_class)->finalize (obj); @@ -327,7 +327,7 @@ rule_context_save (ERuleContext *context, l = context->rule_set_list; while (l) { map = l->data; - rules = xmlNewDocNode (doc, NULL, (xmlChar *)map->name, NULL); + rules = xmlNewDocNode (doc, NULL, (xmlChar *) map->name, NULL); xmlAddChild (root, rules); rule = NULL; while ((rule = map->next (context, rule, NULL))) { @@ -365,7 +365,7 @@ rule_context_revert (ERuleContext *context, /* clear out anythign we have? */ return 0; - source_hash = g_hash_table_new ((GHashFunc)source_hashf, (GCompareFunc)source_eqf); + source_hash = g_hash_table_new ((GHashFunc) source_hashf, (GCompareFunc) source_eqf); /* setup stuff we have now */ /* Note that we assume there is only 1 set of rules in a given rule context, @@ -432,7 +432,7 @@ rule_context_revert (ERuleContext *context, xmlFreeDoc (userdoc); /* remove any we still have that weren't in the file */ - g_hash_table_foreach (source_hash, (GHFunc)revert_source_remove, context); + g_hash_table_foreach (source_hash, (GHFunc) revert_source_remove, context); g_hash_table_destroy (source_hash); return 0; diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c index d8099b1eb8..3fdf5c40bc 100644 --- a/filter/e-rule-editor.c +++ b/filter/e-rule-editor.c @@ -150,7 +150,7 @@ add_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) } if (e_rule_context_find_rule (editor->context, editor->edit->name, editor->edit->source)) { - e_alert_run_dialog_for_args ((GtkWindow *)dialog, + e_alert_run_dialog_for_args ((GtkWindow *) dialog, "filter:bad-name-notunique", editor->edit->name, NULL); return; @@ -298,7 +298,7 @@ edit_editor_response (GtkWidget *dialog, gint button, ERuleEditor *editor) rule = e_rule_context_find_rule (editor->context, editor->edit->name, editor->edit->source); if (rule != NULL && rule != editor->current) { - e_alert_run_dialog_for_args ((GtkWindow *)dialog, + e_alert_run_dialog_for_args ((GtkWindow *) dialog, "filter:bad-name-notunique", rule->name, NULL); |