Skip to content

Commit

Permalink
asset,exp/audio/al: cast context to jobject
Browse files Browse the repository at this point in the history
Fixes golang/go#13823.

Change-Id: I13fc9234a2fb991312c148e7d779271454cb7b90
Reviewed-on: https://go-review.googlesource.com/18511
Reviewed-by: David Crawshaw <crawshaw@golang.org>
  • Loading branch information
rakyll committed Jan 11, 2016
1 parent b4e66ee commit 232ac83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions asset/asset_android.go
Expand Up @@ -14,7 +14,7 @@ package asset
// asset_manager is the asset manager of the app.
AAssetManager* asset_manager;
void asset_manager_init(uintptr_t java_vm, uintptr_t jni_env, uintptr_t ctx) {
void asset_manager_init(uintptr_t java_vm, uintptr_t jni_env, jobject ctx) {
JavaVM* vm = (JavaVM*)java_vm;
JNIEnv* env = (JNIEnv*)jni_env;
Expand Down Expand Up @@ -48,7 +48,7 @@ var assetOnce sync.Once

func assetInit() {
err := mobileinit.RunOnJVM(func(vm, env, ctx uintptr) error {
C.asset_manager_init(C.uintptr_t(vm), C.uintptr_t(env), C.uintptr_t(ctx))
C.asset_manager_init(C.uintptr_t(vm), C.uintptr_t(env), C.jobject(ctx))
return nil
})
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions exp/audio/al/al_android.go
Expand Up @@ -13,7 +13,7 @@ package al
#include <AL/al.h>
#include <AL/alc.h>
void al_init(uintptr_t java_vm, uintptr_t jni_env, uintptr_t context, void** handle) {
void al_init(uintptr_t java_vm, uintptr_t jni_env, jobject context, void** handle) {
JavaVM* vm = (JavaVM*)java_vm;
JNIEnv* env = (JNIEnv*)jni_env;
Expand Down Expand Up @@ -221,7 +221,7 @@ var (

func initAL() {
err := mobileinit.RunOnJVM(func(vm, env, ctx uintptr) error {
C.al_init(C.uintptr_t(vm), C.uintptr_t(env), C.uintptr_t(ctx), &alHandle)
C.al_init(C.uintptr_t(vm), C.uintptr_t(env), C.jobject(ctx), &alHandle)
if alHandle == nil {
return errors.New("al: cannot load libopenal.so")
}
Expand Down

0 comments on commit 232ac83

Please sign in to comment.