From acdb29805bdf7953417cb7cb85988783279521aa Mon Sep 17 00:00:00 2001 From: Desour Date: Sun, 6 Oct 2024 15:13:51 +0200 Subject: [PATCH] some tiny fixes --- doc/compiling/linux.md | 2 +- src/threading/ipc_channel.cpp | 9 +++++---- src/threading/ipc_channel.h | 6 +++--- src/unittest/test_threading.cpp | 3 --- src/util/container.h | 1 - 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/doc/compiling/linux.md b/doc/compiling/linux.md index d2372fc30..d3a8917fc 100644 --- a/doc/compiling/linux.md +++ b/doc/compiling/linux.md @@ -22,7 +22,7 @@ For Debian/Ubuntu users: - sudo apt install g++ make libc6-dev cmake linux-libc-dev libpng-dev libjpeg-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev gettext libsdl2-dev + sudo apt install g++ make libc6-dev cmake linux-libc-dev libpng-dev libjpeg-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev gettext libsdl2-dev For Fedora users: diff --git a/src/threading/ipc_channel.cpp b/src/threading/ipc_channel.cpp index bf319fa38..59b90c4f5 100644 --- a/src/threading/ipc_channel.cpp +++ b/src/threading/ipc_channel.cpp @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2022 DS Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton +Copyright (C) 2024 DS This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "ipc_channel.h" #include "debug.h" +#include "exceptions.h" #include "porting.h" #include #include @@ -179,7 +180,7 @@ static bool wait_in(IPCChannelEnd::Dir *dir, u64 timeout_ms_abs) u64 timeout_ms = timeout_ms_abs - tnow; #elif defined(IPC_CHANNEL_IMPLEMENTATION_POSIX) // Absolute time - u64 timeout_msu = timeout_ms_abs; + u64 timeout_ms = timeout_ms_abs; #endif timeout.tv_sec = timeout_ms / 1000; timeout.tv_nsec = timeout_ms % 1000 * 1000000UL; @@ -200,13 +201,13 @@ static void post_out(IPCChannelEnd::Dir *dir) } template -static inline void write_once(volatile T *var, const T val) +static void write_once(volatile T *var, const T val) { *var = val; } template -static inline T read_once(const volatile T *var) +static T read_once(const volatile T *var) { return *var; } diff --git a/src/threading/ipc_channel.h b/src/threading/ipc_channel.h index 7c151e32f..0cd8b4962 100644 --- a/src/threading/ipc_channel.h +++ b/src/threading/ipc_channel.h @@ -1,7 +1,7 @@ /* Minetest -Copyright (C) 2022 DS Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton +Copyright (C) 2024 DS This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -237,8 +237,8 @@ public: // Get the content of the last received message // TODO: u8 *, or string_view? - inline const void *getRecvData() const noexcept { return m_large_recv.data(); } - inline size_t getRecvSize() const noexcept { return m_recv_size; } + const void *getRecvData() const noexcept { return m_large_recv.data(); } + size_t getRecvSize() const noexcept { return m_recv_size; } private: IPCChannelEnd(std::unique_ptr resources, Dir dir) : diff --git a/src/unittest/test_threading.cpp b/src/unittest/test_threading.cpp index e1b5e25c4..7db619b04 100644 --- a/src/unittest/test_threading.cpp +++ b/src/unittest/test_threading.cpp @@ -6,9 +6,6 @@ #include #include -#if defined(IPC_CHANNEL_IMPLEMENTATION_WIN32) -#include -#endif #include "threading/ipc_channel.h" #include "threading/semaphore.h" #include "threading/thread.h" diff --git a/src/util/container.h b/src/util/container.h index a6fb95a10..2ab573c19 100644 --- a/src/util/container.h +++ b/src/util/container.h @@ -9,7 +9,6 @@ #include "exceptions.h" #include "threading/mutex_auto_lock.h" #include "threading/semaphore.h" -#include "debug.h" #include #include #include