From c09da8924a877689033180052fd7774d9ec78319 Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Fri, 6 Oct 2023 19:31:38 -0400 Subject: [PATCH] Rename fixedp serialization to integer/fractional --- src/JsonUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JsonUtils.cpp b/src/JsonUtils.cpp index 82b3381adf1..68e6e0dff5b 100644 --- a/src/JsonUtils.cpp +++ b/src/JsonUtils.cpp @@ -560,18 +560,18 @@ void from_json(const Json &obj, fixed &f) throw Json::type_error::create(320, "cannot pickle string to fixed point number"); char *next_str = const_cast(str.c_str()) + 1; - int64_t numerator = std::strtol(next_str, &next_str, 10); + int64_t integer = std::strtol(next_str, &next_str, 10); // handle cases: f/34, f1356, f14+4 if (next_str == nullptr || size_t(next_str - str.c_str()) >= str.size() || *next_str++ != '/') throw Json::type_error::create(320, "cannot pickle string to fixed point number"); - int64_t denominator = std::strtol(next_str, &next_str, 10); + int64_t fractional = std::strtol(next_str, &next_str, 10); // handle cases f1345/7684gfrty; fixed numbers should not have any garbage data involved if (next_str != str.c_str() + str.size()) throw Json::type_error::create(320, "cannot pickle string to fixed point number"); - f = fixed(numerator << f.FRAC | denominator); + f = fixed(integer << f.FRAC | fractional); } }