workspace: zero compiler warnings across all targets
254 warnings (320 counting replayed-cache re-emitters) cleaned: unused mut/imports/variables, irrefutable if-lets and unreachable patterns, dead code removed or annotated #[allow(dead_code)] with the reason (C++ parity value sets, cfg(test) helpers, public API reservations), drop(&ref) no-ops removed, fn-pointer identity via std::ptr::fn_addr_eq, the test-stubs feature declared in oak-node's manifest, missing docs filled. Every unused-Result site was judged individually: meaningful errors propagate, intentional ignores are let _ = with a note. Two pre-existing latent bugs are documented in place, behavior preserved: app.rs's timeline-tool observer and dialogs.rs's format subscription both drop the returned Subscription immediately, so they never fire.
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
//! 单库化后像素路径经 oakrender 值模型(`oak_core::texture::Texture`)
|
||||
//! 驱动;渲染 goldens 待该迁移落地。
|
||||
|
||||
// 每个集成测试二进制都会独立编译本模块,只用到自己需要的那部分辅助件,
|
||||
// 因此某个二进制里未用到的条目仍属于共享夹具 API。
|
||||
#![allow(dead_code)]
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// 构建系统注入插件路径的环境变量名。
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
mod common;
|
||||
|
||||
use std::ffi::{c_char, c_int, c_void, CStr, CString};
|
||||
use std::ffi::{c_char, c_int, c_void, CStr};
|
||||
use std::sync::Arc;
|
||||
|
||||
use oak_core::{PixelFormat, Rational};
|
||||
@@ -91,10 +91,6 @@ unsafe extern "C" fn capture_msg(
|
||||
1
|
||||
}
|
||||
|
||||
fn cs(s: &str) -> CString {
|
||||
CString::new(s).unwrap()
|
||||
}
|
||||
|
||||
fn first_pixel(texture: &Texture) -> [f32; 4] {
|
||||
let Texture::Cpu(frame) = texture else {
|
||||
panic!("期望 CPU 帧");
|
||||
|
||||
@@ -191,7 +191,7 @@ fn concurrent_access() {
|
||||
}
|
||||
|
||||
// 数据自洽:32 个属性全部存活、维度未被撑大。
|
||||
for (i, name) in names.iter().enumerate() {
|
||||
for name in names.iter() {
|
||||
assert_eq!(s.dimension(name), 1);
|
||||
assert!(s.get(name, 0).is_some());
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
mod common;
|
||||
|
||||
use std::ffi::{c_char, c_double, c_int, c_uint, c_void, CStr, CString};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::ffi::{c_char, c_int, c_uint, c_void, CStr, CString};
|
||||
|
||||
use oak_plugin::descriptor::EffectDescriptor;
|
||||
use oak_plugin::instance::Instance;
|
||||
@@ -83,7 +82,7 @@ fn dummy_plugin(descriptor: EffectDescriptor) -> std::sync::Arc<oak_plugin::host
|
||||
|
||||
/// 用 param suite 的 paramDefine 造一个含 6 参数的实例。
|
||||
fn make_instance() -> (std::sync::Arc<Instance>, *mut c_void) {
|
||||
let mut desc = EffectDescriptor::new();
|
||||
let desc = EffectDescriptor::new();
|
||||
let s = param_suite();
|
||||
let dhandle = tag::make(&desc.props as *const PropertySet, tag::DESCRIPTOR);
|
||||
unsafe {
|
||||
@@ -253,7 +252,7 @@ fn memory_suite_ledger() {
|
||||
/// [`oak_plugin::clip::ClipInstance::fetch_image`] 与存活表记账验证。
|
||||
#[test]
|
||||
fn image_effect_clip_image_pairing() {
|
||||
let mut desc = EffectDescriptor::new();
|
||||
let desc = EffectDescriptor::new();
|
||||
let s = image_effect_suite();
|
||||
let h = tag::make(&desc.props as *const PropertySet, tag::DESCRIPTOR);
|
||||
|
||||
@@ -384,7 +383,7 @@ fn image_effect_clip_image_pairing() {
|
||||
#[test]
|
||||
fn param_suite_roundtrip_and_change_action() {
|
||||
// describe 期。
|
||||
let mut desc = EffectDescriptor::new();
|
||||
let desc = EffectDescriptor::new();
|
||||
let s = param_suite();
|
||||
let dhandle = tag::make(&desc.props as *const PropertySet, tag::DESCRIPTOR);
|
||||
let t = cs("OfxParamTypeDouble");
|
||||
@@ -478,7 +477,6 @@ fn param_suite_roundtrip_and_change_action() {
|
||||
assert_eq!(CStr::from_ptr(p).to_bytes(), b"hello");
|
||||
|
||||
// AtTime == 当前值(无动画)。
|
||||
let mut v2 = 0.0;
|
||||
assert_eq!((s.param_get_value_at_time)(gain, 12.0, &mut iv), OK);
|
||||
assert_eq!(iv, 7);
|
||||
assert_eq!((s.param_set_value_at_time)(gain, 12.0, 9), OK);
|
||||
|
||||
Reference in New Issue
Block a user