Description: Fix compilation with gcc-6 Author: Gert Wollny Last-Updated: 2016-07-09 Forwarded: No Bug-Debian: https://bugs.debian.org/811642 --- fracplanet-0.4.0.orig/image.cpp +++ fracplanet-0.4.0/image.cpp @@ -85,7 +85,7 @@ template <> bool Raster::write_pg out.write(reinterpret_cast(&(*(row->begin()))),row->size()); } out.close(); - return out; + return out.good(); } template <> bool Raster::write_pgmfile(const std::string& filename,Progress* target) const @@ -101,7 +101,7 @@ template <> bool Raster::write_p progress.step(); for (const ushort* it=row->begin();it!=row->end();++it) { - const uchar p[2]={((*it)>>8),(*it)}; + const uchar p[2]={static_cast((*it)>>8),static_cast((*it) & 0x00FF)}; if (m>=256) { // PGM spec is most significant byte first @@ -115,7 +115,7 @@ template <> bool Raster::write_p } } out.close(); - return out; + return out.good(); } template <> bool Raster::write_ppmfile(const std::string& filename,Progress* target) const @@ -132,7 +132,7 @@ template <> bool Raster::write out.write(reinterpret_cast(&((*it).r)),3); } out.close(); - return out; + return out.good(); }