mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 09:27:38 +00:00
Give file_id_t a real constructor
Initialize it to invalid by default.
This commit is contained in:
parent
c435d8b9b3
commit
8344289fac
2 changed files with 10 additions and 14 deletions
|
@ -31,13 +31,7 @@
|
||||||
|
|
||||||
using cstring = std::string;
|
using cstring = std::string;
|
||||||
|
|
||||||
const file_id_t kInvalidFileID = {static_cast<dev_t>(-1LL),
|
const file_id_t kInvalidFileID{};
|
||||||
static_cast<ino_t>(-1LL),
|
|
||||||
static_cast<uint64_t>(-1LL),
|
|
||||||
-1,
|
|
||||||
-1,
|
|
||||||
-1,
|
|
||||||
-1};
|
|
||||||
|
|
||||||
/// Map used as cache by wgettext.
|
/// Map used as cache by wgettext.
|
||||||
static owning_lock<std::unordered_map<wcstring, wcstring>> wgettext_map;
|
static owning_lock<std::unordered_map<wcstring, wcstring>> wgettext_map;
|
||||||
|
|
16
src/wutil.h
16
src/wutil.h
|
@ -137,13 +137,15 @@ double fish_wcstod(const wchar_t *str, wchar_t **endptr);
|
||||||
/// seems to aggressively re-use inodes, so it cannot determine if a file has been deleted (ABA
|
/// seems to aggressively re-use inodes, so it cannot determine if a file has been deleted (ABA
|
||||||
/// problem). Therefore we include richer information.
|
/// problem). Therefore we include richer information.
|
||||||
struct file_id_t {
|
struct file_id_t {
|
||||||
dev_t device;
|
dev_t device{static_cast<dev_t>(-1LL)};
|
||||||
ino_t inode;
|
ino_t inode{static_cast<ino_t>(-1LL)};
|
||||||
uint64_t size;
|
uint64_t size{static_cast<uint64_t>(-1LL)};
|
||||||
time_t change_seconds;
|
time_t change_seconds{-1};
|
||||||
long change_nanoseconds;
|
long change_nanoseconds{-1};
|
||||||
time_t mod_seconds;
|
time_t mod_seconds{-1};
|
||||||
long mod_nanoseconds;
|
long mod_nanoseconds{-1};
|
||||||
|
|
||||||
|
constexpr file_id_t() = default;
|
||||||
|
|
||||||
bool operator==(const file_id_t &rhs) const;
|
bool operator==(const file_id_t &rhs) const;
|
||||||
bool operator!=(const file_id_t &rhs) const;
|
bool operator!=(const file_id_t &rhs) const;
|
||||||
|
|
Loading…
Reference in a new issue