Skip to content

Commit

Permalink
Minor fixes for CI compliance. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed May 7, 2024
1 parent 429d6a0 commit 6b5a3db
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/sim900_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ typedef enum _SIM900OperatorFormat {
 * values. The same is true for newer Arduino compilers, too. So impilicit cast of integer value to an enum type is no longer allowed. For the sake of the safety of an explicit
 * cast is better to first check the range of the input.
*/
SIM900OperatorFormat intToSIM900OperatorFormat(int i){
if (i < SIM900OperatorFormat::SIM900_OPERATOR_FORMAT_AUTO || i > SIM900OperatorFormat::SIM900_OPERATOR_FORMAT_MANUAL_AUTO)
inline SIM900OperatorFormat intToSIM900OperatorFormat(uint8_t i){
if(i < SIM900OperatorFormat::SIM900_OPERATOR_FORMAT_AUTO ||
i > SIM900OperatorFormat::SIM900_OPERATOR_FORMAT_MANUAL_AUTO)
return SIM900OperatorFormat::SIM900_OPERATOR_FORMAT_AUTO;
else
return static_cast<SIM900OperatorFormat>(i);

return static_cast<SIM900OperatorFormat>(i);
}

/**
Expand Down Expand Up @@ -149,11 +150,12 @@ typedef enum _SIM900OperatorMode {
 * values. The same is true for newer Arduino compilers, too. So impilicit cast of integer value to an enum type is no longer allowed. For the sake of the safety of an explicit
 * cast is better to first check the range of the input.
*/
SIM900OperatorMode intToSIM900OperatorMode(int i){
if (i < SIM900OperatorMode::SIM900_OPERATOR_MODE_GSM || i > SIM900OperatorMode::SIM900_OPERATOR_MODE_E_UTRAN)
inline SIM900OperatorMode intToSIM900OperatorMode(int i){
if(i < SIM900OperatorMode::SIM900_OPERATOR_MODE_GSM ||
i > SIM900OperatorMode::SIM900_OPERATOR_MODE_E_UTRAN)
return SIM900OperatorMode::SIM900_OPERATOR_MODE_GSM;
else
return static_cast<SIM900OperatorMode>(i);

return static_cast<SIM900OperatorMode>(i);
}

/**
Expand Down Expand Up @@ -194,11 +196,12 @@ typedef enum _SIM900CardService {
 * values. The same is true for newer Arduino compilers, too. So impilicit cast of integer value to an enum type is no longer allowed. For the sake of the safety of an explicit
 * cast is better to first check the range of the input.
*/
SIM900CardService intToSIM900CardService(int i){
if (i < SIM900CardService::SIM900_CARD_SERVICE_ASYNC || i > SIM900CardService::SIM900_CARD_SERVICE_FAX)
inline SIM900CardService intToSIM900CardService(int i){
if(i < SIM900CardService::SIM900_CARD_SERVICE_ASYNC ||
i > SIM900CardService::SIM900_CARD_SERVICE_FAX)
return SIM900CardService::SIM900_CARD_SERVICE_ASYNC;
else
return static_cast<SIM900CardService>(i);

return static_cast<SIM900CardService>(i);
}

/**
Expand Down

0 comments on commit 6b5a3db

Please sign in to comment.