Commit f8c37da7 authored by Philip Withnall's avatar Philip Withnall

Fix missing entries in switch statements

Added missing default cases and missing enum cases.
parent 5cc326f7
......@@ -600,6 +600,7 @@ accounts_widget_generic_setup (EmpathyAccountWidget *self,
case 't': minint = 0; maxint = G_MAXUINT64; break;
case 'd': minint = G_MININT32; maxint = G_MAXINT32;
step = 0.1; break;
default: g_assert_not_reached ();
}
str = g_strdup_printf (_("%s:"), param_name_formatted);
......
......@@ -132,8 +132,7 @@ avatar_image_filter_func (GdkXEvent *gdkxevent,
priv = GET_PRIV (data);
switch (xevent->type) {
case PropertyNotify:
if (xevent->type == PropertyNotify) {
atom = gdk_x11_get_xatom_by_name ("_NET_CURRENT_DESKTOP");
if (xevent->xproperty.atom == atom) {
if (priv->popup) {
......@@ -141,7 +140,6 @@ avatar_image_filter_func (GdkXEvent *gdkxevent,
priv->popup = NULL;
}
}
break;
}
return GDK_FILTER_CONTINUE;
......
......@@ -255,6 +255,9 @@ reconnected_connection_ready_cb (TpConnection *connection,
empathy_dispatcher_join_muc (connection,
priv->id, EMPATHY_DISPATCHER_NON_USER_ACTION);
break;
case TP_HANDLE_TYPE_NONE:
case TP_HANDLE_TYPE_LIST:
case TP_HANDLE_TYPE_GROUP:
default:
g_assert_not_reached ();
break;
......@@ -1166,6 +1169,7 @@ chat_send_error_cb (EmpathyTpChat *tp_chat,
case TP_CHANNEL_TEXT_SEND_ERROR_NOT_IMPLEMENTED:
error = _("not implemented");
break;
case TP_CHANNEL_TEXT_SEND_ERROR_UNKNOWN:
default:
error = _("unknown");
break;
......
......@@ -712,6 +712,9 @@ empathy_contact_list_store_set_sort_criterium (EmpathyContactListStore *stor
EMPATHY_CONTACT_LIST_STORE_COL_NAME,
GTK_SORT_ASCENDING);
break;
default:
g_assert_not_reached ();
}
g_object_notify (G_OBJECT (store), "sort-criterium");
......
......@@ -763,11 +763,9 @@ contact_list_view_drag_data_get (GtkWidget *widget,
g_object_unref (contact);
str = g_strconcat (account_id, ":", contact_id, NULL);
switch (info) {
case DND_DRAG_TYPE_CONTACT_ID:
if (info == DND_DRAG_TYPE_CONTACT_ID) {
gtk_selection_data_set (selection, drag_atoms_source[info], 8,
(guchar *) str, strlen (str) + 1);
break;
}
g_free (str);
......
......@@ -1651,6 +1651,9 @@ empathy_individual_store_set_sort_criterium (EmpathyIndividualStore *self,
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (self),
EMPATHY_INDIVIDUAL_STORE_COL_NAME, GTK_SORT_ASCENDING);
break;
default:
g_assert_not_reached ();
}
g_object_notify (G_OBJECT (self), "sort-criterium");
......
......@@ -783,12 +783,10 @@ individual_view_drag_data_get (GtkWidget *widget,
individual_id = folks_individual_get_id (individual);
switch (info)
if (info == DND_DRAG_TYPE_INDIVIDUAL_ID)
{
case DND_DRAG_TYPE_INDIVIDUAL_ID:
gtk_selection_data_set (selection, drag_atoms_source[info], 8,
(guchar *) individual_id, strlen (individual_id) + 1);
break;
}
g_object_unref (individual);
......
......@@ -89,6 +89,30 @@ stripped_char (gunichar ch)
case G_UNICODE_ENCLOSING_MARK:
/* Ignore those */
break;
case G_UNICODE_PRIVATE_USE:
case G_UNICODE_SURROGATE:
case G_UNICODE_LOWERCASE_LETTER:
case G_UNICODE_MODIFIER_LETTER:
case G_UNICODE_OTHER_LETTER:
case G_UNICODE_TITLECASE_LETTER:
case G_UNICODE_UPPERCASE_LETTER:
case G_UNICODE_DECIMAL_NUMBER:
case G_UNICODE_LETTER_NUMBER:
case G_UNICODE_OTHER_NUMBER:
case G_UNICODE_CONNECT_PUNCTUATION:
case G_UNICODE_DASH_PUNCTUATION:
case G_UNICODE_CLOSE_PUNCTUATION:
case G_UNICODE_FINAL_PUNCTUATION:
case G_UNICODE_INITIAL_PUNCTUATION:
case G_UNICODE_OTHER_PUNCTUATION:
case G_UNICODE_OPEN_PUNCTUATION:
case G_UNICODE_CURRENCY_SYMBOL:
case G_UNICODE_MODIFIER_SYMBOL:
case G_UNICODE_MATH_SYMBOL:
case G_UNICODE_OTHER_SYMBOL:
case G_UNICODE_LINE_SEPARATOR:
case G_UNICODE_PARAGRAPH_SEPARATOR:
case G_UNICODE_SPACE_SEPARATOR:
default:
ch = g_unichar_tolower (ch);
decomp = g_unicode_canonical_decomposition (ch, &dlen);
......
......@@ -206,6 +206,7 @@ empathy_icon_name_for_presence (TpConnectionPresenceType presence)
case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:
return EMPATHY_IMAGE_PENDING;
case TP_CONNECTION_PRESENCE_TYPE_UNSET:
default:
return NULL;
}
......
......@@ -1048,7 +1048,13 @@ empathy_contact_is_online (EmpathyContact *contact)
case TP_CONNECTION_PRESENCE_TYPE_OFFLINE:
case TP_CONNECTION_PRESENCE_TYPE_UNKNOWN:
case TP_CONNECTION_PRESENCE_TYPE_ERROR:
case TP_CONNECTION_PRESENCE_TYPE_UNSET:
return FALSE;
case TP_CONNECTION_PRESENCE_TYPE_AVAILABLE:
case TP_CONNECTION_PRESENCE_TYPE_AWAY:
case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
case TP_CONNECTION_PRESENCE_TYPE_BUSY:
default:
return TRUE;
}
......
......@@ -130,10 +130,11 @@ empathy_dispatch_operation_set_property (GObject *object,
case PROP_INCOMING:
priv->incoming = g_value_get_boolean (value);
break;
case PROP_USER_ACTION_TIME:
priv->user_action_time = g_value_get_int64 (value);
break;
default:
g_assert_not_reached ();
}
}
......@@ -167,6 +168,8 @@ empathy_dispatch_operation_get_property (GObject *object,
case PROP_USER_ACTION_TIME:
g_value_set_int64 (value, priv->user_action_time);
break;
default:
g_assert_not_reached ();
}
}
......
......@@ -526,6 +526,9 @@ dispatcher_start_dispatching (EmpathyDispatcher *self,
case EMPATHY_DISPATCHER_OPERATION_STATE_PENDING:
dispatch_operation_ready_cb (operation, self);
break;
case EMPATHY_DISPATCHER_OPERATION_STATE_DISPATCHING:
case EMPATHY_DISPATCHER_OPERATION_STATE_CLAIMED:
case EMPATHY_DISPATCHER_OPERATION_STATE_INVALIDATED:
default:
g_assert_not_reached ();
}
......
......@@ -584,6 +584,7 @@ tp_file_hash_to_g_checksum (TpFileHashType type)
case TP_FILE_HASH_TYPE_SHA256:
retval = G_CHECKSUM_SHA256;
break;
case TP_FILE_HASH_TYPE_NONE:
default:
g_assert_not_reached ();
break;
......
......@@ -603,6 +603,9 @@ empathy_message_type_to_str (TpChannelTextMessageType type)
return "notice";
case TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY:
return "auto-reply";
case TP_CHANNEL_TEXT_MESSAGE_TYPE_DELIVERY_REPORT:
return "delivery-report";
case TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
default:
return "normal";
}
......
......@@ -431,6 +431,8 @@ empathy_status_presets_is_valid (TpConnectionPresenceType state)
case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
case TP_CONNECTION_PRESENCE_TYPE_BUSY:
return TRUE;
default:
return FALSE;
}
return FALSE;
}
......@@ -254,6 +254,7 @@ empathy_presence_get_default_message (TpConnectionPresenceType presence)
return _("Unknown");
case TP_CONNECTION_PRESENCE_TYPE_UNSET:
case TP_CONNECTION_PRESENCE_TYPE_ERROR:
default:
return NULL;
}
......@@ -643,6 +644,12 @@ empathy_connect_new_account (TpAccount *account,
g_free (message);
break;
case TP_CONNECTION_PRESENCE_TYPE_AVAILABLE:
case TP_CONNECTION_PRESENCE_TYPE_AWAY:
case TP_CONNECTION_PRESENCE_TYPE_EXTENDED_AWAY:
case TP_CONNECTION_PRESENCE_TYPE_HIDDEN:
case TP_CONNECTION_PRESENCE_TYPE_BUSY:
case TP_CONNECTION_PRESENCE_TYPE_ERROR:
default:
/* do nothing if the presence is not offline */
break;
......
......@@ -57,12 +57,12 @@ typedef enum {
RESPONSE_CREATE_STOP = 2
} CreateEnterPageResponse;
enum {
typedef enum {
PAGE_INTRO = 0,
PAGE_IMPORT = 1,
PAGE_ENTER_CREATE = 2,
PAGE_SALUT = 3,
};
} PageID;
enum {
PROP_PARENT = 1,
......@@ -75,7 +75,7 @@ typedef struct {
gboolean enter_create_forward;
TpAccountManager *account_mgr;
EmpathyConnectionManagers *connection_mgrs;
gint current_page_id;
PageID current_page_id;
/* enter or create page */
GtkWidget *enter_or_create_page;
......@@ -933,12 +933,8 @@ impl_signal_prepare (GtkAssistant *assistant,
gint current_idx;
/* check from which page we are coming from */
switch (priv->current_page_id)
{
case PAGE_IMPORT:
empathy_import_widget_add_selected_accounts (priv->iw);
break;
}
if (priv->current_page_id == PAGE_IMPORT)
empathy_import_widget_add_selected_accounts (priv->iw);
current_idx = gtk_assistant_get_current_page (assistant);
priv->current_page_id = current_idx;
......
......@@ -2377,6 +2377,10 @@ media_stream_error_to_txt (EmpathyCallWindow *self,
case TP_MEDIA_STREAM_ERROR_MEDIA_ERROR:
return g_strdup (_("There was a failure in the call engine"));
case TP_MEDIA_STREAM_ERROR_EOS:
return g_strdup (_("The end of the stream was reached"));
case TP_MEDIA_STREAM_ERROR_UNKNOWN:
default:
return NULL;
}
......@@ -2737,6 +2741,31 @@ empathy_call_window_bus_message (GstBus *bus, GstMessage *message,
g_error_free (error);
g_free (debug);
}
case GST_MESSAGE_UNKNOWN:
case GST_MESSAGE_EOS:
case GST_MESSAGE_WARNING:
case GST_MESSAGE_INFO:
case GST_MESSAGE_TAG:
case GST_MESSAGE_BUFFERING:
case GST_MESSAGE_STATE_DIRTY:
case GST_MESSAGE_STEP_DONE:
case GST_MESSAGE_CLOCK_PROVIDE:
case GST_MESSAGE_CLOCK_LOST:
case GST_MESSAGE_NEW_CLOCK:
case GST_MESSAGE_STRUCTURE_CHANGE:
case GST_MESSAGE_STREAM_STATUS:
case GST_MESSAGE_APPLICATION:
case GST_MESSAGE_ELEMENT:
case GST_MESSAGE_SEGMENT_START:
case GST_MESSAGE_SEGMENT_DONE:
case GST_MESSAGE_DURATION:
case GST_MESSAGE_LATENCY:
case GST_MESSAGE_ASYNC_START:
case GST_MESSAGE_ASYNC_DONE:
case GST_MESSAGE_REQUEST_STATE:
case GST_MESSAGE_STEP_START:
case GST_MESSAGE_QOS:
case GST_MESSAGE_ANY:
default:
break;
}
......
......@@ -881,6 +881,8 @@ ft_manager_response_cb (GtkWidget *widget,
case RESPONSE_STOP:
ft_manager_stop (manager);
break;
default:
g_assert_not_reached ();
}
}
......
......@@ -1017,6 +1017,9 @@ account_status_changed_cb (TpAccount *account,
case TP_CONNECTION_STATUS_CONNECTED:
/* We can join the room */
break;
default:
g_assert_not_reached ();
}
join_chatroom (ctx->chatroom, ctx->timestamp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment