diff options
author | HampusM <hampus@hampusmat.com> | 2022-05-31 11:39:04 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-05-31 11:39:04 +0200 |
commit | e4b7b5ba2e1371b142167e75a3ddcd63a0e00a48 (patch) | |
tree | df6866e73fdf19962fdd29fd6de5c54ee971db8b /minion/src/util.cpp | |
parent | e75bc5d3fe24979ca59c995a7decbcbf720a20a8 (diff) |
style(minion): change eol to LF
Diffstat (limited to 'minion/src/util.cpp')
-rw-r--r-- | minion/src/util.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/minion/src/util.cpp b/minion/src/util.cpp index 708e47d..b55a6e8 100644 --- a/minion/src/util.cpp +++ b/minion/src/util.cpp @@ -1,46 +1,46 @@ -#include "util.hpp" - -namespace util -{ - -auto str_ends_with(const char *target, size_t target_end, const char *other) noexcept - -> bool -{ - if (target == nullptr || other == nullptr) - { - return false; - } - - const auto other_str_length = strlen(other); - - if (other_str_length > target_end) - { - return false; - } - - return strncmp(target + target_end - other_str_length, other, other_str_length) == 0; -} - -void substr(const char *str, const char *end, char *dest) noexcept -{ - auto *dest_head = dest; - - for (const char *char_ptr = str; char_ptr != end; ++char_ptr) - { - *dest_head = *char_ptr; - dest_head++; - } -} - -auto streq(const char *str_one, const char *str_two) noexcept -> bool -{ - return strcmp(str_one, str_two) == 0; -} - -void quit() noexcept -{ - while (true) - ; -} - -} // namespace util +#include "util.hpp"
+
+namespace util
+{
+
+auto str_ends_with(const char *target, size_t target_end, const char *other) noexcept
+ -> bool
+{
+ if (target == nullptr || other == nullptr)
+ {
+ return false;
+ }
+
+ const auto other_str_length = strlen(other);
+
+ if (other_str_length > target_end)
+ {
+ return false;
+ }
+
+ return strncmp(target + target_end - other_str_length, other, other_str_length) == 0;
+}
+
+void substr(const char *str, const char *end, char *dest) noexcept
+{
+ auto *dest_head = dest;
+
+ for (const char *char_ptr = str; char_ptr != end; ++char_ptr)
+ {
+ *dest_head = *char_ptr;
+ dest_head++;
+ }
+}
+
+auto streq(const char *str_one, const char *str_two) noexcept -> bool
+{
+ return strcmp(str_one, str_two) == 0;
+}
+
+void quit() noexcept
+{
+ while (true)
+ ;
+}
+
+} // namespace util
|