A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bytedeco/javacpp/issues/576 below:

Casting to pointer isn't passing by reference · Issue #576 · bytedeco/javacpp · GitHub

I would like to let the address from LWJGL into JavaCpp of the long type.

What we doing: public native int add(@ByRef @Cast("vk::DescriptorImageInfo*") long ptr);

Result CPP code:

JNIEXPORT jint JNICALL Java_org_helixd2s_yavulkanmod_wrapper_Alter_00024BucketOfDescriptorImageInfo_add(JNIEnv* env, jobject obj, jlong arg0) {
    ::cpp21::bucket<vk::DescriptorImageInfo>* ptr = (::cpp21::bucket<vk::DescriptorImageInfo>*)jlong_to_ptr(env->GetLongField(obj, JavaCPP_addressFID));
    if (ptr == NULL) {
        env->ThrowNew(JavaCPP_getClass(env, 9), "This pointer address is NULL.");
        return 0;
    }
    jlong position = env->GetLongField(obj, JavaCPP_positionFID);
    ptr += position;
    jint rarg = 0;
    jthrowable exc = NULL;
    try {
        int rval = ptr->add((vk::DescriptorImageInfo*)arg0);
        rarg = (jint)rval;
    } catch (...) {
        exc = JavaCPP_handleException(env, 8);
    }

    if (exc != NULL) {
        env->Throw(exc);
    }
    return rarg;
}

Compiler error:

Severity    Code    Description    Project    File    Line    Suppression State
Error    C2664    'uintptr_t cpp21::bucket_<vk::DescriptorImageInfo,std::vector,cpp21::shared_vector>::add(const T &)': cannot convert argument 1 from 'vk::DescriptorImageInfo *' to 'const T &'    YAV    C:\VULKAN\YetAnotherVulkanMod\src\main\cpp\jniAlter.cpp    1582

Should to be line: int rval = ptr->add(*(vk::DescriptorImageInfo*)arg0);


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4