1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-04-20 11:47:46 +00:00

Silence more dead code warnings

This is intentional, for various reasons between binrw limitations and
code that isn't used directly in Physis.
This commit is contained in:
Joshua Goins 2024-06-29 09:33:23 -04:00
parent 444ec6e593
commit ec04c13fbd
16 changed files with 25 additions and 8 deletions

View file

@ -175,6 +175,7 @@ struct AvfxBlock {
} }
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub struct Avfx { pub struct Avfx {
clip_box: [f32; 3], clip_box: [f32; 3],
clip_box_size: [f32; 3], clip_box_size: [f32; 3],

View file

@ -89,6 +89,7 @@ impl<T: for<'a> AnyNumberType<'a>> ModelMemorySizes<T> {
} }
#[derive(BinRead)] #[derive(BinRead)]
#[allow(dead_code)]
pub struct ModelFileBlock { pub struct ModelFileBlock {
pub num_blocks: u32, pub num_blocks: u32,
pub num_used_blocks: u32, pub num_used_blocks: u32,

View file

@ -1,7 +1,10 @@
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com> // SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
// Rust deprecating this is stupid, I don't want to use a crate here
#[allow(deprecated)]
use std::env::home_dir; use std::env::home_dir;
use std::fs; use std::fs;
use std::fs::read_dir; use std::fs::read_dir;
use std::path::PathBuf; use std::path::PathBuf;
@ -110,7 +113,7 @@ pub struct ExistingUserDirectory {
/// Finds existing user folders on disk. Will only return locations that actually have files in them, and a really basic check to see if the data is valid. /// Finds existing user folders on disk. Will only return locations that actually have files in them, and a really basic check to see if the data is valid.
pub fn find_existing_user_dirs() -> Vec<ExistingUserDirectory> { pub fn find_existing_user_dirs() -> Vec<ExistingUserDirectory> {
let mut user_dirs = Vec::new(); let mut user_dirs = Vec::new();
let Some(home_dir) = home_dir() else { let Some(_) = home_dir() else {
return user_dirs; return user_dirs;
}; };

View file

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2020 Inseok Lee // SPDX-FileCopyrightText: 2020 Inseok Lee
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#![allow(dead_code)]
use crate::havok::transform::HavokTransform; use crate::havok::transform::HavokTransform;
pub trait HavokAnimation { pub trait HavokAnimation {

View file

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2020 Inseok Lee // SPDX-FileCopyrightText: 2020 Inseok Lee
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#![allow(dead_code)]
use crate::havok::object::HavokObject; use crate::havok::object::HavokObject;
use crate::havok::spline_compressed_animation::HavokSplineCompressedAnimation; use crate::havok::spline_compressed_animation::HavokSplineCompressedAnimation;
use crate::havok::HavokAnimation; use crate::havok::HavokAnimation;

View file

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2020 Inseok Lee // SPDX-FileCopyrightText: 2020 Inseok Lee
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#![allow(dead_code)]
use crate::havok::animation_binding::HavokAnimationBinding; use crate::havok::animation_binding::HavokAnimationBinding;
use crate::havok::object::HavokObject; use crate::havok::object::HavokObject;
use crate::havok::skeleton::HavokSkeleton; use crate::havok::skeleton::HavokSkeleton;

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#![allow(clippy::bad_bit_mask)] #![allow(clippy::bad_bit_mask)]
#![allow(dead_code)]
use core::cell::RefCell; use core::cell::RefCell;
use std::collections::HashMap; use std::collections::HashMap;

View file

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: 2020 Inseok Lee // SPDX-FileCopyrightText: 2020 Inseok Lee
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
#![allow(dead_code)]
use core::convert::TryInto; use core::convert::TryInto;
pub trait SliceByteOrderExt { pub trait SliceByteOrderExt {

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
#![allow(clippy::identity_op)] #![allow(clippy::identity_op)]
#![allow(unused_variables)] // for br(temp), meh
use std::io::SeekFrom; use std::io::SeekFrom;

View file

@ -12,6 +12,7 @@ use binrw::BinRead;
#[derive(Debug)] #[derive(Debug)]
#[br(import { data_offset: i32 })] #[br(import { data_offset: i32 })]
#[brw(little)] #[brw(little)]
#[allow(unused)]
struct RacialDeformer { struct RacialDeformer {
bone_count: i32, bone_count: i32,
@ -51,6 +52,7 @@ struct PreBoneDeformerItem {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[brw(little)] #[brw(little)]
#[allow(dead_code)]
struct PreBoneDeformerLink { struct PreBoneDeformerLink {
parent_index: i16, parent_index: i16,
first_child_index: i16, first_child_index: i16,
@ -61,6 +63,7 @@ struct PreBoneDeformerLink {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[brw(little)] #[brw(little)]
#[allow(dead_code)]
struct PreBoneDeformerHeader { struct PreBoneDeformerHeader {
count: i32, count: i32,

View file

@ -10,6 +10,7 @@ use binrw::BinRead;
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[brw(little)] #[brw(little)]
#[allow(dead_code)]
struct PhybHeader { struct PhybHeader {
version: [u8; 4], version: [u8; 4],

View file

@ -20,6 +20,7 @@ pub enum ShaderStage {
#[binread] #[binread]
#[derive(Debug)] #[derive(Debug)]
#[brw(little)] #[brw(little)]
#[allow(dead_code)]
struct SchdHeader { struct SchdHeader {
magic: i32, // TODO: what magic? magic: i32, // TODO: what magic?

View file

@ -13,6 +13,7 @@
#![allow(deprecated)] #![allow(deprecated)]
#![allow(clippy::double_parens)] #![allow(clippy::double_parens)]
#![allow(clippy::identity_op)] #![allow(clippy::identity_op)]
#![allow(dead_code)]
use core::cmp; use core::cmp;
use core::fmt; use core::fmt;

View file

@ -129,7 +129,7 @@ pub struct Node {
#[br(little)] #[br(little)]
#[br(magic = b"ShPk")] #[br(magic = b"ShPk")]
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)] #[allow(dead_code, unused_variables)]
pub struct ShaderPackage { pub struct ShaderPackage {
version: u32, version: u32,

View file

@ -25,6 +25,7 @@ struct StmHeader {
} }
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub struct DyePack { pub struct DyePack {
diffuse: [f32; 3], diffuse: [f32; 3],
specular: [f32; 3], specular: [f32; 3],

View file

@ -1,17 +1,12 @@
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com> // SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: GPL-3.0-or-later
use hmac_sha512::Hash;
use physis::patch::apply_patch;
use std::env; use std::env;
use std::fs::{read, read_dir}; use std::fs::read;
use std::process::Command;
use physis::common::Platform; use physis::common::Platform;
use physis::fiin::FileInfo; use physis::fiin::FileInfo;
use physis::index; use physis::index;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
#[test] #[test]
#[cfg_attr(not(feature = "retail_game_testing"), ignore)] #[cfg_attr(not(feature = "retail_game_testing"), ignore)]