[gjs] Fix build when verbose debug output is enabled
- From: Hashem Nasarat <hnasarat src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] Fix build when verbose debug output is enabled
- Date: Wed, 10 Feb 2016 17:55:53 +0000 (UTC)
commit e999545cce611efe03fc7d29c2862c302cc1405d
Author: Hashem Nasarat <hashem riseup net>
Date: Sun Jan 31 10:24:52 2016 -0500
Fix build when verbose debug output is enabled
Mostly this commit updates JSHandle* usage in debug statement to fix
invalid use of incomplete type 'class JSObject':
In 9daff9c4 the type of JSHandle* objects was changed but the debug
statements were left as is. This commit fixes this oversight so
GJS_DEBUG_OUTPUT can be used again.
Other small fixes due to code rot were fixed.
With this commit you can set all the GJS_VERBOSE_ENABLE macros to 1,
recompile, unset GJS_DEBUG_TOPICS, and get all the verbose debug output
from gjs.
https://bugzilla.gnome.org/show_bug.cgi?id=761366
gi/boxed.cpp | 3 ++-
gi/function.cpp | 7 ++++---
gi/fundamental.cpp | 8 +++++---
gi/gerror.cpp | 4 ++--
gi/ns.cpp | 4 +++-
gi/object.cpp | 8 +++++---
gi/repo.cpp | 4 ++--
gi/repo.h | 1 +
gi/union.cpp | 3 ++-
gjs/importer.cpp | 4 +++-
10 files changed, 29 insertions(+), 17 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 7584525..ebb5ad7 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -131,7 +131,8 @@ boxed_new_resolve(JSContext *context,
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
- gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p", name, *obj, priv);
+ gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL)
goto out; /* wrong class */
diff --git a/gi/function.cpp b/gi/function.cpp
index 6a3b8c7..f38b64b 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1311,9 +1311,10 @@ function_call(JSContext *context,
jsval retval;
priv = priv_from_js(context, callee);
- gjs_debug_marshal(GJS_DEBUG_GFUNCTION, "Call callee %p priv %p this obj %p %s", callee, priv,
- obj, JS_GetTypeName(context,
- JS_TypeOfValue(context, OBJECT_TO_JSVAL(object))));
+ gjs_debug_marshal(GJS_DEBUG_GFUNCTION,
+ "Call callee %p priv %p this obj %p %s", callee, priv,
+ object,
+ JS_GetTypeName(context, JS_TypeOfValue(context, OBJECT_TO_JSVAL(object))));
if (priv == NULL)
return JS_TRUE; /* we are the prototype, or have the wrong class */
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index 3488315..87b2293 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -154,8 +154,8 @@ init_fundamental_instance(JSContext *context,
JS_SetPrivate(object, priv);
gjs_debug_lifecycle(GJS_DEBUG_GFUNDAMENTAL,
- "fundamental instance constructor, obj %p priv %p proto %p ",
- object, priv, JS_GetPrototype (object));
+ "fundamental instance constructor, obj %p priv %p",
+ object, priv);
proto_priv = proto_priv_from_js(context, object);
g_assert(proto_priv != NULL);
@@ -307,7 +307,9 @@ fundamental_instance_new_resolve(JSContext *context,
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
- gjs_debug_jsprop(GJS_DEBUG_GFUNDAMENTAL, "Resolve prop '%s' hook obj %p priv %p", name, *obj, priv);
+ gjs_debug_jsprop(GJS_DEBUG_GFUNDAMENTAL,
+ "Resolve prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL)
goto out; /* wrong class */
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index f183ca3..39786d7 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -499,8 +499,8 @@ gjs_error_from_gerror(JSContext *context,
}
gjs_debug_marshal(GJS_DEBUG_GBOXED,
- "Wrapping struct %s %p with JSObject",
- g_base_info_get_name((GIBaseInfo *)info), gboxed);
+ "Wrapping struct %s with JSObject",
+ g_base_info_get_name((GIBaseInfo *)info));
proto = gjs_lookup_generic_prototype(context, info);
proto_priv = priv_from_js(context, proto);
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 02bd6ca..03e5f8f 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -80,7 +80,9 @@ ns_new_resolve(JSContext *context,
}
priv = priv_from_js(context, obj);
- gjs_debug_jsprop(GJS_DEBUG_GNAMESPACE, "Resolve prop '%s' hook obj %p priv %p", name, *obj, priv);
+ gjs_debug_jsprop(GJS_DEBUG_GNAMESPACE,
+ "Resolve prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL) {
ret = JS_TRUE; /* we are the prototype, or have the wrong class */
diff --git a/gi/object.cpp b/gi/object.cpp
index af79482..74121f8 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -268,7 +268,8 @@ object_instance_get_prop(JSContext *context,
priv = priv_from_js(context, obj);
gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
- "Get prop '%s' hook obj %p priv %p", name, *obj, priv);
+ "Get prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL) {
/* If we reach this point, either object_instance_new_resolve
@@ -336,7 +337,8 @@ object_instance_set_prop(JSContext *context,
priv = priv_from_js(context, obj);
gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
- "Set prop '%s' hook obj %p priv %p", name, *obj, priv);
+ "Set prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL) {
/* see the comment in object_instance_get_prop() on this */
@@ -520,7 +522,7 @@ object_instance_new_resolve(JSContext *context,
gjs_debug_jsprop(GJS_DEBUG_GOBJECT,
"Resolve prop '%s' hook obj %p priv %p (%s.%s) gobj %p %s",
name,
- *obj,
+ (void *)obj,
priv,
priv && priv->info ? g_base_info_get_namespace (priv->info) : "",
priv && priv->info ? g_base_info_get_name (priv->info) : "",
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 748d3d5..7b5b59f 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -40,7 +40,6 @@
#include <gjs/compat.h>
#include <gjs/jsapi-private.h>
-#include <util/log.h>
#include <util/misc.h>
#include <girepository.h>
@@ -191,7 +190,8 @@ repo_new_resolve(JSContext *context,
goto out;
priv = priv_from_js(context, obj);
- gjs_debug_jsprop(GJS_DEBUG_GREPO, "Resolve prop '%s' hook obj %p priv %p", name, *obj, priv);
+ gjs_debug_jsprop(GJS_DEBUG_GREPO, "Resolve prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL) /* we are the prototype, or have the wrong class */
goto out;
diff --git a/gi/repo.h b/gi/repo.h
index ba1fd90..ad4c7ed 100644
--- a/gi/repo.h
+++ b/gi/repo.h
@@ -29,6 +29,7 @@
#include <girepository.h>
#include <gjs/gjs-module.h>
+#include <util/log.h>
G_BEGIN_DECLS
diff --git a/gi/union.cpp b/gi/union.cpp
index 23ca458..870534c 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -77,7 +77,8 @@ union_new_resolve(JSContext *context,
return JS_TRUE; /* not resolved, but no error */
priv = priv_from_js(context, obj);
- gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p", name, *obj, priv);
+ gjs_debug_jsprop(GJS_DEBUG_GBOXED, "Resolve prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL) {
ret = JS_FALSE; /* wrong class */
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 1708e0a..d5c4c90 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -872,7 +872,9 @@ importer_new_resolve(JSContext *context,
goto out;
priv = priv_from_js(context, obj);
- gjs_debug_jsprop(GJS_DEBUG_IMPORTER, "Resolve prop '%s' hook obj %p priv %p", name, *obj, priv);
+ gjs_debug_jsprop(GJS_DEBUG_IMPORTER,
+ "Resolve prop '%s' hook obj %p priv %p",
+ name, (void *)obj, priv);
if (priv == NULL) /* we are the prototype, or have the wrong class */
goto out;
JS_BeginRequest(context);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]