pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/vtk Use std::streampos and std::streamoff, si...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/72921b874c96
branches:  trunk
changeset: 518937:72921b874c96
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Sep 24 15:53:06 2006 +0000

description:
Use std::streampos and std::streamoff, since + and - are ambigious for
long. This fixes compilation with GCC 3.4+.

diffstat:

 graphics/vtk/distinfo         |   4 ++-
 graphics/vtk/patches/patch-aa |  44 ++++++++++++++++++++++++++++++++
 graphics/vtk/patches/patch-ab |  58 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 105 insertions(+), 1 deletions(-)

diffs (122 lines):

diff -r 596be8344d0e -r 72921b874c96 graphics/vtk/distinfo
--- a/graphics/vtk/distinfo     Sun Sep 24 15:40:38 2006 +0000
+++ b/graphics/vtk/distinfo     Sun Sep 24 15:53:06 2006 +0000
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.2 2005/02/24 08:45:14 agc Exp $
+$NetBSD: distinfo,v 1.3 2006/09/24 15:53:06 joerg Exp $
 
 SHA1 (VTK-4.2.6/VTK-4.2-LatestRelease.tar.gz) = 31ab01c16b3d44ce201d8180af431833cf6527d8
 RMD160 (VTK-4.2.6/VTK-4.2-LatestRelease.tar.gz) = 71a092cf929cfaeeb8f297334cadb829209b9ad7
 Size (VTK-4.2.6/VTK-4.2-LatestRelease.tar.gz) = 6073644 bytes
+SHA1 (patch-aa) = dbda07f15a60a0e66ce50e50addcf85d4c2b840c
+SHA1 (patch-ab) = 83d063aaf1924daff17a45fb92316743fbb448f3
diff -r 596be8344d0e -r 72921b874c96 graphics/vtk/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/vtk/patches/patch-aa     Sun Sep 24 15:53:06 2006 +0000
@@ -0,0 +1,44 @@
+$NetBSD: patch-aa,v 1.1 2006/09/24 15:53:06 joerg Exp $
+
+--- IO/vtkBMPReader.cxx.orig   2003-02-25 16:59:24.000000000 +0000
++++ IO/vtkBMPReader.cxx
+@@ -375,7 +375,7 @@ void vtkBMPReaderUpdate2(vtkBMPReader *s
+ {
+   int inIncr[3], outIncr[3];
+   OT *outPtr0, *outPtr1, *outPtr2;
+-  long streamSkip0, streamSkip1;
++  std::streamoff streamSkip0, streamSkip1;
+   long streamRead;
+   int idx0, idx1, idx2, pixelRead;
+   unsigned char *buf;
+@@ -424,15 +424,15 @@ void vtkBMPReaderUpdate2(vtkBMPReader *s
+   // length of a row, num pixels read at a time
+   pixelRead = dataExtent[1] - dataExtent[0] + 1; 
+   streamRead = (long) (pixelRead * self->GetDataIncrements()[0]);  
+-  streamSkip0 = (long) (self->GetDataIncrements()[1] - streamRead);
+-  streamSkip1 = (long) (self->GetDataIncrements()[2] - 
+-    (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1]);
++  streamSkip0 = self->GetDataIncrements()[1] - streamRead;
++  streamSkip1 = self->GetDataIncrements()[2] - 
++    (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1];
+   pixelSkip = self->GetDepth()/8;
+     
+   // read from the bottom up
+   if (!self->GetFileLowerLeft())
+     {
+-    streamSkip0 = (long) (-streamRead - self->GetDataIncrements()[1]);
++    streamSkip0 = -streamRead - self->GetDataIncrements()[1];
+     }
+   
+   // create a buffer to hold a row of the data
+@@ -469,8 +469,8 @@ void vtkBMPReaderUpdate2(vtkBMPReader *s
+         {
+         vtkGenericWarningMacro("File operation failed. row = " << idx1
+                                << ", Read = " << streamRead
+-                               << ", Skip0 = " << streamSkip0
+-                               << ", Skip1 = " << streamSkip1
++                               << ", Skip0 = " << (long)streamSkip0
++                               << ", Skip1 = " << (long)streamSkip1
+                                << ", FilePos = " << static_cast<vtkIdType>(self->GetFile()->tellg())
+                                << ", FileName = " << self->GetInternalFileName()
+                                );
diff -r 596be8344d0e -r 72921b874c96 graphics/vtk/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/vtk/patches/patch-ab     Sun Sep 24 15:53:06 2006 +0000
@@ -0,0 +1,58 @@
+$NetBSD: patch-ab,v 1.1 2006/09/24 15:53:06 joerg Exp $
+
+--- IO/vtkImageReader.cxx.orig 2006-09-24 16:29:56.000000000 +0000
++++ IO/vtkImageReader.cxx
+@@ -191,14 +191,14 @@ void vtkImageReaderUpdate2(vtkImageReade
+ {
+   int inIncr[3], outIncr[3];
+   OT *outPtr0, *outPtr1, *outPtr2;
+-  long streamSkip0, streamSkip1;
++  std::streamoff streamSkip0, streamSkip1;
+   unsigned long streamRead;
+   int idx0, idx1, idx2, pixelRead;
+   unsigned char *buf;
+   int inExtent[6];
+   int dataExtent[6];
+   int comp, pixelSkip;
+-  long filePos, correction = 0;
++  std::streampos filePos, correction = 0;
+   unsigned long count = 0;
+   unsigned short DataMask;
+   unsigned long target;
+@@ -233,18 +233,18 @@ void vtkImageReaderUpdate2(vtkImageReade
+   pixelRead = dataExtent[1] - dataExtent[0] + 1; 
+   streamRead = static_cast<unsigned long>(pixelRead * 
+                                           self->GetDataIncrements()[0]);  
+-  streamSkip0 = (long)(self->GetDataIncrements()[1] - streamRead);
+-  streamSkip1 = (long)(self->GetDataIncrements()[2] - 
+-    (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1]);
++  streamSkip0 = self->GetDataIncrements()[1] - streamRead;
++  streamSkip1 = self->GetDataIncrements()[2] - 
++    (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1];
+   pixelSkip = data->GetNumberOfScalarComponents();
+     
+   // read from the bottom up
+   if (!self->GetFileLowerLeft()) 
+     {
+-    streamSkip0 = (long)(-static_cast<long>(streamRead) 
+-                         - self->GetDataIncrements()[1]);
+-    streamSkip1 = (long)(self->GetDataIncrements()[2] + 
+-      (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1]);
++    streamSkip0 = -static_cast<long>(streamRead) 
++                         - self->GetDataIncrements()[1];
++    streamSkip1 = self->GetDataIncrements()[2] + 
++      (dataExtent[3] - dataExtent[2] + 1)* self->GetDataIncrements()[1];
+     }
+   
+     
+@@ -298,8 +298,8 @@ void vtkImageReaderUpdate2(vtkImageReade
+         vtkGenericWarningMacro("File operation failed. row = " << idx1
+                                << ", Tried to Read = " << streamRead
+                                << ", Read = " << self->GetFile()->gcount()
+-                               << ", Skip0 = " << streamSkip0
+-                               << ", Skip1 = " << streamSkip1
++                               << ", Skip0 = " << (long)streamSkip0
++                               << ", Skip1 = " << (long)streamSkip1
+                                << ", FilePos = " << static_cast<vtkIdType>(self->GetFile()->tellg()));
+         delete [] buf;
+         return;



Home | Main Index | Thread Index | Old Index