httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c
Date Mon, 03 Oct 2005 11:58:45 GMT
On Mon, Oct 03, 2005 at 07:50:39AM -0400, Jim Jagielski wrote:
> Just some lines that caught my eye:
> 
> >  
> > -    *context = (void *)(value == 'T');
> > +    *context = (void *)((long)(value == 'T'));
> >  
> > -    int value = context != NULL;
> > +    long value = context != NULL;
> >      apr_fileperms_t perms = resource->info->finfo.protection;
> > -    int old_value = (perms & APR_UEXECUTE) != 0;
> > +    long old_value = (perms & APR_UEXECUTE) != 0;
> >  
> 
> Huh? Whenever I see conditionals cast to (long) I get
> suspicious. 

These are all cases where an integer is stored in a pointer; it's safe 
to assume that a long will fit in a pointer on all platforms which httpd 
runs on as a practical consideration, and using a cast to long rather 
than a cast to int will avoid compiler warnings on LP64 platforms.

joe

Mime
View raw message