httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c
Date Mon, 03 Oct 2005 11:50:39 GMT
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. 

>  
> -            pid = (pid_t)apr_hash_get(script_hash, &cgid_req.conn_id, sizeof(cgid_req.conn_id));
> +            pid = (pid_t)((long)apr_hash_get(script_hash, &cgid_req.conn_id, sizeof(cgid_req.conn_id)));

>                  apr_hash_set(script_hash, key, sizeof(cgid_req.conn_id),
> -                             (void *)procnew->pid);
> +                             (void *)((long)procnew->pid));
>              }
>  {
> -    int fd = (int)thefd;
> +    int fd = (int)((long)thefd);
>      
>          else {
> -            apr_pool_cleanup_register(r->pool, (void *)sd, close_unix_socket,
> -                                      apr_pool_cleanup_null);
> +            apr_pool_cleanup_register(r->pool, (void *)((long)sd),
> +                                      close_unix_socket, apr_pool_cleanup_null);
>              break; /* we got connected! */
>          }

Same when I see sequential casts... What's the rationale for them?
-- 
=======================================================================
 Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
           "If you can dodge a wrench, you can dodge a ball."

Mime
View raw message