Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16644
Modified Files:
Tag: py3k
PyDSBUFFERDESC.cpp PyDSCBUFFERDESC.cpp directsound.cpp
Log Message:
Call PyType_Ready, fix conversion of attr names
Index: PyDSBUFFERDESC.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp,v
retrieving revision 1.3.4.1
retrieving revision 1.3.4.2
diff -C2 -d -r1.3.4.1 -r1.3.4.2
*** PyDSBUFFERDESC.cpp 29 Aug 2008 08:32:34 -0000 1.3.4.1
--- PyDSBUFFERDESC.cpp 7 Sep 2008 02:21:10 -0000 1.3.4.2
***************
*** 153,158 ****
{
PyDSBUFFERDESC *obself = (PyDSBUFFERDESC*)self;
! char *name=PyString_AsString(obname);
!
if (name==NULL)
return -1;
--- 153,157 ----
{
PyDSBUFFERDESC *obself = (PyDSBUFFERDESC*)self;
! char *name=PYWIN_ATTR_CONVERT(obname);
if (name==NULL)
return -1;
Index: PyDSCBUFFERDESC.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/PyDSCBUFFERDESC.cpp,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -C2 -d -r1.2.4.1 -r1.2.4.2
*** PyDSCBUFFERDESC.cpp 29 Aug 2008 08:32:34 -0000 1.2.4.1
--- PyDSCBUFFERDESC.cpp 7 Sep 2008 02:21:10 -0000 1.2.4.2
***************
*** 141,145 ****
{
PyDSCBUFFERDESC *obself = (PyDSCBUFFERDESC*)self;
! char *name=PyString_AsString(obname);
if (name==NULL)
--- 141,145 ----
{
PyDSCBUFFERDESC *obself = (PyDSCBUFFERDESC*)self;
! char *name=PYWIN_ATTR_CONVERT(obname);
if (name==NULL)
Index: directsound.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/directsound.cpp,v
retrieving revision 1.8.4.1
retrieving revision 1.8.4.2
diff -C2 -d -r1.8.4.1 -r1.8.4.2
*** directsound.cpp 29 Aug 2008 08:32:34 -0000 1.8.4.1
--- directsound.cpp 7 Sep 2008 02:21:10 -0000 1.8.4.2
***************
*** 237,253 ****
};
- static int AddConstant(PyObject *dict, const char *key, long value)
- {
- PyObject *oval = PyInt_FromLong(value);
- if (!oval)
- {
- return 1;
- }
- int rc = PyDict_SetItemString(dict, (char*)key, oval);
- Py_DECREF(oval);
- return rc;
- }
! #define ADD_CONSTANT(tok) AddConstant(dict, #tok, tok)
static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] =
--- 237,242 ----
};
! #define ADD_CONSTANT(tok) if (PyModule_AddIntConstant(module, #tok, tok) == -1) RETURN_ERROR;
static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] =
***************
*** 272,283 ****
#if (PY_VERSION_HEX < 0x03000000)
module = Py_InitModule("directsound", directsound_methods);
- if (!module)
- return;
- dict = PyModule_GetDict(module);
- if (!dict)
- return;
#else
!
static PyModuleDef directsound_def = {
PyModuleDef_HEAD_INIT,
--- 261,268 ----
#if (PY_VERSION_HEX < 0x03000000)
+ #define RETURN_ERROR return;
module = Py_InitModule("directsound", directsound_methods);
#else
! #define RETURN_ERROR return NULL;
static PyModuleDef directsound_def = {
PyModuleDef_HEAD_INIT,
***************
*** 288,297 ****
};
module = PyModule_Create(&directsound_def);
if (!module)
! return NULL;
dict = PyModule_GetDict(module);
if (!dict)
! return NULL;
! #endif
// Register all of our interfaces, gateways and IIDs.
--- 273,284 ----
};
module = PyModule_Create(&directsound_def);
+ #endif
+
if (!module)
! RETURN_ERROR;
dict = PyModule_GetDict(module);
if (!dict)
! RETURN_ERROR;
!
// Register all of our interfaces, gateways and IIDs.
***************
*** 418,427 ****
ADD_CONSTANT(DSBPN_OFFSETSTOP);
! PyDict_SetItemString(dict, "DSCAPSType", (PyObject *)&PyDSCAPSType);
! PyDict_SetItemString(dict, "DSBCAPSType", (PyObject *)&PyDSBCAPSType);
! PyDict_SetItemString(dict, "DSBUFFERDESCType", (PyObject *)&PyDSBUFFERDESCType);
! PyDict_SetItemString(dict, "DSCCAPSType", (PyObject *)&PyDSCCAPSType);
! PyDict_SetItemString(dict, "DSCBCAPSType", (PyObject *)&PyDSCBCAPSType);
! PyDict_SetItemString(dict, "DSCBUFFERDESCType", (PyObject *)&PyDSCBUFFERDESCType);
#if (PY_VERSION_HEX >= 0x03000000)
--- 405,421 ----
ADD_CONSTANT(DSBPN_OFFSETSTOP);
! if (PyType_Ready(&PyDSCAPSType) == -1
! ||PyType_Ready(&PyDSBCAPSType) == -1
! ||PyType_Ready(&PyDSBUFFERDESCType) == -1
! ||PyType_Ready(&PyDSCCAPSType) == -1
! ||PyType_Ready(&PyDSCBCAPSType) == -1
! ||PyType_Ready(&PyDSCBUFFERDESCType) == -1
! ||PyDict_SetItemString(dict, "DSCAPSType", (PyObject *)&PyDSCAPSType) == -1
! ||PyDict_SetItemString(dict, "DSBCAPSType", (PyObject *)&PyDSBCAPSType) == -1
! ||PyDict_SetItemString(dict, "DSBUFFERDESCType", (PyObject *)&PyDSBUFFERDESCType) == -1
! ||PyDict_SetItemString(dict, "DSCCAPSType", (PyObject *)&PyDSCCAPSType) == -1
! ||PyDict_SetItemString(dict, "DSCBCAPSType", (PyObject *)&PyDSCBCAPSType) == -1
! ||PyDict_SetItemString(dict, "DSCBUFFERDESCType", (PyObject *)&PyDSCBUFFERDESCType) == -1)
! RETURN_ERROR;
#if (PY_VERSION_HEX >= 0x03000000)
|