From 92e43799ddc8b4d2a293cd5b421ea95b6cef0efd Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 27 Oct 2008 22:04:54 +0100 Subject: [PATCH] get rid of swfdec_as_value_to_debug() --- swfdec/swfdec_as_object.c | 31 ------------------------------- swfdec/swfdec_as_object.h | 3 --- swfdec/swfdec_as_types.c | 34 ---------------------------------- swfdec/swfdec_as_types.h | 1 - swfdec/swfdec_movie.c | 9 --------- vivified/core/vivi_wrap_as.c | 4 +--- 6 files changed, 1 insertion(+), 81 deletions(-) diff --git a/swfdec/swfdec_as_object.c b/swfdec/swfdec_as_object.c index b0a5c71a..48672655 100644 --- a/swfdec/swfdec_as_object.c +++ b/swfdec/swfdec_as_object.c @@ -751,15 +751,6 @@ swfdec_as_object_foreach_rename (SwfdecAsObject *object, SwfdecAsVariableForeach object->properties = fdata.properties_new; } -static char * -swfdec_as_object_do_debug (SwfdecAsObject *object) -{ - if (G_OBJECT_TYPE (object) != SWFDEC_TYPE_AS_OBJECT) - return g_strdup (G_OBJECT_TYPE_NAME (object)); - - return g_strdup ("Object"); -} - static GObject * swfdec_as_object_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) @@ -796,7 +787,6 @@ swfdec_as_object_class_init (SwfdecAsObjectClass *klass) klass->set_flags = swfdec_as_object_do_set_flags; klass->del = swfdec_as_object_do_delete; klass->foreach = swfdec_as_object_do_foreach; - klass->debug = swfdec_as_object_do_debug; } static void @@ -1816,27 +1806,6 @@ swfdec_as_object_init_context (SwfdecAsContext *context) } /** - * swfdec_as_object_get_debug: - * @object: a #SwfdecAsObject - * - * Gets a representation string suitable for debugging. This function is - * guaranteed to not modify the state of the script engine, unlike - * swfdec_as_value_to_string() for example. - * - * Returns: A newly allocated string. Free it with g_free() after use. - **/ -char * -swfdec_as_object_get_debug (SwfdecAsObject *object) -{ - SwfdecAsObjectClass *klass; - - g_return_val_if_fail (SWFDEC_IS_AS_OBJECT (object), NULL); - - klass = SWFDEC_AS_OBJECT_GET_CLASS (object); - return klass->debug (object); -} - -/** * swfdec_as_object_resolve: * @object: a #SwfdecAsObject * diff --git a/swfdec/swfdec_as_object.h b/swfdec/swfdec_as_object.h index 89bb8edc..44513195 100644 --- a/swfdec/swfdec_as_object.h +++ b/swfdec/swfdec_as_object.h @@ -96,8 +96,6 @@ struct _SwfdecAsObjectClass { gboolean (* foreach) (SwfdecAsObject * object, SwfdecAsVariableForeach func, gpointer data); - /* get a debug string representation for this object */ - char * (* debug) (SwfdecAsObject * object); }; GType swfdec_as_object_get_type (void); @@ -120,7 +118,6 @@ void swfdec_as_object_create (SwfdecAsFunction * fun, void swfdec_as_object_set_constructor(SwfdecAsObject * object, SwfdecAsObject * construct); SwfdecAsObject *swfdec_as_object_resolve (SwfdecAsObject * object); -char * swfdec_as_object_get_debug (SwfdecAsObject * object); void swfdec_as_object_set_relay (SwfdecAsObject * object, SwfdecAsRelay * relay); diff --git a/swfdec/swfdec_as_types.c b/swfdec/swfdec_as_types.c index 92c87de9..765dd420 100644 --- a/swfdec/swfdec_as_types.c +++ b/swfdec/swfdec_as_types.c @@ -435,40 +435,6 @@ swfdec_as_value_to_string (SwfdecAsContext *context, const SwfdecAsValue *value) } /** - * swfdec_as_value_to_debug: - * @value: a #SwfdecAsValue - * - * Converts the given @value to a string in a safe way. It will not call into - * the scripting engine. Its intended use is for output in debuggers. - * - * Returns: a newly allocated string. Free with g_free(). - **/ -char * -swfdec_as_value_to_debug (const SwfdecAsValue *value) -{ - g_return_val_if_fail (SWFDEC_IS_AS_VALUE (value), NULL); - - switch (SWFDEC_AS_VALUE_GET_TYPE (value)) { - case SWFDEC_AS_TYPE_STRING: - return g_shell_quote (SWFDEC_AS_VALUE_GET_STRING (value)); - case SWFDEC_AS_TYPE_UNDEFINED: - return g_strdup ("undefined"); - case SWFDEC_AS_TYPE_BOOLEAN: - return g_strdup (SWFDEC_AS_VALUE_GET_BOOLEAN (value) ? "true" : "false"); - case SWFDEC_AS_TYPE_NULL: - return g_strdup ("null"); - case SWFDEC_AS_TYPE_NUMBER: - return g_strdup_printf ("%g", SWFDEC_AS_VALUE_GET_NUMBER (value)); - case SWFDEC_AS_TYPE_OBJECT: - return swfdec_as_object_get_debug (SWFDEC_AS_VALUE_GET_OBJECT (value)); - case SWFDEC_AS_TYPE_INT: - default: - g_assert_not_reached (); - return NULL; - } -} - -/** * swfdec_as_value_to_number: * @context: a #SwfdecAsContext * @value: a #SwfdecAsValue used by context diff --git a/swfdec/swfdec_as_types.h b/swfdec/swfdec_as_types.h index b7640be9..5a899161 100644 --- a/swfdec/swfdec_as_types.h +++ b/swfdec/swfdec_as_types.h @@ -130,7 +130,6 @@ SwfdecAsObject *swfdec_as_value_to_object (SwfdecAsContext * context, void swfdec_as_value_to_primitive (SwfdecAsValue * value); const char * swfdec_as_value_to_string (SwfdecAsContext * context, const SwfdecAsValue * value); -char * swfdec_as_value_to_debug (const SwfdecAsValue * value); /* special conversion functions */ const char * swfdec_as_integer_to_string (SwfdecAsContext * context, diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c index 104e2796..5f3d7047 100644 --- a/swfdec/swfdec_movie.c +++ b/swfdec/swfdec_movie.c @@ -1271,14 +1271,6 @@ swfdec_movie_foreach_variable (SwfdecAsObject *object, SwfdecAsVariableForeach f return ret; } -static char * -swfdec_movie_get_debug (SwfdecAsObject *object) -{ - SwfdecMovie *movie = SWFDEC_MOVIE (object); - - return swfdec_movie_get_path (movie, TRUE); -} - typedef struct { SwfdecMovie * movie; int depth; @@ -1445,7 +1437,6 @@ swfdec_movie_class_init (SwfdecMovieClass * movie_class) asobject_class->get = swfdec_movie_get_variable; asobject_class->set = swfdec_movie_set_variable; asobject_class->foreach = swfdec_movie_foreach_variable; - asobject_class->debug = swfdec_movie_get_debug; signals[MATRIX_CHANGED] = g_signal_new ("matrix-changed", G_TYPE_FROM_CLASS (movie_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, diff --git a/vivified/core/vivi_wrap_as.c b/vivified/core/vivi_wrap_as.c index 79d942dc..52decebe 100644 --- a/vivified/core/vivi_wrap_as.c +++ b/vivified/core/vivi_wrap_as.c @@ -31,7 +31,6 @@ vivi_wrap_toString (SwfdecAsContext *cx, SwfdecAsObject *this, guint argc, SwfdecAsValue *argv, SwfdecAsValue *retval) { ViviWrap *wrap; - char *s; if (!VIVI_IS_WRAP (this)) return; @@ -40,8 +39,7 @@ vivi_wrap_toString (SwfdecAsContext *cx, SwfdecAsObject *this, if (wrap->wrap == NULL) return; - s = swfdec_as_object_get_debug (wrap->wrap); - SWFDEC_AS_VALUE_SET_STRING (retval, swfdec_as_context_give_string (cx, s)); + SWFDEC_AS_VALUE_SET_STRING (retval, swfdec_as_context_get_string (cx, "Here be debugging output")); } VIVI_FUNCTION ("wrap_get", vivi_wrap_get) -- 2.11.4.GIT