gnash-commit
[Top][All Lists]
Advanced

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

Re: [Gnash-commit] /srv/bzr/gnash/trunk r12207: merge from branch all Ex


From: Benjamin Wolsey
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r12207: merge from branch all ExternalInterface refactoring.
Date: Thu, 03 Jun 2010 18:31:45 +0200

> +#include <sys/ioctl.h>
> +#include <sys/types.h>

Is there a way of removing these headers from libcore? If they aren't
present on a particular system, we'd start needing ifdefs and we'd done
quite well getting those out of libcore.

> +using namespace std;

Would be better dropped. I don't think it's needed in the file currently
anyway.

> +std::string
> +ExternalInterface::makeNull ()
> +{
> +    std::stringstream ss;
> +    
> +    ss << "<null/>";
> +    
> +    return ss.str();
> +}

I think 'return "<null/>"' would be clearer and more efficient here!

> +std::string
> +ExternalInterface::makeTrue ()
> +{
> +    std::stringstream ss;
> +
> +    ss << "<true/>";
> +    
> +    return ss.str();
> +}
> +

Same idea here, and in a couple of further functions.

> +size_t
> +ExternalInterface::writeBrowser(int fd, const std::string &data)
> +{
> +    if (fd > 0) {
> +        return ::write(fd, data.c_str(), data.size());
> +    }
> +
> +    return -1;
> +}

It might be worth making an ExternalInterface instance and storing the
fd (if that can be done at construction of movie_root and never changes)
to save passing it every time, but then again it might not.

bwy

--
Free Flash, use Gnash
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de
C++ and Open-Source Flash blog - http://www.benjaminwolsey.de/bwysblog

xmpp:address@hidden
http://identi.ca/bwy

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

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