On Thu, 29 Oct 2026 16:16:52 GMT, Matthias Baesken <[email protected]> wrote:

>> I suppose we could add one more field to the ProcessHandler structure.
>> `typedef struct _ProcessHandler {`
>> `...`
>> `jint resultCode; // 0 - OK , 1 - Allocation error, ...`
>> `...`
>> `} ProcessHandler;`
>> 
>> Then use it in the ProcessPath() main loop to exit with JNI_FALSE on error.  
>> The check could be inserted at the end of the loop, so we fail right after 
>> processing some segment in the path.
>
> Hi @avu , I added the resultCode as suggested. Please check.
> (I also added a little comment to maybe use/check the resultCode earlier than 
> now - where exactly in the for loop in ProcessPath() should I do it? Or keep 
> it as it is ?

I thought about adding it to the loop that processes segments of the path
`jboolean ProcessPath(ProcessHandler* hnd,`
`                     jfloat transXf, jfloat transYf,`
`                     jfloat* coords, jint maxCoords,`
`                     jbyte* types, jint numTypes)`
{
`   for (i = 0; i < numTypes; i++) {`
`       switch (types[i]) {`
`...`
`       }`
`   /* Check and if fail return JNI_FALSE  */`
`    }`
`...`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/33513#discussion_r4446669986

Reply via email to