aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/src')
-rw-r--r--lib/src/CMakeLists.txt2
-rw-r--r--lib/src/name.c8
-rw-r--r--lib/src/policy.c8
-rw-r--r--lib/src/util/ip_address.c10
4 files changed, 14 insertions, 14 deletions
diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt
index f68e7a551..7eecaf775 100644
--- a/lib/src/CMakeLists.txt
+++ b/lib/src/CMakeLists.txt
@@ -35,7 +35,7 @@ set (COMPILER_DEFINITIONS "-DWITH_MAPME")
include(BuildMacros)
include(WindowsMacros)
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
+if (DISABLE_SHARED_LIBRARIES)
build_library(${LIBHICN}
STATIC
SOURCES ${LIBHICN_SOURCE_FILES} ${LIBHICN_HEADER_FILES} ${LIBHICN_HEADER_FILES_PROTOCOL} ${LIBHICN_HEADER_FILES_UTIL}
diff --git a/lib/src/name.c b/lib/src/name.c
index 6c7945a18..7c1f7582a 100644
--- a/lib/src/name.c
+++ b/lib/src/name.c
@@ -460,19 +460,19 @@ hicn_name_ntop (const hicn_name_t * src, char *dst, size_t len)
switch (src->type)
{
case HNT_CONTIGUOUS_V6:
- rc = inet_ntop (AF_INET6, src->buffer, dst, len);
+ rc = inet_ntop (AF_INET6, src->buffer, dst, (socklen_t)len);
seg_number = (u8 *) src->buffer + IPV6_ADDR_LEN;
break;
case HNT_CONTIGUOUS_V4:
- rc = inet_ntop (AF_INET, src->buffer, dst, len);
+ rc = inet_ntop (AF_INET, src->buffer, dst, (socklen_t)len);
seg_number = (u8 *) src->buffer + IPV4_ADDR_LEN;
break;
case HNT_IOV_V6:
- rc = inet_ntop (AF_INET6, src->iov.buffers[0].iov_base, dst, len);
+ rc = inet_ntop (AF_INET6, src->iov.buffers[0].iov_base, dst, (socklen_t)len);
seg_number = src->iov.buffers[1].iov_base;
break;
case HNT_IOV_V4:
- rc = inet_ntop (AF_INET, src->iov.buffers[0].iov_base, dst, len);
+ rc = inet_ntop (AF_INET, src->iov.buffers[0].iov_base, dst, (socklen_t)len);
seg_number = src->iov.buffers[1].iov_base;
break;
default:
diff --git a/lib/src/policy.c b/lib/src/policy.c
index edbb02bea..694f0ea5e 100644
--- a/lib/src/policy.c
+++ b/lib/src/policy.c
@@ -49,13 +49,13 @@ policy_tag_state_snprintf(char * s, size_t size, const policy_tag_state_t * tag_
return -1;
rc = snprintf(cur, s + size - cur, "%s%s", (tag_state->disabled == 1) ? "!" : "", policy_state_str[tag_state->state]);
- if (rc >= s + size - cur)
- return s + size - cur;
+ if (rc >= (int)(s + size - cur))
+ return (int)(s + size - cur);
if (rc < 0)
return rc;
cur += rc;
if (size != 0 && cur >= s + size)
- return cur - s;
+ return (int)(cur - s);
- return cur - s;
+ return (int)(cur - s);
}
diff --git a/lib/src/util/ip_address.c b/lib/src/util/ip_address.c
index 49818de40..805b0b261 100644
--- a/lib/src/util/ip_address.c
+++ b/lib/src/util/ip_address.c
@@ -91,10 +91,10 @@ ip_address_ntop (const ip_address_t * ip_address, char *dst, const size_t len,
const char * s;
switch(family) {
case AF_INET:
- s = inet_ntop (AF_INET, ip_address->v4.buffer, dst, len);
+ s = inet_ntop (AF_INET, ip_address->v4.buffer, dst, (socklen_t)len);
break;
case AF_INET6:
- s = inet_ntop (AF_INET6, ip_address->v6.buffer, dst, len);
+ s = inet_ntop (AF_INET6, ip_address->v6.buffer, dst, (socklen_t)len);
break;
default:
return -1;
@@ -156,7 +156,7 @@ ip_address_snprintf(char * s, size_t size, const ip_address_t * ip_address, int
}
if (!rc)
return -1;
- return strlen(s);
+ return (int)strlen(s);
}
int
@@ -281,7 +281,7 @@ ip_prefix_ntop_short(const ip_prefix_t * ip_prefix, char *dst, size_t size)
return -1;
int rc = snprintf(dst, size, "%s", ip_s);
if (rc >= size)
- return size;
+ return (int)size;
return rc;
}
@@ -304,7 +304,7 @@ ip_prefix_ntop(const ip_prefix_t * ip_prefix, char *dst, size_t size)
return -1;
int rc = snprintf(dst, size, "%s/%d", ip_s, ip_prefix->len);
if (rc >= size)
- return size;
+ return (int)size;
return rc;
}