Skip to content

Commit 5d3268f

Browse files
committed
Fixed formatting issues from clang-format
Signed-off-by: Parth Patel <[email protected]>
1 parent 87f979f commit 5d3268f

File tree

2 files changed

+25
-26
lines changed

2 files changed

+25
-26
lines changed

src/fast_float/fast_float_strtod.h

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,42 +32,41 @@
3232
#define FAST_FLOAT_STRTOD_H
3333

3434
#ifdef __cplusplus
35-
extern "C"
36-
{
35+
extern "C" {
3736
#endif
3837

3938
#ifdef USE_FAST_FLOAT
40-
39+
4140
/**
42-
* @brief Converts a null-terminated byte string to a double using the fast_float library.
43-
*
44-
* This function provides a C-compatible wrapper around the fast_float library's string-to-double
45-
* conversion functionality. It aims to offer a faster alternative to the standard strtod function.
46-
*
47-
* @param nptr A pointer to the null-terminated byte string to be converted.
48-
* @param value A pointer to the double variable where the function stores converted double value.
49-
* On success, the function stores the converted double value. On failure, it stores
50-
* 0.0 and stores error code in errno to ERANGE or EINVAL.
51-
*
52-
* @return On success, returns char pointer pointing to '\0' at the end of the string.
53-
* On failure, returns char pointer pointing to first invalid character in the string.
54-
*
55-
* @note This function uses the fast_float library (https://github.com/fastfloat/fast_float)
56-
* for the actual conversion, which can be significantly faster than standard library functions.
57-
*
58-
* @see https://github.com/fastfloat/fast_float for more information on the underlying library.
59-
*/
60-
const char* fast_float_strtod(const char *str, double *value);
41+
* @brief Converts a null-terminated byte string to a double using the fast_float library.
42+
*
43+
* This function provides a C-compatible wrapper around the fast_float library's string-to-double
44+
* conversion functionality. It aims to offer a faster alternative to the standard strtod function.
45+
*
46+
* @param nptr A pointer to the null-terminated byte string to be converted.
47+
* @param value A pointer to the double variable where the function stores converted double value.
48+
* On success, the function stores the converted double value. On failure, it stores
49+
* 0.0 and stores error code in errno to ERANGE or EINVAL.
50+
*
51+
* @return On success, returns char pointer pointing to '\0' at the end of the string.
52+
* On failure, returns char pointer pointing to first invalid character in the string.
53+
*
54+
* @note This function uses the fast_float library (https://github.com/fastfloat/fast_float)
55+
* for the actual conversion, which can be significantly faster than standard library functions.
56+
*
57+
* @see https://github.com/fastfloat/fast_float for more information on the underlying library.
58+
*/
59+
const char *fast_float_strtod(const char *str, double *value);
6160

62-
static inline const char* valkey_strtod(const char *str, double *value) {
61+
static inline const char *valkey_strtod(const char *str, double *value) {
6362
errno = 0;
6463
return fast_float_strtod(str, value);
6564
}
6665

6766
#else
6867

69-
static inline const char* valkey_strtod(const char *str, double *value) {
70-
char* endptr;
68+
static inline const char *valkey_strtod(const char *str, double *value) {
69+
char *endptr;
7170
*value = strtod(str, &endptr);
7271
return endptr;
7372
}

src/resp_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static int parseDouble(ReplyParser *parser, void *p_ctx) {
156156
if (len <= MAX_LONG_DOUBLE_CHARS) {
157157
memcpy(buf, proto + 1, len);
158158
buf[len] = '\0';
159-
valkey_strtod(buf, &d); /* We expect a valid representation. */
159+
valkey_strtod(buf, &d); /* We expect a valid representation. */
160160
}
161161
parser->callbacks.double_callback(p_ctx, d, proto, parser->curr_location - proto);
162162
return C_OK;

0 commit comments

Comments
 (0)