Rename length_of to size_of
This commit is contained in:
parent
8a4c46a2d1
commit
355de5f67c
|
@ -7,7 +7,7 @@ use std::io::{Read, Seek, SeekFrom};
|
||||||
|
|
||||||
const ROOT_DIR_NAME:&'static str = "\x00";
|
const ROOT_DIR_NAME:&'static str = "\x00";
|
||||||
|
|
||||||
pub mod length_of {
|
pub mod size_of {
|
||||||
use cdtypes::types::{sector::Mode0, helper::{sector_count_mode2_form1, sector_count_mode2_form2}};
|
use cdtypes::types::{sector::Mode0, helper::{sector_count_mode2_form1, sector_count_mode2_form2}};
|
||||||
use crate::types::FileType;
|
use crate::types::FileType;
|
||||||
use super::{Directory, File, FullSizeInfo, SizeInfo, PathTable};
|
use super::{Directory, File, FullSizeInfo, SizeInfo, PathTable};
|
||||||
|
@ -65,11 +65,11 @@ pub mod length_of {
|
||||||
|
|
||||||
pub fn calculate_length_for(element: &Layout) -> SizeInfo {
|
pub fn calculate_length_for(element: &Layout) -> SizeInfo {
|
||||||
match element {
|
match element {
|
||||||
Layout::SystemArea(_) => length_of::system_area(),
|
Layout::SystemArea(_) => size_of::system_area(),
|
||||||
Layout::PVD(_) => length_of::pvd(),
|
Layout::PVD(_) => size_of::pvd(),
|
||||||
Layout::PathTables(root, _) => length_of::path_tables(&root.borrow()),
|
Layout::PathTables(root, _) => size_of::path_tables(&root.borrow()),
|
||||||
Layout::Directory(dir) => length_of::directory(&dir.borrow()),
|
Layout::Directory(dir) => size_of::directory(&dir.borrow()),
|
||||||
Layout::File(file) => length_of::file(&file.borrow()),
|
Layout::File(file) => size_of::file(&file.borrow()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ fn process_system_area(system_area: &SystemArea, sec_writer: &mut dyn SectorWrit
|
||||||
else {
|
else {
|
||||||
// No license specified - filling it with zeros
|
// No license specified - filling it with zeros
|
||||||
print_warning("WARNING: No license file provided. Some emulators (like No$PSX) will not boot this CD.".to_owned());
|
print_warning("WARNING: No license file provided. Some emulators (like No$PSX) will not boot this CD.".to_owned());
|
||||||
write_dummy(sec_writer, length_of::SYSTEM_AREA_SECTOR_COUNT)
|
write_dummy(sec_writer, size_of::SYSTEM_AREA_SECTOR_COUNT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ impl CDDesc {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
size += cd::length_of::lead_out(self.lead_out_sectors).full_size.bytes.unwrap_or(0);
|
size += cd::size_of::lead_out(self.lead_out_sectors).full_size.bytes.unwrap_or(0);
|
||||||
size
|
size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue