Massive libfmt refactor

This commit is contained in:
Jack Andersen
2019-07-19 18:21:57 -10:00
parent d9b6be8446
commit 37792ba116
13 changed files with 103 additions and 118 deletions

View File

@@ -71,7 +71,7 @@ class DiscIOWBFS : public IDiscIO {
off *= 512ULL;
rs.seek(off, SEEK_SET);
if (rs.read(buf, count * 512ULL) != count * 512ULL) {
LogModule.report(logvisor::Error, "error reading disc");
LogModule.report(logvisor::Error, fmt("error reading disc"));
return 1;
}
return 0;
@@ -88,7 +88,7 @@ public:
WBFS* p = &wbfs;
WBFSHead tmpHead;
if (rs->read(&tmpHead, sizeof(tmpHead)) != sizeof(tmpHead)) {
LogModule.report(logvisor::Error, "unable to read WBFS head");
LogModule.report(logvisor::Error, fmt("unable to read WBFS head"));
return;
}
unsigned hd_sector_size = 1 << tmpHead.hd_sec_sz_s;
@@ -98,7 +98,7 @@ public:
WBFSHead* head = (WBFSHead*)wbfsHead.get();
rs->seek(0, SEEK_SET);
if (rs->read(head, hd_sector_size) != hd_sector_size) {
LogModule.report(logvisor::Error, "unable to read WBFS head");
LogModule.report(logvisor::Error, fmt("unable to read WBFS head"));
return;
}
@@ -111,11 +111,11 @@ public:
if (_wbfsReadSector(*rs, p->part_lba, 1, head))
return;
if (hd_sector_size && head->hd_sec_sz_s != size_to_shift(hd_sector_size)) {
LogModule.report(logvisor::Error, "hd sector size doesn't match");
LogModule.report(logvisor::Error, fmt("hd sector size doesn't match"));
return;
}
if (num_hd_sector && head->n_hd_sec != SBig(num_hd_sector)) {
LogModule.report(logvisor::Error, "hd num sector doesn't match");
LogModule.report(logvisor::Error, fmt("hd num sector doesn't match"));
return;
}
p->hd_sec_sz = 1 << head->hd_sec_sz_s;
@@ -143,7 +143,7 @@ public:
if (head->disc_table[0]) {
wbfsDiscInfo.reset(new uint8_t[p->disc_info_sz]);
if (!wbfsDiscInfo) {
LogModule.report(logvisor::Error, "allocating memory");
LogModule.report(logvisor::Error, fmt("allocating memory"));
return;
}
if (_wbfsReadSector(*rs, p->part_lba + 1, disc_info_sz_lba, wbfsDiscInfo.get()))