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

Commit2c4e96c

Browse files
authored
Merge pull request#224 from jboynes/can_msg
Fix#217 when compiling with newer compiler versions
2 parentsc486627 +8ffd335 commit2c4e96c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎api/CanMsg.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class CanMsg : public Printable
5353

5454
CanMsg(CanMsgconst & other)
5555
{
56-
this->id = other.id;
57-
this->data_length = other.data_length;
58-
if (this->data_length&& other.data)
59-
memcpy(this->data, other.data,this->data_length);
56+
id = other.id;
57+
data_length = other.data_length;
58+
if (data_length>0)
59+
memcpy(data, other.data, data_length);
6060
}
6161

6262
virtual~CanMsg() { }
@@ -65,10 +65,10 @@ class CanMsg : public Printable
6565
{
6666
if (this != &other)
6767
{
68-
this->id = other.id;
69-
this->data_length = other.data_length;
70-
if (this->data_length&& other.data)
71-
memcpy(this->data, other.data,this->data_length);
68+
id = other.id;
69+
data_length = other.data_length;
70+
if (data_length>0)
71+
memcpy(data, other.data, data_length);
7272
}
7373
return (*this);
7474
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp