From d57a5d33066a4b0923ca6b8819fa508f56660330 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 30 Jun 2023 10:48:43 +0200 Subject: [PATCH] Refactor parameter name for parse() from cfg to json Signed-off-by: Steffen Vogel --- include/villas/hooks/lua.hpp | 2 +- include/villas/node_compat.hpp | 4 ++-- include/villas/nodes/fpga.hpp | 2 +- lib/node_compat.cpp | 6 +++--- lib/nodes/fpga.cpp | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/villas/hooks/lua.hpp b/include/villas/hooks/lua.hpp index 85cb5e03b..2a5672ab5 100644 --- a/include/villas/hooks/lua.hpp +++ b/include/villas/hooks/lua.hpp @@ -108,7 +108,7 @@ public: virtual ~LuaHook(); - virtual void parse(json_t *cfg); + virtual void parse(json_t *json); virtual void prepare(); diff --git a/include/villas/node_compat.hpp b/include/villas/node_compat.hpp index 14b3ef58f..c24ff5e2b 100644 --- a/include/villas/node_compat.hpp +++ b/include/villas/node_compat.hpp @@ -66,12 +66,12 @@ public: /** Parse node connection details. * - * @param cfg A JSON object containing the configuration of the node. + * @param json A JSON object containing the configuration of the node. * @retval 0 Success. Everything went well. * @retval <0 Error. Something went wrong. */ virtual - int parse(json_t *cfg, const uuid_t sn_uuid); + int parse(json_t *json, const uuid_t sn_uuid); /** Returns a string with a textual represenation of this node. */ virtual diff --git a/include/villas/nodes/fpga.hpp b/include/villas/nodes/fpga.hpp index d0e1ba693..b523a2261 100644 --- a/include/villas/nodes/fpga.hpp +++ b/include/villas/nodes/fpga.hpp @@ -57,7 +57,7 @@ public: ~FpgaNode(); virtual - int parse(json_t *cfg, const uuid_t sn_uuid); + int parse(json_t *json, const uuid_t sn_uuid); virtual const std::string & getDetails(); diff --git a/lib/node_compat.cpp b/lib/node_compat.cpp index 3d7a7376a..369458c17 100644 --- a/lib/node_compat.cpp +++ b/lib/node_compat.cpp @@ -89,14 +89,14 @@ int NodeCompat::prepare() return Node::prepare(); } -int NodeCompat::parse(json_t *cfg, const uuid_t sn_uuid) +int NodeCompat::parse(json_t *json, const uuid_t sn_uuid) { - int ret = Node::parse(cfg, sn_uuid); + int ret = Node::parse(json, sn_uuid); if (ret) return ret; ret = _vt->parse - ? _vt->parse(this, cfg) + ? _vt->parse(this, json) : 0; if (!ret) state = State::PARSED; diff --git a/lib/nodes/fpga.cpp b/lib/nodes/fpga.cpp index d0b6b3cdc..327b61e66 100644 --- a/lib/nodes/fpga.cpp +++ b/lib/nodes/fpga.cpp @@ -52,9 +52,9 @@ FpgaNode::FpgaNode(const std::string &name) : FpgaNode::~FpgaNode() { } -int FpgaNode::parse(json_t *cfg, const uuid_t sn_uuid) +int FpgaNode::parse(json_t *json, const uuid_t sn_uuid) { - int ret = Node::parse(cfg, sn_uuid); + int ret = Node::parse(json); if (ret) return ret; @@ -65,7 +65,7 @@ int FpgaNode::parse(json_t *cfg, const uuid_t sn_uuid) const char *dma = nullptr; int poll = polling; - ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: s, s?: s, s?: i, s?: b }", + ret = json_unpack_ex(json, &err, 0, "{ s?: s, s?: s, s?: s, s?: i, s?: b }", "card", &card, "interface", &intf, "dma", &dma, @@ -73,7 +73,7 @@ int FpgaNode::parse(json_t *cfg, const uuid_t sn_uuid) "polling", &polling ); if (ret) - throw ConfigError(cfg, err, "node-config-fpga", "Failed to parse configuration of node {}", this->getName()); + throw ConfigError(json, err, "node-config-fpga", "Failed to parse configuration of node {}", this->getName()); if (card) cardName = card;