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] Couple of tweaks to locale_facets.tcc


Hi,

straightforward, tested x86-linux, committed.

Paolo.

//////////
2003-10-04  Paolo Carlini  <pcarlini@unitus.it>

	* include/bits/locale_facets.tcc (num_get::_M_extract_float):
	Constify a couple of variables.
	(num_get::do_get(..., bool&)): Constify __c; prefer *__beg,
	++__beg to *__beg++.
diff -urN libstdc++-v3-orig/include/bits/locale_facets.tcc libstdc++-v3/include/bits/locale_facets.tcc
--- libstdc++-v3-orig/include/bits/locale_facets.tcc	2003-10-02 18:56:39.000000000 +0200
+++ libstdc++-v3/include/bits/locale_facets.tcc	2003-10-04 16:34:24.000000000 +0200
@@ -146,7 +146,7 @@
       // First check for sign.
       int __pos = 0;
       char_type  __c = *__beg;
-      bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
+      const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
       if ((__plus || __traits_type::eq(__c, __lit[_S_iminus])) 
 	  && __beg != __end)
 	{
@@ -230,7 +230,7 @@
 	      __c = *(++__beg);
 
 	      // Remove optional plus or minus sign, if they exist.
-	      bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
+	      const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
 	      if (__plus || __traits_type::eq(__c, __lit[_S_iminus]))
 		{
 		  ++__pos;
@@ -453,7 +453,8 @@
 	  bool __testt = false;
           for (size_t __n = 0; __beg != __end; ++__n)
             {
-              char_type __c = *__beg++;
+              const char_type __c = *__beg;
+	      ++__beg;
 
 	      if (__n <= __fn)
 		__testf = __traits_type::eq(__c, __lc->_M_falsename[__n]);

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