[RocksJava] Fix precision problem in rocksjni

main
fyrz 10 years ago
parent 14788e1811
commit c4765dc10b
  1. 5
      java/rocksjni/backupablejni.cc
  2. 6
      java/rocksjni/restorejni.cc

@ -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

@ -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

Loading…
Cancel
Save