This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Minor tweaks to localename.cc


Hi,

tested x86-linux, committed.

Paolo.

////////
2003-10-14  Paolo Carlini  <pcarlini@unitus.it>
	
	* src/localename.cc (_M_replace_categories, M_replace_facet):
	Const-ify a couple of variables.
diff -urN libstdc++-v3-1/src/localename.cc libstdc++-v3/src/localename.cc
--- libstdc++-v3-1/src/localename.cc	2003-10-03 01:06:13.000000000 +0200
+++ libstdc++-v3/src/localename.cc	2003-10-14 16:38:52.000000000 +0200
@@ -344,10 +344,9 @@
   locale::_Impl::
   _M_replace_categories(const _Impl* __imp, category __cat)
   {
-    category __mask;
     for (size_t __ix = 0; __ix < _S_categories_size; ++__ix)
       {
-	__mask = 1 << __ix;
+	const category __mask = 1 << __ix;
 	if (__mask & __cat)
 	  {
 	    // Need to replace entry in _M_facets with other locale's info.
@@ -377,7 +376,7 @@
   locale::_Impl::
   _M_replace_facet(const _Impl* __imp, const locale::id* __idp)
   {
-    size_t __index = __idp->_M_id();
+    const size_t __index = __idp->_M_id();
     if ((__index > (__imp->_M_facets_size - 1)) || !__imp->_M_facets[__index])
       __throw_runtime_error("locale::_Impl::_M_replace_facet");
     _M_install_facet(__idp, __imp->_M_facets[__index]); 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]