rename variables

This commit is contained in:
jbnadal
2018-04-11 15:45:09 +02:00
parent 05fbc418ff
commit 6fa96e928d
2 changed files with 6 additions and 7 deletions

View File

@@ -31,7 +31,6 @@ file(
${workspaceRoot}/src/prog/domod/src/ubus/capabilities_shutters.cpp
${workspaceRoot}/src/prog/domod/src/ubus/capabilities_sprinklers.cpp
${workspaceRoot}/src/prog/domod/src/ubus/timers.cpp
# Timers
${workspaceRoot}/src/prog/domod/src/timers/timers-manager.cpp
${workspaceRoot}/src/prog/domod/src/timers/event.cpp

View File

@@ -69,7 +69,7 @@ TimerManager::~TimerManager(void)
*/
int TimerManager::load(void)
{
struct json_object *the_root_node, *the_data_node;
struct json_object *the_root_node, *the_timers_node;
the_root_node = json_object_from_file(m_timers_path.c_str());
if (the_root_node == NULL)
@@ -78,17 +78,17 @@ int TimerManager::load(void)
return -1;
}
if (json_object_object_get_ex(the_root_node, k_entry_timers, &the_data_node) && (json_object_get_type(the_data_node) == json_type_array))
if (json_object_object_get_ex(the_root_node, k_entry_timers, &the_timers_node) && (json_object_get_type(the_timers_node) == json_type_array))
{
int the_len;
struct json_object *the_timer_node;
struct json_object *the_event_node;
the_len = json_object_array_length(the_data_node);
the_len = json_object_array_length(the_timers_node);
for (int i = 0; i < the_len; i++)
{
Event the_event;
the_timer_node = json_object_array_get_idx(the_data_node, i);
the_event.from_json(the_timer_node);
the_event_node = json_object_array_get_idx(the_timers_node, i);
the_event.from_json(the_event_node);
m_timers.push_back(the_event);
}