Commit cdcdee12 by Paolo Carlini Committed by Paolo Carlini

streambuf.tcc (xsgetn, xsputn): Use streamsize instead of size_t.

2005-07-20  Paolo Carlini  <pcarlini@suse.de>

	* include/bits/streambuf.tcc (xsgetn, xsputn): Use streamsize
	instead of size_t.
	* src/streambuf.cc (__copy_streambufs): Likewise.

From-SVN: r102204
parent 71b50543
2005-07-20 Paolo Carlini <pcarlini@suse.de>
* include/bits/streambuf.tcc (xsgetn, xsputn): Use streamsize
instead of size_t.
* src/streambuf.cc (__copy_streambufs): Likewise.
2005-07-18 Paolo Carlini <pcarlini@suse.de> 2005-07-18 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/ctype_members.cc (do_is(mask, wchar_t)): * config/locale/gnu/ctype_members.cc (do_is(mask, wchar_t)):
......
// Stream buffer classes -*- C++ -*- // Stream buffer classes -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -52,11 +52,11 @@ namespace std ...@@ -52,11 +52,11 @@ namespace std
streamsize __ret = 0; streamsize __ret = 0;
while (__ret < __n) while (__ret < __n)
{ {
const size_t __buf_len = this->egptr() - this->gptr(); const streamsize __buf_len = this->egptr() - this->gptr();
if (__buf_len) if (__buf_len)
{ {
const size_t __remaining = __n - __ret; const streamsize __remaining = __n - __ret;
const size_t __len = std::min(__buf_len, __remaining); const streamsize __len = std::min(__buf_len, __remaining);
traits_type::copy(__s, this->gptr(), __len); traits_type::copy(__s, this->gptr(), __len);
__ret += __len; __ret += __len;
__s += __len; __s += __len;
...@@ -86,11 +86,11 @@ namespace std ...@@ -86,11 +86,11 @@ namespace std
streamsize __ret = 0; streamsize __ret = 0;
while (__ret < __n) while (__ret < __n)
{ {
const size_t __buf_len = this->epptr() - this->pptr(); const streamsize __buf_len = this->epptr() - this->pptr();
if (__buf_len) if (__buf_len)
{ {
const size_t __remaining = __n - __ret; const streamsize __remaining = __n - __ret;
const size_t __len = std::min(__buf_len, __remaining); const streamsize __len = std::min(__buf_len, __remaining);
traits_type::copy(this->pptr(), __s, __len); traits_type::copy(this->pptr(), __s, __len);
__ret += __len; __ret += __len;
__s += __len; __s += __len;
......
// Stream buffer classes -*- C++ -*- // Stream buffer classes -*- C++ -*-
// Copyright (C) 2004 Free Software Foundation, Inc. // Copyright (C) 2004, 2005 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -45,10 +45,10 @@ namespace std ...@@ -45,10 +45,10 @@ namespace std
traits_type::int_type __c = __sbin->sgetc(); traits_type::int_type __c = __sbin->sgetc();
while (!traits_type::eq_int_type(__c, traits_type::eof())) while (!traits_type::eq_int_type(__c, traits_type::eof()))
{ {
const size_t __n = __sbin->egptr() - __sbin->gptr(); const streamsize __n = __sbin->egptr() - __sbin->gptr();
if (__n > 1) if (__n > 1)
{ {
const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n); const streamsize __wrote = __sbout->sputn(__sbin->gptr(), __n);
__sbin->gbump(__wrote); __sbin->gbump(__wrote);
__ret += __wrote; __ret += __wrote;
if (__wrote < __n) if (__wrote < __n)
...@@ -78,10 +78,10 @@ namespace std ...@@ -78,10 +78,10 @@ namespace std
traits_type::int_type __c = __sbin->sgetc(); traits_type::int_type __c = __sbin->sgetc();
while (!traits_type::eq_int_type(__c, traits_type::eof())) while (!traits_type::eq_int_type(__c, traits_type::eof()))
{ {
const size_t __n = __sbin->egptr() - __sbin->gptr(); const streamsize __n = __sbin->egptr() - __sbin->gptr();
if (__n > 1) if (__n > 1)
{ {
const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n); const streamsize __wrote = __sbout->sputn(__sbin->gptr(), __n);
__sbin->gbump(__wrote); __sbin->gbump(__wrote);
__ret += __wrote; __ret += __wrote;
if (__wrote < __n) if (__wrote < __n)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment