diff options
Diffstat (limited to 'absl/strings')
-rw-r--r-- | absl/strings/charconv.cc | 3 | ||||
-rw-r--r-- | absl/strings/internal/cordz_sample_token.h | 10 | ||||
-rw-r--r-- | absl/strings/internal/str_format/float_conversion.cc | 12 |
3 files changed, 13 insertions, 12 deletions
diff --git a/absl/strings/charconv.cc b/absl/strings/charconv.cc index 9f4e6d7c..c510aea4 100644 --- a/absl/strings/charconv.cc +++ b/absl/strings/charconv.cc @@ -203,7 +203,8 @@ struct FloatTraits<float> { if (mantissa > kMantissaMask) { // Normal value. // Adjust by 127 for the exponent representation bias, and an additional - // 23 due to the implied decimal point in the IEEE mantissa representation. + // 23 due to the implied decimal point in the IEEE mantissa + // representation. flt += static_cast<uint32_t>(exponent + 127 + kTargetMantissaBits - 1) << 23; mantissa &= kMantissaMask; diff --git a/absl/strings/internal/cordz_sample_token.h b/absl/strings/internal/cordz_sample_token.h index 96163c93..2a86bc3b 100644 --- a/absl/strings/internal/cordz_sample_token.h +++ b/absl/strings/internal/cordz_sample_token.h @@ -33,11 +33,11 @@ namespace cord_internal { // ST1 <- CH1 <- CH2 <- ST2 <- CH3 <- global_delete_queue_tail // // This list tracks that CH1 and CH2 were created after ST1, so the thread -// holding ST1 might have a reference to CH1, CH2, ST2, and CH3. However, ST2 was -// created later, so the thread holding the ST2 token cannot have a reference to -// ST1, CH1, or CH2. If ST1 is cleaned up first, that thread will delete ST1, -// CH1, and CH2. If instead ST2 is cleaned up first, that thread will only -// delete ST2. +// holding ST1 might have a reference to CH1, CH2, ST2, and CH3. However, ST2 +// was created later, so the thread holding the ST2 token cannot have a +// reference to ST1, CH1, or CH2. If ST1 is cleaned up first, that thread will +// delete ST1, CH1, and CH2. If instead ST2 is cleaned up first, that thread +// will only delete ST2. // // If ST1 is cleaned up first, the new list will be: // ST2 <- CH3 <- global_delete_queue_tail diff --git a/absl/strings/internal/str_format/float_conversion.cc b/absl/strings/internal/str_format/float_conversion.cc index 44b11390..1c729e7b 100644 --- a/absl/strings/internal/str_format/float_conversion.cc +++ b/absl/strings/internal/str_format/float_conversion.cc @@ -711,12 +711,12 @@ bool IncrementNibble(size_t nibble_index, Int* n) { constexpr size_t kShift = sizeof(Int) * 8 - 1; constexpr size_t kNumNibbles = sizeof(Int) * 8 / 4; Int before = *n >> kShift; - // Here we essentially want to take the number 1 and move it into the requested - // nibble, then add it to *n to effectively increment the nibble. However, - // ASan will complain if we try to shift the 1 beyond the limits of the Int, - // i.e., if the nibble_index is out of range. So therefore we check for this - // and if we are out of range we just add 0 which leaves *n unchanged, which - // seems like the reasonable thing to do in that case. + // Here we essentially want to take the number 1 and move it into the + // requested nibble, then add it to *n to effectively increment the nibble. + // However, ASan will complain if we try to shift the 1 beyond the limits of + // the Int, i.e., if the nibble_index is out of range. So therefore we check + // for this and if we are out of range we just add 0 which leaves *n + // unchanged, which seems like the reasonable thing to do in that case. *n += ((nibble_index >= kNumNibbles) ? 0 : (Int{1} << static_cast<int>(nibble_index * 4))); |