??? 08/09/07 10:00 Read: times |
#142969 - for(;;) anomally |
Hello everybody,
during my programming in Raisonance I met with one problem. BACKGROUND: After execution following part of function code, program was permanently restarted again and again after some instructions from program's beginning. PART OF FUNCTION: ... for(c=0;(c<calib_table_def[calib_table].curves_count)&&(c<CALIB_MAX_CURVES_COUNT); c++) { for(p=1;(p<calib_points_count[calib_table].curve[c]-1)&&(p<CALIB_MAX_CURVES_POINTS_COUNT-1);p++) { if (calib_x<calib_tables[calib_table].curve[c].point[p].x ) break; ... } } ... DESCRIPTION: Function is used to found two points around 'calib_x' in some curves 'calib_x' is input parameter to the function I rewrite this part of function by following code: ... for(c=0;c<calib_table_def[CALIB_TABLE_2].curves_count;c++) { if(c >= CALIB_MAX_CURVES_COUNT) break; for(p=1;p<calib_points_count[CALIB_TABLE_2].curve[c]-1;p++) { if(p >= CALIB_MAX_CURVES_POINTS_COUNT-1) break; if(calib_x < calib_tables[CALIB_TABLE_2].curve[c].point[p].x) break; } ... } ... and everythings is going well without permanently restarting and function has the same effect :) Have you ever have the same problem? Can someone explain background of this problem? Or did I have mistake in the first function's code? Thank you at all. |