summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-04-21 10:40:58 (GMT)
committerThomas Wouters <thomas@python.org>2006-04-21 10:40:58 (GMT)
commit49fd7fa4431da299196d74087df4a04f99f9c46f (patch)
tree35ace5fe78d3d52c7a9ab356ab9f6dbf8d4b71f4 /Objects/floatobject.c
parent9ada3d6e29d5165dadacbe6be07bcd35cfbef59d (diff)
downloadcpython-49fd7fa4431da299196d74087df4a04f99f9c46f.zip
cpython-49fd7fa4431da299196d74087df4a04f99f9c46f.tar.gz
cpython-49fd7fa4431da299196d74087df4a04f99f9c46f.tar.bz2
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described here (it's not a Py3K issue, just something Py3K discovers): http://mail.python.org/pipermail/python-dev/2006-April/064051.html Hye-Shik Chang promised to look for a fix, so no need to fix it here. The tests that are expected to break are: test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecs test_multibytecodec This merge fixes an actual test failure (test_weakref) in this branch, though, so I believe merging is the right thing to do anyway.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 20ed86e..8708690 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -97,7 +97,7 @@ PyFloat_FromString(PyObject *v, char **pend)
}
#ifdef Py_USING_UNICODE
else if (PyUnicode_Check(v)) {
- if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) {
+ if (PyUnicode_GET_SIZE(v) >= (Py_ssize_t)sizeof(s_buffer)) {
PyErr_SetString(PyExc_ValueError,
"Unicode float() literal too long to convert");
return NULL;
@@ -940,21 +940,21 @@ float_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static PyObject *
float_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
- PyObject *tmp, *new;
+ PyObject *tmp, *newobj;
assert(PyType_IsSubtype(type, &PyFloat_Type));
tmp = float_new(&PyFloat_Type, args, kwds);
if (tmp == NULL)
return NULL;
assert(PyFloat_CheckExact(tmp));
- new = type->tp_alloc(type, 0);
- if (new == NULL) {
+ newobj = type->tp_alloc(type, 0);
+ if (newobj == NULL) {
Py_DECREF(tmp);
return NULL;
}
- ((PyFloatObject *)new)->ob_fval = ((PyFloatObject *)tmp)->ob_fval;
+ ((PyFloatObject *)newobj)->ob_fval = ((PyFloatObject *)tmp)->ob_fval;
Py_DECREF(tmp);
- return new;
+ return newobj;
}
static PyObject *
@@ -1106,12 +1106,12 @@ Convert a string or number to a floating point number, if possible.");
static PyNumberMethods float_as_number = {
- (binaryfunc)float_add, /*nb_add*/
- (binaryfunc)float_sub, /*nb_subtract*/
- (binaryfunc)float_mul, /*nb_multiply*/
- (binaryfunc)float_rem, /*nb_remainder*/
- (binaryfunc)float_divmod, /*nb_divmod*/
- (ternaryfunc)float_pow, /*nb_power*/
+ float_add, /*nb_add*/
+ float_sub, /*nb_subtract*/
+ float_mul, /*nb_multiply*/
+ float_rem, /*nb_remainder*/
+ float_divmod, /*nb_divmod*/
+ float_pow, /*nb_power*/
(unaryfunc)float_neg, /*nb_negative*/
(unaryfunc)float_pos, /*nb_positive*/
(unaryfunc)float_abs, /*nb_absolute*/
@@ -1122,10 +1122,10 @@ static PyNumberMethods float_as_number = {
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
- (coercion)float_coerce, /*nb_coerce*/
- (unaryfunc)float_int, /*nb_int*/
- (unaryfunc)float_long, /*nb_long*/
- (unaryfunc)float_float, /*nb_float*/
+ float_coerce, /*nb_coerce*/
+ float_int, /*nb_int*/
+ float_long, /*nb_long*/
+ float_float, /*nb_float*/
0, /* nb_oct */
0, /* nb_hex */
0, /* nb_inplace_add */
@@ -1170,7 +1170,7 @@ PyTypeObject PyFloat_Type = {
float_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
- (richcmpfunc)float_richcompare, /* tp_richcompare */
+ float_richcompare, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */