From 24d431f74e296c326e1fa795fc71f92bfb5343b0 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Mon, 3 Dec 2018 01:43:20 +0100 Subject: [PATCH] Fix warning (missing initializer for struct members --- src/core/receiver/control_thread.cc | 4 ++-- src/core/receiver/tcp_cmd_interface.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index c80c78de5..3ba722e28 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -166,7 +166,7 @@ void ControlThread::init() else { // fill agnss_ref_time_ - struct tm tm = {}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (strptime(ref_time_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm) != nullptr) { agnss_ref_time_.d_tv_sec = timegm(&tm); @@ -876,7 +876,7 @@ std::vector> ControlThread::get_visible_sats(time std::vector visible_gps; std::vector visible_gal; std::shared_ptr pvt_ptr = flowgraph_->get_pvt(); - struct tm tstruct = {}; + struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; char buf[80]; tstruct = *gmtime(&rx_utc_time); strftime(buf, sizeof(buf), "%d/%m/%Y %H:%M:%S ", &tstruct); diff --git a/src/core/receiver/tcp_cmd_interface.cc b/src/core/receiver/tcp_cmd_interface.cc index 220d4effb..012d7abb7 100644 --- a/src/core/receiver/tcp_cmd_interface.cc +++ b/src/core/receiver/tcp_cmd_interface.cc @@ -142,7 +142,7 @@ std::string TcpCmdInterface::status(const std::vector &commandLine &course_over_ground_deg, &UTC_time) == true) { - struct tm tstruct = {}; + struct tm tstruct = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; char buf1[80]; tstruct = *gmtime(&UTC_time); strftime(buf1, sizeof(buf1), "%d/%m/%Y %H:%M:%S", &tstruct); @@ -173,7 +173,7 @@ std::string TcpCmdInterface::hotstart(const std::vector &commandLin if (commandLine.size() > 5) { // Read commandline time parameter - struct tm tm = {}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) { response = "ERROR: time parameter malformed\n"; @@ -219,7 +219,7 @@ std::string TcpCmdInterface::warmstart(const std::vector &commandLi { std::string tmp_str; // Read commandline time parameter - struct tm tm = {}; + struct tm tm = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; tmp_str = commandLine.at(1) + commandLine.at(2); if (strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm) == nullptr) {