summaryrefslogtreecommitdiffstats
path: root/lib/addr.c
diff options
context:
space:
mode:
authorКоренберг Марк <mark@ideco.ru>2012-06-08 14:15:06 (GMT)
committerThomas Graf <tgraf@redhat.com>2012-06-13 11:30:26 (GMT)
commit2bdcde7e8e8bb78b165f093f1a708134f417e557 (patch)
tree52d56b1b1d1f75373a33c27988ded96e6a62e36e /lib/addr.c
parent4f933648622fff2b7fd6ec6c71724da4992c2544 (diff)
downloadlibnl-2bdcde7e8e8bb78b165f093f1a708134f417e557.zip
libnl-2bdcde7e8e8bb78b165f093f1a708134f417e557.tar.gz
libnl-2bdcde7e8e8bb78b165f093f1a708134f417e557.tar.bz2
Fix types-related warnings based on clang diagnostics
1. Fix some places where unsigned value compared < 0 2. Fix obsolete %Z specifier to more portable %z 3. Some erroneous types substitution 4. nl_msec2str() - 64-bit msec is now properly used, Only safe changes. I mean int <--> uint32_t and signed/unsigned fixes. Some functinos require size_t argument instead of int, but changes of signatures of that functions is terrible thing. Also, I do not pretend for a full list of fixes. Just to shut up clang -Wall -Wextra One more thing. ifindex. I don't change that because changes will be too big for simple fix.
Diffstat (limited to 'lib/addr.c')
-rw-r--r--lib/addr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/addr.c b/lib/addr.c
index 89d3d4f..3acd9e4 100644
--- a/lib/addr.c
+++ b/lib/addr.c
@@ -368,7 +368,7 @@ int nl_addr_parse(const char *addrstr, int hint, struct nl_addr **result)
}
if (hint == AF_UNSPEC && strchr(str, ':')) {
- int i = 0;
+ size_t i = 0;
char *s = str, *p;
for (;;) {
long l = strtol(s, &p, 16);
@@ -542,7 +542,7 @@ int nl_addr_cmp_prefix(struct nl_addr *a, struct nl_addr *b)
*/
int nl_addr_iszero(struct nl_addr *addr)
{
- int i;
+ unsigned int i;
for (i = 0; i < addr->a_len; i++)
if (addr->a_addr[i])
@@ -823,7 +823,7 @@ unsigned int nl_addr_get_prefixlen(struct nl_addr *addr)
*/
char *nl_addr2str(struct nl_addr *addr, char *buf, size_t size)
{
- int i;
+ unsigned int i;
char tmp[16];
if (!addr || !addr->a_len) {