[PATCH] print format for nevents

Maxim Dounin mdounin at mdounin.ru
Wed Aug 6 16:04:53 UTC 2014


Hello!

On Wed, Aug 06, 2014 at 10:22:10AM -0400, crespin wrote:

> Hello,
> 
> nevents is an ngx_int_t, so the print format must be "%i".

Both signed and unsigned ngx_[u]int_t has the same size, so that's 
more about preferable representation of numbers, not about 
correctness of the code.

In this particular case I think that %ui is better, as negative 
numbers shouldn't be here, and logging them with %ui will make 
them clearly visible as very big positive numbers.  It's also what 
will be used in the actual poll() syscall.

For future reference, please also take a look at the following 
link:

http://nginx.org/en/docs/contributing_changes.html

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list