[v3] Various minor tweaks to locale_facets.tcc

Paolo Carlini pcarlini@unitus.it
Tue Oct 7 10:05:00 GMT 2003


Hi,

many trivial bits (reformattings, const-ifications) and one slightly more
interesting. We had, in money_get::do_get(..., string_type&):

          if (__pos_sign.size() && __neg_sign.size())
            {
              // Sign is mandatory.
              if (__c == __pos_sign[0])
                {
                  __sign = __pos_sign;
                  __c = *(++__beg);
                }
              else if (__c == __neg_sign[0])
                {
                  __sign = __neg_sign;
                  __c = *(++__beg);
                }
              else
                __testvalid = false;
            }
          else if (__pos_sign.size() && __c == __pos_sign[0])
            {
              __sign = __pos_sign;
              __c = *(++__beg);
            }
          else if (__neg_sign.size() && __c == __neg_sign[0])
            {
              __sign = __neg_sign;
              __c = *(++__beg);
            }

which I changed to:

          if (__pos_sign.size() && __c == __pos_sign[0])
            {
              __sign = __pos_sign;
              __c = *(++__beg);
            }
          else if (__neg_sign.size() && __c == __neg_sign[0])
            {
              __sign = __neg_sign;
              __c = *(++__beg);
            }
          else if (__pos_sign.size() && __neg_sign.size())
            {
              // Sign is mandatory.
              __testvalid = false;
            }

Much better, no? ;)

Tested x86-linux, committing...

Paolo.

////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_various
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20031007/72b4461e/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_various
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20031007/72b4461e/attachment-0001.ksh>


More information about the Gcc-patches mailing list