pkgsrc/graphics/vtk/patches/patch-aa
joerg 9d0088bee6 Use std::streampos and std::streamoff, since + and - are ambigious for
long. This fixes compilation with GCC 3.4+.
2006-09-24 15:53:06 +00:00

44 lines
2 KiB
Text

$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()
);