diff options
author | 2023-09-17 11:33:25 -0400 | |
---|---|---|
committer | 2023-09-17 11:33:25 -0400 | |
commit | f5066881db7a601ba7031fbc996ab404e05e5dd5 (patch) | |
tree | 6803289651ccbc928e0141cf5a9392809e4dd00f /src/lib/formats/fs_coco_os9.cpp | |
parent | 0af125686b70300486cb23c4d32c9c92ec369008 (diff) |
fsmgr.h: Cleanup
- Use multibyte.h functions for packing and unpacking words
- Remove a few aliases for cstdlib functions
- Convert rstr and wstr functions to std::string_view
Diffstat (limited to 'src/lib/formats/fs_coco_os9.cpp')
-rw-r--r-- | src/lib/formats/fs_coco_os9.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/lib/formats/fs_coco_os9.cpp b/src/lib/formats/fs_coco_os9.cpp index f94ff290799..074bfd82c59 100644 --- a/src/lib/formats/fs_coco_os9.cpp +++ b/src/lib/formats/fs_coco_os9.cpp @@ -15,6 +15,8 @@ #include "fs_coco_os9.h" #include "coco_rawdsk.h" + +#include "multibyte.h" #include "strformat.h" @@ -115,7 +117,6 @@ public: static std::string pick_os9_string(std::string_view raw_string); static std::string to_os9_string(std::string_view s, size_t length); - static u32 pick_integer_be(const u8 *data, int length); static util::arbitrary_datetime from_os9_date(u32 os9_date, u16 os9_time = 0); static std::tuple<u32, u16> to_os9_date(const util::arbitrary_datetime &datetime); static bool is_ignored_filename(std::string_view name); @@ -522,7 +523,7 @@ void coco_os9_impl::iterate_directory_entries(const file_header &header, const s continue; // set up the child header - u32 lsn = pick_integer_be(&directory_data[i * 32] + 29, 3); + u32 lsn = get_u24be(&directory_data[i * 32] + 29); // invoke the callback done = callback(std::move(filename), lsn); @@ -599,19 +600,6 @@ std::string coco_os9_impl::to_os9_string(std::string_view s, size_t length) //------------------------------------------------- -// pick_integer_be -//------------------------------------------------- - -u32 coco_os9_impl::pick_integer_be(const u8 *data, int length) -{ - u32 result = 0; - for (int i = 0; i < length; i++) - result |= u32(data[length - i - 1]) << i * 8; - return result; -} - - -//------------------------------------------------- // from_os9_date //------------------------------------------------- |