summaryrefslogtreecommitdiff
path: root/deps
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-03-23 23:43:16 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-03-23 23:43:16 +0900
commit16d67e9b32453fb2828f7a6abcac4496b1aed7e5 (patch)
tree5ee334bd81992485f2378268ab8cb29a092ccb53 /deps
parent4c4e1dcf9bec203e1100e6b43727da27e7af9466 (diff)
Updated wslay
Diffstat (limited to 'deps')
-rw-r--r--deps/wslay/configure.ac22
-rw-r--r--deps/wslay/lib/Makefile.am2
-rw-r--r--deps/wslay/lib/wslay_event.c15
-rw-r--r--deps/wslay/lib/wslay_event.h2
-rw-r--r--deps/wslay/lib/wslay_frame.c14
-rw-r--r--deps/wslay/lib/wslay_net.c32
-rw-r--r--deps/wslay/lib/wslay_net.h17
-rw-r--r--deps/wslay/lib/wslay_queue.c17
-rw-r--r--deps/wslay/lib/wslay_queue.h2
-rw-r--r--deps/wslay/tests/main.c6
-rw-r--r--deps/wslay/tests/wslay_event_test.c26
-rw-r--r--deps/wslay/tests/wslay_event_test.h26
-rw-r--r--deps/wslay/tests/wslay_frame_test.c40
-rw-r--r--deps/wslay/tests/wslay_frame_test.h36
-rw-r--r--deps/wslay/tests/wslay_queue_test.c2
-rw-r--r--deps/wslay/tests/wslay_queue_test.h4
16 files changed, 124 insertions, 139 deletions
diff --git a/deps/wslay/configure.ac b/deps/wslay/configure.ac
index fae2f84e..08d961da 100644
--- a/deps/wslay/configure.ac
+++ b/deps/wslay/configure.ac
@@ -31,6 +31,10 @@ AC_SUBST(LT_CURRENT, 0)
AC_SUBST(LT_REVISION, 0)
AC_SUBST(LT_AGE, 0)
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE()
@@ -51,6 +55,13 @@ AC_CHECK_LIB([cunit], [CU_initialize_registry],
[have_cunit=yes], [have_cunit=no])
AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
+case "$target" in
+ *mingw*)
+ # Required for ntoh*/hton* functions.
+ LIBS="-lws2_32 $LIBS"
+ ;;
+esac
+
# Checks for header files.
AC_CHECK_HEADERS([ \
arpa/inet.h \
@@ -62,6 +73,13 @@ AC_CHECK_HEADERS([ \
unistd.h \
])
+# Need winsock2.h for ntoh*/hton* functions.
+case "$target" in
+ *mingw*)
+ AC_CHECK_HEADERS([winsock2.h])
+ ;;
+esac
+
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
@@ -73,7 +91,9 @@ AC_CHECK_TYPES([ptrdiff_t])
AC_C_BIGENDIAN
# Checks for library functions.
-AC_FUNC_MALLOC
+if test "x$cross_compiling" != "xyes"; then
+ AC_FUNC_MALLOC
+fi
AC_CHECK_FUNCS([ \
memmove \
memset \
diff --git a/deps/wslay/lib/Makefile.am b/deps/wslay/lib/Makefile.am
index 51516313..4a397648 100644
--- a/deps/wslay/lib/Makefile.am
+++ b/deps/wslay/lib/Makefile.am
@@ -23,7 +23,7 @@
SUBDIRS = includes
AM_CFLAGS = -Wall
-AM_CPPFLAGS = -I$(srcdir)/includes -I$(builddir)/includes
+AM_CPPFLAGS = @DEFS@ -I$(srcdir)/includes -I$(builddir)/includes
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libwslay.pc
diff --git a/deps/wslay/lib/wslay_event.c b/deps/wslay/lib/wslay_event.c
index a01c9df1..926a5183 100644
--- a/deps/wslay/lib/wslay_event.c
+++ b/deps/wslay/lib/wslay_event.c
@@ -507,12 +507,12 @@ static void wslay_event_call_on_frame_recv_chunk_callback
(wslay_event_context_ptr ctx, const struct wslay_frame_iocb *iocb)
{
if(ctx->callbacks.on_frame_recv_chunk_callback) {
- struct wslay_event_on_frame_recv_chunk_arg arg = {
- iocb->data, iocb->data_length
- };
+ struct wslay_event_on_frame_recv_chunk_arg arg;
+ arg.data = iocb->data;
+ arg.data_length = iocb->data_length;
ctx->callbacks.on_frame_recv_chunk_callback(ctx, &arg, ctx->user_data);
}
-};
+}
static void wslay_event_call_on_frame_recv_end_callback
(wslay_event_context_ptr ctx)
@@ -697,9 +697,10 @@ int wslay_event_recv(wslay_event_context_ptr ctx)
return r;
}
} else if(ctx->imsg->opcode == WSLAY_PING) {
- struct wslay_event_msg arg = {
- WSLAY_PONG, msg, ctx->imsg->msg_length
- };
+ struct wslay_event_msg arg;
+ arg.opcode = WSLAY_PONG;
+ arg.msg = msg;
+ arg.msg_length = ctx->imsg->msg_length;
if((r = wslay_event_queue_msg(ctx, &arg)) &&
r != WSLAY_ERR_NO_MORE_MSG) {
ctx->read_enabled = 0;
diff --git a/deps/wslay/lib/wslay_event.h b/deps/wslay/lib/wslay_event.h
index d1a59d44..f1826cb8 100644
--- a/deps/wslay/lib/wslay_event.h
+++ b/deps/wslay/lib/wslay_event.h
@@ -73,7 +73,7 @@ struct wslay_event_frame_user_data {
enum wslay_event_close_status {
WSLAY_CLOSE_RECEIVED = 1 << 0,
WSLAY_CLOSE_QUEUED = 1 << 1,
- WSLAY_CLOSE_SENT = 1 << 2,
+ WSLAY_CLOSE_SENT = 1 << 2
};
enum wslay_event_config {
diff --git a/deps/wslay/lib/wslay_frame.c b/deps/wslay/lib/wslay_frame.c
index 74bb0b24..16359d8c 100644
--- a/deps/wslay/lib/wslay_frame.c
+++ b/deps/wslay/lib/wslay_frame.c
@@ -26,9 +26,6 @@
#include <stddef.h>
#include <string.h>
-#ifdef HAVE_ARPA_INET_H
-# include <arpa/inet.h>
-#endif // HAVE_ARPA_INET_H
#include <assert.h>
#include "wslay_net.h"
@@ -142,17 +139,18 @@ ssize_t wslay_frame_send(wslay_frame_context_ptr ctx,
const uint8_t *datamark = iocb->data,
*datalimit = iocb->data+iocb->data_length;
while(datamark < datalimit) {
+ size_t datalen = datalimit - datamark;
const uint8_t *writelimit = datamark+
- wslay_min(sizeof(temp), datalimit-datamark);
+ wslay_min(sizeof(temp), datalen);
size_t writelen = writelimit-datamark;
ssize_t r;
- int i;
+ size_t i;
for(i = 0; i < writelen; ++i) {
temp[i] = datamark[i]^ctx->omaskkey[(ctx->opayloadoff+i)%4];
}
r = ctx->callbacks.send_callback(temp, writelen, 0, ctx->user_data);
if(r > 0) {
- if(r > writelen) {
+ if((size_t)r > writelen) {
return WSLAY_ERR_INVALID_CALLBACK;
} else {
datamark += r;
@@ -172,7 +170,7 @@ ssize_t wslay_frame_send(wslay_frame_context_ptr ctx,
r = ctx->callbacks.send_callback(iocb->data, iocb->data_length, 0,
ctx->user_data);
if(r > 0) {
- if(r > iocb->data_length) {
+ if((size_t)r > iocb->data_length) {
return WSLAY_ERR_INVALID_CALLBACK;
} else {
ctx->opayloadoff += r;
@@ -216,7 +214,7 @@ static ssize_t wslay_recv(wslay_frame_context_ptr ctx)
return r;
}
-#define WSLAY_AVAIL_IBUF(ctx) (ctx->ibuflimit-ctx->ibufmark)
+#define WSLAY_AVAIL_IBUF(ctx) ((size_t)(ctx->ibuflimit - ctx->ibufmark))
ssize_t wslay_frame_recv(wslay_frame_context_ptr ctx,
struct wslay_frame_iocb *iocb)
diff --git a/deps/wslay/lib/wslay_net.c b/deps/wslay/lib/wslay_net.c
index eedd0a62..d3867c21 100644
--- a/deps/wslay/lib/wslay_net.c
+++ b/deps/wslay/lib/wslay_net.c
@@ -26,37 +26,11 @@
#ifndef WORDS_BIGENDIAN
-static uint16_t byteswap16(uint16_t x)
-{
- return ((x & 0xffu) << 8) | (x >> 8);;
-}
-
-#ifdef HAVE_NTOHL
-# define byteswap32(x) ntohl(x)
-#else /* !HAVE_NTOHL */
-static uint32_t byteswap32(uint32_t x)
-{
- uint32_t u = byteswap16(x & 0xffffu);
- uint32_t l = byteswap16(x >> 16);
- return (u << 16) | l;
-}
-#endif /* !HAVE_NTOHL */
-
-static uint64_t byteswap64(uint64_t x)
-{
- uint64_t u = byteswap32(x & 0xffffffffllu);
- uint64_t l = byteswap32(x >> 32);
- return (u << 32) | l;
-}
-
-uint16_t wslay_byteswap16(uint16_t x)
-{
- return byteswap16(x);
-}
-
uint64_t wslay_byteswap64(uint64_t x)
{
- return byteswap64(x);
+ uint64_t u = ntohl(x & 0xffffffffllu);
+ uint64_t l = ntohl(x >> 32);
+ return (u << 32) | l;
}
#endif /* !WORDS_BIGENDIAN */
diff --git a/deps/wslay/lib/wslay_net.h b/deps/wslay/lib/wslay_net.h
index 60d0c91c..23108701 100644
--- a/deps/wslay/lib/wslay_net.h
+++ b/deps/wslay/lib/wslay_net.h
@@ -37,25 +37,16 @@
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
+/* For Mingw build */
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif /* HAVE_WINSOCK2_H */
#ifdef WORDS_BIGENDIAN
-# ifndef HAVE_HTONS
-# define htons(x) (x)
-# endif /* !HAVE_HTONS */
-# ifndef HAVE_NTOHS
-# define ntohs(x) (x)
-# endif /* !HAVE_NTOHS */
# define ntoh64(x) (x)
# define hton64(x) (x)
#else /* !WORDS_BIGENDIAN */
-uint16_t wslay_byteswap16(uint16_t x);
uint64_t wslay_byteswap64(uint64_t x);
-# ifndef HAVE_HTONS
-# define htons(x) wslay_byteswap16(x)
-# endif /* !HAVE_HTONS */
-# ifndef HAVE_NTOHS
-# define ntohs(x) wslay_byteswap16(x)
-# endif /* !HAVE_NTOHS */
# define ntoh64(x) wslay_byteswap64(x)
# define hton64(x) wslay_byteswap64(x)
#endif /* !WORDS_BIGENDIAN */
diff --git a/deps/wslay/lib/wslay_queue.c b/deps/wslay/lib/wslay_queue.c
index 534684a0..8d266968 100644
--- a/deps/wslay/lib/wslay_queue.c
+++ b/deps/wslay/lib/wslay_queue.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <assert.h>
-struct wslay_queue* wslay_queue_new()
+struct wslay_queue* wslay_queue_new(void)
{
struct wslay_queue *queue = (struct wslay_queue*)malloc
(sizeof(struct wslay_queue));
@@ -42,14 +42,15 @@ void wslay_queue_free(struct wslay_queue *queue)
{
if(!queue) {
return;
+ } else {
+ struct wslay_queue_cell *p = queue->top;
+ while(p) {
+ struct wslay_queue_cell *next = p->next;
+ free(p);
+ p = next;
+ }
+ free(queue);
}
- struct wslay_queue_cell *p = queue->top;
- while(p) {
- struct wslay_queue_cell *next = p->next;
- free(p);
- p = next;
- }
- free(queue);
}
int wslay_queue_push(struct wslay_queue *queue, void *data)
diff --git a/deps/wslay/lib/wslay_queue.h b/deps/wslay/lib/wslay_queue.h
index 205852ed..55e78a04 100644
--- a/deps/wslay/lib/wslay_queue.h
+++ b/deps/wslay/lib/wslay_queue.h
@@ -41,7 +41,7 @@ struct wslay_queue {
struct wslay_queue_cell *tail;
};
-struct wslay_queue* wslay_queue_new();
+struct wslay_queue* wslay_queue_new(void);
void wslay_queue_free(struct wslay_queue *queue);
int wslay_queue_push(struct wslay_queue *queue, void *data);
int wslay_queue_push_front(struct wslay_queue *queue, void *data);
diff --git a/deps/wslay/tests/main.c b/deps/wslay/tests/main.c
index c68e1f9e..360a6d4a 100644
--- a/deps/wslay/tests/main.c
+++ b/deps/wslay/tests/main.c
@@ -30,18 +30,18 @@
#include "wslay_event_test.h"
#include "wslay_queue_test.h"
-int init_suite1(void)
+static int init_suite1(void)
{
return 0;
}
-int clean_suite1(void)
+static int clean_suite1(void)
{
return 0;
}
-int main()
+int main(void)
{
CU_pSuite pSuite = NULL;
diff --git a/deps/wslay/tests/wslay_event_test.c b/deps/wslay/tests/wslay_event_test.c
index 15bfdfa4..1bcc5065 100644
--- a/deps/wslay/tests/wslay_event_test.c
+++ b/deps/wslay/tests/wslay_event_test.c
@@ -133,7 +133,7 @@ static ssize_t fail_send_callback(wslay_event_context_ptr ctx,
}
-void test_wslay_event_send_fragmented_msg()
+void test_wslay_event_send_fragmented_msg(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -166,7 +166,7 @@ void test_wslay_event_send_fragmented_msg()
wslay_event_context_free(ctx);
}
-void test_wslay_event_send_fragmented_msg_with_ctrl()
+void test_wslay_event_send_fragmented_msg_with_ctrl(void)
{
int i;
wslay_event_context_ptr ctx;
@@ -214,7 +214,7 @@ void test_wslay_event_send_fragmented_msg_with_ctrl()
wslay_event_context_free(ctx);
}
-void test_wslay_event_send_ctrl_msg_first()
+void test_wslay_event_send_ctrl_msg_first(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -246,7 +246,7 @@ void test_wslay_event_send_ctrl_msg_first()
wslay_event_context_free(ctx);
}
-void test_wslay_event_queue_close()
+void test_wslay_event_queue_close(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -270,7 +270,7 @@ void test_wslay_event_queue_close()
wslay_event_context_free(ctx);
}
-void test_wslay_event_queue_close_without_code()
+void test_wslay_event_queue_close_without_code(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -284,7 +284,7 @@ void test_wslay_event_queue_close_without_code()
ud.acc = &acc;
wslay_event_context_server_init(&ctx, &callbacks, &ud);
CU_ASSERT(0 == wslay_event_queue_msg(ctx, &ping));
- // See that ping is not sent because close frame is queued
+ /* See that ping is not sent because close frame is queued */
CU_ASSERT(0 == wslay_event_queue_close(ctx, 0, NULL, 0));
CU_ASSERT(0 == wslay_event_send(ctx));
CU_ASSERT(2 == acc.length);
@@ -295,7 +295,7 @@ void test_wslay_event_queue_close_without_code()
wslay_event_context_free(ctx);
}
-void test_wslay_event_recv_close_without_code()
+void test_wslay_event_recv_close_without_code(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -314,7 +314,7 @@ void test_wslay_event_recv_close_without_code()
wslay_event_context_free(ctx);
}
-void test_wslay_event_reply_close()
+void test_wslay_event_reply_close(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -360,7 +360,7 @@ void test_wslay_event_reply_close()
wslay_event_context_free(ctx);
}
-void test_wslay_event_no_more_msg()
+void test_wslay_event_no_more_msg(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -371,7 +371,7 @@ void test_wslay_event_no_more_msg()
wslay_event_context_free(ctx);
}
-void test_wslay_event_callback_failure()
+void test_wslay_event_callback_failure(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -398,7 +398,7 @@ static void no_buffering_callback(wslay_event_context_ptr ctx,
}
}
-void test_wslay_event_no_buffering()
+void test_wslay_event_no_buffering(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -422,7 +422,7 @@ void test_wslay_event_no_buffering()
wslay_event_context_free(ctx);
}
-void test_wslay_event_frame_too_big()
+void test_wslay_event_frame_too_big(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
@@ -455,7 +455,7 @@ void test_wslay_event_frame_too_big()
wslay_event_context_free(ctx);
}
-void test_wslay_event_message_too_big()
+void test_wslay_event_message_too_big(void)
{
wslay_event_context_ptr ctx;
struct wslay_event_callbacks callbacks;
diff --git a/deps/wslay/tests/wslay_event_test.h b/deps/wslay/tests/wslay_event_test.h
index c33e906e..7814b106 100644
--- a/deps/wslay/tests/wslay_event_test.h
+++ b/deps/wslay/tests/wslay_event_test.h
@@ -25,17 +25,17 @@
#ifndef WSLAY_EVENT_TEST_H
#define WSLAY_EVENT_TEST_H
-void test_wslay_event_send_fragmented_msg();
-void test_wslay_event_send_fragmented_msg_with_ctrl();
-void test_wslay_event_send_ctrl_msg_first();
-void test_wslay_event_queue_close();
-void test_wslay_event_queue_close_without_code();
-void test_wslay_event_recv_close_without_code();
-void test_wslay_event_reply_close();
-void test_wslay_event_no_more_msg();
-void test_wslay_event_callback_failure();
-void test_wslay_event_no_buffering();
-void test_wslay_event_frame_too_big();
-void test_wslay_event_message_too_big();
+void test_wslay_event_send_fragmented_msg(void);
+void test_wslay_event_send_fragmented_msg_with_ctrl(void);
+void test_wslay_event_send_ctrl_msg_first(void);
+void test_wslay_event_queue_close(void);
+void test_wslay_event_queue_close_without_code(void);
+void test_wslay_event_recv_close_without_code(void);
+void test_wslay_event_reply_close(void);
+void test_wslay_event_no_more_msg(void);
+void test_wslay_event_callback_failure(void);
+void test_wslay_event_no_buffering(void);
+void test_wslay_event_frame_too_big(void);
+void test_wslay_event_message_too_big(void);
-#endif // WSLAY_EVENT_TEST_H
+#endif /* WSLAY_EVENT_TEST_H */
diff --git a/deps/wslay/tests/wslay_frame_test.c b/deps/wslay/tests/wslay_frame_test.c
index 66d0e955..9ad3d305 100644
--- a/deps/wslay/tests/wslay_frame_test.c
+++ b/deps/wslay/tests/wslay_frame_test.c
@@ -30,7 +30,7 @@
#include "wslay_frame.h"
-void test_wslay_frame_context_init()
+void test_wslay_frame_context_init(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks;
@@ -88,7 +88,7 @@ static ssize_t scripted_send_callback(const uint8_t* data, size_t len,
return wlen;
}
-void test_wslay_frame_recv()
+void test_wslay_frame_recv(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -114,7 +114,7 @@ void test_wslay_frame_recv()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_1byte()
+void test_wslay_frame_recv_1byte(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -122,7 +122,7 @@ void test_wslay_frame_recv_1byte()
NULL };
struct scripted_data_feed df;
struct wslay_frame_iocb iocb;
- int i;
+ size_t i;
/* Masked text frame containing "Hello" */
uint8_t msg[] = { 0x81u, 0x85u, 0x37u, 0xfau, 0x21u, 0x3du, 0x7fu, 0x9fu,
0x4du, 0x51u, 0x58u };
@@ -150,7 +150,7 @@ void test_wslay_frame_recv_1byte()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_fragmented()
+void test_wslay_frame_recv_fragmented(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -187,7 +187,7 @@ void test_wslay_frame_recv_fragmented()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_interleaved_ctrl_frame()
+void test_wslay_frame_recv_interleaved_ctrl_frame(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -236,7 +236,7 @@ void test_wslay_frame_recv_interleaved_ctrl_frame()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_zero_payloadlen()
+void test_wslay_frame_recv_zero_payloadlen(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -261,7 +261,7 @@ void test_wslay_frame_recv_zero_payloadlen()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_too_large_payload()
+void test_wslay_frame_recv_too_large_payload(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -278,7 +278,7 @@ void test_wslay_frame_recv_too_large_payload()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_ctrl_frame_too_large_payload()
+void test_wslay_frame_recv_ctrl_frame_too_large_payload(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -295,7 +295,7 @@ void test_wslay_frame_recv_ctrl_frame_too_large_payload()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_minimum_ext_payload16()
+void test_wslay_frame_recv_minimum_ext_payload16(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -312,7 +312,7 @@ void test_wslay_frame_recv_minimum_ext_payload16()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_recv_minimum_ext_payload64()
+void test_wslay_frame_recv_minimum_ext_payload64(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { NULL,
@@ -347,12 +347,12 @@ static ssize_t accumulator_send_callback(const uint8_t *buf, size_t len,
static int static_genmask_callback(uint8_t *buf, size_t len,
void* user_data)
{
- const static uint8_t makskey[] = { 0x37u, 0xfau, 0x21u, 0x3du };
+ static const uint8_t makskey[] = { 0x37u, 0xfau, 0x21u, 0x3du };
memcpy(buf, makskey, 4);
return 0;
}
-void test_wslay_frame_send()
+void test_wslay_frame_send(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { accumulator_send_callback,
@@ -379,7 +379,7 @@ void test_wslay_frame_send()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_send_fragmented()
+void test_wslay_frame_send_fragmented(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { accumulator_send_callback,
@@ -416,7 +416,7 @@ void test_wslay_frame_send_fragmented()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_send_interleaved_ctrl_frame()
+void test_wslay_frame_send_interleaved_ctrl_frame(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { accumulator_send_callback,
@@ -467,7 +467,7 @@ void test_wslay_frame_send_interleaved_ctrl_frame()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_send_1byte_masked()
+void test_wslay_frame_send_1byte_masked(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { scripted_send_callback,
@@ -479,7 +479,7 @@ void test_wslay_frame_send_1byte_masked()
0x4du, 0x51u, 0x58u };
uint8_t hello[] = "Hello";
struct scripted_data_feed df;
- int i;
+ size_t i;
scripted_data_feed_init(&df, NULL, 0);
for(i = 0; i < sizeof(msg); ++i) {
df.feedseq[i] = 1;
@@ -500,7 +500,7 @@ void test_wslay_frame_send_1byte_masked()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_send_zero_payloadlen()
+void test_wslay_frame_send_zero_payloadlen(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks = { accumulator_send_callback,
@@ -525,7 +525,7 @@ void test_wslay_frame_send_zero_payloadlen()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_send_too_large_payload()
+void test_wslay_frame_send_too_large_payload(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks;
@@ -542,7 +542,7 @@ void test_wslay_frame_send_too_large_payload()
wslay_frame_context_free(ctx);
}
-void test_wslay_frame_send_ctrl_frame_too_large_payload()
+void test_wslay_frame_send_ctrl_frame_too_large_payload(void)
{
wslay_frame_context_ptr ctx;
struct wslay_frame_callbacks callbacks;
diff --git a/deps/wslay/tests/wslay_frame_test.h b/deps/wslay/tests/wslay_frame_test.h
index 03693b68..e45291ae 100644
--- a/deps/wslay/tests/wslay_frame_test.h
+++ b/deps/wslay/tests/wslay_frame_test.h
@@ -25,22 +25,22 @@
#ifndef WSLAY_FRAME_TEST_H
#define WSLAY_FRAME_TEST_H
-void test_wslay_frame_context_init();
-void test_wslay_frame_recv();
-void test_wslay_frame_recv_1byte();
-void test_wslay_frame_recv_fragmented();
-void test_wslay_frame_recv_interleaved_ctrl_frame();
-void test_wslay_frame_recv_zero_payloadlen();
-void test_wslay_frame_recv_too_large_payload();
-void test_wslay_frame_recv_ctrl_frame_too_large_payload();
-void test_wslay_frame_recv_minimum_ext_payload16();
-void test_wslay_frame_recv_minimum_ext_payload64();
-void test_wslay_frame_send();
-void test_wslay_frame_send_fragmented();
-void test_wslay_frame_send_interleaved_ctrl_frame();
-void test_wslay_frame_send_1byte_masked();
-void test_wslay_frame_send_zero_payloadlen();
-void test_wslay_frame_send_too_large_payload();
-void test_wslay_frame_send_ctrl_frame_too_large_payload();
+void test_wslay_frame_context_init(void);
+void test_wslay_frame_recv(void);
+void test_wslay_frame_recv_1byte(void);
+void test_wslay_frame_recv_fragmented(void);
+void test_wslay_frame_recv_interleaved_ctrl_frame(void);
+void test_wslay_frame_recv_zero_payloadlen(void);
+void test_wslay_frame_recv_too_large_payload(void);
+void test_wslay_frame_recv_ctrl_frame_too_large_payload(void);
+void test_wslay_frame_recv_minimum_ext_payload16(void);
+void test_wslay_frame_recv_minimum_ext_payload64(void);
+void test_wslay_frame_send(void);
+void test_wslay_frame_send_fragmented(void);
+void test_wslay_frame_send_interleaved_ctrl_frame(void);
+void test_wslay_frame_send_1byte_masked(void);
+void test_wslay_frame_send_zero_payloadlen(void);
+void test_wslay_frame_send_too_large_payload(void);
+void test_wslay_frame_send_ctrl_frame_too_large_payload(void);
-#endif // WSLAY_FRAME_TEST_H
+#endif /* WSLAY_FRAME_TEST_H */
diff --git a/deps/wslay/tests/wslay_queue_test.c b/deps/wslay/tests/wslay_queue_test.c
index 1efdf4a8..83fa8618 100644
--- a/deps/wslay/tests/wslay_queue_test.c
+++ b/deps/wslay/tests/wslay_queue_test.c
@@ -28,7 +28,7 @@
#include "wslay_queue.h"
-void test_wslay_queue()
+void test_wslay_queue(void)
{
int ints[] = { 1, 2, 3, 4, 5 };
int i;
diff --git a/deps/wslay/tests/wslay_queue_test.h b/deps/wslay/tests/wslay_queue_test.h
index d75b5cf8..7b0c81fd 100644
--- a/deps/wslay/tests/wslay_queue_test.h
+++ b/deps/wslay/tests/wslay_queue_test.h
@@ -25,6 +25,6 @@
#ifndef WSLAY_QUEUE_TEST_H
#define WSLAY_QUEUE_TEST_H
-void test_wslay_queue();
+void test_wslay_queue(void);
-#endif // WSLAY_QUEUE_TEST_H
+#endif /* WSLAY_QUEUE_TEST_H */