summarylogtreecommitdiffstats
path: root/0001-ouster_client-Fix-spdlog-issues.patch
blob: 8da7a4e73740105d83a83c4bef1c5dba272b3906 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From ef80eff462c64382dad4eba4b264761622617f5b Mon Sep 17 00:00:00 2001
From: Kyle Manna <kyle@kylemanna.com>
Date: Wed, 16 Aug 2023 22:32:44 -0500
Subject: [PATCH 1/3] ouster_client: Fix spdlog issues

* Tested on spdlog v1.11
---
 ouster_client/src/client.cpp         | 8 ++++----
 ouster_client/src/lidar_scan.cpp     | 3 ++-
 ouster_client/src/netcompat.cpp      | 2 +-
 ouster_client/src/netcompat.h        | 2 +-
 ouster_client/src/sensor_tcp_imp.cpp | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/ouster_client/src/client.cpp b/ouster_client/src/client.cpp
index e5ab05f..5e1dc24 100644
--- a/ouster_client/src/client.cpp
+++ b/ouster_client/src/client.cpp
@@ -85,7 +85,7 @@ SOCKET udp_data_socket(int port) {
 
     int ret = getaddrinfo(NULL, port_s.c_str(), &hints, &info_start);
     if (ret != 0) {
-        logger().error("udp getaddrinfo(): {}", gai_strerror(ret));
+        logger().error("udp getaddrinfo(): {}", *gai_strerror(ret));
         return SOCKET_ERROR;
     }
     if (info_start == NULL) {
@@ -167,7 +167,7 @@ SOCKET mtp_data_socket(int port, const std::string& udp_dest_host = "",
 
     int ret = getaddrinfo(NULL, port_s.c_str(), &hints, &info_start);
     if (ret != 0) {
-        logger().error("mtp getaddrinfo(): {}", gai_strerror(ret));
+        logger().error("mtp getaddrinfo(): {}", *gai_strerror(ret));
         return SOCKET_ERROR;
     }
     if (info_start == NULL) {
@@ -473,7 +473,7 @@ std::shared_ptr<client> init_client(const std::string& hostname,
             return std::shared_ptr<client>();
     } catch (const std::runtime_error& e) {
         // log error message
-        logger().error("init_client(): {}", e.what());
+        logger().error("init_client(): {}", *e.what());
         return std::shared_ptr<client>();
     }
 
@@ -521,7 +521,7 @@ std::shared_ptr<client> mtp_init_client(const std::string& hostname,
                 return std::shared_ptr<client>();
         } catch (const std::runtime_error& e) {
             // log error message
-            logger().error("init_client(): {}", e.what());
+            logger().error("init_client(): {}", *e.what());
             return std::shared_ptr<client>();
         }
     }
diff --git a/ouster_client/src/lidar_scan.cpp b/ouster_client/src/lidar_scan.cpp
index 55e552b..8cf1ba4 100644
--- a/ouster_client/src/lidar_scan.cpp
+++ b/ouster_client/src/lidar_scan.cpp
@@ -490,7 +490,8 @@ bool raw_headers_enabled(const sensor::packet_format& pf, const LidarScan& ls) {
         logger().debug(
             "WARNING: Can't fit RAW_HEADERS into a column of {} {} "
             "values",
-            pf.pixels_per_column, to_string(raw_headers_ft));
+            pf.pixels_per_column,
+            static_cast<const std::string>(to_string(raw_headers_ft)));
         return false;
     }
     return true;
diff --git a/ouster_client/src/netcompat.cpp b/ouster_client/src/netcompat.cpp
index 3c2d473..bd91779 100644
--- a/ouster_client/src/netcompat.cpp
+++ b/ouster_client/src/netcompat.cpp
@@ -46,7 +46,7 @@ int socket_close(SOCKET sock) {
 #endif
 }
 
-std::string socket_get_error() {
+const std::string socket_get_error() {
 #ifdef _WIN32
     int errnum = WSAGetLastError();
     char buf[256] = {0};
diff --git a/ouster_client/src/netcompat.h b/ouster_client/src/netcompat.h
index 3f676f6..09fe222 100644
--- a/ouster_client/src/netcompat.h
+++ b/ouster_client/src/netcompat.h
@@ -59,7 +59,7 @@ int socket_close(SOCKET sock);
  * Get the error message for socket errors
  * @return The socket error message
  */
-std::string socket_get_error();
+const std::string socket_get_error();
 
 /**
  * Check if a socket file descriptor is valid
diff --git a/ouster_client/src/sensor_tcp_imp.cpp b/ouster_client/src/sensor_tcp_imp.cpp
index a2f95d9..0a725a2 100644
--- a/ouster_client/src/sensor_tcp_imp.cpp
+++ b/ouster_client/src/sensor_tcp_imp.cpp
@@ -120,7 +120,7 @@ SOCKET SensorTcpImp::cfg_socket(const char* addr) {
         hints.ai_flags = 0;
         ret = getaddrinfo(addr, "7501", &hints, &info_start);
         if (ret != 0) {
-            logger().error("cfg getaddrinfo(): {}", gai_strerror(ret));
+            logger().error("cfg getaddrinfo(): {}", *gai_strerror(ret));
             return SOCKET_ERROR;
         }
     }
-- 
2.41.0