Commit 932c8472 authored by Andreas Schmidt's avatar Andreas Schmidt

CMake uses C99.

parent 09366a58
Pipeline #82 passed with stage
......@@ -5,6 +5,10 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "-fstack-protector -fstack-protector-all -Wall -pedantic" )
set(CMAKE_CXX_FLAGS_DEBUG "-O2 -Wall -ggdb" )
set(CMAKE_CXX_FLAGS_RELEASE "-Os -Wall" )
enable_testing()
find_package (Threads)
......
......@@ -2,7 +2,9 @@ add_subdirectory(prrt)
add_subdirectory(util)
add_executable(sender sender.c)
set_property(TARGET sender PROPERTY C_STANDARD 99)
add_executable(receiver receiver.c)
set_property(TARGET receiver PROPERTY C_STANDARD 99)
target_link_libraries(sender LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(receiver LINK_PUBLIC PRRT UTIL ${CMAKE_THREAD_LIBS_INIT})
\ No newline at end of file
add_library(PRRT ../defines.h socket.c block.c block.h packet.c packet.h receiver.c receiver.h clock.c clock.h channelStateInformation.c channelStateInformation.h processes/feedback_receiver.c processes/feedback_receiver.h processes/data_transmitter.c processes/data_transmitter.h coding_params.c coding_params.h vdmcode/block_code.c vdmcode/block_code.h coding_params.c coding_params.h stores/forward_packet_table.c stores/forward_packet_table.h processes/data_receiver.c processes/data_receiver.h)
\ No newline at end of file
add_library(PRRT ../defines.h socket.c block.c block.h packet.c packet.h receiver.c receiver.h clock.c clock.h channelStateInformation.c channelStateInformation.h processes/feedback_receiver.c processes/feedback_receiver.h processes/data_transmitter.c processes/data_transmitter.h coding_params.c coding_params.h vdmcode/block_code.c vdmcode/block_code.h coding_params.c coding_params.h stores/forward_packet_table.c stores/forward_packet_table.h processes/data_receiver.c processes/data_receiver.h)
set_property(TARGET PRRT PROPERTY C_STANDARD 99)
\ No newline at end of file
......@@ -2,4 +2,5 @@ add_subdirectory(lib/gtest-1.7.0)
include_directories(SYSTEM ${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_executable(prrtTests forward_packet_table_tests.cpp bptree_tests.cpp PrrtBlock_tests.cpp)
set_property(TARGET prrtTests PROPERTY C_STANDARD 99)
target_link_libraries(prrtTests LINK_PUBLIC PRRT UTIL gtest gtest_main)
\ No newline at end of file
......@@ -106,7 +106,7 @@ TEST_F(PrrtBlockTest, EncodeDecode)
PrrtPacket *redPackets = (PrrtPacket *) calloc(4, sizeof(PrrtPacket));
for(int i = 0; i < 4; i++) {
for(uint32_t i = 0; i < 4; i++) {
char data[3];
sprintf(data, "%d", i);
packets[i] = PrrtPacket_create_data_packet(0, data, (uint32_t) strlen(data), i+1);
......@@ -117,7 +117,7 @@ TEST_F(PrrtBlockTest, EncodeDecode)
// ENCODING
ASSERT_TRUE(PrrtBlock_encode_ready(encBlock));
int j = 0;
uint32_t j = 0;
PrrtBlock_encode(encBlock, &base);
uint32_t pkt_count = List_count(encBlock->dataPackets);
......
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 to comment