apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: cvs commit: apr-util/buckets apr_brigade.c
Date Wed, 03 Jul 2002 14:57:30 GMT
William A. Rowe, Jr. wrote:
> At 01:32 PM 7/2/2002, Cliff Woolley wrote:
> 
>> On 2 Jul 2002 wrowe@apache.org wrote:
>>
>> > wrowe       2002/07/02 11:20:57
>> >
>> >   Modified:    buckets  apr_brigade.c
>> >   Log:
>> >     New emit on win32.  Since this is a heap bucket, we are always 
>> dealing
>> >     in start offsets that fit in apr_size_t.  This doesn't need the 
>> file
>> >     sized apr_off_t resolution.
>> >
>> >   -        remaining = h->alloc_len - (e->length + e->start);
>> >   +        /* HEAP bucket start offsets are always in-memory, safe 
>> to cast */
>> >   +        remaining = h->alloc_len - (e->length + 
>> (apr_size_t)e->start);
>> >            buf = h->base + e->start + e->length;
>> >        }
>>
>> Okay, so why on earth would the remaining= line need that cast when the
>> buf= line doesn't?
> 
> 
> Amazing, these compilers ;)
> 
>> Just curious.
> 
> 
> Me too :-)

Well, the obvious answer would be that in the second case, e->start is 
added to h->base (a pointer) and in the first to e->length (not a pointer).

Cheers,

Ben.

-- 
http://www.apache-ssl.org/ben.html       http://www.thebunker.net/

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff


Mime
View raw message