Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spinnaker] Correct Spinnaker_C preset to bring back enum generation for 'spinError' #1048

Merged
merged 4 commits into from
May 17, 2021

Conversation

jpsacha
Copy link
Member

@jpsacha jpsacha commented May 14, 2021

After JavaCPP fix #477, enum for spinError was no longer generated. Add line in Spinaker_C preset to force enum generation and make sure that it is correctly named in generated Java code.

Large part of the diff is due to enums in generated code no longer having prefix "_"

…for 'spinError'

After JavaCPP fix bytedeco#477, enum for spinError was no longer generated. All line in 'Spinaker_C' preset to force enum generation.
@jpsacha
Copy link
Member Author

jpsacha commented May 14, 2021

I used the suggestion and updated PR.

By the way, I noticed that some wrappers have different return values, some have spinError , some @Cast("spinError") int. For instance, in lines 6033-6035 of global/Spinnaker_C.java. Notice second method has return int. This is similar to previous code on master l.6033:

    public static native spinError spinNodeIsImplemented(spinNodeHandle hNode, @Cast("bool8_t*") BytePointer pbResult);
    public static native @Cast("spinError") int spinNodeIsImplemented(spinNodeHandle hNode, @Cast("bool8_t*") ByteBuffer pbResult);
    public static native spinError spinNodeIsImplemented(spinNodeHandle hNode, @Cast("bool8_t*") byte[] pbResult);

I do not know what to make up of this.
Is the generation of that int return a bug or an intentional behavior (signature variants) of JavaCPP?

@saudet
Copy link
Member

saudet commented May 14, 2021

I do not know what to make up of this.
Is the generation of that int return a bug or an intentional behavior (signature variants) of JavaCPP?

Yes, those are just alternative overloads of the same function. You can ignore them if you don't need them.

@saudet saudet merged commit 345dc8e into bytedeco:master May 17, 2021
@jpsacha jpsacha deleted the spinError_enum branch May 17, 2021 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

What gradle dependencies are needed
2 participants