httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: [apreq-2] apreq.c warning
Date Mon, 21 Apr 2003 03:42:54 GMT
Randy Kobes wrote:
> The following diff:
> 
> ===================================================
> Index: apreq.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-apreq-2/src/apreq.c,v
> retrieving revision 1.12
> diff -u -r1.12 apreq.c
> --- apreq.c	19 Apr 2003 09:42:08 -0000	1.12
> +++ apreq.c	20 Apr 2003 04:02:32 -0000
> @@ -166,11 +166,11 @@
>  
>  APREQ_DECLARE(long) apreq_atol(const char *s) 
>  {
> -    apr_int64_t n = 0;
> +    long n = 0;
>      char *p;
>      if (s == NULL)
>          return 0;
> -    n = apr_strtoi64(s, &p, 0); /* XXX: what about overflow? */
> +    n = (long) apr_strtoi64(s, &p, 0); /* XXX: what about overflow? */
>  
>      if (p == NULL)
>          return n;
> ===============================================================
> avoids warnings about a conversion from __int64 to long with 
> VC++ on Win32.

Or, alternatively use:

-  APREQ_DECLARE(long) apreq_atol(const char *s)
+  APREQ_DECLARE(apr_int64_t) apreq_atol(const char *s)

it's probably better to stick to apr types, rather than convert back and force.

Of course this will require to adjust the types in the callers of this function...

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message