Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
0459bf32
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0459bf32
编写于
12月 13, 2018
作者:
L
Liangliang Zhang
提交者:
Jiangtao Hu
12月 13, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Driver: cleared all warnings. Enabled strict check for Wconversion.
上级
44a7714f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
10 deletion
+9
-10
modules/drivers/canbus/can_client/can_client_tool.cc
modules/drivers/canbus/can_client/can_client_tool.cc
+5
-5
modules/drivers/canbus/can_client/esd/esd_can_client.cc
modules/drivers/canbus/can_client/esd/esd_can_client.cc
+1
-1
modules/drivers/canbus/can_client/fake/fake_can_client_test.cc
...es/drivers/canbus/can_client/fake/fake_can_client_test.cc
+1
-1
modules/drivers/canbus/can_comm/protocol_data.h
modules/drivers/canbus/can_comm/protocol_data.h
+1
-1
tools/bazel.rc
tools/bazel.rc
+1
-2
未找到文件。
modules/drivers/canbus/can_client/can_client_tool.cc
浏览文件 @
0459bf32
...
...
@@ -19,8 +19,8 @@
#include <memory>
#include <thread>
#include "gflags/gflags.h"
#include "cyber/common/log.h"
#include "gflags/gflags.h"
#include "modules/common/proto/error_code.pb.h"
#include "modules/common/time/time.h"
#include "modules/common/util/factory.h"
...
...
@@ -134,8 +134,8 @@ class CanAgent {
send_id
=
id
;
frames
[
i
].
id
=
id
;
frames
[
i
].
len
=
8
;
frames
[
i
].
data
[
7
]
=
count
%
256
;
for
(
int32
_t
j
=
0
;
j
<
7
;
++
j
)
{
frames
[
i
].
data
[
7
]
=
static_cast
<
uint8_t
>
(
count
%
256
)
;
for
(
uint8
_t
j
=
0
;
j
<
7
;
++
j
)
{
frames
[
i
].
data
[
j
]
=
j
;
}
++
count
;
...
...
@@ -159,7 +159,7 @@ class CanAgent {
}
}
int64_t
end
=
AsInt64
<
micros
>
(
Clock
::
Now
());
param
->
send_time
=
end
-
start
;
param
->
send_time
=
static_cast
<
int32_t
>
(
end
-
start
)
;
// In case for finish too quick to receiver miss some msg
sleep
(
2
);
AINFO
<<
"Send thread stopping..."
<<
param
->
conf
.
ShortDebugString
();
...
...
@@ -215,7 +215,7 @@ class CanAgent {
}
}
int64_t
end
=
AsInt64
<
micros
>
(
Clock
::
Now
());
param
->
recv_time
=
end
-
start
;
param
->
recv_time
=
static_cast
<
int32_t
>
(
end
-
start
)
;
AINFO
<<
"Recv thread stopping..., conf:"
<<
param
->
conf
.
ShortDebugString
();
return
;
}
...
...
modules/drivers/canbus/can_client/esd/esd_can_client.cc
浏览文件 @
0459bf32
...
...
@@ -277,7 +277,7 @@ std::string EsdCanClient::GetErrorString(const NTCAN_RESULT ntstatus) {
char
sz_error_text
[
60
];
res
=
canFormatError
(
ntstatus
,
NTCAN_ERROR_FORMAT_LONG
,
sz_error_text
,
s
izeof
(
sz_error_text
)
-
1
);
s
tatic_cast
<
uint32_t
>
(
sizeof
(
sz_error_text
)
-
1
)
);
if
(
NTCAN_SUCCESS
==
res
)
{
snprintf
(
reinterpret_cast
<
char
*>
(
str_buf
),
ERROR_BUF_SIZE
,
"%s - %s"
,
es
->
str
,
sz_error_text
);
...
...
modules/drivers/canbus/can_client/fake/fake_can_client_test.cc
浏览文件 @
0459bf32
...
...
@@ -78,7 +78,7 @@ TEST_F(FakeCanClientTest, SendMessage) {
frames
[
i
].
id
=
1
&
0x3FF
;
frames
[
i
].
len
=
8
;
frames
[
i
].
data
[
7
]
=
1
%
256
;
for
(
int32
_t
j
=
0
;
j
<
7
;
++
j
)
{
for
(
uint8
_t
j
=
0
;
j
<
7
;
++
j
)
{
frames
[
i
].
data
[
j
]
=
j
;
}
}
...
...
modules/drivers/canbus/can_comm/protocol_data.h
浏览文件 @
0459bf32
...
...
@@ -121,7 +121,7 @@ T ProtocolData<SensorType>::BoundedValue(T lower, T upper, T val) {
template
<
typename
SensorType
>
uint8_t
ProtocolData
<
SensorType
>::
CalculateCheckSum
(
const
uint8_t
*
input
,
const
uint32_t
length
)
{
return
st
d
::
accumulate
(
input
,
input
+
length
,
0
)
^
0xFF
;
return
st
atic_cast
<
uint8_t
>
(
std
::
accumulate
(
input
,
input
+
length
,
0
)
^
0xFF
)
;
}
template
<
typename
SensorType
>
...
...
tools/bazel.rc
浏览文件 @
0459bf32
...
...
@@ -70,8 +70,7 @@ build --copt="-Werror=unused-but-set-variable"
build --copt="-Werror=switch"
# Strict check on type conversion.
# TODO(all): Clear drivers module and remove it from exception.
build --per_file_copt=^modules/.*\.cc,-^modules/drivers/.*\.cc@-Werror=conversion
build --per_file_copt=^modules/.*\.cc@-Werror=conversion
# TODO(all): Clear cyber warnings and add it to the strict check.
build --per_file_copt=^cyber/.*\.cc@-Wconversion
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录