Skip to content

Commit

Permalink
Some more trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Jun 6, 2024
1 parent 10409e0 commit b8d0479
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 807 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ if(NOT CONSOLE_ONLY)
source_files/obsidian_main/ui_module.cc
source_files/obsidian_main/ui_widgets.cc
source_files/obsidian_main/ui_window.cc
source_files/obsidian_main/vis_buffer.cc
)
else()
add_executable(
Expand Down Expand Up @@ -129,7 +128,6 @@ else()
source_files/obsidian_main/sys_xoshiro.cc
source_files/obsidian_main/tx_forge.cc
source_files/obsidian_main/tx_skies.cc
source_files/obsidian_main/vis_buffer.cc
)
endif()

Expand Down
3 changes: 0 additions & 3 deletions source_files/obsidian_main/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1915,9 +1915,6 @@ softrestart:;
main_action = MAIN_SOFT_RESTART;
}
}
} catch (const assert_fail_c &err) {
Main::FatalError(_("Sorry, an internal error occurred:\n%s"),
err.GetMessage());
} catch (std::exception &e) {
Main::FatalError(_("An exception occurred: \n%s"), e.what());
}
Expand Down
23 changes: 0 additions & 23 deletions source_files/obsidian_main/sys_assert.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,6 @@
#include "headers.h"
#include "main.h"

assert_fail_c::assert_fail_c(const char *_msg) {
strncpy(message, _msg, sizeof(message));

message[sizeof(message) - 1] = 0;
}

assert_fail_c::~assert_fail_c() { /* nothing needed */
}

assert_fail_c::assert_fail_c(const assert_fail_c &other) {
strcpy(message, other.message);
}

assert_fail_c &assert_fail_c::operator=(const assert_fail_c &other) {
if (this != &other) {
strcpy(message, other.message);
}

return *this;
}

//----------------------------------------------------------------------------

void AssertFail(const char *msg, ...) {
Expand All @@ -56,8 +35,6 @@ void AssertFail(const char *msg, ...) {

buffer[MSG_BUF_LEN - 2] = 0;

// NO WORKY WITH LUA :( ---> throw assert_fail_c(buffer);

Main::FatalError("Sorry, an internal error occurred.\n%s", buffer);
}

Expand Down
17 changes: 0 additions & 17 deletions source_files/obsidian_main/sys_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,6 @@
#undef GetMessage
#endif

class assert_fail_c {
public:
assert_fail_c(const char *_msg);
assert_fail_c(const assert_fail_c &other);
~assert_fail_c();

private:
static const int MSG_MAX = 200;

char message[MSG_MAX];

public:
const char *GetMessage() const { return message; }

assert_fail_c &operator=(const assert_fail_c &other);
};

// -------- the macros --------

#ifdef NDEBUG
Expand Down
20 changes: 0 additions & 20 deletions source_files/obsidian_main/sys_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,26 +113,6 @@ static inline uint32_t UT_Swap32(uint32_t x) {
#define BE_S16(X) ((int16_t)BE_U16((uint16_t)(X)))
#define BE_S32(X) ((int32_t)BE_U32((uint32_t)(X)))

// ---- floating point ----

static inline float UT_SwapFloat(float x) {
union {
float f;
uint32_t u;
} in, out;
in.f = x;
out.u = UT_Swap32(in.u);
return out.f;
}

#if (UT_BYTEORDER == UT_LIL_ENDIAN)
#define LE_Float32(X) (X)
#define BE_Float32(X) UT_SwapFloat(X)
#else
#define LE_Float32(X) UT_SwapFloat(X)
#define BE_Float32(X) (X)
#endif

#endif // __SYS_ENDIAN_H__

//--- editor settings ---
Expand Down
13 changes: 0 additions & 13 deletions source_files/obsidian_main/sys_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,6 @@ constexpr T ABS(T a) {
}
#endif

#ifndef SGN
template <typename T>
constexpr auto SGN(T x) {
if (x < 0) {
return -1;
}
if (x > 0) {
return 1;
}
return 0;
}
#endif

#ifndef I_ROUND
template <typename T>
constexpr int I_ROUND(T x) {
Expand Down
Loading

0 comments on commit b8d0479

Please sign in to comment.