search for: swfdec_as_stack_push

Displaying 20 results from an estimated 22 matches for "swfdec_as_stack_push".

2007 Apr 04
0
Branch 'as' - 9 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_stack.c libswfdec/swfdec_as_stack.h
...uot;, type); + swfdec_as_stack_ensure_left (stack, 1); switch (type) { case 0: /* string */ { const char *s = swfdec_bits_skip_string (&bits); - if (!swfdec_action_push_string (cx, s)) - return JS_FALSE; + if (s == NULL) + return; + SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (stack), + swfdec_as_context_get_string (cx, s)); break; } case 1: /* float */ - { - double d = swfdec_bits_get_float (&bits); - if (!JS_NewDoubleValue (cx, d, cx->fp->sp)) - return JS_FALSE; - cx->fp->sp++; - break; - } + SWFDEC_AS_VALUE_SET_NUMBER (...
2007 Oct 25
0
6 commits - libswfdec/swfdec_as_interpret.c test/trace
...k_pop (cx); if (SWFDEC_AS_VALUE_IS_OBJECT (val)) { - object = SWFDEC_AS_VALUE_GET_OBJECT (val); + constructor = SWFDEC_AS_VALUE_GET_OBJECT (val); } else { - object = NULL; + constructor = NULL; } - if (object == NULL || constructor == NULL) { SWFDEC_AS_VALUE_SET_NULL (swfdec_as_stack_push (cx)); return; commit 0a4255c80ae147befa09d263b6025ee775e95ab5 Author: Pekka Lampila <pekka.lampila at iki.fi> Date: Thu Oct 25 19:53:15 2007 +0300 Implement Cast ActionScript action diff --git a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 3b45b3b..b18...
2007 Mar 29
0
Branch 'as' - 9 commits - configure.ac doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_stack.c
...if_fail (SWFDEC_IS_AS_CONTEXT (context)); + g_return_if_fail (context->frame != NULL); + g_return_if_fail (retval == NULL || SWFDEC_IS_AS_VALUE (retval)); + + context->frame = context->frame->next; + swfdec_as_stack_ensure_left (context->frame->stack, 1); + if (retval) { + swfdec_as_stack_push (context->frame->stack, retval); + } else { + SwfdecAsValue value = { SWFDEC_TYPE_AS_UNDEFINED, }; + swfdec_as_stack_push (context->frame->stack, &value); + } +} diff --git a/libswfdec/swfdec_as_context.h b/libswfdec/swfdec_as_context.h index 67e7ec2..420df04 100644 --- a/li...
2007 Jul 30
0
10 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_super.c libswfdec/swfdec_video_movie_as.c test/trace
...349,9 +349,10 @@ swfdec_action_push (SwfdecAsContext *cx, guint regnum = swfdec_bits_get_u8 (&bits); if (!swfdec_action_has_register (cx, regnum)) { SWFDEC_ERROR ("cannot Push register %u: not enough registers", regnum); - return; + SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (cx)); + } else { + *swfdec_as_stack_push (cx) = cx->frame->registers[regnum]; } - *swfdec_as_stack_push (cx) = cx->frame->registers[regnum]; break; } case 5: /* boolean */ diff-tree 63d07e3882ee47cffd2a69b1c1e84b22fc52c64d (from ad8ff3e999a5e7fcae04ba5d9843dfdd...
2007 Apr 12
0
Branch 'as' - 15 commits - 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 libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c
...f_fail (SWFDEC_IS_AS_CONTEXT (context)); g_return_if_fail (context->frame != NULL); - g_return_if_fail (retval == NULL || SWFDEC_IS_AS_VALUE (retval)); context->frame = context->frame->next; - swfdec_as_stack_ensure_left (context->frame->stack, 1); - if (retval) { - *swfdec_as_stack_push (context->frame->stack) = *retval; - } else { - SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (context->frame->stack)); - } } void diff --git a/libswfdec/swfdec_as_context.h b/libswfdec/swfdec_as_context.h index b4b2777..ca1b818 100644 --- a/libswfdec/swfdec_as_context.h...
2007 Sep 03
0
4 commits - libswfdec/swfdec_as_boolean.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c libswfdec/swfdec_as_initialize.as libswfdec/swfdec_as_initialize.h libswfdec/swfdec_as_interpret.c test/trace
...(SwfdecAsObject *object, const char *variable, + SwfdecAsValue *value, guint flags, gpointer listp) { - SwfdecAsContext *cx = cxp; + GSList **list = listp; if (flags & SWFDEC_AS_VARIABLE_HIDDEN) return TRUE; - swfdec_as_stack_ensure_free (cx, 1); - SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), variable); + + *list = g_slist_remove (*list, variable); + *list = g_slist_prepend (*list, (gpointer) variable); return TRUE; } static void +swfdec_action_do_enumerate (SwfdecAsContext *cx, SwfdecAsObject *object) +{ + guint i; + GSList *walk, *list = NULL; + + for (i = 0; i &lt...
2007 May 20
0
Branch 'as' - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_player.c
...AXULONG / 1000 - 1) { + SWFDEC_ERROR ("FIXME: time overflow"); + } + diff *= 1000; + diff = diff + (tv.tv_usec - cx->start_time.tv_usec) / 1000; - *cx->fp->sp++ = INT_TO_JSVAL ((int) SWFDEC_TICKS_TO_MSECS (player->time)); - return JS_TRUE; + SWFDEC_AS_VALUE_SET_INT (swfdec_as_stack_push (cx->frame->stack), diff); } -#endif static void swfdec_action_extends (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) @@ -2070,9 +2077,7 @@ const SwfdecActionSpec swfdec_as_actions [SWFDEC_AS_ACTION_MB_STRING_LENGTH] = { "MBStringLength", NULL }, [SWFD...
2007 Jun 28
0
Branch 'as' - 5 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_movie.c test/trace
...wfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -592,6 +592,7 @@ error: if (n_args > swfdec_as_stack_get_size (frame->stack)) n_args = swfdec_as_stack_get_size (frame->stack); swfdec_as_stack_pop_n (frame->stack, n_args); + SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (frame->stack)); return FALSE; } diff-tree 2966839c6ed4b0d33c7681654a80df45063f60dd (from 692c9a4cde349cc8c927e182c36de44a2e9c6a42) Author: Benjamin Otte <otte at gnome.org> Date: Thu Jun 28 15:03:24 2007 +0200 remove workaround for broken ALSA ALSA seems to be fixed...
2007 Jul 02
0
Branch 'as' - 24 commits - configure.ac doc/Makefile.am doc/swfdec-sections.txt libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c
...swfdec_action_define_function (SwfdecAsC swfdec_script_add_to_context (script, cx); /* attach the function */ if (*function_name == '\0') { - swfdec_as_stack_ensure_left (frame->stack, 1); + swfdec_as_stack_ensure_free (frame->stack, 1); SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (frame->stack), SWFDEC_AS_OBJECT (fun)); } else { SwfdecAsValue funval; @@ -1863,7 +1863,7 @@ swfdec_action_do_enumerate (SwfdecAsObje if (flags & SWFDEC_AS_VARIABLE_DONT_ENUM) return TRUE; - swfdec_as_stack_ensure_left (stack, 1); + swfdec_as_stack_ensure_free (stack, 1)...
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...+ +static gboolean +swfdec_action_do_enumerate (SwfdecAsObject *object, const SwfdecAsValue *val, + SwfdecAsVariable *var, gpointer stackp) +{ + SwfdecAsStack *stack = stackp; + + if (var->flags | SWFDEC_AS_VARIABLE_DONT_ENUM) + return TRUE; + swfdec_as_stack_ensure_left (stack, 1); + *swfdec_as_stack_push (stack) = *val; + return TRUE; +} + +static void +swfdec_action_enumerate (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) +{ + SwfdecAsValue *val; + SwfdecAsStack *stack; + SwfdecAsObject *obj; + + stack = cx->frame->stack; + val = swfdec_as_stack_peek (stack, 1); + +...
2007 Aug 17
0
4 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h test/trace
...ype, &proto); @@ -1883,7 +1885,7 @@ swfdec_action_do_enumerate (SwfdecAsObje { SwfdecAsContext *cx = cxp; - if (flags & SWFDEC_AS_VARIABLE_DONT_ENUM) + if (flags & SWFDEC_AS_VARIABLE_HIDDEN) return TRUE; swfdec_as_stack_ensure_free (cx, 1); SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), variable); diff --git a/libswfdec/swfdec_as_object.c b/libswfdec/swfdec_as_object.c index b5dcd25..46c590d 100644 --- a/libswfdec/swfdec_as_object.c +++ b/libswfdec/swfdec_as_object.c @@ -245,7 +245,7 @@ swfdec_as_object_do_set (SwfdecAsObject if (var == NULL) return; } - if...
2007 Nov 22
0
5 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_debugger.c libswfdec/swfdec_movie.c libswfdec/swfdec_script.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c libswfdec/swfdec_text_field.c
...nt action, const guint8 *data, guint switch (type) { case 0: /* string */ { - char *s = swfdec_bits_get_string_with_version (&bits, cx->version); + char *s = swfdec_bits_get_string (&bits, cx->version); if (s == NULL) return; SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), @@ -1130,8 +1130,8 @@ swfdec_action_get_url (SwfdecAsContext *cx, guint action, const guint8 *data, gu char *url, *target; swfdec_bits_init_data (&bits, data, len); - url = swfdec_bits_get_string_with_version (&bits, cx->version); - target = swfdec_bits_get_string_with_v...
2007 Aug 20
0
15 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_super.c libswfdec/swfdec_as_with.c
...a/libswfdec/swfdec_as_interpret.c b/libswfdec/swfdec_as_interpret.c index 23e4116..4a712c2 100644 --- a/libswfdec/swfdec_as_interpret.c +++ b/libswfdec/swfdec_as_interpret.c @@ -331,7 +331,7 @@ swfdec_action_push (SwfdecAsContext *cx, if (s == NULL) return; SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (cx), - swfdec_as_context_get_string (cx, s)); + swfdec_as_context_give_string (cx, s)); break; } case 1: /* float */ diff-tree c13484c2bf562b37799aa5cce70beb04fe430cd6 (from fc811de19b9f90a01513466483a782c28fa8bbe1) Author: Benjamin Otte <otte at gnome.org> Date:...
2007 May 23
0
Branch 'as' - 7 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_strings.c
...ue_to_string (cx, swfdec_as_stack_peek (stack, 2)); + swfdec_as_object_set_variable (object, s, swfdec_as_stack_peek (stack, 1)); + swfdec_as_stack_pop_n (stack, 2); } - fp->sp -= 2 * n_args; - fp->sp[-1] = OBJECT_TO_JSVAL (object); - return JS_TRUE; + SWFDEC_AS_VALUE_SET_OBJECT (swfdec_as_stack_push (stack), object); } -#endif static void swfdec_action_init_array (SwfdecAsContext *cx, guint action, const guint8 *data, guint len) @@ -2099,9 +2095,7 @@ const SwfdecActionSpec swfdec_as_actions [SWFDEC_AS_ACTION_NEW_OBJECT] = { "NewObject", NULL, -1, 1, { NULL, NULL, swfdec_actio...
2007 Apr 05
0
Branch 'as' - 9 commits - configure.ac libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_function.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...+ b/libswfdec/swfdec_as_stack.h @@ -40,6 +40,7 @@ void swfdec_as_stack_free (SwfdecAsSta #define swfdec_as_stack_peek(stack,n) (&(stack)->cur[-(gssize)(n)]) #define swfdec_as_stack_pop(stack) (--(stack)->cur) +#define swfdec_as_stack_pop_n(stack, n) ((stack)->cur -= (n)) #define swfdec_as_stack_push(stack) ((stack)->cur++) #define swfdec_as_stack_get_size(stack) ((guint)((stack)->cur - (stack)->base)) diff-tree 737748443383004fd830136283af95dc9f8c2a20 (from 6fde0b1cfdf42ab05cf00b60030f926be534efd2) Author: Benjamin Otte <otte@gnome.org> Date: Thu Apr 5 15:26:50 2007 +0200...
2007 Nov 14
0
7 commits - libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_function.c libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_super.c libswfdec/swfdec_as_super.h
...S_SUPER (fun), NULL); + swfdec_as_super_new_chain (frame, SWFDEC_AS_SUPER (fun), NULL); } - return TRUE; + return frame; error: n_args += 2; @@ -834,7 +838,7 @@ error: n_args = swfdec_as_stack_get_size (cx); swfdec_as_stack_pop_n (cx, n_args); SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (cx)); - return FALSE; + return NULL; } static void @@ -858,7 +862,10 @@ swfdec_action_call_function (SwfdecAsContext *cx, guint action, const guint8 *da SWFDEC_AS_VALUE_SET_NULL (thisp); SWFDEC_AS_VALUE_SET_UNDEFINED (fun); } - if (!swfdec_action_call (cx, n_args)) { + frame =...
2007 Mar 29
0
Branch 'as' - 9 commits - libswfdec-gtk/swfdec_playback_alsa.c libswfdec/js libswfdec/Makefile.am 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
...f we're a native function or not */ + if (function->native) { + if (n_args < function->min_args) { + SwfdecAsStack *stack = context->frame->stack; + if (n_args == 0) { + SwfdecAsValue value = { SWFDEC_TYPE_AS_UNDEFINED, }; + swfdec_as_stack_ensure_size (stack, 1); + swfdec_as_stack_push (stack, &value); + } else { + stack->cur -= (n_args - 1); + SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (stack, 1)); + } + return; + } + g_assert_not_reached (); + } else { + SwfdecAsFrame *frame; + + frame = swfdec_as_frame_new (thisp, function->script...
2007 Apr 12
0
Branch 'as' - 14 commits - libswfdec-gtk/swfdec_playback_alsa.c 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 libswfdec/swfdec_as_function.h
...nt things depending on if we're a native function or not */ if (function->native) { - if (n_args < function->min_args) { - SwfdecAsStack *stack = context->frame->stack; - if (n_args == 0) { - swfdec_as_stack_ensure_size (stack, 1); - SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_push (stack)); - } else { - stack->cur -= (n_args - 1); - SWFDEC_AS_VALUE_SET_UNDEFINED (swfdec_as_stack_peek (stack, 1)); - } - return; - } frame = swfdec_as_frame_new_native (thisp); g_assert (function->name); frame->function_name = function->name; - fun...
2007 Oct 25
0
12 commits - libswfdec/swfdec_as_internal.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c test/trace
...constructor = SWFDEC_AS_VALUE_GET_OBJECT (val_p); + } else { + constructor = NULL; + } + + val_p = swfdec_as_stack_pop (cx); + if (SWFDEC_AS_VALUE_IS_OBJECT (val_p)) { + object = SWFDEC_AS_VALUE_GET_OBJECT (val_p); + } else { + object = NULL; + } + + SWFDEC_AS_VALUE_SET_BOOLEAN (swfdec_as_stack_push (cx), FALSE); + + if (object == NULL || constructor == NULL) + return; + + swfdec_as_object_get_variable (constructor, SWFDEC_AS_STR_prototype, &val); + if (!SWFDEC_AS_VALUE_IS_OBJECT (&val)) + return; + prototype = SWFDEC_AS_VALUE_GET_OBJECT (&val); + + class = object; + sw...
2007 Jun 06
0
Branch 'as' - 13 commits - libswfdec/swfdec_as_context.c libswfdec/swfdec_as_context.h libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_frame.h libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...7 @@ swfdec_action_push (SwfdecAsContext *cx, switch (type) { case 0: /* string */ { - const char *s = swfdec_bits_skip_string (&bits); + char *s = swfdec_bits_get_string_with_version (&bits, cx->version); if (s == NULL) return; SWFDEC_AS_VALUE_SET_STRING (swfdec_as_stack_push (stack), @@ -1433,7 +1433,7 @@ swfdec_action_define_function (SwfdecAsC frame = cx->frame; swfdec_bits_init_data (&bits, data, len); - function_name = swfdec_bits_skip_string (&bits); + function_name = swfdec_bits_get_string_with_version (&bits, cx->version); if (fun...