# HG changeset patch # User cannam # Date 1254759265 0 # Node ID af9c4cee95a883b31e786f9c6cce406771e25db2 # Parent 91d6cfd2288348ebeedffd9e3136e753ca9889aa 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? diff -r 91d6cfd22883 -r af9c4cee95a8 PyExtensionModule.cpp --- 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); } diff -r 91d6cfd22883 -r af9c4cee95a8 PyOutputDescriptor.cpp --- 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); diff -r 91d6cfd22883 -r af9c4cee95a8 PyParameterDescriptor.cpp --- 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); diff -r 91d6cfd22883 -r af9c4cee95a8 PyTypeInterface.cpp --- 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) diff -r 91d6cfd22883 -r af9c4cee95a8 VamPy.vcproj --- 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 @@ /> + + @@ -230,6 +234,10 @@ > + +