diff --git a/mtapi_network_c/src/embb_mtapi_network.c b/mtapi_network_c/src/embb_mtapi_network.c index 1a3b146..8a83b98 100644 --- a/mtapi_network_c/src/embb_mtapi_network.c +++ b/mtapi_network_c/src/embb_mtapi_network.c @@ -322,7 +322,6 @@ static int embb_mtapi_network_thread(void * args) { } } } - } } } @@ -350,7 +349,7 @@ void mtapi_network_plugin_initialize( // (2 sockets each if local) plugin->sockets = (embb_mtapi_network_socket_t*)embb_alloc( sizeof(embb_mtapi_network_socket_t) * (1 + max_connections * 2)); - + err = embb_mtapi_network_socket_initialize(&plugin->sockets[0]); err = embb_mtapi_network_socket_bind_and_listen( &plugin->sockets[0], host, port, max_connections); diff --git a/mtapi_network_c/src/embb_mtapi_network_socket.h b/mtapi_network_c/src/embb_mtapi_network_socket.h index 9beac5e..531cb92 100644 --- a/mtapi_network_c/src/embb_mtapi_network_socket.h +++ b/mtapi_network_c/src/embb_mtapi_network_socket.h @@ -97,4 +97,4 @@ int embb_mtapi_network_socket_recvbuffer_sized( } #endif -#endif // MTAPI_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ +#endif // MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ diff --git a/mtapi_network_c/test/embb_mtapi_network_test_task.cc b/mtapi_network_c/test/embb_mtapi_network_test_task.cc index e52c9b5..cec09a2 100644 --- a/mtapi_network_c/test/embb_mtapi_network_test_task.cc +++ b/mtapi_network_c/test/embb_mtapi_network_test_task.cc @@ -51,11 +51,11 @@ static void test( EMBB_UNUSED(context); EMBB_UNUSED(result_buffer_size); EMBB_UNUSED(node_local_data_size); - int elements = (int)(arguments_size / sizeof(float) / 2); - float* a = (float*)arguments; - float* b = ((float*)arguments) + elements; - float* c = (float*)result_buffer; - float* d = (float*)node_local_data; + int elements = static_cast(arguments_size / sizeof(float) / 2); + float const * a = reinterpret_cast(arguments); + float const * b = reinterpret_cast(arguments)+elements; + float * c = reinterpret_cast(result_buffer); + float const * d = reinterpret_cast(node_local_data); for (int ii = 0; ii < elements; ii++) { c[ii] = a[ii] + b[ii] + d[0]; } @@ -72,13 +72,13 @@ void NetworkTaskTest::TestBasic() { mtapi_task_hndl_t task; mtapi_action_hndl_t network_action, local_action; - const int elements = 64; - float arguments[elements * 2]; - float results[elements]; + const int kElements = 64; + float arguments[kElements * 2]; + float results[kElements]; - for (int ii = 0; ii < elements; ii++) { - arguments[ii] = (float)ii; - arguments[ii + elements] = (float)ii; + for (int ii = 0; ii < kElements; ii++) { + arguments[ii] = static_cast(ii); + arguments[ii + kElements] = static_cast(ii); } mtapi_initialize( @@ -90,7 +90,7 @@ void NetworkTaskTest::TestBasic() { MTAPI_CHECK_STATUS(status); mtapi_network_plugin_initialize("127.0.0.1", 12345, 5, - elements * 4 * 3 + 32, &status); + kElements * 4 * 3 + 32, &status); MTAPI_CHECK_STATUS(status); float node_remote = 1.0f; @@ -117,8 +117,8 @@ void NetworkTaskTest::TestBasic() { task = mtapi_task_start( MTAPI_TASK_ID_NONE, job, - arguments, elements * 2 * sizeof(float), - results, elements*sizeof(float), + arguments, kElements * 2 * sizeof(float), + results, kElements*sizeof(float), MTAPI_DEFAULT_TASK_ATTRIBUTES, MTAPI_GROUP_NONE, &status); @@ -127,7 +127,7 @@ void NetworkTaskTest::TestBasic() { mtapi_task_wait(task, MTAPI_INFINITE, &status); MTAPI_CHECK_STATUS(status); - for (int ii = 0; ii < elements; ii++) { + for (int ii = 0; ii < kElements; ii++) { PT_EXPECT_EQ(results[ii], ii * 2 + 1); }