diff options
author | Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> | 2009-05-16 00:34:59 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2009-06-01 23:53:18 +0800 |
commit | ff229c47dcee18e2723aae6f3b5cd513f79ae503 (patch) | |
tree | 34caa68e3c71a94a33e387823a62202b683a3c2b | |
parent | 99e69fa352b25ae65d636a2ab464886d1b8f8af1 (diff) | |
download | gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.tar gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.tar.gz gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.tar.bz2 gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.tar.lz gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.tar.xz gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.tar.zst gsoc2013-empathy-ff229c47dcee18e2723aae6f3b5cd513f79ae503.zip |
Use != NULL for pointer checks.
-rw-r--r-- | libempathy/empathy-ft-factory.c | 2 | ||||
-rw-r--r-- | libempathy/empathy-ft-handler.c | 14 | ||||
-rw-r--r-- | libempathy/empathy-tp-file.c | 32 |
3 files changed, 24 insertions, 24 deletions
diff --git a/libempathy/empathy-ft-factory.c b/libempathy/empathy-ft-factory.c index 89ee446fd..fe687d1eb 100644 --- a/libempathy/empathy-ft-factory.c +++ b/libempathy/empathy-ft-factory.c @@ -48,7 +48,7 @@ do_constructor (GType type, { GObject *retval; - if (factory_singleton) { + if (factory_singleton != NULL) { retval = g_object_ref (factory_singleton); } else { retval = G_OBJECT_CLASS (empathy_ft_factory_parent_class)->constructor diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c index 98e4dc6e5..29b3387f2 100644 --- a/libempathy/empathy-ft-handler.c +++ b/libempathy/empathy-ft-handler.c @@ -177,23 +177,23 @@ do_dispose (GObject *object) priv->dispose_run = TRUE; - if (priv->contact) { + if (priv->contact != NULL) { g_object_unref (priv->contact); priv->contact = NULL; } - if (priv->gfile) { + if (priv->gfile != NULL) { g_object_unref (priv->gfile); priv->gfile = NULL; } - if (priv->tpfile) { + if (priv->tpfile != NULL) { empathy_tp_file_close (priv->tpfile); g_object_unref (priv->tpfile); priv->tpfile = NULL; } - if (priv->cancellable) { + if (priv->cancellable != NULL) { g_object_unref (priv->cancellable); priv->cancellable = NULL; } @@ -753,7 +753,7 @@ again: } out: - if (error) + if (error != NULL) hash_data->error = error; g_io_scheduler_job_send_to_mainloop_async (job, hash_job_done, @@ -778,7 +778,7 @@ do_hash_job_incoming (GIOSchedulerJob *job, hash_data->stream = G_INPUT_STREAM (g_file_read (priv->gfile, cancellable, &error)); - if (error) + if (error != NULL) { hash_data->error = error; g_io_scheduler_job_send_to_mainloop_async (job, hash_job_done, @@ -868,7 +868,7 @@ callbacks_data_free (gpointer user_data) { CallbacksData *data = user_data; - if (data->handler) + if (data->handler != NULL) g_object_unref (data->handler); g_slice_free (CallbacksData, data); diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index d9d7005e5..e44f8e252 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -124,7 +124,7 @@ tp_file_get_state_cb (TpProxy *proxy, { EmpathyTpFilePriv *priv = GET_PRIV (weak_object); - if (error) + if (error != NULL) { /* set a default value for the state */ priv->state = TP_FILE_TRANSFER_STATE_NONE; @@ -164,10 +164,10 @@ ft_operation_close_clean (EmpathyTpFile *tp_file) if (priv->is_closed) return; - else - priv->is_closed = TRUE; - if (priv->op_callback) + priv->is_closed = TRUE; + + if (priv->op_callback != NULL) priv->op_callback (tp_file, NULL, priv->op_user_data); } @@ -181,14 +181,14 @@ ft_operation_close_with_error (EmpathyTpFile *tp_file, if (priv->is_closed) return; - else - priv->is_closed = TRUE; + + priv->is_closed = TRUE; /* close the channel if it's not cancelled already */ if (priv->state != TP_FILE_TRANSFER_STATE_CANCELLED) empathy_tp_file_cancel (tp_file); - if (priv->op_callback) + if (priv->op_callback != NULL) priv->op_callback (tp_file, error, priv->op_user_data); } @@ -264,7 +264,7 @@ tp_file_start_transfer (EmpathyTpFile *tp_file) priv->start_time = empathy_time_get_current (); /* notify we're starting a transfer */ - if (priv->progress_callback) + if (priv->progress_callback != NULL) priv->progress_callback (tp_file, 0, priv->progress_user_data); if (priv->incoming) @@ -392,7 +392,7 @@ tp_file_transferred_bytes_changed_cb (TpChannel *proxy, return; /* notify clients */ - if (priv->progress_callback) + if (priv->progress_callback != NULL) priv->progress_callback (EMPATHY_TP_FILE (weak_object), count, priv->progress_user_data); } @@ -410,9 +410,9 @@ ft_operation_provide_or_accept_file_cb (TpChannel *proxy, g_cancellable_set_error_if_cancelled (priv->cancellable, &myerr); - if (error) + if (error != NULL) { - if (myerr) + if (myerr != NULL) { /* if we were both cancelled and failed when calling the method, * report the method error. @@ -422,7 +422,7 @@ ft_operation_provide_or_accept_file_cb (TpChannel *proxy, } } - if (myerr) + if (myerr != NULL) { DEBUG ("Error: %s", error->message); ft_operation_close_with_error (tp_file, myerr); @@ -575,7 +575,7 @@ do_dispose (GObject *object) priv->dispose_run = TRUE; - if (priv->channel) + if (priv->channel != NULL) { g_signal_handlers_disconnect_by_func (priv->channel, tp_file_invalidated_cb, object); @@ -583,13 +583,13 @@ do_dispose (GObject *object) priv->channel = NULL; } - if (priv->in_stream) + if (priv->in_stream != NULL) g_object_unref (priv->in_stream); - if (priv->out_stream) + if (priv->out_stream != NULL) g_object_unref (priv->out_stream); - if (priv->cancellable) + if (priv->cancellable != NULL) g_object_unref (priv->cancellable); G_OBJECT_CLASS (empathy_tp_file_parent_class)->dispose (object); |