[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch:] restore the native use of isdigit() instead of ap_isdigit() in httpd.
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: Re: [Patch:] restore the native use of isdigit() instead of ap_isdigit() in httpd.
- From: Daniel Ouellet <daniel_(_at_)_presscom_(_dot_)_net>
- Date: Thu, 30 Mar 2006 14:44:19 -0500
On Thu, Mar 30, 2006 at 03:08:11AM -0500, Daniel Ouellet wrote:
Here is a patch to restore the use of the native isdigit() instead of
the ap_isdigit one.
Have you checked that the arguments are always from the unsigned char
domain? Even though OpenBSD's isdigit handles it internally, it is more
efficient when the compiler can drop one conditional.
What I did is to check how it was process by the macro in the
__CTYPE_INLINE int isdigit(int c)
return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
Then apache cast the type to (unsigned char) before calling it and here
it's done in the macro of the system as well. The cast result is the
same here no? Because it is a macro, it would be replace before been
compile anyway no? So, the conditional would be drop no matter what.
May be there is something else I don't think of in the compile process.
Macro are replace by the pre processor no?
Just to be clean however, I am not at the stage yet to correct a lots of
problem if any in the code, I am still trying to clean it up as much as
I welcome feedback to my education if I miss something obvious. I have a
big red and white target on my belly, shoot away! (:>
Visit your host, monkey.org