[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH]fixing the long long problem for the perl-swig bindings.

From: Ben Reser <ben_at_reser.org>
Date: 2004-03-17 19:59:33 CET

On Wed, Mar 17, 2004 at 12:57:33PM +0100, Patrick Mayweg wrote:
> Hi,
> the problem with using the non standard types "long long" and "unsigned
> long long" happens also to be in subversion/bindings/swig/swigutil_pl.c.
> This patch replace all the system dependend types and printf format
> strings with the apr types and macros.
> [[
> * swigutil.c (svn_swig_pl_callback_thunk)
> replace the non standard types and printf format string with their
> apr counterparts
> ]]
>
> Index: swigutil_pl.c
> ===================================================================
> --- swigutil_pl.c (revision 9065)
> +++ swigutil_pl.c (working copy)
> @@ -312,14 +312,14 @@
> * it available as a string. If not then perl will convert
> * it to an IV for us. So this handles the problem gracefully */
> c = malloc(30);
> - snprintf(c,30,"%lld",va_arg(ap, long long));
> + snprintf(c,30,"%" APR_INT64_T_FMT,va_arg(ap, apr_int64_t));
> XPUSHs(sv_2mortal(newSVpv(c, 0)));
> free(c);
> break;
>
> case 'U': /* unsigned long long */
> c = malloc(30);
> - snprintf(c,30,"%llu",va_arg(ap, unsigned long long));
> + snprintf(c,30,"%"APR_INT64_T_FMT,va_arg(ap, apr_uint64_t));
> XPUSHs(sv_2mortal(newSVpv(c, 0)));
> free(c);
> break;

I need to seriously sit down and rework this code. I did a little fixup
on it to get around int vs long sizes but I really should handle apr
types better. I think there may be cases where we're actually passing C
types into this function and sometimes apr types. So before I make this
change I want to actually sit down and track all of these down and look
at them. I also want to update the documentation too.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 17 20:00:03 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.