mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-21 18:11:11 +00:00
some tiny fixes
This commit is contained in:
parent
cc56fb8d29
commit
acdb29805b
5 changed files with 9 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Minetest
|
||||
Copyright (C) 2022 DS
|
||||
Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
|
||||
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 <cerrno>
|
||||
#include <utility>
|
||||
|
@ -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 <typename T>
|
||||
static inline void write_once(volatile T *var, const T val)
|
||||
static void write_once(volatile T *var, const T val)
|
||||
{
|
||||
*var = val;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static inline T read_once(const volatile T *var)
|
||||
static T read_once(const volatile T *var)
|
||||
{
|
||||
return *var;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
Minetest
|
||||
Copyright (C) 2022 DS
|
||||
Copyright (C) 2022 TurkeyMcMac, Jude Melton-Houghton <jwmhjwmh@gmail.com>
|
||||
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<IPCChannelResources> resources, Dir dir) :
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
|
||||
#include <atomic>
|
||||
#include <iostream>
|
||||
#if defined(IPC_CHANNEL_IMPLEMENTATION_WIN32)
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include "threading/ipc_channel.h"
|
||||
#include "threading/semaphore.h"
|
||||
#include "threading/thread.h"
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include "exceptions.h"
|
||||
#include "threading/mutex_auto_lock.h"
|
||||
#include "threading/semaphore.h"
|
||||
#include "debug.h"
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue