gnash-dev
[Top][All Lists]
Advanced

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

Re: [Gnash-dev] std::bad_cast


From: Benjamin Wolsey
Subject: Re: [Gnash-dev] std::bad_cast
Date: Thu, 14 May 2009 23:39:55 +0200

Am Donnerstag, den 14.05.2009, 20:43 +0200 schrieb Andrea Palmatè:
> Here it is..

> as_value
> string_toLowerCase(const fn_call& fn)
> {
>     boost::intrusive_ptr<as_object> obj =  
> ensureType<as_object>(fn.this_ptr);
>     as_value val(fn.this_ptr);
> 
>     VM& vm = obj->getVM();
>     const int version = vm.getSWFVersion();
> #ifdef __amigaos4__
>       std::string str = val.to_string();
>     boost::to_lower(str);
> 
>     return as_value(str);
> #else

I can think of two proper ways of fixing it:

(a) use a custom string implementation for actionscript in Gnash that
allows platforms to supply their own implementations if the default one
doesn't work. I almost did this once, but never applied it and the patch
got obsoleted. This should probably be done sometime anyway, as it makes
string processing much more efficient and fixes a number of swfdec
testcases.

(b) fix either boost string predicates or wstring on AmigaOS.

The first way is obviously better for Gnash and portability, the second
way would benefit AmigaOS :) I don't like putting patches into trunk
just to fix a build when the patches don't have the same functionality,
and personally I would prefer these to remain as patches for AmigaOS
users until a fix suitable for release code is found.

Anyway, if anyone would like to work on a string implementation for
ActionScript, I can supply my patch as a start. It supplied a libICU and
a std::string implementation, but should really use a std::wstring type
with some extra constructors to pass all the testsuite. The very time
consuming part is finding the right places to use it more than anything
else.

bwy

--
Yes, YouTube does work in Gnash
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de

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


reply via email to

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