Skip to content

Commit 59df2fa

Browse files
authored
Merge pull request #555 from d-a-v/warningless
remove warnings
2 parents b5a2315 + 06b53c7 commit 59df2fa

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

src/arduino_lmic_hal_configuration.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ class HalConfiguration_t
102102
uint32_t frequency
103103
)
104104
{
105+
LMIC_API_PARAMETER(policy);
106+
LMIC_API_PARAMETER(requestedPower);
107+
LMIC_API_PARAMETER(frequency);
105108
// default: use PA_BOOST exclusively
106109
return TxPowerPolicy_t::PA_BOOST;
107110
}

src/lmic/lmic.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ ostime_t calcAirTime (rps_t rps, u1_t plen) {
295295
//
296296

297297
static void setRxsyms (ostime_t rxsyms) {
298-
if (rxsyms >= (1u << 10u)) {
298+
if (rxsyms >= (((ostime_t)1) << 10u)) {
299299
LMIC.rxsyms = (1u << 10u) - 1;
300300
} else if (rxsyms < 0) {
301301
LMIC.rxsyms = 0;
@@ -721,11 +721,17 @@ static CONST_TABLE(u1_t, macCmdSize)[] = {
721721
};
722722

723723
static u1_t getMacCmdSize(u1_t macCmd) {
724-
if (macCmd < 2)
725-
return 0;
726-
if ((macCmd - 2) >= LENOF_TABLE(macCmdSize))
727-
return 0;
728-
return TABLE_GET_U1(macCmdSize, macCmd - 2);
724+
if (macCmd >= 2) {
725+
const unsigned macCmdMinus2 = macCmd - 2u;
726+
if (macCmdMinus2 < LENOF_TABLE(macCmdSize)) {
727+
// macCmd in table, fetch it's size.
728+
return TABLE_GET_U1(macCmdSize, macCmdMinus2);
729+
}
730+
}
731+
// macCmd too small or too large: return zero. Zero is
732+
// never a legal command size, so it signals an error
733+
// to the caller.
734+
return 0;
729735
}
730736

731737
static bit_t
@@ -3080,6 +3086,8 @@ int LMIC_getNetworkTimeReference(lmic_time_reference_t *pReference) {
30803086
pReference->tNetwork = LMIC.netDeviceTime;
30813087
return 1;
30823088
}
3089+
#else
3090+
LMIC_API_PARAMETER(pReference);
30833091
#endif // LMIC_ENABLE_DeviceTimeReq
30843092
return 0;
30853093
}

src/lmic/lmic_compliance.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ void acSetTimer(ostime_t delay) {
659659
}
660660

661661
static void timerExpiredCb(osjob_t *j) {
662+
LMIC_API_PARAMETER(j);
662663
LMIC_Compliance.eventflags |= LMIC_COMPLIANCE_EVENT_TIMER_EXPIRED;
663664
fsmEval();
664665
}
@@ -734,6 +735,8 @@ static void acSendUplink(void) {
734735
}
735736

736737
static void sendUplinkCompleteCb(void *pUserData, int fSuccess) {
738+
LMIC_API_PARAMETER(pUserData);
739+
LMIC_API_PARAMETER(fSuccess);
737740
LMIC_Compliance.eventflags |= LMIC_COMPLIANCE_EVENT_UPLINK_COMPLETE;
738741
LMIC_COMPLIANCE_PRINTF("%s(%s)\n", __func__, LMICcompliance_txSuccessToString(fSuccess));
739742
fsmEvalDeferred();

0 commit comments

Comments
 (0)