mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 840706 - Part 1: Add MFBT_API annotations to other methods in StringToDoubleConverter, r=glandium
The annotations added in bug 1770158 only covered `StringToDouble`, however as noted in the comments in that file, that isn't sufficient for accurately parsing floating point numbers. This patch extends the annotations to the single-precision floating point numbers as well and will be used in the next part to clean up the implementation of `nsTString::ToDouble`. Differential Revision: https://phabricator.services.mozilla.com/D148304
This commit is contained in:
parent
e5ec4ca924
commit
97bb85687e
@ -190,5 +190,19 @@ diff --git a/mfbt/double-conversion/double-conversion/string-to-double.h b/mfbt/
|
||||
// Same as StringToDouble but reads a float.
|
||||
// Note that this is not equivalent to static_cast<float>(StringToDouble(...))
|
||||
// due to potential double-rounding.
|
||||
float StringToFloat(const char* buffer,
|
||||
- float StringToFloat(const char* buffer,
|
||||
+ MFBT_API float StringToFloat(const char* buffer,
|
||||
int length,
|
||||
int* processed_characters_count) const;
|
||||
|
||||
// Same as StringToFloat above but for 16 bit characters.
|
||||
- float StringToFloat(const uc16* buffer,
|
||||
+ MFBT_API float StringToFloat(const uc16* buffer,
|
||||
int length,
|
||||
int* processed_characters_count) const;
|
||||
|
||||
// Same as StringToDouble for T = double, and StringToFloat for T = float.
|
||||
template <typename T>
|
||||
T StringTo(const char* buffer,
|
||||
int length,
|
||||
int* processed_characters_count) const;
|
||||
|
@ -196,12 +196,12 @@ class StringToDoubleConverter {
|
||||
// Same as StringToDouble but reads a float.
|
||||
// Note that this is not equivalent to static_cast<float>(StringToDouble(...))
|
||||
// due to potential double-rounding.
|
||||
float StringToFloat(const char* buffer,
|
||||
MFBT_API float StringToFloat(const char* buffer,
|
||||
int length,
|
||||
int* processed_characters_count) const;
|
||||
|
||||
// Same as StringToFloat above but for 16 bit characters.
|
||||
float StringToFloat(const uc16* buffer,
|
||||
MFBT_API float StringToFloat(const uc16* buffer,
|
||||
int length,
|
||||
int* processed_characters_count) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user