From 2040db4eeccdb2db8fa7805d3ba3ea9d27b28d78 Mon Sep 17 00:00:00 2001 From: dijunkun Date: Fri, 10 Nov 2023 10:00:09 +0800 Subject: [PATCH] Fix OpenFEC compile error on Windows platform --- thirdparty/openfec/CMakeLists.txt | 28 +++++++--------- thirdparty/openfec/src/CMakeLists.txt | 20 ++++++------ .../ldpc_from_file/of_ldpc_ff_includes.h | 2 +- .../binary_matrix/of_hamming_weight.c | 16 +++++----- .../binary_matrix/of_hamming_weight.h | 16 +++++----- .../binary_matrix/of_matrix_dense.c | 6 ++-- .../openfec/src/lib_common/of_openfec_api.h | 32 +++++++++---------- .../2d_parity_matrix/of_2d_parity_api.c | 4 +-- .../ldpc_staircase/of_ldpc_staircase_api.c | 4 +-- .../of_reed-solomon_gf_2_8_api.c | 4 +-- .../of_reed-solomon_gf_2_m_api.c | 32 ++++++++++++------- 11 files changed, 85 insertions(+), 79 deletions(-) diff --git a/thirdparty/openfec/CMakeLists.txt b/thirdparty/openfec/CMakeLists.txt index e3d5a60..a1abec1 100644 --- a/thirdparty/openfec/CMakeLists.txt +++ b/thirdparty/openfec/CMakeLists.txt @@ -1,29 +1,26 @@ cmake_minimum_required(VERSION 2.6) -##project +# #project project(openfec C) ENABLE_TESTING() -if (PROFILING STREQUAL "ON") - +if(PROFILING STREQUAL "ON") else(PROFILING STREQUAL "ON") - endif(PROFILING STREQUAL "ON") -if (DEBUG STREQUAL "ON") -# Debug mode -ADD_DEFINITIONS(-DOF_DEBUG) -set(CMAKE_BUILD_TYPE Debug) -message(STATUS "Debug mode ON" ) +if(DEBUG STREQUAL "ON") + # Debug mode + ADD_DEFINITIONS(-DOF_DEBUG) + set(CMAKE_BUILD_TYPE Debug) + message(STATUS "Debug mode ON") else(DEBUG STREQUAL "ON") -# Release mode -set(CMAKE_BUILD_TYPE Release) -set(CMAKE_C_FLAGS "-O4") -message(STATUS "Debug mode OFF") - -endif (DEBUG STREQUAL "ON") + # Release mode + set(CMAKE_BUILD_TYPE Release) + set(CMAKE_C_FLAGS "-O2") + message(STATUS "Debug mode OFF") +endif(DEBUG STREQUAL "ON") # set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) # set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}) @@ -32,7 +29,6 @@ endif (DEBUG STREQUAL "ON") # include_directories(${PROJECT_SOURCE_DIR}/src/lib_common) # set(CMAKE_INSTALL_LIBDIR ${PROJECT_SOURCE_DIR}/src/lib_common) # set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) - MARK_AS_ADVANCED( LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH diff --git a/thirdparty/openfec/src/CMakeLists.txt b/thirdparty/openfec/src/CMakeLists.txt index f410954..da368c7 100644 --- a/thirdparty/openfec/src/CMakeLists.txt +++ b/thirdparty/openfec/src/CMakeLists.txt @@ -1,16 +1,16 @@ -file (GLOB_RECURSE openfec_sources *) +file(GLOB_RECURSE openfec_sources *) -add_library(openfec STATIC ${openfec_sources}) +add_library(openfec STATIC ${openfec_sources}) # From: $cmake --help-property SOVERSION -# For shared libraries VERSION and SOVERSION can be used to specify -# the build version and api version respectively. +# For shared libraries VERSION and SOVERSION can be used to specify +# the build version and api version respectively. # # Edit it as appropriate to be in line with the src/lib_common/of_openfec_api.c::more_about() version # set_target_properties(openfec PROPERTIES - VERSION 1.4.2 - SOVERSION 1) + VERSION 1.4.2 + SOVERSION 1) # Feel free to edit as appropriate the "target_link_libraries". # @@ -21,9 +21,9 @@ set_target_properties(openfec PROPERTIES # Please install it on your machine before compiling the OpenFEC # library if needed. # Otherwise remove the IL library. - target_link_libraries(openfec m) -#target_link_libraries(openfec m IL) -#target_link_libraries(openfec pthread IL) -#target_link_libraries(openfec pthread) +# target_link_libraries(openfec m IL) + +# target_link_libraries(openfec pthread IL) +# target_link_libraries(openfec pthread) diff --git a/thirdparty/openfec/src/lib_advanced/ldpc_from_file/of_ldpc_ff_includes.h b/thirdparty/openfec/src/lib_advanced/ldpc_from_file/of_ldpc_ff_includes.h index 8ec34c6..1a2e2f8 100644 --- a/thirdparty/openfec/src/lib_advanced/ldpc_from_file/of_ldpc_ff_includes.h +++ b/thirdparty/openfec/src/lib_advanced/ldpc_from_file/of_ldpc_ff_includes.h @@ -37,7 +37,7 @@ #include #include #include -#include /* for timersub */ +// #include /* for timersub */ #include "../../lib_common/of_openfec_api.h" diff --git a/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.c b/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.c index b4923d0..1e5780f 100644 --- a/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.c +++ b/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.c @@ -6,27 +6,27 @@ * * You are free: * - * to Share — to copy, distribute and transmit the work - * to Remix — to adapt the work + * to Share to copy, distribute and transmit the work + * to Remix to adapt the work * * Under the following conditions: * - * Attribution — You must attribute the work in the manner specified by the author or licensor + * Attribution You must attribute the work in the manner specified by the author or licensor * (but not in any way that suggests that they endorse you or your use of the work). - * Share Alike — If you alter, transform, or build upon this work, you may distribute the + * Share Alike If you alter, transform, or build upon this work, you may distribute the * resulting work only under the same, similar or a compatible license. * * With the understanding that: * - * Waiver — Any of the above conditions can be waived if you get permission from the copyright holder. - * Public Domain — Where the work or any of its elements is in the public domain under applicable law, + * Waiver Any of the above conditions can be waived if you get permission from the copyright holder. + * Public Domain Where the work or any of its elements is in the public domain under applicable law, * that status is in no way affected by the license. - * Other Rights — In no way are any of the following rights affected by the license: + * Other Rights In no way are any of the following rights affected by the license: * Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; * The author's moral rights; * Rights other persons may have either in the work itself or in how the work is used, such as publicity * or privacy rights. - * Notice — For any reuse or distribution, you must make clear to others the license terms of this work. + * Notice For any reuse or distribution, you must make clear to others the license terms of this work. * * The best way to do this is with a link to this web page: http://creativecommons.org/licenses/by-sa/3.0/ */ diff --git a/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.h b/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.h index 8a9bd00..7905eec 100644 --- a/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.h +++ b/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_hamming_weight.h @@ -6,27 +6,27 @@ * * You are free: * - * to Share — to copy, distribute and transmit the work - * to Remix — to adapt the work + * to Share to copy, distribute and transmit the work + * to Remix to adapt the work * * Under the following conditions: * - * Attribution — You must attribute the work in the manner specified by the author or licensor + * Attribution You must attribute the work in the manner specified by the author or licensor * (but not in any way that suggests that they endorse you or your use of the work). - * Share Alike — If you alter, transform, or build upon this work, you may distribute the + * Share Alike If you alter, transform, or build upon this work, you may distribute the * resulting work only under the same, similar or a compatible license. * * With the understanding that: * - * Waiver — Any of the above conditions can be waived if you get permission from the copyright holder. - * Public Domain — Where the work or any of its elements is in the public domain under applicable law, + * Waiver Any of the above conditions can be waived if you get permission from the copyright holder. + * Public Domain Where the work or any of its elements is in the public domain under applicable law, * that status is in no way affected by the license. - * Other Rights — In no way are any of the following rights affected by the license: + * Other Rights In no way are any of the following rights affected by the license: * Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; * The author's moral rights; * Rights other persons may have either in the work itself or in how the work is used, such as publicity * or privacy rights. - * Notice — For any reuse or distribution, you must make clear to others the license terms of this work. + * Notice For any reuse or distribution, you must make clear to others the license terms of this work. * * The best way to do this is with a link to this web page: http://creativecommons.org/licenses/by-sa/3.0/ */ diff --git a/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_matrix_dense.c b/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_matrix_dense.c index 1642f45..a507786 100644 --- a/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_matrix_dense.c +++ b/thirdparty/openfec/src/lib_common/linear_binary_codes_utils/binary_matrix/of_matrix_dense.c @@ -1724,11 +1724,11 @@ void of_mod2dense_print_memory_info (of_mod2dense *m) #else printf ("m->row=%p\n", m->row); - printf (" m->row size = %lu\n", m->n_rows*sizeof *m->row); + printf (" m->row size = %zu\n", m->n_rows*sizeof *m->row); #endif printf ("m->bits=%p\n", m->bits); - printf (" m->bits size = %lu\n", m->n_words*m->n_rows*sizeof *m->bits); - printf ("sizeof(mod2word)=%lu\n", sizeof (of_mod2word)); + printf (" m->bits size = %zu\n", m->n_words*m->n_rows*sizeof *m->bits); + printf ("sizeof(mod2word)=%zu\n", sizeof (of_mod2word)); OF_EXIT_FUNCTION } diff --git a/thirdparty/openfec/src/lib_common/of_openfec_api.h b/thirdparty/openfec/src/lib_common/of_openfec_api.h index a3661e9..6783ec3 100644 --- a/thirdparty/openfec/src/lib_common/of_openfec_api.h +++ b/thirdparty/openfec/src/lib_common/of_openfec_api.h @@ -202,7 +202,7 @@ extern UINT32 of_verbosity; * @fn of_status_t of_create_codec_instance (of_session_t** ses, *of_codec_id_t codec_id, of_codec_type_t codec_type, UINT32 verbosity) * @brief create a codec instance - *02@param ses (IN/OUT) address of the pointer to a session. This + *0„2@param ses (IN/OUT) address of the pointer to a session. This *pointer is updated by this function. In case of success, it points to a *session structure allocated by the library. In case of failure it points to *NULL. @@ -225,7 +225,7 @@ of_status_t of_create_codec_instance(of_session_t** ses, of_codec_id_t codec_id, * * @fn of_status_t of_release_codec_instance (of_session_t* ses) * @brief release all resources used by the codec - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @return Error status. */ of_status_t of_release_codec_instance(of_session_t* ses); @@ -248,7 +248,7 @@ of_status_t of_release_codec_instance(of_session_t* ses); * @fn of_status_t of_set_fec_parameters (of_session_t* ses, *of_parameters_t* params) * @brief set all the FEC codec parameters (e.g. k, n, or symbol - *size) 02@param ses (IN) Pointer to the session. + *size) 0„2@param ses (IN) Pointer to the session. * @param params (IN) pointer to a structure containing the FEC *parameters associated to a specific FEC codec. * @return Error status. @@ -284,7 +284,7 @@ of_status_t of_set_fec_parameters(of_session_t* ses, of_parameters_t* params); *esi), void* (*decoded_repair_symbol_callback) (void *context,UINT32 *size,UINT32 esi),void* context_4_callback) * @brief set various callbock functions (see header - *of_open_fec_api.h) 02@param ses (IN) Pointer to the session. + *of_open_fec_api.h) 0„2@param ses (IN) Pointer to the session. * * @param decoded_source_symbol_callback * (IN) Pointer to the function, within the @@ -334,7 +334,7 @@ of_status_t of_set_callback_functions( * @fn of_status_t of_build_repair_symbol (of_session_t* ses, void* *encoding_symbols_tab[], UINT32 esi_of_symbol_to_build) * @brief build a repair symbol (encoder only) - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @param encoding_symbols_tab (IN/OUT) table of source and repair symbols. * The entry for the repair symbol to build can *either point to a buffer allocated by the application, or let to NULL meaning @@ -375,7 +375,7 @@ of_status_t of_build_repair_symbol(of_session_t* ses, * @fn of_status_t of_decode_with_new_symbol (of_session_t* ses, *void* const new_symbol_buf, UINT32 new_symbol_esi) * @brief (try to) decode with a newly received symbol - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @param new_symbol_buf (IN) Pointer to the encoding symbol now *available (i.e. a new symbol received by the application, or a decoded symbol *in case of a recursive call). @@ -407,7 +407,7 @@ of_status_t of_decode_with_new_symbol(of_session_t* ses, * @fn of_status_t of_set_available_symbols *(of_session_t* ses, void* const encoding_symbols_tab[]); * @brief inform the decoder of all the available - *(received) symbols 02@param ses (IN) Pointer to the + *(received) symbols 0„2@param ses (IN) Pointer to the *session. * @param encoding_symbols_tab (IN) Pointer to the available encoding symbols *table. To each available symbol the corresponding entry in the table must @@ -439,7 +439,7 @@ of_status_t of_set_available_symbol_list (of_session_t* ses, * @fn of_status_t of_finish_decoding (of_session_t* *ses) * @brief finish decoding with available symbols - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @return Error status. Returns OF_STATUS_FAILURE if decoding *failed, or OF_STATUS_OK if decoding succeeded, or OF_STATUS_*_ERROR in case of *(fatal) error. @@ -453,7 +453,7 @@ of_status_t of_finish_decoding(of_session_t* ses); * @fn bool of_is_decoding_complete (of_session_t* *ses) * @brief check if decoding is finished - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @return Boolean. Warning, this is one of the very functions of *the library that does not return an error status. */ @@ -468,7 +468,7 @@ bool of_is_decoding_complete(of_session_t* ses); * @fn of_status_t of_get_source_symbols_tab (of_session_t* *ses, void* source_symbols_tab[]) * @brief get the table of available source symbols (after - *decoding) 02@param ses (IN) Pointer to the session. + *decoding) 0„2@param ses (IN) Pointer to the session. * @param source_symbols_tab (IN/OUT) table, that will be filled by the *library and returned to the application. * @return Error status. @@ -490,10 +490,10 @@ of_status_t of_get_source_symbols_tab(of_session_t* ses, *string is totally managed by the library and must not be released by the *application. * - *02@param ses (IN) Pointer to the session or NULL. - *02@param version_str (IN/OUT) address of a pointer to a string. This pointer + *0„2@param ses (IN) Pointer to the session or NULL. + *0„2@param version_str (IN/OUT) address of a pointer to a string. This pointer *is updated by this function to point ot a static string (that must not be - *released by the caller). 02@param copyrights_str (IN/OUT) address of a pointer + *released by the caller). 0„2@param copyrights_str (IN/OUT) address of a pointer *to a string. This pointer is updated by this function to point ot a static *string (that must not be released by the caller). * @return Error status. @@ -505,7 +505,7 @@ of_status_t of_more_about(of_session_t* ses, char** version_str, * This function sets a FEC scheme/FEC codec specific control parameter, in *addition to the FEC OTI, using a type/value method. * - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @param type (IN) Type of parameter. This type is FEC codec ID *specific. * @param value (IN) Pointer to the value of the parameter. The type of @@ -520,7 +520,7 @@ of_status_t of_set_control_parameter(of_session_t* ses, UINT32 type, * This function gets a FEC scheme/FEC codec specific control parameter, in *addition to the FEC OTI, using a type/value method. * - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @param type (IN) Type of parameter. This type is FEC codec ID *specific. * @param value (IN/OUT) Pointer to the value of the parameter. The type @@ -577,7 +577,7 @@ of_status_t of_get_control_parameter(of_session_t* ses, UINT32 type, * of available source and repair symbols. The way this probability is calculated depends * on many parameters, and above all the code nature. * - *02@param ses (IN) Pointer to the session. + *0„2@param ses (IN) Pointer to the session. * @return Error status. */ bool of_get_decoding_success_proba (of_session_t* ses, diff --git a/thirdparty/openfec/src/lib_stable/2d_parity_matrix/of_2d_parity_api.c b/thirdparty/openfec/src/lib_stable/2d_parity_matrix/of_2d_parity_api.c index 2f272d5..ef9835a 100644 --- a/thirdparty/openfec/src/lib_stable/2d_parity_matrix/of_2d_parity_api.c +++ b/thirdparty/openfec/src/lib_stable/2d_parity_matrix/of_2d_parity_api.c @@ -431,7 +431,7 @@ of_status_t of_2d_parity_get_control_parameter (of_2d_parity_cb_t* ofcb, switch (type) { case OF_CTRL_GET_MAX_K: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %ld)\n", + OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %zu)\n", __FUNCTION__, length, sizeof(UINT32))) goto error; } @@ -441,7 +441,7 @@ of_status_t of_2d_parity_get_control_parameter (of_2d_parity_cb_t* ofcb, case OF_CTRL_GET_MAX_N: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %ld)\n", + OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n", __FUNCTION__, length, sizeof(UINT32))) goto error; } diff --git a/thirdparty/openfec/src/lib_stable/ldpc_staircase/of_ldpc_staircase_api.c b/thirdparty/openfec/src/lib_stable/ldpc_staircase/of_ldpc_staircase_api.c index f50c620..dbbffba 100644 --- a/thirdparty/openfec/src/lib_stable/ldpc_staircase/of_ldpc_staircase_api.c +++ b/thirdparty/openfec/src/lib_stable/ldpc_staircase/of_ldpc_staircase_api.c @@ -519,7 +519,7 @@ of_status_t of_ldpc_staircase_get_control_parameter (of_ldpc_staircase_cb_t* ofc switch (type) { case OF_CTRL_GET_MAX_K: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %ld)\n", + OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %zu)\n", __FUNCTION__, length, sizeof(UINT32))) goto error; } @@ -529,7 +529,7 @@ of_status_t of_ldpc_staircase_get_control_parameter (of_ldpc_staircase_cb_t* ofc case OF_CTRL_GET_MAX_N: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %ld)\n", + OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n", __FUNCTION__, length, sizeof(UINT32))) goto error; } diff --git a/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8_api.c b/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8_api.c index 153278e..9078585 100644 --- a/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8_api.c +++ b/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8_api.c @@ -497,7 +497,7 @@ of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb, switch (type) { case OF_CTRL_GET_MAX_K: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %ld)\n", + OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_K ERROR: null value or bad length (got %d, expected %zu)\n", __FUNCTION__, length, sizeof(UINT32))) goto error; } @@ -507,7 +507,7 @@ of_status_t of_rs_get_control_parameter (of_rs_cb_t* ofcb, case OF_CTRL_GET_MAX_N: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %ld)\n", + OF_PRINT_ERROR(("%s: OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n", __FUNCTION__, length, sizeof(UINT32))) goto error; } diff --git a/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_m/of_reed-solomon_gf_2_m_api.c b/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_m/of_reed-solomon_gf_2_m_api.c index c03a579..3a4a4fd 100644 --- a/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_m/of_reed-solomon_gf_2_m_api.c +++ b/thirdparty/openfec/src/lib_stable/reed-solomon_gf_2_m/of_reed-solomon_gf_2_m_api.c @@ -374,11 +374,11 @@ of_status_t of_rs_2_m_finish_decoding (of_rs_2_m_cb_t* ofcb) { UINT32 k; UINT32 n; - char *tmp_buf[ofcb->nb_source_symbols];/* keep available source/repair symbol buffers here... */ - int tmp_esi[ofcb->nb_source_symbols]; /* ...and their esi here. In fact we only need k entries - * in these tables, but in order to avoid using malloc (time - * consumming), we use an automatic table of maximum size for - * both tmp_buf[] and tmp_esi[]. */ + // char *tmp_buf[ofcb->nb_source_symbols];/* keep available source/repair symbol buffers here... */ + // int tmp_esi[ofcb->nb_source_symbols]; /* ...and their esi here. In fact we only need k entries + // * in these tables, but in order to avoid using malloc (time + // * consumming), we use an automatic table of maximum size for + // * both tmp_buf[] and tmp_esi[]. */ INT32 tmp_idx; /* index in tmp_buf[] and tmp_esi[] tabs */ char *large_buf = NULL; /* single large buffer where to copy all source/repair symbols */ UINT32 off; /* offset, in unit of characters, in large_buf */ @@ -394,8 +394,11 @@ of_status_t of_rs_2_m_finish_decoding (of_rs_2_m_cb_t* ofcb) } k = ofcb->nb_source_symbols; n = ofcb->nb_encoding_symbols; - //int *tmp_esi = (int*)malloc(ofcb->field_size*sizeof(int)); - //char ** tmp_buf = (char**)malloc(n*sizeof(char*)); // ???? WRT RS(255) + int *tmp_esi = (int*)malloc(ofcb->field_size*sizeof(int)); + char ** tmp_buf = (char**)malloc(n*sizeof(char*)); // ???? WRT RS(255) + for(int i=0; inb_available_symbols < k) { OF_PRINT_ERROR(("ERROR: nb received symbols < nb source symbols\n")) @@ -528,12 +531,19 @@ of_status_t of_rs_2_m_finish_decoding (of_rs_2_m_cb_t* ofcb) tmp_idx, tmp_idx)) } of_free(large_buf); + free(tmp_esi); + for(int i=0;imax_nb_source_symbols == 0) { @@ -637,7 +647,7 @@ of_status_t of_rs_2_m_get_control_parameter (of_rs_2_m_cb_t* ofcb, case OF_CTRL_GET_MAX_N: if (value == NULL || length != sizeof(UINT32)) { - OF_PRINT_ERROR(("OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %ld)\n", length, sizeof(UINT32))) + OF_PRINT_ERROR(("OF_CTRL_GET_MAX_N ERROR: null value or bad length (got %d, expected %zu)\n", length, sizeof(UINT32))) goto error; } if (ofcb->max_nb_encoding_symbols == 0) {