On Fri, 11 Feb 2011 08:44:29 +0100 (CET) Vincent Torri <vto...@univ-evry.fr> wrote:
> > > On Thu, 10 Feb 2011, Enlightenment SVN wrote: > > > /** > > + * @brief Return the port that the client has connected to > > + * @param cl The client > > + * @return The port that @p cl has connected to, or -1 on error > > + * Use this function to return the port on which a given client has > > connected. > > + */ > > +EAPI int > > +ecore_con_client_port_get(Ecore_Con_Client *cl) > > +{ > > + if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_CON_CLIENT)) > > + { > > + ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_CON_CLIENT, > > "ecore_con_client_port_get"); > > + return -1; > > + } > > I'm wondering why isn't __FUNCTION__ used, and also why we don't use 2 > macro > > ECORE_CON_MAGIC_CHECK and ECORE_CON_MAGIC_CHECK_RETURN instead of that > code > > ? > > > + if (cl->client_addr->sa_family == AF_INET) > > + return ((struct sockaddr_in*)cl->client_addr)->sin_port; > > + return ((struct sockaddr_in6*)cl->client_addr)->sin6_port; > > +} > > + > > +/** > > * @brief Check how long a client has been connected > > * @param cl The client to check > > * @return The total time, in seconds, that the client has been connected > > to the server > > > > Yes, I've wondered that as well in all the time I've spent working on it haha. I just kept the same style since copy/paste is easy, but it's ugly and I for one welcome our new macro overlords. -- Mike Blumenkrantz Zentific: NULL pointer dereferences now 50% off! ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel