summaryrefslogtreecommitdiffstats
path: root/avahi-common
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-02 14:08:18 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-02 14:08:18 +0000
commit66142b071a2497d7e3cf58d7bf5159bb1c970d84 (patch)
tree1e0125be0373b7201ec71275f4bd8e06aecc94a3 /avahi-common
parent98d4644e8f9445fa4cf7395b05a9f860b8f3cb9c (diff)
* allow caller to specifiy additional CFLAGS arguments to bootstrap.sh
* fix some warnings (and some real errors) found when compiling avahi with excessive GCC warnings git-svn-id: file:///home/lennart/svn/public/avahi/trunk@209 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-common')
-rw-r--r--avahi-common/address.c8
-rw-r--r--avahi-common/strlst-test.c2
-rw-r--r--avahi-common/strlst.c6
3 files changed, 8 insertions, 8 deletions
diff --git a/avahi-common/address.c b/avahi-common/address.c
index b982a2c..8f1848e 100644
--- a/avahi-common/address.c
+++ b/avahi-common/address.c
@@ -142,9 +142,9 @@ AvahiAddress *avahi_address_from_sockaddr(const struct sockaddr* sa, AvahiAddres
ret_addr->family = sa->sa_family;
if (sa->sa_family == AF_INET)
- memcpy(&ret_addr->data.ipv4, &((struct sockaddr_in*) sa)->sin_addr, sizeof(ret_addr->data.ipv4));
+ memcpy(&ret_addr->data.ipv4, &((const struct sockaddr_in*) sa)->sin_addr, sizeof(ret_addr->data.ipv4));
else
- memcpy(&ret_addr->data.ipv6, &((struct sockaddr_in6*) sa)->sin6_addr, sizeof(ret_addr->data.ipv6));
+ memcpy(&ret_addr->data.ipv6, &((const struct sockaddr_in6*) sa)->sin6_addr, sizeof(ret_addr->data.ipv6));
return ret_addr;
}
@@ -155,9 +155,9 @@ guint16 avahi_port_from_sockaddr(const struct sockaddr* sa) {
g_assert(sa->sa_family == AF_INET || sa->sa_family == AF_INET6);
if (sa->sa_family == AF_INET)
- return ntohs(((struct sockaddr_in*) sa)->sin_port);
+ return ntohs(((const struct sockaddr_in*) sa)->sin_port);
else
- return ntohs(((struct sockaddr_in6*) sa)->sin6_port);
+ return ntohs(((const struct sockaddr_in6*) sa)->sin6_port);
}
gboolean avahi_address_is_ipv4_in_ipv6(const AvahiAddress *a) {
diff --git a/avahi-common/strlst-test.c b/avahi-common/strlst-test.c
index afc13b1..58ca60d 100644
--- a/avahi-common/strlst-test.c
+++ b/avahi-common/strlst-test.c
@@ -40,7 +40,7 @@ int main(int argc, char *argv[]) {
a = avahi_string_list_add(a, "foo");
a = avahi_string_list_add(a, "bar");
a = avahi_string_list_add(a, "quux");
- a = avahi_string_list_add_arbitrary(a, (guint8*) "null\0null", 9);
+ a = avahi_string_list_add_arbitrary(a, (const guint8*) "null\0null", 9);
a = avahi_string_list_add(a, "end");
t = avahi_string_list_to_string(a);
diff --git a/avahi-common/strlst.c b/avahi-common/strlst.c
index d8206e1..d4d67da 100644
--- a/avahi-common/strlst.c
+++ b/avahi-common/strlst.c
@@ -246,12 +246,12 @@ AvahiStringList *avahi_string_list_copy(const AvahiStringList *l) {
AvahiStringList *avahi_string_list_new_from_array(const gchar *array[], gint length) {
AvahiStringList *r = NULL;
- gint index;
+ gint i;
g_assert(array);
- for (index = 0; length >= 0 ? index < length : !!array[index]; index++)
- r = avahi_string_list_add(r, array[index]);
+ for (i = 0; length >= 0 ? i < length : !!array[i]; i++)
+ r = avahi_string_list_add(r, array[i]);
return r;
}