mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Moved get*doublearg() routines to modsupport.c
This commit is contained in:
parent
4a450d06c7
commit
5b7f945bc3
1 changed files with 0 additions and 29 deletions
|
@ -35,35 +35,6 @@ extern int errno;
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
static int
|
|
||||||
getdoublearg(args, px)
|
|
||||||
register object *args;
|
|
||||||
double *px;
|
|
||||||
{
|
|
||||||
if (args == NULL)
|
|
||||||
return err_badarg();
|
|
||||||
if (is_floatobject(args)) {
|
|
||||||
*px = getfloatvalue(args);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (is_intobject(args)) {
|
|
||||||
*px = getintvalue(args);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return err_badarg();
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
get2doublearg(args, px, py)
|
|
||||||
register object *args;
|
|
||||||
double *px, *py;
|
|
||||||
{
|
|
||||||
if (args == NULL || !is_tupleobject(args) || gettuplesize(args) != 2)
|
|
||||||
return err_badarg();
|
|
||||||
return getdoublearg(gettupleitem(args, 0), px) &&
|
|
||||||
getdoublearg(gettupleitem(args, 1), py);
|
|
||||||
}
|
|
||||||
|
|
||||||
static object *
|
static object *
|
||||||
math_1(args, func)
|
math_1(args, func)
|
||||||
object *args;
|
object *args;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue