mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Get rid of some warnings.
This commit is contained in:
parent
d5b0c9b87e
commit
c3264e50e7
1 changed files with 2 additions and 2 deletions
|
|
@ -1329,7 +1329,7 @@ int CFDataRefObj_Convert(PyObject *v, CFDataRef *p_itself)
|
||||||
if (v == Py_None) { *p_itself = NULL; return 1; }
|
if (v == Py_None) { *p_itself = NULL; return 1; }
|
||||||
if (PyString_Check(v)) {
|
if (PyString_Check(v)) {
|
||||||
char *cStr;
|
char *cStr;
|
||||||
int cLen;
|
Py_ssize_t cLen;
|
||||||
if( PyString_AsStringAndSize(v, &cStr, &cLen) < 0 ) return 0;
|
if( PyString_AsStringAndSize(v, &cStr, &cLen) < 0 ) return 0;
|
||||||
*p_itself = CFDataCreate((CFAllocatorRef)NULL, (unsigned char *)cStr, cLen);
|
*p_itself = CFDataCreate((CFAllocatorRef)NULL, (unsigned char *)cStr, cLen);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -1826,7 +1826,7 @@ int CFStringRefObj_Convert(PyObject *v, CFStringRef *p_itself)
|
||||||
if (PyString_Check(v)) {
|
if (PyString_Check(v)) {
|
||||||
char *cStr;
|
char *cStr;
|
||||||
if (!PyArg_Parse(v, "es", "ascii", &cStr))
|
if (!PyArg_Parse(v, "es", "ascii", &cStr))
|
||||||
return NULL;
|
return 0;
|
||||||
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
|
*p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue