From gnash-dev Thu Apr 24 21:47:39 2014 From: Petter Reinholdtsen Date: Thu, 24 Apr 2014 21:47:39 +0000 To: gnash-dev Subject: [Gnash-dev] Why do FBAggGlue::init() have code after its return statement? Message-Id: <2fly4yuiemc.fsf () diskless ! uio ! no> X-MARC-Message: https://marc.info/?l=gnash-dev&m=139839429621455 Anyone know what is going on in this function from fb_glue_agg.cpp? This is Coverity CID 1149302 - Structurally dead code, and there is a large block of code after the return statement in the middle. The code was written by Rob and last touched in 2011 (except a warning fix by Bastiaan in 2012). bool FBAggGlue::init (int argc, char ***argv) { // GNASH_REPORT_FUNCTION; // The device must be initialized before the renderer. AGG only supports // The Raw framebuffer, so we use that. _device.reset(new renderer::rawfb::RawFBDevice); _device->initDevice(argc, *argv); renderer::rawfb::RawFBDevice *rawfb = reinterpret_cast (_device.get()); // You must pass in the file descriptor to the opened // framebuffer when creating a window. return _device->attachWindow(rawfb->getHandle()); // Set the renderer for the AGG glue layer gnash::Renderer *rend = reinterpret_cast (createRenderHandler()); if (rend) { _renderer.reset(rend); } else { log_error(_("failed to create a render handler for AGG!")); return false; } // Set grayscale for 8 bit modes if (_varinfo.bits_per_pixel == 8) { if (!rawfb->setGrayscaleLUT8()) return false; } return true; } Should the code after the first return statement be deleted? -- Happy hacking Petter Reinholdtsen _______________________________________________ Gnash-dev mailing list Gnash-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnash-dev