Skip to content

Commit baca227

Browse files
committed
namespace change didn't work. Revert that. Attempt to use brace initializer
1 parent 3b6aadc commit baca227

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/dbc.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include <regex>
77

8-
namespace {
8+
namespace libdbc {
99

1010
const auto floatPattern = "(-?\\d+\\.?(\\d+)?)"; // Can be negative
1111

@@ -30,7 +30,7 @@ enum VALToken { Identifier = 0, CANId, SignalName, Value, Description };
3030
struct VALObject {
3131
uint32_t can_id;
3232
std::string signal_name;
33-
std::vector<libdbc::Signal::SignalValueDescriptions> vd;
33+
std::vector<Signal::SignalValueDescriptions> vd;
3434
};
3535

3636
static bool parseVal(const std::string& str, VALObject& obj);
@@ -39,7 +39,7 @@ bool parseVal(const std::string& str, VALObject& obj) {
3939
obj.vd.clear();
4040
auto state = Identifier;
4141
const char* a = str.data();
42-
libdbc::Signal::SignalValueDescriptions vd;
42+
Signal::SignalValueDescriptions vd;
4343
for (;;) {
4444
switch (state) {
4545
case Identifier: {
@@ -140,10 +140,6 @@ bool parseVal(const std::string& str, VALObject& obj) {
140140
return false;
141141
}
142142

143-
} // Anonyomous namespace
144-
145-
namespace libdbc {
146-
147143
DbcParser::DbcParser()
148144
: version("")
149145
, nodes()
@@ -240,7 +236,7 @@ void DbcParser::parse_dbc_messages(const std::vector<std::string>& lines) {
240236

241237
std::vector<VALObject> sv;
242238

243-
VALObject obj;
239+
VALObject obj{};
244240
for (const auto& line : lines) {
245241
if (std::regex_search(line, match, message_re)) {
246242
uint32_t id = static_cast<uint32_t>(std::stoul(match.str(2)));

0 commit comments

Comments
 (0)