Fix a problem with MATCH_MASK handling in Regex
authorMikko Rasa <tdb@tdb.fi>
Sun, 8 Mar 2009 15:35:26 +0000 (15:35 +0000)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Mar 2009 15:35:26 +0000 (15:35 +0000)
Explicitly cast both arguments to pow to the same type so mingw doesn't get confused

source/lexicalcast.cpp
source/regex.cpp

index cdd55780b5f612ee86cce7db6beee8c64d80502f..9ba642f2ae48bebe826c226ef98b8604e4c49114 100644 (file)
@@ -305,7 +305,7 @@ string flt_to_str(T v, const Fmt &f)
        }
 
        // Apply rounding
-       w+=5.0l/pow(10.0l, digits);
+       w+=5.0l/pow(10.0l, static_cast<long double>(digits));
        if(w>10)
        {
                // Rounding bumped us to the next exponent, deal with it
index 9ba089d09008c7fd1c23a9d700051984eab11362..7e9c8b0c713c11965f9d5f6b7c8afad4cc696926 100644 (file)
@@ -472,9 +472,9 @@ bool Regex::run(const string &str, const string::const_iterator &begin, RegMatch
                                                {
                                                        unsigned char m=*(j->citer+(c>>3));
                                                        match_result=m&(1<<(c&7));
-                                                       input_consumed=true;
-                                                       j->citer+=32;
                                                }
+                                               input_consumed=true;
+                                               j->citer+=32;
                                        }
                                        else if(instr==MATCH_ANY)
                                        {