Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 64906 invoked from network); 17 Aug 2007 02:34:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Aug 2007 02:34:34 -0000 Received: (qmail 27893 invoked by uid 500); 17 Aug 2007 02:34:32 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 27872 invoked by uid 500); 17 Aug 2007 02:34:32 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 27847 invoked by uid 99); 17 Aug 2007 02:34:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 19:34:32 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of everton.basso@gmail.com designates 209.85.146.181 as permitted sender) Received: from [209.85.146.181] (HELO wa-out-1112.google.com) (209.85.146.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2007 02:34:29 +0000 Received: by wa-out-1112.google.com with SMTP id j5so76864wah for ; Thu, 16 Aug 2007 19:34:09 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; b=bszB2C+3wOjiTVlOTZMWLp1ThQp4y8/ReVgi3zN7V5Vi89ZJd3+1sJ2YQtTrp2v1wWmxAhDBt85sQUP9iQQrMrKXIWW93bbTvjEKIrPavDQvI/BdpE+vxmtVp0L13CFhIqwm1u6DYDqn0OLKSGcznTGTDPxF8aZfCXCu+rnhznY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=LF+98tBfihv9gGd8toj8wItNQ5JOKNJbq8m50W4Z5a384rdV6fo6f3jYAqQmh3bQkbt5qDSFV041EPlupbdUellfrsCuVuPP68N8PdFR3YCnVeyFYXr1OwRiLRdM7TSPtFbjjfHBVlOJi7AS4z01CEVAmi0F6hyofjD5e8IRQOs= Received: by 10.114.109.1 with SMTP id h1mr2652495wac.1187318048717; Thu, 16 Aug 2007 19:34:08 -0700 (PDT) Received: by 10.114.112.8 with HTTP; Thu, 16 Aug 2007 19:34:08 -0700 (PDT) Message-ID: Date: Thu, 16 Aug 2007 23:34:08 -0300 From: "Everton Araujo" To: stdcxx-dev@incubator.apache.org Subject: STDCXX-522 - v2 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_74175_756252.1187318048659" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_74175_756252.1187318048659 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, Sorry, I was wrong about the fix of issue STDCXX-522 because it worked for issue test code, but I've forgot to run test 27 and we I ran that ... oooops! 75% assertations :-( I went get more coffee and restart debugging, and with the following changes in fstream, test on both codes (issue and 27) was successfully. Following is the overflow code changed (diffs are bold): template _TYPENAME basic_filebuf<_CharT, _Traits>::int_type basic_filebuf<_CharT, _Traits>:: overflow (int_type __c /* = eof () */) { _RWSTD_ASSERT (this->_C_is_valid ()); if (!this->_C_is_out () || !is_open ()) return traits_type::eof (); this->setg (0, 0, 0); // invalidate the get area const bool __unbuf = this->_C_is_unbuffered (); const char_type __c_to_char = traits_type::to_char_type (__c); if (this->pptr () == 0 && !__unbuf) { // put area not valid yet - just need to initialize it this->setp (this->_C_buffer, this->_C_buf_end ()); } else if ( this->pptr () == this->epptr () || this->_C_is_eof (__c) || __unbuf) { const char_type* __buf; _RWSTD_STREAMSIZE __nchars; if (__unbuf) { if(this->_C_is_eof(__c)){ _C_cur_pos.state (0); __buf = 0; __nchars = 0; } else{ __buf = &__c_to_char; __nchars = 1; } } else { // call xsputn() with a special value to have it flush // the controlled sequence to the file __buf = _RWSTD_REINTERPRET_CAST (char_type*, this); __nchars = this->pptr () - this->pbase (); } // typedef helps HP aCC 3.27 typedef basic_filebuf _FileBuf; if (__nchars && __nchars != _FileBuf::xsputn (__buf, __nchars)) return traits_type::eof (); // error while writing } // now that there's room in the buffer, call sputc() recursively // to actually place the character in the buffer (unless we're // in unbuffered mode because we just wrote it out) if (!this->_C_is_eof (__c) && !__unbuf) this->sputc (__c_to_char); this->_C_out_last (true); // needed by close () return traits_type::not_eof (__c); } Hope it helps. Everton. ------=_Part_74175_756252.1187318048659--