mirror of git://gcc.gnu.org/git/gcc.git
1.cc: Use initialization instead of copying as the string is used only once.
2005-05-13 Magnus Fromreide <magfr@lysator.liu.se> * testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Use initialization instead of copying as the string is used only once. * testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise. * testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise. From-SVN: r99663
This commit is contained in:
parent
771aaa92ab
commit
894b1dff50
|
|
@ -1,3 +1,11 @@
|
||||||
|
2005-05-13 Magnus Fromreide <magfr@lysator.liu.se>
|
||||||
|
|
||||||
|
* testsuite/27_io/basic_streambuf/sgetn/char/1.cc: Use
|
||||||
|
initialization instead of copying as the string is used only once.
|
||||||
|
* testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc: Likewise.
|
||||||
|
* testsuite/27_io/basic_streambuf/sputn/char/1.cc: Likewise.
|
||||||
|
* testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc: Likewise.
|
||||||
|
|
||||||
2005-05-12 Benjamin Kosnik <bkoz@redhat.com>
|
2005-05-12 Benjamin Kosnik <bkoz@redhat.com>
|
||||||
|
|
||||||
* scripts/create_testsuite_files: Fix.
|
* scripts/create_testsuite_files: Fix.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// 1999-10-11 bkoz
|
// 1999-10-11 bkoz
|
||||||
|
|
||||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 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
|
||||||
|
|
@ -94,10 +95,8 @@ void test02()
|
||||||
|
|
||||||
bool test __attribute__((unused)) = true;
|
bool test __attribute__((unused)) = true;
|
||||||
|
|
||||||
const char* lit00 = "chicago underground trio/possible cube on delmark";
|
char lit01[] = "chicago underground trio/possible cube on delmark";
|
||||||
size_t i01 = traits_type::length(lit00);
|
size_t i01 = traits_type::length(lit01);
|
||||||
char lit01[i01];
|
|
||||||
strcpy(lit01, lit00);
|
|
||||||
|
|
||||||
testbuf buf01;
|
testbuf buf01;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// 1999-10-11 bkoz
|
// 1999-10-11 bkoz
|
||||||
|
|
||||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
|
// Copyright (C) 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
|
||||||
|
|
@ -96,10 +96,8 @@ void test02()
|
||||||
|
|
||||||
bool test __attribute__((unused)) = true;
|
bool test __attribute__((unused)) = true;
|
||||||
|
|
||||||
const wchar_t* lit00 = L"chicago underground trio/possible cube on delmark";
|
wchar_t lit01[] = L"chicago underground trio/possible cube on delmark";
|
||||||
size_t i01 = traits_type::length(lit00);
|
size_t i01 = traits_type::length(lit01);
|
||||||
wchar_t lit01[i01];
|
|
||||||
std::wcscpy(lit01, lit00);
|
|
||||||
|
|
||||||
testbuf buf01;
|
testbuf buf01;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
// 1999-10-11 bkoz
|
// 1999-10-11 bkoz
|
||||||
|
|
||||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 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
|
||||||
|
|
@ -96,10 +97,8 @@ void test01()
|
||||||
testbuf buf01;
|
testbuf buf01;
|
||||||
|
|
||||||
// sputn/xsputn
|
// sputn/xsputn
|
||||||
const char* lit01 = "isotope 217: the unstable molecule on thrill jockey";
|
char lit02[] = "isotope 217: the unstable molecule on thrill jockey";
|
||||||
const int i02 = std::strlen(lit01);
|
const int i02 = std::strlen(lit02);
|
||||||
char lit02[i02];
|
|
||||||
std::strcpy(lit02, lit01);
|
|
||||||
|
|
||||||
char carray[i02 + 1];
|
char carray[i02 + 1];
|
||||||
std::memset(carray, 0, i02 + 1);
|
std::memset(carray, 0, i02 + 1);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// 1999-10-11 bkoz
|
// 1999-10-11 bkoz
|
||||||
|
|
||||||
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
|
// Copyright (C) 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
|
||||||
|
|
@ -98,10 +98,8 @@ void test01()
|
||||||
testbuf buf01;
|
testbuf buf01;
|
||||||
|
|
||||||
// sputn/xsputn
|
// sputn/xsputn
|
||||||
const wchar_t* lit01 = L"isotope 217: the unstable molecule on thrill jockey";
|
wchar_t lit02[] = L"isotope 217: the unstable molecule on thrill jockey";
|
||||||
const int i02 = std::wcslen(lit01);
|
const int i02 = std::wcslen(lit02);
|
||||||
wchar_t lit02[i02];
|
|
||||||
std::wcscpy(lit02, lit01);
|
|
||||||
|
|
||||||
wchar_t carray[i02 + 1];
|
wchar_t carray[i02 + 1];
|
||||||
std::wmemset(carray, 0, i02 + 1);
|
std::wmemset(carray, 0, i02 + 1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue