[Patch] Fix istream::ignore + minor things
Paolo Carlini
pcarlini@suse.de
Tue May 25 07:06:00 GMT 2004
Hi,
eventually I fixed ignore this way (__n is > 0 here):
- while (_M_gcount < __n
+ if (__n != numeric_limits<streamsize>::max())
+ --__n;
+ while (_M_gcount <= __n
Another possibility, would be playing with _M_gcount, inizializing
it to 1 and the --_M_gcount at the end. This permits to spare the
conditional but breaks the general assumption that, at any given
moment, _M_gcount <= number extracted chars. I don't like that.
Took the occasion to tweak a few other bits, tighten some testcases
and add a new one.
Tested x86-linux.
Paolo.
////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_istream_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040525/1f106e42/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_istream_2
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20040525/1f106e42/attachment-0001.ksh>
More information about the Libstdc++
mailing list