mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-28 23:49:12 +00:00
Fixed a few remaining functions to directly return their values instead of an error code.
This commit is contained in:
parent
1e828eec57
commit
3d2e5a0b66
15 changed files with 91 additions and 123 deletions
|
@ -2507,22 +2507,19 @@ const char *SDL_GetAndroidInternalStoragePath(void)
|
|||
return s_AndroidInternalFilesPath;
|
||||
}
|
||||
|
||||
int SDL_GetAndroidExternalStorageState(Uint32 *state)
|
||||
Uint32 SDL_GetAndroidExternalStorageState(void)
|
||||
{
|
||||
struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__);
|
||||
jmethodID mid;
|
||||
jclass cls;
|
||||
jstring stateString;
|
||||
const char *state_string;
|
||||
int stateFlags;
|
||||
Uint32 stateFlags;
|
||||
|
||||
JNIEnv *env = Android_JNI_GetEnv();
|
||||
if (!LocalReferenceHolder_Init(&refs, env)) {
|
||||
LocalReferenceHolder_Cleanup(&refs);
|
||||
if (state) {
|
||||
*state = 0;
|
||||
}
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cls = (*env)->FindClass(env, "android/os/Environment");
|
||||
|
@ -2546,10 +2543,8 @@ int SDL_GetAndroidExternalStorageState(Uint32 *state)
|
|||
(*env)->ReleaseStringUTFChars(env, stateString, state_string);
|
||||
|
||||
LocalReferenceHolder_Cleanup(&refs);
|
||||
if (state) {
|
||||
*state = stateFlags;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return stateFlags;
|
||||
}
|
||||
|
||||
// this caches a string until the process ends, so there's no need to use SDL_FreeLater.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue