[evolution] Address some of the compiler and static analyzers warnings
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Address some of the compiler and static analyzers warnings
- Date: Thu, 17 May 2018 13:10:50 +0000 (UTC)
commit ed7add9842feab90eae9bfa7df85cd28968d932d
Author: Milan Crha <mcrha redhat com>
Date: Thu May 17 15:12:20 2018 +0200
Address some of the compiler and static analyzers warnings
CMakeLists.txt | 5 +-
iconv-detect.c | 10 +-
src/addressbook/gui/contact-editor/eab-editor.c | 7 +
.../contact-list-editor/e-contact-list-editor.c | 6 +-
.../gui/widgets/e-addressbook-selector.c | 4 +-
src/addressbook/gui/widgets/e-minicard.c | 7 +-
src/addressbook/gui/widgets/eab-contact-merging.c | 8 +-
src/addressbook/importers/evolution-csv-importer.c | 12 +-
src/calendar/gui/e-cal-dialogs.c | 2 +-
src/calendar/gui/e-comp-editor-property-part.c | 3 +
src/calendar/gui/e-day-view-main-item.c | 5 +-
src/calendar/gui/e-meeting-time-sel-item.c | 2 +-
src/calendar/gui/ea-cal-view-event.c | 14 +-
src/calendar/gui/ea-cal-view.c | 4 +-
src/calendar/gui/ea-week-view.c | 6 +-
src/calendar/importers/icalendar-importer.c | 7 +-
src/composer/e-msg-composer.c | 6 +-
src/e-util/e-accounts-window.c | 2 +-
src/e-util/e-action-combo-box.c | 2 +-
src/e-util/e-activity.c | 1 +
src/e-util/e-attachment-handler.c | 2 +
src/e-util/e-attachment-view.c | 8 +-
src/e-util/e-attachment.c | 13 +-
src/e-util/e-categories-selector.c | 2 +-
src/e-util/e-color-combo.c | 2 +-
src/e-util/e-conflict-search-selector.h | 3 +-
src/e-util/e-filter-element.c | 10 ++
src/e-util/e-filter-rule.c | 7 +
src/e-util/e-html-editor-image-dialog.c | 8 +-
src/e-util/e-image-chooser.c | 4 +-
src/e-util/e-import-assistant.c | 8 +
src/e-util/e-mail-signature-editor.c | 6 +-
src/e-util/e-name-selector-entry.c | 21 ++-
src/e-util/e-plugin.c | 7 +
src/e-util/e-reflow-model.c | 7 +
src/e-util/e-rule-context.c | 6 +
src/e-util/e-rule-editor.c | 3 +
src/e-util/e-selection-model-array.c | 9 +-
src/e-util/e-selection-model.c | 14 ++
src/e-util/e-source-config-backend.c | 4 +
src/e-util/e-source-config.c | 2 +
src/e-util/e-source-selector.c | 5 +
src/e-util/e-spell-entry.h | 2 +-
src/e-util/e-table-header-item.c | 12 +-
src/e-util/e-table-header.c | 2 +-
src/e-util/e-table-subset-variable.c | 38 ++++--
src/e-util/e-text-event-processor-emacs-like.c | 14 +-
src/e-util/e-text-model.c | 11 ++
src/e-util/e-web-view.c | 7 +
src/e-util/gal-a11y-e-cell-toggle.h | 1 -
src/e-util/gal-a11y-e-cell.c | 21 ++-
src/e-util/gal-view-collection.c | 2 +
src/e-util/gal-view.c | 3 +
src/e-util/test-calendar.c | 2 +-
src/e-util/test-html-editor-units-bugs.c | 8 +-
src/e-util/test-html-editor-units.c | 19 ++-
src/em-format/e-mail-formatter-extension.c | 4 +-
src/em-format/e-mail-formatter-quote-headers.c | 12 +-
src/em-format/e-mail-formatter-utils.c | 14 +-
src/em-format/e-mail-formatter.c | 49 +++++--
src/em-format/e-mail-parser-extension.c | 1 +
src/em-format/e-mail-parser.c | 6 +-
src/em-format/e-mail-part.c | 2 +
src/em-format/e-mail-part.h | 8 +-
src/libemail-engine/e-mail-folder-utils.c | 18 +-
src/libemail-engine/e-mail-junk-filter.c | 5 +
src/libemail-engine/e-mail-session-utils.c | 3 -
src/libemail-engine/e-mail-session.c | 1 +
src/libgnomecanvas/gnome-canvas.c | 160 ++++++++++++++------
src/mail/e-mail-backend.c | 4 +
src/mail/e-mail-config-composing-page.c | 2 +-
src/mail/e-mail-config-page.c | 9 +-
src/mail/e-mail-config-service-backend.c | 9 +
src/mail/e-mail-config-service-page.c | 4 +
src/mail/e-mail-display.c | 4 +-
src/mail/e-mail-migrate.c | 13 ++-
src/mail/e-mail-paned-view.c | 10 +-
src/mail/e-mail-reader-utils.c | 6 +-
src/mail/e-mail-reader.c | 27 +---
src/mail/e-mail-sidebar.c | 1 +
src/mail/e-mail-templates-store.c | 4 +-
src/mail/e-mail-ui-session.c | 3 +-
src/mail/e-mail-view.c | 11 ++
src/mail/em-composer-utils.c | 30 ++--
src/mail/em-folder-tree.c | 23 ++--
src/mail/mail-autofilter.c | 19 ++-
src/mail/message-list.c | 5 +-
src/modules/itip-formatter/itip-view.c | 12 +-
src/modules/mail/e-mail-shell-backend.c | 7 +-
src/modules/mail/e-mail-shell-view-actions.c | 2 +-
.../e-mail-formatter-text-highlight.c | 9 +-
.../web-extension/e-editor-dom-functions.c | 2 +-
.../web-extension/e-editor-undo-redo-manager.c | 7 +-
src/plugins/dbx-import/dbx-importer.c | 7 +
src/shell/e-shell-backend.c | 24 +++-
src/shell/e-shell-content.c | 2 +
src/shell/e-shell-sidebar.c | 1 +
src/shell/e-shell-switcher.c | 17 ++-
src/shell/e-shell-view.c | 23 +++-
src/shell/e-shell-window.c | 1 +
100 files changed, 666 insertions(+), 321 deletions(-)
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0215614..633b0c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -380,7 +380,10 @@ if(NOT HAVE_ICONV)
endif(NOT HAVE_ICONV)
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBS})
-CHECK_C_SOURCE_RUNS("#include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
+file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/" _binary_dir_with_separator)
+CHECK_C_SOURCE_RUNS("#define ICONV_DETECT_BUILD_DIR \"${_binary_dir_with_separator}\"
+ #include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv)
+unset(_binary_dir_with_separator)
unset(CMAKE_REQUIRED_LIBRARIES)
if(NOT _correct_iconv)
diff --git a/iconv-detect.c b/iconv-detect.c
index bc7d872..8cb4673 100644
--- a/iconv-detect.c
+++ b/iconv-detect.c
@@ -50,8 +50,8 @@ enum {
typedef struct {
- char *charset;
- char *format;
+ const char *charset;
+ const char *format;
int id;
} CharInfo;
@@ -90,8 +90,8 @@ static int num_iso10646_tests = sizeof (iso10646_tests) / sizeof (CharInfo);
static int
test_iconv (void)
{
- char *jp = "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
- char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
+ char *jp = (char *) "\x1B\x24\x42\x46\x7C\x4B\x5C\x38\x6C";
+ const char *utf8 = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E";
char *transbuf = malloc (10), *trans = transbuf;
iconv_t cd;
size_t jp_len = strlen (jp), utf8_len = 10;
@@ -128,7 +128,7 @@ main (int argc,
if (!test_iconv ())
return 1;
- fp = fopen ("iconv-detect.h", "w");
+ fp = fopen (ICONV_DETECT_BUILD_DIR "iconv-detect.h", "w");
if (fp == NULL)
return 255;
diff --git a/src/addressbook/gui/contact-editor/eab-editor.c b/src/addressbook/gui/contact-editor/eab-editor.c
index 2de6ccf..4da9da4 100644
--- a/src/addressbook/gui/contact-editor/eab-editor.c
+++ b/src/addressbook/gui/contact-editor/eab-editor.c
@@ -245,6 +245,7 @@ eab_editor_show (EABEditor *editor)
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->show != NULL);
class->show (editor);
@@ -258,6 +259,7 @@ eab_editor_close (EABEditor *editor)
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->close != NULL);
class->close (editor);
@@ -271,6 +273,7 @@ eab_editor_raise (EABEditor *editor)
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->raise != NULL);
class->raise (editor);
@@ -285,6 +288,7 @@ eab_editor_save_contact (EABEditor *editor,
g_return_if_fail (EAB_IS_EDITOR (editor));
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->save_contact != NULL);
class->save_contact (editor, should_close);
@@ -298,6 +302,7 @@ eab_editor_is_changed (EABEditor *editor)
g_return_val_if_fail (EAB_IS_EDITOR (editor), FALSE);
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->is_changed != NULL, FALSE);
return class->is_changed (editor);
@@ -311,6 +316,7 @@ eab_editor_is_valid (EABEditor *editor)
g_return_val_if_fail (EAB_IS_EDITOR (editor), FALSE);
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->is_valid != NULL, FALSE);
return class->is_valid (editor);
@@ -324,6 +330,7 @@ eab_editor_get_window (EABEditor *editor)
g_return_val_if_fail (EAB_IS_EDITOR (editor), NULL);
class = EAB_EDITOR_GET_CLASS (editor);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_window != NULL, NULL);
return class->get_window (editor);
diff --git a/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
b/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
index 1299812..42dafe0 100644
--- a/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
+++ b/src/addressbook/gui/contact-list-editor/e-contact-list-editor.c
@@ -285,13 +285,13 @@ contact_list_editor_add_email (EContactListEditor *editor,
addr = camel_internet_address_new ();
addr_length = camel_address_unformat (CAMEL_ADDRESS (addr), email);
if (addr_length >= 1) {
- const gchar *name, *mail;
gint ii;
for (ii = 0; ii < addr_length; ii++) {
- camel_internet_address_get (addr, ii, &name, &mail);
+ const gchar *name = NULL, *mail = NULL;
- if (name || mail) {
+ if (camel_internet_address_get (addr, ii, &name, &mail) &&
+ (name || mail)) {
dest = e_destination_new ();
if (mail)
e_destination_set_email (dest, mail);
diff --git a/src/addressbook/gui/widgets/e-addressbook-selector.c
b/src/addressbook/gui/widgets/e-addressbook-selector.c
index 80f0e2d..8bc762a 100644
--- a/src/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/src/addressbook/gui/widgets/e-addressbook-selector.c
@@ -45,8 +45,8 @@ struct _MergeContext {
guint pending_removals;
gboolean pending_adds;
- gint remove_from_source : 1;
- gint copy_done : 1;
+ guint remove_from_source : 1;
+ guint copy_done : 1;
};
enum {
diff --git a/src/addressbook/gui/widgets/e-minicard.c b/src/addressbook/gui/widgets/e-minicard.c
index b1680ef..e6127bc 100644
--- a/src/addressbook/gui/widgets/e-minicard.c
+++ b/src/addressbook/gui/widgets/e-minicard.c
@@ -1153,13 +1153,12 @@ e_minicard_reflow (GnomeCanvasItem *item,
for (list = e_minicard->fields; list; list = g_list_next (list)) {
EMinicardField *field = E_MINICARD_FIELD (list->data);
- /* Why not use the item that is passed in? */
- GnomeCanvasItem *item = field->label;
+ GnomeCanvasItem *label_item = field->label;
g_object_get (
- item,
+ label_item,
"height", &text_height,
NULL);
- e_canvas_item_move_absolute (item, 2, e_minicard->height);
+ e_canvas_item_move_absolute (label_item, 2, e_minicard->height);
e_minicard->height += text_height;
}
e_minicard->height += 2;
diff --git a/src/addressbook/gui/widgets/eab-contact-merging.c
b/src/addressbook/gui/widgets/eab-contact-merging.c
index 515e98a..0c49f79 100644
--- a/src/addressbook/gui/widgets/eab-contact-merging.c
+++ b/src/addressbook/gui/widgets/eab-contact-merging.c
@@ -638,7 +638,7 @@ check_if_same (EContact *contact,
} else { /* Do pairwise-comparisons on all of the e-mail addresses. */
iter1 = email_attr_list1;
while (iter1) {
- gboolean match = FALSE;
+ gboolean matches = FALSE;
EVCardAttribute *attr;
gchar *email_address1;
@@ -646,14 +646,14 @@ check_if_same (EContact *contact,
email_address1 = e_vcard_attribute_get_value (attr);
iter2 = email_attr_list2;
- while ( iter2 && match == FALSE) {
+ while ( iter2 && matches == FALSE) {
gchar *email_address2;
attr = iter2->data;
email_address2 = e_vcard_attribute_get_value (attr);
if (g_ascii_strcasecmp (email_address1, email_address2) == 0)
{
- match = TRUE;
+ matches = TRUE;
}
g_free (email_address2);
@@ -663,7 +663,7 @@ check_if_same (EContact *contact,
g_free (email_address1);
iter1 = g_list_next (iter1);
- if (match == FALSE) {
+ if (matches == FALSE) {
res = FALSE;
break;
}
diff --git a/src/addressbook/importers/evolution-csv-importer.c
b/src/addressbook/importers/evolution-csv-importer.c
index 582d8a5..ce9e3de 100644
--- a/src/addressbook/importers/evolution-csv-importer.c
+++ b/src/addressbook/importers/evolution-csv-importer.c
@@ -430,10 +430,10 @@ parseLine (CSVImporter *gci,
home_street = g_string_new ("");
work_street = g_string_new ("");
other_street = g_string_new ("");
- home_address = g_new0 (EContactAddress, 1);
- work_address = g_new0 (EContactAddress, 1);
- other_address = g_new0 (EContactAddress, 1);
- bday = g_new0 (EContactDate, 1);
+ home_address = e_contact_address_new ();
+ work_address = e_contact_address_new ();
+ other_address = e_contact_address_new ();
+ bday = e_contact_date_new ();
if (!g_utf8_validate (pptr, -1, NULL)) {
do_free = g_convert (pptr, -1, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);
@@ -627,6 +627,10 @@ parseLine (CSVImporter *gci,
e_contact_set (contact, E_CONTACT_BIRTH_DATE, bday);
}
+ e_contact_address_free (home_address);
+ e_contact_address_free (work_address);
+ e_contact_address_free (other_address);
+ e_contact_date_free (bday);
g_free (do_free);
return TRUE;
diff --git a/src/calendar/gui/e-cal-dialogs.c b/src/calendar/gui/e-cal-dialogs.c
index 87d85a3..04974e3 100644
--- a/src/calendar/gui/e-cal-dialogs.c
+++ b/src/calendar/gui/e-cal-dialogs.c
@@ -638,7 +638,7 @@ ecal_event (ECalendarItem *calitem,
icaltimezone *timezone;
time_t et;
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
+ g_warn_if_fail (e_calendar_item_get_selection (calitem, &start_date, &end_date));
timezone = e_cal_data_model_get_timezone (dlg->data_model);
tt.year = g_date_get_year (&start_date);
diff --git a/src/calendar/gui/e-comp-editor-property-part.c b/src/calendar/gui/e-comp-editor-property-part.c
index aafe74e..5407ff8 100644
--- a/src/calendar/gui/e-comp-editor-property-part.c
+++ b/src/calendar/gui/e-comp-editor-property-part.c
@@ -255,6 +255,7 @@ e_comp_editor_property_part_create_widgets (ECompEditorPropertyPart *property_pa
g_return_if_fail (property_part->priv->edit_widget == NULL);
klass = E_COMP_EDITOR_PROPERTY_PART_GET_CLASS (property_part);
+ g_return_if_fail (klass != NULL);
g_return_if_fail (klass->create_widgets != NULL);
klass->create_widgets (property_part, out_label_widget, out_edit_widget);
@@ -285,6 +286,7 @@ e_comp_editor_property_part_fill_widget (ECompEditorPropertyPart *property_part,
g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART (property_part));
klass = E_COMP_EDITOR_PROPERTY_PART_GET_CLASS (property_part);
+ g_return_if_fail (klass != NULL);
g_return_if_fail (klass->fill_widget != NULL);
klass->fill_widget (property_part, component);
@@ -299,6 +301,7 @@ e_comp_editor_property_part_fill_component (ECompEditorPropertyPart *property_pa
g_return_if_fail (E_IS_COMP_EDITOR_PROPERTY_PART (property_part));
klass = E_COMP_EDITOR_PROPERTY_PART_GET_CLASS (property_part);
+ g_return_if_fail (klass != NULL);
g_return_if_fail (klass->fill_component != NULL);
klass->fill_component (property_part, component);
diff --git a/src/calendar/gui/e-day-view-main-item.c b/src/calendar/gui/e-day-view-main-item.c
index 9471bcc..4edb2d8 100644
--- a/src/calendar/gui/e-day-view-main-item.c
+++ b/src/calendar/gui/e-day-view-main-item.c
@@ -1175,10 +1175,7 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item,
if (can_draw_in_region (draw_region, rect_x, rect_y, rect_width, rect_height)) {
cairo_save (cr);
gdk_cairo_set_source_color (cr,
&day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED]);
- if (e_day_view_get_draw_flat_events (day_view))
- cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height);
- else
- cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height);
+ cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height);
cairo_fill (cr);
cairo_restore (cr);
}
diff --git a/src/calendar/gui/e-meeting-time-sel-item.c b/src/calendar/gui/e-meeting-time-sel-item.c
index dfc3874..c10be09 100644
--- a/src/calendar/gui/e-meeting-time-sel-item.c
+++ b/src/calendar/gui/e-meeting-time-sel-item.c
@@ -517,7 +517,7 @@ e_meeting_time_selector_item_paint_all_attendees_busy_periods (EMeetingTimeSelec
y = 2 * mts->row_height - scroll_y - 1;
/* Get the first visible busy periods for all the attendees. */
- first_periods = g_new (gint, e_meeting_store_count_actual_attendees (mts->model));
+ first_periods = g_new0 (gint, e_meeting_store_count_actual_attendees (mts->model) + 1);
for (row = 0; row < e_meeting_store_count_actual_attendees (mts->model); row++)
first_periods[row] = e_meeting_time_selector_item_find_first_busy_period (mts_item, date,
row);
diff --git a/src/calendar/gui/ea-cal-view-event.c b/src/calendar/gui/ea-cal-view-event.c
index 6ab80cb..70fc590 100644
--- a/src/calendar/gui/ea-cal-view-event.c
+++ b/src/calendar/gui/ea-cal-view-event.c
@@ -213,7 +213,7 @@ ea_cal_view_event_get_name (AtkObject *accessible)
const gchar *alarm_string;
const gchar *recur_string;
const gchar *meeting_string;
- gchar *summary_string;
+ gchar *summary_string = NULL;
const gchar *summary;
g_return_val_if_fail (EA_IS_CAL_VIEW_EVENT (accessible), NULL);
@@ -237,15 +237,13 @@ ea_cal_view_event_get_name (AtkObject *accessible)
if (e_cal_util_component_has_organizer (event->comp_data->icalcomp))
meeting_string = _("It is a meeting.");
+ summary = icalcomponent_get_summary (event->comp_data->icalcomp);
+ if (summary)
+ summary_string = g_strdup_printf (_("Calendar Event: Summary is %s."), summary);
}
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- if (summary)
- summary_string = g_strdup_printf (
- _("Calendar Event: Summary is %s."), summary);
- else
- summary_string = g_strdup (
- _("Calendar Event: It has no summary."));
+ if (!summary_string)
+ summary_string = g_strdup (_("Calendar Event: It has no summary."));
name_string = g_strdup_printf (
"%s %s %s %s", summary_string,
diff --git a/src/calendar/gui/ea-cal-view.c b/src/calendar/gui/ea-cal-view.c
index 69db29c..bbec262 100644
--- a/src/calendar/gui/ea-cal-view.c
+++ b/src/calendar/gui/ea-cal-view.c
@@ -324,14 +324,14 @@ action_interface_do_action (AtkAction *action,
break;
case 1:
/* New All Day Event */
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
+ g_warn_if_fail (e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend));
e_cal_ops_new_component_editor_from_model (
e_calendar_view_get_model (cal_view), NULL,
dtstart, dtend, FALSE, TRUE);
break;
case 2:
/* New Meeting */
- e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend);
+ g_warn_if_fail (e_calendar_view_get_selected_time_range (cal_view, &dtstart, &dtend));
e_cal_ops_new_component_editor_from_model (
e_calendar_view_get_model (cal_view), NULL,
dtstart, dtend, TRUE, FALSE);
diff --git a/src/calendar/gui/ea-week-view.c b/src/calendar/gui/ea-week-view.c
index 3f292d7..5fdec3f 100644
--- a/src/calendar/gui/ea-week-view.c
+++ b/src/calendar/gui/ea-week-view.c
@@ -267,12 +267,12 @@ ea_week_view_ref_child (AtkObject *accessible,
ea_calendar_helpers_get_accessible_for (
span->text_item);
} else {
- gint index;
+ gint jump_index;
- index = (current_day != -1) ? current_day : 0;
+ jump_index = (current_day != -1) ? current_day : 0;
atk_object =
ea_calendar_helpers_get_accessible_for (
- week_view->jump_buttons[index]);
+ week_view->jump_buttons[jump_index]);
}
g_object_ref (atk_object);
break;
diff --git a/src/calendar/importers/icalendar-importer.c b/src/calendar/importers/icalendar-importer.c
index 980c141..b4fd161 100644
--- a/src/calendar/importers/icalendar-importer.c
+++ b/src/calendar/importers/icalendar-importer.c
@@ -428,6 +428,8 @@ ivcal_import_items (gpointer d)
{
ICalImporter *ici = d;
+ ici->idle_id = 0;
+
switch (ici->source_type) {
case E_CAL_CLIENT_SOURCE_TYPE_EVENTS:
prepare_events (ici->icalcomp, NULL);
@@ -440,13 +442,10 @@ ivcal_import_items (gpointer d)
default:
g_warn_if_reached ();
- ici->idle_id = 0;
ivcal_import_done (ici, NULL);
return FALSE;
}
- ici->idle_id = 0;
-
return FALSE;
}
@@ -1230,7 +1229,7 @@ preview_comp (EWebViewPreview *preview,
have = FALSE;
if (e_cal_component_has_recurrences (comp)) {
- e_web_view_preview_add_section (preview, have ? NULL : str, C_("iCalImp", "has recurrences"));
+ e_web_view_preview_add_section (preview, /*have ? NULL :*/ str, C_("iCalImp", "has
recurrences"));
have = TRUE;
}
diff --git a/src/composer/e-msg-composer.c b/src/composer/e-msg-composer.c
index 1c14526..5194194 100644
--- a/src/composer/e-msg-composer.c
+++ b/src/composer/e-msg-composer.c
@@ -734,9 +734,9 @@ composer_build_message_pgp (AsyncContext *context,
g_object_unref (context->top_level_part);
context->top_level_part = NULL;
- if (pgp_key_id == NULL || *pgp_key_id == '\0')
- camel_internet_address_get (
- context->from, 0, NULL, &pgp_key_id);
+ if ((pgp_key_id == NULL || *pgp_key_id == '\0') &&
+ !camel_internet_address_get (context->from, 0, NULL, &pgp_key_id))
+ pgp_key_id = NULL;
if (context->pgp_sign) {
CamelMimePart *npart;
diff --git a/src/e-util/e-accounts-window.c b/src/e-util/e-accounts-window.c
index 57388ca..de99e1b 100644
--- a/src/e-util/e-accounts-window.c
+++ b/src/e-util/e-accounts-window.c
@@ -1189,7 +1189,7 @@ accounts_window_tree_view_enabled_toggled_cb (GtkCellRendererToggle *cell_render
/* And finally the collection, but only to enable it, if disabled */
collection = e_source_registry_find_extension (accounts_window->priv->registry,
source, E_SOURCE_EXTENSION_COLLECTION);
- if (collection && set_enabled && (e_source_get_enabled (collection) ? 1 : 0) !=
(set_enabled ? 1 : 0)) {
+ if (collection && set_enabled && (e_source_get_enabled (collection) ? 1 : 0) != 1) {
e_source_set_enabled (collection, set_enabled);
if (e_source_get_writable (collection))
diff --git a/src/e-util/e-action-combo-box.c b/src/e-util/e-action-combo-box.c
index c69e8fa..1dfe7f2 100644
--- a/src/e-util/e-action-combo-box.c
+++ b/src/e-util/e-action-combo-box.c
@@ -44,7 +44,7 @@ struct _EActionComboBoxPrivate {
guint changed_handler_id; /* action::changed */
guint group_sensitive_handler_id; /* action-group::sensitive */
guint group_visible_handler_id; /* action-group::visible */
- gboolean group_has_icons : 1;
+ gboolean group_has_icons;
};
G_DEFINE_TYPE (
diff --git a/src/e-util/e-activity.c b/src/e-util/e-activity.c
index eb37a6a..1ffc354 100644
--- a/src/e-util/e-activity.c
+++ b/src/e-util/e-activity.c
@@ -429,6 +429,7 @@ e_activity_describe (EActivity *activity)
g_return_val_if_fail (E_IS_ACTIVITY (activity), NULL);
class = E_ACTIVITY_GET_CLASS (activity);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->describe != NULL, NULL);
return class->describe (activity);
diff --git a/src/e-util/e-attachment-handler.c b/src/e-util/e-attachment-handler.c
index c81a616..6e9b7d7 100644
--- a/src/e-util/e-attachment-handler.c
+++ b/src/e-util/e-attachment-handler.c
@@ -103,6 +103,7 @@ e_attachment_handler_get_drag_actions (EAttachmentHandler *handler)
g_return_val_if_fail (E_IS_ATTACHMENT_HANDLER (handler), 0);
class = E_ATTACHMENT_HANDLER_GET_CLASS (handler);
+ g_return_val_if_fail (class != NULL, 0);
if (class->get_drag_actions != NULL)
return class->get_drag_actions (handler);
@@ -119,6 +120,7 @@ e_attachment_handler_get_target_table (EAttachmentHandler *handler,
g_return_val_if_fail (E_IS_ATTACHMENT_HANDLER (handler), NULL);
class = E_ATTACHMENT_HANDLER_GET_CLASS (handler);
+ g_return_val_if_fail (class != NULL, NULL);
if (class->get_target_table != NULL)
return class->get_target_table (handler, n_targets);
diff --git a/src/e-util/e-attachment-view.c b/src/e-util/e-attachment-view.c
index 5a7df35..0384451 100644
--- a/src/e-util/e-attachment-view.c
+++ b/src/e-util/e-attachment-view.c
@@ -1194,7 +1194,7 @@ e_attachment_view_remove_selected (EAttachmentView *view,
}
/* If we only removed one attachment, try to select another. */
- if (select_next && g_list_length (list) == 1) {
+ if (select_next && list && list->data && !list->next) {
GtkTreePath *path = list->data;
e_attachment_view_select_path (view, path);
@@ -1308,10 +1308,10 @@ e_attachment_view_button_release_event (EAttachmentView *view,
priv = e_attachment_view_get_private (view);
for (iter = priv->event_list; iter != NULL; iter = iter->next) {
- GdkEvent *event = iter->data;
+ GdkEvent *an_event = iter->data;
- gtk_propagate_event (widget, event);
- gdk_event_free (event);
+ gtk_propagate_event (widget, an_event);
+ gdk_event_free (an_event);
}
g_list_free (priv->event_list);
diff --git a/src/e-util/e-attachment.c b/src/e-util/e-attachment.c
index 156e95c..c9ab68b 100644
--- a/src/e-util/e-attachment.c
+++ b/src/e-util/e-attachment.c
@@ -3142,9 +3142,11 @@ static void
attachment_save_extracted_cancelled_cb (AutoarExtractor *extractor,
SaveContext *save_context)
{
- attachment_save_check_for_error (save_context,
- g_error_new_literal (
- G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled")));
+ if (attachment_save_check_for_error (save_context,
+ g_error_new_literal (G_IO_ERROR, G_IO_ERROR_CANCELLED, _("Operation was cancelled")))) {
+ ;
+ }
+
g_object_unref (extractor);
}
@@ -3161,7 +3163,10 @@ attachment_save_extracted_error_cb (AutoarExtractor *extractor,
GError *error,
SaveContext *save_context)
{
- attachment_save_check_for_error (save_context, g_error_copy (error));
+ if (attachment_save_check_for_error (save_context, g_error_copy (error))) {
+ ;
+ }
+
g_object_unref (extractor);
}
diff --git a/src/e-util/e-categories-selector.c b/src/e-util/e-categories-selector.c
index c148dc5..cb55e8d 100644
--- a/src/e-util/e-categories-selector.c
+++ b/src/e-util/e-categories-selector.c
@@ -527,7 +527,7 @@ e_categories_selector_delete_selection (ECategoriesSelector *selector)
selector->priv->ignore_category_changes = FALSE;
/* If we only remove one category, try to select another */
- if (g_list_length (selected) == 1) {
+ if (selected && selected->data && !selected->next) {
GtkTreePath *path = selected->data;
gtk_tree_selection_select_path (selection, path);
diff --git a/src/e-util/e-color-combo.c b/src/e-util/e-color-combo.c
index 53975be..7e8ef88 100644
--- a/src/e-util/e-color-combo.c
+++ b/src/e-util/e-color-combo.c
@@ -41,9 +41,9 @@ struct _EColorComboPrivate {
guint popup_shown : 1;
guint popup_in_progress : 1;
+ guint default_transparent: 1;
GdkRGBA *current_color;
GdkRGBA *default_color;
- gint default_transparent: 1;
GList *palette;
diff --git a/src/e-util/e-conflict-search-selector.h b/src/e-util/e-conflict-search-selector.h
index 38f65c3..299d3fb 100644
--- a/src/e-util/e-conflict-search-selector.h
+++ b/src/e-util/e-conflict-search-selector.h
@@ -22,7 +22,8 @@
#ifndef E_CONFLICT_SEARCH_SELECTOR_H
#define E_CONFLICT_SEARCH_SELECTOR_H
-#include <e-util/e-util.h>
+#include <libedataserver/libedataserver.h>
+#include <e-util/e-source-selector.h>
/* Standard GObject macros */
#define E_TYPE_CONFLICT_SEARCH_SELECTOR \
diff --git a/src/e-util/e-filter-element.c b/src/e-util/e-filter-element.c
index f97f482..0553211 100644
--- a/src/e-util/e-filter-element.c
+++ b/src/e-util/e-filter-element.c
@@ -235,6 +235,7 @@ e_filter_element_validate (EFilterElement *element,
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), FALSE);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->validate != NULL, FALSE);
return class->validate (element, alert);
@@ -254,6 +255,7 @@ e_filter_element_eq (EFilterElement *element_a,
return FALSE;
class = E_FILTER_ELEMENT_GET_CLASS (element_a);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->eq != NULL, FALSE);
return class->eq (element_a, element_b);
@@ -277,6 +279,7 @@ e_filter_element_xml_create (EFilterElement *element,
g_return_if_fail (node != NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->xml_create != NULL);
class->xml_create (element, node);
@@ -298,6 +301,7 @@ e_filter_element_xml_encode (EFilterElement *element)
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->xml_encode != NULL, NULL);
return class->xml_encode (element);
@@ -322,6 +326,7 @@ e_filter_element_xml_decode (EFilterElement *element,
g_return_val_if_fail (node != NULL, FALSE);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->xml_decode != NULL, FALSE);
return class->xml_decode (element, node);
@@ -343,6 +348,7 @@ e_filter_element_clone (EFilterElement *element)
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->clone != NULL, NULL);
return class->clone (element);
@@ -365,6 +371,7 @@ e_filter_element_get_widget (EFilterElement *element)
g_return_val_if_fail (E_IS_FILTER_ELEMENT (element), NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_widget != NULL, NULL);
return class->get_widget (element);
@@ -390,6 +397,7 @@ e_filter_element_build_code (EFilterElement *element,
g_return_if_fail (E_IS_FILTER_PART (part));
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_if_fail (class != NULL);
/* This method is optional. */
if (class->build_code != NULL)
@@ -414,6 +422,7 @@ e_filter_element_format_sexp (EFilterElement *element,
g_return_if_fail (out != NULL);
class = E_FILTER_ELEMENT_GET_CLASS (element);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->format_sexp != NULL);
class->format_sexp (element, out);
@@ -439,6 +448,7 @@ e_filter_element_copy_value (EFilterElement *dst_element,
g_return_if_fail (E_IS_FILTER_ELEMENT (src_element));
class = E_FILTER_ELEMENT_GET_CLASS (dst_element);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->copy_value != NULL);
class->copy_value (dst_element, src_element);
diff --git a/src/e-util/e-filter-rule.c b/src/e-util/e-filter-rule.c
index 2382b37..c54e640 100644
--- a/src/e-util/e-filter-rule.c
+++ b/src/e-util/e-filter-rule.c
@@ -547,6 +547,7 @@ e_filter_rule_get_widget (EFilterRule *rule,
g_return_val_if_fail (E_IS_RULE_CONTEXT (context), NULL);
class = E_FILTER_RULE_GET_CLASS (rule);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_widget != NULL, NULL);
return class->get_widget (rule, context);
@@ -1277,6 +1278,7 @@ e_filter_rule_validate (EFilterRule *rule,
g_return_val_if_fail (E_IS_FILTER_RULE (rule), FALSE);
class = E_FILTER_RULE_GET_CLASS (rule);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->validate != NULL, FALSE);
return class->validate (rule, alert);
@@ -1292,6 +1294,7 @@ e_filter_rule_eq (EFilterRule *rule_a,
g_return_val_if_fail (E_IS_FILTER_RULE (rule_b), FALSE);
class = E_FILTER_RULE_GET_CLASS (rule_a);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->eq != NULL, FALSE);
if (G_OBJECT_TYPE (rule_a) != G_OBJECT_TYPE (rule_b))
@@ -1308,6 +1311,7 @@ e_filter_rule_xml_encode (EFilterRule *rule)
g_return_val_if_fail (E_IS_FILTER_RULE (rule), NULL);
class = E_FILTER_RULE_GET_CLASS (rule);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->xml_encode != NULL, NULL);
return class->xml_encode (rule);
@@ -1326,6 +1330,7 @@ e_filter_rule_xml_decode (EFilterRule *rule,
g_return_val_if_fail (E_IS_RULE_CONTEXT (context), FALSE);
class = E_FILTER_RULE_GET_CLASS (rule);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->xml_decode != NULL, FALSE);
rule->priv->frozen++;
@@ -1347,6 +1352,7 @@ e_filter_rule_copy (EFilterRule *dst_rule,
g_return_if_fail (E_IS_FILTER_RULE (src_rule));
class = E_FILTER_RULE_GET_CLASS (dst_rule);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->copy != NULL);
class->copy (dst_rule, src_rule);
@@ -1408,6 +1414,7 @@ e_filter_rule_build_code (EFilterRule *rule,
g_return_if_fail (out != NULL);
class = E_FILTER_RULE_GET_CLASS (rule);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->build_code != NULL);
class->build_code (rule, out);
diff --git a/src/e-util/e-html-editor-image-dialog.c b/src/e-util/e-html-editor-image-dialog.c
index 975ebf9..9ea1853 100644
--- a/src/e-util/e-html-editor-image-dialog.c
+++ b/src/e-util/e-html-editor-image-dialog.c
@@ -131,7 +131,7 @@ html_editor_image_dialog_set_width_units (EHTMLEditorImageDialog *dialog)
EHTMLEditor *editor;
EContentEditor *cnt_editor;
gint requested;
- gint32 natural = 0;
+ gint32 natural;
gint width = 0;
editor = e_html_editor_dialog_get_editor (E_HTML_EDITOR_DIALOG (dialog));
@@ -155,7 +155,7 @@ html_editor_image_dialog_set_width_units (EHTMLEditorImageDialog *dialog)
break;
case 1: /* percent */
- if (gtk_widget_is_sensitive (dialog->priv->width_edit)) {
+ if (natural && gtk_widget_is_sensitive (dialog->priv->width_edit)) {
width = (((gdouble) requested) / natural) * 100;
} else {
width = 100;
@@ -219,7 +219,7 @@ html_editor_image_dialog_set_height_units (EHTMLEditorImageDialog *dialog)
EHTMLEditor *editor;
EContentEditor *cnt_editor;
gint requested;
- gulong natural = 0;
+ gulong natural;
gint height = -1;
editor = e_html_editor_dialog_get_editor (E_HTML_EDITOR_DIALOG (dialog));
@@ -243,7 +243,7 @@ html_editor_image_dialog_set_height_units (EHTMLEditorImageDialog *dialog)
break;
case 1: /* percent */
- if (gtk_widget_is_sensitive (dialog->priv->height_edit)) {
+ if (natural && gtk_widget_is_sensitive (dialog->priv->height_edit)) {
height = (((gdouble) requested) / natural) * 100;
} else {
height = 100;
diff --git a/src/e-util/e-image-chooser.c b/src/e-util/e-image-chooser.c
index cf42c21..d299ea7 100644
--- a/src/e-util/e-image-chooser.c
+++ b/src/e-util/e-image-chooser.c
@@ -92,8 +92,8 @@ set_image_from_data (EImageChooser *chooser,
new_height = gdk_pixbuf_get_height (pixbuf);
new_width = gdk_pixbuf_get_width (pixbuf);
- if (chooser->priv->image_height == 0
- && chooser->priv->image_width == 0) {
+ if (chooser->priv->image_height == 0 ||
+ chooser->priv->image_width == 0) {
scale = 1.0;
} else if (chooser->priv->image_height < new_height
|| chooser->priv->image_width < new_width) {
diff --git a/src/e-util/e-import-assistant.c b/src/e-util/e-import-assistant.c
index 2372f4e..81ffb84 100644
--- a/src/e-util/e-import-assistant.c
+++ b/src/e-util/e-import-assistant.c
@@ -915,10 +915,18 @@ prepare_simple_page (GtkAssistant *assistant,
store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (page->filetype)));
gtk_list_store_clear (store);
+ if (!importers || !importers->data) {
+ g_slist_free (importers);
+ return;
+ }
+
for (imp = importers; imp; imp = imp->next) {
GtkTreeIter iter;
EImportImporter *eii = imp->data;
+ if (!eii)
+ continue;
+
gtk_list_store_append (store, &iter);
gtk_list_store_set (
store, &iter,
diff --git a/src/e-util/e-mail-signature-editor.c b/src/e-util/e-mail-signature-editor.c
index 1919519..4b6c13f 100644
--- a/src/e-util/e-mail-signature-editor.c
+++ b/src/e-util/e-mail-signature-editor.c
@@ -211,12 +211,12 @@ action_close_cb (GtkAction *action,
"widgets:ask-signature-changed", NULL);
if (response == GTK_RESPONSE_YES) {
GtkActionGroup *action_group;
- GtkAction *action;
+ GtkAction *action2;
action_group = window->priv->action_group;
- action = gtk_action_group_get_action (
+ action2 = gtk_action_group_get_action (
action_group, "save-and-close");
- gtk_action_activate (action);
+ gtk_action_activate (action2);
return;
} else if (response == GTK_RESPONSE_CANCEL)
return;
diff --git a/src/e-util/e-name-selector-entry.c b/src/e-util/e-name-selector-entry.c
index aaac0e7..2135f40 100644
--- a/src/e-util/e-name-selector-entry.c
+++ b/src/e-util/e-name-selector-entry.c
@@ -935,7 +935,7 @@ build_textrep_for_contact (EContact *contact,
case E_CONTACT_EMAIL:
name = NULL;
l = e_contact_get (contact, cue_field);
- email = strdup (g_list_nth_data (l, email_num));
+ email = g_strdup (g_list_nth_data (l, email_num));
g_list_free_full (l, g_free);
break;
@@ -944,16 +944,21 @@ build_textrep_for_contact (EContact *contact,
break;
}
- g_return_val_if_fail (email, NULL);
- g_return_val_if_fail (strlen (email) > 0, NULL);
-
- if (name)
- textrep = g_strdup_printf ("%s <%s>", name, email);
- else
- textrep = g_strdup_printf ("%s", email);
+ if (email && *email) {
+ if (name)
+ textrep = g_strdup_printf ("%s <%s>", name, email);
+ else
+ textrep = g_strdup_printf ("%s", email);
+ } else {
+ textrep = NULL;
+ g_warn_if_fail (email != NULL);
+ if (email)
+ g_warn_if_fail (*email != '\0');
+ }
g_free (name);
g_free (email);
+
return textrep;
}
diff --git a/src/e-util/e-plugin.c b/src/e-util/e-plugin.c
index 4926cfa..386233e 100644
--- a/src/e-util/e-plugin.c
+++ b/src/e-util/e-plugin.c
@@ -589,6 +589,7 @@ e_plugin_construct (EPlugin *plugin,
g_return_val_if_fail (E_IS_PLUGIN (plugin), -1);
class = E_PLUGIN_GET_CLASS (plugin);
+ g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->construct != NULL, -1);
return class->construct (plugin, root);
@@ -621,6 +622,7 @@ e_plugin_invoke (EPlugin *plugin,
g_return_val_if_fail (plugin->enabled, NULL);
class = E_PLUGIN_GET_CLASS (plugin);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->invoke != NULL, NULL);
return class->invoke (plugin, name, data);
@@ -645,6 +647,7 @@ e_plugin_get_symbol (EPlugin *plugin,
g_return_val_if_fail (E_IS_PLUGIN (plugin), NULL);
class = E_PLUGIN_GET_CLASS (plugin);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_symbol != NULL, NULL);
return class->get_symbol (plugin, name);
@@ -671,6 +674,7 @@ e_plugin_enable (EPlugin *plugin,
return;
class = E_PLUGIN_GET_CLASS (plugin);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->enable != NULL);
class->enable (plugin, state);
@@ -695,6 +699,8 @@ e_plugin_get_configure_widget (EPlugin *plugin)
g_return_val_if_fail (E_IS_PLUGIN (plugin), NULL);
class = E_PLUGIN_GET_CLASS (plugin);
+ g_return_val_if_fail (class != NULL, NULL);
+
if (class->get_configure_widget == NULL)
return NULL;
@@ -892,6 +898,7 @@ e_plugin_hook_enable (EPluginHook *plugin_hook,
g_return_if_fail (E_IS_PLUGIN_HOOK (plugin_hook));
class = E_PLUGIN_HOOK_GET_CLASS (plugin_hook);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->enable != NULL);
class->enable (plugin_hook, state);
diff --git a/src/e-util/e-reflow-model.c b/src/e-util/e-reflow-model.c
index abffdd4..dc52b81 100644
--- a/src/e-util/e-reflow-model.c
+++ b/src/e-util/e-reflow-model.c
@@ -57,6 +57,7 @@ e_reflow_model_set_width (EReflowModel *reflow_model,
g_return_if_fail (E_IS_REFLOW_MODEL (reflow_model));
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_width != NULL);
class->set_width (reflow_model, width);
@@ -76,6 +77,7 @@ e_reflow_model_count (EReflowModel *reflow_model)
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), 0);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->count != NULL, 0);
return class->count (reflow_model);
@@ -99,6 +101,7 @@ e_reflow_model_height (EReflowModel *reflow_model,
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), 0);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->height != NULL, 0);
return class->height (reflow_model, n, parent);
@@ -124,6 +127,7 @@ e_reflow_model_incarnate (EReflowModel *reflow_model,
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), NULL);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->incarnate != NULL, NULL);
return class->incarnate (reflow_model, n, parent);
@@ -147,6 +151,7 @@ e_reflow_model_create_cmp_cache (EReflowModel *reflow_model)
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), NULL);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_val_if_fail (class != NULL, NULL);
if (class->create_cmp_cache == NULL)
return NULL;
@@ -179,6 +184,7 @@ e_reflow_model_compare (EReflowModel *reflow_model,
g_return_val_if_fail (E_IS_REFLOW_MODEL (reflow_model), 0);
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->compare != NULL, 0);
return class->compare (reflow_model, n1, n2, cmp_cache);
@@ -202,6 +208,7 @@ e_reflow_model_reincarnate (EReflowModel *reflow_model,
g_return_if_fail (E_IS_REFLOW_MODEL (reflow_model));
class = E_REFLOW_MODEL_GET_CLASS (reflow_model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->reincarnate != NULL);
class->reincarnate (reflow_model, n, item);
diff --git a/src/e-util/e-rule-context.c b/src/e-util/e-rule-context.c
index 8fe5b27..8d73fcf 100644
--- a/src/e-util/e-rule-context.c
+++ b/src/e-util/e-rule-context.c
@@ -649,6 +649,7 @@ e_rule_context_load (ERuleContext *context,
g_return_val_if_fail (user != NULL, -1);
class = E_RULE_CONTEXT_GET_CLASS (context);
+ g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->load != NULL, -1);
context->priv->frozen++;
@@ -677,6 +678,7 @@ e_rule_context_save (ERuleContext *context,
g_return_val_if_fail (user != NULL, -1);
class = E_RULE_CONTEXT_GET_CLASS (context);
+ g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->save != NULL, -1);
return class->save (context, user);
@@ -702,6 +704,7 @@ e_rule_context_revert (ERuleContext *context,
g_return_val_if_fail (user != NULL, 0);
class = E_RULE_CONTEXT_GET_CLASS (context);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->revert != NULL, 0);
return class->revert (context, user);
@@ -958,6 +961,7 @@ e_rule_context_rename_uri (ERuleContext *context,
g_return_val_if_fail (compare != NULL, NULL);
class = E_RULE_CONTEXT_GET_CLASS (context);
+ g_return_val_if_fail (class != NULL, NULL);
/* This method is optional. */
if (class->rename_uri == NULL)
@@ -978,6 +982,7 @@ e_rule_context_delete_uri (ERuleContext *context,
g_return_val_if_fail (compare != NULL, NULL);
class = E_RULE_CONTEXT_GET_CLASS (context);
+ g_return_val_if_fail (class != NULL, NULL);
/* This method is optional. */
if (class->delete_uri == NULL)
@@ -1017,6 +1022,7 @@ e_rule_context_new_element (ERuleContext *context,
g_return_val_if_fail (name != NULL, NULL);
class = E_RULE_CONTEXT_GET_CLASS (context);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->new_element != NULL, NULL);
return class->new_element (context, name);
diff --git a/src/e-util/e-rule-editor.c b/src/e-util/e-rule-editor.c
index 414b809..3bef3ff 100644
--- a/src/e-util/e-rule-editor.c
+++ b/src/e-util/e-rule-editor.c
@@ -649,6 +649,7 @@ e_rule_editor_set_sensitive (ERuleEditor *editor)
g_return_if_fail (E_IS_RULE_EDITOR (editor));
class = E_RULE_EDITOR_GET_CLASS (editor);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_sensitive != NULL);
class->set_sensitive (editor);
@@ -663,6 +664,7 @@ e_rule_editor_set_source (ERuleEditor *editor,
g_return_if_fail (E_IS_RULE_EDITOR (editor));
class = E_RULE_EDITOR_GET_CLASS (editor);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_source != NULL);
class->set_source (editor, source);
@@ -676,6 +678,7 @@ e_rule_editor_create_rule (ERuleEditor *editor)
g_return_val_if_fail (E_IS_RULE_EDITOR (editor), NULL);
class = E_RULE_EDITOR_GET_CLASS (editor);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->create_rule != NULL, NULL);
return class->create_rule (editor);
diff --git a/src/e-util/e-selection-model-array.c b/src/e-util/e-selection-model-array.c
index c0735f1..dfbc0b3 100644
--- a/src/e-util/e-selection-model-array.c
+++ b/src/e-util/e-selection-model-array.c
@@ -500,11 +500,16 @@ esma_set_selection_end (ESelectionModel *selection,
gint
e_selection_model_array_get_row_count (ESelectionModelArray *esma)
{
+ ESelectionModelArrayClass *klass;
+
g_return_val_if_fail (esma != NULL, 0);
g_return_val_if_fail (E_IS_SELECTION_MODEL_ARRAY (esma), 0);
- if (E_SELECTION_MODEL_ARRAY_GET_CLASS (esma)->get_row_count)
- return E_SELECTION_MODEL_ARRAY_GET_CLASS (esma)->get_row_count (esma);
+ klass = E_SELECTION_MODEL_ARRAY_GET_CLASS (esma);
+ g_return_val_if_fail (klass != NULL, 0);
+
+ if (klass->get_row_count)
+ return klass->get_row_count (esma);
else
return 0;
}
diff --git a/src/e-util/e-selection-model.c b/src/e-util/e-selection-model.c
index 6a39b8a..e174d7b 100644
--- a/src/e-util/e-selection-model.c
+++ b/src/e-util/e-selection-model.c
@@ -248,6 +248,7 @@ e_selection_model_is_row_selected (ESelectionModel *model,
g_return_val_if_fail (E_IS_SELECTION_MODEL (model), FALSE);
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->is_row_selected != NULL, FALSE);
return class->is_row_selected (model, n);
@@ -273,6 +274,7 @@ e_selection_model_foreach (ESelectionModel *model,
g_return_if_fail (callback != NULL);
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->foreach != NULL);
class->foreach (model, callback, closure);
@@ -292,6 +294,7 @@ e_selection_model_clear (ESelectionModel *model)
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->clear != NULL);
class->clear (model);
@@ -313,6 +316,7 @@ e_selection_model_selected_count (ESelectionModel *model)
g_return_val_if_fail (E_IS_SELECTION_MODEL (model), 0);
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->selected_count != NULL, 0);
return class->selected_count (model);
@@ -333,6 +337,7 @@ e_selection_model_select_all (ESelectionModel *model)
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->select_all != NULL);
class->select_all (model);
@@ -346,6 +351,7 @@ e_selection_model_row_count (ESelectionModel *model)
g_return_val_if_fail (E_IS_SELECTION_MODEL (model), 0);
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->row_count != NULL, 0);
return class->row_count (model);
@@ -361,6 +367,7 @@ e_selection_model_change_one_row (ESelectionModel *model,
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->change_one_row != NULL);
return class->change_one_row (model, row, grow);
@@ -376,6 +383,7 @@ e_selection_model_change_cursor (ESelectionModel *model,
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->change_cursor != NULL);
class->change_cursor (model, row, col);
@@ -389,6 +397,7 @@ e_selection_model_cursor_row (ESelectionModel *model)
g_return_val_if_fail (E_IS_SELECTION_MODEL (model), -1);
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->cursor_row != NULL, -1);
return class->cursor_row (model);
@@ -402,6 +411,7 @@ e_selection_model_cursor_col (ESelectionModel *model)
g_return_val_if_fail (E_IS_SELECTION_MODEL (model), -1);
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, -1);
g_return_val_if_fail (class->cursor_col != NULL, -1);
return class->cursor_col (model);
@@ -416,6 +426,7 @@ e_selection_model_select_single_row (ESelectionModel *model,
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->select_single_row != NULL);
class->select_single_row (model, row);
@@ -430,6 +441,7 @@ e_selection_model_toggle_single_row (ESelectionModel *model,
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->toggle_single_row != NULL);
class->toggle_single_row (model, row);
@@ -444,6 +456,7 @@ e_selection_model_move_selection_end (ESelectionModel *model,
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->move_selection_end != NULL);
class->move_selection_end (model, row);
@@ -458,6 +471,7 @@ e_selection_model_set_selection_end (ESelectionModel *model,
g_return_if_fail (E_IS_SELECTION_MODEL (model));
class = E_SELECTION_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_selection_end != NULL);
class->set_selection_end (model, row);
diff --git a/src/e-util/e-source-config-backend.c b/src/e-util/e-source-config-backend.c
index 19c95c7..d481288 100644
--- a/src/e-util/e-source-config-backend.c
+++ b/src/e-util/e-source-config-backend.c
@@ -88,6 +88,7 @@ e_source_config_backend_allow_creation (ESourceConfigBackend *backend)
g_return_val_if_fail (E_IS_SOURCE_CONFIG_BACKEND (backend), FALSE);
class = E_SOURCE_CONFIG_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->allow_creation != NULL, FALSE);
return class->allow_creation (backend);
@@ -103,6 +104,7 @@ e_source_config_backend_insert_widgets (ESourceConfigBackend *backend,
g_return_if_fail (E_IS_SOURCE (scratch_source));
class = E_SOURCE_CONFIG_BACKEND_GET_CLASS (backend);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->insert_widgets != NULL);
class->insert_widgets (backend, scratch_source);
@@ -118,6 +120,7 @@ e_source_config_backend_check_complete (ESourceConfigBackend *backend,
g_return_val_if_fail (E_IS_SOURCE (scratch_source), FALSE);
class = E_SOURCE_CONFIG_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->check_complete != NULL, FALSE);
return class->check_complete (backend, scratch_source);
@@ -133,6 +136,7 @@ e_source_config_backend_commit_changes (ESourceConfigBackend *backend,
g_return_if_fail (E_IS_SOURCE (scratch_source));
class = E_SOURCE_CONFIG_BACKEND_GET_CLASS (backend);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->commit_changes != NULL);
class->commit_changes (backend, scratch_source);
diff --git a/src/e-util/e-source-config.c b/src/e-util/e-source-config.c
index c46c6ad..8ba8dd7 100644
--- a/src/e-util/e-source-config.c
+++ b/src/e-util/e-source-config.c
@@ -1153,6 +1153,7 @@ e_source_config_get_backend_extension_name (ESourceConfig *config)
g_return_val_if_fail (E_IS_SOURCE_CONFIG (config), NULL);
class = E_SOURCE_CONFIG_GET_CLASS (config);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_backend_extension_name != NULL, NULL);
return class->get_backend_extension_name (config);
@@ -1166,6 +1167,7 @@ e_source_config_list_eligible_collections (ESourceConfig *config)
g_return_val_if_fail (E_IS_SOURCE_CONFIG (config), NULL);
class = E_SOURCE_CONFIG_GET_CLASS (config);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->list_eligible_collections != NULL, NULL);
return class->list_eligible_collections (config);
diff --git a/src/e-util/e-source-selector.c b/src/e-util/e-source-selector.c
index 49392da..096f83c 100644
--- a/src/e-util/e-source-selector.c
+++ b/src/e-util/e-source-selector.c
@@ -2346,6 +2346,7 @@ e_source_selector_select_source (ESourceSelector *selector,
g_return_if_fail (gtk_tree_row_reference_valid (reference));
class = E_SOURCE_SELECTOR_GET_CLASS (selector);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_source_selected != NULL);
if (class->set_source_selected (selector, source, TRUE)) {
@@ -2383,6 +2384,7 @@ e_source_selector_unselect_source (ESourceSelector *selector,
g_return_if_fail (gtk_tree_row_reference_valid (reference));
class = E_SOURCE_SELECTOR_GET_CLASS (selector);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_source_selected != NULL);
if (class->set_source_selected (selector, source, FALSE)) {
@@ -2414,6 +2416,7 @@ e_source_selector_select_exclusive (ESourceSelector *selector,
g_return_if_fail (E_IS_SOURCE (source));
class = E_SOURCE_SELECTOR_GET_CLASS (selector);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_source_selected != NULL);
source_index = selector->priv->source_index;
@@ -2454,6 +2457,7 @@ e_source_selector_select_all (ESourceSelector *selector)
g_return_if_fail (E_IS_SOURCE_SELECTOR (selector));
class = E_SOURCE_SELECTOR_GET_CLASS (selector);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_source_selected != NULL);
source_index = selector->priv->source_index;
@@ -2501,6 +2505,7 @@ e_source_selector_source_is_selected (ESourceSelector *selector,
g_return_val_if_fail (gtk_tree_row_reference_valid (reference), FALSE);
class = E_SOURCE_SELECTOR_GET_CLASS (selector);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->get_source_selected != NULL, FALSE);
return class->get_source_selected (selector, source);
diff --git a/src/e-util/e-spell-entry.h b/src/e-util/e-spell-entry.h
index a07d68f..107549a 100644
--- a/src/e-util/e-spell-entry.h
+++ b/src/e-util/e-spell-entry.h
@@ -24,7 +24,7 @@
#include <gtk/gtk.h>
-#include <e-util/e-util.h>
+#include <e-util/e-spell-checker.h>
/* Standard GObject macros */
#define E_TYPE_SPELL_ENTRY \
diff --git a/src/e-util/e-table-header-item.c b/src/e-util/e-table-header-item.c
index ddf129e..5e3e472 100644
--- a/src/e-util/e-table-header-item.c
+++ b/src/e-util/e-table-header-item.c
@@ -1097,8 +1097,8 @@ ethi_draw (GnomeCanvasItem *item,
cr, ecol, GTK_WIDGET (canvas),
x1 - x, -y, width, height,
x2 - x1, ethi->height,
- (ETableColArrow) g_hash_table_lookup (
- arrows, GINT_TO_POINTER (ecol->spec->model_col)));
+ (ETableColArrow) GPOINTER_TO_INT (g_hash_table_lookup (
+ arrows, GINT_TO_POINTER (ecol->spec->model_col))));
gtk_style_context_restore (context);
}
@@ -1318,8 +1318,8 @@ ethi_start_drag (ETableHeaderItem *ethi,
widget, 0, 0,
col_width, ethi->height,
col_width, ethi->height,
- (ETableColArrow) g_hash_table_lookup (
- arrows, GINT_TO_POINTER (ecol->spec->model_col)));
+ (ETableColArrow) GPOINTER_TO_INT (g_hash_table_lookup (
+ arrows, GINT_TO_POINTER (ecol->spec->model_col))));
gtk_drag_set_icon_surface (context, s);
cairo_surface_destroy (s);
@@ -1971,13 +1971,13 @@ ethi_event (GnomeCanvasItem *item,
event_device = gdk_event_get_device (event);
- gnome_canvas_item_grab (
+ g_warn_if_fail (gnome_canvas_item_grab (
item,
GDK_POINTER_MOTION_MASK |
GDK_BUTTON_RELEASE_MASK,
ethi->resize_cursor,
event_device,
- event_time);
+ event_time));
}
new_width = x - ethi->resize_start_pos;
diff --git a/src/e-util/e-table-header.c b/src/e-util/e-table-header.c
index 1c1255f..2de0962 100644
--- a/src/e-util/e-table-header.c
+++ b/src/e-util/e-table-header.c
@@ -932,7 +932,7 @@ eth_calc_widths (ETableHeader *eth)
gint *widths;
gboolean changed;
- widths = g_new (int, eth->col_count);
+ widths = g_new0 (int, eth->col_count + 1);
extra = eth->width;
expansion = 0;
diff --git a/src/e-util/e-table-subset-variable.c b/src/e-util/e-table-subset-variable.c
index 3340c97..9af5acd 100644
--- a/src/e-util/e-table-subset-variable.c
+++ b/src/e-util/e-table-subset-variable.c
@@ -26,8 +26,6 @@
#include "e-table-subset-variable.h"
-#define ETSSV_CLASS(e) (E_TABLE_SUBSET_VARIABLE_GET_CLASS (e))
-
G_DEFINE_TYPE (
ETableSubsetVariable,
e_table_subset_variable,
@@ -172,11 +170,16 @@ void
e_table_subset_variable_add (ETableSubsetVariable *etssv,
gint row)
{
+ ETableSubsetVariableClass *klass;
+
g_return_if_fail (etssv != NULL);
g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv));
- if (ETSSV_CLASS (etssv)->add)
- ETSSV_CLASS (etssv)->add (etssv, row);
+ klass = E_TABLE_SUBSET_VARIABLE_GET_CLASS (etssv);
+ g_return_if_fail (klass != NULL);
+
+ if (klass->add)
+ klass->add (etssv, row);
}
void
@@ -184,32 +187,47 @@ e_table_subset_variable_add_array (ETableSubsetVariable *etssv,
const gint *array,
gint count)
{
+ ETableSubsetVariableClass *klass;
+
g_return_if_fail (etssv != NULL);
g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv));
- if (ETSSV_CLASS (etssv)->add_array)
- ETSSV_CLASS (etssv)->add_array (etssv, array, count);
+ klass = E_TABLE_SUBSET_VARIABLE_GET_CLASS (etssv);
+ g_return_if_fail (klass != NULL);
+
+ if (klass->add_array)
+ klass->add_array (etssv, array, count);
}
void
e_table_subset_variable_add_all (ETableSubsetVariable *etssv)
{
+ ETableSubsetVariableClass *klass;
+
g_return_if_fail (etssv != NULL);
g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv));
- if (ETSSV_CLASS (etssv)->add_all)
- ETSSV_CLASS (etssv)->add_all (etssv);
+ klass = E_TABLE_SUBSET_VARIABLE_GET_CLASS (etssv);
+ g_return_if_fail (klass != NULL);
+
+ if (klass->add_all)
+ klass->add_all (etssv);
}
gboolean
e_table_subset_variable_remove (ETableSubsetVariable *etssv,
gint row)
{
+ ETableSubsetVariableClass *klass;
+
g_return_val_if_fail (etssv != NULL, FALSE);
g_return_val_if_fail (E_IS_TABLE_SUBSET_VARIABLE (etssv), FALSE);
- if (ETSSV_CLASS (etssv)->remove)
- return ETSSV_CLASS (etssv)->remove (etssv, row);
+ klass = E_TABLE_SUBSET_VARIABLE_GET_CLASS (etssv);
+ g_return_val_if_fail (klass != NULL, FALSE);
+
+ if (klass->remove)
+ return klass->remove (etssv, row);
else
return FALSE;
}
diff --git a/src/e-util/e-text-event-processor-emacs-like.c b/src/e-util/e-text-event-processor-emacs-like.c
index d161c1f..a040b46 100644
--- a/src/e-util/e-text-event-processor-emacs-like.c
+++ b/src/e-util/e-text-event-processor-emacs-like.c
@@ -116,15 +116,13 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
{
ETextEventProcessorCommand command;
ETextEventProcessorEmacsLike *tep_el = E_TEXT_EVENT_PROCESSOR_EMACS_LIKE (tep);
+ ETextEventProcessorEventKey key;
+
+ g_return_val_if_fail (event != NULL, 0);
+
command.action = E_TEP_NOP;
+ key = event->key;
- /* Warning from the Intel compiler here:
- * e-text-event-processor-emacs-like.c(136): warning #589:
- * transfer of control bypasses initialization of:
- * variable "key" (declared at line 194)
- * switch (event->type) {
- * ^
- */
switch (event->type) {
case GDK_BUTTON_PRESS:
if (event->button.button == 1 || event->button.button == 2) {
@@ -189,8 +187,6 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep,
case GDK_KEY_PRESS:
{
- ETextEventProcessorEventKey key = event->key;
-
command.time = event->key.time;
if (key.state & GDK_SHIFT_MASK)
diff --git a/src/e-util/e-text-model.c b/src/e-util/e-text-model.c
index 2330bcd..3539ab7 100644
--- a/src/e-util/e-text-model.c
+++ b/src/e-util/e-text-model.c
@@ -303,6 +303,7 @@ e_text_model_changed (ETextModel *model)
g_return_if_fail (E_IS_TEXT_MODEL (model));
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
/*
Objectify before emitting any signal.
@@ -344,6 +345,7 @@ e_text_model_validate_position (ETextModel *model,
g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, 0);
if (class->validate_pos != NULL)
pos = class->validate_pos (model, pos);
@@ -359,6 +361,7 @@ e_text_model_get_text (ETextModel *model)
g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL);
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, NULL);
if (class->get_text == NULL)
return "";
@@ -374,6 +377,7 @@ e_text_model_get_text_length (ETextModel *model)
g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, 0);
if (class->get_text_len (model)) {
@@ -404,6 +408,7 @@ e_text_model_set_text (ETextModel *model,
g_return_if_fail (E_IS_TEXT_MODEL (model));
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
if (class->set_text != NULL)
class->set_text (model, text);
@@ -422,6 +427,7 @@ e_text_model_insert (ETextModel *model,
return;
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
if (class->insert != NULL)
class->insert (model, position, text);
@@ -442,6 +448,7 @@ e_text_model_insert_length (ETextModel *model,
return;
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
if (class->insert_length != NULL)
class->insert_length (model, position, text, length);
@@ -490,6 +497,7 @@ e_text_model_delete (ETextModel *model,
return;
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_if_fail (class != NULL);
if (class->delete != NULL)
class->delete (model, position, length);
@@ -503,6 +511,7 @@ e_text_model_object_count (ETextModel *model)
g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0);
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, 0);
if (class->obj_count == NULL)
return 0;
@@ -523,6 +532,7 @@ e_text_model_get_nth_object (ETextModel *model,
return NULL;
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, NULL);
if (class->get_nth_obj == NULL)
return NULL;
@@ -585,6 +595,7 @@ e_text_model_get_object_at_offset (ETextModel *model,
return -1;
class = E_TEXT_MODEL_GET_CLASS (model);
+ g_return_val_if_fail (class != NULL, -1);
/* If an optimized version has been provided, we use it. */
if (class->obj_at_offset != NULL) {
diff --git a/src/e-util/e-web-view.c b/src/e-util/e-web-view.c
index 3f5f011..19a0c02 100644
--- a/src/e-util/e-web-view.c
+++ b/src/e-util/e-web-view.c
@@ -576,6 +576,7 @@ web_view_mouse_target_changed_cb (EWebView *web_view,
* behavior from subclasses for special URI types. */
class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->hovering_over_link != NULL);
class->hovering_over_link (web_view, title, uri);
@@ -652,6 +653,7 @@ web_view_decide_policy_cb (EWebView *web_view,
* behavior from subclasses for special URI types. */
class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->link_clicked != NULL, FALSE);
webkit_policy_decision_ignore (decision);
@@ -2594,6 +2596,7 @@ e_web_view_load_string (EWebView *web_view,
g_return_if_fail (E_IS_WEB_VIEW (web_view));
class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->load_string != NULL);
e_web_view_replace_load_cancellable (web_view, TRUE);
@@ -2610,6 +2613,7 @@ e_web_view_load_uri (EWebView *web_view,
g_return_if_fail (E_IS_WEB_VIEW (web_view));
class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->load_uri != NULL);
e_web_view_replace_load_cancellable (web_view, TRUE);
@@ -2648,6 +2652,7 @@ e_web_view_suggest_filename (EWebView *web_view,
g_return_val_if_fail (uri != NULL, NULL);
class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->suggest_filename != NULL, NULL);
filename = class->suggest_filename (web_view, uri);
@@ -3819,6 +3824,8 @@ e_web_view_update_fonts (EWebView *web_view)
g_return_if_fail (E_IS_WEB_VIEW (web_view));
class = E_WEB_VIEW_GET_CLASS (web_view);
+ g_return_if_fail (class != NULL);
+
if (class->set_fonts != NULL)
class->set_fonts (web_view, &ms, &vw);
diff --git a/src/e-util/gal-a11y-e-cell-toggle.h b/src/e-util/gal-a11y-e-cell-toggle.h
index 4b392c9..e64e5ad 100644
--- a/src/e-util/gal-a11y-e-cell-toggle.h
+++ b/src/e-util/gal-a11y-e-cell-toggle.h
@@ -27,7 +27,6 @@
#include <atk/atk.h>
#include "gal-a11y-e-cell.h"
-#include "gal-a11y-e-cell-toggle.h"
G_BEGIN_DECLS
diff --git a/src/e-util/gal-a11y-e-cell.c b/src/e-util/gal-a11y-e-cell.c
index bd4ed25..3d5b023 100644
--- a/src/e-util/gal-a11y-e-cell.c
+++ b/src/e-util/gal-a11y-e-cell.c
@@ -338,14 +338,18 @@ gal_a11y_e_cell_remove_action (GalA11yECell *cell,
gint action_index)
{
GList *list_node;
+ gpointer data;
g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE);
list_node = g_list_nth (cell->action_list, action_index);
if (!list_node)
return FALSE;
- g_return_val_if_fail (list_node->data != NULL, FALSE);
- _gal_a11y_e_cell_destroy_action_info (list_node->data, NULL);
- cell->action_list = g_list_remove (cell->action_list, list_node->data);
+
+ data = list_node->data;
+ g_return_val_if_fail (data != NULL, FALSE);
+
+ cell->action_list = g_list_remove (cell->action_list, data);
+ _gal_a11y_e_cell_destroy_action_info (data, NULL);
return TRUE;
}
@@ -355,6 +359,7 @@ gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell,
const gchar *action_name)
{
GList *list_node;
+ gpointer data;
g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE);
@@ -369,8 +374,14 @@ gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell,
return FALSE;
}
- _gal_a11y_e_cell_destroy_action_info (list_node->data, NULL);
- cell->action_list = g_list_remove (cell->action_list, list_node->data);
+ data = list_node->data;
+ if (!data) {
+ g_warn_if_reached ();
+ return FALSE;
+ }
+
+ cell->action_list = g_list_remove (cell->action_list, data);
+ _gal_a11y_e_cell_destroy_action_info (data, NULL);
return TRUE;
}
diff --git a/src/e-util/gal-view-collection.c b/src/e-util/gal-view-collection.c
index 91c9ac8..079e065 100644
--- a/src/e-util/gal-view-collection.c
+++ b/src/e-util/gal-view-collection.c
@@ -744,6 +744,7 @@ gal_view_collection_append_with_title (GalViewCollection *collection,
g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
view_class = GAL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (view_class != NULL, NULL);
gal_view_set_title (view, title);
@@ -786,6 +787,7 @@ gal_view_collection_set_nth_view (GalViewCollection *collection,
g_return_val_if_fail (i < collection->priv->view_count, NULL);
view_class = GAL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (view_class != NULL, NULL);
item = collection->priv->view_data[i];
diff --git a/src/e-util/gal-view.c b/src/e-util/gal-view.c
index c11176e..1d08b8e 100644
--- a/src/e-util/gal-view.c
+++ b/src/e-util/gal-view.c
@@ -168,6 +168,7 @@ gal_view_load (GalView *view,
g_return_if_fail (filename != NULL);
class = GAL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->load != NULL);
class->load (view, filename);
@@ -188,6 +189,7 @@ gal_view_save (GalView *view,
g_return_if_fail (filename != NULL);
class = GAL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->save != NULL);
class->save (view, filename);
@@ -241,6 +243,7 @@ gal_view_clone (GalView *view)
g_return_val_if_fail (GAL_IS_VIEW (view), NULL);
class = GAL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->clone != NULL, NULL);
return class->clone (view);
diff --git a/src/e-util/test-calendar.c b/src/e-util/test-calendar.c
index 3c4dc77..d3683a0 100644
--- a/src/e-util/test-calendar.c
+++ b/src/e-util/test-calendar.c
@@ -134,7 +134,7 @@ on_selection_changed (ECalendarItem *calitem)
{
GDate start_date, end_date;
- e_calendar_item_get_selection (calitem, &start_date, &end_date);
+ g_warn_if_fail (e_calendar_item_get_selection (calitem, &start_date, &end_date));
g_print (
"Selection changed (D/M/Y): %i/%i/%i - %i/%i/%i\n",
diff --git a/src/e-util/test-html-editor-units-bugs.c b/src/e-util/test-html-editor-units-bugs.c
index 58a8a36..0558291 100644
--- a/src/e-util/test-html-editor-units-bugs.c
+++ b/src/e-util/test-html-editor-units-bugs.c
@@ -25,6 +25,9 @@
static void
test_bug_726548 (TestFixture *fixture)
{
+ /* This test is known to fail, skip it. */
+ printf ("SKIPPED ");
+#if 0
gboolean success;
gchar *text;
const gchar *expected_plain =
@@ -33,10 +36,6 @@ test_bug_726548 (TestFixture *fixture)
" 2. b\n"
" 3. c\n";
- /* This test is known to fail, skip it. */
- printf ("SKIPPED ");
- return;
-
if (!test_utils_run_simple_test (fixture,
"mode:plain\n"
"type:aaa\\n\n"
@@ -65,6 +64,7 @@ test_bug_726548 (TestFixture *fixture)
} else {
g_free (text);
}
+#endif
}
static void
diff --git a/src/e-util/test-html-editor-units.c b/src/e-util/test-html-editor-units.c
index dcd4171..4a59223 100644
--- a/src/e-util/test-html-editor-units.c
+++ b/src/e-util/test-html-editor-units.c
@@ -1560,8 +1560,8 @@ test_paste_multiline_html2html (TestFixture *fixture)
{
/* This test is known to fail, skip it. */
printf ("SKIPPED ");
- return;
+#if 0
test_utils_set_clipboard_text ("<html><body><b>bold</b> text<br><i>italic</i>
text<br><u>underline</u> text<br></body></html>", TRUE);
if (!test_utils_run_simple_test (fixture,
@@ -1572,6 +1572,7 @@ test_paste_multiline_html2html (TestFixture *fixture)
HTML_PREFIX "<div>text before <b>bold</b> text</div><div><i>italic</i>
text</div><div><u>underline</u> text</div><div>text after</div>" HTML_SUFFIX,
"text before bold text\nitalic text\nunderline text\ntext after"))
g_test_fail ();
+#endif
}
static void
@@ -1597,8 +1598,8 @@ test_paste_multiline_div_html2html (TestFixture *fixture)
{
/* This test is known to fail, skip it. */
printf ("SKIPPED ");
- return;
+#if 0
test_utils_set_clipboard_text ("<html><body><div><b>bold</b> text</div><div><i>italic</i>
text</div><div><u>underline</u> text</div><div></div></body></html>", TRUE);
if (!test_utils_run_simple_test (fixture,
@@ -1609,6 +1610,7 @@ test_paste_multiline_div_html2html (TestFixture *fixture)
HTML_PREFIX "<div>text before <b>bold</b> text</div><div><i>italic</i>
text</div><div><u>underline</u> text</div><div>text after</div>" HTML_SUFFIX,
"text before bold text\nitalic text\nunderline text\ntext after"))
g_test_fail ();
+#endif
}
static void
@@ -1634,8 +1636,8 @@ test_paste_multiline_p_html2html (TestFixture *fixture)
{
/* This test is known to fail, skip it. */
printf ("SKIPPED ");
- return;
+#if 0
test_utils_set_clipboard_text ("<html><body><div><b>bold</b> text</div><div><i>italic</i>
text</div><div><u>underline</u> text</div><div></div></body></html>", TRUE);
if (!test_utils_run_simple_test (fixture,
@@ -1646,6 +1648,7 @@ test_paste_multiline_p_html2html (TestFixture *fixture)
HTML_PREFIX "<div>text before <b>bold</b> text</div><div><i>italic</i>
text</div><div><u>underline</u> text</div><div>text after</div>" HTML_SUFFIX,
"text before bold text\nitalic text\nunderline text\ntext after"))
g_test_fail ();
+#endif
}
static void
@@ -1784,8 +1787,8 @@ test_paste_quoted_multiline_html2html (TestFixture *fixture)
{
/* This test is known to fail, skip it. */
printf ("SKIPPED ");
- return;
+#if 0
test_utils_set_clipboard_text ("<html><body><b>bold</b> text<br><i>italic</i>
text<br><u>underline</u> text<br></body></html>", TRUE);
if (!test_utils_run_simple_test (fixture,
@@ -1805,6 +1808,7 @@ test_paste_quoted_multiline_html2html (TestFixture *fixture)
"> underline text\n"
"text after"))
g_test_fail ();
+#endif
}
static void
@@ -1812,8 +1816,8 @@ test_paste_quoted_multiline_html2plain (TestFixture *fixture)
{
/* This test is known to fail, skip it. */
printf ("SKIPPED ");
- return;
+#if 0
test_utils_set_clipboard_text ("<html><body><b>bold</b> text<br><i>italic</i>
text<br><u>underline</u> text</body></html>", TRUE);
if (!test_utils_run_simple_test (fixture,
@@ -1833,6 +1837,7 @@ test_paste_quoted_multiline_html2plain (TestFixture *fixture)
"> underline text\n"
"text after"))
g_test_fail ();
+#endif
}
static void
@@ -2124,8 +2129,8 @@ test_cite_reply_html (TestFixture *fixture)
{
/* This test is known to fail, skip it. */
printf ("SKIPPED ");
- return;
+#if 0
if (!test_utils_process_commands (fixture,
"mode:html\n")) {
g_test_fail ();
@@ -2150,7 +2155,7 @@ test_cite_reply_html (TestFixture *fixture)
"> line 2\n"
"> "))
g_test_fail ();
-
+#endif
}
static void
diff --git a/src/em-format/e-mail-formatter-extension.c b/src/em-format/e-mail-formatter-extension.c
index 3a2dd52..6121429 100644
--- a/src/em-format/e-mail-formatter-extension.c
+++ b/src/em-format/e-mail-formatter-extension.c
@@ -73,8 +73,8 @@ e_mail_formatter_extension_format (EMailFormatterExtension *extension,
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), FALSE);
class = E_MAIL_FORMATTER_EXTENSION_GET_CLASS (extension);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->format != NULL, FALSE);
- return class->format (
- extension, formatter, context, part, stream, cancellable);
+ return class->format (extension, formatter, context, part, stream, cancellable);
}
diff --git a/src/em-format/e-mail-formatter-quote-headers.c b/src/em-format/e-mail-formatter-quote-headers.c
index 01a77dd..1f2d759 100644
--- a/src/em-format/e-mail-formatter-quote-headers.c
+++ b/src/em-format/e-mail-formatter-quote-headers.c
@@ -139,20 +139,20 @@ emfqe_format_header (EMailFormatter *formatter,
CamelMedium *medium;
struct _camel_header_address *addrs;
GString *html;
- gchar *charset;
+ gchar *fmt_charset;
medium = CAMEL_MEDIUM (mime_part);
txt = camel_medium_get_header (medium, canon_name);
if (txt == NULL)
return;
- charset = e_mail_formatter_dup_charset (formatter);
- if (!charset)
- charset = e_mail_formatter_dup_default_charset (formatter);
+ fmt_charset = e_mail_formatter_dup_charset (formatter);
+ if (!fmt_charset)
+ fmt_charset = e_mail_formatter_dup_default_charset (formatter);
buf = camel_header_unfold (txt);
- addrs = camel_header_address_decode (txt, charset);
- g_free (charset);
+ addrs = camel_header_address_decode (txt, fmt_charset);
+ g_free (fmt_charset);
if (addrs == NULL) {
g_free (buf);
diff --git a/src/em-format/e-mail-formatter-utils.c b/src/em-format/e-mail-formatter-utils.c
index c43aec3..1c4c765 100644
--- a/src/em-format/e-mail-formatter-utils.c
+++ b/src/em-format/e-mail-formatter-utils.c
@@ -297,21 +297,21 @@ e_mail_formatter_format_header (EMailFormatter *formatter,
struct _camel_header_address *addrs;
GString *html;
gchar *img;
- gchar *charset;
+ gchar *fmt_charset;
- charset = e_mail_formatter_dup_charset (formatter);
- if (charset == NULL)
- charset = e_mail_formatter_dup_default_charset (formatter);
+ fmt_charset = e_mail_formatter_dup_charset (formatter);
+ if (fmt_charset == NULL)
+ fmt_charset = e_mail_formatter_dup_default_charset (formatter);
buf = camel_header_unfold (header_value);
- addrs = camel_header_address_decode (buf, charset);
+ addrs = camel_header_address_decode (buf, fmt_charset);
if (addrs == NULL) {
- g_free (charset);
+ g_free (fmt_charset);
g_free (buf);
return;
}
- g_free (charset);
+ g_free (fmt_charset);
g_free (buf);
html = g_string_new ("");
diff --git a/src/em-format/e-mail-formatter.c b/src/em-format/e-mail-formatter.c
index f0ea97e..cc157d1 100644
--- a/src/em-format/e-mail-formatter.c
+++ b/src/em-format/e-mail-formatter.c
@@ -120,6 +120,7 @@ mail_formatter_create_context (EMailFormatter *formatter,
EMailFormatterContext *context;
class = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_val_if_fail (class != NULL, NULL);
g_warn_if_fail (class->context_size >= sizeof (EMailFormatterContext));
@@ -856,6 +857,7 @@ e_mail_formatter_format_sync (EMailFormatter *formatter,
g_return_if_fail (G_IS_OUTPUT_STREAM (stream));
class = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->run != NULL);
context = mail_formatter_create_context (
@@ -903,6 +905,7 @@ e_mail_formatter_format (EMailFormatter *formatter,
g_return_if_fail (G_IS_OUTPUT_STREAM (stream));
class = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->run != NULL);
async_context = g_slice_new0 (AsyncContext);
@@ -1164,30 +1167,42 @@ e_mail_formatter_get_html_header (EMailFormatter *formatter)
EMailExtensionRegistry *
e_mail_formatter_get_extension_registry (EMailFormatter *formatter)
{
- EMailFormatterClass * class;
+ EMailFormatterClass *klass;
g_return_val_if_fail (E_IS_MAIL_FORMATTER (formatter), NULL);
- class = E_MAIL_FORMATTER_GET_CLASS (formatter);
- return E_MAIL_EXTENSION_REGISTRY (class->extension_registry);
+ klass = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_val_if_fail (klass != NULL, NULL);
+
+ return E_MAIL_EXTENSION_REGISTRY (klass->extension_registry);
}
CamelMimeFilterToHTMLFlags
e_mail_formatter_get_text_format_flags (EMailFormatter *formatter)
{
+ EMailFormatterClass *klass;
+
g_return_val_if_fail (E_IS_MAIL_FORMATTER (formatter), 0);
- return E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags;
+ klass = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_val_if_fail (klass != NULL, 0);
+
+ return klass->text_html_flags;
}
const GdkRGBA *
e_mail_formatter_get_color (EMailFormatter *formatter,
EMailFormatterColor type)
{
+ EMailFormatterClass *klass;
+
g_return_val_if_fail (E_IS_MAIL_FORMATTER (formatter), NULL);
g_return_val_if_fail (type < E_MAIL_FORMATTER_NUM_COLOR_TYPES, NULL);
- return &E_MAIL_FORMATTER_GET_CLASS (formatter)->colors[type];
+ klass = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_val_if_fail (klass != NULL, NULL);
+
+ return &(klass->colors[type]);
}
void
@@ -1195,6 +1210,7 @@ e_mail_formatter_set_color (EMailFormatter *formatter,
EMailFormatterColor type,
const GdkRGBA *color)
{
+ EMailFormatterClass *klass;
GdkRGBA *format_color;
const gchar *property_name;
@@ -1202,7 +1218,10 @@ e_mail_formatter_set_color (EMailFormatter *formatter,
g_return_if_fail (type < E_MAIL_FORMATTER_NUM_COLOR_TYPES);
g_return_if_fail (color != NULL);
- format_color = &E_MAIL_FORMATTER_GET_CLASS (formatter)->colors[type];
+ klass = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_if_fail (klass != NULL);
+
+ format_color = &(klass->colors[type]);
if (gdk_rgba_equal (color, format_color))
return;
@@ -1246,6 +1265,7 @@ e_mail_formatter_update_style (EMailFormatter *formatter,
g_return_if_fail (E_IS_MAIL_FORMATTER (formatter));
class = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->update_style != NULL);
class->update_style (formatter, state);
@@ -1276,11 +1296,15 @@ e_mail_formatter_set_image_loading_policy (EMailFormatter *formatter,
gboolean
e_mail_formatter_get_mark_citations (EMailFormatter *formatter)
{
+ EMailFormatterClass *klass;
guint32 flags;
g_return_val_if_fail (E_IS_MAIL_FORMATTER (formatter), FALSE);
- flags = E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags;
+ klass = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_val_if_fail (klass != NULL, FALSE);
+
+ flags = klass->text_html_flags;
return ((flags & CAMEL_MIME_FILTER_TOHTML_MARK_CITATION) != 0);
}
@@ -1289,14 +1313,17 @@ void
e_mail_formatter_set_mark_citations (EMailFormatter *formatter,
gboolean mark_citations)
{
+ EMailFormatterClass *klass;
+
g_return_if_fail (E_IS_MAIL_FORMATTER (formatter));
+ klass = E_MAIL_FORMATTER_GET_CLASS (formatter);
+ g_return_if_fail (klass != NULL);
+
if (mark_citations)
- E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags |=
- CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
+ klass->text_html_flags |= CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
else
- E_MAIL_FORMATTER_GET_CLASS (formatter)->text_html_flags &=
- ~CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
+ klass->text_html_flags &= ~CAMEL_MIME_FILTER_TOHTML_MARK_CITATION;
g_object_notify (G_OBJECT (formatter), "mark-citations");
}
diff --git a/src/em-format/e-mail-parser-extension.c b/src/em-format/e-mail-parser-extension.c
index ae9ef7d..dbbc2c3 100644
--- a/src/em-format/e-mail-parser-extension.c
+++ b/src/em-format/e-mail-parser-extension.c
@@ -79,6 +79,7 @@ e_mail_parser_extension_parse (EMailParserExtension *extension,
g_return_val_if_fail (E_IS_MAIL_PARSER (parser), FALSE);
class = E_MAIL_PARSER_EXTENSION_GET_CLASS (extension);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->parse != NULL, FALSE);
/* Check for cancellation before calling the method. */
diff --git a/src/em-format/e-mail-parser.c b/src/em-format/e-mail-parser.c
index 3cbd90d..9bcb4df 100644
--- a/src/em-format/e-mail-parser.c
+++ b/src/em-format/e-mail-parser.c
@@ -551,12 +551,14 @@ e_mail_parser_get_parsers (EMailParser *parser,
g_return_val_if_fail (E_IS_MAIL_PARSER (parser), NULL);
+ parser_class = E_MAIL_PARSER_GET_CLASS (parser);
+ g_return_val_if_fail (parser_class != NULL, NULL);
+
if (mime_type)
as_mime_type = g_ascii_strdown (mime_type, -1);
else
as_mime_type = NULL;
- parser_class = E_MAIL_PARSER_GET_CLASS (parser);
reg = E_MAIL_EXTENSION_REGISTRY (parser_class->extension_registry);
parsers = e_mail_extension_registry_get_for_mime_type (reg, as_mime_type);
@@ -860,5 +862,7 @@ e_mail_parser_get_extension_registry (EMailParser *parser)
g_return_val_if_fail (E_IS_MAIL_PARSER (parser), NULL);
parser_class = E_MAIL_PARSER_GET_CLASS (parser);
+ g_return_val_if_fail (parser_class != NULL, NULL);
+
return E_MAIL_EXTENSION_REGISTRY (parser_class->extension_registry);
}
diff --git a/src/em-format/e-mail-part.c b/src/em-format/e-mail-part.c
index 48d8be9..135005e 100644
--- a/src/em-format/e-mail-part.c
+++ b/src/em-format/e-mail-part.c
@@ -595,6 +595,7 @@ e_mail_part_bind_dom_element (EMailPart *part,
g_return_if_fail (element_id && *element_id);
class = E_MAIL_PART_GET_CLASS (part);
+ g_return_if_fail (class != NULL);
if (class->bind_dom_element != NULL)
class->bind_dom_element (part, web_view, page_id, element_id);
@@ -610,6 +611,7 @@ e_mail_part_web_view_loaded (EMailPart *part,
g_return_if_fail (E_IS_WEB_VIEW (web_view));
klass = E_MAIL_PART_GET_CLASS (part);
+ g_return_if_fail (klass != NULL);
if (klass->web_view_loaded)
klass->web_view_loaded (part, web_view);
diff --git a/src/em-format/e-mail-part.h b/src/em-format/e-mail-part.h
index 9cc2fc0..3e3d38a 100644
--- a/src/em-format/e-mail-part.h
+++ b/src/em-format/e-mail-part.h
@@ -68,18 +68,18 @@ struct _EMailPart {
* This is used for example to prevent images
* related to text/html parts from being
* rendered as attachments. */
- gint is_hidden: 1;
+ guint is_hidden: 1;
/* Force attachment to be expanded, even without
* content-disposition: inline */
- gint force_inline: 1;
+ guint force_inline: 1;
/* Force attachment to be collapsed, even with
* content-disposition: inline */
- gint force_collapse: 1;
+ guint force_collapse: 1;
/* Does part contain an error message? */
- gint is_error: 1;
+ guint is_error: 1;
};
struct _EMailPartClass {
diff --git a/src/libemail-engine/e-mail-folder-utils.c b/src/libemail-engine/e-mail-folder-utils.c
index e41cbf1..e8aa726 100644
--- a/src/libemail-engine/e-mail-folder-utils.c
+++ b/src/libemail-engine/e-mail-folder-utils.c
@@ -284,7 +284,7 @@ mail_folder_expunge_pop3_stores (CamelFolder *folder,
for (link = list; link != NULL; link = g_list_next (link)) {
ESource *source = E_SOURCE (link->data);
ESourceBackend *extension;
- CamelFolder *folder;
+ CamelFolder *inbox_folder;
CamelService *service;
CamelSettings *settings;
const gchar *backend_name;
@@ -321,21 +321,21 @@ mail_folder_expunge_pop3_stores (CamelFolder *folder,
continue;
}
- folder = camel_store_get_inbox_folder_sync (
+ inbox_folder = camel_store_get_inbox_folder_sync (
CAMEL_STORE (service), cancellable, error);
/* Abort the loop on error. */
- if (folder == NULL) {
+ if (inbox_folder == NULL) {
g_object_unref (service);
success = FALSE;
break;
}
- uids = camel_folder_get_uids (folder);
+ uids = camel_folder_get_uids (inbox_folder);
if (uids == NULL) {
g_object_unref (service);
- g_object_unref (folder);
+ g_object_unref (inbox_folder);
continue;
}
@@ -347,17 +347,17 @@ mail_folder_expunge_pop3_stores (CamelFolder *folder,
if (g_strcmp0 (source_uid, service_uid) == 0) {
any_found = TRUE;
camel_folder_delete_message (
- folder, uids->pdata[ii]);
+ inbox_folder, uids->pdata[ii]);
}
}
- camel_folder_free_uids (folder, uids);
+ camel_folder_free_uids (inbox_folder, uids);
if (any_found)
success = camel_folder_synchronize_sync (
- folder, TRUE, cancellable, error);
+ inbox_folder, TRUE, cancellable, error);
- g_object_unref (folder);
+ g_object_unref (inbox_folder);
g_object_unref (service);
/* Abort the loop on error. */
diff --git a/src/libemail-engine/e-mail-junk-filter.c b/src/libemail-engine/e-mail-junk-filter.c
index 580ed2d..6f98e95 100644
--- a/src/libemail-engine/e-mail-junk-filter.c
+++ b/src/libemail-engine/e-mail-junk-filter.c
@@ -46,6 +46,7 @@ e_mail_junk_filter_available (EMailJunkFilter *junk_filter)
g_return_val_if_fail (E_IS_MAIL_JUNK_FILTER (junk_filter), FALSE);
class = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->available != NULL, FALSE);
return class->available (junk_filter);
@@ -60,6 +61,7 @@ e_mail_junk_filter_new_config_widget (EMailJunkFilter *junk_filter)
g_return_val_if_fail (E_IS_MAIL_JUNK_FILTER (junk_filter), NULL);
class = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter);
+ g_return_val_if_fail (class != NULL, NULL);
if (class->new_config_widget != NULL)
widget = class->new_config_widget (junk_filter);
@@ -77,5 +79,8 @@ e_mail_junk_filter_compare (EMailJunkFilter *junk_filter_a,
class_a = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter_a);
class_b = E_MAIL_JUNK_FILTER_GET_CLASS (junk_filter_b);
+ g_return_val_if_fail (class_a != NULL, 0);
+ g_return_val_if_fail (class_b != NULL, 0);
+
return g_utf8_collate (class_a->display_name, class_b->display_name);
}
diff --git a/src/libemail-engine/e-mail-session-utils.c b/src/libemail-engine/e-mail-session-utils.c
index cdcea02..1384be2 100644
--- a/src/libemail-engine/e-mail-session-utils.c
+++ b/src/libemail-engine/e-mail-session-utils.c
@@ -535,15 +535,12 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple,
status = camel_service_get_connection_status (context->transport);
if (status != CAMEL_SERVICE_CONNECTED) {
- EMailSession *session;
ESourceRegistry *registry;
ESource *source;
/* Make sure user will be asked for a password, in case he/she cancelled it */
- session = E_MAIL_SESSION (camel_service_ref_session (context->transport));
registry = e_mail_session_get_registry (session);
source = e_source_registry_ref_source (registry, camel_service_get_uid (context->transport));
- g_object_unref (session);
if (source) {
e_mail_session_emit_allow_auth_prompt (session, source);
diff --git a/src/libemail-engine/e-mail-session.c b/src/libemail-engine/e-mail-session.c
index 942e6a0..c86947c 100644
--- a/src/libemail-engine/e-mail-session.c
+++ b/src/libemail-engine/e-mail-session.c
@@ -2329,6 +2329,7 @@ e_mail_session_create_vfolder_context (EMailSession *session)
g_return_val_if_fail (E_IS_MAIL_SESSION (session), NULL);
class = E_MAIL_SESSION_GET_CLASS (session);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->create_vfolder_context != NULL, NULL);
return class->create_vfolder_context (session);
diff --git a/src/libgnomecanvas/gnome-canvas.c b/src/libgnomecanvas/gnome-canvas.c
index 6412673..ef34185 100644
--- a/src/libgnomecanvas/gnome-canvas.c
+++ b/src/libgnomecanvas/gnome-canvas.c
@@ -284,11 +284,13 @@ redraw_if_visible (GnomeCanvasItem *item)
static void
gnome_canvas_item_dispose (GObject *object)
{
+ GnomeCanvasItemClass *klass;
GnomeCanvasItem *item;
g_return_if_fail (GNOME_IS_CANVAS_ITEM (object));
item = GNOME_CANVAS_ITEM (object);
+ klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
if (item->canvas)
redraw_if_visible (item);
@@ -319,17 +321,21 @@ gnome_canvas_item_dispose (GObject *object)
/* Normal dispose stuff */
- if (item->flags & GNOME_CANVAS_ITEM_MAPPED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->unmap) (item);
+ if (item->flags & GNOME_CANVAS_ITEM_MAPPED) {
+ if (klass)
+ klass->unmap (item);
+ }
- if (item->flags & GNOME_CANVAS_ITEM_REALIZED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->unrealize) (item);
+ if (item->flags & GNOME_CANVAS_ITEM_REALIZED) {
+ if (klass)
+ klass->unrealize (item);
+ }
if (item->parent)
group_remove (GNOME_CANVAS_GROUP (item->parent), item);
- if (GNOME_CANVAS_ITEM_GET_CLASS (item)->dispose)
- GNOME_CANVAS_ITEM_GET_CLASS (item)->dispose (item);
+ if (klass && klass->dispose)
+ klass->dispose (item);
G_OBJECT_CLASS (gnome_canvas_item_parent_class)->dispose (object);
/* items should remove any reference to item->canvas after the
@@ -474,8 +480,10 @@ gnome_canvas_item_invoke_update (GnomeCanvasItem *item,
child_flags |= GNOME_CANVAS_UPDATE_VISIBILITY;
if (child_flags & GCI_UPDATE_MASK) {
- if (GNOME_CANVAS_ITEM_GET_CLASS (item)->update)
- GNOME_CANVAS_ITEM_GET_CLASS (item)->update (item, &i2c, child_flags);
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
+
+ if (klass && klass->update)
+ klass->update (item, &i2c, child_flags);
}
}
@@ -493,6 +501,7 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item,
gint cx,
gint cy)
{
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
cairo_matrix_t inverse;
/* Calculate x & y in item local coordinates */
@@ -502,8 +511,8 @@ gnome_canvas_item_invoke_point (GnomeCanvasItem *item,
cairo_matrix_transform_point (&inverse, &x, &y);
- if (GNOME_CANVAS_ITEM_GET_CLASS (item)->point)
- return GNOME_CANVAS_ITEM_GET_CLASS (item)->point (item, x, y, cx, cy);
+ if (klass && klass->point)
+ return klass->point (item, x, y, cx, cy);
return NULL;
}
@@ -1162,17 +1171,20 @@ gnome_canvas_item_get_bounds (GnomeCanvasItem *item,
gdouble *x2,
gdouble *y2)
{
+ GnomeCanvasItemClass *klass;
gdouble tx1, ty1, tx2, ty2;
g_return_if_fail (GNOME_IS_CANVAS_ITEM (item));
+ klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
+ g_return_if_fail (klass != NULL);
+
tx1 = ty1 = tx2 = ty2 = 0.0;
/* Get the item's bounds in its coordinate system */
- if (GNOME_CANVAS_ITEM_GET_CLASS (item)->bounds)
- GNOME_CANVAS_ITEM_GET_CLASS (item)->bounds (
- item, &tx1, &ty1, &tx2, &ty2);
+ if (klass->bounds)
+ klass->bounds (item, &tx1, &ty1, &tx2, &ty2);
/* Make the bounds relative to the item's parent coordinate system */
gnome_canvas_matrix_transform_rect (&item->matrix, &tx1, &ty1, &tx2, &ty2);
@@ -1444,12 +1456,15 @@ gnome_canvas_group_realize (GnomeCanvasItem *item)
for (list = group->item_list; list; list = list->next) {
i = list->data;
- if (!(i->flags & GNOME_CANVAS_ITEM_REALIZED))
- (* GNOME_CANVAS_ITEM_GET_CLASS (i)->realize) (i);
+ if (!(i->flags & GNOME_CANVAS_ITEM_REALIZED)) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (i);
+
+ if (klass)
+ klass->realize (i);
+ }
}
- GNOME_CANVAS_ITEM_CLASS (gnome_canvas_group_parent_class)->
- realize (item);
+ GNOME_CANVAS_ITEM_CLASS (gnome_canvas_group_parent_class)->realize (item);
}
/* Unrealize handler for canvas groups */
@@ -1465,8 +1480,12 @@ gnome_canvas_group_unrealize (GnomeCanvasItem *item)
for (list = group->item_list; list; list = list->next) {
i = list->data;
- if (i->flags & GNOME_CANVAS_ITEM_REALIZED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (i)->unrealize) (i);
+ if (i->flags & GNOME_CANVAS_ITEM_REALIZED) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (i);
+
+ if (klass)
+ klass->unrealize (i);
+ }
}
GNOME_CANVAS_ITEM_CLASS (gnome_canvas_group_parent_class)->
@@ -1486,8 +1505,12 @@ gnome_canvas_group_map (GnomeCanvasItem *item)
for (list = group->item_list; list; list = list->next) {
i = list->data;
- if (!(i->flags & GNOME_CANVAS_ITEM_MAPPED))
- (* GNOME_CANVAS_ITEM_GET_CLASS (i)->map) (i);
+ if (!(i->flags & GNOME_CANVAS_ITEM_MAPPED)) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (i);
+
+ if (klass)
+ klass->map (i);
+ }
}
GNOME_CANVAS_ITEM_CLASS (gnome_canvas_group_parent_class)->map (item);
@@ -1506,8 +1529,12 @@ gnome_canvas_group_unmap (GnomeCanvasItem *item)
for (list = group->item_list; list; list = list->next) {
i = list->data;
- if (i->flags & GNOME_CANVAS_ITEM_MAPPED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (i)->unmap) (i);
+ if (i->flags & GNOME_CANVAS_ITEM_MAPPED) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (i);
+
+ if (klass)
+ klass->unmap (i);
+ }
}
GNOME_CANVAS_ITEM_CLASS (gnome_canvas_group_parent_class)->unmap (item);
@@ -1536,12 +1563,15 @@ gnome_canvas_group_draw (GnomeCanvasItem *item,
&& (child->y1 < (y + height))
&& (child->x2 > x)
&& (child->y2 > y))) {
- cairo_save (cr);
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (child);
- GNOME_CANVAS_ITEM_GET_CLASS (child)->draw (
- child, cr, x, y, width, height);
+ if (klass && klass->draw) {
+ cairo_save (cr);
- cairo_restore (cr);
+ klass->draw (child, cr, x, y, width, height);
+
+ cairo_restore (cr);
+ }
}
}
}
@@ -1664,11 +1694,19 @@ group_add (GnomeCanvasGroup *group,
} else
group->item_list_end = g_list_append (group->item_list_end, item)->next;
- if (group->item.flags & GNOME_CANVAS_ITEM_REALIZED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->realize) (item);
+ if (group->item.flags & GNOME_CANVAS_ITEM_REALIZED) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
- if (group->item.flags & GNOME_CANVAS_ITEM_MAPPED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->map) (item);
+ if (klass)
+ klass->realize (item);
+ }
+
+ if (group->item.flags & GNOME_CANVAS_ITEM_MAPPED) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
+
+ if (klass)
+ klass->map (item);
+ }
g_object_notify (G_OBJECT (item), "parent");
}
@@ -1685,11 +1723,19 @@ group_remove (GnomeCanvasGroup *group,
for (children = group->item_list; children; children = children->next)
if (children->data == item) {
- if (item->flags & GNOME_CANVAS_ITEM_MAPPED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->unmap) (item);
+ if (item->flags & GNOME_CANVAS_ITEM_MAPPED) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
- if (item->flags & GNOME_CANVAS_ITEM_REALIZED)
- (* GNOME_CANVAS_ITEM_GET_CLASS (item)->unrealize) (item);
+ if (klass)
+ klass->unmap (item);
+ }
+
+ if (item->flags & GNOME_CANVAS_ITEM_REALIZED) {
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (item);
+
+ if (klass)
+ klass->unrealize (item);
+ }
/* Unparent the child */
@@ -1811,14 +1857,18 @@ gnome_canvas_paint_rect (GnomeCanvas *canvas,
cairo_restore (cr);
if (canvas->root->flags & GNOME_CANVAS_ITEM_VISIBLE) {
- cairo_save (cr);
+ GnomeCanvasItemClass *klass = GNOME_CANVAS_ITEM_GET_CLASS (canvas->root);
- (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->draw) (
- canvas->root, cr,
- draw_x1, draw_y1,
- draw_width, draw_height);
+ if (klass && klass->draw) {
+ cairo_save (cr);
+
+ klass->draw (
+ canvas->root, cr,
+ draw_x1, draw_y1,
+ draw_width, draw_height);
- cairo_restore (cr);
+ cairo_restore (cr);
+ }
}
}
@@ -2034,6 +2084,7 @@ static void
gnome_canvas_map (GtkWidget *widget)
{
GnomeCanvas *canvas;
+ GnomeCanvasItemClass *klass;
g_return_if_fail (GNOME_IS_CANVAS (widget));
@@ -2048,8 +2099,11 @@ gnome_canvas_map (GtkWidget *widget)
/* Map items */
- if (GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->map)
- (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->map) (canvas->root);
+ klass = GNOME_CANVAS_ITEM_GET_CLASS (canvas->root);
+ g_return_if_fail (klass != NULL);
+
+ if (klass->map)
+ klass->map (canvas->root);
}
/* Unmap handler for the canvas */
@@ -2057,6 +2111,7 @@ static void
gnome_canvas_unmap (GtkWidget *widget)
{
GnomeCanvas *canvas;
+ GnomeCanvasItemClass *klass;
g_return_if_fail (GNOME_IS_CANVAS (widget));
@@ -2066,8 +2121,11 @@ gnome_canvas_unmap (GtkWidget *widget)
/* Unmap items */
- if (GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->unmap)
- (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->unmap) (canvas->root);
+ klass = GNOME_CANVAS_ITEM_GET_CLASS (canvas->root);
+ g_return_if_fail (klass != NULL);
+
+ if (klass->unmap)
+ klass->unmap (canvas->root);
/* Normal widget unmapping stuff */
@@ -2079,6 +2137,7 @@ static void
gnome_canvas_realize (GtkWidget *widget)
{
GnomeCanvas *canvas;
+ GnomeCanvasItemClass *klass;
GtkLayout *layout;
GdkWindow *bin_window;
@@ -2107,9 +2166,12 @@ gnome_canvas_realize (GtkWidget *widget)
| GDK_LEAVE_NOTIFY_MASK
| GDK_FOCUS_CHANGE_MASK));
+ klass = GNOME_CANVAS_ITEM_GET_CLASS (canvas->root);
+ g_return_if_fail (klass != NULL);
+
/* Create our own temporary pixmap gc and realize all the items */
- (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->realize) (canvas->root);
+ klass->realize (canvas->root);
}
/* Unrealize handler for the canvas */
@@ -2117,6 +2179,7 @@ static void
gnome_canvas_unrealize (GtkWidget *widget)
{
GnomeCanvas *canvas;
+ GnomeCanvasItemClass *klass;
g_return_if_fail (GNOME_IS_CANVAS (widget));
@@ -2126,7 +2189,10 @@ gnome_canvas_unrealize (GtkWidget *widget)
/* Unrealize items and parent widget */
- (* GNOME_CANVAS_ITEM_GET_CLASS (canvas->root)->unrealize) (canvas->root);
+ klass = GNOME_CANVAS_ITEM_GET_CLASS (canvas->root);
+ g_return_if_fail (klass != NULL);
+
+ klass->unrealize (canvas->root);
GTK_WIDGET_CLASS (gnome_canvas_parent_class)->unrealize (widget);
}
diff --git a/src/mail/e-mail-backend.c b/src/mail/e-mail-backend.c
index 26f1af0..b0c5cde 100644
--- a/src/mail/e-mail-backend.c
+++ b/src/mail/e-mail-backend.c
@@ -1416,6 +1416,8 @@ e_mail_backend_delete_junk_policy_decision (EMailBackend *backend)
g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), FALSE);
class = E_MAIL_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
+
if (class->delete_junk_policy_decision == NULL)
return FALSE;
@@ -1430,6 +1432,8 @@ e_mail_backend_empty_trash_policy_decision (EMailBackend *backend)
g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), FALSE);
class = E_MAIL_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
+
if (class->empty_trash_policy_decision == NULL)
return FALSE;
diff --git a/src/mail/e-mail-config-composing-page.c b/src/mail/e-mail-config-composing-page.c
index 3fc89f1..d00c45e 100644
--- a/src/mail/e-mail-config-composing-page.c
+++ b/src/mail/e-mail-config-composing-page.c
@@ -96,7 +96,7 @@ mail_config_composing_page_string_to_addrs (GBinding *binding,
const gchar *name = NULL;
const gchar *addr = NULL;
- camel_internet_address_get (address, ii, &name, &addr);
+ g_warn_if_fail (camel_internet_address_get (address, ii, &name, &addr));
strv[ii] = camel_internet_address_format_address (name, addr);
}
diff --git a/src/mail/e-mail-config-page.c b/src/mail/e-mail-config-page.c
index 161a637..a7e0a3b 100644
--- a/src/mail/e-mail-config-page.c
+++ b/src/mail/e-mail-config-page.c
@@ -217,11 +217,12 @@ e_mail_config_page_compare (GtkWidget *page_a,
if (interface_a == interface_b)
return 0;
- if (interface_a != NULL && interface_b == NULL)
- return -1;
+ if (!interface_a || !interface_b) {
+ if (interface_a == interface_b)
+ return 0;
- if (interface_a == NULL && interface_b != NULL)
- return 1;
+ return interface_a ? -1 : 1;
+ }
/* coverity[var_deref_op] */
if (interface_a->sort_order < interface_b->sort_order)
diff --git a/src/mail/e-mail-config-service-backend.c b/src/mail/e-mail-config-service-backend.c
index 29411c9..83c5305 100644
--- a/src/mail/e-mail-config-service-backend.c
+++ b/src/mail/e-mail-config-service-backend.c
@@ -54,6 +54,7 @@ mail_config_service_backend_init_collection (EMailConfigServiceBackend *backend)
g_return_if_fail (backend->priv->collection == NULL);
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->new_collection != NULL);
backend->priv->collection = class->new_collection (backend);
@@ -351,6 +352,7 @@ e_mail_config_service_backend_get_provider (EMailConfigServiceBackend *backend)
g_return_val_if_fail (E_IS_MAIL_CONFIG_SERVICE_BACKEND (backend), NULL);
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->backend_name != NULL, NULL);
return camel_provider_get (class->backend_name, NULL);
@@ -445,6 +447,7 @@ e_mail_config_service_backend_get_selectable (EMailConfigServiceBackend *backend
g_return_val_if_fail (E_IS_MAIL_CONFIG_SERVICE_BACKEND (backend), FALSE);
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->get_selectable != NULL, FALSE);
return class->get_selectable (backend);
@@ -460,6 +463,7 @@ e_mail_config_service_backend_insert_widgets (EMailConfigServiceBackend *backend
g_return_if_fail (GTK_IS_BOX (parent));
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->insert_widgets != NULL);
class->insert_widgets (backend, parent);
@@ -473,6 +477,7 @@ e_mail_config_service_backend_setup_defaults (EMailConfigServiceBackend *backend
g_return_if_fail (E_IS_MAIL_CONFIG_SERVICE_BACKEND (backend));
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->setup_defaults != NULL);
return class->setup_defaults (backend);
@@ -490,6 +495,7 @@ e_mail_config_service_backend_auto_configure (EMailConfigServiceBackend *backend
g_return_val_if_fail (E_IS_CONFIG_LOOKUP (config_lookup), FALSE);
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->auto_configure != NULL, FALSE);
return class->auto_configure (backend, config_lookup, out_priority, out_is_complete);
@@ -503,6 +509,7 @@ e_mail_config_service_backend_check_complete (EMailConfigServiceBackend *backend
g_return_val_if_fail (E_IS_MAIL_CONFIG_SERVICE_BACKEND (backend), FALSE);
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->check_complete != NULL, FALSE);
return class->check_complete (backend);
@@ -516,6 +523,7 @@ e_mail_config_service_backend_commit_changes (EMailConfigServiceBackend *backend
g_return_if_fail (E_IS_MAIL_CONFIG_SERVICE_BACKEND (backend));
class = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->commit_changes != NULL);
class->commit_changes (backend);
@@ -560,6 +568,7 @@ e_mail_config_service_backend_auto_configure_for_kind (EMailConfigServiceBackend
g_return_val_if_fail (kind != E_CONFIG_LOOKUP_RESULT_UNKNOWN, FALSE);
klass = E_MAIL_CONFIG_SERVICE_BACKEND_GET_CLASS (backend);
+ g_return_val_if_fail (klass != NULL, FALSE);
g_return_val_if_fail (klass->backend_name != NULL, FALSE);
if (!source)
diff --git a/src/mail/e-mail-config-service-page.c b/src/mail/e-mail-config-service-page.c
index 0b1fd2d..be48fcc 100644
--- a/src/mail/e-mail-config-service-page.c
+++ b/src/mail/e-mail-config-service-page.c
@@ -119,6 +119,8 @@ mail_config_service_page_new_candidate (EMailConfigServicePage *page,
/* Get the backend name for this scratch source. */
class = E_MAIL_CONFIG_SERVICE_PAGE_GET_CLASS (page);
+ g_return_val_if_fail (class != NULL, NULL);
+
extension_name = class->extension_name;
extension = e_source_get_extension (scratch_source, extension_name);
backend_name = e_source_backend_get_backend_name (extension);
@@ -610,6 +612,8 @@ mail_config_service_page_setup_defaults (EMailConfigPage *page)
guint ii;
class = E_MAIL_CONFIG_SERVICE_PAGE_GET_CLASS (page);
+ g_return_if_fail (class != NULL);
+
priv = E_MAIL_CONFIG_SERVICE_PAGE_GET_PRIVATE (page);
for (ii = 0; ii < priv->candidates->len; ii++) {
diff --git a/src/mail/e-mail-display.c b/src/mail/e-mail-display.c
index 65506ed..5a1fd7a 100644
--- a/src/mail/e-mail-display.c
+++ b/src/mail/e-mail-display.c
@@ -961,7 +961,6 @@ mail_display_attachment_inline_update_actions (EMailDisplay *display)
EAttachmentView *view;
guint n_shown = 0;
guint n_hidden = 0;
- guint n_selected = 0;
gboolean can_show = FALSE;
gboolean shown = FALSE;
gboolean is_image = FALSE;
@@ -993,9 +992,8 @@ mail_display_attachment_inline_update_actions (EMailDisplay *display)
view = e_mail_display_get_attachment_view (display);
attachments = view ? e_attachment_view_get_selected_attachments (view) : NULL;
- n_selected = g_list_length (attachments);
- if (n_selected == 1) {
+ if (attachments && attachments->data && !attachments->next) {
EAttachment *attachment;
gchar *mime_type;
guint32 flags;
diff --git a/src/mail/e-mail-migrate.c b/src/mail/e-mail-migrate.c
index 8a06952..e0c9f6d 100644
--- a/src/mail/e-mail-migrate.c
+++ b/src/mail/e-mail-migrate.c
@@ -89,7 +89,8 @@ cp (const gchar *src,
gboolean show_progress,
gint mode)
{
- guchar readbuf[65536];
+ const gint nreadbuf = 65535;
+ guchar *readbuf = NULL;
gssize nread, nwritten;
gint errnosav, readfd, writefd;
gsize total = 0;
@@ -114,9 +115,10 @@ cp (const gchar *src,
return FALSE;
}
+ readbuf = g_new0 (guchar, nreadbuf);
do {
do {
- nread = read (readfd, readbuf, sizeof (readbuf));
+ nread = read (readfd, readbuf, nreadbuf);
} while (nread == -1 && errno == EINTR);
if (nread == 0)
@@ -152,6 +154,8 @@ cp (const gchar *src,
g_warning ("%s: Failed to chmod '%s': %s", G_STRFUNC, dest, g_strerror (errno));
}
+ g_free (readbuf);
+
return TRUE;
exception:
@@ -167,6 +171,8 @@ cp (const gchar *src,
unlink (dest);
errno = errnosav;
+ g_free (readbuf);
+
return FALSE;
}
@@ -198,11 +204,12 @@ emm_setup_initial (const gchar *data_dir)
if (g_file_test (local, G_FILE_TEST_EXISTS))
break;
g_free (local);
+ local = NULL;
language_names++;
}
/* Make sure we found one. */
- g_return_val_if_fail (*language_names != NULL, FALSE);
+ g_return_val_if_fail (local != NULL, FALSE);
dir = g_dir_open (local, 0, NULL);
if (dir) {
diff --git a/src/mail/e-mail-paned-view.c b/src/mail/e-mail-paned-view.c
index bdd197c..228be05 100644
--- a/src/mail/e-mail-paned-view.c
+++ b/src/mail/e-mail-paned-view.c
@@ -1098,19 +1098,19 @@ mail_paned_view_update_view_instance (EMailView *view)
folder, "et-header-");
if (g_file_test (state_filename, G_FILE_TEST_IS_REGULAR)) {
- GalView *view;
+ GalView *gal_view;
- view = gal_view_etable_new ("");
+ gal_view = gal_view_etable_new ("");
/* XXX This only stashes the filename in the view.
* The state file is not actually loaded until
* the MessageList is attached to the view. */
- gal_view_load (view, state_filename);
+ gal_view_load (gal_view, state_filename);
gal_view_instance_set_custom_view (
- view_instance, view);
+ view_instance, gal_view);
- g_object_unref (view);
+ g_object_unref (gal_view);
}
g_free (state_filename);
diff --git a/src/mail/e-mail-reader-utils.c b/src/mail/e-mail-reader-utils.c
index 9ac8c9e..cc8bd28 100644
--- a/src/mail/e-mail-reader-utils.c
+++ b/src/mail/e-mail-reader-utils.c
@@ -1109,7 +1109,7 @@ insert_to_checked_msgids (GHashTable *checked_msgids,
static gboolean
mark_ignore_thread_traverse_uids (CamelFolder *folder,
- const gchar *uid,
+ const gchar *in_uid,
GHashTable *checked_uids,
GHashTable *checked_msgids,
gboolean whole_thread,
@@ -1126,10 +1126,10 @@ mark_ignore_thread_traverse_uids (CamelFolder *folder,
if (!success)
return success;
- if (g_hash_table_contains (checked_uids, uid))
+ if (g_hash_table_contains (checked_uids, in_uid))
return success;
- to_check = g_slist_prepend (NULL, (gpointer) camel_pstring_strdup (uid));
+ to_check = g_slist_prepend (NULL, (gpointer) camel_pstring_strdup (in_uid));
while (to_check != NULL && !g_cancellable_set_error_if_cancelled (cancellable, error)) {
CamelMessageInfo *mi;
diff --git a/src/mail/e-mail-reader.c b/src/mail/e-mail-reader.c
index 3500656..e24ec5d 100644
--- a/src/mail/e-mail-reader.c
+++ b/src/mail/e-mail-reader.c
@@ -203,8 +203,8 @@ action_mail_add_sender_cb (GtkAction *action,
photo_cache = e_mail_ui_session_get_photo_cache (
E_MAIL_UI_SESSION (session));
- camel_internet_address_get (cia, 0, NULL, &address_only);
- e_photo_cache_remove_photo (photo_cache, address_only);
+ if (camel_internet_address_get (cia, 0, NULL, &address_only))
+ e_photo_cache_remove_photo (photo_cache, address_only);
}
g_object_unref (cia);
@@ -268,8 +268,8 @@ action_add_to_address_book_cb (GtkAction *action,
/* Remove this address from the photo cache. */
photo_cache = e_mail_ui_session_get_photo_cache (
E_MAIL_UI_SESSION (session));
- camel_internet_address_get (cia, 0, NULL, &address_only);
- e_photo_cache_remove_photo (photo_cache, address_only);
+ if (camel_internet_address_get (cia, 0, NULL, &address_only))
+ e_photo_cache_remove_photo (photo_cache, address_only);
g_object_unref (cia);
@@ -3056,7 +3056,7 @@ mail_reader_load_changed_cb (EMailReader *reader,
}
}
-static gboolean
+static void
maybe_schedule_timeout_mark_seen (EMailReader *reader)
{
EMailReaderPrivate *priv;
@@ -3071,7 +3071,7 @@ maybe_schedule_timeout_mark_seen (EMailReader *reader)
message_uid = message_list->cursor_uid;
if (message_uid == NULL ||
e_tree_is_dragging (E_TREE (message_list)))
- return FALSE;
+ return;
settings = e_util_ref_settings ("org.gnome.evolution.mail");
@@ -3091,8 +3091,6 @@ maybe_schedule_timeout_mark_seen (EMailReader *reader)
priv = E_MAIL_READER_GET_PRIVATE (reader);
priv->schedule_mark_seen = schedule_timeout;
priv->schedule_mark_seen_interval = timeout_interval;
-
- return schedule_timeout;
}
static gboolean
@@ -3707,7 +3705,6 @@ mail_reader_message_loaded (EMailReader *reader,
EShell *shell;
EMEvent *event;
EMEventTargetMessage *target;
- GError *error = NULL;
priv = E_MAIL_READER_GET_PRIVATE (reader);
@@ -3745,16 +3742,8 @@ mail_reader_message_loaded (EMailReader *reader,
/* Determine whether to mark the message as read. */
if (message != NULL &&
- !priv->avoid_next_mark_as_seen &&
- maybe_schedule_timeout_mark_seen (reader)) {
- g_clear_error (&error);
- } else if (error != NULL) {
- e_alert_submit (
- E_ALERT_SINK (display),
- "mail:no-retrieve-message",
- error->message, NULL);
- g_error_free (error);
- }
+ !priv->avoid_next_mark_as_seen)
+ maybe_schedule_timeout_mark_seen (reader);
priv->avoid_next_mark_as_seen = FALSE;
diff --git a/src/mail/e-mail-sidebar.c b/src/mail/e-mail-sidebar.c
index d6d6e59..92ee867 100644
--- a/src/mail/e-mail-sidebar.c
+++ b/src/mail/e-mail-sidebar.c
@@ -644,6 +644,7 @@ e_mail_sidebar_check_state (EMailSidebar *sidebar)
g_return_val_if_fail (E_IS_MAIL_SIDEBAR (sidebar), 0);
class = E_MAIL_SIDEBAR_GET_CLASS (sidebar);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->check_state != NULL, 0);
return class->check_state (sidebar);
diff --git a/src/mail/e-mail-templates-store.c b/src/mail/e-mail-templates-store.c
index 9d41e41..ba830ee 100644
--- a/src/mail/e-mail-templates-store.c
+++ b/src/mail/e-mail-templates-store.c
@@ -1404,7 +1404,7 @@ tmpl_store_data_notify_display_name_cb (CamelService *service,
}
static gchar *
-templates_store_find_custom_templates_root_folder_path (EMailTemplatesStore *templates_store,
+templates_store_find_custom_templates_root_folder_path (EMailTemplatesStore *mail_templates_store,
CamelStore *store,
EMailSession *mail_session,
ESource **out_identity_source,
@@ -1414,7 +1414,7 @@ templates_store_find_custom_templates_root_folder_path (EMailTemplatesStore *tem
ESource *identity_source;
gchar *root_folder_path = NULL;
- g_return_val_if_fail (E_IS_MAIL_TEMPLATES_STORE (templates_store), NULL);
+ g_return_val_if_fail (E_IS_MAIL_TEMPLATES_STORE (mail_templates_store), NULL);
g_return_val_if_fail (CAMEL_IS_STORE (store), NULL);
g_return_val_if_fail (out_identity_source != NULL, NULL);
g_return_val_if_fail (out_use_store != NULL, NULL);
diff --git a/src/mail/e-mail-ui-session.c b/src/mail/e-mail-ui-session.c
index 2b85f70..93eab27 100644
--- a/src/mail/e-mail-ui-session.c
+++ b/src/mail/e-mail-ui-session.c
@@ -1159,8 +1159,7 @@ e_mail_ui_session_check_known_address_sync (EMailUISession *session,
g_return_val_if_fail (E_IS_MAIL_UI_SESSION (session), FALSE);
g_return_val_if_fail (CAMEL_IS_INTERNET_ADDRESS (addr), FALSE);
-
- camel_internet_address_get (addr, 0, NULL, &email_address);
+ g_return_val_if_fail (camel_internet_address_get (addr, 0, NULL, &email_address), FALSE);
g_return_val_if_fail (email_address != NULL, FALSE);
g_mutex_lock (&session->priv->address_cache_mutex);
diff --git a/src/mail/e-mail-view.c b/src/mail/e-mail-view.c
index a9a752f..6e3cb04 100644
--- a/src/mail/e-mail-view.c
+++ b/src/mail/e-mail-view.c
@@ -393,6 +393,7 @@ e_mail_view_update_view_instance (EMailView *view)
g_return_if_fail (E_IS_MAIL_VIEW (view));
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->update_view_instance != NULL);
class->update_view_instance (view);
@@ -406,6 +407,7 @@ e_mail_view_get_view_instance (EMailView *view)
g_return_val_if_fail (E_IS_MAIL_VIEW (view), NULL);
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_view_instance != NULL, NULL);
return class->get_view_instance (view);
@@ -420,6 +422,7 @@ e_mail_view_set_search_strings (EMailView *view,
g_return_if_fail (E_IS_MAIL_VIEW (view));
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_search_strings != NULL);
class->set_search_strings (view, search_strings);
@@ -433,6 +436,7 @@ e_mail_view_get_orientation (EMailView *view)
g_return_val_if_fail (E_IS_MAIL_VIEW (view), 0);
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (class != NULL, 0);
g_return_val_if_fail (class->get_orientation != NULL, 0);
return class->get_orientation (view);
@@ -447,6 +451,7 @@ e_mail_view_set_orientation (EMailView *view,
g_return_if_fail (E_IS_MAIL_VIEW (view));
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_orientation != NULL);
class->set_orientation (view, orientation);
@@ -460,6 +465,7 @@ e_mail_view_get_preview_visible (EMailView *view)
g_return_val_if_fail (E_IS_MAIL_VIEW (view), FALSE);
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->get_preview_visible != NULL, FALSE);
return class->get_preview_visible (view);
@@ -474,6 +480,7 @@ e_mail_view_set_preview_visible (EMailView *view,
g_return_if_fail (E_IS_MAIL_VIEW (view));
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_preview_visible != NULL);
class->set_preview_visible (view, visible);
@@ -517,6 +524,7 @@ e_mail_view_get_show_deleted (EMailView *view)
g_return_val_if_fail (E_IS_MAIL_VIEW (view), FALSE);
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->get_show_deleted != NULL, FALSE);
return class->get_show_deleted (view);
@@ -531,6 +539,7 @@ e_mail_view_set_show_deleted (EMailView *view,
g_return_if_fail (E_IS_MAIL_VIEW (view));
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_show_deleted != NULL);
class->set_show_deleted (view, show_deleted);
@@ -544,6 +553,7 @@ e_mail_view_get_show_junk (EMailView *view)
g_return_val_if_fail (E_IS_MAIL_VIEW (view), FALSE);
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_val_if_fail (class != NULL, FALSE);
g_return_val_if_fail (class->get_show_junk != NULL, FALSE);
return class->get_show_junk (view);
@@ -558,6 +568,7 @@ e_mail_view_set_show_junk (EMailView *view,
g_return_if_fail (E_IS_MAIL_VIEW (view));
class = E_MAIL_VIEW_GET_CLASS (view);
+ g_return_if_fail (class != NULL);
g_return_if_fail (class->set_show_junk != NULL);
class->set_show_junk (view, show_junk);
diff --git a/src/mail/em-composer-utils.c b/src/mail/em-composer-utils.c
index 2aaa369..8ddb5aa 100644
--- a/src/mail/em-composer-utils.c
+++ b/src/mail/em-composer-utils.c
@@ -3226,8 +3226,8 @@ em_utils_get_reply_all (ESourceRegistry *registry,
/* Promote the first Cc: address to To: if To: is empty. */
if (camel_address_length ((CamelAddress *) to) == 0 &&
camel_address_length ((CamelAddress *) cc) > 0) {
- camel_internet_address_get (cc, 0, &name, &addr);
- camel_internet_address_add (to, name, addr);
+ if (camel_internet_address_get (cc, 0, &name, &addr))
+ camel_internet_address_add (to, name, addr);
camel_address_remove ((CamelAddress *) cc, 0);
}
@@ -3274,21 +3274,23 @@ format_sender (GString *str,
sender = camel_mime_message_get_from (message);
if (sender != NULL && camel_address_length (CAMEL_ADDRESS (sender)) > 0) {
- camel_internet_address_get (sender, 0, &name, &addr);
-
- if (name && !*name) {
- name = NULL;
- } else if (name && *name == '\"') {
- gint len = strlen (name);
+ name = NULL;
- if (len == 1) {
+ if (camel_internet_address_get (sender, 0, &name, &addr)) {
+ if (name && !*name) {
name = NULL;
- } else if (len > 1 && name[len - 1] == '\"') {
- if (len == 2) {
+ } else if (name && *name == '\"') {
+ gint len = strlen (name);
+
+ if (len == 1) {
name = NULL;
- } else {
- tmp = g_strndup (name + 1, len - 2);
- name = tmp;
+ } else if (len > 1 && name[len - 1] == '\"') {
+ if (len == 2) {
+ name = NULL;
+ } else {
+ tmp = g_strndup (name + 1, len - 2);
+ name = tmp;
+ }
}
}
}
diff --git a/src/mail/em-folder-tree.c b/src/mail/em-folder-tree.c
index 2314b5e..3a9dd2e 100644
--- a/src/mail/em-folder-tree.c
+++ b/src/mail/em-folder-tree.c
@@ -1748,9 +1748,9 @@ em_folder_tree_set_selectable_widget (EMFolderTree *folder_tree,
static void
folder_tree_selectable_update_actions (ESelectable *selectable,
- EFocusTracker *focus_tracker,
- GdkAtom *clipboard_targets,
- gint n_clipboard_targets)
+ EFocusTracker *focus_tracker,
+ GdkAtom *clipboard_targets,
+ gint n_clipboard_targets)
{
EMFolderTree *folder_tree;
@@ -1759,14 +1759,15 @@ folder_tree_selectable_update_actions (ESelectable *selectable,
if (folder_tree->priv->selectable != NULL) {
ESelectableInterface *iface;
- ESelectable *selectable;
+ ESelectable *inner_selectable;
- selectable = E_SELECTABLE (folder_tree->priv->selectable);
- iface = E_SELECTABLE_GET_INTERFACE (selectable);
+ inner_selectable = E_SELECTABLE (folder_tree->priv->selectable);
+ iface = E_SELECTABLE_GET_INTERFACE (inner_selectable);
+ g_return_if_fail (iface != NULL);
g_return_if_fail (iface->update_actions != NULL);
iface->update_actions (
- selectable, focus_tracker,
+ inner_selectable, focus_tracker,
clipboard_targets, n_clipboard_targets);
}
}
@@ -3308,8 +3309,8 @@ folder_tree_descend (GtkTreeModel *model,
if (n_children == 0)
return gtk_tree_model_get_iter_first (model, iter);
- gtk_tree_model_iter_nth_child (
- model, &parent, NULL, n_children - 1);
+ if (!gtk_tree_model_iter_nth_child (model, &parent, NULL, n_children - 1))
+ return FALSE;
} else
parent = *root;
@@ -3318,8 +3319,8 @@ folder_tree_descend (GtkTreeModel *model,
while (n_children > 0) {
GtkTreeIter child;
- gtk_tree_model_iter_nth_child (
- model, &child, &parent, n_children - 1);
+ if (!gtk_tree_model_iter_nth_child (model, &child, &parent, n_children - 1))
+ break;
parent = child;
diff --git a/src/mail/mail-autofilter.c b/src/mail/mail-autofilter.c
index 7cec5ac..c1f5b28 100644
--- a/src/mail/mail-autofilter.c
+++ b/src/mail/mail-autofilter.c
@@ -210,21 +210,22 @@ rule_from_address (EFilterRule *rule,
rule->grouping = E_FILTER_GROUP_ALL;
if (flags & AUTO_FROM) {
- const gchar *name, *address;
+ const gchar *name = NULL, *address = NULL;
gchar *namestr;
- camel_internet_address_get (addr, 0, &name, &address);
- rule_add_sender (context, rule, address);
- if (name == NULL || name[0] == '\0')
- name = address;
- namestr = g_strdup_printf (_("Mail from %s"), name);
- e_filter_rule_set_name (rule, namestr);
- g_free (namestr);
+ if (camel_internet_address_get (addr, 0, &name, &address)) {
+ rule_add_sender (context, rule, address);
+ if (name == NULL || name[0] == '\0')
+ name = address;
+ namestr = g_strdup_printf (_("Mail from %s"), name);
+ e_filter_rule_set_name (rule, namestr);
+ g_free (namestr);
+ }
}
+
if (flags & AUTO_TO) {
rule_match_recipients (context, rule, addr);
}
-
}
static void
diff --git a/src/mail/message-list.c b/src/mail/message-list.c
index 8fb54e9..52165bd 100644
--- a/src/mail/message-list.c
+++ b/src/mail/message-list.c
@@ -6142,8 +6142,9 @@ message_list_regen_thread (GSimpleAsyncResult *simple,
if (local_error == NULL) {
/* coverity[unchecked_value] */
- g_cancellable_set_error_if_cancelled (
- cancellable, &local_error);
+ if (g_cancellable_set_error_if_cancelled (cancellable, &local_error)) {
+ ;
+ }
}
if (local_error != NULL) {
diff --git a/src/modules/itip-formatter/itip-view.c b/src/modules/itip-formatter/itip-view.c
index f502a61..8d9434f 100644
--- a/src/modules/itip-formatter/itip-view.c
+++ b/src/modules/itip-formatter/itip-view.c
@@ -86,12 +86,12 @@ struct _ItipViewPrivate {
gchar *comment;
struct tm *start_tm;
- gint start_tm_is_date : 1;
+ guint start_tm_is_date : 1;
gchar *start_label;
const gchar *start_header;
struct tm *end_tm;
- gint end_tm_is_date : 1;
+ guint end_tm_is_date : 1;
gchar *end_label;
const gchar *end_header;
@@ -102,11 +102,11 @@ struct _ItipViewPrivate {
gchar *description;
- gint buttons_sensitive : 1;
+ guint buttons_sensitive : 1;
gboolean is_recur_set;
- gint needs_decline : 1;
+ guint needs_decline : 1;
gpointer itip_part_ptr; /* not referenced, only for a "reference" to which part this belongs */
@@ -4538,9 +4538,9 @@ message_foreach_part (CamelMimePart *part,
parts = camel_multipart_get_number (CAMEL_MULTIPART (containee));
for (i = 0; go && i < parts; i++) {
/* Reuse already declared *parts? */
- CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
+ CamelMimePart *subpart = camel_multipart_get_part (CAMEL_MULTIPART (containee), i);
- message_foreach_part (part, part_list);
+ message_foreach_part (subpart, part_list);
}
} else if (CAMEL_IS_MIME_MESSAGE (containee)) {
message_foreach_part ((CamelMimePart *) containee, part_list);
diff --git a/src/modules/mail/e-mail-shell-backend.c b/src/modules/mail/e-mail-shell-backend.c
index 99e5aae..7faf964 100644
--- a/src/modules/mail/e-mail-shell-backend.c
+++ b/src/modules/mail/e-mail-shell-backend.c
@@ -656,11 +656,12 @@ mail_shell_backend_changes_committed_cb (EMailConfigWindow *window,
/* Find an EShellWindow to serve as an EAlertSink. */
for (link = list; link != NULL; link = g_list_next (link)) {
- GtkWindow *window = GTK_WINDOW (link->data);
+ GtkWindow *appwindow = GTK_WINDOW (link->data);
- if (E_IS_SHELL_WINDOW (window)) {
- EAlertSink *alert_sink = E_ALERT_SINK (window);
+ if (E_IS_SHELL_WINDOW (appwindow)) {
+ EAlertSink *alert_sink = E_ALERT_SINK (appwindow);
e_activity_set_alert_sink (activity, alert_sink);
+ break;
}
}
diff --git a/src/modules/mail/e-mail-shell-view-actions.c b/src/modules/mail/e-mail-shell-view-actions.c
index d1da9fb..73988f8 100644
--- a/src/modules/mail/e-mail-shell-view-actions.c
+++ b/src/modules/mail/e-mail-shell-view-actions.c
@@ -1265,7 +1265,7 @@ action_mail_label_new_cb (GtkAction *action,
* probably needs some rethinking. */
model = GTK_TREE_MODEL (label_store);
n_children = gtk_tree_model_iter_n_children (model, NULL);
- gtk_tree_model_iter_nth_child (model, &iter, NULL, n_children - 1);
+ g_warn_if_fail (gtk_tree_model_iter_nth_child (model, &iter, NULL, n_children - 1));
label_tag = e_mail_label_list_store_get_tag (label_store, &iter);
mail_shell_content = mail_shell_view->priv->mail_shell_content;
diff --git a/src/modules/text-highlight/e-mail-formatter-text-highlight.c
b/src/modules/text-highlight/e-mail-formatter-text-highlight.c
index a46a246..51d4dc2 100644
--- a/src/modules/text-highlight/e-mail-formatter-text-highlight.c
+++ b/src/modules/text-highlight/e-mail-formatter-text-highlight.c
@@ -121,16 +121,19 @@ static gpointer
text_hightlight_read_data_thread (gpointer user_data)
{
TextHighlightClosure *closure = user_data;
- gchar buffer[10240];
+ gint nbuffer = 10240;
+ gchar *buffer;
g_return_val_if_fail (closure != NULL, NULL);
+ buffer = g_new (gchar, nbuffer);
+
while (!camel_stream_eos (closure->read_stream) &&
!g_cancellable_set_error_if_cancelled (closure->cancellable, &closure->error)) {
gssize read;
gsize wrote = 0;
- read = camel_stream_read (closure->read_stream, buffer, 10240, closure->cancellable,
&closure->error);
+ read = camel_stream_read (closure->read_stream, buffer, nbuffer, closure->cancellable,
&closure->error);
if (read < 0 || closure->error)
break;
@@ -141,6 +144,8 @@ text_hightlight_read_data_thread (gpointer user_data)
break;
}
+ g_free (buffer);
+
return NULL;
}
diff --git a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
index f3d5845..a835850 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
@@ -5864,7 +5864,7 @@ body_compositionend_event_cb (WebKitDOMElement *element,
static void
body_drop_event_cb (WebKitDOMElement *element,
- WebKitDOMUIEvent *event,
+ WebKitDOMUIEvent *dom_ui_event,
EEditorPage *editor_page)
{
g_return_if_fail (E_IS_EDITOR_PAGE (editor_page));
diff --git a/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
b/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
index b91207d..1ead32d 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c
@@ -139,9 +139,11 @@ print_history_event (EEditorHistoryEvent *event)
printf (" type: backspace\n");
if (g_object_get_data (G_OBJECT (event->data.fragment), "history-control-key"))
printf (" control\n");
+ /* fall through */
case HISTORY_INPUT:
if (event->data.fragment && g_object_get_data (G_OBJECT (event->data.fragment),
"history-return-key"))
printf (" type: return\n");
+ /* fall through */
case HISTORY_REMOVE_LINK:
case HISTORY_SMILEY:
case HISTORY_IMAGE:
@@ -189,6 +191,7 @@ print_history_event (EEditorHistoryEvent *event)
break;
default:
printf (" Unknown history type\n");
+ break;
}
}
@@ -1739,7 +1742,9 @@ undo_redo_replace_all (EEditorUndoRedoManager *manager,
next_item = next_item->next;
}
- manager->priv->history = next_item->prev;
+ g_warn_if_fail (next_item != NULL);
+
+ manager->priv->history = next_item ? next_item->prev : NULL;
dom_window = webkit_dom_document_get_default_view (document);
dom_selection = webkit_dom_dom_window_get_selection (dom_window);
diff --git a/src/plugins/dbx-import/dbx-importer.c b/src/plugins/dbx-import/dbx-importer.c
index c372bbf..e6ef30a 100644
--- a/src/plugins/dbx-import/dbx-importer.c
+++ b/src/plugins/dbx-import/dbx-importer.c
@@ -454,6 +454,7 @@ dbx_read_mail_body (DbxImporter *m,
CAMEL_ERROR, CAMEL_ERROR_GENERIC,
"Failed to read mail data block from "
"DBX file at offset %x", offset);
+ g_free (buffer);
return FALSE;
}
hdr.self = GUINT32_FROM_LE (hdr.self);
@@ -466,6 +467,7 @@ dbx_read_mail_body (DbxImporter *m,
CAMEL_ERROR, CAMEL_ERROR_GENERIC,
"Corrupt DBX file: Mail data block at "
"0x%x does not point to itself", offset);
+ g_free (buffer);
return FALSE;
}
@@ -482,6 +484,7 @@ dbx_read_mail_body (DbxImporter *m,
"Failed to read mail data from DBX file "
"at offset %lx",
(long)(offset + sizeof (hdr)));
+ g_free (buffer);
return FALSE;
}
if (write (bodyfd, buffer, hdr.blocksize) != hdr.blocksize) {
@@ -489,10 +492,14 @@ dbx_read_mail_body (DbxImporter *m,
&m->base.error,
CAMEL_ERROR, CAMEL_ERROR_GENERIC,
"Failed to write mail data to temporary file");
+ g_free (buffer);
return FALSE;
}
offset = hdr.nextaddress;
}
+
+ g_free (buffer);
+
return TRUE;
}
diff --git a/src/shell/e-shell-backend.c b/src/shell/e-shell-backend.c
index 01b4fc0..dd74c77 100644
--- a/src/shell/e-shell-backend.c
+++ b/src/shell/e-shell-backend.c
@@ -86,6 +86,7 @@ shell_backend_debug_list_activities (EShellBackend *shell_backend)
guint n_activities;
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_if_fail (class != NULL);
n_activities = g_queue_get_length (shell_backend->priv->activities);
@@ -190,6 +191,8 @@ shell_backend_constructor (GType type,
/* Install a reference to ourselves in the
* corresponding EShellViewClass structure. */
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_val_if_fail (class != NULL, object);
+
shell_view_class = g_type_class_ref (class->shell_view_type);
shell_view_class->shell_backend = g_object_ref (shell_backend);
shell_backend->priv->shell_view_class = shell_view_class;
@@ -289,6 +292,7 @@ shell_backend_get_config_dir (EShellBackend *shell_backend)
EShellBackendClass *class;
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_val_if_fail (class != NULL, NULL);
/* Determine the user config directory for this backend. */
if (G_UNLIKELY (shell_backend->priv->config_dir == NULL)) {
@@ -309,6 +313,7 @@ shell_backend_get_data_dir (EShellBackend *shell_backend)
EShellBackendClass *class;
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_val_if_fail (class != NULL, NULL);
/* Determine the user data directory for this backend. */
if (G_UNLIKELY (shell_backend->priv->data_dir == NULL)) {
@@ -416,10 +421,19 @@ gint
e_shell_backend_compare (EShellBackend *shell_backend_a,
EShellBackend *shell_backend_b)
{
- gint a = E_SHELL_BACKEND_GET_CLASS (shell_backend_a)->sort_order;
- gint b = E_SHELL_BACKEND_GET_CLASS (shell_backend_b)->sort_order;
+ EShellBackendClass *a_klass, *b_klass;
+ gint aa, bb;
+
+ a_klass = E_SHELL_BACKEND_GET_CLASS (shell_backend_a);
+ b_klass = E_SHELL_BACKEND_GET_CLASS (shell_backend_b);
+
+ g_return_val_if_fail (a_klass != NULL, 0);
+ g_return_val_if_fail (b_klass != NULL, 0);
+
+ aa = a_klass->sort_order;
+ bb = b_klass->sort_order;
- return (a < b) ? -1 : (a > b);
+ return (aa < bb) ? -1 : (aa > bb) ? 1 : 0;
}
/**
@@ -440,6 +454,7 @@ e_shell_backend_get_config_dir (EShellBackend *shell_backend)
g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), NULL);
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_config_dir != NULL, NULL);
return class->get_config_dir (shell_backend);
@@ -463,6 +478,7 @@ e_shell_backend_get_data_dir (EShellBackend *shell_backend)
g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), NULL);
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_data_dir != NULL, NULL);
return class->get_data_dir (shell_backend);
@@ -644,6 +660,7 @@ e_shell_backend_start (EShellBackend *shell_backend)
return;
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_if_fail (class != NULL);
if (class->start != NULL)
class->start (shell_backend);
@@ -693,6 +710,7 @@ e_shell_backend_migrate (EShellBackend *shell_backend,
g_return_val_if_fail (E_IS_SHELL_BACKEND (shell_backend), TRUE);
class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_val_if_fail (class != NULL, TRUE);
if (class->migrate == NULL)
return TRUE;
diff --git a/src/shell/e-shell-content.c b/src/shell/e-shell-content.c
index aee5707..5dc46c5 100644
--- a/src/shell/e-shell-content.c
+++ b/src/shell/e-shell-content.c
@@ -541,6 +541,7 @@ e_shell_content_check_state (EShellContent *shell_content)
g_return_val_if_fail (E_IS_SHELL_CONTENT (shell_content), 0);
shell_content_class = E_SHELL_CONTENT_GET_CLASS (shell_content);
+ g_return_val_if_fail (shell_content_class != NULL, 0);
g_return_val_if_fail (shell_content_class->check_state != NULL, 0);
return shell_content_class->check_state (shell_content);
@@ -564,6 +565,7 @@ e_shell_content_focus_search_results (EShellContent *shell_content)
g_return_if_fail (E_IS_SHELL_CONTENT (shell_content));
shell_content_class = E_SHELL_CONTENT_GET_CLASS (shell_content);
+ g_return_if_fail (shell_content_class != NULL);
if (shell_content_class->focus_search_results != NULL)
shell_content_class->focus_search_results (shell_content);
diff --git a/src/shell/e-shell-sidebar.c b/src/shell/e-shell-sidebar.c
index 0d3ae3d..d6b3141 100644
--- a/src/shell/e-shell-sidebar.c
+++ b/src/shell/e-shell-sidebar.c
@@ -538,6 +538,7 @@ e_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
g_return_val_if_fail (E_IS_SHELL_SIDEBAR (shell_sidebar), 0);
shell_sidebar_class = E_SHELL_SIDEBAR_GET_CLASS (shell_sidebar);
+ g_return_val_if_fail (shell_sidebar_class != NULL, 0);
g_return_val_if_fail (shell_sidebar_class->check_state != NULL, 0);
return shell_sidebar_class->check_state (shell_sidebar);
diff --git a/src/shell/e-shell-switcher.c b/src/shell/e-shell-switcher.c
index 4f117d7..db1e63a 100644
--- a/src/shell/e-shell-switcher.c
+++ b/src/shell/e-shell-switcher.c
@@ -124,10 +124,13 @@ shell_switcher_layout_actions (EShellSwitcher *switcher)
btns_per_row--;
}
+ if (btns_per_row <= 0)
+ btns_per_row = 1;
+
/* Assign buttons to rows. */
rows = g_new0 (GList *, num_btns / btns_per_row + 1);
- if (!icons_only && num_btns % btns_per_row != 0) {
+ if (!icons_only && num_btns % btns_per_row != 0 && switcher->priv->proxies) {
rows[0] = g_list_append (rows[0], switcher->priv->proxies->data);
p = switcher->priv->proxies->next;
@@ -290,7 +293,7 @@ shell_switcher_get_preferred_width (GtkWidget *widget,
}
static void
-shell_switcher_get_preferred_height (GtkWidget *widget,
+shell_switcher_get_preferred_height (GtkWidget *switcher_widget,
gint *minimum,
gint *natural)
{
@@ -298,11 +301,11 @@ shell_switcher_get_preferred_height (GtkWidget *widget,
GtkWidget *child;
GList *iter;
- priv = E_SHELL_SWITCHER_GET_PRIVATE (widget);
+ priv = E_SHELL_SWITCHER_GET_PRIVATE (switcher_widget);
*minimum = *natural = 0;
- child = gtk_bin_get_child (GTK_BIN (widget));
+ child = gtk_bin_get_child (GTK_BIN (switcher_widget));
if (child != NULL)
gtk_widget_get_preferred_height (child, minimum, natural);
@@ -389,7 +392,7 @@ shell_switcher_screen_changed (GtkWidget *widget,
static void
shell_switcher_remove (GtkContainer *container,
- GtkWidget *widget)
+ GtkWidget *remove_widget)
{
EShellSwitcherPrivate *priv;
GList *link;
@@ -398,7 +401,7 @@ shell_switcher_remove (GtkContainer *container,
/* Look in the internal widgets first. */
- link = g_list_find (priv->proxies, widget);
+ link = g_list_find (priv->proxies, remove_widget);
if (link != NULL) {
GtkWidget *widget = link->data;
@@ -410,7 +413,7 @@ shell_switcher_remove (GtkContainer *container,
/* Chain up to parent's remove() method. */
GTK_CONTAINER_CLASS (e_shell_switcher_parent_class)->remove (
- container, widget);
+ container, remove_widget);
}
static void
diff --git a/src/shell/e-shell-view.c b/src/shell/e-shell-view.c
index 66bcc2c..be5530d 100644
--- a/src/shell/e-shell-view.c
+++ b/src/shell/e-shell-view.c
@@ -153,6 +153,7 @@ static void
shell_view_init_view_collection (EShellViewClass *class)
{
EShellBackend *shell_backend;
+ EShellBackendClass *backend_class;
const gchar *base_directory;
const gchar *name;
gchar *system_directory;
@@ -160,7 +161,11 @@ shell_view_init_view_collection (EShellViewClass *class)
shell_backend = class->shell_backend;
g_return_if_fail (E_IS_SHELL_BACKEND (shell_backend));
- name = E_SHELL_BACKEND_GET_CLASS (shell_backend)->name;
+
+ backend_class = E_SHELL_BACKEND_GET_CLASS (shell_backend);
+ g_return_if_fail (backend_class != NULL);
+
+ name = backend_class->name;
base_directory = EVOLUTION_GALVIEWSDIR;
system_directory = g_build_filename (base_directory, name, NULL);
@@ -598,6 +603,7 @@ shell_view_constructed (GObject *object)
shell_view = E_SHELL_VIEW (object);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_if_fail (shell_view_class != NULL);
shell_backend = e_shell_view_get_shell_backend (shell_view);
shell = e_shell_backend_get_shell (shell_backend);
@@ -653,6 +659,8 @@ shell_view_construct_searchbar (EShellView *shell_view)
shell_content = e_shell_view_get_shell_content (shell_view);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_val_if_fail (shell_view_class != NULL, NULL);
+
widget = shell_view_class->new_shell_searchbar (shell_view);
e_shell_content_set_searchbar (shell_content, widget);
gtk_widget_show (widget);
@@ -690,6 +698,8 @@ shell_view_toggled (EShellView *shell_view)
gboolean view_is_active;
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_if_fail (shell_view_class != NULL);
+
shell_window = e_shell_view_get_shell_window (shell_view);
ui_manager = e_shell_window_get_ui_manager (shell_window);
view_is_active = e_shell_view_is_active (shell_view);
@@ -1210,8 +1220,12 @@ e_shell_view_set_title (EShellView *shell_view,
{
g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
- if (title == NULL)
- title = E_SHELL_VIEW_GET_CLASS (shell_view)->label;
+ if (!title) {
+ EShellViewClass *klass = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_if_fail (klass != NULL);
+
+ title = klass->label;
+ }
if (g_strcmp0 (shell_view->priv->title, title) == 0)
return;
@@ -1290,6 +1304,7 @@ e_shell_view_new_view_instance (EShellView *shell_view,
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_val_if_fail (class != NULL, NULL);
view_collection = class->view_collection;
@@ -1473,6 +1488,7 @@ e_shell_view_get_search_name (EShellView *shell_view)
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->get_search_name != NULL, NULL);
return class->get_search_name (shell_view);
@@ -1605,6 +1621,7 @@ e_shell_view_get_shell_backend (EShellView *shell_view)
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), NULL);
class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->shell_backend != NULL, NULL);
return class->shell_backend;
diff --git a/src/shell/e-shell-window.c b/src/shell/e-shell-window.c
index 829535d..3734898 100644
--- a/src/shell/e-shell-window.c
+++ b/src/shell/e-shell-window.c
@@ -1304,6 +1304,7 @@ e_shell_window_get_shell_view (EShellWindow *shell_window,
return shell_view;
class = E_SHELL_WINDOW_GET_CLASS (shell_window);
+ g_return_val_if_fail (class != NULL, NULL);
g_return_val_if_fail (class->create_shell_view != NULL, NULL);
shell_view = class->create_shell_view (shell_window, view_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]