fix(system/file): make sz_copybuffer explicitly always size_t

This commit is contained in:
phaneron 2023-08-14 20:14:25 -04:00
parent 6011b53e0f
commit def2fe1bc4

View file

@ -187,7 +187,7 @@ bool GetRootChars(File::Filesystem* fs, Stacked::FileParms* parms) {
parms->position = 1; parms->position = 1;
#if defined(WHOA_SYSTEM_MAC) #if defined(WHOA_SYSTEM_MAC)
if (name != -1) { if (name + 1 != nullptr) {
auto cmp = strncasecmp(name + 1, "Volumes", 7); auto cmp = strncasecmp(name + 1, "Volumes", 7);
auto volume = name + 9; auto volume = name + 9;
@ -274,7 +274,7 @@ bool Copy(File::Filesystem* fs, Stacked::FileParms* parms) {
auto sz_source = File::GetFileInfo(st_source)->size; auto sz_source = File::GetFileInfo(st_source)->size;
// copybuffer size upper limit is BC_FILE_SYSTEM_COPYBUFFER_SIZE // copybuffer size upper limit is BC_FILE_SYSTEM_COPYBUFFER_SIZE
size_t sz_copybuffer = std::min(sz_source, size_t(BC_FILE_SYSTEM_COPYBUFFER_SIZE)); size_t sz_copybuffer = std::min(static_cast<size_t(sz_source), static_cast<size_t>(BC_FILE_SYSTEM_COPYBUFFER_SIZE));
auto u8_copybuffer = reinterpret_cast<uint8_t*>(Memory::Allocate(sz_copybuffer)); auto u8_copybuffer = reinterpret_cast<uint8_t*>(Memory::Allocate(sz_copybuffer));
// Loop through the source file, reading segments into copybuffer // Loop through the source file, reading segments into copybuffer