summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-12-11 14:17:02 +0100
committerAndreas Schneider <asn@samba.org>2013-12-11 16:27:40 +0100
commit20467324a5508d8efafb087faf1914c87529f052 (patch)
tree3e2ced0fe97091d69b383f30dfe5fdb1dbe90863 /tests
parent11146ca50aa4f2ae55d0a61f3d7dae92c8bca63f (diff)
downloadsocket_wrapper-20467324a5508d8efafb087faf1914c87529f052.tar.gz
socket_wrapper-20467324a5508d8efafb087faf1914c87529f052.tar.xz
socket_wrapper-20467324a5508d8efafb087faf1914c87529f052.zip
tests: use discard_const to get rid of a warning on Solaris
Diffstat (limited to 'tests')
-rw-r--r--tests/echo_srv.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/echo_srv.c b/tests/echo_srv.c
index 32a03da..b290ca8 100644
--- a/tests/echo_srv.c
+++ b/tests/echo_srv.c
@@ -25,6 +25,14 @@
#define BUFSIZE 4194304
#endif /* BUFSIZE */
+#ifndef discard_const
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
+#endif
+
+#ifndef discard_const_p
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#endif
+
struct echo_srv_opts {
int port;
int socktype;
@@ -257,13 +265,13 @@ int main(int argc, char **argv)
int opt;
int optindex;
static struct option long_options[] = {
- {"tcp", no_argument, 0, 't' },
- {"udp", no_argument, 0, 'u' },
- {"bind-addr", required_argument, 0, 'b' },
- {"port", required_argument, 0, 'p' },
- {"daemon", no_argument, 0, 'D' },
- {"pid", required_argument, 0, 0 },
- {0, 0, 0, 0 }
+ { discard_const_p(char, "tcp"), no_argument, 0, 't' },
+ { discard_const_p(char, "udp"), no_argument, 0, 'u' },
+ { discard_const_p(char, "bind-addr"), required_argument, 0, 'b' },
+ { discard_const_p(char, "port"), required_argument, 0, 'p' },
+ { discard_const_p(char, "daemon"), no_argument, 0, 'D' },
+ { discard_const_p(char, "pid"), required_argument, 0, 0 },
+ {0, 0, 0, 0 }
};
opts.port = DFL_PORT;