httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Gruno <rum...@cord.dk>
Subject Re: svn commit: r1523974 - in /httpd/httpd/branches/2.4.x: docs/manual/mod/mod_lua.xml modules/lua/lua_request.c modules/lua/mod_lua.c
Date Wed, 18 Sep 2013 08:10:32 GMT
On 09/18/2013 01:17 AM, Yann Ylavic wrote:
> On Tue, Sep 17, 2013 at 12:38 PM, <humbedooh@apache.org
> <mailto:humbedooh@apache.org>> wrote:
> 
>     Author: humbedooh
>     Date: Tue Sep 17 10:38:12 2013
>     New Revision: 1523974
> 
>     <...>
> 
> 
>     +static apr_uint64_t ap_ntoh64(const apr_uint64_t *input)
>     +{
>     +    apr_uint64_t rval;
>     +    unsigned char *data = (unsigned char *)&rval;
>     +
>     +    data[0] = *input >> 56;
>     +    data[1] = *input >> 48;
>     +    data[2] = *input >> 40;
>     +    data[3] = *input >> 32;
>     +    data[4] = *input >> 24;
>     +    data[5] = *input >> 16;
>     +    data[6] = *input >> 8;
>     +    data[7] = *input >> 0;
>     +
>     +    return rval;
>     +}
> 
> 
> Isn't that code byte-order dependent
>  
> (eg. simply "return *input" when big-endian)
> ?
> 
This is one of the things I enjoy about httpd - there's always someone
there to spot bugs or missing snippets :) Thanks for the heads up, I've
added a big endian check in the function now.

With regards,
Daniel.

Mime
View raw message