Mercurial > hg > vampy
changeset 46:af9c4cee95a8
VC++ fixes.
Much of this is changing "and" to "&&". I had never realised
until today that "and" is in fact a keyword in C++, albeit not
one that has been there since the start, so this should compile
(I eventually looked this up having been puzzled by how this
code could ever build with any other compiler). However,
despite its keywordness, "and" still doesn't seem to be acceptable
to VC++. Possibly there's an option to change this, or one could
use a macro -- but why not just stick with the token that compilers
are known to like?
author | cannam |
---|---|
date | Mon, 05 Oct 2009 16:14:25 +0000 |
parents | 91d6cfd22883 |
children | 8b2eddf686da |
files | PyExtensionModule.cpp PyOutputDescriptor.cpp PyParameterDescriptor.cpp PyTypeInterface.cpp VamPy.vcproj |
diffstat | 5 files changed, 15 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/PyExtensionModule.cpp Mon Oct 05 13:57:10 2009 +0000 +++ b/PyExtensionModule.cpp Mon Oct 05 16:14:25 2009 +0000 @@ -97,7 +97,7 @@ static PyObject * OutputList_new(PyObject *ignored, PyObject *args) { - if (args and PyTuple_Check(args)) + if (args && PyTuple_Check(args)) return PySequence_List(args); else return (PyObject *) PyList_New(0); } @@ -107,7 +107,7 @@ static PyObject * ParameterList_new(PyObject *ignored, PyObject *args) { - if (args and PyTuple_Check(args)) + if (args && PyTuple_Check(args)) return PySequence_List(args); else return (PyObject *) PyList_New(0); } @@ -116,7 +116,7 @@ static PyObject * FeatureList_new(PyObject *ignored, PyObject *args) { - if (args and PyTuple_Check(args)) + if (args && PyTuple_Check(args)) return PySequence_List(args); else return (PyObject *) PyList_New(0); }
--- a/PyOutputDescriptor.cpp Mon Oct 05 13:57:10 2009 +0000 +++ b/PyOutputDescriptor.cpp Mon Oct 05 16:14:25 2009 +0000 @@ -37,7 +37,7 @@ if (self->dict == NULL) return NULL; /// allow copying objects - if (args and PyTuple_Size(args) == 1) { + if (args && PyTuple_Size(args) == 1) { PyObject* arg = PyTuple_GET_ITEM(args,0); if (PyOutputDescriptor_CheckExact(arg)) PyDict_Merge(self->dict,PyOutputDescriptor_AS_DICT(arg),0);
--- a/PyParameterDescriptor.cpp Mon Oct 05 13:57:10 2009 +0000 +++ b/PyParameterDescriptor.cpp Mon Oct 05 16:14:25 2009 +0000 @@ -38,7 +38,7 @@ if (self->dict == NULL) return NULL; /// allow copying objects - if (args and PyTuple_Size(args) == 1) { + if (args && PyTuple_Size(args) == 1) { PyObject* arg = PyTuple_GET_ITEM(args,0); if (PyParameterDescriptor_CheckExact(arg)) PyDict_Merge(self->dict,PyParameterDescriptor_AS_DICT(arg),0);
--- a/PyTypeInterface.cpp Mon Oct 05 13:57:10 2009 +0000 +++ b/PyTypeInterface.cpp Mon Oct 05 16:14:25 2009 +0000 @@ -311,7 +311,7 @@ } // convert the first element of iterable sequences - if (PySequence_Check(pyValue) and PySequence_Size(pyValue) > 0) + if (PySequence_Check(pyValue) && PySequence_Size(pyValue) > 0) { PyObject* item = PySequence_GetItem(pyValue,0); if (item)
--- a/VamPy.vcproj Mon Oct 05 13:57:10 2009 +0000 +++ b/VamPy.vcproj Mon Oct 05 16:14:25 2009 +0000 @@ -113,7 +113,7 @@ /> <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories=""..\vamp-plugin-sdk";C:\Python26\include;"C:\Python26\Lib\site-packages\numpy\core\include\numpy"" + AdditionalIncludeDirectories=""..\vamp-plugin-sdk";C:\Python26\include;"C:\Python26\Lib\site-packages\numpy\core\include"" PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;VAMPY_EXPORTS;HAVE_NUMPY" RuntimeLibrary="2" UsePrecompiledHeader="0" @@ -178,6 +178,10 @@ > </File> <File + RelativePath=".\PyExtensionManager.h" + > + </File> + <File RelativePath=".\PyExtensionModule.h" > </File> @@ -230,6 +234,10 @@ > </File> <File + RelativePath=".\PyExtensionManager.cpp" + > + </File> + <File RelativePath=".\PyExtensionModule.cpp" > </File>