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; object *r, *i;
number_methods *nbr, *nbi; number_methods *nbr, *nbi;
complex cr, ci; Py_complex cr, ci;
i = NULL; i = NULL;
if (!newgetargs(args, "O|O:complex", &r, &i)) if (!newgetargs(args, "O|O:complex", &r, &i))

View file

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

View file

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

View file

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