xref: /OK3568_Linux_fs/buildroot/package/urg/0002-urg-gcc6-fix-narrowing-conversion.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1urg: fix 'narrowing conversion' with gcc6
2
3Fixes:
4  http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/
5
6Signed-off-by: Samuel Martin <s.martin49@gmail.com>
7
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
11
12       // QT �̔��s
13       int return_code = -1;
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
20
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)) {
26           error_message_ =
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
29
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);
39     int return_code = -1;
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.";
45       return false;
46@@ -216,7 +216,7 @@ struct ScipHandler::pImpl
47   {
48     // PP �̑��M�ƃf�[�^�̎�M
49     int return_code = -1;
50-    char pp_expected_response[] = { 0, -1 };
51+    char pp_expected_response[] = { 0, (char)-1 };
52     vector<string> lines;
53     if (! response(return_code, "PP\n", pp_expected_response, &lines)) {
54       error_message_ = "PP fail.";
55@@ -356,7 +356,7 @@ struct ScipHandler::pImpl
56
57     if (on) {
58       int return_code = -1;
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.";
63         return false;
64@@ -369,7 +369,7 @@ struct ScipHandler::pImpl
65       if (! mx_capturing_) {
66         // �������邽�߂� QT �ł́A������҂‚ׂ�
67         int return_code = -1;
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)) {
71           return false;
72         }
73@@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen
74 bool ScipHandler::versionLines(vector<string>& lines)
75 {
76   int return_code = -1;
77-  char expected_response[] = { 0, -1 };
78+  char expected_response[] = { 0, (char)-1 };
79   if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) {
80     return false;
81   }
82@@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo
83
84   // TM0 or TM2 �̑��M
85   int return_code = -1;
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.";
90     return false;
91@@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time
92 {
93   // TM1 �̒l��Ԃ�
94   int return_code = -1;
95-  char expected_response[] = { 0, -1 };
96+  char expected_response[] = { 0, (char)-1 };
97   vector<string> lines;
98   if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) {
99     pimpl->error_message_ = "TM1 fail.";
100