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

Use "int" for errors in JNI code #71

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Use "int" for errors in JNI code #71

merged 1 commit into from
Apr 3, 2023

Conversation

gavv
Copy link
Member

@gavv gavv commented Apr 3, 2023

  • Use "int" instead of "char" as error types. int is more common and expected for errors. Also mixing int and char is confusing. Also char may be unsigned on some platforms.
  • Use "-1" instead of "1" when reporting errors. Using negative error numbers is more common and expected.

@gavv gavv requested a review from ortex April 3, 2023 09:12
return 0;
}
return (unsigned int) ret;
}

long long get_llong_field_value(
JNIEnv* env, jclass clazz, jobject obj, const char* attr_name, char* error) {
JNIEnv* env, jclass clazz, jobject obj, const char* attr_name, int* error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: looks like we don't need int* error in this function

@ortex ortex merged commit cf1600b into roc-streaming:main Apr 3, 2023
@gavv gavv deleted the int branch April 3, 2023 10:44
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.

None yet

2 participants