Merge part of the trunk changes into the p3yk branch. This merges from 43030

(branch-creation time) up to 43067. 43068 and 43069 contain a little
swapping action between re.py and sre.py, and this mightily confuses svn
merge, so later changes are going in separately.

This merge should break no additional tests.

The last-merged revision is going in a 'last_merge' property on '.' (the
branch directory.) Arbitrarily chosen, really; if there's a BCP for this, I
couldn't find it, but we can easily change it afterwards ;)
This commit is contained in:
Thomas Wouters 2006-04-21 09:43:23 +00:00
parent d858f70617
commit a977329b6f
116 changed files with 3409 additions and 709 deletions

View file

@ -3674,7 +3674,11 @@ CreateArrayType(PyObject *itemtype, Py_ssize_t length)
if (cache == NULL)
return NULL;
}
#if (PY_VERSION_HEX < 0x02050000)
key = Py_BuildValue("(Oi)", itemtype, length);
#else
key = Py_BuildValue("(On)", itemtype, length);
#endif
if (!key)
return NULL;
result = PyDict_GetItem(cache, key);
@ -3698,7 +3702,11 @@ CreateArrayType(PyObject *itemtype, Py_ssize_t length)
#endif
result = PyObject_CallFunction((PyObject *)&ArrayType_Type,
#if (PY_VERSION_HEX < 0x02050000)
"s(O){s:i,s:O}",
#else
"s(O){s:n,s:O}",
#endif
name,
&Array_Type,
"_length_",

View file

@ -250,11 +250,21 @@ CField_repr(CFieldObject *self)
name = ((PyTypeObject *)self->proto)->tp_name;
if (bits)
result = PyString_FromFormat("<Field type=%s, ofs=%d:%d, bits=%d>",
name, (int)self->offset, size, bits);
result = PyString_FromFormat(
#if (PY_VERSION_HEX < 0x02050000)
"<Field type=%s, ofs=%d:%d, bits=%d>",
#else
"<Field type=%s, ofs=%zd:%d, bits=%d>",
#endif
name, self->offset, size, bits);
else
result = PyString_FromFormat("<Field type=%s, ofs=%d, size=%d>",
name, (int)self->offset, size);
result = PyString_FromFormat(
#if (PY_VERSION_HEX < 0x02050000)
"<Field type=%s, ofs=%d, size=%d>",
#else
"<Field type=%s, ofs=%zd, size=%d>",
#endif
name, self->offset, size);
return result;
}

View file

@ -1,5 +1,18 @@
/******************************************************************/
#if (PY_VERSION_HEX < 0x02050000)
typedef int Py_ssize_t;
#define lenfunc inquiry
#define readbufferproc getreadbufferproc
#define writebufferproc getwritebufferproc
#define segcountproc getsegcountproc
#define charbufferproc getcharbufferproc
#define ssizeargfunc intargfunc
#define ssizessizeargfunc intintargfunc
#define ssizeobjargproc intobjargproc
#define ssizessizeobjargproc intintobjargproc
#endif
#ifndef MS_WIN32
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))