Inotify: convert anonymous enum to constexpr
This commit is contained in:
parent
b879bcb1eb
commit
3315c67f0f
@ -26,14 +26,12 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
enum {
|
/**
|
||||||
/**
|
* Wait this long after the last change before calling
|
||||||
* Wait this long after the last change before calling
|
* update_enqueue(). This increases the probability that updates can
|
||||||
* update_enqueue(). This increases the probability that
|
* be bundled.
|
||||||
* updates can be bundled.
|
*/
|
||||||
*/
|
static constexpr unsigned INOTIFY_UPDATE_DELAY_S = 5;
|
||||||
INOTIFY_UPDATE_DELAY_S = 5,
|
|
||||||
};
|
|
||||||
|
|
||||||
void
|
void
|
||||||
InotifyQueue::OnTimeout()
|
InotifyQueue::OnTimeout()
|
||||||
|
@ -39,13 +39,12 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
enum {
|
static constexpr unsigned IN_MASK =
|
||||||
IN_MASK = IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|
|
||||||
|IN_MOVE|IN_MOVE_SELF
|
|
||||||
#ifdef IN_ONLYDIR
|
#ifdef IN_ONLYDIR
|
||||||
|IN_ONLYDIR
|
IN_ONLYDIR|
|
||||||
#endif
|
#endif
|
||||||
};
|
IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|
||||||
|
|IN_MOVE|IN_MOVE_SELF;
|
||||||
|
|
||||||
struct WatchDirectory {
|
struct WatchDirectory {
|
||||||
WatchDirectory *parent;
|
WatchDirectory *parent;
|
||||||
|
@ -28,13 +28,12 @@
|
|||||||
|
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
|
|
||||||
enum {
|
static constexpr unsigned IN_MASK =
|
||||||
IN_MASK = IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|
|
||||||
|IN_MOVE|IN_MOVE_SELF
|
|
||||||
#ifdef IN_ONLYDIR
|
#ifdef IN_ONLYDIR
|
||||||
|IN_ONLYDIR
|
IN_ONLYDIR|
|
||||||
#endif
|
#endif
|
||||||
};
|
IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|
||||||
|
|IN_MOVE|IN_MOVE_SELF;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
my_inotify_callback(gcc_unused int wd, unsigned mask,
|
my_inotify_callback(gcc_unused int wd, unsigned mask,
|
||||||
|
Loading…
Reference in New Issue
Block a user