Emit StateChangedProperties post emitting service state's PropertyChanged
[platform/upstream/connman.git] / doc / coding-style.txt
index 30690b7..97410ce 100644 (file)
@@ -51,7 +51,7 @@ b = 3;
 
 The only exception to this rule applies when a variable is being allocated:
 array = g_try_new0(int, 20);
-if (array == NULL)     // Correct
+if (!array)    // Correct
        return;
 
 
@@ -94,7 +94,7 @@ if (call->status == CALL_STATUS_ACTIVE ||
 
 3)
 gboolean sim_ust_is_available(unsigned char *service_ust, unsigned char len,
-       num sim_ust_service index) // wrong
+       enum sim_ust_service index) // wrong
 {
        int a;
        ...
@@ -162,7 +162,7 @@ the expected behavior, and you may want to use g_try_malloc instead.
 
 Example:
 additional = g_try_malloc(len - 1);  // correct
-if (additional == NULL)
+if (!additional)
        return FALSE;
 
 
@@ -247,22 +247,22 @@ rule might not apply.
 M13: Check for pointer being NULL
 =================================
 
-When checking if a pointer or a return value is NULL, explicitly compare to
-NULL rather than use the shorter check with "!" operator.
+When checking if a pointer or a return value is NULL, use the
+check with "!" operator.
 
 Example:
 1)
 array = g_try_new0(int, 20);
-if (!array)    // Wrong
+if (!array)    // Correct
        return;
 
 2)
-if (!g_at_chat_get_slave(chat))        // Wrong
+if (!g_at_chat_get_slave(chat))        // Correct
        return -EINVAL;
 
 3)
 array = g_try_new0(int, 20);
-if (array == NULL)     // Correct
+if (array == NULL)     // Wrong
        return;