[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r9551: Minor cleanups.
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r9551: Minor cleanups. |
Date: |
Thu, 31 Jul 2008 21:23:44 +0200 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9551
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2008-07-31 21:23:44 +0200
message:
Minor cleanups.
removed:
libcore/asobj/Error.cpp
libcore/asobj/Error.h
modified:
libcore/asobj/xml.cpp
libcore/asobj/xmlsocket.cpp
------------------------------------------------------------
revno: 9549.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-07-31 17:09:32 +0200
message:
Drop DMALLOC ifdefs.
modified:
libcore/asobj/xml.cpp
libcore/asobj/xmlsocket.cpp
------------------------------------------------------------
revno: 9549.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-07-31 17:45:18 +0200
message:
Minor cleanup.
modified:
libcore/asobj/xml.cpp
------------------------------------------------------------
revno: 9549.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-07-31 21:22:46 +0200
message:
Drop old files.
removed:
libcore/asobj/Error.cpp
libcore/asobj/Error.h
------------------------------------------------------------
revno: 9549.1.4
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2008-07-31 21:23:06 +0200
message:
Clean up logging.
modified:
libcore/asobj/xml.cpp
=== removed file 'libcore/asobj/Error.cpp'
--- a/libcore/asobj/Error.cpp 2008-01-21 20:55:39 +0000
+++ b/libcore/asobj/Error.cpp 1970-01-01 00:00:00 +0000
@@ -1,109 +0,0 @@
-// Error.cpp: ActionScript "Error" class, for Gnash.
-//
-// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifdef HAVE_CONFIG_H
-#include "gnashconfig.h"
-#endif
-
-#include "Error.h"
-#include "as_object.h" // for inheritance
-#include "log.h"
-#include "fn_call.h"
-#include "smart_ptr.h" // for boost intrusive_ptr
-#include "builtin_function.h" // need builtin_function
-#include "Object.h" // for getObjectInterface
-
-namespace gnash {
-
-as_value error_tostring(const fn_call& fn);
-as_value error_ctor(const fn_call& fn);
-
-static void
-attachErrorInterface(as_object& o)
-{
- // is this really needed ? shouldn't toString be
- // derived from Object inheritance ?
- o.init_member("toString", new builtin_function(error_tostring));
-}
-
-static as_object*
-getErrorInterface()
-{
- static boost::intrusive_ptr<as_object> o;
- if ( ! o )
- {
- o = new as_object(getObjectInterface());
- attachErrorInterface(*o);
- }
- return o.get();
-}
-
-class error_as_object: public as_object
-{
-
-public:
-
- error_as_object()
- :
- as_object(getErrorInterface())
- {}
-
- // override from as_object ?
- //std::string get_text_value() const { return "Error"; }
-
- // override from as_object ?
- //double get_numeric_value() const { return 0; }
-};
-
-as_value error_tostring(const fn_call& /*fn*/) {
- log_unimpl (__FUNCTION__);
- return as_value();
-}
-
-as_value
-error_ctor(const fn_call& /* fn */)
-{
- boost::intrusive_ptr<as_object> obj = new error_as_object;
-
- return as_value(obj.get()); // will keep alive
-}
-
-// extern (used by Global.cpp)
-void error_class_init(as_object& global)
-{
- // This is going to be the global Error "class"/"function"
- static boost::intrusive_ptr<builtin_function> cl;
-
- if ( cl == NULL )
- {
- cl=new builtin_function(&error_ctor, getErrorInterface());
- // replicate all interface to class, to be able to access
- // all methods as static functions
- attachErrorInterface(*cl);
-
- }
-
- // Register _global.Error
- global.init_member("Error", cl.get());
-
-}
-
-
-} // end of gnash namespace
-
=== removed file 'libcore/asobj/Error.h'
--- a/libcore/asobj/Error.h 2008-03-26 21:34:20 +0000
+++ b/libcore/asobj/Error.h 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
-//
-// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef __GNASH_ASOBJ_ERROR_H__
-#define __GNASH_ASOBJ_ERROR_H__
-
-#include <memory> // for auto_ptr
-
-namespace gnash {
-
-class as_object;
-
-/// Initialize the global Error class
-void error_class_init(as_object& global);
-
-/// Return a Error instance (in case the core lib needs it)
-//std::auto_ptr<as_object> init_error_instance();
-
-} // end of gnash namespace
-
-// __GNASH_ASOBJ_ERROR_H__
-#endif
-
=== modified file 'libcore/asobj/xml.cpp'
--- a/libcore/asobj/xml.cpp 2008-06-10 06:14:29 +0000
+++ b/libcore/asobj/xml.cpp 2008-07-31 19:23:06 +0000
@@ -178,7 +178,8 @@
{
//GNASH_REPORT_FUNCTION;
- for (LoadThreadList::iterator it=_loadThreads.begin(); it !=
_loadThreads.end(); ++it)
+ for (LoadThreadList::iterator it = _loadThreads.begin(),
+ e = _loadThreads.end(); it != e; ++it)
{
delete *it; // supposedly joins the thread
}
@@ -360,19 +361,13 @@
{
//GNASH_REPORT_FUNCTION;
- //log_debug(_("Parse XML from memory: %s"), xml_in.c_str());
+ //log_debug(_("Parse XML from memory: %s"), xml_in);
if (xml_in.empty()) {
log_error(_("XML data is empty"));
return false;
}
-#ifndef USE_DMALLOC
- //dump_memory_stats(__FUNCTION__, __LINE__, "before xmlParseMemory");
-#endif
-
- //_bytes_total = _bytes_loaded = xml_in.size();
-
// Clear current data
clear();
@@ -410,9 +405,6 @@
else if ( firstNode ) xmlFreeNodeList(firstNode);
xmlMemoryDump();
-#ifndef USE_DMALLOC
- //dump_memory_stats(__FUNCTION__, __LINE__, "after xmlParseMemory");
-#endif
return ret;
}
@@ -579,14 +571,14 @@
std::auto_ptr<IOChannel> str (
StreamProvider::getDefaultInstance().getStream(url) );
if ( ! str.get() )
{
- log_error(_("Can't load XML file: %s (security?)"), url.str().c_str());
+ log_error(_("Can't load XML file: %s (security?)"), url.str());
return false;
// TODO: this is still not correct.. we should still send onData
later...
//as_value nullValue; nullValue.set_null();
//callMethod(NSV::PROP_ON_DATA, nullValue);
}
- log_security(_("Loading XML file from url: '%s'"), url.str().c_str());
+ log_security(_("Loading XML file from url: '%s'"), url.str());
queueLoad(str);
return true;
@@ -653,14 +645,14 @@
std::auto_ptr<IOChannel> str (
StreamProvider::getDefaultInstance().getStream(url, data) );
if ( ! str.get() )
{
- log_error(_("Can't load XML file: %s (security?)"), url.str().c_str());
+ log_error(_("Can't load XML file: %s (security?)"), url.str());
return false;
// TODO: this is still not correct.. we should still send onData
later...
//as_value nullValue; nullValue.set_null();
//callMethod(NSV::PROP_ON_DATA, nullValue);
}
- log_security(_("Loading XML file from url: '%s'"), url.str().c_str());
+ log_security(_("Loading XML file from url: '%s'"), url.str());
target.queueLoad(str);
return true;
@@ -922,7 +914,7 @@
std::stringstream ss;
fn.dump_args(ss);
log_aserror(_("XML.sendAndLoad(%s): missing arguments"),
- ss.str().c_str());
+ ss.str());
);
return as_value(false);
}
@@ -936,7 +928,7 @@
std::stringstream ss;
fn.dump_args(ss);
log_aserror(_("XML.sendAndLoad(%s): second argument doesn't cast to an
object"),
- ss.str().c_str());
+ ss.str());
);
return as_value(false);
}
@@ -947,7 +939,7 @@
std::stringstream ss;
fn.dump_args(ss);
log_aserror(_("XML.sendAndLoad(%s): second argument is not an XML
object"),
- ss.str().c_str());
+ ss.str());
);
return as_value(false);
}
=== modified file 'libcore/asobj/xmlsocket.cpp'
--- a/libcore/asobj/xmlsocket.cpp 2008-05-29 11:44:28 +0000
+++ b/libcore/asobj/xmlsocket.cpp 2008-07-31 15:09:32 +0000
@@ -652,10 +652,6 @@
log_debug(_("Still processing data"));
}
-#ifndef USE_DMALLOC
- //dump_memory_stats(__FUNCTION__, __LINE__, "memory checkpoint");
-#endif
-
std::vector<std::string > msgs;
if (obj.anydata(msgs))
{
@@ -676,18 +672,12 @@
std::string& s = *it;
as_value datain( s );
-#ifndef USE_DMALLOC
- //dump_memory_stats(__FUNCTION__, __LINE__, "start");
-#endif
as_environment env;
env.push(datain);
fn_call call(this, &env, 1, env.stack_size() -
1);
onDataHandler->call(call);
// call_method(as_value(onDataHandler.get()), &env, this, 1,
env.stack_size()-1);
-#ifndef USE_DMALLOC
- //dump_memory_stats(__FUNCTION__, __LINE__, "end");
-#endif
}
obj.processing(false);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r9551: Minor cleanups.,
Benjamin Wolsey <=