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: Andrea Palmatè
Subject: Re: [Gnash-dev] std::bad_cast
Date: Thu, 14 May 2009 20:43:03 +0200

Here it is..
this is the main problem on AmigaOS4... changing those two functions cure all the problems and now i'm able to play almost all files that i play correctly on window.. But the proposal for the patch is this:


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
std::wstring wstr = utf8::decodeCanonicalString(val.to_string(), version);

   // If this is the C locale, the conversion will be wrong.
   // Most other locales are correct. FIXME: get this to
   // work regardless of user's current settings.
   std::locale currentLocale;
   try
   {
       currentLocale = std::locale("");
   }
   catch (std::runtime_error& e)
   {
       currentLocale = std::locale::classic();
   }

   if (currentLocale == std::locale::classic())
   {
       LOG_ONCE(
           log_error(_("Your locale probably can't convert non-ascii "
"DisplayObjects to lower case. Using a UTF8 locale may fix this"));
       );
   }

   boost::to_lower(wstr, currentLocale);

   return as_value(utf8::encodeCanonicalString(wstr, version));
#endif
}

I know.. is a bit hackish. maybe we can use instead of __amigaos4__ a define variable like HAVE_WSTRING since also Haiku (aka Beos) has this problem and maybe also other systems that doesn't have wstring support
What do you think?

Now the latest youtube player is playing videos correctly but is too slow also on a G4 933Mhz..

Actually i'm using AGG and SDL so i can find all OS4 bugs before starting with a native OS4 gui

Andrea


Il giorno 14/mag/09, alle ore 00:30, Andrea Palmatè ha scritto:

i've found two bugs thah cause a bad_cast here on AmigaOS4 and as usual are AmigaOS the guilty- Since we don't have a full working wstring implementation, the two functions string_toLowerCase and string_toUpperCase cause a bad cast when they call

  boost::to_lower(wstr, currentLocale);

and

  boost::to_upper(wstr, currentLocale);

not because currentLocale is empty but because wstr is null or something else

I'm looking for something to avoid this problem

Andrea

Il giorno 12/mag/09, alle ore 13:55, Benjamin Wolsey ha scritto:

Note that the catch block re-throws, so shouldn't really hide anything
(at least as of revno 10865)


This is true, so the bad_cast is clearly caught somewhere outside too.
It shouldn't be too hard to find the one that's hiding the bug.

--
The current release of Gnash is 0.8.5
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de
_______________________________________________
Gnash-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnash-dev



_______________________________________________
Gnash-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnash-dev






reply via email to

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