[vtk6] 01/02: Fix compilation with gcc-4.9. (Closes: #746923)

Anton Gladky gladk at moszumanska.debian.org
Fri May 30 23:14:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository vtk6.

commit 26157d654cf429592d99a4a83318f0ddcbc55563
Author: Anton Gladky <gladk at debian.org>
Date:   Sat May 31 01:13:14 2014 +0200

    Fix compilation with gcc-4.9. (Closes: #746923)
---
 debian/patches/fix_ftbfs_gcc49.patch | 128 +++++++++++++++++++++++++++++++++++
 debian/patches/series                |   1 +
 2 files changed, 129 insertions(+)

diff --git a/debian/patches/fix_ftbfs_gcc49.patch b/debian/patches/fix_ftbfs_gcc49.patch
new file mode 100644
index 0000000..1116a28
--- /dev/null
+++ b/debian/patches/fix_ftbfs_gcc49.patch
@@ -0,0 +1,128 @@
+Description: fix compilation with gcc-4.9
+Author: Anton Gladky <gladk at debian.org>
+Bug-Debian: http://bugs.debian.org/746923
+Forwarded: https://github.com/Kitware/VTK/pull/7
+Last-Update: 2014-05-30
+
+--- vtk6-6.1.0+dfsg.orig/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
++++ vtk6-6.1.0+dfsg/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
+@@ -1094,7 +1094,10 @@ vtkDataSet *vtkDistributedDataFilter::Te
+   vtkIdType cellsPerNode = numTotalCells / nprocs;
+ 
+   vtkIdList **sendCells = new vtkIdList * [ nprocs ];
+-  memset(sendCells, 0, sizeof(vtkIdList *) * nprocs);
++  
++  if (sizeof(vtkIdList *) * nprocs > 0) {
++    memset(sendCells, 0, sizeof(vtkIdList *) * nprocs);
++  }
+ 
+   if (numConsumers == nprocs - 1)
+     {
+@@ -1585,7 +1588,9 @@ vtkFloatArray **
+   // Exchange int arrays
+ 
+   float **recvArrays = new float * [nprocs];
+-  memset(recvArrays, 0, sizeof(float *) * nprocs);
++  if (sizeof(float *) * nprocs > 0) {
++    memset(recvArrays, 0, sizeof(float *) * nprocs);
++  }
+ 
+   if (sendSize[me] > 0)  // sent myself an array
+     {
+@@ -1706,7 +1711,9 @@ vtkIdTypeArray **
+   // Exchange int arrays
+ 
+   vtkIdType **recvArrays = new vtkIdType * [nprocs];
+-  memset(recvArrays, 0, sizeof(vtkIdType *) * nprocs);
++  if (sizeof(vtkIdType *) * nprocs > 0) {
++    memset(recvArrays, 0, sizeof(vtkIdType *) * nprocs);
++  }
+ 
+   if (sendSize[me] > 0)  // sent myself an array
+     {
+@@ -2810,7 +2817,9 @@ void vtkDistributedDataFilter::AddConsta
+ 
+   unsigned char *vals = new unsigned char [npoints];
+ 
+-  memset(vals, val, npoints);
++  if (npoints > 0) {
++    memset(vals, val, npoints);
++  }
+ 
+   vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
+   Array->SetName(arrayName);
+@@ -2830,7 +2839,9 @@ void vtkDistributedDataFilter::AddConsta
+ 
+   unsigned char *vals = new unsigned char [ncells];
+ 
+-  memset(vals, val, ncells);
++  if (ncells > 0) {
++    memset(vals, val, ncells);
++  }
+ 
+   vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
+   Array->SetName(arrayName);
+@@ -3027,7 +3038,9 @@ int vtkDistributedDataFilter::AssignGlob
+   vtkIdType nGridPoints = grid->GetNumberOfPoints();
+ 
+   vtkIdType *numPointsOutside = new vtkIdType [nprocs];
+-  memset(numPointsOutside, 0, sizeof(vtkIdType) * nprocs);
++  if (sizeof(vtkIdType) * nprocs > 0) {
++    memset(numPointsOutside, 0, sizeof(vtkIdType) * nprocs);
++  }
+ 
+   vtkIdTypeArray *globalIds = vtkIdTypeArray::New();
+   globalIds->SetNumberOfValues(nGridPoints);
+@@ -3109,10 +3122,16 @@ int vtkDistributedDataFilter::AssignGlob
+   // global ID back?
+ 
+   vtkFloatArray **ptarrayOut = new vtkFloatArray * [nprocs];
+-  memset(ptarrayOut, 0, sizeof(vtkFloatArray *) * nprocs);
++  
++  if (sizeof(vtkFloatArray *) * nprocs > 0) {
++    memset(ptarrayOut, 0, sizeof(vtkFloatArray *) * nprocs);
++  }
+ 
+   vtkIdTypeArray **localIds     = new vtkIdTypeArray * [nprocs];
+-  memset(localIds, 0, sizeof(vtkIdTypeArray *) * nprocs);
++  
++  if (sizeof(vtkIdTypeArray *) * nprocs > 0) {
++    memset(localIds, 0, sizeof(vtkIdTypeArray *) * nprocs);
++  }
+ 
+   vtkIdType *next = new vtkIdType [nprocs];
+   vtkIdType *next3 = new vtkIdType [nprocs];
+@@ -3287,7 +3306,9 @@ vtkIdTypeArray **vtkDistributedDataFilte
+     {
+     // There are no cells in my assigned region
+ 
+-    memset(gids, 0, sizeof(vtkIdTypeArray *) * nprocs);
++    if (sizeof(vtkIdTypeArray *) * nprocs > 0) {
++      memset(gids, 0, sizeof(vtkIdTypeArray *) * nprocs);
++    }
+ 
+     return gids;
+     }
+@@ -3492,7 +3513,10 @@ vtkIdTypeArray **vtkDistributedDataFilte
+   std::multimap<int, int>::iterator mapIt;
+ 
+   vtkIdTypeArray **processList = new vtkIdTypeArray * [nprocs];
+-  memset(processList, 0, sizeof (vtkIdTypeArray *) * nprocs);
++
++  if (sizeof (vtkIdTypeArray *) * nprocs > 0) {
++    memset(processList, 0, sizeof (vtkIdTypeArray *) * nprocs);
++  }
+ 
+   for (int i=0; i<nprocs; i++)
+     {
+@@ -3582,7 +3606,9 @@ vtkIdTypeArray **vtkDistributedDataFilte
+   vtkIdType numPoints = grid->GetNumberOfPoints();
+ 
+   vtkIdTypeArray **ghostPtIds = new vtkIdTypeArray * [nprocs];
+-  memset(ghostPtIds, 0, sizeof(vtkIdTypeArray *) * nprocs);
++  if (sizeof(vtkIdTypeArray *) * nprocs) {
++    memset(ghostPtIds, 0, sizeof(vtkIdTypeArray *) * nprocs);
++  }
+ 
+   if (numPoints < 1)
+     {
diff --git a/debian/patches/series b/debian/patches/series
index e663e65..609e310 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ docs.patch
 fix_libav10.patch
 10_Java_Target.patch
 fix_FTBFS_KWSys.patch
+fix_ftbfs_gcc49.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vtk6.git



More information about the debian-science-commits mailing list