[PATCH wayland 1/1] connection: Move wl_interface_equal to util

Bryce Harrington bryce at osg.samsung.com
Wed May 11 18:06:45 UTC 2016


On Tue, May 10, 2016 at 06:08:15PM -0700, Bryce Harrington wrote:
> On Mon, May 09, 2016 at 03:41:14PM +0300, Pekka Paalanen wrote:
> > On Sun,  8 May 2016 08:44:08 -0500
> > Yong Bakos <junk at humanoriented.com> wrote:
> > 
> > > From: Yong Bakos <ybakos at humanoriented.com>
> > > 
> > > Move the wl_interface_equal prototype to the top of wayland-private, where
> > > it is not buried in the middle of map, connection and closure functions.
> > > 
> > > Move the implementation out of connection and into util. This is a utility
> > > function, not specific to connections, and has call sites within connection,
> > > wayland-client and wayland-server.
> > > 
> > > Signed-off-by: Yong Bakos <ybakos at humanoriented.com>
> > > ---
> > >  src/connection.c      | 13 -------------
> > >  src/wayland-private.h |  8 ++++----
> > >  src/wayland-util.c    | 13 +++++++++++++
> > >  3 files changed, 17 insertions(+), 17 deletions(-)
> > > 
> > > diff --git a/src/connection.c b/src/connection.c
> > > index 747229e..c3293a9 100644
> > > --- a/src/connection.c
> > > +++ b/src/connection.c
> > > @@ -798,19 +798,6 @@ wl_connection_demarshal(struct wl_connection *connection,
> > >  }
> > >  
> > >  int
> > > -wl_interface_equal(const struct wl_interface *a, const struct wl_interface *b)
> > > -{
> > > -	/* In most cases the pointer equality test is sufficient.
> > > -	 * However, in some cases, depending on how things are split
> > > -	 * across shared objects, we can end up with multiple
> > > -	 * instances of the interface metadata constants.  So if the
> > > -	 * pointers match, the interfaces are equal, if they don't
> > > -	 * match we have to compare the interface names. */
> > > -
> > > -	return a == b || strcmp(a->name, b->name) == 0;
> > > -}
> > > -
> > > -int
> > >  wl_closure_lookup_objects(struct wl_closure *closure, struct wl_map *objects)
> > >  {
> > >  	struct wl_object *object;
> > > diff --git a/src/wayland-private.h b/src/wayland-private.h
> > > index 994bc45..a9a07a8 100644
> > > --- a/src/wayland-private.h
> > > +++ b/src/wayland-private.h
> > > @@ -55,6 +55,10 @@ struct wl_object {
> > >  extern struct wl_object global_zombie_object;
> > >  #define WL_ZOMBIE_OBJECT ((void*)&global_zombie_object)
> > >  
> > > +int
> > > +wl_interface_equal(const struct wl_interface *iface1,
> > > +		   const struct wl_interface *iface2);
> > > +
> > >  /* Flags for wl_map_insert_new and wl_map_insert_at.  Flags can be queried with
> > >   * wl_map_lookup_flags.  The current implementation has room for 1 bit worth of
> > >   * flags.  If more flags are ever added, the implementation of wl_map will have
> > > @@ -103,10 +107,6 @@ struct wl_connection;
> > >  struct wl_closure;
> > >  struct wl_proxy;
> > >  
> > > -int
> > > -wl_interface_equal(const struct wl_interface *iface1,
> > > -		   const struct wl_interface *iface2);
> > > -
> > >  struct wl_connection *
> > >  wl_connection_create(int fd);
> > >  
> > > diff --git a/src/wayland-util.c b/src/wayland-util.c
> > > index 748476a..5bfb7e1 100644
> > > --- a/src/wayland-util.c
> > > +++ b/src/wayland-util.c
> > > @@ -35,6 +35,19 @@
> > >  
> > >  struct wl_object global_zombie_object;
> > >  
> > > +int
> > > +wl_interface_equal(const struct wl_interface *a, const struct wl_interface *b)
> > > +{
> > > +	/* In most cases the pointer equality test is sufficient.
> > > +	 * However, in some cases, depending on how things are split
> > > +	 * across shared objects, we can end up with multiple
> > > +	 * instances of the interface metadata constants.  So if the
> > > +	 * pointers match, the interfaces are equal, if they don't
> > > +	 * match we have to compare the interface names.
> > > +	 */
> > > +	return a == b || strcmp(a->name, b->name) == 0;
> > > +}
> > > +
> > >  WL_EXPORT void
> > >  wl_list_init(struct wl_list *list)
> > >  {
> > 
> > Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> 
> Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

Pushed:
   e5b12aa..385906b  master -> master


> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v2
> > 
> > iQIVAwUBVzCFcSNf5bQRqqqnAQjtfBAAmOgNH+tI3mDtBCTwTnPfslCyeDHlZmoa
> > JSvXlkyfxUx0C2TmC4pDUI89JB7pEHM1b2m3u8OotMDBgTf9Vawb9pQuCZB0W8MX
> > 406+41f/m4Lbfo6R66wMiec5swHDxIMA2iu2lR42NKoQEAMfHlkA6QPnZhhJhWNv
> > PT0lwIMG7S82x8j3iHOj/faXCG1WnK1zNL7ZAFCp7Ug1i4o2KeEZqpqS2MRDy/T0
> > O6U3tZHLi42vtxXqsWPY6X4/J2YIysbTM4K17IZlkgxiRUstBncoRdNf0Upo5rPc
> > ZaHBO0wmf55uzUNxgTC3Mh1XopgtNn6/jGV7UlW/U3avSv+cNx8x0k0Geq9K1cch
> > 8lX0RxyEyFlPn6pDk9S27wNdh0SLx7yhfpiCms6x+CHCF2mVjSbViM0d4g1VY5Uw
> > gT69+fhvnbdaJygh35oReoo86PZOpR61phWmeQkToXaj+FnEG8Pl5HSTpqG5tARH
> > G0OXoLdTIXC4yJZUVA15KiUB3QKJmYxiryX3LYrlqiCZI0UCPBY1pI59Nczmy7wo
> > IlQiL3PJIOMGNTqL+Fuzn42DPhfbxugxnTeFTlGyDrzPnUUjCpTqAUrc7r+25OCi
> > vb3wKtH6kgCoEJCY8gI9zKy0PpbMg40DIQDpTfC38ee4rDsvLwzfkYyqrOLK/sPO
> > HXM1WjdzO4Q=
> > =yi7J
> > -----END PGP SIGNATURE-----
> 
> 
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list