Click here to Skip to main content
15,891,936 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
By looking at the definition of jbyte in jni.h I have:
typedef int8_t jbyte; /* signed 8 bits */
So is it is always safe to convert jbyte to a signed integer without casting?

What I have tried:

So far I have tried int8_t
Posted
Updated 18-May-21 3:33am
v2
Comments
Richard MacCutchan 18-May-21 9:38am    
It rather depends on what you are trying to do, and we cannot guess that.

BTW are you the same person that recently asked all the other JNI questions?
another_newbie 18-May-21 9:42am    
Thank you for your comment. Regarding your question about me asking other JNI question, this is my first time asking a question in this website.
Richard MacCutchan 18-May-21 9:46am    
Thank you. But we still do not know what you are trying to use jbyte for.
another_newbie 18-May-21 11:10am    
Sorry I thought it was not necessary. I want to use jbyte as an integer and compare its value to an enum constant. I am getting this jbytes in java from a Greendao data table.
Richard MacCutchan 18-May-21 11:10am    
So what happens when you try it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900