Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable compile warnings #728

Merged
merged 31 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2819646
CMake: add compiler warnings
barsnick Apr 12, 2024
31e0ff6
API: avoid warnings
barsnick Apr 12, 2024
cf765c0
Auth: avoid warnings
barsnick Apr 12, 2024
2ce906f
DPM1000: avoid warnings
barsnick Apr 12, 2024
90c9fc2
EvseManager: avoid warnings
barsnick Jun 10, 2024
0fa5509
Example, ExampleUser: avoid warnings by regenerating using ev-cli
barsnick Apr 12, 2024
3c6abe8
OCPP201: hint at enum warning causes
barsnick Apr 12, 2024
637b67e
OCPPExtensionExample: avoid warnings
barsnick May 30, 2024
0fc1e94
PacketSniffer: avoid warnings by regenerating using ev-cli
barsnick Apr 15, 2024
1a24c12
PersistentStore: avoid warnings by regenerating using ev-cli
barsnick Apr 12, 2024
b18f8c5
PN532TokenProvider: avoid warnings by regenerating using ev-cli
barsnick Apr 15, 2024
38ee09e
PN532TokenProvider: avoid warnings
barsnick Apr 12, 2024
8616b60
Setup: avoid warnings
barsnick May 30, 2024
d6401c9
Store: avoid warnings by regenerating using ev-cli
barsnick Apr 12, 2024
d165746
lib/staging/slac: avoid warnings by using modern iterator
barsnick Apr 12, 2024
b2c181e
Add EVEREST_COMPILE_OPTIONS list that is passed to the module targets…
hikinggrass Jun 26, 2024
59922b8
EnergyManager: avoid warnings
barsnick Jul 2, 2024
fcdad10
EnergyNode: avoid warnings
barsnick Jul 2, 2024
fe00270
SerialCommHub: avoid warnings
barsnick Jul 2, 2024
94bc395
ExampleErrorRaiser: avoid warnings
barsnick Jul 2, 2024
43f3c61
Add EVEREST_ENABLE_GLOBAL_COMPILE_WARNINGS option
hikinggrass Jul 4, 2024
8ada383
Handline Unknown SessionInfo State in API module
hikinggrass Jul 19, 2024
b8edf0d
Explicitly fallthrough SessionEventEnums in AuthHandler
hikinggrass Jul 19, 2024
0f12a67
Handle MutexDescription Undefined in EvseManager scoped_lock to_string()
hikinggrass Jul 19, 2024
b284f1c
Iterate over tx_start_stop_points with const ref
hikinggrass Jul 19, 2024
703dddb
Enable compile warnings in compile.sh
hikinggrass Jul 19, 2024
25cd52c
Fix some more compiler warnings
hikinggrass Jul 19, 2024
ca86e62
Add missing newline
hikinggrass Jul 22, 2024
8f37f9e
Merge branch 'main' into cb/enable_and_fix_warnings
hikinggrass Jul 25, 2024
ba44ab0
Merge branch 'main' into cb/enable_and_fix_warnings
Pietfried Jul 25, 2024
2be3427
Merge branch 'main' into cb/enable_and_fix_warnings
Pietfried Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ci/build-kit/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cmake \
-DISO15118_2_GENERATE_AND_INSTALL_CERTIFICATES=OFF \
-DCMAKE_INSTALL_PREFIX="$EXT_MOUNT/dist" \
-DWHEEL_INSTALL_PREFIX="$EXT_MOUNT/dist-wheels" \
-DBUILD_TESTING=ON
-DBUILD_TESTING=ON \
-DEVEREST_ENABLE_COMPILE_WARNINGS=ON

ninja -j$(nproc) -C "$EXT_MOUNT/build"
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ option(ISO15118_2_GENERATE_AND_INSTALL_CERTIFICATES "Automatically generate and
option(EVEREST_ENABLE_RUN_SCRIPT_GENERATION "Enables the generation of run scripts (convenience scripts for starting available configurations)" ON)
option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF)
option(BUILD_TESTING "Build unit tests, used if standalone project" OFF)
option(EVEREST_ENABLE_COMPILE_WARNINGS "Enable compile warnings set in the EVEREST_COMPILE_OPTIONS flag" OFF)
option(EVEREST_ENABLE_GLOBAL_COMPILE_WARNINGS "Enable compile warnings set in the EVEREST_COMPILE_OPTIONS flag globally" OFF)
# list of compile options that are passed to modules if EVEREST_ENABLE_COMPILE_WARNINGS=ON
# generated code has functions often not used
set(EVEREST_COMPILE_OPTIONS "-Wall;-Wno-unused-function" CACHE STRING "A list of compile options used for building modules")
if(EVEREST_ENABLE_GLOBAL_COMPILE_WARNINGS)
add_compile_options(${EVEREST_COMPILE_OPTIONS})
endif()
if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING)
set(EVEREST_CORE_BUILD_TESTING ON)
endif()
Expand Down
7 changes: 7 additions & 0 deletions cmake/everest-generate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,13 @@ function (ev_add_cpp_module MODULE_NAME)
${ATOMIC_LIBS}
)

if(EVEREST_ENABLE_COMPILE_WARNINGS)
message(STATUS "Building ${MODULE_NAME} with the following compile options: ${EVEREST_COMPILE_OPTIONS}")
target_compile_options(${MODULE_NAME}
PRIVATE ${EVEREST_COMPILE_OPTIONS}
)
endif()

add_dependencies(${MODULE_NAME} generate_cpp_files)

install(TARGETS ${MODULE_NAME}
Expand Down
4 changes: 2 additions & 2 deletions lib/staging/slac/fsm/ev/src/states/others.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void InitSlacState::enter() {
std::mt19937 rng(rnd_dev());
std::uniform_int_distribution<std::mt19937::result_type> dist256(0, 255);

for (auto i = 0; i < sizeof(run_id); ++i) {
run_id[i] = dist256(rng);
for (auto& id : this->run_id) {
id = dist256(rng);
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/staging/slac/fsm/ev/src/states/sounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ bool SoundingState::do_sounding() {
std::mt19937 rng(rnd_dev());
std::uniform_int_distribution<std::mt19937::result_type> dist256(0, 255);

for (auto i = 0; i < sizeof(msg.random); ++i) {
msg.random[i] = dist256(rng);
for (auto& random : msg.random) {
random = dist256(rng);
}

ctx.send_slac_message(session_parameters.evse_mac, msg);
Expand Down
8 changes: 5 additions & 3 deletions modules/API/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ namespace module {
static const auto NOTIFICATION_PERIOD = std::chrono::seconds(1);

SessionInfo::SessionInfo() :
state(State::Unknown),
start_energy_import_wh(0),
end_energy_import_wh(0),
latest_total_w(0),
start_energy_export_wh(0),
end_energy_export_wh(0) {
end_energy_export_wh(0),
latest_total_w(0),
state(State::Unknown) {
this->start_time_point = date::utc_clock::now();
this->end_time_point = this->start_time_point;

Expand Down Expand Up @@ -146,6 +146,8 @@ void SessionInfo::update_state(const types::evse_manager::SessionEventEnum event

std::string SessionInfo::state_to_string(SessionInfo::State s) {
switch (s) {
case SessionInfo::State::Unknown:
return "Unknown";
case SessionInfo::State::Unplugged:
return "Unplugged";
case SessionInfo::State::Disabled:
Expand Down
2 changes: 1 addition & 1 deletion modules/Auth/Auth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void Auth::init() {

for (const auto& token_provider : this->r_token_provider) {
token_provider->subscribe_provided_token([this](ProvidedIdToken provided_token) {
std::thread t([this, provided_token]() { const auto res = this->auth_handler->on_token(provided_token); });
std::thread t([this, provided_token]() { this->auth_handler->on_token(provided_token); });
t.detach();
});
}
Expand Down
4 changes: 2 additions & 2 deletions modules/Auth/include/Connector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ struct Connector {
explicit Connector(int id) :
id(id),
transaction_active(false),
reserved(false),
state_machine(ConnectorState::AVAILABLE),
is_reservable(true),
state_machine(ConnectorState::AVAILABLE){};
reserved(false){};

int id;

Expand Down
35 changes: 34 additions & 1 deletion modules/Auth/lib/AuthHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ TokenHandlingResult AuthHandler::handle_token(const ProvidedIdToken& provided_to
types::authorization::ValidationResult validation_result = {types::authorization::AuthorizationStatus::Unknown};
if (!validation_results.empty()) {
bool authorized = false;
int i = 0;
std::vector<ValidationResult>::size_type i = 0;
// iterate over validation results
while (i < validation_results.size() && !authorized && !referenced_connectors.empty()) {
validation_result = validation_results.at(i);
Expand Down Expand Up @@ -604,6 +604,39 @@ void AuthHandler::handle_session_event(const int connector_id, const SessionEven
this->connectors.at(connector_id)->connector.is_reservable = true;
this->connectors.at(connector_id)->connector.reserved = false;
break;
/// explicitly fall through all the SessionEventEnum values we are not handling
case SessionEventEnum::Authorized:
[[fallthrough]];
case SessionEventEnum::Deauthorized:
[[fallthrough]];
case SessionEventEnum::AuthRequired:
[[fallthrough]];
case SessionEventEnum::PrepareCharging:
[[fallthrough]];
case SessionEventEnum::ChargingStarted:
[[fallthrough]];
case SessionEventEnum::ChargingPausedEV:
[[fallthrough]];
case SessionEventEnum::ChargingPausedEVSE:
[[fallthrough]];
case SessionEventEnum::WaitingForEnergy:
[[fallthrough]];
case SessionEventEnum::ChargingResumed:
[[fallthrough]];
case SessionEventEnum::StoppingCharging:
[[fallthrough]];
case SessionEventEnum::ChargingFinished:
[[fallthrough]];
case SessionEventEnum::ErrorCleared:
[[fallthrough]];
case SessionEventEnum::PermanentFaultCleared:
[[fallthrough]];
case SessionEventEnum::ReplugStarted:
[[fallthrough]];
case SessionEventEnum::ReplugFinished:
[[fallthrough]];
case SessionEventEnum::PluginTimeout:
break;
}
this->connectors.at(connector_id)->event_mutex.unlock();
}
Expand Down
5 changes: 5 additions & 0 deletions modules/Auth/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ PRIVATE
# needs c++ 14
target_compile_features(auth_handler PRIVATE cxx_std_14)

if(EVEREST_ENABLE_COMPILE_WARNINGS)
target_compile_options(auth_handler
PRIVATE ${EVEREST_COMPILE_OPTIONS}
)
endif()
hikinggrass marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion modules/DPM1000/main/can_broker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void CanBroker::set_state(bool enabled) {
write_to_can(frame);

// Do an extra module ON command as sometimes the bits in the header are not enough to actually switch on
auto status = set_data_int(dpm1000::def::SetValueType::SWITCH_ON_OFF_SETTING, (enabled ? 0 : 1));
set_data_int(dpm1000::def::SetValueType::SWITCH_ON_OFF_SETTING, (enabled ? 0 : 1));
}

CanBroker::AccessReturnType CanBroker::dispatch_frame(const struct can_frame& frame, uint16_t id,
Expand Down
8 changes: 4 additions & 4 deletions modules/EnergyManager/BrokerFastCharging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ bool BrokerFastCharging::trade(Offer& _offer) {

// in each timeslot: do we want to import or export energy?
if (slot_type[i] == SlotType::Undecided) {
bool can_import = !(total_power_import.has_value() && total_power_import.value() == 0. ||
max_current_import.has_value() && max_current_import.value() == 0.);
bool can_import = !((total_power_import.has_value() && total_power_import.value() == 0.) ||
(max_current_import.has_value() && max_current_import.value() == 0.));

bool can_export = !(total_power_export.has_value() && total_power_export.value() == 0. ||
max_current_export.has_value() && max_current_export.value() == 0.);
bool can_export = !((total_power_export.has_value() && total_power_export.value() == 0.) ||
(max_current_export.has_value() && max_current_export.value() == 0.));

if (can_import) {
slot_type[i] = SlotType::Import;
Expand Down
8 changes: 4 additions & 4 deletions modules/EnergyManager/Market.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ ScheduleReq Market::get_max_available_energy(const ScheduleReq& request) {
break;
}
auto tp_r_2 = Everest::Date::from_rfc3339((*(ir + 1)).timestamp);
if (tp_a >= tp_r_1 && tp_a < tp_r_2 || (ir == request.begin() && tp_a < tp_r_1)) {
if ((tp_a >= tp_r_1 && tp_a < tp_r_2) || (ir == request.begin() && tp_a < tp_r_1)) {
r = ir;
break;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ ScheduleReq Market::get_max_available_energy(const ScheduleReq& request) {

ScheduleReq Market::get_available_energy(const ScheduleReq& max_available, bool add_sold) {
ScheduleReq available = max_available;
for (int i = 0; i < available.size(); i++) {
for (ScheduleReq::size_type i = 0; i < available.size(); i++) {
// FIXME: sold_root is the sum of all energy sold, but we need to limit indivdual paths as well
// add config option for pure star type of cabling here as well.

Expand Down Expand Up @@ -222,7 +222,7 @@ ScheduleReq Market::get_available_energy_export() {

Market::Market(types::energy::EnergyFlowRequest& _energy_flow_request, const float __nominal_ac_voltage,
Market* __parent) :
_nominal_ac_voltage(__nominal_ac_voltage), _parent(__parent), energy_flow_request(_energy_flow_request) {
energy_flow_request(_energy_flow_request), _parent(__parent), _nominal_ac_voltage(__nominal_ac_voltage) {

// EVLOG_info << "Create market for " << _energy_flow_request.uuid;

Expand Down Expand Up @@ -290,7 +290,7 @@ static void schedule_add(ScheduleRes& a, const ScheduleRes& b) {
if (a.size() != b.size())
return;

for (int i = 0; i < a.size(); i++) {
for (ScheduleRes::size_type i = 0; i < a.size(); i++) {
if (b[i].limits_to_root.ac_max_current_A.has_value()) {
a[i].limits_to_root.ac_max_current_A =
b[i].limits_to_root.ac_max_current_A.value() + a[i].limits_to_root.ac_max_current_A.value_or(0);
Expand Down
2 changes: 1 addition & 1 deletion modules/EnergyManager/Offer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void apply_limits(ScheduleReq& a, const ScheduleReq& b) {
EVLOG_error << fmt::format("apply_limits: a({}) and b({}) do not have the same size.", a.size(), b.size());
return;
}
for (int i = 0; i < a.size(); i++) {
for (ScheduleReq::size_type i = 0; i < a.size(); i++) {
// limits to leave are already merged to the root side, so we dont use them here
apply_one_limit_if_smaller(a[i].limits_to_root.ac_max_current_A, b[i].limits_to_root.ac_max_current_A);
apply_one_limit_if_smaller(a[i].limits_to_root.ac_max_phase_count, b[i].limits_to_root.ac_max_phase_count);
Expand Down
4 changes: 2 additions & 2 deletions modules/EnergyNode/energy_grid/energyImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void energyImpl::merge_price_into_schedule(std::vector<types::energy::ScheduleRe
auto tp_schedule = Everest::Date::from_rfc3339(next_entry_schedule.timestamp);
auto tp_price = Everest::Date::from_rfc3339(next_entry_price.timestamp);

if (tp_schedule < tp_price && it_schedule != schedule.end() || it_price == price.end()) {
if ((tp_schedule < tp_price && it_schedule != schedule.end()) || it_price == price.end()) {
currently_valid_entry_schedule = next_entry_schedule;
auto joined_entry = currently_valid_entry_schedule;

Expand All @@ -168,7 +168,7 @@ void energyImpl::merge_price_into_schedule(std::vector<types::energy::ScheduleRe
continue;
}

if (tp_price < tp_schedule && it_price != price.end() || it_schedule == schedule.end()) {
if ((tp_price < tp_schedule && it_price != price.end()) || it_schedule == schedule.end()) {
currently_valid_entry_price = next_entry_price;
auto joined_entry = currently_valid_entry_schedule;
joined_entry.price_per_kwh = currently_valid_entry_price;
Expand Down
4 changes: 2 additions & 2 deletions modules/EvseManager/Charger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Charger::Charger(const std::unique_ptr<IECStateMachine>& bsp, const std::unique_
const types::evse_board_support::Connector_type& connector_type, const std::string& evse_id) :
bsp(bsp),
error_handling(error_handling),
r_powermeter_billing(r_powermeter_billing),
connector_type(connector_type),
evse_id(evse_id) {
evse_id(evse_id),
r_powermeter_billing(r_powermeter_billing) {

#ifdef EVEREST_USE_BACKTRACES
Everest::install_backtrace_handler();
Expand Down
2 changes: 2 additions & 0 deletions modules/EvseManager/scoped_lock_timeout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ enum class MutexDescription {

static std::string to_string(MutexDescription d) {
switch (d) {
case MutexDescription::Undefined:
return "Undefined";
case MutexDescription::Charger_signal_loop:
return "Charger.cpp: error_handling->signal_loop";
case MutexDescription::Charger_signal_error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ class LemDCBM400600Controller {
std::string version;
bool v2_capable = false;
bool trasaction_is_ongoing = false;
Conf config;
std::unique_ptr<LemDCBMTimeSyncHelper> time_sync_helper;
Conf config;

void fetch_meter_id_from_device();
void request_device_to_start_transaction(const types::powermeter::TransactionReq& value);
Expand Down
6 changes: 3 additions & 3 deletions modules/LemDCBM400600/main/lem_dcbm_time_sync_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ class LemDCBMTimeSyncHelper {
}

explicit LemDCBMTimeSyncHelper(ntp_server_spec ntp_spec, timing_config tc) :
timing_constants(tc),
ntp_spec(std::move(ntp_spec)),
unsafe_period_start_time({}),
timing_constants(tc),
meter_timezone(""),
meter_dst("") {
meter_dst(""),
unsafe_period_start_time({}) {
}

virtual ~LemDCBMTimeSyncHelper() = default;
Expand Down
4 changes: 3 additions & 1 deletion modules/OCPP201/OCPP201.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ std::set<TxStartStopPoint> get_tx_start_stop_points(const std::string& tx_start_
csv.push_back(str);
}

for (const auto tx_start_stop_point : csv) {
for (const auto& tx_start_stop_point : csv) {
if (tx_start_stop_point == "ParkingBayOccupancy") {
tx_start_stop_points.insert(TxStartStopPoint::ParkingBayOccupancy);
} else if (tx_start_stop_point == "EVConnected") {
Expand Down Expand Up @@ -661,6 +661,8 @@ void OCPP201::process_session_event(const int32_t evse_id, const types::evse_man
this->process_deauthorized(evse_id, connector_id, session_event);
break;
}

// missing AuthRequired, PrepareCharging and many more
}

// process authorized event which will inititate a TransactionEvent(Updated) message in case the token has not yet
Expand Down
2 changes: 1 addition & 1 deletion modules/OCPPExtensionExample/OCPPExtensionExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void OCPPExtensionExample::ready() {
component_variables.push_back({{""}, {"KeyThatIsNotConfigured"}});

std::vector<types::ocpp::GetVariableRequest> get_variables_requests;
for (const auto component_variable : component_variables) {
for (const auto& component_variable : component_variables) {
get_variables_requests.push_back({component_variable});
}

Expand Down
4 changes: 2 additions & 2 deletions modules/PN532TokenProvider/PN532TokenProvider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

//
// AUTO GENERATED - MARKED REGIONS WILL BE KEPT
// template version 1
// template version 2
//

#include "ld-ev.hpp"
Expand All @@ -27,8 +27,8 @@ class PN532TokenProvider : public Everest::ModuleBase {
PN532TokenProvider(const ModuleInfo& info, std::unique_ptr<auth_token_providerImplBase> p_main, Conf& config) :
ModuleBase(info), p_main(std::move(p_main)), config(config){};

const Conf& config;
const std::unique_ptr<auth_token_providerImplBase> p_main;
const Conf& config;

// ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1
// insert your public definitions here
Expand Down
11 changes: 5 additions & 6 deletions modules/PN532TokenProvider/pn532_serial/PN532Serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,28 @@

void PN532Serial::readThread() {
uint8_t buf[2048];
int n;

resetDataRead();

while (true) {
if (readThreadHandle.shouldExit()) {
break;
}
n = read(fd, buf, sizeof buf);
auto n = read(fd, buf, sizeof buf);

Check notice on line 65 in modules/PN532TokenProvider/pn532_serial/PN532Serial.cpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/PN532TokenProvider/pn532_serial/PN532Serial.cpp#L65

Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20).
if (n == 0) {
continue;
}

if (this->debug) {
std::stringstream data_stream;
for (size_t i = 0; i < n; i++) {
for (ssize_t i = 0; i < n; i++) {
data_stream << "0x" << std::setfill('0') << std::setw(2) << std::right << std::hex << (int)buf[i]
<< " ";
}

EVLOG_info << "Received bytes: " << data_stream.str();
}
for (size_t i = 0; i < n; i++) {
for (ssize_t i = 0; i < n; i++) {
if (!preamble_seen) {
if (preamble_start_seen && buf[i] == 0xff) {
preamble_seen = true;
Expand Down Expand Up @@ -137,7 +136,7 @@
tfi = buf[start_of_packet + 2];
command_code = buf[start_of_packet + 3];
first_data = false;
for (size_t i = start_of_packet + 4; i < n; i++) {
for (ssize_t i = start_of_packet + 4; i < n; i++) {
data.push_back(buf[i]);
}
}
Expand Down Expand Up @@ -243,7 +242,7 @@

if (data.size() >= 6 + target_data.nfcid_length) {
response.valid = true;
for (size_t i = 6; i < 6 + target_data.nfcid_length; i++) {
for (ssize_t i = 6; i < 6 + target_data.nfcid_length; i++) {
target_data.nfcid.push_back(data.at(i));
}

Expand Down
Loading
Loading