aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-18 16:37:01 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-18 16:37:01 -0800
commite76757c9213e3bd671eebf0154f379efb8659305 (patch)
tree259e27cb72cbfda7dabb67da253b0f57b5b934b9
parent59a81ace3c9591316cefcff0e1e4913ed8bf555b (diff)
fix function types of main loop funcs in sockets tests
-rw-r--r--tests/module/test_stdin.c8
-rw-r--r--tests/sockets/test_sockets_echo_client.c4
-rw-r--r--tests/sockets/test_sockets_echo_server.c4
-rw-r--r--tests/sockets/test_sockets_partial_client.c4
-rw-r--r--tests/sockets/test_sockets_partial_server.c4
-rw-r--r--tests/sockets/test_sockets_select_server_closes_connection_client_rw.c4
-rw-r--r--tests/sockets/test_sockets_select_server_down_client.c4
-rw-r--r--tests/sockets/test_sockets_select_server_down_server.c4
-rw-r--r--tests/sockets/webrtc_host.c6
-rw-r--r--tests/sockets/webrtc_peer.c6
10 files changed, 24 insertions, 24 deletions
diff --git a/tests/module/test_stdin.c b/tests/module/test_stdin.c
index 4838d466..319c686c 100644
--- a/tests/module/test_stdin.c
+++ b/tests/module/test_stdin.c
@@ -9,7 +9,7 @@
int line = 0;
-void main_loop(void *arg)
+void main_loop()
{
char str[10] = {0};
int ret;
@@ -46,12 +46,12 @@ int main(int argc, char const *argv[])
// SM shell doesn't implement an event loop and therefor doesn't support
// emscripten_set_main_loop. However, its stdin reads are sync so it
// should exit out after calling main_loop once.
- main_loop(NULL);
+ main_loop();
#if EMSCRIPTEN
emscripten_set_main_loop(main_loop, 60, 0);
#else
- while (1) main_loop(NULL); sleep(1);
+ while (1) main_loop(); sleep(1);
#endif
return 0;
-} \ No newline at end of file
+}
diff --git a/tests/sockets/test_sockets_echo_client.c b/tests/sockets/test_sockets_echo_client.c
index 18cff97e..684d767f 100644
--- a/tests/sockets/test_sockets_echo_client.c
+++ b/tests/sockets/test_sockets_echo_client.c
@@ -48,7 +48,7 @@ void finish(int result) {
exit(result);
}
-void main_loop(void *arg) {
+void main_loop() {
static char out[1024*2];
static int pos = 0;
fd_set fdr;
@@ -163,7 +163,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(main_loop, 0, 0);
#else
- while (1) main_loop(NULL);
+ while (1) main_loop();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_echo_server.c b/tests/sockets/test_sockets_echo_server.c
index 850b7e89..b24472e8 100644
--- a/tests/sockets/test_sockets_echo_server.c
+++ b/tests/sockets/test_sockets_echo_server.c
@@ -49,7 +49,7 @@ void cleanup() {
}
}
-void main_loop(void *arg) {
+void main_loop() {
int res;
fd_set fdr;
fd_set fdw;
@@ -189,7 +189,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(main_loop, 60, 0);
#else
- while (1) main_loop(NULL);
+ while (1) main_loop();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_partial_client.c b/tests/sockets/test_sockets_partial_client.c
index dcf90f19..61084b17 100644
--- a/tests/sockets/test_sockets_partial_client.c
+++ b/tests/sockets/test_sockets_partial_client.c
@@ -25,7 +25,7 @@ void finish(int result) {
exit(result);
}
-void iter(void *arg) {
+void iter() {
char buffer[1024];
char packetLength;
fd_set fdr;
@@ -111,7 +111,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(iter, 0, 0);
#else
- while (1) iter(NULL);
+ while (1) iter();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_partial_server.c b/tests/sockets/test_sockets_partial_server.c
index 19f7f2af..f740c307 100644
--- a/tests/sockets/test_sockets_partial_server.c
+++ b/tests/sockets/test_sockets_partial_server.c
@@ -61,7 +61,7 @@ void do_send(int sockfd) {
exit(EXIT_SUCCESS);
}
-void iter(void *arg) {
+void iter() {
int res;
fd_set fdr;
fd_set fdw;
@@ -127,7 +127,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(iter, 60, 0);
#else
- while (1) iter(NULL);
+ while (1) iter();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c b/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c
index 25dcdd05..e69c3ac0 100644
--- a/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c
+++ b/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c
@@ -30,7 +30,7 @@ void finish(int result) {
exit(result);
}
-void main_loop(void *arg) {
+void main_loop() {
static int state = 0;
static int readPos = 0;
static int writePos = 0;
@@ -219,7 +219,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(main_loop, 0, 0);
#else
- while (1) main_loop(NULL);
+ while (1) main_loop();
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/test_sockets_select_server_down_client.c b/tests/sockets/test_sockets_select_server_down_client.c
index 27e200e0..2765a879 100644
--- a/tests/sockets/test_sockets_select_server_down_client.c
+++ b/tests/sockets/test_sockets_select_server_down_client.c
@@ -26,7 +26,7 @@ void finish(int result) {
exit(result);
}
-void iter(void *arg) {
+void iter() {
static int retries = 0;
fd_set sett;
@@ -90,7 +90,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(iter, 0, 0);
#else
- while (1) iter(NULL);
+ while (1) iter();
#endif
return EXIT_FAILURE;
diff --git a/tests/sockets/test_sockets_select_server_down_server.c b/tests/sockets/test_sockets_select_server_down_server.c
index c2e70f33..012932cf 100644
--- a/tests/sockets/test_sockets_select_server_down_server.c
+++ b/tests/sockets/test_sockets_select_server_down_server.c
@@ -14,7 +14,7 @@
#include <emscripten.h>
#endif
-void main_loop(void *arg) {
+void main_loop() {
}
int main() {
@@ -50,7 +50,7 @@ int main() {
#if EMSCRIPTEN
emscripten_set_main_loop(main_loop, 60, 0);
#else
- while (1) main_loop(NULL); sleep(1);
+ while (1) main_loop(); sleep(1);
#endif
return EXIT_SUCCESS;
diff --git a/tests/sockets/webrtc_host.c b/tests/sockets/webrtc_host.c
index 770e59e0..866c875c 100644
--- a/tests/sockets/webrtc_host.c
+++ b/tests/sockets/webrtc_host.c
@@ -26,7 +26,7 @@ struct iovec iov[1];
struct msghdr hdr;
int done = 0;
-void iter(void* arg) {
+void iter() {
int n;
n = recvmsg(sock, &hdr, 0);
@@ -82,8 +82,8 @@ int main(void)
#if EMSCRIPTEN
emscripten_set_main_loop(iter, 0, 0);
#else
- while (!done) iter(NULL);
+ while (!done) iter();
#endif
return EXIT_SUCCESS;
-} \ No newline at end of file
+}
diff --git a/tests/sockets/webrtc_peer.c b/tests/sockets/webrtc_peer.c
index d24979e7..dd44e93e 100644
--- a/tests/sockets/webrtc_peer.c
+++ b/tests/sockets/webrtc_peer.c
@@ -25,7 +25,7 @@ struct iovec iov[1];
struct msghdr hdr;
int done = 0;
-void iter(void* arg) {
+void iter() {
int n;
n = sendmsg(sock, &hdr, 0);
@@ -74,8 +74,8 @@ int main(void)
#if EMSCRIPTEN
emscripten_set_main_loop(iter, 0, 0);
#else
- while (!done) iter(NULL);
+ while (!done) iter();
#endif
return EXIT_SUCCESS;
-} \ No newline at end of file
+}