summaryrefslogtreecommitdiffstats
path: root/Mac
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 /Mac
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 'Mac')
-rwxr-xr-xMac/Modules/carbonevt/_CarbonEvtmodule.c4
-rw-r--r--Mac/Modules/cf/_CFmodule.c4
-rw-r--r--Mac/Modules/gestaltmodule.c9
-rw-r--r--Mac/Modules/qd/_Qdmodule.c5
4 files changed, 6 insertions, 16 deletions
diff --git a/Mac/Modules/carbonevt/_CarbonEvtmodule.c b/Mac/Modules/carbonevt/_CarbonEvtmodule.c
index fee43cc..fd4b266 100755
--- a/Mac/Modules/carbonevt/_CarbonEvtmodule.c
+++ b/Mac/Modules/carbonevt/_CarbonEvtmodule.c
@@ -40,7 +40,7 @@ EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out)
PyMac_GetOSType, &(out->eventClass),
&(out->eventKind)))
return 1;
- return NULL;
+ return 0;
}
/********** end EventTypeSpec *******/
@@ -78,7 +78,7 @@ EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out)
{
if (PyArg_ParseTuple(v, "ll", &out->signature, &out->id))
return 1;
- return NULL;
+ return 0;
}
/********** end EventHotKeyID *******/
diff --git a/Mac/Modules/cf/_CFmodule.c b/Mac/Modules/cf/_CFmodule.c
index 22e9676..5f934c2 100644
--- a/Mac/Modules/cf/_CFmodule.c
+++ b/Mac/Modules/cf/_CFmodule.c
@@ -1329,7 +1329,7 @@ int CFDataRefObj_Convert(PyObject *v, CFDataRef *p_itself)
if (v == Py_None) { *p_itself = NULL; return 1; }
if (PyString_Check(v)) {
char *cStr;
- int cLen;
+ Py_ssize_t cLen;
if( PyString_AsStringAndSize(v, &cStr, &cLen) < 0 ) return 0;
*p_itself = CFDataCreate((CFAllocatorRef)NULL, (unsigned char *)cStr, cLen);
return 1;
@@ -1826,7 +1826,7 @@ int CFStringRefObj_Convert(PyObject *v, CFStringRef *p_itself)
if (PyString_Check(v)) {
char *cStr;
if (!PyArg_Parse(v, "es", "ascii", &cStr))
- return NULL;
+ return 0;
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
return 1;
}
diff --git a/Mac/Modules/gestaltmodule.c b/Mac/Modules/gestaltmodule.c
index f82687e..6d8673f 100644
--- a/Mac/Modules/gestaltmodule.c
+++ b/Mac/Modules/gestaltmodule.c
@@ -33,17 +33,10 @@ static PyObject *
gestalt_gestalt(PyObject *self, PyObject *args)
{
OSErr iErr;
- char *str;
- int size;
OSType selector;
long response;
- if (!PyArg_Parse(args, "s#", &str, &size))
+ if (!PyArg_Parse(args, "O&", PyMac_GetOSType, &selector))
return NULL;
- if (size != 4) {
- PyErr_SetString(PyExc_TypeError, "gestalt arg must be 4-char string");
- return NULL;
- }
- selector = *(OSType*)str;
iErr = Gestalt ( selector, &response );
if (iErr != 0)
return PyMac_Error(iErr);
diff --git a/Mac/Modules/qd/_Qdmodule.c b/Mac/Modules/qd/_Qdmodule.c
index 118dfc4..bfb040f 100644
--- a/Mac/Modules/qd/_Qdmodule.c
+++ b/Mac/Modules/qd/_Qdmodule.c
@@ -5824,7 +5824,6 @@ static PyObject *Qd_MacDrawText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *textBuf__in__;
- int textBuf__len__;
int textBuf__in_len__;
short firstByte;
short byteCount;
@@ -5885,7 +5884,6 @@ static PyObject *Qd_TextWidth(PyObject *_self, PyObject *_args)
PyObject *_res = NULL;
short _rv;
char *textBuf__in__;
- int textBuf__len__;
int textBuf__in_len__;
short firstByte;
short byteCount;
@@ -6471,7 +6469,6 @@ static PyObject *Qd_DrawText(PyObject *_self, PyObject *_args)
{
PyObject *_res = NULL;
char *textBuf__in__;
- int textBuf__len__;
int textBuf__in_len__;
short firstByte;
short byteCount;
@@ -6534,7 +6531,7 @@ static PyObject *Qd_RawBitMap(PyObject *_self, PyObject *_args)
return NULL;
if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
PyErr_Format(PyExc_TypeError,
- "Argument size was %d, should be %d (sizeof BitMap) or %d (sizeof PixMap)",
+ "Argument size was %ld, should be %lu (sizeof BitMap) or %lu (sizeof PixMap)",
PyString_Size(source), sizeof(BitMap), sizeof(PixMap));
return NULL;
}