search for: g_stmt_end

Displaying 20 results from an estimated 35 matches for "g_stmt_end".

2007 Mar 28
0
3 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_sprite.c libswfdec/swfdec_tag.c
...dec_bits.c @@ -32,6 +32,25 @@ #include "swfdec_rect.h" +#define SWFDEC_BITS_CHECK(b,n) G_STMT_START { \ + if (swfdec_bits_left(b) < (n)) { \ + SWFDEC_ERROR ("reading past end of buffer"); \ + b->ptr = b->end; \ + b->idx = 0; \ + return 0; \ + } \ +}G_STMT_END +#define SWFDEC_BYTES_CHECK(b,n) G_STMT_START { \ + g_assert (b->end >= b->ptr); \ + g_assert (b->idx == 0); \ + if ((unsigned long) (b->end - b->ptr) < n) { \ + SWFDEC_ERROR ("reading past end of buffer"); \ + b->ptr = b->end; \ + b->idx = 0; \ +...
2007 Jan 29
0
3 commits - autogen.sh configure.ac player/.gitignore player/Makefile.am player/swfdec_playback_alsa.c player/swfdec_playback.c player/swfdec_playback_none.c
...** sources; /* sources for writing data */ - guint n_sources; /* number of sources */ - guint offset; /* offset into sound */ -} Stream; - -#define ALSA_TRY(func,msg) G_STMT_START{ \ - int err = func; \ - if (err < 0) \ - g_printerr (msg ": %s\n", snd_strerror (err)); \ -}G_STMT_END - -#define ALSA_ERROR(func,msg,retval) G_STMT_START { \ - int err = func; \ - if (err < 0) { \ - g_printerr (msg ": %s\n", snd_strerror (err)); \ - return retval; \ - } \ -}G_STMT_END - -/*** STREAMS ***/ - -static snd_pcm_uframes_t -write_player (Stream *stream, const snd_pcm...
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
...ably don't want to bind them */ #define swfdec_as_object_set(object, name, value) G_STMT_START { \ @@ -122,6 +130,21 @@ SwfdecAsObject *swfdec_as_object_find_va SWFDEC_AS_VALUE_SET_STRING (&__variable, (name)); \ swfdec_as_object_get_variable ((object), &__variable, (value)); \ }G_STMT_END +#define swfdec_as_object_set_flags(object, name, flags) G_STMT_START { \ + SwfdecAsValue __variable; \ + SWFDEC_AS_VALUE_SET_STRING (&__variable, (name)); \ + swfdec_as_object_set_variable_flags ((object), &__variable, (flags)); \ +}G_STMT_END +#define swfdec_as_object_unset_flags(objec...
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
...S_BOOLEAN), (val)->value.boolean) #define SWFDEC_AS_VALUE_SET_BOOLEAN(val,b) G_STMT_START { \ - (val)->type = SWFDEC_TYPE_AS_BOOLEAN; \ - (val)->value.boolean = b; \ + SwfdecAsValue *__val = (val); \ + (__val)->type = SWFDEC_TYPE_AS_BOOLEAN; \ + (__val)->value.boolean = b; \ } G_STMT_END #define SWFDEC_AS_VALUE_IS_NUMBER(val) ((val)->type == SWFDEC_TYPE_AS_NUMBER) #define SWFDEC_AS_VALUE_GET_NUMBER(val) (g_assert ((val)->type == SWFDEC_TYPE_AS_NUMBER), (val)->value.number) #define SWFDEC_AS_VALUE_SET_NUMBER(val,d) G_STMT_START { \ - (val)->type = SWFDEC_TYPE_AS_NU...
2007 Oct 11
1
[PATCH] Fix compiler warnings that prevent compilation
...varargs); #define SWFDEC_AS_CHECK(type,result,...) G_STMT_START {\ - if (!swfdec_as_native_function_check (cx, object, type, (gpointer *) result, argc, argv, __VA_ARGS__)) \ + if (!swfdec_as_native_function_check (cx, object, type, (gpointer) result, argc, argv, __VA_ARGS__)) \ return; \ }G_STMT_END
2007 Mar 20
0
9 commits - configure.ac libswfdec/swfdec_bits.c libswfdec/swfdec_debug.c libswfdec/swfdec_js.c libswfdec/swfdec_script.c libswfdec/swfdec_sound.c
...te strings as utf-8 - slight speed improvement for SWFDEC_BITS_CHECK_BYTES macro diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c index 860d2c4..7327413 100644 --- a/libswfdec/swfdec_bits.c +++ b/libswfdec/swfdec_bits.c @@ -96,8 +96,16 @@ swfdec_bits_left (SwfdecBits *b) } \ }G_STMT_END #define SWFDEC_BYTES_CHECK(b,n) G_STMT_START { \ + gulong __bytes; \ swfdec_bits_syncbits (b); \ - SWFDEC_BITS_CHECK (b, 8 * n); \ + __bytes = b->end - b->ptr; \ + if (!(__bytes > n || \ + (__bytes == n && b->idx == 0))) { \ + SWFDEC_ERROR ("reading past e...
2007 Oct 11
0
libswfdec/swfdec_as_native_function.h
...varargs); #define SWFDEC_AS_CHECK(type,result,...) G_STMT_START {\ - if (!swfdec_as_native_function_check (cx, object, type, (gpointer *) result, argc, argv, __VA_ARGS__)) \ + if (!swfdec_as_native_function_check (cx, object, type, (gpointer) result, argc, argv, __VA_ARGS__)) \ return; \ }G_STMT_END
2007 Oct 31
0
3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_load_object_as.c libswfdec/swfdec_movie_asprops.c
...swfdec_as_string.c index fd326ac..5fc31f3 100644 --- a/libswfdec/swfdec_as_string.c +++ b/libswfdec/swfdec_as_string.c @@ -638,12 +638,12 @@ swfdec_as_string_unescape_5 (SwfdecAsContext *cx, const char *msg) #define APPEND(chr) G_STMT_START{ \ g_byte_array_append (array, (guchar *) chr, 1); \ }G_STMT_END - array = g_byte_array_new (); in = s = g_convert (msg, -1, "LATIN1", "UTF-8", NULL, NULL, NULL); if (s == NULL) { SWFDEC_FIXME ("%s can not be converted to utf8 - is this Flash 5 or what?", msg); return NULL; } + array = g_byte_array_new (); wh...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...** sources; /* sources for writing data */ - guint n_sources; /* number of sources */ - guint offset; /* offset into sound */ -} Stream; - -#define ALSA_TRY(func,msg) G_STMT_START{ \ - int err = func; \ - if (err < 0) \ - g_printerr (msg ": %s\n", snd_strerror (err)); \ -}G_STMT_END - -#define ALSA_ERROR(func,msg,retval) G_STMT_START { \ - int err = func; \ - if (err < 0) { \ - g_printerr (msg ": %s\n", snd_strerror (err)); \ - return retval; \ - } \ -}G_STMT_END - -/*** STREAMS ***/ - -static snd_pcm_uframes_t -write_player (Stream *stream, const snd_pcm...
2007 Jul 14
0
libswfdec/swfdec_as_interpret.c libswfdec/swfdec_as_string.c libswfdec/swfdec_bits.c
...;error); + s = g_convert ((char *) array->data, array->len, "UTF-8", "LATIN1", NULL, NULL, &error); if (s) { SWFDEC_AS_VALUE_SET_STRING (ret, swfdec_as_context_get_string (cx, s)); g_free (s); @@ -481,7 +481,7 @@ swfdec_as_string_unescape_5 (SwfdecAsCon }G_STMT_END array = g_byte_array_new (); msg = swfdec_as_value_to_string (cx, &argv[0]); - in = s = g_convert (msg, -1, "LATIN1", "UTF8", NULL, NULL, NULL); + in = s = g_convert (msg, -1, "LATIN1", "UTF-8", NULL, NULL, NULL); if (s == NULL) { SWFDEC_F...
2007 Jun 28
0
Branch 'as' - 2 commits - doc/swfdec-sections.txt libswfdec/swfdec_as_types.c libswfdec/swfdec_as_types.h
...oves error messages by some compilers diff --git a/libswfdec/swfdec_as_types.h b/libswfdec/swfdec_as_types.h index 757958f..2a8cb79 100644 --- a/libswfdec/swfdec_as_types.h +++ b/libswfdec/swfdec_as_types.h @@ -86,7 +86,7 @@ struct _SwfdecAsValue { (__val)->type = SWFDEC_AS_TYPE_NUMBER; \ } G_STMT_END -#define SWFDEC_AS_VALUE_SET_INT SWFDEC_AS_VALUE_SET_NUMBER +#define SWFDEC_AS_VALUE_SET_INT(val,d) SWFDEC_AS_VALUE_SET_NUMBER(val,d) #define SWFDEC_AS_VALUE_IS_STRING(val) ((val)->type == SWFDEC_AS_TYPE_STRING) #define SWFDEC_AS_VALUE_GET_STRING(val) ((val)->value.string)
2007 Feb 02
0
Branch 'interpreter' - 6 commits - libswfdec/swfdec_bits.c libswfdec/swfdec_compiler.c libswfdec/swfdec_sprite.c test/swfdec-extract.c
...ts *b) #define SWFDEC_BITS_CHECK(b,n) G_STMT_START { \ if (swfdec_bits_left(b) < (n)) { \ - SWFDEC_ERROR("reading past end of buffer"); \ + SWFDEC_ERROR ("reading past end of buffer"); \ + b->ptr = b->end; \ + b->idx = 0; \ return 0; \ } \ }G_STMT_END diff-tree f8448012991988e247c42ba67603b46e29a8d59f (from a7b8850adba4086c321e69c8933f6248b3de0803) Author: Benjamin Otte <otte@gnome.org> Date: Fri Feb 2 15:32:35 2007 +0100 Set clip depth correctly Real depths get 16384 subtracted when reading from a file, this is necessa...
2007 Oct 26
0
6 commits - configure.ac libswfdec/swfdec_codec_audio.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_codec_video.c player/swfplay.c
...,273 +28,400 @@ #include "swfdec_debug.h" #include "swfdec_internal.h" -#if 0 -#define swfdec_cond_wait(cond, mutex) G_STMT_START { \ - g_print ("waiting at %s\n", G_STRLOC); \ - g_cond_wait (cond, mutex); \ - g_print (" done at %s\n", G_STRLOC); \ -}G_STMT_END -#else -#define swfdec_cond_wait g_cond_wait -#endif +/*** BUFFER ***/ -/*** AUDIO ***/ +static void +swfdec_gst_buffer_free (unsigned char *data, gpointer priv) +{ + gst_buffer_unref (priv); +} -typedef struct _SwfdecGstAudio SwfdecGstAudio; -struct _SwfdecGstAudio { - SwfdecAudioDecoder dec...
2007 Mar 28
0
Branch 'as' - 3 commits - 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_object.c libswfdec/swfdec_as_object.h libswfdec/swfdec_as_types.c
...iable); +/* shortcuts, you probably don't want to bind them */ +#define swfdec_as_object_set(object, name, value) G_STMT_START { \ + SwfdecAsValue __variable; \ + SWFDEC_AS_VALUE_SET_STRING (&__variable, (name)); \ + swfdec_as_object_set_variable ((object), &__variable, (value)); \ +}G_STMT_END +#define swfdec_as_object_get(object, name, value) G_STMT_START { \ + SwfdecAsValue __variable; \ + SWFDEC_AS_VALUE_SET_STRING (&__variable, (name)); \ + swfdec_as_object_get_variable ((object), &__variable, (value)); \ +}G_STMT_END G_END_DECLS diff --git a/libswfdec/swfdec_as_types...
2007 Jul 16
0
configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_playback_oss.c
...ext = context; + return sound; +} + +void +swfdec_playback_close (SwfdecPlayback *sound) +{ +#define REMOVE_HANDLER_FULL(obj,func,data,count) G_STMT_START {\ + if (g_signal_handlers_disconnect_by_func ((obj), \ + G_CALLBACK (func), (data)) != (count)) { \ + g_assert_not_reached (); \ + } \ +} G_STMT_END +#define REMOVE_HANDLER(obj,func,data) REMOVE_HANDLER_FULL (obj, func, data, 1) + + while (sound->streams) + swfdec_stream_close (sound->streams->data); + REMOVE_HANDLER (sound->player, advance_before, sound); + REMOVE_HANDLER (sound->player, audio_added, sound); + REMOVE_HAND...
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
...TYPE_AS_BOOLEAN), (val)->value.boolean) +#define SWFDEC_AS_VALUE_GET_BOOLEAN(val) ((val)->value.boolean) #define SWFDEC_AS_VALUE_SET_BOOLEAN(val,b) G_STMT_START { \ SwfdecAsValue *__val = (val); \ (__val)->type = SWFDEC_TYPE_AS_BOOLEAN; \ @@ -66,7 +66,7 @@ struct _SwfdecAsValue { } G_STMT_END #define SWFDEC_AS_VALUE_IS_NUMBER(val) ((val)->type == SWFDEC_TYPE_AS_NUMBER) -#define SWFDEC_AS_VALUE_GET_NUMBER(val) (g_assert ((val)->type == SWFDEC_TYPE_AS_NUMBER), (val)->value.number) +#define SWFDEC_AS_VALUE_GET_NUMBER(val) ((val)->value.number) #define SWFDEC_AS_VALUE_SET_NU...
2007 Nov 10
0
[PATCH] swfdec: better variable parsing.
...6789", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", ".-_/" }, 4 } -}; - -#define ERROR(...) G_STMT_START { \ - g_printerr ("ERROR (line %u): ", __LINE__); \ - g_printerr (__VA_ARGS__); \ - g_printerr ("\n"); \ - errors++; \ -}G_STMT_END - -static guint -run_test_encode (Test *test) -{ - GString *string; - guint i, errors = 0; - - string = g_string_new (""); - for (i = 0; i < test->n_props; i++) { - swfdec_string_append_urlencoded (string, test->names[i], test->values[i]); - } - if (!g_str_equal (test...
2007 Apr 05
0
configure.ac libswfdec/Makefile.am libswfdec/swfdec_codec.c libswfdec/swfdec_codec_gst.c
...clude <gst/gst.h> + +#include "swfdec_codec.h" +#include "swfdec_debug.h" + +#define swfdec_cond_wait(cond, mutex) G_STMT_START { \ + g_print ("waiting at %s\n", G_STRLOC); \ + g_cond_wait (cond, mutex); \ + g_print (" done at %s\n", G_STRLOC); \ +}G_STMT_END + +typedef struct _SwfdecGstVideo SwfdecGstVideo; +struct _SwfdecGstVideo { + GMutex * mutex; /* mutex that blocks everything below */ + GCond * cond; /* cond used to signal when stuff below changes */ + volatile int refcount; /* refcount (d'oh) */ + + GstElement * pipeline; /* pipe...
2007 Nov 08
0
configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_playback_pa.c
...(pa); + pa_context_unref (pa); +} + +void +swfdec_playback_close (SwfdecPlayback *sound) +{ +#define REMOVE_HANDLER_FULL(obj,func,data,count) G_STMT_START {\ + if (g_signal_handlers_disconnect_by_func ((obj), \ + G_CALLBACK (func), (data)) != (count)) { \ + g_assert_not_reached (); \ + } \ +} G_STMT_END +#define REMOVE_HANDLER(obj,func,data) REMOVE_HANDLER_FULL (obj, func, data, 1) + + while (sound->streams) + swfdec_stream_close (sound->streams->data); + REMOVE_HANDLER (sound->player, advance_before, sound); + REMOVE_HANDLER (sound->player, audio_added, sound); + REMOVE_HAND...
2007 Nov 12
0
2 commits - libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_resource.c test/various
...6789", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz", ".-_/" }, 4 } -}; - -#define ERROR(...) G_STMT_START { \ - g_printerr ("ERROR (line %u): ", __LINE__); \ - g_printerr (__VA_ARGS__); \ - g_printerr ("\n"); \ - errors++; \ -}G_STMT_END - -static guint -run_test_encode (Test *test) -{ - GString *string; - guint i, errors = 0; - - string = g_string_new (""); - for (i = 0; i < test->n_props; i++) { - swfdec_string_append_urlencoded (string, test->names[i], test->values[i]); - } - if (!g_str_equal (test...