gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2067-g586d4e0
Date: Tue, 27 May 2014 16:42:00 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  586d4e0b2cd13a3f64e8e19f6aa74573b9dd3bc3 (commit)
       via  2cd5008da64a58712c754443a73e838ab509f161 (commit)
      from  bde2d5bdf827fc563e96e0261e11af1ae103ee6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=586d4e0b2cd13a3f64e8e19f6aa74573b9dd3bc3


commit 586d4e0b2cd13a3f64e8e19f6aa74573b9dd3bc3
Author: Bastiaan Jacques <address@hidden>
Date:   Tue May 27 18:41:28 2014 +0200

    Remove some unneeded include directives, and add them where needed.

diff --git a/gui/Player.cpp b/gui/Player.cpp
index be29eec..49a6336 100644
--- a/gui/Player.cpp
+++ b/gui/Player.cpp
@@ -57,6 +57,7 @@
 #include "log.h"
 #include "HostInterface.h"
 #include "RunResources.h"
+#include "IOChannel.h"
 
 using namespace gnash;
 
diff --git a/libcore/movie_root.h b/libcore/movie_root.h
index f954ad2..5093cae 100644
--- a/libcore/movie_root.h
+++ b/libcore/movie_root.h
@@ -93,7 +93,6 @@
 #include "VM.h"
 #include "HostInterface.h"
 #include "log.h"
-#include "IOChannel.h"
 
 #ifdef USE_SWFTREE
 # include "tree.hh"
diff --git a/libcore/parser/SWFMovieDefinition.h 
b/libcore/parser/SWFMovieDefinition.h
index 88a7de5..fc9a3b2 100644
--- a/libcore/parser/SWFMovieDefinition.h
+++ b/libcore/parser/SWFMovieDefinition.h
@@ -40,7 +40,6 @@
 #include <condition_variable>
 
 #include "movie_definition.h" // for inheritance
-#include "DefinitionTag.h" // for boost::intrusive_ptr visibility of dtor
 #include "StringPredicates.h" 
 #include "SWFRect.h"
 #include "GnashNumeric.h"
@@ -59,6 +58,9 @@ namespace gnash {
     class SWFMovie;
     class RunResources;
     class Font;
+    namespace SWF {
+        class DefinitionTag;
+    }
 }
 
 namespace gnash {

http://git.savannah.gnu.org/cgit//commit/?id=2cd5008da64a58712c754443a73e838ab509f161


commit 2cd5008da64a58712c754443a73e838ab509f161
Author: Bastiaan Jacques <address@hidden>
Date:   Tue May 27 17:41:09 2014 +0200

    Look Ma, no macros!
    
    Define the logging functions using variadic templates.

diff --git a/libbase/log.h b/libbase/log.h
index a9dbaf4..b56b1fc 100644
--- a/libbase/log.h
+++ b/libbase/log.h
@@ -51,12 +51,6 @@
     if (!warned) { warned = true; x; } \
 }
 
-# include <boost/preprocessor/arithmetic/inc.hpp>
-# include <boost/preprocessor/repetition/enum_params.hpp>
-# include <boost/preprocessor/repetition/repeat.hpp>
-# include <boost/preprocessor/repetition/repeat_from_to.hpp>
-# include <boost/preprocessor/seq/for_each.hpp>
-
 // Mingw32 (win32 console) doesn't use the standard GCC defines that
 // Gnash used for debug messages, so make it so...
 #ifndef __FUNCDNAME__
@@ -252,78 +246,98 @@ DSOEXPORT void processLog_swferror(const boost::format& 
fmt);
 DSOEXPORT void processLog_aserror(const boost::format& fmt);
 DSOEXPORT void processLog_abc(const boost::format& fmt);
 
-/// This heap of steaming preprocessor code magically converts
-/// printf-style statements into boost::format messages using templates.
-//
-/// Macro to feed boost::format strings to the boost::format object,
-/// producing code like this: "% t1 % t2 % t3 ..."
-#define TOKENIZE_FORMAT(z, n, t) % t##n
-
-/// Macro to add a number of arguments to the templated function
-/// corresponding to the number of template arguments. Produces code
-/// like this: "const T0& t0, const T1& t1, const T2& t2 ..."
-#define TOKENIZE_ARGS(z, n, t) BOOST_PP_COMMA_IF(n) const T##n& t##n
-
-/// This is a sequence of different log message types to be used in
-/// the code. Append the name to log_ to call the function, e.g. 
-/// log_error, log_unimpl.
-#define LOG_TYPES (error) (debug) (unimpl) (aserror) (swferror) \
-    (security) (action) (parse) (trace) (abc) (network)
-
-/// This actually creates the template functions using the TOKENIZE
-/// functions above. The templates look like this:
-//
-/// template<typename T0 , typename T1 , typename T2>
-/// void log_error(const T0& t0 , const T1& t1 , const T2& t2)
-/// {
-///     if (LogFile::getDefaultInstance().getVerbosity() == 0) return;
-///     boost::format f(t0);
-///     using namespace boost::io;
-///     f.exceptions(all_error_bits ^ (too_many_args_bit |
-///                                    too_few_args_bit |
-///                                    bad_format_string_bit));
-///     processLog_error(f % t1 % t2);
-/// }
-///
-/// Only not as nicely indented.
-///
-/// Use "g++ -E log.h" or "cpp log.h" to check.
-#define LOG_TEMPLATES(z, n, data)\
-template<BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), typename T)>\
-inline void log_##data(BOOST_PP_REPEAT(BOOST_PP_INC(n), TOKENIZE_ARGS, t)) \
-{\
-    if (LogFile::getDefaultInstance().getVerbosity() == 0) return; \
-    boost::format f(t0); \
-    using namespace boost::io; \
-    f.exceptions(all_error_bits ^ (too_many_args_bit | \
-                                   too_few_args_bit | \
-                                   bad_format_string_bit)); \
-    processLog_##data(f BOOST_PP_REPEAT_FROM_TO(1, \
-            BOOST_PP_INC(n), \
-            TOKENIZE_FORMAT, t));\
+template <typename FuncType>
+inline void
+log_impl(boost::format& fmt, FuncType func)
+{
+    func(fmt);
 }
 
-/// Defines the maximum number of template arguments
-//
-/// The preprocessor generates templates with 1..ARG_NUMBER
-/// arguments.
-#define ARG_NUMBER 10
-
-/// Calls the macro LOG_TEMPLATES an ARG_NUMBER number
-/// of times, each time adding an extra typename argument to the
-/// template.
-#define GENERATE_LOG_TYPES(r, _, t) \
-    BOOST_PP_REPEAT(ARG_NUMBER, LOG_TEMPLATES, t)
-
-/// Calls the template generator for each log type in the
-/// sequence LOG_TYPES.
-BOOST_PP_SEQ_FOR_EACH(GENERATE_LOG_TYPES, _, LOG_TYPES)
-
-#undef TOKENIZE_ARGS
-#undef TOKENIZE_FORMAT
-#undef GENERATE_LOG_TYPES
-#undef LOG_TEMPLATES
-#undef ARG_NUMBER
+template<typename FuncType, typename Arg, typename... Args>
+inline void
+log_impl(boost::format& fmt, FuncType processFunc, Arg arg, Args... args)
+{
+    fmt % arg;
+    log_impl(fmt, processFunc, args...);
+}
+
+template<typename StringType, typename FuncType, typename... Args>
+inline void
+log_impl(StringType msg, FuncType func, Args... args)
+{
+    boost::format fmt(msg);
+    using namespace boost::io;
+    fmt.exceptions(all_error_bits ^ (too_many_args_bit |
+                                   too_few_args_bit |
+                                   bad_format_string_bit));
+    log_impl(fmt, func, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_network(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_network, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_error(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_error, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_unimpl(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_unimpl, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_trace(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_trace, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_debug(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_debug, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_action(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_action, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_parse(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_parse, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_security(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_security, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_swferror(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_swferror, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_aserror(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_aserror, args...);
+}
+
+template<typename StringType, typename... Args>
+inline void log_abc(StringType msg, Args... args)
+{
+    log_impl(msg, processLog_abc, args...);
+}
 
 /// Convert a sequence of bytes to hex or ascii format.
 //

-----------------------------------------------------------------------

Summary of changes:
 gui/Player.cpp                      |    1 +
 libbase/log.h                       |  166 +++++++++++++++++++----------------
 libcore/movie_root.h                |    1 -
 libcore/parser/SWFMovieDefinition.h |    4 +-
 4 files changed, 94 insertions(+), 78 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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