From 9e7b8e02b478a5d930f6d9a503ee3d1af30c6719 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 21:11:16 +0300 Subject: [PATCH 1/3] ftl-sdk: Get rid of generic warnings --- ftl_app/bitstream.c | 1 + ftl_app/main.c | 2 ++ libftl/ftl_private.h | 2 +- libftl/ingest.c | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ftl_app/bitstream.c b/ftl_app/bitstream.c index a2d08d2..4a0a28c 100644 --- a/ftl_app/bitstream.c +++ b/ftl_app/bitstream.c @@ -1,3 +1,4 @@ +#include "dec_obj.h" #include "utils.h" #include "bitstream.h" diff --git a/ftl_app/main.c b/ftl_app/main.c index 7750e50..940d861 100644 --- a/ftl_app/main.c +++ b/ftl_app/main.c @@ -22,6 +22,7 @@ * SOFTWARE. **/ +#include "ftl.h" #include "main.h" #include "gettimeofday.h" #ifdef _WIN32 @@ -34,6 +35,7 @@ #include #include #endif +#include #include "file_parser.h" void sleep_ms(int ms) diff --git a/libftl/ftl_private.h b/libftl/ftl_private.h index 0606052..402ff4b 100644 --- a/libftl/ftl_private.h +++ b/libftl/ftl_private.h @@ -315,7 +315,7 @@ typedef struct _ftl_ingest_t { typedef struct { ftl_handle_t* handle; - BOOL(*change_bitrate_callback)(void*, uint64_t); + int(*change_bitrate_callback)(void*, uint64_t); void* context; uint64_t initial_encoding_bitrate; uint64_t max_encoding_bitrate; diff --git a/libftl/ingest.c b/libftl/ingest.c index b751c84..40b9bd3 100644 --- a/libftl/ingest.c +++ b/libftl/ingest.c @@ -335,7 +335,7 @@ OS_THREAD_ROUTINE _ingest_get_hosts(ftl_stream_configuration_private_t *ftl) { ftl->ingest_count = total_ingest_cnt; - return total_ingest_cnt; + return (OS_THREAD_ROUTINE)total_ingest_cnt; } char * ingest_find_best(ftl_stream_configuration_private_t *ftl) { From 4665d18ac7ea49a1212ab05cd5227809b683b6cd Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 21:11:31 +0300 Subject: [PATCH 2/3] ftl-sdk: Discard excess warning for e2k --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef616e9..6c74061 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,17 @@ MESSAGE(STATUS "FTL DISABLE_FTL_APP: " ${DISABLE_FTL_APP}) option(FTL_STATIC_COMPILE "Set to TRUE if you want ftl to be compiled as a static lib. If TRUE, the program will want to statically link to the ftl cmake object." FALSE) MESSAGE(STATUS "FTL FTL_STATIC_COMPILE: " ${FTL_STATIC_COMPILE}) +include(CheckCCompilerFlag) + +if(LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "e2k") + foreach(TEST_C_FLAG "-Wno-unused-parameter" "-Wno-pointer-sign" "-Wno-unused-variable" "-Wno-sign-compare" "-Wno-maybe-uninitialized") + CHECK_C_COMPILER_FLAG(${TEST_C_FLAG} C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG}) + if(C_COMPILER_SUPPORTS_FLAG_${TEST_C_FLAG}) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TEST_C_FLAG}") + endif() + endforeach() +endif() + find_package(Threads REQUIRED) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) From 9c70c010c635eceb62cac681f1914537aa054795 Mon Sep 17 00:00:00 2001 From: makise-homura Date: Tue, 18 Aug 2020 21:24:00 +0300 Subject: [PATCH 3/3] ftl-sdk: Get rid of -Wformat warning --- ftl_app/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftl_app/main.c b/ftl_app/main.c index 940d861..fe06f5a 100644 --- a/ftl_app/main.c +++ b/ftl_app/main.c @@ -427,7 +427,7 @@ static void *ftl_status_thread(void *data) { ftl_packet_stats_msg_t *p = &status.msg.pkt_stats; - printf("Avg packet send per second %3.1f, total nack requests %d\n", + printf("Avg packet send per second %3.1f, total nack requests %ld\n", (float)p->sent * 1000.f / p->period, p->nack_reqs); }