]> git.0d.be Git - empathy.git/commitdiff
Use != NULL for pointer checks.
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>
Fri, 15 May 2009 16:34:59 +0000 (18:34 +0200)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 1 Jun 2009 15:53:18 +0000 (17:53 +0200)
libempathy/empathy-ft-factory.c
libempathy/empathy-ft-handler.c
libempathy/empathy-tp-file.c

index 89ee446fd973140f28706468713d6b9a46ecc100..fe687d1eb463b79f66ca5d82f0a0c209b0f10023 100644 (file)
@@ -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
index 98e4dc6e5cfa7f42c296055b121b4df0d67a4733..29b3387f2213dbacd1c414b2da278d2ba0f097f4 100644 (file)
@@ -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);
index d9d7005e5ccfc72809b7ab74d5601a6cf8b12cff..e44f8e25238d9da04990a0afab5c6192bbf98a15 100644 (file)
@@ -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);