Skip to content

Commit cdff571

Browse files
committed
Change CoreCreationFlags and PluginConfigFlags to use i32 for improved compatibility
1 parent ccb3784 commit cdff571

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

rustsynth/src/core.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ pub type CoreResult<T> = Result<T, CoreError>;
4242

4343
bitflags! {
4444
/// Options when creating a core.
45-
pub struct CoreCreationFlags: u32 {
45+
pub struct CoreCreationFlags: i32 {
4646
/// No flags.
4747
const NONE = 0;
4848
/// Required to use the graph inspection api functions. Increases memory usage due to the extra information stored.
49-
const ENABLE_GRAPH_INSPECTION = ffi::VSCoreCreationFlags::ccfEnableGraphInspection.0;
50-
/// Dont autoload any user plugins. Core plugins are always loaded.
51-
const DISABLE_AUTO_LOADING = ffi::VSCoreCreationFlags::ccfDisableAutoLoading.0;
52-
/// Dont unload plugin libraries when the core is destroyed. Due to a small amount of memory leaking every load and unload (windows feature, not my fault) of a library this may help in applications with extreme amount of script reloading.
53-
const DISABLE_LIBRARY_UNLOADING = ffi::VSCoreCreationFlags::ccfDisableLibraryUnloading.0;
49+
const ENABLE_GRAPH_INSPECTION = ffi::VSCoreCreationFlags::ccfEnableGraphInspection.0 as i32;
50+
/// Don't autoload any user plugins. Core plugins are always loaded.
51+
const DISABLE_AUTO_LOADING = ffi::VSCoreCreationFlags::ccfDisableAutoLoading.0 as i32;
52+
/// Don't unload plugin libraries when the core is destroyed. Due to a small amount of memory leaking every load and unload (windows feature, not my fault) of a library this may help in applications with extreme amount of script reloading.
53+
const DISABLE_LIBRARY_UNLOADING = ffi::VSCoreCreationFlags::ccfDisableLibraryUnloading.0 as i32;
5454
}
5555
}
5656

@@ -84,7 +84,7 @@ impl<'core> CoreRef<'core> {
8484
pub fn new(flags: CoreCreationFlags) -> Self {
8585
let api = API::get().unwrap();
8686
unsafe {
87-
let handle = api.create_core(flags.bits() as i32);
87+
let handle = api.create_core(flags.bits());
8888
Self::from_ptr(handle)
8989
}
9090
}

rustsynth/src/plugin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ unsafe extern "C" fn public_function(
242242
pub type PublicFunction = fn(in_map: &MapRef<'_>, out_map: &mut MapRef<'_>, core: CoreRef);
243243

244244
bitflags! {
245-
pub struct PluginConfigFlags: u32 {
245+
pub struct PluginConfigFlags: i32 {
246246
/// Allow functions to be added to the plugin object after the plugin loading phase. Mostly useful for Avisynth compatibility and other foreign plugin loaders.
247-
const MODIFIABLE = ffi::VSPluginConfigFlags::pcModifiable.0 as u32;
247+
const MODIFIABLE = ffi::VSPluginConfigFlags::pcModifiable.0 as i32;
248248
const NONE = 0;
249249
}
250250
}

0 commit comments

Comments
 (0)