summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2020-02-15 10:56:25 +0000
committerflorian <florian@openbsd.org>2020-02-15 10:56:25 +0000
commit38a459988215af17cce3cc5e49ee1223b22d36fb (patch)
tree93dfa0fea7fc214c94dbd39ed9201398560db414
parentConsistently perform atomic writes to the ps_flags field of struct (diff)
downloadwireguard-openbsd-38a459988215af17cce3cc5e49ee1223b22d36fb.tar.xz
wireguard-openbsd-38a459988215af17cce3cc5e49ee1223b22d36fb.zip
Get rid of "discards (const) qualifiers" warning in a less convoluted way.
OK schwarze who points out that sufficiently excessive compiler warning settings will still warn for a straight forward (void *) cast.
-rw-r--r--usr.bin/dig/lib/dns/name.c4
-rw-r--r--usr.bin/dig/lib/isc/include/isc/buffer.h9
2 files changed, 3 insertions, 10 deletions
diff --git a/usr.bin/dig/lib/dns/name.c b/usr.bin/dig/lib/dns/name.c
index de3b6474a8a..f790d9f1da9 100644
--- a/usr.bin/dig/lib/dns/name.c
+++ b/usr.bin/dig/lib/dns/name.c
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: name.c,v 1.6 2020/02/13 16:55:20 florian Exp $ */
+/* $Id: name.c,v 1.7 2020/02/15 10:56:25 florian Exp $ */
/*! \file */
#include <ctype.h>
@@ -1982,7 +1982,7 @@ dns_name_fromstring2(dns_name_t *target, const char *src,
REQUIRE(src != NULL);
- isc_buffer_constinit(&buf, src, strlen(src));
+ isc_buffer_init(&buf, (void *)src, strlen(src));
isc_buffer_add(&buf, strlen(src));
if (BINDABLE(target) && target->buffer != NULL)
name = target;
diff --git a/usr.bin/dig/lib/isc/include/isc/buffer.h b/usr.bin/dig/lib/isc/include/isc/buffer.h
index 1d81576b738..190a6496b24 100644
--- a/usr.bin/dig/lib/isc/include/isc/buffer.h
+++ b/usr.bin/dig/lib/isc/include/isc/buffer.h
@@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: buffer.h,v 1.4 2020/02/13 16:57:55 florian Exp $ */
+/* $Id: buffer.h,v 1.5 2020/02/15 10:56:25 florian Exp $ */
#ifndef ISC_BUFFER_H
#define ISC_BUFFER_H 1
@@ -851,13 +851,6 @@ isc_buffer_copyregion(isc_buffer_t *b, const isc_region_t *r);
#define isc_buffer_putuint32 isc__buffer_putuint32
#endif
-#define isc_buffer_constinit(_b, _d, _l) \
- do { \
- union { void *_var; const void *_const; } _deconst; \
- _deconst._const = (_d); \
- isc_buffer_init((_b), _deconst._var, (_l)); \
- } while (0)
-
/*
* No inline method for this one (yet).
*/