search for: swfdec_as_double_to_string

Displaying 19 results from an estimated 19 matches for "swfdec_as_double_to_string".

2008 Jan 07
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_types.c libswfdec/swfdec_xml.c
...;swfdec_asbroadcaster.c | 2 +- libswfdec/swfdec_xml.c | 5 +++-- 6 files changed, 24 insertions(+), 27 deletions(-) New commits: commit 7384ece8d36106701d9231cae70a071af55206fe Author: Benjamin Otte <otte at gnome.org> Date: Mon Jan 7 10:39:35 2008 +0100 replace swfdec_as_double_to_string with swfdec_as_integer_to_string where appropriate diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c index 61a62e9..f28170c 100644 --- a/libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -182,7 +182,7 @@ swfdec_as_array_remove_ran...
2007 Jul 21
0
12 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/jpeg libswfdec/swfdec_as_array.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_player.c libswfdec/swfdec_player.h libswfdec/swfdec_player_internal.h
...dx = swfdec_as_array_to_index (variable); + if (idx == -1) return variable; - if (index >= fdata->start_index && index < fdata->start_index + fdata->num) { + if (idx >= fdata->start_index && idx < fdata->start_index + fdata->num) { return swfdec_as_double_to_string (object->context, - fdata->to_index + index - fdata->start_index); - } else if (index >= fdata->to_index && index < fdata->to_index + fdata->num) { + fdata->to_index + idx - fdata->start_index); + } else if (idx >= fdata->to_index && idx < fd...
2007 Aug 17
0
2 commits - libswfdec/swfdec_as_array.c test/trace
...rgv, SwfdecAsValue *ret) { gint32 length; const char *var; - length = swfdec_as_array_get_length (object); - if (length <= 0) + // we allow negative indexes here, but not 0 + length = swfdec_as_array_get_length_as_integer (object); + if (length == 0) return; var = swfdec_as_double_to_string (object->context, length - 1); swfdec_as_object_get_variable (object, var, ret); - swfdec_as_array_set_length (object, length - 1); + + // if Array, the length is reduced by one (which destroys the variable also) + // else the length is not reduced at all, but the variable...
2007 Aug 17
0
Branch 'vivi' - 9 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_function.h libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_native_function.c
...rgv, SwfdecAsValue *ret) { gint32 length; const char *var; - length = swfdec_as_array_get_length (object); - if (length <= 0) + // we allow negative indexes here, but not 0 + length = swfdec_as_array_get_length_as_integer (object); + if (length == 0) return; var = swfdec_as_double_to_string (object->context, length - 1); swfdec_as_object_get_variable (object, var, ret); - swfdec_as_array_set_length (object, length - 1); + + // if Array, the length is reduced by one (which destroys the variable also) + // else the length is not reduced at all, but the variable...
2007 Dec 17
0
2 commits - doc/Makefile.am doc/swfdec-sections.txt NEWS
...swfdec_player_get_audio swfdec_player_get_maximum_runtime swfdec_player_set_maximum_runtime <SUBSECTION Standard> +SwfdecPlayerPrivate SwfdecPlayerClass SWFDEC_PLAYER SWFDEC_IS_PLAYER @@ -284,6 +287,7 @@ SWFDEC_AS_VALUE_SET_OBJECT swfdec_as_value_to_primitive swfdec_as_value_to_debug swfdec_as_double_to_string +swfdec_as_integer_to_string swfdec_as_str_concat <SUBSECTION Standard> SWFDEC_IS_AS_VALUE @@ -344,6 +348,7 @@ swfdec_as_object_set_variable_and_flags swfdec_as_object_add_variable swfdec_as_object_set_variable_flags swfdec_as_object_unset_variable_flags +swfdec_as_object_has_variable...
2007 Jun 28
0
Branch 'as' - 2 commits - doc/swfdec-sections.txt libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...FDEC_AS_VALUE_SET_INT +SWFDEC_AS_VALUE_SET_NUMBER +SWFDEC_AS_VALUE_GET_STRING +swfdec_as_value_to_string +SWFDEC_AS_VALUE_SET_STRING +SWFDEC_AS_VALUE_SET_NULL +SWFDEC_AS_VALUE_GET_OBJECT swfdec_as_value_to_object +SWFDEC_AS_VALUE_SET_OBJECT swfdec_as_value_to_primitive -swfdec_as_value_to_string +swfdec_as_double_to_string +swfdec_as_str_concat +<SUBSECTION Standard> +SWFDEC_IS_AS_VALUE +SWFDEC_AS_VALUE_IS_UNDEFINED +SWFDEC_AS_VALUE_IS_BOOLEAN +SWFDEC_AS_VALUE_IS_NUMBER +SWFDEC_AS_VALUE_IS_STRING +SWFDEC_AS_VALUE_IS_NULL +SWFDEC_AS_VALUE_IS_OBJECT </SECTION> diff --git a/libswfdec/swfdec_as_t...
2007 Jul 12
0
Branch 'as' - 7 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_with.c libswfdec/swfdec_sprite_movie.c test/trace
...wfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -368,16 +368,20 @@ swfdec_as_array_join (SwfdecAsContext *c length = swfdec_as_array_get_length (object); if (length > 0) { + /* FIXME: implement this with the StringBuilder class */ + GString *string; var = swfdec_as_double_to_string (cx, 0); swfdec_as_object_get_variable (object, var, &val); str = swfdec_as_value_to_string (cx, &val); + string = g_string_new (str); for (i = 1; i < length; i++) { var = swfdec_as_double_to_string (cx, i); swfdec_as_object_get_variable (object, var, &amp...
2007 Sep 14
0
4 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_object.c test/trace
...providing argv not as an array */ + if (!swfdec_as_context_use_mem (cx, sizeof (SwfdecAsValue) * length)) + return; argv_pass = g_malloc (sizeof (SwfdecAsValue) * length); for (i = 0; i < length; i++) { @@ -201,21 +205,18 @@ swfdec_as_function_apply (SwfdecAsContex swfdec_as_double_to_string (cx, i), &argv_pass[i]); } } else { - argv_pass = NULL; + length = 0; } - - swfdec_as_function_call (SWFDEC_AS_FUNCTION (fun), thisp, length, - argv_pass, ret); - - if (argv_pass != NULL) - g_free (argv_pass); - } - else - { - swfdec_as_function_call...
2007 Dec 03
0
12 commits - libswfdec/Makefile.am libswfdec/swfdec_as_strings.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_gradient_pattern.c libswfdec/swfdec_gradient_pattern.h libswfdec/swfdec_movie_as_drawing.c libswfdec/swfdec_pattern.c
...a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c index 34cbbc5..d4bbfb9 100644 --- a/libswfdec/swfdec_as_types.c +++ b/libswfdec/swfdec_as_types.c @@ -216,6 +216,22 @@ swfdec_as_str_concat (SwfdecAsContext *cx, const char * s1, const char *s2) /** * swfdec_as_double_to_string: * @context: a #SwfdecAsContext + * @i: an integer that fits into 32 bits + * + * Converts @d into a string using the same conversion algorithm as the + * official Flash player. + * + * Returns: a garbage-collected string + **/ +const char * +swfdec_as_integer_to_string (SwfdecAsContext *con...
2007 Jun 28
0
Branch 'as' - 4 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...+ * + * Convenience function to concatenate two garbage-collected strings. This + * function is equivalent to g_strconcat (). + * + * Returns: A new garbage-collected string + **/ const char * swfdec_as_str_concat (SwfdecAsContext *cx, const char * s1, const char *s2) { @@ -174,10 +235,13 @@ swfdec_as_double_to_string (SwfdecAsCont * @context: a #SwfdecAsContext * @value: value to be expressed as string * - * Converts @value to a string. - * <warning>This function may run the garbage collector.</warning> + * Converts @value to a string according to the rules of Flash. This might + * cause...
2008 Jan 10
0
8 commits - libswfdec/swfdec_as_date.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_bits.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_text_field_movie_html.c test/trace
...ff --git a/libswfdec/swfdec_as_types.c b/libswfdec/swfdec_as_types.c index 8e87a6b..420d094 100644 --- a/libswfdec/swfdec_as_types.c +++ b/libswfdec/swfdec_as_types.c @@ -248,105 +248,103 @@ swfdec_as_integer_to_string (SwfdecAsContext *context, int i) const char * swfdec_as_double_to_string (SwfdecAsContext *context, double d) { + gboolean found = FALSE, gotdot = FALSE; + guint digits = 15; + char tmp[50], *end, *start, *s; + g_return_val_if_fail (SWFDEC_IS_AS_CONTEXT (context), SWFDEC_AS_STR_EMPTY); - switch (fpclassify (d)) { - case FP_ZERO: - return SWFDEC_AS_STR_...
2007 Sep 04
0
4 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_video_movie_as.c test/trace
...--- a/libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -549,7 +549,7 @@ swfdec_as_array_foreach_reverse (SwfdecA gint32 idx; idx = swfdec_as_array_to_index (variable); - if (idx == -1) + if (idx == -1 || idx >= *length) return variable; return swfdec_as_double_to_string (object->context, *length - 1 - idx); @@ -761,7 +761,7 @@ swfdec_as_array_foreach_sort_rename (Swf gboolean after_undefined = FALSE; idx = swfdec_as_array_to_index (variable); - if (idx == -1) + if (idx == -1 || idx >= fdata->length) return variable; if (SWFDEC_AS_VALUE...
2007 Jul 12
0
15 commits - doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt INSTALL libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.h
...LE>Enumerations</TITLE> +SwfdecAsContextState SwfdecLoaderDataType SwfdecLoaderRequest swfdec_loader_data_type_get_extension @@ -205,6 +206,7 @@ SWFDEC_AS_VALUE_GET_OBJECT swfdec_as_value_to_object SWFDEC_AS_VALUE_SET_OBJECT swfdec_as_value_to_primitive +swfdec_as_value_to_debug swfdec_as_double_to_string swfdec_as_str_concat <SUBSECTION Standard> @@ -220,6 +222,7 @@ SWFDEC_AS_VALUE_IS_OBJECT <SECTION> <FILE>SwfdecAsContext</FILE> <TITLE>SwfdecAsContext</TITLE> +SwfdecAsContext swfdec_as_context_startup swfdec_as_context_abort swfdec_as_context_get...
2007 Jul 27
0
11 commits - libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_strings.c libswfdec/swfdec_initialize.as libswfdec/swfdec_initialize.h libswfdec/swfdec_net_stream.c libswfdec/swfdec_player.c libswfdec/swfdec_sprite_movie_as.c test/trace
...o; gint i, length; const char *name; GSList *list = NULL, *walk; @@ -61,9 +61,13 @@ broadcastMessage (SwfdecAsContext *cx, S /* FIXME: solve this wth foreach, so it gets faster for weird cases */ for (i = 0; i < length; i++) { swfdec_as_object_get_variable (listeners, swfdec_as_double_to_string (cx, i), &val); - if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) - list = g_slist_prepend (list, SWFDEC_AS_VALUE_GET_OBJECT (&val)); + o = swfdec_as_value_to_object (cx, &val); + if (o == NULL) + continue; + list = g_slist_prepend (list, o); } + if (list == NULL) +...
2007 Dec 20
0
13 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml_node.c test/trace
...#47;libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -181,8 +181,8 @@ swfdec_as_array_remove_range (SwfdecAsArray *array, gint32 start_index, // to avoid foreach loop, use special case when removing just one variable if (num == 1) { - const char *var = swfdec_as_double_to_string (object->context, start_index); - swfdec_as_object_delete_variable (object, var); + swfdec_as_object_delete_variable (object, + swfdec_as_double_to_string (object->context, start_index)); } else { ForeachRemoveRangeData fdata = { start_index, num }; swfdec_as_object_foreach...
2007 Sep 11
0
8 commits - libswfdec/swfdec_as_function.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_strings.c test/trace
...s_object_get_variable (array, SWFDEC_AS_STR_length, &val); + length = swfdec_as_value_to_integer (cx, &val); + + if (length > 0) { + argv_pass = g_malloc (sizeof (SwfdecAsValue) * length); + + for (i = 0; i < length; i++) { + swfdec_as_object_get_variable (array, + swfdec_as_double_to_string (cx, i), &argv_pass[i]); + } + } else { + argv_pass = NULL; + } + + swfdec_as_function_call (SWFDEC_AS_FUNCTION (fun), thisp, length, + argv_pass, ret); + + if (argv_pass != NULL) + g_free (argv_pass); + } + else + { + swfdec_as_function_call (SWFDEC_AS_FUNCTION...
2007 Jul 26
0
17 commits - doc/swfdec-sections.txt libswfdec/compiler.c libswfdec/.gitignore libswfdec/Makefile.am libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
...nteger (cx, &val); + + /* return undefined if we won't try to call anything */ + if (length <= 0) + return; + + /* FIXME: solve this wth foreach, so it gets faster for weird cases */ + for (i = 0; i < length; i++) { + swfdec_as_object_get_variable (listeners, swfdec_as_double_to_string (cx, i), &val); + if (SWFDEC_AS_VALUE_IS_OBJECT (&val)) + list = g_slist_prepend (list, SWFDEC_AS_VALUE_GET_OBJECT (&val)); + } + list = g_slist_reverse (list); + for (walk = list; walk; walk = walk->next) { + swfdec_as_object_call (walk->data, name, argc, argv, &amp...
2007 Jul 04
0
Branch 'as' - 25 commits - libswfdec/Makefile.am libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c
...o_objec 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_double_to_string (SwfdecAsContext * context, diff --git a/player/swfdec_debug_stack.c b/player/swfdec_debug_stack.c index b6f2a91..3afffea 100644 --- a/player/swfdec_debug_stack.c +++ b/player/swfdec_debug_stack.c @@ -72,11 +72,12 @@ swfdec_debug_stack_set_model (SwfdecDebu guin...
2008 Jan 01
0
4 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h libswfdec/swfdec_sprite_movie_as.c test/trace
...wfdec_as_types.h @@ -127,6 +127,7 @@ char * swfdec_as_value_to_debug (const SwfdecAsValue * value); /* special conversion functions */ const char * swfdec_as_integer_to_string (SwfdecAsContext * context, int i); +int swfdec_as_double_to_integer (double d); const char * swfdec_as_double_to_string (SwfdecAsContext * context, double d); const char * swfdec_as_str_concat (SwfdecAsContext * cx,