diff --git a/lib_com/hq2_noise_inject_fx.c b/lib_com/hq2_noise_inject_fx.c index 76efad10e991b289bd73e343153f8440468cc7b5..7fc9f8fe96b93d426f29ba6b472470924d8131fb 100644 --- a/lib_com/hq2_noise_inject_fx.c +++ b/lib_com/hq2_noise_inject_fx.c @@ -34,7 +34,7 @@ #include "options.h" #include "prot_fx.h" #include "oper_32b.h" -#include "move.h" +#include "stl.h" /*--------------------------------------------------------------------------* * hq2_noise_inject() diff --git a/lib_debug/wmc_auto.c b/lib_debug/wmc_auto.c index 5afd9de166568531c15df05978d588430d1cad77..ce7b69e28815728bb9b17f8f8245739a9edd30d1 100644 --- a/lib_debug/wmc_auto.c +++ b/lib_debug/wmc_auto.c @@ -820,7 +820,6 @@ static void *mem_alloc_block( size_t size, const char *size_str ); void reset_mem( Counting_Size cnt_size ) { - int16_t something; size_t tmp_size; /* initialize list of stack records */ @@ -840,7 +839,13 @@ void reset_mem( Counting_Size cnt_size ) max_num_calls = MAX_NUM_RECORDS; /* initialize stack pointers */ +#if defined( __GNUC__ ) || defined( __clang__ ) + /* GCC/Clang: use builtin (works for many targets) */ + ptr_base_stack = __builtin_frame_address( 0 ); +#else + int16_t something; ptr_base_stack = &something; +#endif ptr_max_stack = ptr_base_stack; ptr_current_stack = ptr_base_stack; @@ -945,10 +950,14 @@ void reset_mem( Counting_Size cnt_size ) void reset_stack( void ) { - int16_t something; - /* initialize/reset stack pointers */ +#if defined( __GNUC__ ) || defined( __clang__ ) + /* GCC/Clang: use builtin (works for many targets) */ + ptr_base_stack = __builtin_frame_address( 0 ); +#else + int16_t something; ptr_base_stack = &something; +#endif ptr_max_stack = ptr_base_stack; ptr_current_stack = ptr_base_stack; @@ -963,10 +972,15 @@ void reset_stack( void ) int push_stack( const char *filename, const char *fctname ) { - int16_t something; int32_t current_stack_size; +#if defined( __GNUC__ ) || defined( __clang__ ) + /* GCC/Clang: use builtin (works for many targets) */ + ptr_base_stack = __builtin_frame_address( 0 ); +#else + int16_t something; ptr_current_stack = &something; +#endif (void) *filename; /* to avoid compilation warning */ diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 2c62fd65340c904f09cf44af0e344f72e34496fa..d970dfee48f9f6bd4ba4d031d45654d534a75c78 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -3,17 +3,15 @@ ====================================================================================*/ -#include "basop32.h" +#include +#include +#include "options.h" +#include "stl.h" #include "cnst.h" -#include "enh1632.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "move.h" #include "wmc_auto.h" -#include #include "typedef.h" -#include -#include "options.h" #include "rom_com.h" #include "stat_dec.h" #include "prot_fx.h" diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index f48c79ea7ec3b75ef4e0103b91c279dbe5b77523..e8a26ce9d2ae1cb0419c89481ce4d750ba39ccfd 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -31,13 +31,14 @@ *******************************************************************************************************/ #include +#include #include "options.h" +#include "stl.h" #include "ivas_cnst.h" #include "ivas_prot_fx.h" #include "ivas_rom_com.h" #include "prot_fx.h" #include "ivas_stat_enc.h" -#include #include "wmc_auto.h" #include "move.h" #include "ivas_prot_fx.h" diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 1149440a9dfaf05b6e82a8ed1cbd1f2b420643d9..38819b58400ed58fd41cefbc9a3dbd5df95bdbff 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -30,14 +30,15 @@ *******************************************************************************************************/ -#include "basop32.h" -#include "basop_util.h" +#include +#include +#include #include "options.h" +#include "stl.h" +#include "basop_util.h" #include "cnst.h" #include "common_api_types.h" -#include "enh32.h" #include "lib_rend.h" -#include "move.h" #include "prot_fx.h" #include "ivas_prot_fx.h" #include "ivas_prot_rend_fx.h" @@ -47,11 +48,6 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "ivas_rom_rend.h" -#include "stl.h" -#include "typedef.h" -#include -#include -#include #include "wmc_auto.h" #ifdef DEBUGGING #include "debug.h"