Skip to content

Commit 9c60255

Browse files
committed
More build cleanup.
1 parent 3aa73f9 commit 9c60255

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ jobs:
7878
working-directory: build/
7979
run: ninja
8080

81-
- name: Test
82-
run: build/tests/abyss_test
83-
8481
- name: Package (Windows)
8582
if: ${{ matrix.os == 'windows-latest' && github.event_name == 'push' }}
8683
working-directory: build/

src/Abyss/FileSystem/CASC.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@
1212

1313
namespace Abyss::FileSystem {
1414

15-
class CASCStream : public SizeableStreambuf {
15+
class CASCStream final : public SizeableStreambuf {
1616
public:
17-
CASCStream(void *casc, std::string fileName);
17+
CASCStream(void *casc, const std::string& fileName);
1818

1919
~CASCStream() override;
2020

2121
protected:
2222
int underflow() override;
2323
pos_type seekpos(pos_type pos, std::ios_base::openmode which) override;
2424
pos_type seekoff(off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which) override;
25-
std::streamsize size() const override;
25+
[[nodiscard]] std::streamsize size() const override;
2626

2727
private:
28-
void *_file = 0;
28+
void *_file = nullptr;
2929
std::streamsize _startOfBlock = 0;
3030
char _buffer[2048] = {};
3131
};
3232

33-
CASCStream::CASCStream(HANDLE storage, std::string fileName) {
33+
CASCStream::CASCStream(HANDLE storage, const std::string& fileName) {
3434
if (!CascOpenFile(storage, fileName.c_str(), 0, CASC_OPEN_BY_NAME, &_file)) {
3535
throw std::runtime_error(absl::StrCat("Failed to open file '", fileName, "' from CASC"));
3636
}
@@ -85,7 +85,7 @@ CASCStream::pos_type CASCStream::seekoff(off_type off, std::ios_base::seekdir di
8585
std::streamsize CASCStream::size() const {
8686
ULONGLONG ulongsize;
8787
CascGetFileSize64(_file, &ulongsize);
88-
return ulongsize;
88+
return static_cast<std::streamsize>(ulongsize);
8989
}
9090

9191
static bool casc_progress_callback(void *PtrUserParam, LPCSTR szWork, LPCSTR szObject, DWORD CurrentValue, DWORD TotalValue) {
@@ -106,12 +106,12 @@ static bool casc_progress_callback(void *PtrUserParam, LPCSTR szWork, LPCSTR szO
106106
}
107107

108108
CASC::CASC(const std::filesystem::path &cascPath) {
109-
std::string path = std::filesystem::absolute(cascPath).string();
109+
const std::string path = std::filesystem::absolute(cascPath).string();
110110
CASC_OPEN_STORAGE_ARGS args = {};
111111
args.Size = sizeof(CASC_OPEN_STORAGE_ARGS);
112112
args.PfnProgressCallback = casc_progress_callback;
113113
if (!CascOpenStorageEx(path.c_str(), &args, 0, &_storage)) {
114-
throw std::runtime_error(std::format("Error occurred while opening CASC {}: {}", cascPath.string(), GetCascError()));
114+
throw std::runtime_error(fmt::format("Error occurred while opening CASC {}: {}", cascPath.string(), GetCascError()));
115115
}
116116
}
117117

src/Abyss/FileSystem/CASC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace Abyss::FileSystem {
1212

1313
class CASC final : public Provider {
14-
void* _storage;
14+
void* _storage{};
1515

1616
public:
1717
explicit CASC(const std::filesystem::path &cascPath);

0 commit comments

Comments
 (0)