From 1d78d1251a052461605d28cd8cf832ccad93ef73 Mon Sep 17 00:00:00 2001 From: rdeaton-freenome <134093844+rdeaton-freenome@users.noreply.github.com> Date: Wed, 7 Feb 2024 03:48:30 -0800 Subject: [PATCH] fix: Loosen acceptable types to support current linux build on aarch64 (#415) * Loosen acceptable types to support current linux build on aarch64 * Fix missing import --- src/bam/record.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bam/record.rs b/src/bam/record.rs index e989b4da6..8ddd35c12 100644 --- a/src/bam/record.rs +++ b/src/bam/record.rs @@ -4,6 +4,7 @@ // except according to those terms. use std::convert::TryFrom; +use std::convert::TryInto; use std::ffi; use std::fmt; use std::marker::PhantomData; @@ -2216,7 +2217,7 @@ impl fmt::Display for CigarStringView { pub struct BaseModificationMetadata { pub strand: i32, pub implicit: i32, - pub canonical: i8, + pub canonical: u8, } /// struct containing the internal state required to access @@ -2314,7 +2315,8 @@ impl BaseModificationState<'_> { unsafe { let mut strand: i32 = 0; let mut implicit: i32 = 0; - let mut canonical: i8 = 0; + // This may be i8 or u8 in hts_sys. + let mut canonical: c_char = 0; let ret = hts_sys::bam_mods_query_type( self.state, @@ -2329,7 +2331,7 @@ impl BaseModificationState<'_> { return Ok(BaseModificationMetadata { strand, implicit, - canonical, + canonical: canonical.try_into().unwrap(), }); } }