Displaying 10 results from an estimated 10 matches for "swfdec_value_to_number".
2007 Mar 05
0
11 commits - configure.ac libswfdec/swfdec_js_movie.c libswfdec/swfdec_root_movie.c libswfdec/swfdec_root_movie.h libswfdec/swfdec_script.c libswfdec/swfdec_sprite.c libswfdec/swfdec_sprite.h libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_swf_decoder.c
...jsval
swfdec_script_execute (SwfdecScript *script, SwfdecScriptable *scriptable)
{
diff-tree 59aa2d0990e32ec1996df5b233cb0355e2381b8a (from e9391a04c8c57250fe0032668bedfd2d494e9ffc)
Author: Benjamin Otte <otte@gnome.org>
Date: Sun Mar 4 19:40:55 2007 +0100
s/swfdec_action_to_number/swfdec_value_to_number/
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 6a3e90c..762264c 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -155,7 +155,7 @@ swfdec_action_push_string (JSContext *cx
}
static double
-swfdec_action_to_number (JSContext *cx, jsval val)
+sw...
2007 Apr 04
0
Branch 'as' - 4 commits - libswfdec/Makefile.am libswfdec/swfdec_as_context.c libswfdec/swfdec_as_frame.c libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_interpret.h libswfdec/swfdec_as_object.c libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...GetStringLength (JSVAL_TO_STRING (val)) > 0;
+ } else if (JSVAL_IS_NULL (val)) {
+ return JS_FALSE;
+ } else if (JSVAL_IS_VOID (val)) {
+ return JS_FALSE;
+ } else if (JSVAL_IS_OBJECT (val)) {
+ return JS_TRUE;
+ }
+ g_assert_not_reached ();
+ return JS_FALSE;
+}
+
+static double
+swfdec_value_to_number (SwfdecAsContext *cx, jsval val)
+{
+ if (JSVAL_IS_INT (val)) {
+ return JSVAL_TO_INT (val);
+ } else if (JSVAL_IS_DOUBLE (val)) {
+ return *JSVAL_TO_DOUBLE (val);
+ } else if (JSVAL_IS_BOOLEAN (val)) {
+ return JSVAL_TO_BOOLEAN (val);
+ } else if (JSVAL_IS_STRING (val)) {
+ double...
2007 Apr 16
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_object.h
...d_int_range (cx->rand, 0, max));
}
-#if 0
static void
swfdec_action_old_compare (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- jsval rval, lval;
double l, r;
- void cond;
+ gboolean cond;
- rval = cx->fp->sp[-1];
- lval = cx->fp->sp[-2];
- l = swfdec_value_to_number (cx, lval);
- r = swfdec_value_to_number (cx, rval);
+ l = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx->frame->stack, 2));
+ r = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx->frame->stack, 1));
switch (action) {
case 0x0e:
cond = l == r;
@@ -1037...
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
...action_add2 (SwfdecAsContext *cx,
}
}
-#if 0
static void
swfdec_action_new_comparison_6 (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
{
- jsval lval, rval;
double d, d2;
- rval = cx->fp->sp[-1];
- lval = cx->fp->sp[-2];
- cx->fp->sp--;
- d = swfdec_value_to_number (cx, lval);
- d2 = swfdec_value_to_number (cx, rval);
+ d2 = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx->frame->stack, 1));
+ d = swfdec_as_value_to_number (cx, swfdec_as_stack_peek (cx->frame->stack, 2));
+ swfdec_as_stack_pop (cx->frame->stack);
if (action ==...
2007 Mar 21
0
4 commits - libswfdec/swfdec_js_movie.c libswfdec/swfdec_script.c player/swfdec_slow_loader.c
...enjamin Otte <otte@gnome.org>
Date: Wed Mar 21 19:25:10 2007 +0100
add some fixes for number conversion
diff --git a/libswfdec/swfdec_script.c b/libswfdec/swfdec_script.c
index 06915d0..d96ec0f 100644
--- a/libswfdec/swfdec_script.c
+++ b/libswfdec/swfdec_script.c
@@ -265,8 +265,12 @@ swfdec_value_to_number (JSContext *cx, j
double d;
if (!JS_ValueToNumber (cx, val, &d))
return 0;
- return isnan (d) ? 0 : d;
+ return d;
} else if (JSVAL_IS_OBJECT(val) && (((SwfdecScript *) cx->fp->swf)->version >= 6)) {
+ /* Checking for version 6 is completely wron...
2007 Mar 07
1
2 commits - libswfdec/swfdec_script.c test/trace
...EC_SPRITE_MOVIE (movie)->sprite, name);
+ else
+ frame--;
+ } else if (JSVAL_IS_INT (val)) {
+ return JSVAL_TO_INT (val) - 1;
+ } else if (JSVAL_IS_DOUBLE (val)) {
+ return (int) *JSVAL_TO_DOUBLE (val) - 1;
} else {
/* FIXME: how do we treat undefined etc? */
- frame = swfdec_value_to_number (cx, val);
+ frame = -1;
}
return frame;
}
2007 Apr 27
0
Changes to 'refs/tags/0.4.3'
...g is correct
: is an unescaped character for formencoded
improve debugging
register the loader correctly
No need for storing the player in the script anymore
read DoInitAction contents
implement ActionInitArray
add array test
s/swfdec_action_to_number/swfdec_value_to_number/
implement ActionToNumber
implement Delete2
only remove movie as property if it is one
allow attaching runtime data to characters
use per-character data to check if movie's DoInitAction has been run,
oops, the cairo requirement should be >= 1.2 not >= 0...
2007 Mar 09
0
17 commits - libswfdec/js libswfdec/swfdec_js.c libswfdec/swfdec_js_global.c libswfdec/swfdec_js.h libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_player_internal.h libswfdec/swfdec_root_movie.c
..., guint len)
{
JSStackFrame *fp = cx->fp;
- guint stack_size = fp->sp - fp->spbase;
guint n_args = 1;
- if (stack_size < 3)
+ if (!swfdec_script_ensure_stack (cx, 3))
return JS_FALSE;
if (!swfdec_eval_jsval (cx, NULL, &fp->sp[-1]))
return JS_FALSE;
if (swfdec_value_to_number (cx, fp->sp[-3])) {
jsval tmp;
- if (stack_size < 7)
+ if (!swfdec_script_ensure_stack (cx, 7))
return JS_FALSE;
n_args = 5;
/* yay for order */
@@ -1408,7 +1444,7 @@ swfdec_action_new_object (JSContext *cx,
return JS_FALSE;
if (!JS_ValueToECMAUint32 (cx, f...
2007 Apr 27
0
Changes to 'refs/tags/0.4.4'
...g is correct
: is an unescaped character for formencoded
improve debugging
register the loader correctly
No need for storing the player in the script anymore
read DoInitAction contents
implement ActionInitArray
add array test
s/swfdec_action_to_number/swfdec_value_to_number/
implement ActionToNumber
implement Delete2
only remove movie as property if it is one
allow attaching runtime data to characters
use per-character data to check if movie's DoInitAction has been run,
oops, the cairo requirement should be >= 1.2 not >= 0...
2007 Mar 12
0
11 commits - libswfdec/js libswfdec/swfdec_loader.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_script.c player/swfdebug.c player/swfdec_player_manager.c test/trace
...GetStringLength (JSVAL_TO_STRING (val)) > 0;
+ } else if (JSVAL_IS_NULL (val)) {
+ return JS_FALSE;
+ } else if (JSVAL_IS_VOID (val)) {
+ return JS_FALSE;
+ } else if (JSVAL_IS_OBJECT (val)) {
+ return JS_TRUE;
+ }
+ g_assert_not_reached ();
+ return JS_FALSE;
+}
+
static double
swfdec_value_to_number (JSContext *cx, jsval val)
{
@@ -930,7 +979,7 @@ swfdec_action_binary (JSContext *cx, gui
static JSString *
swfdec_action_to_string_5 (JSContext *cx, jsval val)
{
- if (JSVAL_IS_VOID (val) || JSVAL_IS_NULL (val))
+ if (JSVAL_IS_VOID (val))
return cx->runtime->emptyString;
return...