mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-26 12:59:18 +01:00
Fix warnings detected on Android build
This commit is contained in:
parent
39ec1699e7
commit
7468d1e096
@ -942,11 +942,6 @@ static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_bool LocalReferenceHolder_IsActive(void)
|
|
||||||
{
|
|
||||||
return s_active > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ANativeWindow* Android_JNI_GetNativeWindow(void)
|
ANativeWindow* Android_JNI_GetNativeWindow(void)
|
||||||
{
|
{
|
||||||
ANativeWindow* anw;
|
ANativeWindow* anw;
|
||||||
@ -1372,7 +1367,8 @@ static SDL_bool Android_JNI_ExceptionOccurred(SDL_bool silent)
|
|||||||
JNIEnv *mEnv = Android_JNI_GetEnv();
|
JNIEnv *mEnv = Android_JNI_GetEnv();
|
||||||
jthrowable exception;
|
jthrowable exception;
|
||||||
|
|
||||||
SDL_assert(LocalReferenceHolder_IsActive());
|
/* Detect mismatch LocalReferenceHolder_Init/Cleanup */
|
||||||
|
SDL_assert((s_active > 0));
|
||||||
|
|
||||||
exception = (*mEnv)->ExceptionOccurred(mEnv);
|
exception = (*mEnv)->ExceptionOccurred(mEnv);
|
||||||
if (exception != NULL) {
|
if (exception != NULL) {
|
||||||
@ -1455,13 +1451,13 @@ static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getStartOffset", "()J");
|
mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getStartOffset", "()J");
|
||||||
ctx->hidden.androidio.offset = (*mEnv)->CallLongMethod(mEnv, inputStream, mid);
|
ctx->hidden.androidio.offset = (long)(*mEnv)->CallLongMethod(mEnv, inputStream, mid);
|
||||||
if (Android_JNI_ExceptionOccurred(SDL_TRUE)) {
|
if (Android_JNI_ExceptionOccurred(SDL_TRUE)) {
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getDeclaredLength", "()J");
|
mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, inputStream), "getDeclaredLength", "()J");
|
||||||
ctx->hidden.androidio.size = (*mEnv)->CallLongMethod(mEnv, inputStream, mid);
|
ctx->hidden.androidio.size = (long)(*mEnv)->CallLongMethod(mEnv, inputStream, mid);
|
||||||
if (Android_JNI_ExceptionOccurred(SDL_TRUE)) {
|
if (Android_JNI_ExceptionOccurred(SDL_TRUE)) {
|
||||||
goto fallback;
|
goto fallback;
|
||||||
}
|
}
|
||||||
@ -1779,7 +1775,7 @@ Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence)
|
|||||||
if (amount > movement) {
|
if (amount > movement) {
|
||||||
amount = movement;
|
amount = movement;
|
||||||
}
|
}
|
||||||
result = Android_JNI_FileRead(ctx, buffer, 1, amount);
|
result = Android_JNI_FileRead(ctx, buffer, 1, (size_t)amount);
|
||||||
if (result <= 0) {
|
if (result <= 0) {
|
||||||
/* Failed to read/skip the required amount, so fail */
|
/* Failed to read/skip the required amount, so fail */
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -83,7 +83,7 @@ static Uint32 crc32_for_byte(Uint32 r)
|
|||||||
return r ^ (Uint32)0xFF000000L;
|
return r ^ (Uint32)0xFF000000L;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Uint32 crc32(const void *data, int count)
|
static Uint32 crc32(const void *data, size_t count)
|
||||||
{
|
{
|
||||||
Uint32 crc = 0;
|
Uint32 crc = 0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -112,8 +112,7 @@ SDL_GetTicks(void)
|
|||||||
#if HAVE_CLOCK_GETTIME
|
#if HAVE_CLOCK_GETTIME
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clock_gettime(SDL_MONOTONIC_CLOCK, &now);
|
clock_gettime(SDL_MONOTONIC_CLOCK, &now);
|
||||||
ticks = (now.tv_sec - start_ts.tv_sec) * 1000 + (now.tv_nsec -
|
ticks = (Uint32)((now.tv_sec - start_ts.tv_sec) * 1000 + (now.tv_nsec - start_ts.tv_nsec) / 1000000);
|
||||||
start_ts.tv_nsec) / 1000000;
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
uint64_t now = mach_absolute_time();
|
uint64_t now = mach_absolute_time();
|
||||||
ticks = (Uint32)((((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000);
|
ticks = (Uint32)((((now - start_mach) * mach_base_info.numer) / mach_base_info.denom) / 1000000);
|
||||||
|
Loading…
Reference in New Issue
Block a user