On 11/30/2010 3:59 PM, [email protected] wrote:
> Author: fuankg
> Date: Tue Nov 30 21:59:01 2010
> New Revision: 1040791
> 
> URL: http://svn.apache.org/viewvc?rev=1040791&view=rev
> Log:
> Some more casts to make MSVC calm ...
> 
> Modified:
>     httpd/httpd/trunk/support/htcacheclean.c
> 
> Modified: httpd/httpd/trunk/support/htcacheclean.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/trunk/support/htcacheclean.c?rev=1040791&r1=1040790&r2=1040791&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/support/htcacheclean.c (original)
> +++ httpd/httpd/trunk/support/htcacheclean.c Tue Nov 30 21:59:01 2010
> @@ -508,9 +508,9 @@ static int list_urls(char *path, apr_poo
>                                                      " %" APR_TIME_T_FMT
>                                                      " %d %d\n",
>                                                      url,
> -                                                    round_up(hinfo.size, 
> round),
> +                                                    
> round_up((apr_size_t)hinfo.size, round),

Absolutely not.

apr_off_t is nearly always much smaller than apr_size_t.  Conveniently, there is
an APR_OFF_T_FMT at your service to solve this correctly.

The vast majority of casts are used inappropriately.  Appropriate casts should 
be
documented, and you will rarely find one that can't be better addressed by 
correct
normalization of all of the types/function declarations involved.  Since we are
no where near API freeze, there are basically no excuses.

Reply via email to