Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 86141 invoked from network); 6 Oct 2006 20:56:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Oct 2006 20:56:01 -0000 Received: (qmail 84971 invoked by uid 500); 6 Oct 2006 20:56:01 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 84959 invoked by uid 500); 6 Oct 2006 20:56:00 -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 84947 invoked by uid 99); 6 Oct 2006 20:56:00 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Oct 2006 13:56:00 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [208.30.140.160] ([208.30.140.160:29236] helo=moroha.quovadx.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 96/DB-24193-8D2C6254 for ; Fri, 06 Oct 2006 13:55:56 -0700 Received: from qxvcexch01.ad.quovadx.com (qxvcexch01.ad.quovadx.com [192.168.170.59]) by moroha.quovadx.com (8.13.6/8.13.6) with ESMTP id k96KtfkS019112 for ; Fri, 6 Oct 2006 20:55:42 GMT Received: from [10.70.3.113] ([10.70.3.113]) by qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 6 Oct 2006 14:55:51 -0600 Message-ID: <4526C2DE.2020004@roguewave.com> Date: Fri, 06 Oct 2006 14:55:58 -0600 From: Martin Sebor Organization: Rogue Wave Software User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: [PATCH] STDCXX-93 References: <45266CF8.60900@kyiv.vdiweb.com> In-Reply-To: <45266CF8.60900@kyiv.vdiweb.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 06 Oct 2006 20:55:51.0416 (UTC) FILETIME=[CEB15F80:01C6E989] X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Farid Zaripov wrote: > > -----Original Message----- > > From: Martin Sebor [mailto:sebor@roguewave.com] > > Sent: Thursday, October 05, 2006 6:59 PM > > To: stdcxx-dev@incubator.apache.org > > Subject: Re: [PATCH] STDCXX-93 > > > > We should either pass in the size of the destination buffer > > or some large value that windows can deal with. > > First, I have made this, but then I had seen the first mbstowcs() call > with length of source string in the size and changed by analogy. > > New patch is attached. This looks correct to me. Just one request regarding formatting: [...] > @@ -804,9 +805,9 @@ > // (at an appropriately aligned offset) and set its offset > const char *str = > _RWSTD_STATIC_CAST (const char*, pun->abmon (t.tm_mon, 0)); > - > wchar_t *pwbuf = _RWSTD_REINTERPRET_CAST (wchar_t*, pbuf + off); > - _RWSTD_SIZE_T size = mbstowcs (pwbuf, str, _RWSTD_SIZE_MAX); > + _RWSTD_SIZE_T size = mbstowcs (pwbuf, str, > + (bufsize - off) / sizeof (*pwbuf)); The style of indentation we've been following breaks the statement above either after the equals sign _RWSTD_SIZE_T size = mbstowcs (pwbuf, str, (bufsize - off) / sizeof *pwbuf); or (IMHO, less preferably) indents the function arguments on the next lines to begin in the same column as the first argument on the first line. _RWSTD_SIZE_T size = mbstowcs (pwbuf, str, (bufsize - off) / sizeof *pwbuf); The goal is to use indentation to group subexpression according to their role in the complete expression or statement to help readability. Martin