From 58fb956823faced0e5f7aa9240256f3db3bf9adb Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Tue, 5 Nov 2024 10:25:08 -0800 Subject: [PATCH] use ScaledType in FFI --- src/core/src/ffi/cmd/compute.rs | 3 ++- src/core/src/ffi/index/revindex.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/src/ffi/cmd/compute.rs b/src/core/src/ffi/cmd/compute.rs index 7a6099e242..4cecd456e2 100644 --- a/src/core/src/ffi/cmd/compute.rs +++ b/src/core/src/ffi/cmd/compute.rs @@ -1,6 +1,7 @@ use std::slice; use crate::cmd::ComputeParameters; +use crate::ScaledType; use crate::ffi::utils::ForeignObject; @@ -155,7 +156,7 @@ pub unsafe extern "C" fn computeparams_set_num_hashes( } #[no_mangle] -pub unsafe extern "C" fn computeparams_scaled(ptr: *const SourmashComputeParameters) -> u32 { +pub unsafe extern "C" fn computeparams_scaled(ptr: *const SourmashComputeParameters) -> ScaledType { let cp = SourmashComputeParameters::as_rust(ptr); cp.scaled() } diff --git a/src/core/src/ffi/index/revindex.rs b/src/core/src/ffi/index/revindex.rs index a4be85b484..ef0e328139 100644 --- a/src/core/src/ffi/index/revindex.rs +++ b/src/core/src/ffi/index/revindex.rs @@ -12,6 +12,7 @@ use crate::prelude::*; use crate::signature::{Signature, SigsTrait}; use crate::sketch::minhash::KmerMinHash; use crate::sketch::Sketch; +use crate::ScaledType; pub struct SourmashRevIndex; @@ -233,7 +234,7 @@ unsafe fn revindex_gather( } #[no_mangle] -pub unsafe extern "C" fn revindex_scaled(ptr: *const SourmashRevIndex) -> u32 { +pub unsafe extern "C" fn revindex_scaled(ptr: *const SourmashRevIndex) -> ScaledType { let revindex = SourmashRevIndex::as_rust(ptr); if let Sketch::MinHash(mh) = revindex.template() { mh.scaled()