vtkVolume16Reader CodeGuard workaround
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
A bug in Borland CodeGuard does not like to substract a pointer under its origin.
int vtkVolume16Reader:: Read16BitImage (FILE *fp, unsigned short *pixels, int xsize, int ysize, int skip, int swapBytes) { unsigned short *shortPtr; int numShorts = xsize * ysize;
if (skip) { fseek (fp, skip, 0); }
shortPtr = pixels; shortPtr = shortPtr + xsize*(ysize - 1); for (int j=0; j<ysize; j++) { if ( ! fread(shortPtr,sizeof (unsigned short),xsize,fp) ) { vtkErrorMacro(<<"Error reaading raw pgm data!"); return 0; } if( shortPtr>pixels ) shortPtr = shortPtr - xsize; //<--- Workaround }