Few suggestions

nsf no.smile.face at gmail.com
Wed Jun 18 02:26:54 CEST 2008


On Tue, 17 Jun 2008 15:45:07 -0700
nsf <no.smile.face at gmail.com> wrote:

> Hi.
> 
> I want to suggest few possible improvements that developers can do in
> libev.
> 
> 1) Include pkg-config .pc file to source distribution.
> 2) I wanted to compile my project (which is using libev) with -Wall and
> without any warnings, but there is few bad macros in libev.h. So, I was
> forced to remove all these macros and change them to ugly code.
> You can see in this commit what I mean:
> http://github.com/nsf/bmpanel/commit/60f74645be5e234f778d43621cbfc59d9f9d6cd8
> (just search with browser string "ev_io_init" and look around)
> 
> I'm not a pro in C, but why are you using these type conversions in
> macros:
> 
> -----------------------------------------------
> #define ev_init(ev,cb_) do {			\
>   ((ev_watcher *)(void *)(ev))->active   =	\
>   ((ev_watcher *)(void *)(ev))->pending  =	\
>   ((ev_watcher *)(void *)(ev))->priority = 0;	\
>   ev_set_cb ((ev), cb_);			\
> } while (0)
> -----------------------------------------------
> 
> and
> 
> -----------------------------------------------
> #define ev_timer_set(ev,after_,repeat_)     do { ((ev_watcher_time *)(ev))->at = (after_); (ev)->repeat = (repeat_); } while (0)
> -----------------------------------------------
> 
> They will work without them. And also there will be no warnings in -Wall
> mode.
> 
> I'm using gcc 4.3.0.
> 
> Thank you for your attention. :)

Here is the patch for libev-3.42 which adds pkg-config support. Well,
if you need it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libev-3.42-pkgconfig.patch
Type: text/x-patch
Size: 1280 bytes
Desc: not available
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20080617/73c9e0ca/attachment.bin>


More information about the libev mailing list