Unix Technical Forum

Re: [Patch:] restore the native use of isdigit() instead of ap_isdigit() in httpd.

This is a discussion on Re: [Patch:] restore the native use of isdigit() instead of ap_isdigit() in httpd. within the lucky.openbsd.tech forums, part of the OpenBSD category; --> joerg@britannica.bec.de wrote: > On Thu, Mar 30, 2006 at 03:08:11AM -0500, Daniel Ouellet wrote: > >>Here is a patch ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 01:16 PM
Daniel Ouellet
 
Posts: n/a
Default Re: [Patch:] restore the native use of isdigit() instead of ap_isdigit() in httpd.

joerg@britannica.bec.de wrote:
> 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
/include/ctype.h:

__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 can.
I welcome feedback to my education if I miss something obvious. I have a
big red and white target on my belly, shoot away! (:>

Daniel

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:34 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com