changeset in /hg/icedtea6: 2008-10-17 Matthias Klose <doko at ubu...
doko at ubuntu.com
doko at ubuntu.com
Fri Oct 17 10:20:55 PDT 2008
changeset 8ea55953d4df in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=8ea55953d4df
description:
2008-10-17 Matthias Klose <doko at ubuntu.com>
* IcedTeaPlugin.cc: Don't use open if's in macros; cache getenv() call.
diffstat:
2 files changed, 42 insertions(+), 20 deletions(-)
ChangeLog | 4 +++
IcedTeaPlugin.cc | 58 +++++++++++++++++++++++++++++++++++-------------------
diffs (98 lines):
diff -r be5fa1722f4f -r 8ea55953d4df ChangeLog
--- a/ChangeLog Fri Oct 17 10:37:37 2008 -0400
+++ b/ChangeLog Fri Oct 17 19:20:38 2008 +0200
@@ -1,3 +1,7 @@ 2008-10-17 Gary Benson <gbenson at redhat
+2008-10-17 Matthias Klose <doko at ubuntu.com>
+
+ * IcedTeaPlugin.cc: Don't use open if's in macros; cache getenv() call.
+
2008-10-17 Gary Benson <gbenson at redhat.com>
PR icedtea/203:
diff -r be5fa1722f4f -r 8ea55953d4df IcedTeaPlugin.cc
--- a/IcedTeaPlugin.cc Fri Oct 17 10:37:37 2008 -0400
+++ b/IcedTeaPlugin.cc Fri Oct 17 19:20:38 2008 +0200
@@ -90,38 +90,55 @@ PRThread* current_thread ();
#define ID(object) \
(object == NULL ? (PRUint32) 0 : reinterpret_cast<JNIReference*> (object)->identifier)
+static int plugin_debug = 0;
+
#if 1
// Debugging macros.
#define PLUGIN_DEBUG_0ARG(str) \
- if (getenv ("ICEDTEAPLUGIN_DEBUG")) \
- { \
- printf (str); \
- }
+ do \
+ { \
+ if (plugin_debug) \
+ { \
+ printf (str); \
+ } \
+ } while (0)
#define PLUGIN_DEBUG_1ARG(str, arg1) \
- if (getenv ("ICEDTEAPLUGIN_DEBUG")) \
- { \
- printf (str, arg1); \
- }
+ do \
+ { \
+ if (plugin_debug) \
+ { \
+ printf (str, arg1); \
+ } \
+ } while (0)
#define PLUGIN_DEBUG_2ARG(str, arg1, arg2) \
- if (getenv ("ICEDTEAPLUGIN_DEBUG")) \
- { \
- printf (str, arg1, arg2); \
- }
+ do \
+ { \
+ if (plugin_debug) \
+ { \
+ printf (str, arg1, arg2); \
+ } \
+ } while (0)
#define PLUGIN_DEBUG_3ARG(str, arg1, arg2, arg3) \
- if (getenv ("ICEDTEAPLUGIN_DEBUG")) \
- { \
- printf (str, arg1, arg2, arg3); \
- }
+ do \
+ { \
+ if (plugin_debug) \
+ { \
+ printf (str, arg1, arg2, arg3); \
+ } \
+ } while (0)
#define PLUGIN_DEBUG_4ARG(str, arg1, arg2, arg3, arg4) \
- if (getenv ("ICEDTEAPLUGIN_DEBUG")) \
- { \
- printf (str, arg1, arg2, arg3, arg4); \
- }
+ do \
+ { \
+ if (plugin_debug) \
+ { \
+ printf (str, arg1, arg2, arg3, arg4); \
+ } \
+ } while (0)
#define PLUGIN_DEBUG(message) \
PLUGIN_DEBUG_1ARG ("ICEDTEA PLUGIN: %s\n", message)
@@ -1439,6 +1456,7 @@ IcedTeaPluginFactory::IcedTeaPluginFacto
out_watch_source(NULL),
out_to_appletviewer(NULL)
{
+ plugin_debug = getenv ("ICEDTEAPLUGIN_DEBUG") != NULL;
PLUGIN_TRACE_FACTORY ();
instances.Init ();
references.Init ();
More information about the distro-pkg-dev
mailing list