On Thu, 18 Nov 2010 03:02:56 -0200
Rafael Antognolli <[email protected]> wrote:

> On Thu, Nov 18, 2010 at 2:47 AM, Enlightenment SVN
> <[email protected]> wrote:
> > Log:
> >  make client_data_set take const void*
> >
> > Author:       discomfitor
> > Date:         2010-11-17 20:47:34 -0800 (Wed, 17 Nov 2010)
> > New Revision: 54665
> >
> > Modified:
> >  trunk/PROTO/azy/src/include/Azy.h trunk/PROTO/azy/src/lib/azy_client.c
> >
> > Modified: trunk/PROTO/azy/src/include/Azy.h
> > ===================================================================
> > --- trunk/PROTO/azy/src/include/Azy.h   2010-11-18 02:54:12 UTC (rev 54664)
> > +++ trunk/PROTO/azy/src/include/Azy.h   2010-11-18 04:47:34 UTC (rev 54665)
> > @@ -374,7 +374,7 @@
> >    /* client */
> >    void            *azy_client_data_get(Azy_Client *client);
> >    void             azy_client_data_set(Azy_Client *client,
> > -                                         void        *data);
> > +                                        const void *data);
> >    Azy_Client     *azy_client_new(void);
> >    Eina_Bool        azy_client_callback_set(Azy_Client *client,
> >                                              Azy_Client_Call_Id id,
> >
> > Modified: trunk/PROTO/azy/src/lib/azy_client.c
> > ===================================================================
> > --- trunk/PROTO/azy/src/lib/azy_client.c        2010-11-18 02:54:12 UTC
> > (rev 54664) +++ trunk/PROTO/azy/src/lib/azy_client.c        2010-11-18
> > 04:47:34 UTC (rev 54665) @@ -31,7 +31,7 @@
> >  }
> >
> >  void
> > -azy_client_data_set(Azy_Client *client, void *data)
> > +azy_client_data_set(Azy_Client *client, const void *data)
> >  {
> >    DBG("(client=%p)", client);
> >    if (!AZY_MAGIC_CHECK(client, AZY_MAGIC_CLIENT))
> > @@ -39,7 +39,7 @@
> >         AZY_MAGIC_FAIL(client, AZY_MAGIC_CLIENT);
> >         return;
> >      }
> > -   client->data = data;
> > +   client->data = (void*)data;
> >  }
> >
> >  Azy_Client *
> >
> 
> Hey, then why client->data and azy_client_data_get aren't const too?
> 
Because then you'd have to cast away the const every time you did data_get()
which is annoying.  This just informs the user that the function doesn't modify
the data.

-- 
Mike Blumenkrantz
Zentific: Our boolean values are huge.

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to