Skip to content

Commit

Permalink
promote float to double va va_arg()...
Browse files Browse the repository at this point in the history
intel and pcc does not support va_arg float arguments. Sounds weird but
so it is.
float still has problems
  • Loading branch information
Reini Urban committed Sep 12, 2012
1 parent a38401c commit 6a80df4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/call/args.c
@@ -1,5 +1,5 @@
/*
Copyright (C) 2001-2011, Parrot Foundation.
Copyright (C) 2001-2012, Parrot Foundation.
=head1 NAME
Expand Down Expand Up @@ -622,7 +622,12 @@ set_call_from_varargs(PARROT_INTERP,
VTABLE_push_integer(interp, signature, va_arg(*args, INTVAL));
break;
case 'N':
#if FLOATTYPE == FLOATTYPE_4
/* Cannot pass float through va_arg */
VTABLE_push_float(interp, signature, va_arg(*args, double));
#else
VTABLE_push_float(interp, signature, va_arg(*args, FLOATVAL));
#endif
break;
case '-':
return;
Expand Down Expand Up @@ -744,7 +749,12 @@ Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, ARGIN_NULLOK(PMC *obj),
VTABLE_push_integer(interp, call_object, va_arg(args, INTVAL));
break;
case 'N':
#if FLOATTYPE == FLOATTYPE_4
/* Cannot pass float through va_arg */
VTABLE_push_float(interp, call_object, va_arg(args, double));
#else
VTABLE_push_float(interp, call_object, va_arg(args, FLOATVAL));
#endif
break;
case 'S':
VTABLE_push_string(interp, call_object, va_arg(args, STRING *));
Expand Down
6 changes: 5 additions & 1 deletion src/string/spf_vtable.c
@@ -1,5 +1,5 @@
/*
Copyright (C) 2001-2009, Parrot Foundation.
Copyright (C) 2001-2012, Parrot Foundation.
=head1 NAME
Expand Down Expand Up @@ -322,7 +322,11 @@ getfloat_va(PARROT_INTERP, INTVAL size, ARGIN(SPRINTF_OBJ *obj))
return (HUGEFLOATVAL)(HUGEFLOATVAL) va_arg(*arg, HUGEFLOATVAL);

case SIZE_XVAL:
#if FLOATTYPE == FLOATTYPE_4
return (HUGEFLOATVAL)(FLOATVAL) va_arg(*arg, double);
#else
return (HUGEFLOATVAL)(FLOATVAL) va_arg(*arg, FLOATVAL);
#endif

case SIZE_PMC:
{
Expand Down
Binary file modified t/native_pbc/number_8_8_le.pbc
Binary file not shown.

0 comments on commit 6a80df4

Please sign in to comment.