diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:17:45 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:17:45 +0800 |
commit | 75e327f0e73bc4e509ad1f69833ee0048aef62f2 (patch) | |
tree | 071e66739e20372aa89b42b77579a29ced670111 | |
parent | e64a676589d21f6bb93bda0bef0ecc9a00c6e985 (diff) | |
download | gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.tar gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.tar.gz gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.tar.bz2 gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.tar.lz gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.tar.xz gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.tar.zst gsoc2013-empathy-75e327f0e73bc4e509ad1f69833ee0048aef62f2.zip |
Updated parameter checks to return appropriate values. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1799
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 2 | ||||
-rw-r--r-- | libempathy/empathy-tp-file.c | 21 |
2 files changed, 13 insertions, 10 deletions
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index a7e72aa3d..0a2b5eccb 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -195,7 +195,7 @@ empathy_contact_log_menu_item_new (EmpathyContact *contact) static void contact_file_transfer_menu_item_activate_cb (EmpathyContact *contact) { - g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL); + g_return_if_fail (EMPATHY_IS_CONTACT (contact)); empathy_send_file_with_file_chooser_and_manager (contact); } diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index 03b617541..020e7af67 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -727,7 +727,7 @@ empathy_tp_file_new (McAccount *account, TpChannel *channel) { g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL); - g_return_val_if_fail (TP_IS_CHANNEL (chnanel), NULL); + g_return_val_if_fail (TP_IS_CHANNEL (channel), NULL); return g_object_new (EMPATHY_TYPE_TP_FILE, "account", account, @@ -872,21 +872,23 @@ empathy_tp_file_get_filename (EmpathyTpFile *tp_file) gboolean empathy_tp_file_get_incoming (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), FALSE); return tp_file->priv->incoming; } EmpFileTransferState empathy_tp_file_get_state (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), + EMP_FILE_TRANSFER_STATE_NONE); return tp_file->priv->state; } EmpFileTransferStateChangeReason empathy_tp_file_get_state_change_reason (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), + EMP_FILE_TRANSFER_STATE_CHANGE_REASON_NONE); g_return_val_if_fail (tp_file->priv->state_change_reason >= 0, EMP_FILE_TRANSFER_STATE_CHANGE_REASON_NONE); @@ -896,14 +898,15 @@ empathy_tp_file_get_state_change_reason (EmpathyTpFile *tp_file) guint64 empathy_tp_file_get_size (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), + EMPATHY_TP_FILE_UNKNOWN_SIZE); return tp_file->priv->size; } guint64 empathy_tp_file_get_transferred_bytes (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), 0); return tp_file->priv->transferred_bytes; } @@ -914,7 +917,7 @@ empathy_tp_file_get_remaining_time (EmpathyTpFile *tp_file) gdouble time_per_byte; gdouble remaining_time; - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), -1); if (tp_file->priv->size == EMPATHY_TP_FILE_UNKNOWN_SIZE) return -1; @@ -935,7 +938,7 @@ empathy_tp_file_get_remaining_time (EmpathyTpFile *tp_file) void empathy_tp_file_cancel (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), NULL); + g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file)); tp_cli_channel_call_close (tp_file->priv->channel, -1, NULL, NULL, NULL, NULL); @@ -972,7 +975,7 @@ empathy_tp_file_set_output_stream (EmpathyTpFile *tp_file, GOutputStream *out_stream) { g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file)); - g_return_if_fail (G_IS_INPUT_STREAM (in_stream)); + g_return_if_fail (G_IS_OUTPUT_STREAM (out_stream)); if (tp_file->priv->out_stream == out_stream) return; |