Content-Length: 307420 | pFad | https://github.com/astand/c-coderdbc/commit/7d42aec031c6e8650d87d8a09f060c9d25a4a13b

3F Explicit cast from int64 to uint32. · astand/c-coderdbc@7d42aec · GitHub
Skip to content

Commit 7d42aec

Browse files
committed
Explicit cast from int64 to uint32.
1 parent 196b17d commit 7d42aec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/parser/dbclineparser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ uint32_t DbcLineParser::ParseMultiTrans(std::vector<std::string>& outnodes, std:
151151

152152
if (chunks.size() >= 3 && chunks[0] == "BO_TX_BU_")
153153
{
154-
ret = clear_msgid(atoll(chunks[1].c_str()));
154+
ret = clear_msgid(static_cast<uint32_t>(atoll(chunks[1].c_str())));
155155

156156
if (ret != 0)
157157
{
@@ -453,7 +453,7 @@ bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line)
453453
// 1 CM_ marker
454454
// 2 target (message or signal)
455455
// 3 msg id
456-
uint32_t id = static_cast<uint32_t>((atoll(meta[2].c_str())));
456+
uint32_t id = static_cast<uint32_t>(atoll(meta[2].c_str()));
457457

458458
// clear message id from high 3 bits
459459
cm->MsgId = clear_msgid(id);
@@ -510,7 +510,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s
510510
if (items.size() > 4 && items[1] == "GenMsgCycleTime" && items[2] == "BO_")
511511
{
512512
attr->Type = AttributeType::CycleTime;
513-
attr->MsgId = clear_msgid(atoll(items[3].c_str()));
513+
attr->MsgId = clear_msgid(static_cast<uint32_t>(atoll(items[3].c_str())));
514514
// read value of ms of cycle time for the current message
515515
attr->Value = atoi(items[4].c_str());
516516
ret = true;
@@ -549,7 +549,7 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line)
549549

550550
if ((items.size() >= 3) && (items.back() == ";") && (items.size() % 2 == 0))
551551
{
552-
comm->MsgId = (clear_msgid(atoll(items[1].c_str())));
552+
comm->MsgId = (clear_msgid(static_cast<uint32_t>(atoll(items[1].c_str()))));
553553
comm->SigName = items[2];
554554
comm->Text = "";
555555
comm->ca_target = CommentTarget::Signal;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/astand/c-coderdbc/commit/7d42aec031c6e8650d87d8a09f060c9d25a4a13b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy