diff --git a/include/spdk/json.h b/include/spdk/json.h index 915939d70..ed5fb660e 100644 --- a/include/spdk/json.h +++ b/include/spdk/json.h @@ -176,7 +176,6 @@ bool spdk_json_strequal(const struct spdk_json_val *val, const char *str); */ char *spdk_json_strdup(const struct spdk_json_val *val); -int spdk_json_number_to_double(const struct spdk_json_val *val, double *num); int spdk_json_number_to_int32(const struct spdk_json_val *val, int32_t *num); int spdk_json_number_to_uint32(const struct spdk_json_val *val, uint32_t *num); diff --git a/lib/json/json_util.c b/lib/json/json_util.c index 18bf48d1b..edf9a83f5 100644 --- a/lib/json/json_util.c +++ b/lib/json/json_util.c @@ -199,30 +199,6 @@ spdk_json_number_split(const struct spdk_json_val *val, struct spdk_json_num *nu return 0; } -int -spdk_json_number_to_double(const struct spdk_json_val *val, double *num) -{ - char buf[32]; - char *end; - - if (val->type != SPDK_JSON_VAL_NUMBER || val->len >= sizeof(buf)) { - *num = 0.0; - return -1; - } - - memcpy(buf, val->start, val->len); - buf[val->len] = '\0'; - - errno = 0; - /* TODO: strtod() uses locale for decimal point (. is not guaranteed) */ - *num = strtod(buf, &end); - if (*end != '\0' || errno != 0) { - return -1; - } - - return 0; -} - int spdk_json_number_to_int32(const struct spdk_json_val *val, int32_t *num) {