mirror of
https://github.com/openharmony/drivers_framework.git
synced 2026-08-27 02:42:28 -04:00
!694 fix: clear code warnings of LTS3.0
Merge pull request !694 from 郭东奇/OpenHarmony-3.0-LTS
This commit is contained in:
@@ -176,11 +176,11 @@ static bool CheckHcsBlobLength(uint32_t length, struct HbcHeader *header)
|
||||
uint32_t minLength = rootNodeLen + HBC_HEADER_LENGTH;
|
||||
uint32_t blobLength;
|
||||
if (header->totalSize >= 0) {
|
||||
blobLength = HBC_HEADER_LENGTH + header->totalSize;
|
||||
blobLength = (uint32_t)(HBC_HEADER_LENGTH + header->totalSize);
|
||||
g_byteAlign = false;
|
||||
HDF_LOGI("%s: the blobLength: %u, byteAlign: %d", __func__, blobLength, g_byteAlign);
|
||||
} else {
|
||||
blobLength = HBC_HEADER_LENGTH - header->totalSize;
|
||||
blobLength = (uint32_t)(HBC_HEADER_LENGTH - header->totalSize);
|
||||
g_byteAlign = true;
|
||||
HDF_LOGI("%s: the blobLength: %u, byteAlign: %d", __func__, blobLength, g_byteAlign);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ static struct DeviceResourceNode *CreateTreeNode(const char *start, int32_t offs
|
||||
struct DeviceResourceNode *newNode = (struct DeviceResourceNode *)(*treeMem);
|
||||
*treeMem += sizeof(struct DeviceResourceNode);
|
||||
newNode->name = start + offset + HCS_PREFIX_LENGTH;
|
||||
newNode->hashValue = offset + sizeof(struct HbcHeader);
|
||||
newNode->hashValue = (uint32_t)(offset + sizeof(struct HbcHeader));
|
||||
if (parentNode != NULL) {
|
||||
newNode->parent = parentNode;
|
||||
struct DeviceResourceNode *curNode = parentNode->child;
|
||||
|
||||
@@ -282,7 +282,7 @@ static int32_t HdfGetBrightness(enum BrightnessType type,
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
blDevManager = GetBlDevManager();
|
||||
if (devId >= blDevManager->devNum) {
|
||||
if (devId >= (uint32_t)blDevManager->devNum) {
|
||||
HDF_LOGE("%s: devId is illegal", __func__);
|
||||
return HDF_FAILURE;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ static int32_t AllocPackageBuffer(InputDevice *inputDev)
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
static uint32_t AllocDeviceID(InputDevice *inputDev)
|
||||
static int32_t AllocDeviceID(InputDevice *inputDev)
|
||||
{
|
||||
InputDevice *tmpDev = g_inputManager->inputDevList;
|
||||
uint32_t idList[MAX_INPUT_DEV_NUM + 1];
|
||||
|
||||
@@ -196,7 +196,7 @@ static int32_t ParsePowerSequence(struct DeviceResourceIface *parser, const stru
|
||||
ChipPwrSeq *pwrSeq)
|
||||
{
|
||||
int32_t ret;
|
||||
uint32_t num = parser->GetElemNum(seqNode, "powerOnSeq");
|
||||
uint32_t num = (uint32_t)parser->GetElemNum(seqNode, "powerOnSeq");
|
||||
pwrSeq->pwrOn.count = num;
|
||||
pwrSeq->pwrOn.buf = (uint32_t *)OsalMemAlloc(sizeof(uint32_t) * num);
|
||||
if (pwrSeq->pwrOn.buf == NULL) {
|
||||
|
||||
@@ -27,8 +27,8 @@ int32_t OsalGetTime(OsalTimespec *time)
|
||||
|
||||
(void)memset_s(&ts, sizeof(ts), 0, sizeof(ts));
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
time->sec = ts.tv_sec;
|
||||
time->usec = ts.tv_nsec / HDF_KILO_UNIT;
|
||||
time->sec = (uint64_t)ts.tv_sec;
|
||||
time->usec = (uint64_t)(ts.tv_nsec / HDF_KILO_UNIT);
|
||||
|
||||
return HDF_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ public:
|
||||
|
||||
while (forwardWalkObj != nullptr) {
|
||||
if (!preVisited) {
|
||||
int32_t ret = callback(forwardWalkObj, walkDepth);
|
||||
int32_t ret = (int32_t)callback(forwardWalkObj, walkDepth);
|
||||
if (ret && ret != EASTWALKBREAK) {
|
||||
return false;
|
||||
} else if (ret != EASTWALKBREAK && forwardWalkObj->child_ != nullptr) {
|
||||
|
||||
Reference in New Issue
Block a user