forked from 1b-agent/opencadstudio-upstream
chore: silence native and wasm build warnings
Gate target-specific code so neither build warns about the other's items: native-only helpers (view, window icon, file dialogs, file association, plugin host/guard/registry, self-update) are cfg'd to non-wasm; the wasm-only font fallback (script_of / cjk_lang / request) is cfg'd to wasm. Drop an unused mut, allow the few genuinely-conditional dead items (mesh_click_hit, GPU layout helpers, parity stubs), and gate the embedded PlotSettings-unrelated dead constants. Both targets now build clean (only the unavoidable nom/quick-xml future-incompat dependency notice remains). Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
2de5c7668f
commit
10e4c18ba7
20 files changed
+37
-2
No files matched your search
@@ -205,6 +205,7 @@ fn shape_cache() -> &'static Mutex<ShapeCache> {
|
||||
|
||||
/// Pixel font size the layout runs at. Positions and outlines are normalized
|
||||
/// out of pixel space afterwards, so the exact value only affects rounding.
|
||||
#[allow(dead_code)]
|
||||
const SHAPE_FS: f32 = 1000.0;
|
||||
|
||||
/// Shared cosmic-text layout engine, loaded once with the system fonts. Held
|
||||
|
||||
@@ -57,6 +57,7 @@ impl Script {
|
||||
/// 2 = Korean. Set from the active document's code page.
|
||||
static CJK_LANG: AtomicU8 = AtomicU8::new(0);
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
fn cjk_lang() -> Script {
|
||||
match CJK_LANG.load(Ordering::Relaxed) {
|
||||
1 => Script::Japanese,
|
||||
@@ -83,6 +84,7 @@ pub fn set_cjk_lang_from_codepage(code_page: &str) -> bool {
|
||||
|
||||
/// The script font that covers `ch`, or `None` for control / uncovered code
|
||||
/// points. Ranges mirror the subset unicode ranges in `web/fonts/generate.sh`.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub fn script_of(ch: char) -> Option<Script> {
|
||||
Some(match ch as u32 {
|
||||
0x0000..=0x024F | 0x1E00..=0x1EFF | 0x2000..=0x206F => Script::Latin,
|
||||
@@ -184,6 +186,8 @@ mod imp {
|
||||
use super::Script;
|
||||
use std::sync::Arc;
|
||||
|
||||
// Kept for parity with the wasm impl; only the wasm path has a caller.
|
||||
#[allow(dead_code)]
|
||||
pub fn request(_script: Script) -> Option<Arc<Vec<u8>>> {
|
||||
None
|
||||
}
|
||||
@@ -196,4 +200,7 @@ mod imp {
|
||||
}
|
||||
}
|
||||
|
||||
pub use imp::{fetch, insert, request, take_pending};
|
||||
pub use imp::{fetch, insert, take_pending};
|
||||
// `request` only has a caller in the wasm font-fallback path.
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
pub use imp::request;
|
||||
Reference in new issue
Block a user