Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3315c67f
Commit
3315c67f
authored
Oct 20, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inotify: convert anonymous enum to constexpr
parent
b879bcb1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
InotifyQueue.cxx
src/InotifyQueue.cxx
+6
-8
InotifyUpdate.cxx
src/InotifyUpdate.cxx
+4
-5
run_inotify.cxx
test/run_inotify.cxx
+4
-5
No files found.
src/InotifyQueue.cxx
View file @
3315c67f
...
...
@@ -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
()
...
...
src/InotifyUpdate.cxx
View file @
3315c67f
...
...
@@ -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
;
...
...
test/run_inotify.cxx
View file @
3315c67f
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment