[RocksJava] Fixed MacOS build of RocksJava

There were still some precision loss problems
remainging in RocksJava. This pull request resolve
these.
This commit is contained in:
fyrz 2014-11-26 20:51:50 +01:00
parent b8136a7d27
commit 67cb7ca758
2 changed files with 10 additions and 4 deletions

View File

@ -112,8 +112,11 @@ jintArray Java_org_rocksdb_BackupableDB_getCorruptedBackups(
}
// Store ints in java array
jintArray ret_backup_ids;
ret_backup_ids = env->NewIntArray(kIdSize);
env->SetIntArrayRegion(ret_backup_ids, 0, kIdSize, int_backup_ids);
// Its ok to loose precision here (64->32)
jsize ret_backup_ids_size = static_cast<jsize>(kIdSize);
ret_backup_ids = env->NewIntArray(ret_backup_ids_size);
env->SetIntArrayRegion(ret_backup_ids, 0, ret_backup_ids_size,
int_backup_ids);
return ret_backup_ids;
}

View File

@ -166,8 +166,11 @@ jintArray Java_org_rocksdb_RestoreBackupableDB_getCorruptedBackups(
}
// Store ints in java array
jintArray ret_backup_ids;
ret_backup_ids = env->NewIntArray(kIdSize);
env->SetIntArrayRegion(ret_backup_ids, 0, kIdSize, int_backup_ids);
// Its ok to loose precision here (64->32)
jsize ret_backup_ids_size = static_cast<jsize>(kIdSize);
ret_backup_ids = env->NewIntArray(ret_backup_ids_size);
env->SetIntArrayRegion(ret_backup_ids, 0, ret_backup_ids_size,
int_backup_ids);
return ret_backup_ids;
}