diff --git a/include/fast_float/fast_float_strtod.h b/include/fast_float/fast_float_strtod.h index 6411f76..bba5c81 100644 --- a/include/fast_float/fast_float_strtod.h +++ b/include/fast_float/fast_float_strtod.h @@ -2,13 +2,12 @@ #define __FAST_FLOAT_STRTOD_H__ #if defined(__cplusplus) -extern "C" -{ +extern "C" { #endif /** * @brief Convert a string to a double using the fast_float library. This is - * a C-compatible wrapper around the fast_float parsing functionality, designed to - * mimic the behavior of the standard strtod function. + * a C-compatible wrapper around the fast_float parsing functionality, designed + * to mimic the behavior of the standard strtod function. * * This function parses the initial portion of the null-terminated string `nptr` * and converts it to a `double`, similar to the standard `strtod` function but @@ -23,7 +22,7 @@ extern "C" * to the beginning of the string. * @return The converted double value on success, or 0.0 on failure. */ - double fast_float_strtod(const char *in, char **out); +double fast_float_strtod(const char *in, char **out); #if defined(__cplusplus) } diff --git a/src/fast_float_strtod.cpp b/src/fast_float_strtod.cpp index cce1176..c8dbb65 100644 --- a/src/fast_float_strtod.cpp +++ b/src/fast_float_strtod.cpp @@ -5,20 +5,20 @@ #include extern "C" double fast_float_strtod(const char *nptr, char **endptr) { - double result = 0.0; + double result = 0.0; - // Parse the string using fast_float's from_chars function - auto parse_result = fast_float::from_chars(nptr, nptr + strlen(nptr), result); + // Parse the string using fast_float's from_chars function + auto parse_result = fast_float::from_chars(nptr, nptr + strlen(nptr), result); - // Check if parsing encountered an error - if (parse_result.ec != std::errc{}) { - errno = EINVAL; - } + // Check if parsing encountered an error + if (parse_result.ec != std::errc{}) { + errno = EINVAL; + } - // Update endptr if provided - if (endptr != nullptr) { - *endptr = const_cast(parse_result.ptr); - } + // Update endptr if provided + if (endptr != nullptr) { + *endptr = const_cast(parse_result.ptr); + } - return result; + return result; } \ No newline at end of file