Skip to content

Commit

Permalink
Fix the bug caused by type conversion errors.(#2491)
Browse files Browse the repository at this point in the history
Fix the bug caused by type conversion errors.
  • Loading branch information
jackyshan authored Sep 25, 2024
1 parent 9275dcb commit 7393913
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/platform/ohos/JPAGImageView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ static napi_value NumFrame(napi_env env, napi_callback_info info) {
}

static void StateChangeCallback(napi_env env, napi_value callback, void*, void* data) {
int state = *static_cast<int*>(data);
Enum state = *static_cast<Enum*>(data);
size_t argc = 1;
napi_value argv[1] = {0};
napi_create_uint32(env, state, &argv[0]);
napi_create_uint32(env, static_cast<uint32_t>(state), &argv[0]);
napi_value undefined;
napi_get_undefined(env, &undefined);
napi_call_function(env, undefined, callback, argc, argv, nullptr);
Expand Down
6 changes: 3 additions & 3 deletions src/platform/ohos/JPAGView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ static napi_value UniqueID(napi_env env, napi_callback_info info) {
}

static void StateChangeCallback(napi_env env, napi_value callback, void*, void* data) {
int state = *static_cast<int*>(data);
Enum state = *static_cast<Enum*>(data);
size_t argc = 1;
napi_value argv[1] = {0};
napi_create_uint32(env, state, &argv[0]);
napi_create_uint32(env, static_cast<uint32_t>(state), &argv[0]);
napi_value undefined;
napi_get_undefined(env, &undefined);
napi_call_function(env, undefined, callback, argc, argv, nullptr);
Expand Down Expand Up @@ -926,4 +926,4 @@ std::shared_ptr<PAGPlayer> JPAGView::getPlayer() {
std::lock_guard lock_guard(locker);
return player;
}
} // namespace pag
} // namespace pag

0 comments on commit 7393913

Please sign in to comment.