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

Commit21eb965

Browse files
committed
Fixarduino#217 issue with compiling with newer compiler
1 parentc486627 commit21eb965

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

‎api/CanMsg.h‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,7 @@ class CanMsg : public Printable
5151

5252
CanMsg() : CanMsg(0,0,nullptr) { }
5353

54-
CanMsg(CanMsgconst & other)
55-
{
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);
54+
CanMsg(CanMsgconst & other) : CanMsg(other.id, other.data_length, other.data) {
6055
}
6156

6257
virtual~CanMsg() { }
@@ -65,10 +60,10 @@ class CanMsg : public Printable
6560
{
6661
if (this != &other)
6762
{
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);
63+
id = other.id;
64+
data_length = other.data_length;
65+
if (data_length>0)
66+
memcpy(data, other.data, data_length);
7267
}
7368
return (*this);
7469
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp