0002-urg-gcc6-fix-narrowing-conversion.patch 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. urg: fix 'narrowing conversion' with gcc6
  2. Fixes:
  3. http://autobuild.buildroot.net/results/d0c/d0cd11163753db69a14c02e941dbda40e5f98bba/
  4. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  5. --- a/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:16.083995214 +0200
  6. +++ b/src/cpp/urg/ScipHandler.cpp 2016-09-11 16:11:24.380832543 +0200
  7. @@ -120,7 +120,7 @@ struct ScipHandler::pImpl
  8. // QT の発行
  9. int return_code = -1;
  10. - char qt_expected_response[] = { 0, -1 };
  11. + char qt_expected_response[] = { 0, (char)-1 };
  12. // return_code を使いたいため、setLaserOutput() を用いずに QT を送信する
  13. if (response(return_code, "QT\n", qt_expected_response)) {
  14. laser_state_ = LaserOff;
  15. @@ -139,7 +139,7 @@ struct ScipHandler::pImpl
  16. } else if (return_code == Scip11Response) {
  17. // SCIP1.1 プロトコルの場合のみ、SCIP2.0 を送信する
  18. - char scip20_expected_response[] = { 0, -1 };
  19. + char scip20_expected_response[] = { 0, (char)-1 };
  20. if (! response(return_code, "SCIP2.0\n", scip20_expected_response)) {
  21. error_message_ =
  22. "SCIP1.1 protocol is not supported. Please update URG firmware, or reconnect after a few seconds because sensor is booting.";
  23. @@ -150,7 +150,7 @@ struct ScipHandler::pImpl
  24. } else if (return_code == 0xE) {
  25. // TM モードとみなし、TM2 を発行する
  26. - char tm2_expected_response[] = { 0, -1 };
  27. + char tm2_expected_response[] = { 0, (char)-1 };
  28. if (response(return_code, "TM2\n", tm2_expected_response)) {
  29. laser_state_ = LaserOff;
  30. return changeBothBaudrate(baudrate);
  31. @@ -202,7 +202,7 @@ struct ScipHandler::pImpl
  32. snprintf(send_buffer, 10, "SS%06ld\n", baudrate);
  33. int return_code = -1;
  34. // !!! 既に設定対象のボーレート、の場合の戻り値を ss_expected... に追加する
  35. - char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, -1 };
  36. + char ss_expected_response[] = { 0, 0x3, 0x4, 0xf, (char)-1 };
  37. if (! response(return_code, send_buffer, ss_expected_response)) {
  38. error_message_ = "Baudrate change fail.";
  39. return false;
  40. @@ -216,7 +216,7 @@ struct ScipHandler::pImpl
  41. {
  42. // PP の送信とデータの受信
  43. int return_code = -1;
  44. - char pp_expected_response[] = { 0, -1 };
  45. + char pp_expected_response[] = { 0, (char)-1 };
  46. vector<string> lines;
  47. if (! response(return_code, "PP\n", pp_expected_response, &lines)) {
  48. error_message_ = "PP fail.";
  49. @@ -356,7 +356,7 @@ struct ScipHandler::pImpl
  50. if (on) {
  51. int return_code = -1;
  52. - char expected_response[] = { 0, -1 };
  53. + char expected_response[] = { 0, (char)-1 };
  54. if (! response(return_code, "BM\n", expected_response)) {
  55. error_message_ = "BM fail.";
  56. return false;
  57. @@ -369,7 +369,7 @@ struct ScipHandler::pImpl
  58. if (! mx_capturing_) {
  59. // 消灯するための QT では、応答を待つべき
  60. int return_code = -1;
  61. - char qt_expected_response[] = { 0, -1 };
  62. + char qt_expected_response[] = { 0, (char)-1 };
  63. if (! response(return_code, "QT\n", qt_expected_response)) {
  64. return false;
  65. }
  66. @@ -777,7 +777,7 @@ bool ScipHandler::loadParameter(RangeSen
  67. bool ScipHandler::versionLines(vector<string>& lines)
  68. {
  69. int return_code = -1;
  70. - char expected_response[] = { 0, -1 };
  71. + char expected_response[] = { 0, (char)-1 };
  72. if (! pimpl->response(return_code, "VV\n", expected_response, &lines)) {
  73. return false;
  74. }
  75. @@ -792,7 +792,7 @@ bool ScipHandler::setRawTimestampMode(bo
  76. // TM0 or TM2 の送信
  77. int return_code = -1;
  78. - char expected_response[] = { 0, -1 };
  79. + char expected_response[] = { 0, (char)-1 };
  80. if (! pimpl->response(return_code, send_command, expected_response)) {
  81. pimpl->error_message_ = (on) ? "TM0 fail." : "TM2 fail.";
  82. return false;
  83. @@ -809,7 +809,7 @@ bool ScipHandler::rawTimestamp(int* time
  84. {
  85. // TM1 の値を返す
  86. int return_code = -1;
  87. - char expected_response[] = { 0, -1 };
  88. + char expected_response[] = { 0, (char)-1 };
  89. vector<string> lines;
  90. if (! pimpl->response(return_code, "TM1\n", expected_response, &lines)) {
  91. pimpl->error_message_ = "TM1 fail.";