Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 530956d

Browse files
committed
Py_complex; and WITHOUT_COMPLEX added to getargs.c
1 parent 519b433 commit 530956d

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

Python/bltinmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ builtin_complex(self, args)
286286
{
287287
object *r, *i;
288288
number_methods *nbr, *nbi;
289-
complex cr, ci;
289+
Py_complex cr, ci;
290290

291291
i = NULL;
292292
if (!newgetargs(args, "O|O:complex", &r, &i))

Python/compile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ parsenumber(s)
565565
char *end;
566566
long x;
567567
#ifndef WITHOUT_COMPLEX
568-
complex c;
568+
Py_complex c;
569569
int imflag;
570570
#endif
571571

@@ -2500,7 +2500,7 @@ com_arglist(c, n)
25002500
name = STR(fp);
25012501
else {
25022502
name = "";
2503-
complex= 1;
2503+
complex = 1;
25042504
}
25052505
com_newlocal(c, name);
25062506
c->c_argcount++;

Python/getargs.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,16 +498,18 @@ convertsimple1(arg, p_format, p_va)
498498
break;
499499
}
500500

501+
#ifndef WITHOUT_COMPLEX
501502
case 'D': /* complex double */
502503
{
503-
complex *p = va_arg(*p_va, complex *);
504-
complex cval = PyComplex_AsCComplex(arg);
504+
Py_complex *p = va_arg(*p_va, Py_complex *);
505+
Py_complex cval = PyComplex_AsCComplex(arg);
505506
if (err_occurred())
506507
return "complex<D>";
507508
else
508509
*p = cval;
509510
break;
510511
}
512+
#endif /* WITHOUT_COMPLEX */
511513

512514
case 'c': /* char */
513515
{

Python/marshal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ r_object(p)
359359
{
360360
extern double atof PROTO((const char *));
361361
char buf[256];
362-
complex c;
362+
Py_complex c;
363363
n = r_byte(p);
364364
if (r_string(buf, (int)n, p) != n) {
365365
err_setstr(EOFError,

0 commit comments

Comments
 (0)