[nostalgia] Remove nodiscards from Error and ValErr functions
This commit is contained in:
@@ -18,9 +18,9 @@ namespace nostalgia::core {
|
||||
|
||||
using event_handler = int(*)(Context*);
|
||||
|
||||
[[nodiscard]] ox::Error init(Context *ctx);
|
||||
ox::Error init(Context *ctx);
|
||||
|
||||
[[nodiscard]] ox::Error run(Context *ctx);
|
||||
ox::Error run(Context *ctx);
|
||||
|
||||
// Sets event handler that sleeps for the time given in the return value. The
|
||||
// sleep time is a minimum of ~16 milliseconds.
|
||||
|
||||
@@ -66,18 +66,18 @@ ox::Error model(T *io, NostalgiaGraphic *ng) {
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
[[nodiscard]] ox::Error initGfx(Context *ctx);
|
||||
ox::Error initGfx(Context *ctx);
|
||||
|
||||
[[nodiscard]] ox::Error shutdownGfx(Context*);
|
||||
ox::Error shutdownGfx(Context*);
|
||||
|
||||
[[nodiscard]] ox::Error initConsole(Context *ctx);
|
||||
ox::Error initConsole(Context *ctx);
|
||||
|
||||
/**
|
||||
* @param section describes which section of the selected TileSheetSpace to use (e.g. MEM_PALLETE_BG[section])
|
||||
*/
|
||||
[[nodiscard]] ox::Error loadBgTileSheet(Context *ctx, int section, ox::FileAddress tilesheet, ox::FileAddress palette = nullptr);
|
||||
ox::Error loadBgTileSheet(Context *ctx, int section, ox::FileAddress tilesheet, ox::FileAddress palette = nullptr);
|
||||
|
||||
[[nodiscard]] ox::Error loadSpriteTileSheet(Context *ctx,
|
||||
ox::Error loadSpriteTileSheet(Context *ctx,
|
||||
int section,
|
||||
ox::FileAddress tilesheetAddr,
|
||||
ox::FileAddress paletteAddr);
|
||||
|
||||
@@ -33,7 +33,7 @@ struct SdlImplData {
|
||||
|
||||
constexpr auto Scale = 5;
|
||||
|
||||
[[nodiscard]] static ox::ValErr<ox::Vector<char>> readFile(Context *ctx, const ox::FileAddress &file) {
|
||||
static ox::ValErr<ox::Vector<char>> readFile(Context *ctx, const ox::FileAddress &file) {
|
||||
auto [stat, err] = ctx->rom->stat(file);
|
||||
oxReturnError(err);
|
||||
ox::Vector<char> buff(stat.size);
|
||||
@@ -42,7 +42,7 @@ constexpr auto Scale = 5;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]] ox::ValErr<T> readObj(Context *ctx, const ox::FileAddress &file) {
|
||||
ox::ValErr<T> readObj(Context *ctx, const ox::FileAddress &file) {
|
||||
auto [buff, err] = readFile(ctx, file);
|
||||
oxReturnError(err);
|
||||
T t;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
namespace nostalgia::core {
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]] ox::ValErr<std::vector<uint8_t>> toBuffer(T *data, std::size_t buffSize = ox::units::MB) {
|
||||
ox::ValErr<std::vector<uint8_t>> toBuffer(T *data, std::size_t buffSize = ox::units::MB) {
|
||||
std::vector<uint8_t> buff(buffSize);
|
||||
std::size_t sz = 0;
|
||||
oxReturnError(ox::writeMC(buff.data(), buff.size(), data, &sz));
|
||||
|
||||
Reference in New Issue
Block a user