diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 1d9091a..fefde1f 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -2316,8 +2316,6 @@ reply_to_calendar_comp (ESourceRegistry *registry, cleanup: - if (comp != NULL) - g_object_unref (comp); if (top_level != NULL) icalcomponent_free (top_level); diff --git a/e-util/e-color-chooser-widget.c b/e-util/e-color-chooser-widget.c index 530f199..2ebd044 100644 --- a/e-util/e-color-chooser-widget.c +++ b/e-util/e-color-chooser-widget.c @@ -203,6 +203,9 @@ find_swatch (GtkContainer *container) GtkWidget *widget = child->data; GtkWidget *swatch; + if (!widget) + continue; + if (GTK_IS_CONTAINER (widget)) { swatch = find_swatch (GTK_CONTAINER (widget)); diff --git a/e-util/test-html-editor-units.c b/e-util/test-html-editor-units.c index 4de3c7e..cfaff58 100644 --- a/e-util/test-html-editor-units.c +++ b/e-util/test-html-editor-units.c @@ -955,6 +955,7 @@ test_image_insert (TestFixture *fixture) gchar *image_data; gchar *image_data_base64; gsize image_data_length; + gboolean success; GError *error = NULL; if (!test_utils_process_commands (fixture, @@ -968,8 +969,9 @@ test_image_insert (TestFixture *fixture) uri = g_filename_to_uri (filename, NULL, &error); g_assert_no_error (error); - g_file_get_contents (filename, &image_data, &image_data_length, &error); + success = g_file_get_contents (filename, &image_data, &image_data_length, &error); g_assert_no_error (error); + g_assert (success); g_free (filename); diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 957b3dd..e536898 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -525,15 +525,15 @@ headers_collapsed_signal_cb (GDBusConnection *connection, GVariant *parameters, EMailDisplay *display) { - gboolean expanded; + gboolean collapsed = FALSE; if (g_strcmp0 (signal_name, "HeadersCollapsed") != 0) return; if (parameters) - g_variant_get (parameters, "(b)", &expanded); + g_variant_get (parameters, "(b)", &collapsed); - e_mail_display_set_headers_collapsed (display, expanded); + e_mail_display_set_headers_collapsed (display, collapsed); } static void diff --git a/mail/e-mail-free-form-exp.c b/mail/e-mail-free-form-exp.c index 39af793..da4bb6a 100644 --- a/mail/e-mail-free-form-exp.c +++ b/mail/e-mail-free-form-exp.c @@ -76,12 +76,9 @@ mail_ffe_build_header_sexp (const gchar *word, camel_sexp_encode_string (encoded_word, word); if (!header_names[1]) { - if (!sexp) - sexp = g_string_new (""); - } else if (!sexp) { - sexp = g_string_new ("(or "); + sexp = g_string_new (""); } else { - g_string_append (sexp, "(or "); + sexp = g_string_new ("(or "); } for (ii = 0; header_names[ii]; ii++) { diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c index ef28ddd..02aff51 100644 --- a/modules/calendar/e-cal-attachment-handler.c +++ b/modules/calendar/e-cal-attachment-handler.c @@ -347,7 +347,7 @@ attachment_handler_run_dialog (GtkWindow *parent, break; default: g_warn_if_reached (); - return; + goto exit; } shell_view = e_shell_window_get_shell_view (shell_window, diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 1feb1b8..594890a 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -2225,7 +2225,7 @@ e_cal_shell_content_update_filters (ECalShellContent *cal_shell_content, hide_completed_tasks_sexp = calendar_config_get_hide_completed_tasks_sexp (FALSE); if (hide_completed_tasks_sexp != NULL) { - if (cal_filter != NULL) { + if (*cal_filter) { gchar *filter; filter = g_strdup_printf ("(and %s %s)", hide_completed_tasks_sexp, cal_filter); @@ -2235,7 +2235,7 @@ e_cal_shell_content_update_filters (ECalShellContent *cal_shell_content, cal_shell_content_update_model_filter (data_model, model, hide_completed_tasks_sexp, 0, 0); } } else { - cal_shell_content_update_model_filter (data_model, model, cal_filter ? cal_filter : "#t", 0, 0); + cal_shell_content_update_model_filter (data_model, model, *cal_filter ? cal_filter : "#t", 0, 0); } g_free (hide_completed_tasks_sexp); @@ -2275,7 +2275,7 @@ e_cal_shell_content_update_filters (ECalShellContent *cal_shell_content, "(and (or (not (has-start?)) " "(occur-in-time-range? (make-time \"%s\") " "(make-time \"%s\") \"%s\")) %s)", - iso_start, iso_end, default_tzloc, cal_filter ? cal_filter : ""); + iso_start, iso_end, default_tzloc, cal_filter); cal_shell_content_update_model_filter (data_model, model, filter, 0, 0); @@ -2283,7 +2283,7 @@ e_cal_shell_content_update_filters (ECalShellContent *cal_shell_content, g_free (iso_start); g_free (iso_end); } else { - cal_shell_content_update_model_filter (data_model, model, cal_filter ? cal_filter : "#t", 0, 0); + cal_shell_content_update_model_filter (data_model, model, *cal_filter ? cal_filter : "#t", 0, 0); } } } diff --git a/modules/webkit-editor/e-webkit-editor.c b/modules/webkit-editor/e-webkit-editor.c index 9fb3060..4b56adf 100644 --- a/modules/webkit-editor/e-webkit-editor.c +++ b/modules/webkit-editor/e-webkit-editor.c @@ -1781,8 +1781,7 @@ webkit_editor_insert_content (EContentEditor *editor, } if (strstr (content, "data-evo-draft") && !(wk_editor->priv->html_mode)) { - if (content && *content) - set_convert_in_situ (wk_editor, TRUE); + set_convert_in_situ (wk_editor, TRUE); wk_editor->priv->reload_in_progress = TRUE; webkit_web_view_load_html (WEBKIT_WEB_VIEW (wk_editor), content, "file://"); return; @@ -1799,8 +1798,7 @@ webkit_editor_insert_content (EContentEditor *editor, return; } } - if (content && *content) - set_convert_in_situ (wk_editor, TRUE); + set_convert_in_situ (wk_editor, TRUE); } wk_editor->priv->reload_in_progress = TRUE; diff --git a/modules/webkit-editor/web-extension/e-editor-dom-functions.c b/modules/webkit-editor/web-extension/e-editor-dom-functions.c index b79ea50..0eb29bd 100644 --- a/modules/webkit-editor/web-extension/e-editor-dom-functions.c +++ b/modules/webkit-editor/web-extension/e-editor-dom-functions.c @@ -2722,12 +2722,9 @@ save_history_before_event_in_table (EEditorPage *editor_page, ev = g_new0 (EEditorHistoryEvent, 1); ev->type = HISTORY_TABLE_INPUT; - if (block) { - e_editor_dom_selection_save (editor_page); - ev->data.dom.from = g_object_ref (webkit_dom_node_clone_node_with_error (WEBKIT_DOM_NODE (block), TRUE, NULL)); - e_editor_dom_selection_restore (editor_page); - } else - ev->data.dom.from = NULL; + e_editor_dom_selection_save (editor_page); + ev->data.dom.from = g_object_ref (webkit_dom_node_clone_node_with_error (WEBKIT_DOM_NODE (block), TRUE, NULL)); + e_editor_dom_selection_restore (editor_page); e_editor_dom_selection_get_coordinates (editor_page, &ev->before.start.x, @@ -5252,7 +5249,7 @@ parse_html_into_blocks (EEditorPage *editor_page, if (camel_debug ("webkit") || camel_debug ("webkit:editor")) printf ("\tto_process: '%s'\n", to_process); - if (!*to_process && processing_last) { + if (to_process && !*to_process && processing_last) { g_free (to_process); to_process = g_strdup (next_token); next_token = NULL; @@ -15303,7 +15300,6 @@ e_editor_dom_selection_set_monospace (EEditorPage *editor_page, } else { gboolean is_bold = FALSE, is_italic = FALSE; gboolean is_underline = FALSE, is_strikethrough = FALSE; - guint font_size = 0; WebKitDOMElement *tt_element; WebKitDOMNode *node; @@ -16142,7 +16138,7 @@ process_block_to_block (EEditorPage *editor_page, word_wrap_length = e_editor_page_get_word_wrap_length (editor_page); - quote = citation_level ? citation_level * 2 : 0; + quote = citation_level * 2; element = e_editor_dom_wrap_paragraph_length ( editor_page, element, word_wrap_length - quote); @@ -16487,8 +16483,7 @@ format_change_list_from_list (EEditorPage *editor_page, WEBKIT_DOM_ELEMENT (item), new_list, to); webkit_dom_node_append_child ( - after_selection_end ? - source_list_clone : WEBKIT_DOM_NODE (new_list), + WEBKIT_DOM_NODE (new_list), WEBKIT_DOM_NODE (processed_list), NULL); } else if (node_is_list (item) && !after_selection_end) { @@ -16510,10 +16505,7 @@ format_change_list_from_list (EEditorPage *editor_page, WEBKIT_DOM_NODE (new_list), FALSE, NULL); webkit_dom_node_append_child ( - after_selection_end ? - source_list_clone : WEBKIT_DOM_NODE (new_list), - clone, - NULL); + WEBKIT_DOM_NODE (new_list), clone, NULL); while ((child = webkit_dom_node_get_first_child (item))) { webkit_dom_node_append_child (clone, child, NULL); @@ -16523,10 +16515,7 @@ format_change_list_from_list (EEditorPage *editor_page, if (webkit_dom_node_get_first_child (item)) webkit_dom_node_append_child ( - after_selection_end ? - source_list_clone : WEBKIT_DOM_NODE (new_list), - item, - NULL); + WEBKIT_DOM_NODE (new_list), item, NULL); else remove_node (item); } else { @@ -17351,10 +17340,8 @@ e_editor_dom_selection_get_coordinates (EEditorPage *editor_page, parent = webkit_dom_element_get_offset_parent (parent); } - if (start_x) - *start_x = local_x; - if (start_y) - *start_y = local_y; + *start_x = local_x; + *start_y = local_y; if (e_editor_dom_selection_is_collapsed (editor_page)) { *end_x = local_x; @@ -17379,10 +17366,8 @@ e_editor_dom_selection_get_coordinates (EEditorPage *editor_page, parent = webkit_dom_element_get_offset_parent (parent); } - if (end_x) - *end_x = local_x; - if (end_y) - *end_y = local_y; + *end_x = local_x; + *end_y = local_y; if (created_selection_markers) e_editor_dom_selection_restore (editor_page); diff --git a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c b/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c index 5853f0b..1bd5fe9 100644 --- a/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c +++ b/modules/webkit-editor/web-extension/e-editor-undo-redo-manager.c @@ -1810,11 +1810,12 @@ undo_redo_replace_all (EEditorUndoRedoManager *manager, if (prev_event->type == HISTORY_REPLACE) { undo_redo_replace (editor_page, prev_event, undo); prev_item = prev_item->prev; - } else + } else { + manager->priv->history = prev_item->next; break; + } } - manager->priv->history = prev_item->next; } } @@ -2724,7 +2725,7 @@ e_editor_undo_redo_manager_redo (EEditorUndoRedoManager *manager) return; } - if (history->prev && history->prev->prev) { + if (history->prev->prev) { event = history->prev->prev->data; if (event->type == HISTORY_AND) { manager->priv->history = manager->priv->history->prev->prev; diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 5edbdb3..89c6a71 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -327,7 +327,10 @@ notify_default_action_cb (NotifyNotification *notification, if (!list) list = fallback; - g_return_if_fail (list != NULL); + if (!list) { + g_warn_if_reached (); + return; + } /* Present the shell window. */ shell_window = E_SHELL_WINDOW (list->data); diff --git a/smime/lib/e-cert-db.c b/smime/lib/e-cert-db.c index 237c912..2775cf8 100644 --- a/smime/lib/e-cert-db.c +++ b/smime/lib/e-cert-db.c @@ -413,6 +413,9 @@ p12u_ucs2_ascii_conversion_function(PRBool toUnicode, it.data = inBuf; it.len = inBufLen; dup = SECITEM_DupItem(&it); + if (!dup) + return PR_FALSE; + /* If converting Unicode to ASCII, swap bytes before conversion * as neccessary. */ @@ -425,8 +428,7 @@ p12u_ucs2_ascii_conversion_function(PRBool toUnicode, /* Perform the conversion. */ ret = PORT_UCS2_UTF8Conversion (toUnicode, dup->data, dup->len, outBuf, maxOutBufLen, outBufLen); - if (dup) - SECITEM_ZfreeItem(dup, PR_TRUE); + SECITEM_ZfreeItem(dup, PR_TRUE); #ifdef DEBUG_CONVERSION if (pk12_debugging) { diff --git a/web-extensions/e-dom-utils.c b/web-extensions/e-dom-utils.c index 28ac97e..c4f7d61 100644 --- a/web-extensions/e-dom-utils.c +++ b/web-extensions/e-dom-utils.c @@ -522,7 +522,7 @@ add_css_rule_into_style_sheet (WebKitDOMDocument *document, rule_text = webkit_dom_css_rule_get_css_text (rule); /* Find the start of the style => end of the selector */ - if (rule_text && selector && g_str_has_prefix (rule_text, selector) && + if (rule_text && g_str_has_prefix (rule_text, selector) && rule_text[selector_length] == ' ' && rule_text[selector_length + 1] == '{') { /* If exists remove it */ webkit_dom_css_style_sheet_remove_rule (