mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-11-27 02:40:40 +00:00
fix code-check warn
Signed-off-by: xiao_xing9426 <xiaoxing12@huawei.com>
This commit is contained in:
parent
1d6bcc44dc
commit
9a93400f74
@ -212,7 +212,7 @@ static int32_t SslAesGcmDecrypt(const AesGcmCipherKey *cipherkey, const unsigned
|
||||
COMM_LOGE(COMM_ADAPTER, "EVP_DecryptFinal_ex fail.");
|
||||
goto EXIT;
|
||||
}
|
||||
if (plainLen > INT32_MAX - outLen) {
|
||||
if ((int32_t)plainLen > INT32_MAX - outLen) {
|
||||
COMM_LOGE(COMM_ADAPTER, "outLen convert overflow.");
|
||||
goto EXIT;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ typedef struct {
|
||||
uint32_t certCount;
|
||||
} SoftbusCertChain;
|
||||
|
||||
bool IsSupportUDIDAbatement();
|
||||
bool IsSupportUDIDAbatement(void);
|
||||
bool IsNeedUDIDAbatement(const AuthSessionInfo *info);
|
||||
bool CalcHKDF(const uint8_t *ikm, uint32_t ikmLen, uint8_t *out, uint32_t outLen);
|
||||
int32_t GenerateCertificate(SoftbusCertChain *softbusCertChain, const AuthSessionInfo *info);
|
||||
|
@ -72,7 +72,7 @@ static IServerDiscInnerCallback g_discInnerCb = {
|
||||
static int32_t OnDataLevelChanged(const char *networkId, const DataLevelInfo *dataLevelInfo);
|
||||
|
||||
static IDataLevelChangeCallback g_dataLevelChangeCb = {
|
||||
.OnDataLevelChanged = OnDataLevelChanged,
|
||||
.onDataLevelChanged = OnDataLevelChanged,
|
||||
};
|
||||
|
||||
static bool IsRepeatJoinLNNRequest(const char *pkgName, int32_t callingPid, const ConnectionAddr *addr)
|
||||
|
@ -28,7 +28,7 @@ int32_t HbUpdateBleScanFilter(int32_t listenerId, LnnHeartbeatType type);
|
||||
int32_t HbGenerateBitPosition(int32_t min, int32_t max, int64_t seed, int32_t *randPos, int32_t num);
|
||||
|
||||
void LnnBleHbRegDataLevelChangeCb(const IDataLevelChangeCallback *callback);
|
||||
void LnnBleHbUnregDataLevelChangeCb();
|
||||
void LnnBleHbUnregDataLevelChangeCb(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -42,9 +42,9 @@ void LnnHbOnTrustedRelationReduced(void);
|
||||
int32_t LnnInitHeartbeat(void);
|
||||
void LnnDeinitHeartbeat(void);
|
||||
|
||||
int32_t LnnTriggerDataLevelHeartBeat();
|
||||
int32_t LnnTriggerDataLevelHeartBeat(void);
|
||||
void LnnRegDataLevelChangeCb(const IDataLevelChangeCallback *callback);
|
||||
void LnnUnregDataLevelChangeCb();
|
||||
void LnnUnregDataLevelChangeCb(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ typedef struct {
|
||||
#define ENABLE_WIFI_CAP (1 << 3)
|
||||
|
||||
typedef struct {
|
||||
int32_t (*OnDataLevelChanged)(const char *networkId, const DataLevelInfo *dataLevelInfo);
|
||||
int32_t (*onDataLevelChanged)(const char *networkId, const DataLevelInfo *dataLevelInfo);
|
||||
} IDataLevelChangeCallback;
|
||||
|
||||
typedef bool (*VisitHbTypeCb)(LnnHeartbeatType *typeSet, LnnHeartbeatType eachType, void *data);
|
||||
|
@ -99,6 +99,6 @@ void LnnBleHbRegDataLevelChangeCb(const IDataLevelChangeCallback *callback)
|
||||
(void)callback;
|
||||
}
|
||||
|
||||
void LnnBleHbUnregDataLevelChangeCb()
|
||||
void LnnBleHbUnregDataLevelChangeCb(void)
|
||||
{
|
||||
}
|
@ -112,6 +112,6 @@ void LnnRegDataLevelChangeCb(const IDataLevelChangeCallback *callback)
|
||||
(void)callback;
|
||||
}
|
||||
|
||||
void LnnUnregDataLevelChangeCb()
|
||||
void LnnUnregDataLevelChangeCb(void)
|
||||
{
|
||||
}
|
@ -36,7 +36,7 @@ void SoftbusBitmapClr(uint32_t *bitmap, const uint8_t pos)
|
||||
|
||||
void SoftbusBitmapSetBits(uint32_t *bitmap, const uint8_t start, const uint8_t nums)
|
||||
{
|
||||
if (bitmap == NULL || start > UINT32_BITNUM || (start + nums) > UINT32_BITNUM || nums == 0) {
|
||||
if (bitmap == NULL || start > UINT32_BITNUM || (start + nums) > UINT32_BITNUM || nums == 0 || start == 0) {
|
||||
return;
|
||||
}
|
||||
*bitmap |= (UINT32_MAX - ((((1U << ((start + nums - 1U))) - 1U)) & (~((1U << ((start - 1U))) - 1U))));
|
||||
@ -44,7 +44,7 @@ void SoftbusBitmapSetBits(uint32_t *bitmap, const uint8_t start, const uint8_t n
|
||||
|
||||
void SoftbusBitmapClrBits(uint32_t *bitmap, const uint8_t start, const uint8_t nums)
|
||||
{
|
||||
if (bitmap == NULL || start > UINT32_BITNUM || (start + nums) > UINT32_BITNUM || nums == 0) {
|
||||
if (bitmap == NULL || start > UINT32_BITNUM || (start + nums) > UINT32_BITNUM || nums == 0 || start == 0) {
|
||||
return;
|
||||
}
|
||||
*bitmap &= ((((1U << ((start + nums - 1U))) - 1U)) & (~((1U << ((start - 1U))) - 1U)));
|
||||
|
@ -38,7 +38,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief Defines a callback that is invoked when receive the data level from remote device.
|
||||
* For details, see {@link RegDataLevelChangeCb}.
|
||||
*
|
||||
*
|
||||
* @since 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -52,10 +52,10 @@ typedef struct {
|
||||
typedef struct {
|
||||
/**
|
||||
* @brief Called when the Data level of a device received.
|
||||
*
|
||||
*
|
||||
* @param networkId Indicates the network id of the device.
|
||||
* @param dataLevel Indicates the received data level.
|
||||
*
|
||||
*
|
||||
* @since 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -64,11 +64,11 @@ typedef struct {
|
||||
|
||||
/**
|
||||
* @brief Registers a callback for data level received.
|
||||
*
|
||||
*
|
||||
* @param pkgName Indicates the package name of the caller.
|
||||
* @param callback Indicates the function callback to be registered. For details, see {@link IDataLevelCb}.
|
||||
* @return Returns <b>0</b> if the registeration is successful; returns any other value otherwise.
|
||||
*
|
||||
* @return Returns <b>0</b> if the registeration is successful; returns any other value otherwise.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -76,10 +76,10 @@ int32_t RegDataLevelChangeCb(const char *pkgName, IDataLevelCb *callback);
|
||||
|
||||
/**
|
||||
* @brief Unregisters a callback for data level received.
|
||||
*
|
||||
*
|
||||
* @param pkgName Indicates the package name of the caller.
|
||||
* @return Returns <b>0</b> if the registeration is successful; returns any other value otherwise.
|
||||
*
|
||||
* @return Returns <b>0</b> if the registeration is successful; returns any other value otherwise.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -87,10 +87,10 @@ int32_t UnregDataLevelChangeCb(const char *pkgName);
|
||||
|
||||
/**
|
||||
* @brief Set the DistributedDataBase Data Level. This interface CAN ONLY invoked by DistributedDataBase.
|
||||
*
|
||||
*
|
||||
* @param dataLevel Indicates the data level.
|
||||
* @return Returns <b>0</b> if the registeration is successful; returns any other value otherwise.
|
||||
*
|
||||
* @return Returns <b>0</b> if the registeration is successful; returns any other value otherwise.
|
||||
*
|
||||
* @since 1.0
|
||||
* @version 1.0
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user