Merge pull request #421 from fyrz/RocksJava-PrecisionFix

[RocksJava] Fix precision problem in rocksjni
This commit is contained in:
Igor Canadi 2014-11-25 14:32:44 -05:00
commit 4f2e8bab5f
2 changed files with 7 additions and 4 deletions

View file

@ -103,10 +103,11 @@ jintArray Java_org_rocksdb_BackupableDB_getCorruptedBackups(
reinterpret_cast<rocksdb::BackupableDB*>(jhandle)->
GetCorruptedBackups(&backup_ids);
// store backupids in int array
const int kIdSize = backup_ids.size();
const std::vector<rocksdb::BackupID>::size_type
kIdSize = backup_ids.size();
int int_backup_ids[kIdSize];
for (std::vector<rocksdb::BackupID>::size_type i = 0;
i != backup_ids.size(); i++) {
i != kIdSize; i++) {
int_backup_ids[i] = backup_ids[i];
}
// Store ints in java array

View file

@ -156,10 +156,12 @@ jintArray Java_org_rocksdb_RestoreBackupableDB_getCorruptedBackups(
reinterpret_cast<rocksdb::RestoreBackupableDB*>(jhandle)->
GetCorruptedBackups(&backup_ids);
// store backupids in int array
const int kIdSize = backup_ids.size();
const std::vector<rocksdb::BackupID>::size_type
kIdSize = backup_ids.size();
int int_backup_ids[kIdSize];
for (std::vector<rocksdb::BackupID>::size_type i = 0;
i != backup_ids.size(); i++) {
i != kIdSize; i++) {
int_backup_ids[i] = backup_ids[i];
}
// Store ints in java array