From stdcxx-dev-return-5367-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Fri Oct 05 03:47:34 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 5158 invoked from network); 5 Oct 2007 03:47:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2007 03:47:33 -0000 Received: (qmail 92875 invoked by uid 500); 5 Oct 2007 03:47:22 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 92856 invoked by uid 500); 5 Oct 2007 03:47:22 -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 92845 invoked by uid 99); 5 Oct 2007 03:47:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Oct 2007 20:47:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 64.233.162.236 as permitted sender) Received: from [64.233.162.236] (HELO nz-out-0506.google.com) (64.233.162.236) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Oct 2007 03:47:23 +0000 Received: by nz-out-0506.google.com with SMTP id o37so380822nzf for ; Thu, 04 Oct 2007 20:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=StQLaAoIbESBLEuANXuGnz0AZPDbToW6+mD6SY8G9oE=; b=DKflhQzwUuK+IV30HwIOHupZxAlwSAHkK1tBufJGwZI5Ef4B1+LjsEir/V2YK/35Vys+lD41q5QlLSN05Gd3pb9ilDNLe3hTTfddqfoIZjelyPEXPpzX7ADOSO6Nwuhvv2XTfvik6rxZP4XaA/NTreIu5RXSz5XzBCKE8VeGC6Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=WT+dSgv0h5UkEk1hlpKeFyW+xTEu6uf5uXjiiTUBzHEIk+CWJWHWiBoRf/YeS7VAzfxnS28SgKEmxJVX9ZtPP8MG4vPNvFztDfZVJrhZ40BfH7MBRYDHnd0z1rOZwUJRp6woJ9wsVLCDy1ybyACkM5dIYyLgikAOn1tuOexYq6o= Received: by 10.142.88.20 with SMTP id l20mr1342507wfb.1191556021169; Thu, 04 Oct 2007 20:47:01 -0700 (PDT) Received: from ?10.19.230.97? ( [67.53.46.3]) by mx.google.com with ESMTPS id f42sm5350926rvb.2007.10.04.20.46.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 04 Oct 2007 20:46:59 -0700 (PDT) Message-ID: <4705B3AA.2050704@roguewave.com> Date: Thu, 04 Oct 2007 17:46:50 -1000 From: Martin Sebor User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2pre) Gecko/20070111 SeaMonkey/1.1 MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: svn commit: r581929 - in /incubator/stdcxx/branches/4.2.0: include/loc/_punct.cc src/file.cpp References: <20071004143800.783BA1A9838@eris.apache.org> In-Reply-To: <20071004143800.783BA1A9838@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org faridz@apache.org wrote: > Author: faridz > Date: Thu Oct 4 07:37:59 2007 > New Revision: 581929 > > URL: http://svn.apache.org/viewvc?rev=581929&view=rev > Log: > 2007-10-04 Farid Zaripov > > STDCXX-564 > * _punct.cc (__rw_match_name): Cast 1UL constant to _RWSTD_SIZE_T > to avoid 64-bit MSVC warning C4334: '<<' : result of 32-bit shift > implicitly converted to 64 bits (was 64-bit shift intended?). > * file.cpp [_WIN64]: Disable 64-bit MSVC warning C4244 for > __rw_fseek(), __rw_fread(), __rw_fwrite() functions. > > Modified: > incubator/stdcxx/branches/4.2.0/include/loc/_punct.cc > incubator/stdcxx/branches/4.2.0/src/file.cpp > > Modified: incubator/stdcxx/branches/4.2.0/include/loc/_punct.cc > URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/include/loc/_punct.cc?rev=581929&r1=581928&r2=581929&view=diff > ============================================================================== > --- incubator/stdcxx/branches/4.2.0/include/loc/_punct.cc (original) > +++ incubator/stdcxx/branches/4.2.0/include/loc/_punct.cc Thu Oct 4 07:37:59 2007 > @@ -87,7 +87,10 @@ > > typedef _STD::char_traits<_CharT> _Traits; > > - if (__bits & 1UL << __k) { > + const _RWSTD_SIZE_T __mask = > + _RWSTD_STATIC_CAST(_RWSTD_SIZE_T, 1UL) << __k; The cast is missing a space before the open paren. Martin > + > + if (__bits & __mask) { > // `name' is still in the set, see if the next char matches > // (case insensitive comparison done if `ctp' is nonzero) > if ( __pos < __sizes [__k] > @@ -108,7 +111,7 @@ > > // this match is a duplicate of the last best one > // remove this match from the set > - __bits &= ~(1UL << __k); > + __bits &= ~__mask; > --__nmatch; > } > else if ( __sizes [__k] < __sizes [__inx] > @@ -137,7 +140,7 @@ > > // clear the bit for the `name' that failed to match > // and decrement the numeber of matches > - __bits &= ~(1UL << __k); > + __bits &= ~__mask; > --__nmatch; > } > } > > Modified: incubator/stdcxx/branches/4.2.0/src/file.cpp > URL: http://svn.apache.org/viewvc/incubator/stdcxx/branches/4.2.0/src/file.cpp?rev=581929&r1=581928&r2=581929&view=diff > ============================================================================== > --- incubator/stdcxx/branches/4.2.0/src/file.cpp (original) > +++ incubator/stdcxx/branches/4.2.0/src/file.cpp Thu Oct 4 07:37:59 2007 > @@ -475,13 +475,18 @@ > } > > > +#ifdef _WIN64 > +// disable MSVC warning: conversion from '__int64' to 'long', possible loss of data > +#pragma warning (disable: 4244) > +#endif I'm not sure we want to simply silence the warning here. It points out a real problem in our library on Windows, i.e., that __rw_fseek() cannot seek past the range of 32-bits. We should open an issue for this to remember to revisit this limitation in the future (and then it will be appropriate to silence the warning :) Martin > + > _RWSTD_EXPORT long > __rw_fseek (void *file, int flags, _RWSTD_PTRDIFF_T offset, int origin) > { > if (flags & _RWSTD_IOS_STDIO) { > FILE* const fp = _RWSTD_STATIC_CAST (FILE*, file); > > - const int pos = fseek (fp, offset, origin); > + const int pos = fseek (fp, long (offset), origin); > if (pos < 0) > return long (pos); > > @@ -522,6 +527,11 @@ > > return write (fd, buf, size); > } > + > +#ifdef _WIN64 > +// restore MSVC warning: conversion from '__int64' to 'long', possible loss of data > +#pragma warning (default: 4244) > +#endif > > > _RWSTD_EXPORT extern const void* __rw_std_streams[]; > > >