Fix voice_type signedness change

The signedness changed happened in speech-dispatcher 0.11, not in
speech-dispatcher 0.10.2.

Closes #4
This commit is contained in:
Samuel Thibault 2022-09-07 15:47:03 +02:00
parent 6a6bc3f805
commit 8ff6902148
3 changed files with 12 additions and 12 deletions

View File

@ -11,7 +11,7 @@ before_script:
test:
stage: test
script:
- cargo test
- cargo test --no-default-features --features 0_10
publish:
stage: publish

View File

@ -8,9 +8,9 @@ license = "LGPL-2.1 OR MIT OR Apache-2.0"
edition = "2021"
[features]
0_10_2 = ["0_10"]
0_11 = ["0_10"]
0_10 = []
default = ["0_10_2"]
default = ["0_11"]
[dependencies]
lazy_static = "1"

View File

@ -413,26 +413,26 @@ impl Connection {
}
pub fn set_voice_type(&self, voice_type: VoiceType) -> Result<(), Error> {
#[cfg(all(feature = "0_10", not(feature = "0_10_2")))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
#[cfg(any(feature = "0_10_2", not(feature = "0_10")))]
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as u32) };
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
let v = unsafe { spd_set_voice_type(*self.0, voice_type as i32) };
c_int_to_result(v)
}
pub fn set_voice_type_all(&self, voice_type: VoiceType) -> Result<(), Error> {
#[cfg(all(feature = "0_10", not(feature = "0_10_2")))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
#[cfg(any(feature = "0_10_2", not(feature = "0_10")))]
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as u32) };
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
let v = unsafe { spd_set_voice_type_all(*self.0, voice_type as i32) };
c_int_to_result(v)
}
pub fn set_voice_type_uid(&self, voice_type: VoiceType, target_uid: u32) -> Result<(), Error> {
#[cfg(all(feature = "0_10", not(feature = "0_10_2")))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
#[cfg(any(feature = "0_10_2", not(feature = "0_10")))]
#[cfg(all(feature = "0_10", not(feature = "0_11")))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as u32, target_uid) };
#[cfg(any(feature = "0_11", not(feature = "0_10")))]
let v = unsafe { spd_set_voice_type_uid(*self.0, voice_type as i32, target_uid) };
c_int_to_result(v)
}