avoid compiler warnings

This commit is contained in:
Dietmar Maurer
2019-01-30 18:25:37 +01:00
parent 34f956bc25
commit 9f49fe1d5d
18 changed files with 60 additions and 119 deletions

View File

@ -25,12 +25,12 @@ pub struct ArchiveIndexHeader {
pub struct ArchiveIndexReader {
store: Arc<ChunkStore>,
_file: File,
size: usize,
pub size: usize,
filename: PathBuf,
index: *const u8,
index_entries: usize,
uuid: [u8; 16],
ctime: u64,
pub uuid: [u8; 16],
pub ctime: u64,
}
// fixme: ???!!!
@ -324,8 +324,8 @@ pub struct ArchiveIndexWriter {
closed: bool,
filename: PathBuf,
tmp_filename: PathBuf,
uuid: [u8; 16],
ctime: u64,
pub uuid: [u8; 16],
pub ctime: u64,
chunk_offset: usize,
last_chunk: usize,

View File

@ -17,9 +17,9 @@ pub struct Chunker {
chunk_size_min: usize,
chunk_size_max: usize,
chunk_size_avg: usize,
_chunk_size_avg: usize,
discriminator: u32,
_discriminator: u32,
break_test_value: u32,
@ -123,8 +123,8 @@ impl Chunker {
chunk_size: 0,
chunk_size_min: chunk_size_avg>>2,
chunk_size_max: chunk_size_avg<<2,
chunk_size_avg: chunk_size_avg,
discriminator: discriminator,
_chunk_size_avg: chunk_size_avg,
_discriminator: discriminator,
break_test_value: break_test_value,
window: [0u8; CA_CHUNKER_WINDOW_SIZE],
}
@ -199,6 +199,7 @@ impl Chunker {
}
// This is the original implementation from casync
/*
#[inline(always)]
fn shall_break_orig(&self) -> bool {
@ -208,7 +209,8 @@ impl Chunker {
(self.h % self.discriminator) == (self.discriminator - 1)
}
*/
fn start(&mut self) {
let window_len = self.window.len();

View File

@ -7,8 +7,6 @@ use std::collections::HashMap;
use lazy_static::lazy_static;
use std::sync::{Mutex, Arc};
use std::os::unix::io::AsRawFd;
use crate::tools;
use crate::config::datastore;
use super::chunk_store::*;

View File

@ -27,10 +27,10 @@ pub struct ImageIndexReader {
store: Arc<ChunkStore>,
filename: PathBuf,
chunk_size: usize,
size: usize,
pub size: usize,
index: *mut u8,
uuid: [u8; 16],
ctime: u64,
pub uuid: [u8; 16],
pub ctime: u64,
}
impl Drop for ImageIndexReader {
@ -160,8 +160,8 @@ pub struct ImageIndexWriter {
duplicate_chunks: usize,
size: usize,
index: *mut u8,
uuid: [u8; 16],
ctime: u64,
pub uuid: [u8; 16],
pub ctime: u64,
}
impl Drop for ImageIndexWriter {