Add some modifications (space, new line, coma, float). 35/22035/2
authorArthur Guyader <arthur.guyader@iot.bzh>
Wed, 31 Jul 2019 12:46:38 +0000 (14:46 +0200)
committerArthur Guyader <arthur.guyader@iot.bzh>
Wed, 7 Aug 2019 12:27:24 +0000 (14:27 +0200)
This commit adds some modifications for code readability
and to remove compilation warnings in low can.

Signed-off-by: Arthur Guyader <arthur.guyader@iot.bzh>
Change-Id: Ia85f94125c1e9ff41cda60f027ab7213c8f378dc

src/main.cpp

index ac7ce4b..9f7969f 100644 (file)
@@ -151,7 +151,7 @@ std::ostream& operator<<(std::ostream& o, const generator<openxc::signal>& v)
                << v.line_prefix_ << "\t" << v.v_.bit_position() << ",// bit_position\n"\r
                << v.line_prefix_ << "\t" << v.v_.bit_size() << ",// bit_size\n"\r
                << v.line_prefix_ << "\t" << gen(v.v_.factor()) << ",// factor\n"\r
-               << v.line_prefix_ << "\t" << v.v_.offset() << ",// offset\n"\r
+               << v.line_prefix_ << "\t" << gen(v.v_.offset()) << ",// offset\n"\r
                << v.line_prefix_ << "\t" << "0,// min_value\n"\r
                << v.line_prefix_ << "\t" << "0,// max_value\n"\r
                << v.line_prefix_ << "\tfrequency_clock_t(" << gen(v.v_.max_frequency()) << "),// frequency\n"\r
@@ -168,11 +168,11 @@ std::ostream& operator<<(std::ostream& o, const generator<openxc::signal>& v)
                }else{\r
                        multi_first = "false";\r
                }\r
-               std::string multi = "std::make_pair<bool, int>(" + multi_first + "," + std::to_string(v.v_.multiplex().second) + ")";\r
+               std::string multi = "std::make_pair<bool, int>(" + multi_first + ", " + std::to_string(v.v_.multiplex().second) + ")";\r
        o       << v.line_prefix_ << '\t' << multi << ",// multiplex\n"\r
                << v.line_prefix_ << '\t' << v.v_.is_big_endian() << ",// is_big_endian\n"\r
                << v.line_prefix_ << '\t' << v.v_.is_signed() << ",// is_signed\n"\r
-               << v.line_prefix_ << "\t" << gen(v.v_.unit()) << ",// unit\n"\r
+               << v.line_prefix_ << "\t" << gen(v.v_.unit()) << "// unit\n"\r
                << v.line_prefix_ << "})}";\r
        return o;\r
 }\r
@@ -200,7 +200,7 @@ std::ostream& operator<<(std::ostream& o, const generator<openxc::can_message>&
        o       << "frequency_clock_t(" << gen(v.v_.max_frequency()) << "),"\r
                << gen(v.v_.force_send_changed()) << ",";\r
                std::uint32_t index = 0;\r
-       o       << "\t\t\t\t\t{ // beginning signals vector\n";\r
+       o       << "\n\t\t\t\t\t{ // beginning signals vector\n";\r
                        std::uint32_t signal_count = (uint32_t)v.v_.signals().size();\r
                        for(const openxc::signal& s : v.v_.signals())\r
                        {\r