]> git.meshlink.io Git - catta/blobdiff - avahi-client/entrygroup.c
remove yet another osx compiler warning
[catta] / avahi-client / entrygroup.c
index 4143f2bfa827b3d01498dc6075d13ecce59f156a..e43a44fb8ae42b61db5785ce7f084d0141187d58 100644 (file)
@@ -51,7 +51,7 @@ void avahi_entry_group_set_state(AvahiEntryGroup *group, AvahiEntryGroupState st
 }
 
 static int retrieve_state(AvahiEntryGroup *group) {
-    DBusMessage *message, *reply;
+    DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
     int r = AVAHI_OK;
     int32_t state;
@@ -111,7 +111,7 @@ AvahiEntryGroup* avahi_entry_group_new (AvahiClient *client, AvahiEntryGroupCall
 
     dbus_error_init (&error);
 
-    if (client->state == AVAHI_CLIENT_DISCONNECTED) {
+    if (!avahi_client_is_connected(client)) {
         avahi_client_set_errno(client, AVAHI_ERR_BAD_STATE);
         goto fail;
     }
@@ -237,7 +237,7 @@ int avahi_entry_group_free(AvahiEntryGroup *group) {
         
     assert(group);
     
-    if (group->path && client->state != AVAHI_CLIENT_DISCONNECTED)
+    if (group->path && avahi_client_is_connected(client))
         r = entry_group_simple_method_call(group, "Free");
     
     AVAHI_LLIST_REMOVE(AvahiEntryGroup, groups, client->groups, group);
@@ -251,7 +251,7 @@ int avahi_entry_group_free(AvahiEntryGroup *group) {
 int avahi_entry_group_commit(AvahiEntryGroup *group) {
     assert(group);
     
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     return entry_group_simple_method_call(group, "Commit");
@@ -260,7 +260,7 @@ int avahi_entry_group_commit(AvahiEntryGroup *group) {
 int avahi_entry_group_reset(AvahiEntryGroup *group) {
     assert(group);
     
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     return entry_group_simple_method_call(group, "Reset");
@@ -279,7 +279,7 @@ AvahiClient* avahi_entry_group_get_client (AvahiEntryGroup *group) {
 }
 
 int avahi_entry_group_is_empty (AvahiEntryGroup *group) {
-    DBusMessage *message, *reply;
+    DBusMessage *message = NULL, *reply = NULL;
     DBusError error;
     int r = AVAHI_OK;
     int b;
@@ -288,7 +288,7 @@ int avahi_entry_group_is_empty (AvahiEntryGroup *group) {
     assert(group);
     client = group->client;
 
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     dbus_error_init(&error);
@@ -330,7 +330,7 @@ fail:
     return r;
 }
 
-static int append_rdata(DBusMessage *message, uint8_t *rdata, size_t size) {
+static int append_rdata(DBusMessage *message, const void *rdata, size_t size) {
     DBusMessageIter iter, sub;
  
     assert(message);
@@ -409,7 +409,7 @@ int avahi_entry_group_add_service_strlst(
 
     client = group->client;
 
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     if (!domain)
@@ -528,7 +528,7 @@ int avahi_entry_group_add_service_subtype(
 
     client = group->client;
 
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     if (!domain)
@@ -638,7 +638,7 @@ int avahi_entry_group_update_service_txt_strlst(
 
     client = group->client;
 
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     if (!domain)
@@ -700,8 +700,6 @@ fail:
         dbus_message_unref(reply);
 
     return r;
-    
-    
 }
 
 /** Add a host/address pair */
@@ -726,7 +724,7 @@ int avahi_entry_group_add_address(
 
     client = group->client;
 
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     dbus_error_init(&error);
@@ -801,7 +799,7 @@ int avahi_entry_group_add_record(
     uint16_t clazz,
     uint16_t type,
     uint32_t ttl,
-    uint8_t *rdata,
+    const void *rdata,
     size_t size) {
 
     DBusMessage *message = NULL, *reply = NULL;
@@ -815,7 +813,7 @@ int avahi_entry_group_add_record(
 
     client = group->client;
 
-    if (!group->path || group->client->state == AVAHI_CLIENT_DISCONNECTED)
+    if (!group->path || !avahi_client_is_connected(group->client))
         return avahi_client_set_errno(group->client, AVAHI_ERR_BAD_STATE);
 
     dbus_error_init(&error);