Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d42aec

Browse files
committed
Explicit cast from int64 to uint32.
1 parent196b17d commit7d42aec

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)

[8]ページ先頭

©2009-2025 Movatter.jp