# HG changeset patch # User JeanDo # Date 1313005997 -7200 # Node ID 4c7f304de294abf528f02a44d6a8fbbcc58a12ff # Parent 9cec10e640773ab25e5e30b135bf444a78b8d913 BUGFIX: infinite loop for Decoplaner's CNS in CCR mode. diff -r 9cec10e64077 -r 4c7f304de294 code_part1/OSTC_code_c_part2/p2_deco.c --- a/code_part1/OSTC_code_c_part2/p2_deco.c Wed Aug 10 20:15:24 2011 +0200 +++ b/code_part1/OSTC_code_c_part2/p2_deco.c Wed Aug 10 21:53:17 2011 +0200 @@ -2371,7 +2371,7 @@ if (CNS_fraction < 0.0) CNS_fraction = 0.0; - char_O_CNS_fraction = (unsigned char)(100.0f * CNS_fraction + 0.5f ); + char_O_CNS_fraction = (unsigned char)(100.0 * CNS_fraction + 0.5); } ////////////////////////////////////////////////////////////////////////////// @@ -2388,20 +2388,20 @@ //---- Retrieve bottom Gas used, and set variables. sim_gas_last_used = char_I_first_gas; - sim_gas_last_depth = 0; // Surface gas marker. - gas_switch_set(); // Sets initial calc_N2/He_ratio + sim_gas_last_depth = 0; // Surface gas marker. + gas_switch_set(); // Sets initial calc_N2/He_ratio //---- CCR mode : do the full TTS at once -------------------------------- if( char_I_const_ppO2 != 0 ) { - overlay unsigned char t; + overlay unsigned short t; // Needs 16bits here ! char_I_actual_ppO2 = char_I_const_ppO2; for(t=0; t