Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 447 invoked from network); 22 Sep 2006 13:08:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Sep 2006 13:08:13 -0000 Received: (qmail 99328 invoked by uid 500); 22 Sep 2006 13:08:13 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 99268 invoked by uid 500); 22 Sep 2006 13:08:13 -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 99252 invoked by uid 99); 22 Sep 2006 13:08:12 -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, 22 Sep 2006 06:08:12 -0700 Authentication-Results: idunn.apache.osuosl.org smtp.mail=FaridZ@kyiv.vdiweb.com; spf=permerror X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received-SPF: error (idunn.apache.osuosl.org: domain kyiv.vdiweb.com from 212.82.213.172 cause and error) Received: from [212.82.213.172] ([212.82.213.172:3402] helo=exkiv.kyiv.vdiweb.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id 80/5A-06791-230E3154 for ; Fri, 22 Sep 2006 06:08:05 -0700 Content-class: urn:content-classes:message Subject: RE: svn commit: r448754 [2/6] - /incubator/stdcxx/trunk/util/ MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 22 Sep 2006 16:07:36 +0300 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: svn commit: r448754 [2/6] - /incubator/stdcxx/trunk/util/ Thread-Index: Acbd4AHb2nEFIEfYQamTyCNOj2djHAAZY9pA From: "Farid Zaripov" To: X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: sebor@apache.org [mailto:sebor@apache.org]=20 > Sent: Friday, September 22, 2006 3:42 AM > To: stdcxx-commits@incubator.apache.org > Subject: svn commit: r448754 [2/6] - /incubator/stdcxx/trunk/util/ >=20 > Modified: incubator/stdcxx/trunk/util/codecvt.cpp > URL:=20 > http://svn.apache.org/viewvc/incubator/stdcxx/trunk/util/codec > vt.cpp?view=3Ddiff&rev=3D448754&r1=3D448753&r2=3D448754 [...] > write_codecvt (std::string dir_name) > { [...] > ////////////////////////////////////////////////////////////////// > + // write out the multibyte to wchar_t tables > + issue_diag (I_WRITE, false, 0, > + "writing %lu multibyte tables (%lu characters)\n", > + mbchar_offs.size (), n_mbchars); > + > + for (off_iter_t it =3D mbchar_offs.begin (); it !=3D=20 > mbchar_offs.end (); ++it) { > + for (unsigned i =3D 0; i <=3D UCHAR_MAX; ++i) { > + > + const unsigned off =3D it->second->off [i]; > + > + out.write ((const char*)&off, sizeof off); > } > + > + delete it->second->off; I think here should be "delete it->second;". At this line the MSVC 7.1 gives warnings: codecvt.cpp(548) : warning C4156: deletion of an array expression without using the array form of 'delete'; array form substituted codecvt.cpp(548) : warning C4154: deletion of an array expression; conversion to pointer supplied > } > =20 > - issue_diag (I_WRITE, false, 0, "writing wchar_t to char=20 > table\n"); > + // not needed beyond this point, clear it out > + mbchar_offs.clear (); > + > + =20 > ////////////////////////////////////////////////////////////////// > + // write out the wchar_t to multibyte conversion tables > + issue_diag (I_WRITE, false, 0, > + "writing %lu wchar_t tables (%lu characters)\n", > + wchar_offs.size (), n_wchars); > + > + for (off_iter_t it =3D wchar_offs.begin (); it !=3D=20 > wchar_offs.end (); ++it) { > + for (unsigned i =3D 0; i <=3D UCHAR_MAX; ++i) { > + > + // adjust offsets to multibyte characters (but not those > + // to other tables or invalid encodings) > + unsigned off =3D it->second->off [i]; > + > + if (!(off & 0x80000000)) > + off +=3D mb_offset; > =20 > - // now write the wide_to_narrow tables > - for (wchar_offs_it =3D wchar_offs_.begin();=20 > - wchar_offs_it !=3D wchar_offs_.end(); wchar_offs_it++) { > - for (unsigned int c =3D 0; c <=3D UCHAR_MAX; c++) { > - out.write ((const char*)&wchar_offs_it->second.off[c], > - sizeof (wchar_offs_it->second.off[c])); > + out.write ((const char*)&off, sizeof off); > } > + > + delete it->second->off; The same here,=20 > } > =20 > - issue_diag (I_WRITE, false, 0, "writing UTF-8 to char table\n"); > + // not needed beyond this point, clear it out > + wchar_offs.clear (); > + > + =20 > ////////////////////////////////////////////////////////////////// > + // write out the UTF-8 to (libc) multibyte tables > + issue_diag (I_WRITE, false, 0, > + "writing %lu UTF-8 tables (%lu characters)\n", > + uchar_offs.size (), n_uchars); > + > + for (off_iter_t it =3D uchar_offs.begin (); it !=3D=20 > uchar_offs.end (); ++it) { > + for (unsigned i =3D 0; i <=3D UCHAR_MAX; ++i) { > + > + // adjust offsets to multibyte characters (but not those > + // to other tables or invalid encodings) > + unsigned off =3D it->second->off [i]; > =20 > - // write the utf8_to_external tables > - for (utf8_offs_it =3D utf8_offs_it =3D utf8_offs_.begin();=20 > - utf8_offs_it !=3D utf8_offs_.end(); utf8_offs_it++) { > - for (unsigned int c =3D 0; c <=3D UCHAR_MAX; c++) { > - out.write ((const char*)&utf8_offs_it->second.off[c], > - sizeof (utf8_offs_it->second.off[c])); > + if (!(off & 0x80000000)) > + off +=3D mb_offset; > + > + out.write ((const char*)&off, sizeof off); > } > + > + delete it->second->off; ... and here. Farid.