Re: [Widelands-public] [Widelands-cvs] SF.net SVN: widelands: [2562] trunk/src
Status: Beta
Brought to you by:
sirver
From: Erik <fr...@ho...> - 2007-08-31 15:36:51
|
ixp...@us... skrev: > + if (extent.w <= x) throw Width_Exceeded (GetPos() - 4, extent.w, x); > + if (extent.h <= y) throw Height_Exceeded(GetPos() - 4, extent.h, y); > + return Coords(x, y); > +} > + > +inline Coords FileRead::Coords32_allow_null(const Extent extent) { > + const Uint16 x = Unsigned16(); > + const Uint16 y = Unsigned16(); > + const Coords result(x, y); > + if (not result.isNull()) { > + if (extent.w <= x) throw Width_Exceeded (GetPos() - 4, extent.w, x); > + if (extent.h <= y) throw Height_Exceeded(GetPos() - 4, extent.h, y); > I see that you changed this. Now it will report that the file position of the out-of-range y-coordinate is the file position of the (not out of range) x-coordinate. I assume your intention was not to mix x and y, but rather make the Coords read atomic and that any error in it gives the file position of the *whole* Coords object. But note that if the calling code calls GetPrevPos, it will get the file position of the y coordinate. I will fix this. |