1 urg: fix 'narrowing conversion' with gcc6
4 http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/
6 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
8 --- a/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:16.083995214 +0200
9 +++ b/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:24.380832543 +0200
10 @@ -120,7 +120,7 @@ struct ScipHandler::pImpl
14 - char qt_expected_response[] = { 0, -1 };
15 + char qt_expected_response[] = { 0, (char)-1 };
16 // return_code ‚ðŽg‚¢‚½‚¢‚½‚ß�AsetLaserOutput() ‚ð—p‚¢‚¸‚É QT ‚ð‘—�M‚·‚é
17 if (response(return_code, "QT\n", qt_expected_response)) {
18 laser_state_ = LaserOff;
19 @@ -139,7 +139,7 @@ struct ScipHandler::pImpl
21 } else if (return_code == Scip11Response) {
22 // SCIP1.1 ƒvƒ�ƒgƒRƒ‹‚Ì�ê�‡‚Ì‚Ý�ASCIP2.0 ‚ð‘—�M‚·‚é
23 - char scip20_expected_response[] = { 0, -1 };
24 + char scip20_expected_response[] = { 0, (char)-1 };
25 if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) {
27 "SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting.";
28 @@ -150,7 +150,7 @@ struct ScipHandler::pImpl
30 } else if (return_code == 0xE) {
31 // TM ƒ‚�[ƒh‚Æ‚Ý‚È‚µ�ATM2 ‚ð”�s‚·‚é
32 - char tm2_expected_response[] = { 0, -1 };
33 + char tm2_expected_response[] = { 0, (char)-1 };
34 if (response(return_code, "TM2\n", tm2_expected_response)) {
35 laser_state_ = LaserOff;
36 return changeBothBaudrate(baudrate);
37 @@ -202,7 +202,7 @@ struct ScipHandler::pImpl
38 snprintf(send_buffer, 10, "SS%06ld\n", baudrate);
40 // !!! Šù‚É�Ý’è‘Î�ۂ̃{�[ƒŒ�[ƒg�A‚Ì�ê�‡‚Ì–ß‚è’l‚ð ss_expected... ‚ɒljÁ‚·‚é
41 - char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 };
42 + char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 };
43 if (! response(return_code, send_buffer, ss_expected_response)) {
44 error_message_ = "Baudrate change fail.";
46 @@ -216,7 +216,7 @@ struct ScipHandler::pImpl
48 // PP ‚Ì‘—�M‚ƃf�[ƒ^‚ÌŽó�M
50 - char pp_expected_response[] = { 0, -1 };
51 + char pp_expected_response[] = { 0, (char)-1 };
53 if (! response(return_code, "PP\n", pp_expected_response, &lines)) {
54 error_message_ = "PP fail.";
55 @@ -356,7 +356,7 @@ struct ScipHandler::pImpl
59 - char expected_response[] = { 0, -1 };
60 + char expected_response[] = { 0, (char)-1 };
61 if (! response(return_code, "BM\n", expected_response)) {
62 error_message_ = "BM fail.";
64 @@ -369,7 +369,7 @@ struct ScipHandler::pImpl
65 if (! mx_capturing_) {
66 // �Á“”‚·‚邽‚ß‚Ì QT ‚Å‚Í�A‰ž“š‚ð‘҂‚ׂ«
68 - char qt_expected_response[] = { 0, -1 };
69 + char qt_expected_response[] = { 0, (char)-1 };
70 if (! response(return_code, "QT\n", qt_expected_response)) {
73 @@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen
74 bool ScipHandler::versionLines(vector<string>& lines)
77 - char expected_response[] = { 0, -1 };
78 + char expected_response[] = { 0, (char)-1 };
79 if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) {
82 @@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo
86 - char expected_response[] = { 0, -1 };
87 + char expected_response[] = { 0, (char)-1 };
88 if (! pimpl->response(return_code, send_command, expected_response)) {
89 pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail.";
91 @@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time
95 - char expected_response[] = { 0, -1 };
96 + char expected_response[] = { 0, (char)-1 };
98 if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) {
99 pimpl->error_message_ = "TM1 fail.";