Skip to content

Commit 0bb60ac

Browse files
committed
ais.h: Fix hicpp-member-init
1 parent ab1687a commit 0bb60ac

1 file changed

Lines changed: 91 additions & 91 deletions

File tree

src/libais/ais.h

Lines changed: 91 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -597,12 +597,12 @@ ostream& operator<< (ostream &o, const Ais5 &msg);
597597
// AIS Binary Broadcast message ... parent to many
598598
class Ais6 : public AisMsg {
599599
public:
600-
int seq; // sequence number
601-
int mmsi_dest;
602-
bool retransmit;
603-
int spare;
604-
int dac; // dac+fi = app id
605-
int fi;
600+
int seq{}; // sequence number
601+
int mmsi_dest{};
602+
bool retransmit{};
603+
int spare{};
604+
int dac{}; // dac+fi = app id
605+
int fi{};
606606

607607
// TODO(schwehr): how to make Ais6 protected?
608608
Ais6(const char *nmea_payload, size_t pad);
@@ -736,12 +736,12 @@ ostream& operator<< (ostream &o, const Ais6_1_12 &msg);
736736
class Ais6_1_14_Window {
737737
public:
738738
AisPoint position;
739-
int utc_hour_from;
740-
int utc_min_from;
741-
int utc_hour_to;
742-
int utc_min_to;
743-
int cur_dir;
744-
float cur_speed;
739+
int utc_hour_from{};
740+
int utc_min_from{};
741+
int utc_hour_to{};
742+
int utc_min_to{};
743+
int cur_dir{};
744+
float cur_speed{};
745745
};
746746

747747

@@ -890,10 +890,10 @@ ostream& operator<< (ostream &o, const Ais7_13 &msg);
890890
// AIS Binary Broadcast message ... parent to many
891891
class Ais8 : public AisMsg {
892892
public:
893-
int spare;
893+
int spare{};
894894
// TODO(schwehr): seq? // ITU M.R. 1371-3 Anex 2 5.3.1
895-
int dac; // dac+fi = app id
896-
int fi;
895+
int dac{}; // dac+fi = app id
896+
int fi{};
897897

898898
// TODO(schwehr): make Ais8 protected
899899
Ais8(const char *nmea_payload, size_t pad);
@@ -1341,10 +1341,10 @@ ais8_1_26_sensor_report_factory(const AisBitset &bs,
13411341
class Ais8_1_26_Location : public Ais8_1_26_SensorReport {
13421342
public:
13431343
AisPoint position;
1344-
float z; // alt in m from MSL
1345-
int owner;
1346-
int timeout;
1347-
int spare;
1344+
float z{}; // alt in m from MSL
1345+
int owner{};
1346+
int timeout{};
1347+
int spare{};
13481348

13491349
Ais8_1_26_Location(const AisBitset &bs, size_t offset);
13501350
Ais8_1_26_Location() = default;
@@ -1354,7 +1354,7 @@ class Ais8_1_26_Location : public Ais8_1_26_SensorReport {
13541354
class Ais8_1_26_Station : public Ais8_1_26_SensorReport {
13551355
public:
13561356
string name;
1357-
int spare;
1357+
int spare{};
13581358

13591359
Ais8_1_26_Station(const AisBitset &bs, size_t offset);
13601360
Ais8_1_26_Station() = default;
@@ -1363,19 +1363,19 @@ class Ais8_1_26_Station : public Ais8_1_26_SensorReport {
13631363

13641364
class Ais8_1_26_Wind : public Ais8_1_26_SensorReport {
13651365
public:
1366-
int wind_speed; // knots
1367-
int wind_gust; // knots
1368-
int wind_dir;
1369-
int wind_gust_dir;
1370-
int sensor_type;
1371-
int wind_forecast; // knots
1372-
int wind_gust_forecast; // knots
1373-
int wind_dir_forecast;
1374-
int utc_day_forecast;
1375-
int utc_hour_forecast;
1376-
int utc_min_forecast;
1377-
int duration;
1378-
int spare;
1366+
int wind_speed{}; // knots
1367+
int wind_gust{}; // knots
1368+
int wind_dir{};
1369+
int wind_gust_dir{};
1370+
int sensor_type{};
1371+
int wind_forecast{}; // knots
1372+
int wind_gust_forecast{}; // knots
1373+
int wind_dir_forecast{};
1374+
int utc_day_forecast{};
1375+
int utc_hour_forecast{};
1376+
int utc_min_forecast{};
1377+
int duration{};
1378+
int spare{};
13791379

13801380
Ais8_1_26_Wind(const AisBitset &bs, size_t offset);
13811381
Ais8_1_26_Wind() = default;
@@ -1384,18 +1384,18 @@ class Ais8_1_26_Wind : public Ais8_1_26_SensorReport {
13841384

13851385
class Ais8_1_26_WaterLevel : public Ais8_1_26_SensorReport {
13861386
public:
1387-
int type;
1388-
float level; // m. assuming it is being stored at 0.01 m inc.
1389-
int trend;
1390-
int vdatum;
1391-
int sensor_type;
1392-
int forecast_type;
1393-
float level_forecast;
1394-
int utc_day_forecast;
1395-
int utc_hour_forecast;
1396-
int utc_min_forecast;
1397-
int duration; // minutes
1398-
int spare;
1387+
int type{};
1388+
float level{}; // m. assuming it is being stored at 0.01 m inc.
1389+
int trend{};
1390+
int vdatum{};
1391+
int sensor_type{};
1392+
int forecast_type{};
1393+
float level_forecast{};
1394+
int utc_day_forecast{};
1395+
int utc_hour_forecast{};
1396+
int utc_min_forecast{};
1397+
int duration{}; // minutes
1398+
int spare{};
13991399

14001400
Ais8_1_26_WaterLevel(const AisBitset &bs, size_t offset);
14011401
Ais8_1_26_WaterLevel() = default;
@@ -1411,9 +1411,9 @@ class Ais8_1_26_Curr2D_Current {
14111411

14121412
class Ais8_1_26_Curr2D : public Ais8_1_26_SensorReport {
14131413
public:
1414-
std::array<Ais8_1_26_Curr2D_Current, 3> currents;
1415-
int type;
1416-
int spare;
1414+
std::array<Ais8_1_26_Curr2D_Current, 3> currents{};
1415+
int type{};
1416+
int spare{};
14171417

14181418
Ais8_1_26_Curr2D(const AisBitset &bs, size_t offset);
14191419
Ais8_1_26_Curr2D() = default;
@@ -1430,9 +1430,9 @@ class Ais8_1_26_Curr3D_Current {
14301430

14311431
class Ais8_1_26_Curr3D : public Ais8_1_26_SensorReport {
14321432
public:
1433-
std::array<Ais8_1_26_Curr3D_Current, 2> currents;;
1434-
int type;
1435-
int spare;
1433+
std::array<Ais8_1_26_Curr3D_Current, 2> currents{};;
1434+
int type{};
1435+
int spare{};
14361436

14371437
Ais8_1_26_Curr3D(const AisBitset &bs, size_t offset);
14381438
Ais8_1_26_Curr3D() = default;
@@ -1450,8 +1450,8 @@ class Ais8_1_26_HorzFlow_Current {
14501450

14511451
class Ais8_1_26_HorzFlow : public Ais8_1_26_SensorReport {
14521452
public:
1453-
std::array<Ais8_1_26_HorzFlow_Current, 2> currents;;
1454-
int spare;
1453+
std::array<Ais8_1_26_HorzFlow_Current, 2> currents{};;
1454+
int spare{};
14551455

14561456
Ais8_1_26_HorzFlow(const AisBitset &bs, size_t offset);
14571457
Ais8_1_26_HorzFlow() = default;
@@ -1460,19 +1460,19 @@ class Ais8_1_26_HorzFlow : public Ais8_1_26_SensorReport {
14601460

14611461
class Ais8_1_26_SeaState : public Ais8_1_26_SensorReport {
14621462
public:
1463-
float swell_height;
1464-
int swell_period; // seconds
1465-
int swell_dir; // deg
1466-
int sea_state;
1467-
int swell_sensor_type;
1468-
float water_temp; // C
1469-
float water_temp_depth; // m
1470-
int water_sensor_type;
1471-
float wave_height;
1472-
int wave_period; // seconds
1473-
int wave_dir; // deg
1474-
int wave_sensor_type;
1475-
float salinity;
1463+
float swell_height{};
1464+
int swell_period{}; // seconds
1465+
int swell_dir{}; // deg
1466+
int sea_state{};
1467+
int swell_sensor_type{};
1468+
float water_temp{}; // C
1469+
float water_temp_depth{}; // m
1470+
int water_sensor_type{};
1471+
float wave_height{};
1472+
int wave_period{}; // seconds
1473+
int wave_dir{}; // deg
1474+
int wave_sensor_type{};
1475+
float salinity{};
14761476

14771477
Ais8_1_26_SeaState(const AisBitset &bs, size_t offset);
14781478
Ais8_1_26_SeaState() = default;
@@ -1481,12 +1481,12 @@ class Ais8_1_26_SeaState : public Ais8_1_26_SensorReport {
14811481

14821482
class Ais8_1_26_Salinity : public Ais8_1_26_SensorReport {
14831483
public:
1484-
float water_temp; // C
1485-
float conductivity; // siemens/m
1486-
float pressure; // decibars
1487-
float salinity; // 0/00 ppt
1488-
int salinity_type;
1489-
int sensor_type;
1484+
float water_temp{}; // C
1485+
float conductivity{}; // siemens/m
1486+
float pressure{}; // decibars
1487+
float salinity{}; // 0/00 ppt
1488+
int salinity_type{};
1489+
int sensor_type{};
14901490
std::array<int, 2> spare{0, 0};
14911491

14921492
Ais8_1_26_Salinity(const AisBitset &bs, size_t offset);
@@ -1496,17 +1496,17 @@ class Ais8_1_26_Salinity : public Ais8_1_26_SensorReport {
14961496

14971497
class Ais8_1_26_Wx : public Ais8_1_26_SensorReport {
14981498
public:
1499-
float air_temp; // C
1500-
int air_temp_sensor_type;
1501-
int precip;
1502-
float horz_vis; // nm
1503-
float dew_point; // C
1504-
int dew_point_type;
1505-
float air_pressure; // Pascals (Pa).
1506-
int air_pressure_trend;
1507-
int air_pressor_type;
1508-
float salinity; // 0/00 ppt
1509-
int spare;
1499+
float air_temp{}; // C
1500+
int air_temp_sensor_type{};
1501+
int precip{};
1502+
float horz_vis{}; // nm
1503+
float dew_point{}; // C
1504+
int dew_point_type{};
1505+
float air_pressure{}; // Pascals (Pa).
1506+
int air_pressure_trend{};
1507+
int air_pressor_type{};
1508+
float salinity{}; // 0/00 ppt
1509+
int spare{};
15101510

15111511
Ais8_1_26_Wx(const AisBitset &bs, size_t offset);
15121512
Ais8_1_26_Wx() = default;
@@ -1515,14 +1515,14 @@ class Ais8_1_26_Wx : public Ais8_1_26_SensorReport {
15151515

15161516
class Ais8_1_26_AirDraught : public Ais8_1_26_SensorReport {
15171517
public:
1518-
float draught;
1519-
float gap;
1520-
float forecast_gap;
1521-
int trend;
1522-
int utc_day_forecast;
1523-
int utc_hour_forecast;
1524-
int utc_min_forecast;
1525-
int spare;
1518+
float draught{};
1519+
float gap{};
1520+
float forecast_gap{};
1521+
int trend{};
1522+
int utc_day_forecast{};
1523+
int utc_hour_forecast{};
1524+
int utc_min_forecast{};
1525+
int spare{};
15261526

15271527
Ais8_1_26_AirDraught(const AisBitset &bs, size_t offset);
15281528
Ais8_1_26_AirDraught() = default;

0 commit comments

Comments
 (0)