On Sun, 14 Mar 2010 12:33:20 -0300 Gustavo Sverzut Barbieri <barbi...@profusion.mobi> said:
> On Sun, Mar 14, 2010 at 11:49 AM, Carsten Haitzler <ras...@rasterman.com> > wrote: > > On Sun, 14 Mar 2010 10:20:11 -0300 Gustavo Sverzut Barbieri > > <barbi...@profusion.mobi> said: > > > >> On Sun, Mar 14, 2010 at 12:48 AM, Enlightenment SVN > >> <no-re...@enlightenment.org> wrote: > >> > Log: > >> > fix more runtime wornings... added ELM_ERROR_ABORT! :) > >> > >> couldn't/shouldn't you use the EINA_MAGIC or EINA_SAFETY macros and > >> then get the same system there as well? I'm thinking about this being > >> used in Ecore and Evas as well. > >> > >> This is a case for the eina_magic. > > > > eina_magic is not useful - no magic numbers for checking. it's literally > > checking types. and types are strings (but that happens to work with a > > pointer comparison due to stringshare). and eina_safety macros simply dont > > output useful information in the same way - as literally the strings need > > to be printed - not the "inline in the code" expression (as one is a > > dynamic return from a func). what's there now works well. i don't see a > > need to do much more and throw everything into eina for what is a > > case-specific checking and output. > > well, eina magic does print strings, but yeah, the magic number is not > dynamically allocated... maybe something that we could add to > eina_magic... in the same fashion as ecore_event_type_new(), have an > eina_magic_number_new()? there is little point - the check is a "if this fails - complain". it's an if... in a macro. total over-engineering. its getting the type string - it possibly could use strcmp. it happens not to though. but u'd have to make it do that - and then all u do is have to allow aribtrary code to do the check - then arbitrary code to handle the complaint output - at that point your macro is a glorified if (x) then y; else z; - no point. > Another option, we could use the same thing and use the stringshare > pointer as the magic number, that would work nicely as well. but the magic number isnt put into a struct ala eina_magic. there is little point in trying to over-engineer what is a 1 line macro and then the "custom handler" func we already now have. -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel