From: Alexandre Oliva <aoliva@redhat.com>
To: Benjamin Kosnik <bkoz@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: operands to min and max must have the same type...
Date: Wed, 05 Mar 2003 22:25:00 -0000 [thread overview]
Message-ID: <oradg9jvtu.fsf@free.redhat.lsd.ic.unicamp.br> (raw)
In-Reply-To: <20030304225734.57d1be09.bkoz@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 208 bytes --]
On Mar 5, 2003, Benjamin Kosnik <bkoz@redhat.com> wrote:
> (note the lack of space).
> See C++STYLE.
Thanks, I didn't know about these guidelines. Fixed with the
following patch, that I'm checking in.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: lscxx-ws.patch --]
[-- Type: text/x-patch, Size: 3812 bytes --]
Index: libstdc++-v3/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* src/strstream.cc, include/bits/basic_string.tcc: Remove
incorrect whitespace added in my previous change.
Index: libstdc++-v3/src/strstream.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/strstream.cc,v
retrieving revision 1.16
diff -u -p -r1.16 strstream.cc
--- libstdc++-v3/src/strstream.cc 4 Mar 2003 21:21:44 -0000 1.16
+++ libstdc++-v3/src/strstream.cc 5 Mar 2003 22:23:33 -0000
@@ -148,7 +148,7 @@ namespace std
if (pptr() == epptr() && _M_dynamic && !_M_frozen && !_M_constant)
{
ptrdiff_t old_size = epptr() - pbase();
- ptrdiff_t new_size = std::max(ptrdiff_t (2 * old_size), ptrdiff_t (1));
+ ptrdiff_t new_size = std::max(ptrdiff_t(2 * old_size), ptrdiff_t(1));
char* buf = _M_alloc(new_size);
if (buf)
Index: libstdc++-v3/include/bits/basic_string.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/basic_string.tcc,v
retrieving revision 1.32
diff -u -p -r1.32 basic_string.tcc
--- libstdc++-v3/include/bits/basic_string.tcc 4 Mar 2003 21:21:44 -0000 1.32
+++ libstdc++-v3/include/bits/basic_string.tcc 5 Mar 2003 22:23:33 -0000
@@ -578,7 +578,7 @@ namespace std
// Iff appending itself, string needs to pre-reserve the
// correct size so that _M_mutate does not clobber the
// iterators formed here.
- size_type __len = std::min(size_type (__str.size() - __pos),
+ size_type __len = std::min(size_type(__str.size() - __pos),
__n) + this->size();
if (__len > this->capacity())
this->reserve(__len);
@@ -710,7 +710,7 @@ namespace std
size_type __size = this->size();
if (__n <= __size)
{
- __pos = std::min(size_type (__size - __n), __pos);
+ __pos = std::min(size_type(__size - __n), __pos);
const _CharT* __data = _M_data();
do
{
@@ -849,7 +849,7 @@ namespace std
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
- size_type __rsize= std::min(size_type (__size - __pos), __n);
+ size_type __rsize= std::min(size_type(__size - __pos), __n);
size_type __len = std::min(__rsize, __osize);
int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len);
if (!__r)
@@ -868,8 +868,8 @@ namespace std
if (__pos1 > __size || __pos2 > __osize)
__throw_out_of_range("basic_string::compare");
- size_type __rsize = std::min(size_type (__size - __pos1), __n1);
- size_type __rosize = std::min(size_type (__osize - __pos2), __n2);
+ size_type __rsize = std::min(size_type(__size - __pos1), __n1);
+ size_type __rosize = std::min(size_type(__osize - __pos2), __n2);
size_type __len = std::min(__rsize, __rosize);
int __r = traits_type::compare(_M_data() + __pos1,
__str.data() + __pos2, __len);
@@ -904,7 +904,7 @@ namespace std
__throw_out_of_range("basic_string::compare");
size_type __osize = traits_type::length(__s);
- size_type __rsize = std::min(size_type (__size - __pos), __n1);
+ size_type __rsize = std::min(size_type(__size - __pos), __n1);
size_type __len = std::min(__rsize, __osize);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
@@ -923,7 +923,7 @@ namespace std
__throw_out_of_range("basic_string::compare");
size_type __osize = std::min(traits_type::length(__s), __n2);
- size_type __rsize = std::min(size_type (__size - __pos), __n1);
+ size_type __rsize = std::min(size_type(__size - __pos), __n1);
size_type __len = std::min(__rsize, __osize);
int __r = traits_type::compare(_M_data() + __pos, __s, __len);
if (!__r)
[-- Attachment #3: Type: text/plain, Size: 289 bytes --]
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer
next prev parent reply other threads:[~2003-03-05 22:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-28 22:38 Alexandre Oliva
2003-03-04 20:38 ` Phil Edwards
2003-03-04 22:13 ` Benjamin Kosnik
2003-03-05 2:49 ` Alexandre Oliva
2003-03-05 4:59 ` Benjamin Kosnik
2003-03-05 22:25 ` Alexandre Oliva [this message]
2003-03-06 17:37 ` Benjamin Kosnik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=oradg9jvtu.fsf@free.redhat.lsd.ic.unicamp.br \
--to=aoliva@redhat.com \
--cc=bkoz@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).