diff options
author | joerg <joerg@pkgsrc.org> | 2006-09-24 15:53:06 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2006-09-24 15:53:06 +0000 |
commit | 9d0088bee63c751e515612023ad16764663327ea (patch) | |
tree | adff7f30193ea57823618f53c7aab3eecb340f1d /graphics/vtk | |
parent | 982e92296e24a1c174bef09660152bd9b972442b (diff) | |
download | pkgsrc-9d0088bee63c751e515612023ad16764663327ea.tar.gz |
Use std::streampos and std::streamoff, since + and - are ambigious for
long. This fixes compilation with GCC 3.4+.
Diffstat (limited to 'graphics/vtk')
-rw-r--r-- | graphics/vtk/distinfo | 4 | ||||
-rw-r--r-- | graphics/vtk/patches/patch-aa | 44 | ||||
-rw-r--r-- | graphics/vtk/patches/patch-ab | 58 |
3 files changed, 105 insertions, 1 deletions
diff --git a/graphics/vtk/distinfo b/graphics/vtk/distinfo index 66118f6a982..ca7ea0294da 100644 --- a/graphics/vtk/distinfo +++ b/graphics/vtk/distinfo @@ -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 --git a/graphics/vtk/patches/patch-aa b/graphics/vtk/patches/patch-aa new file mode 100644 index 00000000000..7f7c74018b5 --- /dev/null +++ b/graphics/vtk/patches/patch-aa @@ -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 --git a/graphics/vtk/patches/patch-ab b/graphics/vtk/patches/patch-ab new file mode 100644 index 00000000000..91bf444b1c8 --- /dev/null +++ b/graphics/vtk/patches/patch-ab @@ -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; |