diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-12 18:23:31 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-03-12 18:23:31 +0100 |
| commit | fe55f67bf7a5aeba365d7af1d681cef1d9ed7a3c (patch) | |
| tree | 9e962f83a756522ab17f24b3703971348ea4de2f /include | |
| parent | 9792287fddc2fc9f47c71b3f9fd69933c9010275 (diff) | |
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/CompilerKit/Detail/PreConfig.h | 3 | ||||
| -rw-r--r-- | include/CompilerKit/MachO.h | 4 | ||||
| -rw-r--r-- | include/CompilerKit/UUID.h | 2 | ||||
| -rw-r--r-- | include/ThirdParty/Dialogs/Dialogs.h | 43 |
4 files changed, 26 insertions, 26 deletions
diff --git a/include/CompilerKit/Detail/PreConfig.h b/include/CompilerKit/Detail/PreConfig.h index 9294c01..882e00b 100644 --- a/include/CompilerKit/Detail/PreConfig.h +++ b/include/CompilerKit/Detail/PreConfig.h @@ -87,7 +87,8 @@ #define kObjectFileExt ".obj" #define kBinaryFileExt ".bin" -#define kAsmFileExts {".64x", ".32x", ".masm", ".s", ".S", ".asm", ".x64"} +#define kAsmFileExts \ + { ".64x", ".32x", ".masm", ".s", ".S", ".asm", ".x64" } #define kAsmFileExtsMax (7U) diff --git a/include/CompilerKit/MachO.h b/include/CompilerKit/MachO.h index 2942420..05131ad 100644 --- a/include/CompilerKit/MachO.h +++ b/include/CompilerKit/MachO.h @@ -43,9 +43,7 @@ namespace MachO { constexpr uint32_t kSectionAlign = 4; /// @brief Helper to align a value to page boundary - inline uint64_t AlignToPage(uint64_t value) { - return (value + kPageSize - 1) & ~(kPageSize - 1); - } + inline uint64_t AlignToPage(uint64_t value) { return (value + kPageSize - 1) & ~(kPageSize - 1); } /// @brief Helper to copy segment/section name safely inline void CopySegmentName(char* dest, const char* src) { diff --git a/include/CompilerKit/UUID.h b/include/CompilerKit/UUID.h index 02f95dc..a334052 100644 --- a/include/CompilerKit/UUID.h +++ b/include/CompilerKit/UUID.h @@ -165,7 +165,7 @@ namespace Detail { process_byte(static_cast<unsigned char>((bitCount >> 24) & 0xFF)); process_byte(static_cast<unsigned char>((bitCount >> 16) & 0xFF)); process_byte(static_cast<unsigned char>((bitCount >> 8) & 0xFF)); - process_byte(static_cast<unsigned char>((bitCount) & 0xFF)); + process_byte(static_cast<unsigned char>((bitCount) &0xFF)); memcpy(digest, m_digest, 5 * sizeof(uint32_t)); return digest; diff --git a/include/ThirdParty/Dialogs/Dialogs.h b/include/ThirdParty/Dialogs/Dialogs.h index 8168dd2..f370719 100644 --- a/include/ThirdParty/Dialogs/Dialogs.h +++ b/include/ThirdParty/Dialogs/Dialogs.h @@ -176,7 +176,7 @@ namespace internal { #elif __EMSCRIPTEN__ void start(int exit_code); #else - void start_process(std::vector<std::string> const& command); + void start_process(std::vector<std::string> const& command); #endif ~executor(); @@ -219,7 +219,7 @@ namespace internal { : m_proc(reinterpret_cast<T*>((void*) ::GetProcAddress(lib.handle, sym.c_str()))) {} explicit operator bool() const { return m_proc != nullptr; } - operator T*() const { return m_proc; } + operator T*() const { return m_proc; } private: T* m_proc; @@ -491,10 +491,10 @@ inline settings::settings(bool resync) { #if _WIN32 flags(flag::is_vista) = internal::is_vista(); #elif !__APPLE__ - flags(flag::has_zenity) = check_program("zenity"); + flags(flag::has_zenity) = check_program("zenity"); flags(flag::has_matedialog) = check_program("matedialog"); - flags(flag::has_qarma) = check_program("qarma"); - flags(flag::has_kdialog) = check_program("kdialog"); + flags(flag::has_qarma) = check_program("qarma"); + flags(flag::has_kdialog) = check_program("kdialog"); // If multiple helpers are available, try to default to the best one if (flags(flag::has_zenity) && flags(flag::has_kdialog)) { @@ -541,7 +541,7 @@ inline bool settings::check_program(std::string const& program) { (void) program; return false; #else - int exit_code = -1; + int exit_code = -1; internal::executor async; async.start_process({"/bin/sh", "-c", "which " + program}); async.result(&exit_code); @@ -605,7 +605,7 @@ inline std::string path::home() { if (size_max != -1) len = size_t(size_max); #endif std::vector<char> buf(len); - struct passwd pwd, *result; + struct passwd pwd, *result; if (getpwuid_r(getuid(), &pwd, buf.data(), buf.size(), &result) == 0) return result->pw_dir; #endif return "/"; @@ -718,7 +718,7 @@ inline void internal::executor::start_process(std::vector<std::string> const& co } close(in[1]); - m_fd = out[0]; + m_fd = out[0]; auto flags = fcntl(m_fd, F_GETFL); fcntl(m_fd, F_SETFL, flags | O_NONBLOCK); @@ -754,7 +754,7 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */) // FIXME: do something (void) timeout; #else - char buf[BUFSIZ]; + char buf[BUFSIZ]; ssize_t received = read(m_fd, buf, BUFSIZ); // Flawfinder: ignore if (received > 0) { m_stdout += std::string(buf, received); @@ -765,7 +765,7 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */) // (this happens when the calling application handles or ignores SIG_CHLD) and results in // waitpid() failing with ECHILD. Otherwise we assume the child is running and we sleep for // a little while. - int status; + int status; pid_t child = waitpid(m_pid, &status, WNOHANG); if (child != m_pid && (child >= 0 || errno != ECHILD)) { // FIXME: this happens almost always at first iteration @@ -783,7 +783,8 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */) inline void internal::executor::stop() { // Loop until the user closes the dialog - while (!ready()); + while (!ready()) + ; } // dll implementation @@ -879,11 +880,11 @@ inline std::vector<std::string> internal::dialog::desktop_helper() const { #if __APPLE__ return {"osascript"}; #else - return {flags(flag::has_zenity) ? "zenity" + return {flags(flag::has_zenity) ? "zenity" : flags(flag::has_matedialog) ? "matedialog" - : flags(flag::has_qarma) ? "qarma" - : flags(flag::has_kdialog) ? "kdialog" - : "echo"}; + : flags(flag::has_qarma) ? "qarma" + : flags(flag::has_kdialog) ? "kdialog" + : "echo"}; #endif } @@ -1125,9 +1126,9 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title // Split the pattern list to check whether "*" is in there; if it // is, we have to disable filters because there is no mechanism in // OS X for the user to override the filter. - std::regex sep("\\s+"); - std::string filter_list; - bool has_filter = true; + std::regex sep("\\s+"); + std::string filter_list; + bool has_filter = true; std::sregex_token_iterator iter(patterns.begin(), patterns.end(), sep, -1); std::sregex_token_iterator end; for (; iter != end; ++iter) { @@ -1236,7 +1237,7 @@ inline std::vector<std::string> internal::file_dialog::vector_result() { return m_vector_result; #else std::vector<std::string> ret; - auto result = m_async->result(); + auto result = m_async->result(); for (;;) { // Split result along newline characters auto i = result.find('\n'); @@ -1569,7 +1570,7 @@ inline message::message(std::string const& title, std::string const& text, if_cancel = button::ok; break; } - m_mappings[1] = if_cancel; + m_mappings[1] = if_cancel; m_mappings[256] = if_cancel; // XXX: I think this was never correct script += " with icon "; switch (_icon) { @@ -1656,7 +1657,7 @@ inline message::message(std::string const& title, std::string const& text, if (_choice == choice::yes_no_cancel) flag += "cancel"; command.push_back(flag); if (_choice == choice::yes_no || _choice == choice::yes_no_cancel) { - m_mappings[0] = button::yes; + m_mappings[0] = button::yes; m_mappings[256] = button::no; } } |
