# HG changeset patch # User greg # Date 1256203605 -7200 # Node ID 4d7ac355701d29988aab749cb95bd4a31ae05b5a # Parent 76aebe92fd5f432f8c4fda6858c88c984c133903 Fix some warnings during compilation diff -r 76aebe92fd5f -r 4d7ac355701d plugger.py --- a/plugger.py Mon Oct 19 16:26:15 2009 +0200 +++ b/plugger.py Thu Oct 22 11:26:45 2009 +0200 @@ -1287,7 +1287,7 @@ "__publish_%s();"%locstrs[i-1] for i in xrange(len(locstrs), 0, -1)]), "init_calls":"\n ".join([ "init_level=%d; "%(i+1)+ - "if(res = __init_%s(argc,argv)){"%locstr + + "if((res = __init_%s(argc,argv))){"%locstr + #"printf(\"%s\"); "%locstr + #for debug "return res;}" for i,locstr in enumerate(locstrs)]), "cleanup_calls":"\n ".join([ diff -r 76aebe92fd5f -r 4d7ac355701d targets/plc_common_main.c --- a/targets/plc_common_main.c Mon Oct 19 16:26:15 2009 +0200 +++ b/targets/plc_common_main.c Thu Oct 22 11:26:45 2009 +0200 @@ -41,7 +41,7 @@ /* * Retrieve input variables, run PLC and publish output variables **/ -void __run() +void __run(void) { __tick++; if (greatest_tick_count__) @@ -66,6 +66,7 @@ int __init(int argc,char **argv) { int res = 0; + init_level = 0; setlocale(LC_NUMERIC, "C"); config_init__(); __init_debug(); @@ -75,7 +76,7 @@ /* * Calls plugin cleanup proc. **/ -void __cleanup() +void __cleanup(void) { %(cleanup_calls)s __cleanup_debug(); diff -r 76aebe92fd5f -r 4d7ac355701d targets/plc_debug.c --- a/targets/plc_debug.c Mon Oct 19 16:26:15 2009 +0200 +++ b/targets/plc_debug.c Thu Oct 22 11:26:45 2009 +0200 @@ -51,17 +51,17 @@ struct_plcvar variable_table[%(variables_pointer_type_table_count)d]; -void __init_debug() +void __init_debug(void) { %(variables_pointer_type_table_initializer)s buffer_state = BUFFER_FREE; } -void __cleanup_debug() +void __cleanup_debug(void) { } -void __retrieve_debug() +void __retrieve_debug(void) { } @@ -71,7 +71,7 @@ extern void InitiateDebugTransfer(void); extern unsigned long __tick; -void __publish_debug() +void __publish_debug(void) { /* Check there is no running debugger re-configuration */ if(TryEnterDebugSection()){ @@ -143,10 +143,11 @@ latest_subscription = subscription_table; } -void FreeDebugData() +void FreeDebugData(void) { /* atomically mark buffer as free */ - long latest_state = AtomicCompareExchange( + long latest_state; + latest_state = AtomicCompareExchange( &buffer_state, BUFFER_BUSY, BUFFER_FREE); @@ -169,8 +170,8 @@ { return old_cursor; }else{ - printf("%%d > %%d\n", old_cursor - debug_buffer, BUFFER_SIZE); - return NULL; + //printf("%%d > %%d\n", old_cursor - debug_buffer, BUFFER_SIZE); + return NULL; } } *idx = -1;