From: Ian Campbell Subject: Re: [PATCH 07/23] libxl: events: const-correct *_inuse, *_isregistered Date: Thu, 19 Dec 2013 13:01:16 +0000 Message-ID: <1387458076.9925.66.camel@kazak.uk.xensource.com> References: <1387305337-15355-1-git-send-email-ian.jackson@eu.citrix.com> <1387305337-15355-8-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1387305337-15355-8-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Shriram Rajagopalan , George Dunlap , xen-devel@lists.xensource.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, 2013-12-17 at 18:35 +0000, Ian Jackson wrote: > The comments for libxl__ev_time_isregistered and the corresponding > watch function even say that these should be const. Make it so. > > Also fix libxl__ev_child_inuse and libxl__ev_spawn_inuse. > > Signed-off-by: Ian Jackson > CC: Stefano Stabellini Acked-by: Ian Campbell > --- > tools/libxl/libxl_internal.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 2712005..51d6c6d 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > @@ -716,7 +716,7 @@ _hidden int libxl__ev_fd_modify(libxl__gc*, libxl__ev_fd *ev, > _hidden void libxl__ev_fd_deregister(libxl__gc*, libxl__ev_fd *ev); > static inline void libxl__ev_fd_init(libxl__ev_fd *efd) > { efd->fd = -1; } > -static inline int libxl__ev_fd_isregistered(libxl__ev_fd *efd) > +static inline int libxl__ev_fd_isregistered(const libxl__ev_fd *efd) > { return efd->fd >= 0; } > > _hidden int libxl__ev_time_register_rel(libxl__gc*, libxl__ev_time *ev_out, > @@ -732,7 +732,7 @@ _hidden int libxl__ev_time_modify_abs(libxl__gc*, libxl__ev_time *ev, > _hidden void libxl__ev_time_deregister(libxl__gc*, libxl__ev_time *ev); > static inline void libxl__ev_time_init(libxl__ev_time *ev) > { ev->func = 0; } > -static inline int libxl__ev_time_isregistered(libxl__ev_time *ev) > +static inline int libxl__ev_time_isregistered(const libxl__ev_time *ev) > { return !!ev->func; } > > > @@ -772,7 +772,7 @@ _hidden pid_t libxl__ev_child_fork(libxl__gc *gc, libxl__ev_child *childw_out, > libxl__ev_child_callback *death); > static inline void libxl__ev_child_init(libxl__ev_child *childw_out) > { childw_out->pid = -1; } > -static inline int libxl__ev_child_inuse(libxl__ev_child *childw_out) > +static inline int libxl__ev_child_inuse(const libxl__ev_child *childw_out) > { return childw_out->pid >= 0; } > > /* Useable (only) in the child to once more make the ctx useable for > @@ -1213,7 +1213,7 @@ struct libxl__spawn_state { > libxl__ev_xswatch xswatch; > }; > > -static inline int libxl__spawn_inuse(libxl__spawn_state *ss) > +static inline int libxl__spawn_inuse(const libxl__spawn_state *ss) > { return libxl__ev_child_inuse(&ss->mid); } > > /*