diff options
author | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2020-09-22 20:20:43 +0000 |
---|---|---|
committer | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2020-09-22 20:20:43 +0000 |
commit | 92c5d82c86f1fde4462e7a37238c13e227eabec5 (patch) | |
tree | 5368030ce1f089eba78707825f388d7826dd01f1 /lib | |
parent | 8e13d6dfb6e42ac2d55258d6425dcbba428a58f4 (diff) | |
download | src-92c5d82c86f1fde4462e7a37238c13e227eabec5.tar.gz src-92c5d82c86f1fde4462e7a37238c13e227eabec5.zip |
libnetmap: fix cast from uint64_t to void*
We use uintptr_t as an intermediate cast to avoid compiler
warnings on 32 bit architectures.
Reported by: adrian
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=366011
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libnetmap/libnetmap.h | 4 | ||||
-rw-r--r-- | lib/libnetmap/nmport.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libnetmap/libnetmap.h b/lib/libnetmap/libnetmap.h index 6736ee9cc46b..0367a1735c4f 100644 --- a/lib/libnetmap/libnetmap.h +++ b/lib/libnetmap/libnetmap.h @@ -554,9 +554,9 @@ struct nmreq_option *nmreq_find_option(struct nmreq_header *, uint32_t); void nmreq_free_options(struct nmreq_header *); const char* nmreq_option_name(uint32_t); #define nmreq_foreach_option(h_, o_) \ - for ((o_) = (struct nmreq_option *)((h_)->nr_options);\ + for ((o_) = (struct nmreq_option *)((uintptr_t)((h_)->nr_options));\ (o_) != NULL;\ - (o_) = (struct nmreq_option *)((o_)->nro_next)) + (o_) = (struct nmreq_option *)((uintptr_t)((o_)->nro_next))) /* nmctx manipulation */ diff --git a/lib/libnetmap/nmport.c b/lib/libnetmap/nmport.c index ec39172a0b1e..a3fd7e87100f 100644 --- a/lib/libnetmap/nmport.c +++ b/lib/libnetmap/nmport.c @@ -614,7 +614,7 @@ nmport_mmap(struct nmport_d *d) } memset(m, 0, sizeof(*m)); if (d->extmem != NULL) { - m->mem = (void *)d->extmem->nro_usrptr; + m->mem = (void *)((uintptr_t)d->extmem->nro_usrptr); m->size = d->extmem->nro_info.nr_memsize; m->is_extmem = 1; } else { |