Commit 3315c67f authored by Max Kellermann's avatar Max Kellermann

Inotify: convert anonymous enum to constexpr

parent b879bcb1
......@@ -26,14 +26,12 @@
#include <string.h>
enum {
/**
* Wait this long after the last change before calling
* update_enqueue(). This increases the probability that
* updates can be bundled.
*/
INOTIFY_UPDATE_DELAY_S = 5,
};
/**
* Wait this long after the last change before calling
* update_enqueue(). This increases the probability that updates can
* be bundled.
*/
static constexpr unsigned INOTIFY_UPDATE_DELAY_S = 5;
void
InotifyQueue::OnTimeout()
......
......@@ -39,13 +39,12 @@
#include <string.h>
#include <dirent.h>
enum {
IN_MASK = IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|IN_MOVE|IN_MOVE_SELF
static constexpr unsigned IN_MASK =
#ifdef IN_ONLYDIR
|IN_ONLYDIR
IN_ONLYDIR|
#endif
};
IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|IN_MOVE|IN_MOVE_SELF;
struct WatchDirectory {
WatchDirectory *parent;
......
......@@ -28,13 +28,12 @@
#include <sys/inotify.h>
enum {
IN_MASK = IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|IN_MOVE|IN_MOVE_SELF
static constexpr unsigned IN_MASK =
#ifdef IN_ONLYDIR
|IN_ONLYDIR
IN_ONLYDIR|
#endif
};
IN_ATTRIB|IN_CLOSE_WRITE|IN_CREATE|IN_DELETE|IN_DELETE_SELF
|IN_MOVE|IN_MOVE_SELF;
static void
my_inotify_callback(gcc_unused int wd, unsigned mask,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment