100 lines
4.1 KiB
Diff
100 lines
4.1 KiB
Diff
|
urg: fix 'narrowing conversion' with gcc6
|
|||
|
|
|||
|
Fixes:
|
|||
|
http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/
|
|||
|
|
|||
|
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
|
|||
|
|
|||
|
--- a/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:16.083995214 +0200
|
|||
|
+++ b/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:24.380832543 +0200
|
|||
|
@@ -120,7 +120,7 @@ struct ScipHandler::pImpl
|
|||
|
|
|||
|
// QT <20>̔<EFBFBD><CC94>s
|
|||
|
int return_code = -1;
|
|||
|
- char qt_expected_response[] = { 0, -1 };
|
|||
|
+ char qt_expected_response[] = { 0, (char)-1 };
|
|||
|
// return_code <20><><EFBFBD>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߁AsetLaserOutput() <20><><EFBFBD>p<EFBFBD><70><EFBFBD><EFBFBD><EFBFBD><EFBFBD> QT <20>𑗐M<F0919790><4D><EFBFBD><EFBFBD>
|
|||
|
if (response(return_code, "QT\n", qt_expected_response)) {
|
|||
|
laser_state_ = LaserOff;
|
|||
|
@@ -139,7 +139,7 @@ struct ScipHandler::pImpl
|
|||
|
|
|||
|
} else if (return_code == Scip11Response) {
|
|||
|
// SCIP1.1 <20>v<EFBFBD><76><EFBFBD>g<EFBFBD>R<EFBFBD><52><EFBFBD>̏ꍇ<CC8F>̂݁ASCIP2.0 <20>𑗐M<F0919790><4D><EFBFBD><EFBFBD>
|
|||
|
- char scip20_expected_response[] = { 0, -1 };
|
|||
|
+ char scip20_expected_response[] = { 0, (char)-1 };
|
|||
|
if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) {
|
|||
|
error_message_ =
|
|||
|
"SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting.";
|
|||
|
@@ -150,7 +150,7 @@ struct ScipHandler::pImpl
|
|||
|
|
|||
|
} else if (return_code == 0xE) {
|
|||
|
// TM <20><><EFBFBD>[<5B>h<EFBFBD>Ƃ݂Ȃ<DD82><C882>ATM2 <20>s<F094AD8D><73><EFBFBD><EFBFBD>
|
|||
|
- char tm2_expected_response[] = { 0, -1 };
|
|||
|
+ char tm2_expected_response[] = { 0, (char)-1 };
|
|||
|
if (response(return_code, "TM2\n", tm2_expected_response)) {
|
|||
|
laser_state_ = LaserOff;
|
|||
|
return changeBothBaudrate(baudrate);
|
|||
|
@@ -202,7 +202,7 @@ struct ScipHandler::pImpl
|
|||
|
snprintf(send_buffer, 10, "SS%06ld\n", baudrate);
|
|||
|
int return_code = -1;
|
|||
|
// !!! <20><><EFBFBD>ɐݒ<C990><DD92>Ώۂ̃{<7B>[<5B><><EFBFBD>[<5B>g<EFBFBD>A<EFBFBD>̏ꍇ<CC8F>̖߂<CC96><DF82>l<EFBFBD><6C> ss_expected... <20>ɒlj<C992><C789><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
- char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 };
|
|||
|
+ char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 };
|
|||
|
if (! response(return_code, send_buffer, ss_expected_response)) {
|
|||
|
error_message_ = "Baudrate change fail.";
|
|||
|
return false;
|
|||
|
@@ -216,7 +216,7 @@ struct ScipHandler::pImpl
|
|||
|
{
|
|||
|
// PP <20>̑<EFBFBD><CC91>M<EFBFBD>ƃf<C683>[<5B>^<5E>̎<EFBFBD><CC8E>M
|
|||
|
int return_code = -1;
|
|||
|
- char pp_expected_response[] = { 0, -1 };
|
|||
|
+ char pp_expected_response[] = { 0, (char)-1 };
|
|||
|
vector<string> lines;
|
|||
|
if (! response(return_code, "PP\n", pp_expected_response, &lines)) {
|
|||
|
error_message_ = "PP fail.";
|
|||
|
@@ -356,7 +356,7 @@ struct ScipHandler::pImpl
|
|||
|
|
|||
|
if (on) {
|
|||
|
int return_code = -1;
|
|||
|
- char expected_response[] = { 0, -1 };
|
|||
|
+ char expected_response[] = { 0, (char)-1 };
|
|||
|
if (! response(return_code, "BM\n", expected_response)) {
|
|||
|
error_message_ = "BM fail.";
|
|||
|
return false;
|
|||
|
@@ -369,7 +369,7 @@ struct ScipHandler::pImpl
|
|||
|
if (! mx_capturing_) {
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>邽<EFBFBD>߂<EFBFBD> QT <20>ł́A<CD81><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>҂ׂ<C282>
|
|||
|
int return_code = -1;
|
|||
|
- char qt_expected_response[] = { 0, -1 };
|
|||
|
+ char qt_expected_response[] = { 0, (char)-1 };
|
|||
|
if (! response(return_code, "QT\n", qt_expected_response)) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
@@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen
|
|||
|
bool ScipHandler::versionLines(vector<string>& lines)
|
|||
|
{
|
|||
|
int return_code = -1;
|
|||
|
- char expected_response[] = { 0, -1 };
|
|||
|
+ char expected_response[] = { 0, (char)-1 };
|
|||
|
if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) {
|
|||
|
return false;
|
|||
|
}
|
|||
|
@@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo
|
|||
|
|
|||
|
// TM0 or TM2 <20>̑<EFBFBD><CC91>M
|
|||
|
int return_code = -1;
|
|||
|
- char expected_response[] = { 0, -1 };
|
|||
|
+ char expected_response[] = { 0, (char)-1 };
|
|||
|
if (! pimpl->response(return_code, send_command, expected_response)) {
|
|||
|
pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail.";
|
|||
|
return false;
|
|||
|
@@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time
|
|||
|
{
|
|||
|
// TM1 <20>̒l<CC92><6C><EFBFBD>Ԃ<EFBFBD>
|
|||
|
int return_code = -1;
|
|||
|
- char expected_response[] = { 0, -1 };
|
|||
|
+ char expected_response[] = { 0, (char)-1 };
|
|||
|
vector<string> lines;
|
|||
|
if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) {
|
|||
|
pimpl->error_message_ = "TM1 fail.";
|