1*4882a593Smuzhiyunurg: fix 'narrowing conversion' with gcc6 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunFixes: 4*4882a593Smuzhiyun http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/ 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunSigned-off-by: Samuel Martin <s.martin49@gmail.com> 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun--- a/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:16.083995214 +0200 9*4882a593Smuzhiyun+++ b/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:24.380832543 +0200 10*4882a593Smuzhiyun@@ -120,7 +120,7 @@ struct ScipHandler::pImpl 11*4882a593Smuzhiyun 12*4882a593Smuzhiyun // QT �̔��s 13*4882a593Smuzhiyun int return_code = -1; 14*4882a593Smuzhiyun- char qt_expected_response[] = { 0, -1 }; 15*4882a593Smuzhiyun+ char qt_expected_response[] = { 0, (char)-1 }; 16*4882a593Smuzhiyun // return_code ���g���������߁AsetLaserOutput() ��p������ QT �M���� 17*4882a593Smuzhiyun if (response(return_code, "QT\n", qt_expected_response)) { 18*4882a593Smuzhiyun laser_state_ = LaserOff; 19*4882a593Smuzhiyun@@ -139,7 +139,7 @@ struct ScipHandler::pImpl 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun } else if (return_code == Scip11Response) { 22*4882a593Smuzhiyun // SCIP1.1 �v���g�R���̏ꍇ�̂݁ASCIP2.0 �M���� 23*4882a593Smuzhiyun- char scip20_expected_response[] = { 0, -1 }; 24*4882a593Smuzhiyun+ char scip20_expected_response[] = { 0, (char)-1 }; 25*4882a593Smuzhiyun if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) { 26*4882a593Smuzhiyun error_message_ = 27*4882a593Smuzhiyun "SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting."; 28*4882a593Smuzhiyun@@ -150,7 +150,7 @@ struct ScipHandler::pImpl 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun } else if (return_code == 0xE) { 31*4882a593Smuzhiyun // TM ���[�h�Ƃ݂Ȃ��ATM2 �s���� 32*4882a593Smuzhiyun- char tm2_expected_response[] = { 0, -1 }; 33*4882a593Smuzhiyun+ char tm2_expected_response[] = { 0, (char)-1 }; 34*4882a593Smuzhiyun if (response(return_code, "TM2\n", tm2_expected_response)) { 35*4882a593Smuzhiyun laser_state_ = LaserOff; 36*4882a593Smuzhiyun return changeBothBaudrate(baudrate); 37*4882a593Smuzhiyun@@ -202,7 +202,7 @@ struct ScipHandler::pImpl 38*4882a593Smuzhiyun snprintf(send_buffer, 10, "SS%06ld\n", baudrate); 39*4882a593Smuzhiyun int return_code = -1; 40*4882a593Smuzhiyun // !!! ���ɐݒ�Ώۂ̃{�[���[�g�A�̏ꍇ�̖߂�l�� ss_expected... �ɒlj����� 41*4882a593Smuzhiyun- char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 }; 42*4882a593Smuzhiyun+ char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 }; 43*4882a593Smuzhiyun if (! response(return_code, send_buffer, ss_expected_response)) { 44*4882a593Smuzhiyun error_message_ = "Baudrate change fail."; 45*4882a593Smuzhiyun return false; 46*4882a593Smuzhiyun@@ -216,7 +216,7 @@ struct ScipHandler::pImpl 47*4882a593Smuzhiyun { 48*4882a593Smuzhiyun // PP �̑��M�ƃf�[�^�̎�M 49*4882a593Smuzhiyun int return_code = -1; 50*4882a593Smuzhiyun- char pp_expected_response[] = { 0, -1 }; 51*4882a593Smuzhiyun+ char pp_expected_response[] = { 0, (char)-1 }; 52*4882a593Smuzhiyun vector<string> lines; 53*4882a593Smuzhiyun if (! response(return_code, "PP\n", pp_expected_response, &lines)) { 54*4882a593Smuzhiyun error_message_ = "PP fail."; 55*4882a593Smuzhiyun@@ -356,7 +356,7 @@ struct ScipHandler::pImpl 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun if (on) { 58*4882a593Smuzhiyun int return_code = -1; 59*4882a593Smuzhiyun- char expected_response[] = { 0, -1 }; 60*4882a593Smuzhiyun+ char expected_response[] = { 0, (char)-1 }; 61*4882a593Smuzhiyun if (! response(return_code, "BM\n", expected_response)) { 62*4882a593Smuzhiyun error_message_ = "BM fail."; 63*4882a593Smuzhiyun return false; 64*4882a593Smuzhiyun@@ -369,7 +369,7 @@ struct ScipHandler::pImpl 65*4882a593Smuzhiyun if (! mx_capturing_) { 66*4882a593Smuzhiyun // �������邽�߂� QT �ł́A������҂ׂ� 67*4882a593Smuzhiyun int return_code = -1; 68*4882a593Smuzhiyun- char qt_expected_response[] = { 0, -1 }; 69*4882a593Smuzhiyun+ char qt_expected_response[] = { 0, (char)-1 }; 70*4882a593Smuzhiyun if (! response(return_code, "QT\n", qt_expected_response)) { 71*4882a593Smuzhiyun return false; 72*4882a593Smuzhiyun } 73*4882a593Smuzhiyun@@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen 74*4882a593Smuzhiyun bool ScipHandler::versionLines(vector<string>& lines) 75*4882a593Smuzhiyun { 76*4882a593Smuzhiyun int return_code = -1; 77*4882a593Smuzhiyun- char expected_response[] = { 0, -1 }; 78*4882a593Smuzhiyun+ char expected_response[] = { 0, (char)-1 }; 79*4882a593Smuzhiyun if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) { 80*4882a593Smuzhiyun return false; 81*4882a593Smuzhiyun } 82*4882a593Smuzhiyun@@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun // TM0 or TM2 �̑��M 85*4882a593Smuzhiyun int return_code = -1; 86*4882a593Smuzhiyun- char expected_response[] = { 0, -1 }; 87*4882a593Smuzhiyun+ char expected_response[] = { 0, (char)-1 }; 88*4882a593Smuzhiyun if (! pimpl->response(return_code, send_command, expected_response)) { 89*4882a593Smuzhiyun pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail."; 90*4882a593Smuzhiyun return false; 91*4882a593Smuzhiyun@@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time 92*4882a593Smuzhiyun { 93*4882a593Smuzhiyun // TM1 �̒l��Ԃ� 94*4882a593Smuzhiyun int return_code = -1; 95*4882a593Smuzhiyun- char expected_response[] = { 0, -1 }; 96*4882a593Smuzhiyun+ char expected_response[] = { 0, (char)-1 }; 97*4882a593Smuzhiyun vector<string> lines; 98*4882a593Smuzhiyun if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) { 99*4882a593Smuzhiyun pimpl->error_message_ = "TM1 fail."; 100