IIRC they should be fine without the static. New input file -> start from zero again.
miika > On 05 Nov 2014, at 19:30, Willem Ferguson <[email protected]> > wrote: > > Miika, > > The inconsistency I found after locally implementing your patch of moving the > declaration of cur_cylinder_index from outside to inside the function > parse_txt_file() was that the starting cylinder pressure of the diluent > cylinder is lost starting at the second of a series of consecutive imports > (i.e. the first import is ok but the ones afterwards not). This may be > suggestive that the value of diluent_pressure is not re-initialised before > the loop that parses the CSV text. > 1) If I insert the following: > cylinder_pressure = 0; > diluent_pressure = 0; > just before the for (;;) {, then the problem is solved. All diluent cylinder > values are initialised correctly. > > 2) Now these two variables are initalised every time the function runs, but > they are static. If I take away the static attribute so that the declaration > is just: > int diluent_pressure = 0, cylinder_pressure = 0; > Then the problem is also solved. > > I have no idea whether these variables, because of their static attribute > should have any meaning outside of the function and I am not sure whether it > is safe to remove the static attribute. > Your opinion, please? > Kind regards, > \willem > > _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
