Fix new warnings

This commit is contained in:
Simon Gellis 2025-10-17 22:44:15 -04:00
parent 0a8da6bff0
commit c00fae79f8
5 changed files with 4 additions and 15 deletions

View File

@ -16,7 +16,7 @@ RUN apt-get update && \
ln -s $(which ld64.lld-20) /usr/bin/ld64.lld && \
SDK_VERSION=14.5 UNATTENDED=1 ENABLE_COMPILER_RT_INSTALL=1 TARGET_DIR=/osxcross ./build.sh
FROM rust:1.89-bookworm
FROM rust:1.90-bookworm
ADD --chmod=644 "https://apt.llvm.org/llvm-snapshot.gpg.key" /etc/apt/trusted.gpg.d/apt.llvm.org.asc
COPY llvm.sources /etc/apt/sources.list.d/llvm.sources
RUN rustup target add x86_64-pc-windows-msvc && \

View File

@ -21,6 +21,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.include(Path::new("shrooms-vb-core/util"))
.opt_level(opt_level)
.flag_if_supported("-fno-strict-aliasing")
.define("_CRT_SECURE_NO_WARNINGS", None)
.define("VB_LITTLE_ENDIAN", None)
.define("VB_SIGNED_PROPAGATE", None)
.define("VB_DIV_GENERIC", None)

View File

@ -457,12 +457,6 @@ struct PersistedGamepadMapping {
default_axes: Vec<(Code, (VBKey, VBKey))>,
}
#[derive(Serialize, Deserialize)]
pub struct Shortcut {
pub shortcut: KeyboardShortcut,
pub command: Command,
}
#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub enum Command {
OpenRom,

View File

@ -50,11 +50,11 @@ impl MemoryClient {
}
fn aligned_memory(start: u32, length: usize) -> BoxBytes {
if start % 4 == 0 && length % 4 == 0 {
if start.is_multiple_of(4) && length.is_multiple_of(4) {
let memory = vec![0u32; length / 4].into_boxed_slice();
return bytemuck::box_bytes_of(memory);
}
if start % 2 == 0 && length % 2 == 0 {
if start.is_multiple_of(2) && length.is_multiple_of(2) {
let memory = vec![0u16; length / 2].into_boxed_slice();
return bytemuck::box_bytes_of(memory);
}

View File

@ -274,12 +274,6 @@ impl AppWindow for CharacterDataWindow {
}
}
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Hash)]
enum CharDataResource {
Character { palette: Palette, index: usize },
CharacterData { palette: Palette },
}
#[derive(Clone, Default, PartialEq, Eq)]
struct CharDataParams {
palette: Palette,