Commit d132ee85 authored by Bill Lorensen's avatar Bill Lorensen Committed by Code Review
Browse files

Merge topic 'ExpectEOFsIn3DS' into master

631d795b Reads past EOF are expected
parents 8497b42d 631d795b
......@@ -52,14 +52,14 @@ viewer.SetColorWindow(255)
viewer.SetColorLevel(127.5)
viewer.Render()
# on several opengl X window unix implementations
# multiple context deletes cause errors
# so we leak the renWin in this test for unix
if renWin1.IsA('vtkXOpenGLRenderWindow'):
renWin1.Register(ren1)
dl = vtk.vtkDebugLeaks()
dl.SetExitError(0)
del dl
## on several opengl X window unix implementations
## multiple context deletes cause errors
## so we leak the renWin in this test for unix
#if renWin1.IsA('vtkXOpenGLRenderWindow'):
# renWin1.Register(ren1)
# dl = vtk.vtkDebugLeaks()
# dl.SetExitError(0)
# del dl
# iren.Initialize()
# iren.Start()
......@@ -52,14 +52,14 @@ viewer.SetColorWindow(255)
viewer.SetColorLevel(127.5)
viewer.Render()
# on several opengl X window unix implementations
# multiple context deletes cause errors
# so we leak the renWin1 in this test for unix
if renWin1.IsA('vtkXOpenGLRenderWindow'):
renWin1.Register(ren1)
dl = vtk.vtkDebugLeaks()
dl.SetExitError(0)
del dl
## on several opengl X window unix implementations
## multiple context deletes cause errors
## so we leak the renWin1 in this test for unix
#if renWin1.IsA('vtkXOpenGLRenderWindow'):
# renWin1.Register(ren1)
# dl = vtk.vtkDebugLeaks()
# dl.SetExitError(0)
# del dl
# iren.Initialize()
# iren.Start()
......@@ -49,12 +49,12 @@ vtkImageViewer viewer
viewer SetColorLevel 127.5
viewer Render
# on several opengl X window unix implementations
# multiple context deletes cause errors
# so we leak the renWin1 in this test for unix
if { $tcl_platform(platform) == "unix" } {
renWin1 Register ren1
vtkDebugLeaks dl
dl SetExitError 0
dl Delete
}
## on several opengl X window unix implementations
## multiple context deletes cause errors
## so we leak the renWin1 in this test for unix
#if { $tcl_platform(platform) == "unix" } {
# renWin1 Register ren1
# vtkDebugLeaks dl
# dl SetExitError 0
# dl Delete
#}
......@@ -49,12 +49,12 @@ vtkImageViewer viewer
viewer SetColorLevel 127.5
viewer Render
# on several opengl X window unix implementations
# multiple context deletes cause errors
# so we leak the renWin1 in this test for unix
if { $tcl_platform(platform) == "unix" } {
renWin1 Register ren1
vtkDebugLeaks dl
dl SetExitError 0
dl Delete
}
## on several opengl X window unix implementations
## multiple context deletes cause errors
## so we leak the renWin1 in this test for unix
#if { $tcl_platform(platform) == "unix" } {
# renWin1 Register ren1
# vtkDebugLeaks dl
# dl SetExitError 0
# dl Delete
#}
......@@ -96,7 +96,8 @@ static void start_chunk (vtk3DSImporter *importer, vtk3DSChunk *chunk);
static void end_chunk (vtk3DSImporter *importer, vtk3DSChunk *chunk);
static byte read_byte (vtk3DSImporter *importer);
static word read_word (vtk3DSImporter *importer);
static dword read_dword (vtk3DSImporter *importer);
static word peek_word (vtk3DSImporter *importer);
static dword peek_dword (vtk3DSImporter *importer);
static float read_float (vtk3DSImporter *importer);
static void read_point (vtk3DSImporter *importer, vtk3DSVector v);
static char *read_string (vtk3DSImporter *importer);
......@@ -1043,8 +1044,8 @@ static float parse_float_percentage(vtk3DSImporter *importer)
static void start_chunk (vtk3DSImporter *importer, vtk3DSChunk *chunk)
{
chunk->start = ftell(importer->GetFileFD());
chunk->tag = read_word(importer);
chunk->length = read_dword(importer);
chunk->tag = peek_word(importer);
chunk->length = peek_dword(importer);
if (chunk->length == 0)
{
chunk->length = 1;
......@@ -1083,14 +1084,24 @@ static word read_word(vtk3DSImporter *importer)
return data;
}
static dword read_dword(vtk3DSImporter *importer)
static word peek_word(vtk3DSImporter *importer)
{
word data;
if (fread (&data, 2, 1, importer->GetFileFD()) != 1)
{
data = 0;
}
vtkByteSwap::Swap2LE ((short *) &data);
return data;
}
static dword peek_dword(vtk3DSImporter *importer)
{
dword data;
if (fread (&data, 4, 1, importer->GetFileFD()) != 1)
{
vtkErrorWithObjectMacro(
importer, "Pre-mature end of file in read_dword\n");
data = 0;
}
......@@ -1098,7 +1109,6 @@ static dword read_dword(vtk3DSImporter *importer)
return data;
}
static float read_float(vtk3DSImporter *importer)
{
float data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment