[gjs] Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro
- Date: Thu, 10 Mar 2011 21:29:57 +0000 (UTC)
commit e4ce5947b00cd73436d2a5e2305f919e8466b695
Author: Marc-Antoine Perennou <Marc-Antoine Perennou com>
Date: Fri Mar 4 17:33:35 2011 +0100
Drop the GJS_NATIVE_CONSTRUCTOR_VARIABLES macro
It was not very usefull and caused some gcc warning
because of argv not being used in some cases
https://bugzilla.gnome.org/show_bug.cgi?id=643325
gi/boxed.c | 3 ++-
gi/keep-alive.c | 2 +-
gi/ns.c | 2 +-
gi/object.c | 3 ++-
gi/param.c | 2 +-
gi/repo.c | 2 +-
gi/union.c | 2 +-
gjs/byteArray.c | 3 ++-
gjs/compat.h | 11 -----------
gjs/importer.c | 2 +-
modules/cairo-context.c | 3 ++-
modules/cairo-image-surface.c | 3 ++-
modules/cairo-linear-gradient.c | 3 ++-
modules/cairo-pdf-surface.c | 3 ++-
modules/cairo-ps-surface.c | 3 ++-
modules/cairo-radial-gradient.c | 3 ++-
modules/cairo-surface-pattern.c | 3 ++-
modules/cairo-svg-surface.c | 3 ++-
modules/dbus-exports.c | 2 +-
19 files changed, 29 insertions(+), 29 deletions(-)
---
diff --git a/gi/boxed.c b/gi/boxed.c
index 268d629..faff71e 100644
--- a/gi/boxed.c
+++ b/gi/boxed.c
@@ -416,7 +416,8 @@ boxed_init(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(boxed)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(boxed)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
Boxed *priv;
Boxed *proto_priv;
JSClass *obj_class;
diff --git a/gi/keep-alive.c b/gi/keep-alive.c
index 028f900..dd59d17 100644
--- a/gi/keep-alive.c
+++ b/gi/keep-alive.c
@@ -90,7 +90,7 @@ child_free(void *data)
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(keep_alive)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(keep_alive)
+ JSObject *object = NULL; \
KeepAlive *priv;
GJS_NATIVE_CONSTRUCTOR_PRELUDE(keep_alive);
diff --git a/gi/ns.c b/gi/ns.c
index 665af8a..945b5d0 100644
--- a/gi/ns.c
+++ b/gi/ns.c
@@ -156,7 +156,7 @@ ns_new_resolve(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(ns)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(ns)
+ JSObject *object = NULL; \
Ns *priv;
GJS_NATIVE_CONSTRUCTOR_PRELUDE(ns);
diff --git a/gi/object.c b/gi/object.c
index b55d743..5355ba6 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -620,7 +620,8 @@ wrapped_gobj_toggle_notify(gpointer data,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(object_instance)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(object_instance)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
ObjectInstance *priv;
ObjectInstance *proto_priv;
JSObject *proto;
diff --git a/gi/param.c b/gi/param.c
index 77b83af..6bbdad9 100644
--- a/gi/param.c
+++ b/gi/param.c
@@ -150,7 +150,7 @@ param_new_resolve(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(param)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(param)
+ JSObject *object = NULL; \
Param *priv;
Param *proto_priv;
JSClass *obj_class;
diff --git a/gi/repo.c b/gi/repo.c
index 097ca67..db6905e 100644
--- a/gi/repo.c
+++ b/gi/repo.c
@@ -169,7 +169,7 @@ repo_new_resolve(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(repo)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(repo)
+ JSObject *object = NULL; \
Repo *priv;
GJS_NATIVE_CONSTRUCTOR_PRELUDE(repo);
diff --git a/gi/union.c b/gi/union.c
index 8d1ee6e..cdf93dd 100644
--- a/gi/union.c
+++ b/gi/union.c
@@ -209,7 +209,7 @@ union_new(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(union)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(union)
+ JSObject *object = NULL; \
Union *priv;
Union *proto_priv;
JSClass *obj_class;
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index 02c627f..70a4203 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -439,7 +439,8 @@ gjs_g_byte_array_new(int preallocated_length)
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(byte_array)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(byte_array)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
ByteArrayInstance *priv;
JSObject *proto;
gboolean is_proto;
diff --git a/gjs/compat.h b/gjs/compat.h
index 3ceeb1d..c3599b2 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -81,15 +81,6 @@ gjs_##name##_constructor(JSContext *context, \
jsval *vp)
/**
- * GJS_NATIVE_CONSTRUCTOR_VARIABLES:
- * Declare variables necessary for the constructor; should
- * be at the very top.
- */
-#define GJS_NATIVE_CONSTRUCTOR_VARIABLES(name) \
- JSObject *object = NULL; \
- jsval *argv = JS_ARGV(context, vp);
-
-/**
* GJS_NATIVE_CONSTRUCTOR_PRELUDE:
* Call after the initial variable declaration.
*/
@@ -123,8 +114,6 @@ gjs_##name##_constructor(JSContext *context, \
jsval *argv, \
jsval *retval)
-#define GJS_NATIVE_CONSTRUCTOR_VARIABLES(name)
-
#define GJS_NATIVE_CONSTRUCTOR_PRELUDE(name) \
if (!JS_IsConstructing(context)) { \
gjs_throw_constructor_error(context); \
diff --git a/gjs/importer.c b/gjs/importer.c
index fc5e16c..9e29545 100644
--- a/gjs/importer.c
+++ b/gjs/importer.c
@@ -967,7 +967,7 @@ importer_new_resolve(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(importer)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(importer)
+ JSObject *object = NULL; \
Importer *priv;
GJS_NATIVE_CONSTRUCTOR_PRELUDE(importer);
diff --git a/modules/cairo-context.c b/modules/cairo-context.c
index 7b9575f..bdb89ac 100644
--- a/modules/cairo-context.c
+++ b/modules/cairo-context.c
@@ -274,7 +274,8 @@ _gjs_cairo_context_construct_internal(JSContext *context,
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_context)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_context)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
JSObject *surface_wrapper;
cairo_surface_t *surface;
cairo_t *cr;
diff --git a/modules/cairo-image-surface.c b/modules/cairo-image-surface.c
index c2e587f..30b0df2 100644
--- a/modules/cairo-image-surface.c
+++ b/modules/cairo-image-surface.c
@@ -31,7 +31,8 @@ GJS_DEFINE_PROTO("CairoImageSurface", cairo_image_surface)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_image_surface)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_image_surface)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
int format, width, height;
cairo_surface_t *surface;
diff --git a/modules/cairo-linear-gradient.c b/modules/cairo-linear-gradient.c
index 74efc90..4132c96 100644
--- a/modules/cairo-linear-gradient.c
+++ b/modules/cairo-linear-gradient.c
@@ -31,7 +31,8 @@ GJS_DEFINE_PROTO("CairoLinearGradient", cairo_linear_gradient)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_linear_gradient)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_linear_gradient)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
double x0, y0, x1, y1;
cairo_pattern_t *pattern;
diff --git a/modules/cairo-pdf-surface.c b/modules/cairo-pdf-surface.c
index 6aca613..144d53b 100644
--- a/modules/cairo-pdf-surface.c
+++ b/modules/cairo-pdf-surface.c
@@ -34,7 +34,8 @@ GJS_DEFINE_PROTO("CairoPDFSurface", cairo_pdf_surface)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_pdf_surface)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_pdf_surface)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
char *filename;
double width, height;
cairo_surface_t *surface;
diff --git a/modules/cairo-ps-surface.c b/modules/cairo-ps-surface.c
index ca0fad4..6e86c1a 100644
--- a/modules/cairo-ps-surface.c
+++ b/modules/cairo-ps-surface.c
@@ -34,7 +34,8 @@ GJS_DEFINE_PROTO("CairoPSSurface", cairo_ps_surface)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_ps_surface)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_ps_surface)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
char *filename;
double width, height;
cairo_surface_t *surface;
diff --git a/modules/cairo-radial-gradient.c b/modules/cairo-radial-gradient.c
index 48f8b0b..6b9a20c 100644
--- a/modules/cairo-radial-gradient.c
+++ b/modules/cairo-radial-gradient.c
@@ -31,7 +31,8 @@ GJS_DEFINE_PROTO("CairoRadialGradient", cairo_radial_gradient)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_radial_gradient)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_radial_gradient)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
double cx0, cy0, radius0, cx1, cy1, radius1;
cairo_pattern_t *pattern;
diff --git a/modules/cairo-surface-pattern.c b/modules/cairo-surface-pattern.c
index 8791e32..3f9cf3d 100644
--- a/modules/cairo-surface-pattern.c
+++ b/modules/cairo-surface-pattern.c
@@ -31,7 +31,8 @@ GJS_DEFINE_PROTO("CairoSurfacePattern", cairo_surface_pattern)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_surface_pattern)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_surface_pattern)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
JSObject *surface_wrapper;
cairo_surface_t *surface;
cairo_pattern_t *pattern;
diff --git a/modules/cairo-svg-surface.c b/modules/cairo-svg-surface.c
index 6acc26c..03880a4 100644
--- a/modules/cairo-svg-surface.c
+++ b/modules/cairo-svg-surface.c
@@ -34,7 +34,8 @@ GJS_DEFINE_PROTO("CairoSVGSurface", cairo_svg_surface)
GJS_NATIVE_CONSTRUCTOR_DECLARE(cairo_svg_surface)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(cairo_svg_surface)
+ JSObject *object = NULL; \
+ jsval *argv = JS_ARGV(context, vp);
char *filename;
double width, height;
cairo_surface_t *surface;
diff --git a/modules/dbus-exports.c b/modules/dbus-exports.c
index d5c7198..3c1d8b4 100644
--- a/modules/dbus-exports.c
+++ b/modules/dbus-exports.c
@@ -1708,7 +1708,7 @@ exports_new_resolve(JSContext *context,
*/
GJS_NATIVE_CONSTRUCTOR_DECLARE(js_exports)
{
- GJS_NATIVE_CONSTRUCTOR_VARIABLES(js_exports)
+ JSObject *object = NULL; \
Exports *priv;
GJS_NATIVE_CONSTRUCTOR_PRELUDE(js_exports);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]