Commit 391cfc46 by Paolo Carlini Committed by Paolo Carlini

locale_classes.h: Fully qualify standard functions with std::, thus avoiding Koenig lookup.

2003-07-06  Paolo Carlini  <pcarlini@unitus.it>

	* include/bits/locale_classes.h: Fully qualify standard
	functions with std::, thus avoiding Koenig lookup.
	* include/bits/locale_facets.tcc: Likewise.
	* src/locale.cc: Likewise.
	* src/localename.cc: Likewise.

From-SVN: r68997
parent 1d088dee
2003-07-06 Paolo Carlini <pcarlini@unitus.it>
* include/bits/locale_classes.h: Fully qualify standard
functions with std::, thus avoiding Koenig lookup.
* include/bits/locale_facets.tcc: Likewise.
* src/locale.cc: Likewise.
* src/localename.cc: Likewise.
2003-07-06 Phil Edwards <pme@gcc.gnu.org>
* include/bits/allocator_traits.h: Fix doxygen markup.
......
......@@ -386,7 +386,7 @@ namespace std
{
delete [] _M_impl->_M_names[__i];
char* __new = new char[2];
strcpy(__new, "*");
std::strcpy(__new, "*");
_M_impl->_M_names[__i] = __new;
}
}
......
......@@ -176,18 +176,18 @@ namespace std
if (__s)
{
_S_initialize();
if (strcmp(__s, "C") == 0 || strcmp(__s, "POSIX") == 0)
if (std::strcmp(__s, "C") == 0 || std::strcmp(__s, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else if (strcmp(__s, "") != 0)
else if (std::strcmp(__s, "") != 0)
_M_impl = new _Impl(__s, 1);
else
{
// Get it from the environment.
char* __env = getenv("LC_ALL");
// If LC_ALL is set we are done.
if (__env && strcmp(__env, "") != 0)
if (__env && std::strcmp(__env, "") != 0)
{
if (strcmp(__env, "C") == 0 || strcmp(__env, "POSIX") == 0)
if (std::strcmp(__env, "C") == 0 || std::strcmp(__env, "POSIX") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else
_M_impl = new _Impl(__env, 1);
......@@ -197,8 +197,8 @@ namespace std
char* __res;
// LANG may set a default different from "C".
char* __env = getenv("LANG");
if (!__env || strcmp(__env, "") == 0 || strcmp(__env, "C") == 0
|| strcmp(__env, "POSIX") == 0)
if (!__env || std::strcmp(__env, "") == 0 || std::strcmp(__env, "C") == 0
|| std::strcmp(__env, "POSIX") == 0)
__res = strdup("C");
else
__res = strdup(__env);
......@@ -206,21 +206,21 @@ namespace std
// Scan the categories looking for the first one
// different from LANG.
size_t __i = 0;
if (strcmp(__res, "C") == 0)
if (std::strcmp(__res, "C") == 0)
for (; __i < _S_categories_size; ++__i)
{
__env = getenv(_S_categories[__i]);
if (__env && strcmp(__env, "") != 0
&& strcmp(__env, "C") != 0
&& strcmp(__env, "POSIX") != 0)
if (__env && std::strcmp(__env, "") != 0
&& std::strcmp(__env, "C") != 0
&& std::strcmp(__env, "POSIX") != 0)
break;
}
else
for (; __i < _S_categories_size; ++__i)
{
__env = getenv(_S_categories[__i]);
if (__env && strcmp(__env, "") != 0
&& strcmp(__env, __res) != 0)
if (__env && std::strcmp(__env, "") != 0
&& std::strcmp(__env, __res) != 0)
break;
}
......@@ -244,15 +244,15 @@ namespace std
for (; __i < _S_categories_size; ++__i)
{
__env = getenv(_S_categories[__i]);
if (!__env || strcmp(__env, "") == 0)
if (!__env || std::strcmp(__env, "") == 0)
{
__str += _S_categories[__i];
__str += '=';
__str += __res;
__str += ';';
}
else if (strcmp(__env, "C") == 0
|| strcmp(__env, "POSIX") == 0)
else if (std::strcmp(__env, "C") == 0
|| std::strcmp(__env, "POSIX") == 0)
{
__str += _S_categories[__i];
__str += "=C;";
......@@ -270,7 +270,7 @@ namespace std
}
// ... otherwise either an additional instance of
// the "C" locale or LANG.
else if (strcmp(__res, "C") == 0)
else if (std::strcmp(__res, "C") == 0)
(_M_impl = _S_classic)->_M_add_reference();
else
_M_impl = new _Impl(__res, 1);
......@@ -323,7 +323,7 @@ namespace std
__other._M_impl->_M_add_reference();
_S_global = __other._M_impl;
if (_S_global->_M_check_same_name()
&& (strcmp(_S_global->_M_names[0], "*") != 0))
&& (std::strcmp(_S_global->_M_names[0], "*") != 0))
setlocale(LC_ALL, __other.name().c_str());
// Reference count sanity check: one reference removed for the
......
......@@ -150,7 +150,7 @@ namespace std
for (size_t __i = 0; __i < _S_categories_size; ++__i)
{
char* __new = new char[strlen(__imp._M_names[__i]) + 1];
strcpy(__new, __imp._M_names[__i]);
std::strcpy(__new, __imp._M_names[__i]);
_M_names[__i] = __new;
}
}
......@@ -199,13 +199,13 @@ namespace std
delete [] _M_names;
__throw_exception_again;
}
size_t __len = strlen(__s);
if (!strchr(__s, ';'))
size_t __len = std::strlen(__s);
if (!std::strchr(__s, ';'))
{
for (size_t __i = 0; __i < _S_categories_size; ++__i)
{
_M_names[__i] = new char[__len + 1];
strcpy(_M_names[__i], __s);
std::strcpy(_M_names[__i], __s);
}
}
else
......@@ -213,12 +213,12 @@ namespace std
const char* __beg = __s;
for (size_t __i = 0; __i < _S_categories_size; ++__i)
{
__beg = strchr(__beg, '=') + 1;
const char* __end = strchr(__beg, ';');
__beg = std::strchr(__beg, '=') + 1;
const char* __end = std::strchr(__beg, ';');
if (!__end)
__end = __s + __len;
char* __new = new char[__end - __beg + 1];
memcpy(__new, __beg, __end - __beg);
std::memcpy(__new, __beg, __end - __beg);
__new[__end - __beg] = '\0';
_M_names[__i] = __new;
}
......@@ -355,12 +355,12 @@ namespace std
// Need to replace entry in _M_facets with other locale's info.
_M_replace_category(__imp, _S_facet_categories[__ix]);
// If both have names, go ahead and mangle.
if (strcmp(_M_names[__ix], "*") != 0
&& strcmp(__imp->_M_names[__ix], "*") != 0)
if (std::strcmp(_M_names[__ix], "*") != 0
&& std::strcmp(__imp->_M_names[__ix], "*") != 0)
{
delete [] _M_names[__ix];
char* __new = new char[strlen(__imp->_M_names[__ix]) + 1];
strcpy(__new, __imp->_M_names[__ix]);
char* __new = new char[std::strlen(__imp->_M_names[__ix]) + 1];
std::strcpy(__new, __imp->_M_names[__ix]);
_M_names[__ix] = __new;
}
}
......
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