summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/cf
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-09-05 10:31:52 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-09-05 10:31:52 (GMT)
commitfd064863ebbe90adc24c60df4c3dbf630ec3a6c4 (patch)
tree60d77f56f209d3909b275d760bb4aedc9bd1d243 /Mac/Modules/cf
parent5a1516bce5c9aa6f957f1e93ba85d143d8eac03a (diff)
downloadcpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.zip
cpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.tar.gz
cpython-fd064863ebbe90adc24c60df4c3dbf630ec3a6c4.tar.bz2
Shut up many more gcc warnings.
Diffstat (limited to 'Mac/Modules/cf')
-rw-r--r--Mac/Modules/cf/_CFmodule.c30
-rw-r--r--Mac/Modules/cf/cfsupport.py20
2 files changed, 24 insertions, 26 deletions
diff --git a/Mac/Modules/cf/_CFmodule.c b/Mac/Modules/cf/_CFmodule.c
index 124f9dc..649e437 100644
--- a/Mac/Modules/cf/_CFmodule.c
+++ b/Mac/Modules/cf/_CFmodule.c
@@ -5,8 +5,12 @@
+#ifdef _WIN32
+#include "pywintoolbox.h"
+#else
#include "macglue.h"
#include "pymactoolbox.h"
+#endif
/* Macro to test whether a weak-loaded CFM function exists */
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
@@ -272,7 +276,7 @@ static int CFTypeRefObj_compare(CFTypeRefObject *self, CFTypeRefObject *other)
static PyObject * CFTypeRefObj_repr(CFTypeRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", CFGetTypeID(self->ob_itself), (unsigned long)self, (unsigned long)self->ob_itself);
+ sprintf(buf, "<CFTypeRef type-%d object at 0x%8.8x for 0x%8.8x>", CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -422,7 +426,7 @@ static int CFArrayRefObj_compare(CFArrayRefObject *self, CFArrayRefObject *other
static PyObject * CFArrayRefObj_repr(CFArrayRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFArrayRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFArrayRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -575,7 +579,7 @@ static int CFMutableArrayRefObj_compare(CFMutableArrayRefObject *self, CFMutable
static PyObject * CFMutableArrayRefObj_repr(CFMutableArrayRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFMutableArrayRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFMutableArrayRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -707,7 +711,7 @@ static int CFDictionaryRefObj_compare(CFDictionaryRefObject *self, CFDictionaryR
static PyObject * CFDictionaryRefObj_repr(CFDictionaryRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFDictionaryRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFDictionaryRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -823,7 +827,7 @@ static int CFMutableDictionaryRefObj_compare(CFMutableDictionaryRefObject *self,
static PyObject * CFMutableDictionaryRefObj_repr(CFMutableDictionaryRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFMutableDictionaryRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFMutableDictionaryRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -973,7 +977,7 @@ static int CFDataRefObj_compare(CFDataRefObject *self, CFDataRefObject *other)
static PyObject * CFDataRefObj_repr(CFDataRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFDataRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFDataRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -1096,7 +1100,6 @@ static PyObject *CFMutableDataRefObj_CFDataAppendBytes(CFMutableDataRefObject *_
bytes__in__, bytes__len__);
Py_INCREF(Py_None);
_res = Py_None;
- bytes__error__: ;
return _res;
}
@@ -1118,7 +1121,6 @@ static PyObject *CFMutableDataRefObj_CFDataReplaceBytes(CFMutableDataRefObject *
newBytes__in__, newBytes__len__);
Py_INCREF(Py_None);
_res = Py_None;
- newBytes__error__: ;
return _res;
}
@@ -1171,7 +1173,7 @@ static int CFMutableDataRefObj_compare(CFMutableDataRefObject *self, CFMutableDa
static PyObject * CFMutableDataRefObj_repr(CFMutableDataRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFMutableDataRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFMutableDataRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -1774,7 +1776,7 @@ static int CFStringRefObj_compare(CFStringRefObject *self, CFStringRefObject *ot
static PyObject * CFStringRefObj_repr(CFStringRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFStringRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFStringRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -2061,7 +2063,7 @@ static int CFMutableStringRefObj_compare(CFMutableStringRefObject *self, CFMutab
static PyObject * CFMutableStringRefObj_repr(CFMutableStringRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFMutableStringRef object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFMutableStringRef object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -2433,7 +2435,7 @@ static int CFURLRefObj_compare(CFURLRefObject *self, CFURLRefObject *other)
static PyObject * CFURLRefObj_repr(CFURLRefObject *self)
{
char buf[100];
- sprintf(buf, "<CFURL object at 0x%08.8x for 0x%08.8x>", self, self->ob_itself);
+ sprintf(buf, "<CFURL object at 0x%8.8x for 0x%8.8x>", (unsigned)self, (unsigned)self->ob_itself);
return PyString_FromString(buf);
}
@@ -2590,7 +2592,6 @@ static PyObject *CF_CFDataCreate(PyObject *_self, PyObject *_args)
bytes__in__, bytes__len__);
_res = Py_BuildValue("O&",
CFDataRefObj_New, _rv);
- bytes__error__: ;
return _res;
}
@@ -2611,7 +2612,6 @@ static PyObject *CF_CFDataCreateWithBytesNoCopy(PyObject *_self, PyObject *_args
(CFAllocatorRef)NULL);
_res = Py_BuildValue("O&",
CFDataRefObj_New, _rv);
- bytes__error__: ;
return _res;
}
@@ -2848,7 +2848,6 @@ static PyObject *CF_CFStringCreateWithBytes(PyObject *_self, PyObject *_args)
isExternalRepresentation);
_res = Py_BuildValue("O&",
CFStringRefObj_New, _rv);
- bytes__error__: ;
return _res;
}
@@ -3038,7 +3037,6 @@ static PyObject *CF_CFURLCreateWithBytes(PyObject *_self, PyObject *_args)
baseURL);
_res = Py_BuildValue("O&",
CFURLRefObj_New, _rv);
- URLBytes__error__: ;
return _res;
}
diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py
index 18361fe..af62b66 100644
--- a/Mac/Modules/cf/cfsupport.py
+++ b/Mac/Modules/cf/cfsupport.py
@@ -190,7 +190,7 @@ class MyGlobalObjectDefinition(GlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", CFGetTypeID(self->ob_itself), (unsigned long)self, (unsigned long)self->ob_itself);""")
+ Output("""sprintf(buf, "<CFTypeRef type-%%d object at 0x%%8.8x for 0x%%8.8x>", CFGetTypeID(self->ob_itself), (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -205,7 +205,7 @@ class CFArrayRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFArrayRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFArrayRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -217,7 +217,7 @@ class CFMutableArrayRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFMutableArrayRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFMutableArrayRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -229,7 +229,7 @@ class CFDictionaryRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFDictionaryRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFDictionaryRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -241,7 +241,7 @@ class CFMutableDictionaryRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFMutableDictionaryRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFMutableDictionaryRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -253,7 +253,7 @@ class CFDataRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFDataRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFDataRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -265,7 +265,7 @@ class CFMutableDataRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFMutableDataRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFMutableDataRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -296,7 +296,7 @@ class CFStringRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFStringRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFStringRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -312,7 +312,7 @@ class CFMutableStringRefObjectDefinition(CFStringRefObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFMutableStringRef object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFMutableStringRef object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()
@@ -324,7 +324,7 @@ class CFURLRefObjectDefinition(MyGlobalObjectDefinition):
Output("static PyObject * %s_repr(%s *self)", self.prefix, self.objecttype)
OutLbrace()
Output("char buf[100];")
- Output("""sprintf(buf, "<CFURL object at 0x%%08.8x for 0x%%08.8x>", self, self->ob_itself);""")
+ Output("""sprintf(buf, "<CFURL object at 0x%%8.8x for 0x%%8.8x>", (unsigned)self, (unsigned)self->ob_itself);""")
Output("return PyString_FromString(buf);")
OutRbrace()