Commit 445fd347 by Marcus Winter

mtapi_network_c: fixed cpplint warnings

parent 9d9184e6
...@@ -322,7 +322,6 @@ static int embb_mtapi_network_thread(void * args) { ...@@ -322,7 +322,6 @@ static int embb_mtapi_network_thread(void * args) {
} }
} }
} }
} }
} }
} }
......
...@@ -97,4 +97,4 @@ int embb_mtapi_network_socket_recvbuffer_sized( ...@@ -97,4 +97,4 @@ int embb_mtapi_network_socket_recvbuffer_sized(
} }
#endif #endif
#endif // MTAPI_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_ #endif // MTAPI_NETWORK_C_SRC_EMBB_MTAPI_NETWORK_SOCKET_H_
...@@ -51,11 +51,11 @@ static void test( ...@@ -51,11 +51,11 @@ static void test(
EMBB_UNUSED(context); EMBB_UNUSED(context);
EMBB_UNUSED(result_buffer_size); EMBB_UNUSED(result_buffer_size);
EMBB_UNUSED(node_local_data_size); EMBB_UNUSED(node_local_data_size);
int elements = (int)(arguments_size / sizeof(float) / 2); int elements = static_cast<int>(arguments_size / sizeof(float) / 2);
float* a = (float*)arguments; float const * a = reinterpret_cast<float const *>(arguments);
float* b = ((float*)arguments) + elements; float const * b = reinterpret_cast<float const *>(arguments)+elements;
float* c = (float*)result_buffer; float * c = reinterpret_cast<float*>(result_buffer);
float* d = (float*)node_local_data; float const * d = reinterpret_cast<float const *>(node_local_data);
for (int ii = 0; ii < elements; ii++) { for (int ii = 0; ii < elements; ii++) {
c[ii] = a[ii] + b[ii] + d[0]; c[ii] = a[ii] + b[ii] + d[0];
} }
...@@ -72,13 +72,13 @@ void NetworkTaskTest::TestBasic() { ...@@ -72,13 +72,13 @@ void NetworkTaskTest::TestBasic() {
mtapi_task_hndl_t task; mtapi_task_hndl_t task;
mtapi_action_hndl_t network_action, local_action; mtapi_action_hndl_t network_action, local_action;
const int elements = 64; const int kElements = 64;
float arguments[elements * 2]; float arguments[kElements * 2];
float results[elements]; float results[kElements];
for (int ii = 0; ii < elements; ii++) { for (int ii = 0; ii < kElements; ii++) {
arguments[ii] = (float)ii; arguments[ii] = static_cast<float>(ii);
arguments[ii + elements] = (float)ii; arguments[ii + kElements] = static_cast<float>(ii);
} }
mtapi_initialize( mtapi_initialize(
...@@ -90,7 +90,7 @@ void NetworkTaskTest::TestBasic() { ...@@ -90,7 +90,7 @@ void NetworkTaskTest::TestBasic() {
MTAPI_CHECK_STATUS(status); MTAPI_CHECK_STATUS(status);
mtapi_network_plugin_initialize("127.0.0.1", 12345, 5, mtapi_network_plugin_initialize("127.0.0.1", 12345, 5,
elements * 4 * 3 + 32, &status); kElements * 4 * 3 + 32, &status);
MTAPI_CHECK_STATUS(status); MTAPI_CHECK_STATUS(status);
float node_remote = 1.0f; float node_remote = 1.0f;
...@@ -117,8 +117,8 @@ void NetworkTaskTest::TestBasic() { ...@@ -117,8 +117,8 @@ void NetworkTaskTest::TestBasic() {
task = mtapi_task_start( task = mtapi_task_start(
MTAPI_TASK_ID_NONE, MTAPI_TASK_ID_NONE,
job, job,
arguments, elements * 2 * sizeof(float), arguments, kElements * 2 * sizeof(float),
results, elements*sizeof(float), results, kElements*sizeof(float),
MTAPI_DEFAULT_TASK_ATTRIBUTES, MTAPI_DEFAULT_TASK_ATTRIBUTES,
MTAPI_GROUP_NONE, MTAPI_GROUP_NONE,
&status); &status);
...@@ -127,7 +127,7 @@ void NetworkTaskTest::TestBasic() { ...@@ -127,7 +127,7 @@ void NetworkTaskTest::TestBasic() {
mtapi_task_wait(task, MTAPI_INFINITE, &status); mtapi_task_wait(task, MTAPI_INFINITE, &status);
MTAPI_CHECK_STATUS(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); PT_EXPECT_EQ(results[ii], ii * 2 + 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment