Hey Gustavo, eo_data_get_from_type already exists, it's called eo_data_get. eo_data_get already handles everything that's needed to be handled and already reports an error when it's the wrong type.
As for this macro, it looks very bad. I would at the very minimum take "wd = " outside of it, as it's *very* confusing atm. Daniel, any comments on this macro and it's usage/existence in the EFL? On Mon, Dec 17, 2012 at 2:04 PM, Gustavo Sverzut Barbieri < barbi...@profusion.mobi> wrote: > On Mon, Dec 17, 2012 at 11:53 AM, Stefan Schmidt <s.schm...@samsung.com> > wrote: > > Hello. > > > > I'm just investigating some potential NULL dereferencing in elm_widget > and I > > wanted to get an opinion on that from Glima and maybe the EO devs. > > > > The root problem is this macro: > > > > #define ELM_WIDGET_DATA_GET_NO_INST(o, wd) \ > > wd = (o && eo_isa(o, ELM_OBJ_WIDGET_CLASS) ? \ > > eo_data_get(o, ELM_OBJ_WIDGET_CLASS) : \ > > NULL) > > did not look into your patch, but i guess that the above macro is so > common that eo should provide something like that by default: > > wd = eo_data_get_from_type(o, TYPE_CLASS); > > name is open to discussion, but the ability to type check and get its > private data is very good. It could even do the eina_log and warn of > null pointer or wrong type, saving users some repetitive code to do > so. > > -- > Gustavo Sverzut Barbieri > http://profusion.mobi embedded systems > -------------------------------------- > MSN: barbi...@gmail.com > Skype: gsbarbieri > Mobile: +55 (19) 9225-2202 > > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- Tom. ------------------------------------------------------------------------------ LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel