diff options
author | Max Kellermann <max@duempel.org> | 2013-01-02 19:22:15 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-02 19:22:15 +0100 |
commit | a654f146d1b39a363cb10853a7670ef099570e54 (patch) | |
tree | 2c171646333f0b529655b57bee2c1eb6a3dd7c1c /src/inotify_source.c | |
parent | 67b46a151da4ca6f81fa63d30e2c629da352ec45 (diff) | |
download | mpd-a654f146d1b39a363cb10853a7670ef099570e54.tar.gz mpd-a654f146d1b39a363cb10853a7670ef099570e54.tar.xz mpd-a654f146d1b39a363cb10853a7670ef099570e54.zip |
update: convert to C++
Diffstat (limited to '')
-rw-r--r-- | src/InotifySource.cxx (renamed from src/inotify_source.c) | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/inotify_source.c b/src/InotifySource.cxx index 2fbfdff7e..689468102 100644 --- a/src/inotify_source.c +++ b/src/InotifySource.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2011 The Music Player Daemon Project + * Copyright (C) 2003-2013 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,8 +18,12 @@ */ #include "config.h" -#include "inotify_source.h" +#include "InotifySource.hxx" + +extern "C" { #include "fifo_buffer.h" +} + #include "fd_util.h" #include "mpd_error.h" @@ -63,11 +67,10 @@ mpd_inotify_in_event(G_GNUC_UNUSED GIOChannel *_source, G_GNUC_UNUSED GIOCondition condition, gpointer data) { - struct mpd_inotify_source *source = data; + struct mpd_inotify_source *source = (struct mpd_inotify_source *)data; void *dest; size_t length; ssize_t nbytes; - const struct inotify_event *event; dest = fifo_buffer_write(source->buffer, &length); if (dest == NULL) @@ -85,7 +88,9 @@ mpd_inotify_in_event(G_GNUC_UNUSED GIOChannel *_source, while (true) { const char *name; - event = fifo_buffer_read(source->buffer, &length); + const struct inotify_event *event = + (const struct inotify_event *) + fifo_buffer_read(source->buffer, &length); if (event == NULL || length < sizeof(*event) || length < sizeof(*event) + event->len) break; |