diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-05-29 04:35:29 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-05-29 04:35:29 +0000 |
commit | f313543ecea62890c909b1318b7362aebe044e62 (patch) | |
tree | 3a5216ab20e8390dc2547fd600d9002d1831d592 /cpukit | |
parent | 2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-f313543ecea62890c909b1318b7362aebe044e62.tar.bz2 |
2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* libnetworking/net/if.c:
Use uintptr_t and void* in _offsetof().
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 2 | ||||
-rw-r--r-- | cpukit/libnetworking/net/if.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 5b30294580..807737aabf 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,7 @@ 2010-05-29 Ralf Corsépius <ralf.corsepius@rtems.org> + * libnetworking/net/if.c: + Use uintptr_t and void* in _offsetof(). * libnetworking/netinet/raw_ip.c: Cast nam to uintptr_t instead of int. * libnetworking/libc/gethostnamadr.c: diff --git a/cpukit/libnetworking/net/if.c b/cpukit/libnetworking/net/if.c index 93773dbd80..36d48fcc34 100644 --- a/cpukit/libnetworking/net/if.c +++ b/cpukit/libnetworking/net/if.c @@ -134,7 +134,7 @@ if_attach(struct ifnet *ifp) * create a Link Level name for this device */ namelen = sprintf(workbuf, "%s%d", ifp->if_name, ifp->if_unit); -#define _offsetof(t, m) ((int)((caddr_t)&((t *)0)->m)) +#define _offsetof(t, m) ((uintptr_t)((void*)&((t *)0)->m)) masklen = _offsetof(struct sockaddr_dl, sdl_data[0]) + namelen; socksize = masklen + ifp->if_addrlen; #define ROUNDUP(a) (1 + (((a) - 1) | (sizeof(long) - 1))) |