// File : SALOME_PYQT_Module.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
//
+
#include "SALOME_PYQT_Module.h"
#include <PyInterp_Dispatcher.h>
const bool IsCallOldMethods = false;
#endif
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+#endif
+
//
// NB: Python requests.
// General rule for Python requests created by SALOME_PYQT_Module:
if ( PyDict_Check( res1 ) ) {
PyObject* key;
PyObject* value;
- int pos = 0;
+ Py_ssize_t pos = 0;
while ( PyDict_Next( res1, &pos, &key, &value ) ) {
// parse the return value
// it should be a map: {integer:integer}
if(int aNbOfParts = theMapIndex.Extent()){
vtkPoints *aPoints = vtkPoints::New();
aPoints->SetNumberOfPoints(aNbOfParts);
- vtkIdType iIdT;
- for(int i = 0; i < aNbOfParts; i++){
+ for(vtkIdType i = 0; i < aNbOfParts; i++){
int aPartId = theMapIndex( i+1 );
if(vtkFloatingPointType* aCoord = theMapActor->GetNodeCoord(aPartId)){
aPoints->SetPoint(i,aCoord);
// Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
// from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
- iIdT = i;
- myUnstructuredGrid->InsertNextCell(VTK_VERTEX,1,&iIdT);
+ myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
}
}
myUnstructuredGrid->SetPoints(aPoints);
vtkIdType newCellId;
int faceId, *faceVerts, numFacePts;
vtkFloatingPointType *x;
- int PixelConvert[4];
+ vtkIdType PixelConvert[4];
// Change the type from int to vtkIdType in order to avoid compilation errors while using VTK
// from ParaView-3.4.0 compiled on 64-bit Debian platform with VTK_USE_64BIT_IDS = ON
vtkIdType aNewPts[VTK_CELL_SIZE];