Skip to content

Commit 6eb3dcd

Browse files
committed
lint
1 parent df5db2c commit 6eb3dcd

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

include/fast_float/fast_float_strtod.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
#define __FAST_FLOAT_STRTOD_H__
33

44
#if defined(__cplusplus)
5-
extern "C"
6-
{
5+
extern "C" {
76
#endif
87
/**
98
* @brief Convert a string to a double using the fast_float library. This is
10-
* a C-compatible wrapper around the fast_float parsing functionality, designed to
11-
* mimic the behavior of the standard strtod function.
9+
* a C-compatible wrapper around the fast_float parsing functionality, designed
10+
* to mimic the behavior of the standard strtod function.
1211
*
1312
* This function parses the initial portion of the null-terminated string `nptr`
1413
* and converts it to a `double`, similar to the standard `strtod` function but
@@ -23,7 +22,7 @@ extern "C"
2322
* to the beginning of the string.
2423
* @return The converted double value on success, or 0.0 on failure.
2524
*/
26-
double fast_float_strtod(const char *in, char **out);
25+
double fast_float_strtod(const char *in, char **out);
2726

2827
#if defined(__cplusplus)
2928
}

src/fast_float_strtod.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
#include <system_error>
66

77
extern "C" double fast_float_strtod(const char *nptr, char **endptr) {
8-
double result = 0.0;
8+
double result = 0.0;
99

10-
// Parse the string using fast_float's from_chars function
11-
auto parse_result = fast_float::from_chars(nptr, nptr + strlen(nptr), result);
10+
// Parse the string using fast_float's from_chars function
11+
auto parse_result = fast_float::from_chars(nptr, nptr + strlen(nptr), result);
1212

13-
// Check if parsing encountered an error
14-
if (parse_result.ec != std::errc{}) {
15-
errno = EINVAL;
16-
}
13+
// Check if parsing encountered an error
14+
if (parse_result.ec != std::errc{}) {
15+
errno = EINVAL;
16+
}
1717

18-
// Update endptr if provided
19-
if (endptr != nullptr) {
20-
*endptr = const_cast<char*>(parse_result.ptr);
21-
}
18+
// Update endptr if provided
19+
if (endptr != nullptr) {
20+
*endptr = const_cast<char *>(parse_result.ptr);
21+
}
2222

23-
return result;
23+
return result;
2424
}

0 commit comments

Comments
 (0)