Skip to content

Commit c44ce96

Browse files
committed
Fixed various compilation warnings on mac
Increased size of milliseconds in time/date interface which could have been truncated. Removed some unused variables. Added some missing "override" keywords. Replaced "0b" with hex, since 0b is a C++14 extension.
1 parent b2dd3bb commit c44ce96

File tree

8 files changed

+17
-19
lines changed

8 files changed

+17
-19
lines changed

examples/seeder_example/vt_application.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ class SeederVtApplication
136136
isobus::SpeedMessagesInterface speedMessages; ///< Interface for reading speed from the bus
137137
std::shared_ptr<isobus::DeviceDescriptorObjectPool> ddop = nullptr; ///< Stores our application's DDOP
138138
std::uint32_t slowUpdateTimestamp_ms = 0; ///< A timestamp to limit some polled data to 1Hz update rate
139-
std::uint32_t lastMachineSpeed = 0; ///< Used to help track speed source timeouts
140139
bool languageDataRequested = false; ///< Stores if we've requested the current language data yet
141-
bool alarmsEnabled = true; ///< Enables or disables showing alarms
142140
};
143141

144142
#endif // VT_APPLICATION_HPP

examples/task_controller_client/section_control_implement_sim.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bool SectionControlImplementSimulator::create_ddop(std::shared_ptr<isobus::Devic
7979
poolToPopulate->clear();
8080

8181
// English, decimal point, 12 hour time, ddmmyyyy, all units imperial
82-
constexpr std::array<std::uint8_t, 7> localizationData = { 'e', 'n', 0b01010000, 0x00, 0b01010101, 0b01010101, 0xFF };
82+
constexpr std::array<std::uint8_t, 7> localizationData = { 'e', 'n', 0x50, 0x00, 0x55, 0x55, 0xFF };
8383

8484
// Make a test pool as a 120ft sprayer with 16 sections, 1 liquid product
8585
// Set up device

isobus/include/isobus/isobus/isobus_time_date_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace isobus
3333
/// We store it slightly differently than the PGN to make it easier to work with.
3434
struct TimeAndDate
3535
{
36-
std::uint8_t milliseconds = 0; ///< Number of milliseconds. This has resolution of 0.25s, so it will be either 0, 250, 500, or 750
36+
std::uint16_t milliseconds = 0; ///< Number of milliseconds. This has resolution of 0.25s, so it will be either 0, 250, 500, or 750
3737
std::uint8_t seconds = 0; ///< Number of seconds, range: 0 to 59s
3838
std::uint8_t minutes = 0; ///< Number of minutes, range: 0 to 59m
3939
std::uint8_t hours = 0; ///< Number of hours, range: 0 to 23h

isobus/include/isobus/isobus/isobus_virtual_terminal_client_state_tracker.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace isobus
8080
/// @param[in] dataOrAlarmMaskId The data/alarm mask to remove the soft key mask from tracking for.
8181
void remove_tracked_soft_key_mask(std::uint16_t dataOrAlarmMaskId);
8282

83-
/// @brief Get the soft key mask currently active on thse server for this client. It may not be displayed if the working set is not active.
83+
/// @brief Get the soft key mask currently active on the server for this client. It may not be displayed if the working set is not active.
8484
/// @return The soft key mask currently active on the server for this client.
8585
std::uint16_t get_active_soft_key_mask() const;
8686

isobus/src/isobus_time_date_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ namespace isobus
146146

147147
timeAndDateInformation.controlFunction = message.get_source_control_function();
148148
timeAndDateInformation.timeAndDate.seconds = message.get_uint8_at(0) / 4; // This is SPN 959
149-
timeAndDateInformation.timeAndDate.milliseconds = (message.get_uint8_at(0) % 4) * 250; // This is also part of SPN 959
149+
timeAndDateInformation.timeAndDate.milliseconds = static_cast<std::uint16_t>((message.get_uint8_at(0) % 4) * 250); // This is also part of SPN 959
150150
timeAndDateInformation.timeAndDate.minutes = message.get_uint8_at(1); // This is SPN 960
151151
timeAndDateInformation.timeAndDate.hours = message.get_uint8_at(2); // This is SPN 961
152152
timeAndDateInformation.timeAndDate.month = message.get_uint8_at(3); // This is SPN 963

test/can_message_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using namespace isobus;
1414
std::uint64_t value64;
1515
std::uint16_t value16;
1616

17-
void callback(const CANMessage &message, void *parent)
17+
void callback(const CANMessage &message, void *)
1818
{
1919
value16 = message.get_int16_at(0);
2020
EXPECT_EQ(value16, 513);

test/tc_server_tests.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,55 +204,55 @@ class DerivedTcServer : public TaskControllerServer
204204
return !failActivations;
205205
}
206206

207-
bool change_designator(std::shared_ptr<ControlFunction>, std::uint16_t, const std::vector<std::uint8_t> &)
207+
bool change_designator(std::shared_ptr<ControlFunction>, std::uint16_t, const std::vector<std::uint8_t> &) override
208208
{
209209
return true;
210210
}
211211

212-
bool deactivate_object_pool(std::shared_ptr<ControlFunction>)
212+
bool deactivate_object_pool(std::shared_ptr<ControlFunction>) override
213213
{
214214
return true;
215215
}
216216

217-
bool delete_device_descriptor_object_pool(std::shared_ptr<ControlFunction>, ObjectPoolDeletionErrors &)
217+
bool delete_device_descriptor_object_pool(std::shared_ptr<ControlFunction>, ObjectPoolDeletionErrors &) override
218218
{
219219
return true;
220220
}
221221

222-
bool get_is_stored_device_descriptor_object_pool_by_structure_label(std::shared_ptr<ControlFunction>, const std::vector<std::uint8_t> &, const std::vector<std::uint8_t> &)
222+
bool get_is_stored_device_descriptor_object_pool_by_structure_label(std::shared_ptr<ControlFunction>, const std::vector<std::uint8_t> &, const std::vector<std::uint8_t> &) override
223223
{
224224
return !testStructureLabel.empty();
225225
}
226226

227-
bool get_is_stored_device_descriptor_object_pool_by_localization_label(std::shared_ptr<ControlFunction>, const std::array<std::uint8_t, 7> &)
227+
bool get_is_stored_device_descriptor_object_pool_by_localization_label(std::shared_ptr<ControlFunction>, const std::array<std::uint8_t, 7> &) override
228228
{
229229
return 0 != testLocalizationLabel.at(0);
230230
}
231231

232-
bool get_is_enough_memory_available(std::uint32_t)
232+
bool get_is_enough_memory_available(std::uint32_t) override
233233
{
234234
return enoughMemory;
235235
}
236236

237-
void identify_task_controller(std::uint8_t tcNumber)
237+
void identify_task_controller(std::uint8_t tcNumber) override
238238
{
239239
identifyTC = tcNumber;
240240
}
241241

242-
void on_client_timeout(std::shared_ptr<ControlFunction>)
242+
void on_client_timeout(std::shared_ptr<ControlFunction>) override
243243
{
244244
}
245245

246-
void on_process_data_acknowledge(std::shared_ptr<ControlFunction>, std::uint16_t, std::uint16_t, std::uint8_t, ProcessDataCommands)
246+
void on_process_data_acknowledge(std::shared_ptr<ControlFunction>, std::uint16_t, std::uint16_t, std::uint8_t, ProcessDataCommands) override
247247
{
248248
}
249249

250-
bool on_value_command(std::shared_ptr<ControlFunction>, std::uint16_t, std::uint16_t, std::int32_t, std::uint8_t &)
250+
bool on_value_command(std::shared_ptr<ControlFunction>, std::uint16_t, std::uint16_t, std::int32_t, std::uint8_t &) override
251251
{
252252
return true;
253253
}
254254

255-
bool store_device_descriptor_object_pool(std::shared_ptr<ControlFunction>, const std::vector<std::uint8_t> &, bool)
255+
bool store_device_descriptor_object_pool(std::shared_ptr<ControlFunction>, const std::vector<std::uint8_t> &, bool) override
256256
{
257257
return true;
258258
}

test/transport_protocol_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ TEST(TRANSPORT_PROTOCOL_TESTS, DestinationSpecificConcurrentMessaging)
11361136

11371137
std::uint32_t pgnToCheck;
11381138
const std::uint8_t *dataToCheck;
1139-
std::size_t dataLengthToCheck;
1139+
std::size_t dataLengthToCheck = 0;
11401140

11411141
if ((message.get_destination_control_function() == receiver1) || (message.get_source_control_function() == originator1))
11421142
{

0 commit comments

Comments
 (0)