Py_complex; and WITHOUT_COMPLEX added to getargs.c

This commit is contained in:
Guido van Rossum 1996-07-21 02:27:43 +00:00
parent 519b4339f1
commit 530956d247
4 changed files with 8 additions and 6 deletions

View File

@ -286,7 +286,7 @@ builtin_complex(self, args)
{
object *r, *i;
number_methods *nbr, *nbi;
complex cr, ci;
Py_complex cr, ci;
i = NULL;
if (!newgetargs(args, "O|O:complex", &r, &i))

View File

@ -565,7 +565,7 @@ parsenumber(s)
char *end;
long x;
#ifndef WITHOUT_COMPLEX
complex c;
Py_complex c;
int imflag;
#endif
@ -2500,7 +2500,7 @@ com_arglist(c, n)
name = STR(fp);
else {
name = "";
complex= 1;
complex = 1;
}
com_newlocal(c, name);
c->c_argcount++;

View File

@ -498,16 +498,18 @@ convertsimple1(arg, p_format, p_va)
break;
}
#ifndef WITHOUT_COMPLEX
case 'D': /* complex double */
{
complex *p = va_arg(*p_va, complex *);
complex cval = PyComplex_AsCComplex(arg);
Py_complex *p = va_arg(*p_va, Py_complex *);
Py_complex cval = PyComplex_AsCComplex(arg);
if (err_occurred())
return "complex<D>";
else
*p = cval;
break;
}
#endif /* WITHOUT_COMPLEX */
case 'c': /* char */
{

View File

@ -359,7 +359,7 @@ r_object(p)
{
extern double atof PROTO((const char *));
char buf[256];
complex c;
Py_complex c;
n = r_byte(p);
if (r_string(buf, (int)n, p) != n) {
err_setstr(EOFError,