From a97605e07ad7f44f2f65e15be64880e61a39ab43 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 25 Jun 2010 01:08:29 +0200 Subject: from now on we enforce a strict whitespace regime --- avahi-glib/glib-malloc.c | 6 ++--- avahi-glib/glib-malloc.h | 6 ++--- avahi-glib/glib-watch-test.c | 12 ++++----- avahi-glib/glib-watch.c | 58 ++++++++++++++++++++++---------------------- avahi-glib/glib-watch.h | 6 ++--- 5 files changed, 44 insertions(+), 44 deletions(-) (limited to 'avahi-glib') diff --git a/avahi-glib/glib-malloc.c b/avahi-glib/glib-malloc.c index 2968abc..5c6a02e 100644 --- a/avahi-glib/glib-malloc.c +++ b/avahi-glib/glib-malloc.c @@ -2,17 +2,17 @@ /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 diff --git a/avahi-glib/glib-malloc.h b/avahi-glib/glib-malloc.h index 675ccb5..391d274 100644 --- a/avahi-glib/glib-malloc.h +++ b/avahi-glib/glib-malloc.h @@ -5,17 +5,17 @@ /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 diff --git a/avahi-glib/glib-watch-test.c b/avahi-glib/glib-watch-test.c index 733c81f..bd7d9ac 100644 --- a/avahi-glib/glib-watch-test.c +++ b/avahi-glib/glib-watch-test.c @@ -2,17 +2,17 @@ /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -43,7 +43,7 @@ static void callback(AvahiWatch *w, int fd, AvahiWatchEvent event, AVAHI_GCC_UNU if (event & AVAHI_WATCH_IN) { ssize_t r; char c; - + if ((r = read(fd, &c, 1)) <= 0) { fprintf(stderr, "read() failed: %s\n", r < 0 ? strerror(errno) : "EOF"); api->watch_free(w); @@ -70,7 +70,7 @@ static void wakeup(AvahiTimeout *t, AVAHI_GCC_UNUSED void *userdata) { int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { AvahiGLibPoll *g; struct timeval tv; - + g = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT); assert(g); @@ -86,6 +86,6 @@ int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char *argv[]) { g_main_loop_unref(loop); avahi_glib_poll_free(g); - + return 0; } diff --git a/avahi-glib/glib-watch.c b/avahi-glib/glib-watch.c index f0fd934..72a778b 100644 --- a/avahi-glib/glib-watch.c +++ b/avahi-glib/glib-watch.c @@ -2,17 +2,17 @@ /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 @@ -32,10 +32,10 @@ struct AvahiWatch { AvahiGLibPoll *glib_poll; int dead; - + GPollFD pollfd; int pollfd_added; - + AvahiWatchCallback callback; void *userdata; @@ -51,7 +51,7 @@ struct AvahiTimeout { AvahiTimeoutCallback callback; void *userdata; - + AVAHI_LLIST_FIELDS(AvahiTimeout, timeouts); }; @@ -62,7 +62,7 @@ struct AvahiGLibPoll { gboolean timeout_req_cleanup; gboolean watch_req_cleanup; - + AVAHI_LLIST_HEAD(AvahiWatch, watches); AVAHI_LLIST_HEAD(AvahiTimeout, timeouts); }; @@ -111,7 +111,7 @@ static AvahiWatchEvent map_events_from_glib(gushort events) { static AvahiWatch* watch_new(const AvahiPoll *api, int fd, AvahiWatchEvent events, AvahiWatchCallback callback, void *userdata) { AvahiWatch *w; AvahiGLibPoll *g; - + assert(api); assert(fd >= 0); assert(callback); @@ -121,7 +121,7 @@ static AvahiWatch* watch_new(const AvahiPoll *api, int fd, AvahiWatchEvent event if (!(w = avahi_new(AvahiWatch, 1))) return NULL; - + w->glib_poll = g; w->pollfd.fd = fd; w->pollfd.events = map_events_to_glib(events); @@ -160,7 +160,7 @@ static void watch_free(AvahiWatch *w) { g_source_remove_poll(&w->glib_poll->source, &w->pollfd); w->pollfd_added = FALSE; } - + w->dead = TRUE; w->glib_poll->timeout_req_cleanup = TRUE; } @@ -168,7 +168,7 @@ static void watch_free(AvahiWatch *w) { static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, AvahiTimeoutCallback callback, void *userdata) { AvahiTimeout *t; AvahiGLibPoll *g; - + assert(api); assert(callback); @@ -177,13 +177,13 @@ static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, if (!(t = avahi_new(AvahiTimeout, 1))) return NULL; - + t->glib_poll = g; t->dead = FALSE; if ((t->enabled = !!tv)) t->expiry = *tv; - + t->callback = callback; t->userdata = userdata; @@ -195,7 +195,7 @@ static AvahiTimeout* timeout_new(const AvahiPoll *api, const struct timeval *tv, static void timeout_update(AvahiTimeout *t, const struct timeval *tv) { assert(t); assert(!t->dead); - + if ((t->enabled = !!tv)) t->expiry = *tv; } @@ -234,10 +234,10 @@ static AvahiTimeout* find_next_timeout(AvahiGLibPoll *g) { assert(g); for (t = g->timeouts; t; t = t->timeouts_next) { - + if (t->dead || !t->enabled) continue; - + if (!n || avahi_timeval_compare(&t->expiry, &n->expiry) < 0) n = t; } @@ -266,7 +266,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) { if (g->timeout_req_cleanup) cleanup_timeouts(g, 0); - + if ((next_timeout = find_next_timeout(g))) { GTimeVal now; struct timeval tvnow; @@ -275,7 +275,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) { g_source_get_current_time(source, &now); tvnow.tv_sec = now.tv_sec; tvnow.tv_usec = now.tv_usec; - + usec = avahi_timeval_diff(&next_timeout->expiry, &tvnow); if (usec <= 0) { @@ -286,7 +286,7 @@ static gboolean prepare_func(GSource *source, gint *timeout) { *timeout = (gint) (usec / 1000); } else *timeout = -1; - + return FALSE; } @@ -303,7 +303,7 @@ static gboolean check_func(GSource *source) { g_source_get_current_time(source, &now); tvnow.tv_sec = now.tv_sec; tvnow.tv_usec = now.tv_usec; - + if (avahi_timeval_compare(&next_timeout->expiry, &tvnow) <= 0) return TRUE; } @@ -311,7 +311,7 @@ static gboolean check_func(GSource *source) { for (w = g->watches; w; w = w->watches_next) if (w->pollfd.revents > 0) return TRUE; - + return FALSE; } @@ -319,7 +319,7 @@ static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc call AvahiGLibPoll* g = (AvahiGLibPoll*) source; AvahiWatch *w; AvahiTimeout *next_timeout; - + g_assert(g); if ((next_timeout = find_next_timeout(g))) { @@ -328,13 +328,13 @@ static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc call g_source_get_current_time(source, &now); tvnow.tv_sec = now.tv_sec; tvnow.tv_usec = now.tv_usec; - + if (avahi_timeval_compare(&next_timeout->expiry, &tvnow) < 0) { start_timeout_callback(next_timeout); return TRUE; } } - + for (w = g->watches; w; w = w->watches_next) if (w->pollfd.revents > 0) { assert(w->callback); @@ -348,7 +348,7 @@ static gboolean dispatch_func(GSource *source, AVAHI_GCC_UNUSED GSourceFunc call AvahiGLibPoll *avahi_glib_poll_new(GMainContext *context, gint priority) { AvahiGLibPoll *g; - + static GSourceFuncs source_funcs = { prepare_func, check_func, @@ -362,22 +362,22 @@ AvahiGLibPoll *avahi_glib_poll_new(GMainContext *context, gint priority) { g_main_context_ref(g->context = context ? context : g_main_context_default()); g->api.userdata = g; - + g->api.watch_new = watch_new; g->api.watch_free = watch_free; g->api.watch_update = watch_update; g->api.watch_get_events = watch_get_events; - + g->api.timeout_new = timeout_new; g->api.timeout_free = timeout_free; g->api.timeout_update = timeout_update; g->watch_req_cleanup = FALSE; g->timeout_req_cleanup = FALSE; - + AVAHI_LLIST_HEAD_INIT(AvahiWatch, g->watches); AVAHI_LLIST_HEAD_INIT(AvahiTimeout, g->timeouts); - + g_source_attach(&g->source, g->context); g_source_set_priority(&g->source, priority); g_source_set_can_recurse(&g->source, FALSE); diff --git a/avahi-glib/glib-watch.h b/avahi-glib/glib-watch.h index 78f7742..cd8cbaa 100644 --- a/avahi-glib/glib-watch.h +++ b/avahi-glib/glib-watch.h @@ -5,17 +5,17 @@ /*** This file is part of avahi. - + avahi is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + avahi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with avahi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -- cgit