Skip to content

Commit 8ccc952

Browse files
committed
mixed inline changes
1 parent 2d24c10 commit 8ccc952

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/include/sndx/container/packed_view.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,7 @@ namespace sndx::container {
8989
if (m_container != other.m_container)
9090
throw std::logic_error("Compared Iterators of PackedView refer to different PackedViews!");
9191

92-
if (m_pos < other.m_pos)
93-
return std::strong_ordering::less;
94-
95-
if (m_pos > other.m_pos)
96-
return std::strong_ordering::greater;
97-
98-
return std::strong_ordering::equal;
92+
return m_pos <=> other.m_pos;
9993
}
10094
};
10195

src/include/sndx/data/ogg_wrap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ namespace sndx::ogg {
209209
}
210210

211211
// WriteFn is a function callable with std::span<char, dynamic_extent> as argument,
212-
// if the return is can be converted to long, that much is repoted as witten
212+
// if the return can be converted to long, that much is repoted as witten
213213
// WriteFn should attempt to write size bytes into the argument buffer
214214
// returns amount written or -1 on error
215215
template <class WriteFn>

src/include/sndx/data/version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ namespace sndx {
3030
constexpr Version SNDXlibVersion{ SNDXLIB_MAJOR, SNDXLIB_MINOR, SNDXLIB_PATCH };
3131

3232
static_assert(SNDXlibVersion >= Version{ 0, 0, 0 });
33-
}
33+
}

src/include/sndx/platform/shared_lib.hpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ namespace sndx::platform {
107107
std::unordered_map<std::string, Data> m_funcs{};
108108
public:
109109

110+
enum class ErrorType : uint8_t {
111+
BadLibrary,
112+
BadFunction,
113+
};
114+
110115
[[nodiscard]]
111116
bool contains(const std::string& id) const {
112117
return m_funcs.contains(id);
@@ -154,7 +159,7 @@ namespace sndx::platform {
154159
continue;
155160
}
156161
else {
157-
errorCallback(id, "failed to load");
162+
errorCallback(id, ErrorType::BadFunction);
158163
}
159164
}
160165

@@ -163,14 +168,14 @@ namespace sndx::platform {
163168
}
164169

165170
if (!lib.valid()) {
166-
errorCallback("", "library not valid");
171+
errorCallback("", ErrorType::BadLibrary);
167172
}
168173

169174
return fails;
170175
}
171176

172177
size_t load(const SharedLib& lib) {
173-
return load(lib, [](std::string_view, std::string_view) {});
178+
return load(lib, [](std::string_view, ErrorType) {});
174179
}
175180
};
176181
}

0 commit comments

Comments
 (0)