Skip to content

Commit

Permalink
Remove warnings from build
Browse files Browse the repository at this point in the history
  • Loading branch information
zowens committed Apr 24, 2023
1 parent 3779fe8 commit ba34025
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ extern crate rustc_version;

use rustc_version::{version_meta, Channel};
use std::path::Path;
use std::{io, mem, ops};
use std::{io, ops};

/// CRC-32-Castagnoli polynomial in reversed bit order.
pub const POLYNOMIAL: u32 = 0x82_F6_3B_78;

/// Table for a quadword-at-a-time software CRC.
fn sw_table() -> [[u32; 256]; 8] {
let mut table: [[u32; 256]; 8] = unsafe { mem::MaybeUninit::uninit().assume_init() };
let mut table: [[u32; 256]; 8] = [[0u32; 256]; 8];

for n in 0..256 {
let mut crc = n;

Expand Down Expand Up @@ -45,7 +46,7 @@ pub struct Matrix([u32; 32]);
impl Matrix {
/// Allocates space for a new matrix.
fn new() -> Self {
unsafe { mem::MaybeUninit::uninit().assume_init() }
Matrix([0u32; 32])
}

/// Multiplies a matrix by itself.
Expand Down Expand Up @@ -132,7 +133,7 @@ fn create_zero_operator(mut len: usize) -> Matrix {
}

fn hw_table(len: usize) -> [[u32; 256]; 4] {
let mut zeroes: [[u32; 256]; 4] = unsafe { mem::MaybeUninit::uninit().assume_init() };
let mut zeroes: [[u32; 256]; 4] = [[0u32; 256]; 4];
let op = create_zero_operator(len);

for n in 0..256 {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! Otherwise, the crate will use `cpuid` at runtime to detect the
//! running CPU's features, and enable the appropiate algorithm.
#![cfg_attr(nightly, feature(stdsimd, aarch64_target_feature))]
#![cfg_attr(nightly, feature(stdsimd))]

mod combine;
#[cfg(all(target_arch = "aarch64", nightly))]
Expand Down

0 comments on commit ba34025

Please sign in to comment.