Fix naming. (#103)
Fix naming of `case_insensibility` to `case_insensitivity`.
diff --git a/AUTHORS b/AUTHORS
index 88b38ae..3fcb1f7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -12,3 +12,4 @@
Martin Olsson <mnemo@minimum.se>
Kent Williams <chaircrusher@gmail.com>
Elan Ruusamäe <glen@delfi.ee>
+Colin Hirsch <github@colin-hirsch.net>
diff --git a/Changelog b/Changelog
index b454d8b..66a24b4 100644
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,7 @@
2019-06-11:
Changed all macros to use DOUBLE_CONVERSION_ as prefix.
+ Renamed ALLOW_CASE_INSENSIBILITY to ALLOW_CASE_INSENSITIVITY,
+ the old name is still available but officially deprecated.
2019-05-25:
Fix `0x` for string->double conversion when Hex Floats are allowed.
diff --git a/double-conversion/double-conversion.cc b/double-conversion/double-conversion.cc
index bede45c..e047a28 100644
--- a/double-conversion/double-conversion.cc
+++ b/double-conversion/double-conversion.cc
@@ -456,8 +456,8 @@
static bool ConsumeSubString(Iterator* current,
Iterator end,
const char* substring,
- bool allow_case_insensibility) {
- if (allow_case_insensibility) {
+ bool allow_case_insensitivity) {
+ if (allow_case_insensitivity) {
return ConsumeSubStringImpl(current, end, substring, ToLower);
} else {
return ConsumeSubStringImpl(current, end, substring, Pass);
@@ -467,8 +467,8 @@
// Consumes first character of the str is equal to ch
inline bool ConsumeFirstCharacter(char ch,
const char* str,
- bool case_insensibility) {
- return case_insensibility ? ToLower(ch) == str[0] : ch == str[0];
+ bool case_insensitivity) {
+ return case_insensitivity ? ToLower(ch) == str[0] : ch == str[0];
}
} // namespace
@@ -803,7 +803,7 @@
const bool allow_leading_spaces = (flags_ & ALLOW_LEADING_SPACES) != 0;
const bool allow_trailing_spaces = (flags_ & ALLOW_TRAILING_SPACES) != 0;
const bool allow_spaces_after_sign = (flags_ & ALLOW_SPACES_AFTER_SIGN) != 0;
- const bool allow_case_insensibility = (flags_ & ALLOW_CASE_INSENSIBILITY) != 0;
+ const bool allow_case_insensitivity = (flags_ & ALLOW_CASE_INSENSITIVITY) != 0;
// To make sure that iterator dereferencing is valid the following
// convention is used:
@@ -853,8 +853,8 @@
}
if (infinity_symbol_ != NULL) {
- if (ConsumeFirstCharacter(*current, infinity_symbol_, allow_case_insensibility)) {
- if (!ConsumeSubString(¤t, end, infinity_symbol_, allow_case_insensibility)) {
+ if (ConsumeFirstCharacter(*current, infinity_symbol_, allow_case_insensitivity)) {
+ if (!ConsumeSubString(¤t, end, infinity_symbol_, allow_case_insensitivity)) {
return junk_string_value_;
}
@@ -872,8 +872,8 @@
}
if (nan_symbol_ != NULL) {
- if (ConsumeFirstCharacter(*current, nan_symbol_, allow_case_insensibility)) {
- if (!ConsumeSubString(¤t, end, nan_symbol_, allow_case_insensibility)) {
+ if (ConsumeFirstCharacter(*current, nan_symbol_, allow_case_insensitivity)) {
+ if (!ConsumeSubString(¤t, end, nan_symbol_, allow_case_insensitivity)) {
return junk_string_value_;
}
diff --git a/double-conversion/double-conversion.h b/double-conversion/double-conversion.h
index 4fc24ed..ff19311 100644
--- a/double-conversion/double-conversion.h
+++ b/double-conversion/double-conversion.h
@@ -395,7 +395,8 @@
ALLOW_LEADING_SPACES = 8,
ALLOW_TRAILING_SPACES = 16,
ALLOW_SPACES_AFTER_SIGN = 32,
- ALLOW_CASE_INSENSIBILITY = 64,
+ ALLOW_CASE_INSENSITIVITY = 64,
+ ALLOW_CASE_INSENSIBILITY = 64, // Deprecated
ALLOW_HEX_FLOATS = 128,
};
@@ -430,7 +431,7 @@
// - ALLOW_SPACES_AFTER_SIGN: ignore whitespace after the sign.
// Ex: StringToDouble("- 123.2") -> -123.2.
// StringToDouble("+ 123.2") -> 123.2
- // - ALLOW_CASE_INSENSIBILITY: ignore case of characters for special values:
+ // - ALLOW_CASE_INSENSITIVITY: ignore case of characters for special values:
// infinity and nan.
// - ALLOW_HEX_FLOATS: allows hexadecimal float literals.
// This *must* start with "0x" and separate the exponent with "p".
diff --git a/test/cctest/test-conversions.cc b/test/cctest/test-conversions.cc
index e811739..397d8b3 100644
--- a/test/cctest/test-conversions.cc
+++ b/test/cctest/test-conversions.cc
@@ -5546,7 +5546,7 @@
TEST(StringToDoubleCaseInsensitiveSpecialValues) {
int processed = 0;
- int flags = StringToDoubleConverter::ALLOW_CASE_INSENSIBILITY |
+ int flags = StringToDoubleConverter::ALLOW_CASE_INSENSITIVITY |
StringToDoubleConverter::ALLOW_LEADING_SPACES |
StringToDoubleConverter::ALLOW_TRAILING_JUNK |
StringToDoubleConverter::ALLOW_TRAILING_SPACES;