]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
0020062: [CEA 295] Type coherence in *.i files
authordmv <dmv@opencascade.com>
Tue, 30 Dec 2008 14:06:19 +0000 (14:06 +0000)
committerdmv <dmv@opencascade.com>
Tue, 30 Dec 2008 14:06:19 +0000 (14:06 +0000)
src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.cxx
src/SVTK/SVTK_Actor.cxx
src/VTKViewer/VTKViewer_GeometryFilter.cxx

index 4762968641dc9ed180f088b45f7636061d05b783..55171f8a45f3241982476c7f0a1a08466cf50c64 100644 (file)
@@ -78,6 +78,15 @@ const bool IsCallOldMethods = true;
 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.
@@ -770,7 +779,7 @@ void SALOME_PYQT_Module::init( CAM_Application* app )
       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}
index 40d275d3eb2c10a1858dee5831619dd1601f9ed0..0f167b69f69e9d794c9210e6ad7ed3c919f8987a 100644 (file)
@@ -145,11 +145,11 @@ SVTK_Actor
   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);
index 4ed453c3ff5f4ab8cbbb50ad956f53c1bceb272d..47144dff2ac2c8ff687193643a60f816050a6d81 100755 (executable)
@@ -151,7 +151,7 @@ VTKViewer_GeometryFilter
   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;