Skip to content

Commit 045de9a

Browse files
committed
Do not use the constructor's initializer list for data member. Use the in-class initializer instead.
1 parent e01bad5 commit 045de9a

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

include/Structure_Helper.h

+38-38
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ enum BaudRate
5757
*/
5858
struct Point
5959
{
60-
int16_t x;
61-
int16_t y;
60+
int16_t x = 0;
61+
int16_t y = 0;
6262
/**
6363
* @brief Construct a new Point object
6464
*
6565
*/
66-
Point() : x(0), y(0) {}
66+
Point() {}
6767
/**
6868
* @brief Construct a new Point object
6969
* @param _x int16_t
@@ -79,13 +79,13 @@ struct Point
7979
*/
8080
struct PointF
8181
{
82-
float x;
83-
float y;
82+
float x = 0;
83+
float y = 0;
8484
/**
8585
* @brief Construct a new Point F object
8686
*
8787
*/
88-
PointF() : x(0), y(0) {}
88+
PointF() {}
8989
/**
9090
* @brief Construct a new Point F object
9191
*
@@ -103,13 +103,13 @@ struct PointF
103103
*/
104104
struct Pose
105105
{
106-
int16_t x;
107-
int16_t y;
108-
int32_t h;
106+
int16_t x = 0;
107+
int16_t y = 0;
108+
int32_t h = 0;
109109
/**
110110
* @brief Construct a new Pose object
111111
*/
112-
Pose() : x(0), y(0), h(0) {}
112+
Pose() {}
113113
/**
114114
* @brief Construct a new Pose object
115115
*
@@ -128,13 +128,13 @@ struct Pose
128128
*/
129129
struct PoseF
130130
{
131-
float x;
132-
float y;
133-
float h;
131+
float x = 0;
132+
float y = 0;
133+
float h = 0;
134134
/**
135135
* @brief Construct a new PoseF object
136136
*/
137-
PoseF() : x(0), y(0), h(0) {}
137+
PoseF() {}
138138
/**
139139
* @brief Construct a new PoseF object
140140
*
@@ -153,13 +153,13 @@ struct PoseF
153153
*/
154154
struct Point3D
155155
{
156-
int16_t x;
157-
int16_t y;
158-
int16_t z;
156+
int16_t x = 0;
157+
int16_t y = 0;
158+
int16_t z = 0;
159159
/**
160160
* @brief Construct a new Point3D object
161161
*/
162-
Point3D() : x(0), y(0), z(0) {}
162+
Point3D() {}
163163
/**
164164
* @brief Construct a new Point3D object
165165
*
@@ -178,13 +178,13 @@ struct Point3D
178178
*/
179179
struct PointF3D
180180
{
181-
float x;
182-
float y;
183-
float z;
181+
float x = 0;
182+
float y = 0;
183+
float z = 0;
184184
/**
185185
* @brief Construct a new Point3D object
186186
*/
187-
PointF3D() : x(0), y(0), z(0) {}
187+
PointF3D() {}
188188
/**
189189
* @brief Construct a new Point3D object
190190
*
@@ -204,14 +204,14 @@ struct PointF3D
204204
*/
205205
struct Point4D
206206
{
207-
int16_t x;
208-
int16_t y;
209-
int16_t z;
210-
int16_t w;
207+
int16_t x = 0;
208+
int16_t y = 0;
209+
int16_t z = 0;
210+
int16_t w = 0;
211211
/**
212212
* @brief Construct a new Point4D object
213213
*/
214-
Point4D() : x(0), y(0), z(0), w(0) {}
214+
Point4D() {}
215215
/**
216216
* @brief Construct a new Point4D object
217217
*
@@ -232,14 +232,14 @@ struct Point4D
232232
*/
233233
struct PointF4D
234234
{
235-
float x;
236-
float y;
237-
float z;
238-
float w;
235+
float x = 0;
236+
float y = 0;
237+
float z = 0;
238+
float w = 0;
239239
/**
240240
* @brief Construct a new Point4D object
241241
*/
242-
PointF4D() : x(0), y(0), z(0), w(0) {}
242+
PointF4D(){}
243243
/**
244244
* @brief Construct a new Point4D object
245245
*
@@ -263,15 +263,15 @@ struct PointF4D
263263
*/
264264
struct PolarPoint
265265
{
266-
float angle;
267-
int16_t distance;
268-
uint16_t confidence;
269-
float x;
270-
float y;
266+
float angle = 0;
267+
int16_t distance = 0;
268+
uint16_t confidence = 0;
269+
float x = 0;
270+
float y = 0;
271271
/**
272272
* @brief Construct a new Polar Point object
273273
*/
274-
PolarPoint() : angle(0), distance(0), confidence(0), x(0), y(0) {}
274+
PolarPoint() {}
275275
/**
276276
*
277277
* @brief Construct a new Polar Point object

0 commit comments

Comments
 (0)