gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Why do FBAggGlue::init() have code after its return statemen


From: Petter Reinholdtsen
Subject: [Gnash-dev] Why do FBAggGlue::init() have code after its return statement?
Date: Thu, 24 Apr 2014 23:47:39 +0200
User-agent: Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.4.1 (i486-pc-linux-gnu)

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
        <renderer::rawfb::RawFBDevice *>(_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<gnash::Renderer *>
                                                (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]