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:
// all requests should be executed SYNCHRONOUSLY within the main GUI thread.
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);
- 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);
- myUnstructuredGrid->InsertNextCell(VTK_VERTEX,1,&i);
+ myUnstructuredGrid->InsertNextCell(VTK_VERTEX,(vtkIdType) 1,&i);
}
}
myUnstructuredGrid->SetPoints(aPoints);
vtkIdType newCellId;
int faceId, *faceVerts, numFacePts;
vtkFloatingPointType *x;
- int PixelConvert[4], aNewPts[VTK_CELL_SIZE];
+ vtkIdType PixelConvert[4], aNewPts[VTK_CELL_SIZE];
// ghost cell stuff
unsigned char updateLevel = (unsigned char)(output->GetUpdateGhostLevel());
unsigned char *cellGhostLevels = 0;