Support 64-bit compile

Signed-off-by: libing3@huawei.com <libing3@huawei.com>
Change-Id: I2b1d5fed44cdb08cad57a6cc108dede0da27af31
This commit is contained in:
libing3@huawei.com 2021-08-16 15:35:57 +08:00
parent 061ff4cea7
commit 7ad3a71068
5 changed files with 10 additions and 7 deletions

View File

@ -15,6 +15,7 @@
#include <securec.h>
#include <unistd.h>
#include <inttypes.h>
#include <display_type.h>
#include <vsync_helper.h>
@ -53,7 +54,7 @@ int32_t DoDraw(uint8_t *addr, uint32_t width, uint32_t height, uint32_t count)
memcpy_s(addr, addrSize, frame.get(), addrSize);
last = count;
LOG("GetData time: %{public}lld, data: %{public}p, length: %{public}d", GetNowTime() - start, data, length);
LOG("GetData time: %{public}" PRIu64 ", data: %{public}p, length: %{public}d", GetNowTime() - start, data, length);
return 0;
}
@ -190,7 +191,7 @@ int main(int argc, const char *argv[])
if (RawParser::GetInstance()->Parse(resourceString)) {
return -1;
}
LOG("time: %{public}lld", GetNowTime() - start);
LOG("time: %{public}" PRIu64 "", GetNowTime() - start);
auto runner = AppExecFwk::EventRunner::Create(false);
auto handler = std::make_shared<AppExecFwk::EventHandler>(runner);

View File

@ -74,7 +74,7 @@ int32_t RawParser::Parse(std::string &filename)
struct HeaderInfo *info = reinterpret_cast<struct HeaderInfo *>(&compressed[magicHeaderLength]);
uint32_t ipos = reinterpret_cast<uint8_t *>(info) - reinterpret_cast<uint8_t *>(magic);
while (ipos < clength) {
LOG("[%{public}d, %{public}d], type: %{public}d, "
LOG("[%{public}zu, %{public}d], type: %{public}d, "
"offset: %{public}d, length: %{public}d, clen: %{public}d, mem: %{public}p",
infos.size() + 1, ipos, info->type, info->offset, info->length, info->clen, info->mem);

View File

@ -18,6 +18,7 @@
#include <cstdio>
#include <securec.h>
#include <sys/time.h>
#include <inttypes.h>
#include <zlib.h>
@ -96,7 +97,7 @@ public:
ExitTest();
return;
}
printf("uncompress time: %lld\n", GetNowTime() - start);
printf("uncompress time: %" PRIu64 "\n", GetNowTime() - start);
ExitTest();
}

View File

@ -21,6 +21,7 @@
#include <thread>
#include <unistd.h>
#include <vector>
#include <inttypes.h>
#include <display_gralloc.h>
#include <hilog/log.h>
@ -815,7 +816,7 @@ void Test16()
if (Test16Uncompress(ptr, uulength, compressed, ulength) != Z_OK) {
return;
}
printf("uncompress time: %lld\n", GetNowTime() - start);
printf("uncompress time: %" PRIu64 "\n", GetNowTime() - start);
}
void Test17()

View File

@ -75,14 +75,14 @@ int32_t CreateShmFile(int32_t size)
std::unique_ptr<char[]> name = std::make_unique<char[]>(len);
auto ret = strcpy_s(name.get(), len, path);
if (ret) {
WMLOGFE("strcpy_s: %{public}s, name: %{public}s, len: %{public}d, path: %{public}s",
WMLOGFE("strcpy_s: %{public}s, name: %{public}s, len: %{public}zu, path: %{public}s",
strerror(ret), name.get() ? "Yes" : "No", len, path);
return -1;
}
ret = strcat_s(name.get(), len, tempPath);
if (ret) {
WMLOGFE("strcpy_s: %{public}s, name: %{public}s, len: %{public}d, tempPath: %{public}s",
WMLOGFE("strcpy_s: %{public}s, name: %{public}s, len: %{public}zu, tempPath: %{public}s",
strerror(ret), name.get() ? "Yes" : "No", len, tempPath);
return -1;
}