tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

debug-only-functions.patch (1180B)


      1 diff --git a/double-conversion/strtod.cc b/double-conversion/strtod.cc
      2 --- a/double-conversion/strtod.cc
      3 +++ b/double-conversion/strtod.cc
      4 @@ -436,16 +436,17 @@ static bool ComputeGuess(Vector<const ch
      5     return true;
      6   }
      7   if (*guess == Double::Infinity()) {
      8     return true;
      9   }
     10   return false;
     11 }
     12 
     13 +#ifdef DEBUG
     14 static bool IsDigit(const char d) {
     15   return ('0' <= d) && (d <= '9');
     16 }
     17 
     18 static bool IsNonZeroDigit(const char d) {
     19   return ('1' <= d) && (d <= '9');
     20 }
     21 
     22 @@ -457,16 +458,17 @@ static bool IsNonZeroDigit(const char d)
     23 static bool AssertTrimmedDigits(const Vector<const char>& buffer) {
     24   for(int i = 0; i < buffer.length(); ++i) {
     25     if(!IsDigit(buffer[i])) {
     26       return false;
     27     }
     28   }
     29   return (buffer.length() == 0) || (IsNonZeroDigit(buffer[0]) && IsNonZeroDigit(buffer[buffer.length()-1]));
     30 }
     31 +#endif
     32 
     33 double StrtodTrimmed(Vector<const char> trimmed, int exponent) {
     34   DOUBLE_CONVERSION_ASSERT(trimmed.length() <= kMaxSignificantDecimalDigits);
     35   DOUBLE_CONVERSION_ASSERT(AssertTrimmedDigits(trimmed));
     36   double guess;
     37   const bool is_correct = ComputeGuess(trimmed, exponent, &guess);
     38   if (is_correct) {
     39     return guess;