Displaying 20 results from an estimated 46 matches for "g_new".
Did you mean:
__new
2007 Nov 01
0
libswfdec/swfdec_text_field_movie.c libswfdec/swfdec_text_field_movie_html.c
...libswfdec/swfdec_text_field_movie.c b/libswfdec/swfdec_text_field_movie.c
index 4dd9c07..5d499b2 100644
--- a/libswfdec/swfdec_text_field_movie.c
+++ b/libswfdec/swfdec_text_field_movie.c
@@ -1063,6 +1063,10 @@ swfdec_text_field_movie_set_text_format (SwfdecTextFieldMovie *text,
findex_new = g_new (SwfdecFormatIndex, 1);
findex_new->index_ = end_index;
findex_new->format = swfdec_text_format_copy (findex->format);
+ if (findex_new->format == NULL) {
+ g_free (findex_new);
+ break;
+ }
iter = g_slist_insert (iter, findex_new, 1);
}
@@ -1071,6...
2012 Oct 15
1
[QEMU PATCH v4] create struct for machine initialization arguments
...nit(QEMUMachineInitArgs *args)
{
+ ram_addr_t ram_size = args->ram_size;
+ const char *cpu_model = args->cpu_model;
+ const char *kernel_filename = args->kernel_filename;
CPUM68KState *env;
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
diff --git a/hw/exynos4_boards.c b/hw/exynos4_boards.c
index 4bb0a60..4951064 100644
--- a/hw/exynos4_boards.c
+++ b/hw/exynos4_boards.c
@@ -130,22 +130,22 @@ static Exynos4210State *exynos4_boards_init_common(
exynos4_board_ram_size[board_type]);
}
-static void nu...
2007 Feb 13
0
9 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c test/Makefile.am test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c
...ite (SwfeditToken *token, gpointer data, SwfdecOut *out, gconstpointer hint)
{
swfdec_out_put_rect (out, data);
}
static gpointer
-swfedit_rect_read (SwfdecBits *bits, gconstpointer hint)
+swfedit_rect_read (SwfeditToken *token, SwfdecBits *bits, gconstpointer hint)
{
SwfdecRect *rect = g_new (SwfdecRect, 1);
swfdec_bits_get_rect (bits, rect);
@@ -130,13 +131,13 @@ swfedit_rect_read (SwfdecBits *bits, gco
}
static void
-swfedit_string_write (gpointer data, SwfdecOut *out, gconstpointer hint)
+swfedit_string_write (SwfeditToken *token, gpointer data, SwfdecOut *out, gconstpointer...
2007 Oct 29
0
2 commits - libswfdec/swfdec_sound.c libswfdec/swfdec_text_field_movie.c
...51,6 +351,7 @@ swfdec_sound_parse_chunk (SwfdecSwfDecoder *s, SwfdecBits *b, int id)
chunk->loop_count = 1;
}
if (has_envelope) {
+ SWFDEC_FIXME ("support for sound envelopes not implemented");
chunk->n_envelopes = swfdec_bits_get_u8 (b);
chunk->envelope = g_new (SwfdecSoundEnvelope, chunk->n_envelopes);
SWFDEC_LOG (" n_envelopes = %u", chunk->n_envelopes);
@@ -366,7 +367,7 @@ swfdec_sound_parse_chunk (SwfdecSwfDecoder *s, SwfdecBits *b, int id)
if (i > 0 && chunk->envelope[i].offset <=
chunk->envelope[i-1]....
2007 Aug 22
0
Branch 'vivi' - 2 commits - libswfdec-gtk/swfdec_source.c vivified/ui
...vi_movie_list.c b/vivified/ui/vivi_movie_list.c
index 497ee27..35aa0dd 100644
--- a/vivified/ui/vivi_movie_list.c
+++ b/vivified/ui/vivi_movie_list.c
@@ -294,7 +294,6 @@ vivi_movie_list_movie_notify (SwfdecMovi
guint i;
guint count = g_node_n_children (parent);
int *positions = g_new (int, count);
- g_print ("reordering %u => %u (%u total)\n", old, new, count);
for (i = 0; i < min; i++) {
positions[i] = i;
}
@@ -393,6 +392,16 @@ vivi_movie_list_removed (ViviDebugger *d
}
static void
+vivi_movie_list_reset (ViviApplication *app, GParamSpe...
2007 Jun 06
0
Branch 'as' - libswfdec/Makefile.am libswfdec/swfdec_root_movie.c libswfdec/swfdec_root_sprite.c libswfdec/swfdec_root_sprite.h libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_swf_decoder.h libswfdec/swfdec_tag.c
...SwfdecSprite *sprite;
- GArray *array;
- SwfdecSpriteAction action;
-
- g_return_if_fail (SWFDEC_IS_ROOT_SPRITE (root));
- sprite = SWFDEC_SPRITE (root);
- g_return_if_fail (sprite->parse_frame < sprite->n_frames);
-
- if (root->root_actions == NULL)
- root->root_actions = g_new0 (GArray *, sprite->n_frames);
-
- array = root->root_actions[sprite->parse_frame];
- if (array == NULL) {
- root->root_actions[sprite->parse_frame] =
- g_array_new (FALSE, FALSE, sizeof (SwfdecSpriteAction));
- array = root->root_actions[sprite->parse_frame];
-...
2007 Aug 16
1
Branch 'vivi' - vivified/ui
vivified/ui/main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
diff-tree be3bc1a6cd88c0f2294b4f6059898c3989f172eb (from da8a9e9b145d5cb1aebc04764e9ed66856a31c9b)
Author: Benjamin Otte <otte at gnome.org>
Date: Thu Aug 16 21:42:39 2007 +0200
Set the title correctly
diff --git a/vivified/ui/main.c b/vivified/ui/main.c
index df123a9..13d03ab 100644
---
2007 Apr 05
0
4 commits - libswfdec/swfdec_audio_flv.c libswfdec/swfdec_audio_stream.c libswfdec/swfdec_codec_adpcm.c libswfdec/swfdec_codec.c libswfdec/swfdec_codec_ffmpeg.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_codec.h libswfdec/swfdec_codec_mad.c
...282,9 @@ swfdec_codec_ffmpeg_video_finish (gpoint
av_free (codec->frame);
}
-static gpointer
-swfdec_codec_ffmpeg_screen_init (void)
-{
- SwfdecCodecFFMpegVideo *codec;
- AVCodecContext *ctx = swfdec_codec_ffmpeg_init (CODEC_ID_FLASHSV);
-
- if (ctx == NULL)
- return NULL;
- codec = g_new (SwfdecCodecFFMpegVideo, 1);
- codec->ctx = ctx;
- codec->frame = avcodec_alloc_frame ();
-
- return codec;
-}
-
-
-const SwfdecVideoCodec swfdec_codec_ffmpeg_h263 = {
- swfdec_codec_ffmpeg_h263_init,
- swfdec_codec_ffmpeg_video_get_size,
- swfdec_codec_ffmpeg_video_decode,
- swfdec_co...
2007 Mar 09
0
libswfdec/swfdec_root_sprite.c libswfdec/swfdec_root_sprite.h
...SwfdecSprite *sprite;
+ GArray *array;
+ SwfdecSpriteAction action;
+
+ g_return_if_fail (SWFDEC_IS_ROOT_SPRITE (root));
+ sprite = SWFDEC_SPRITE (root);
+ g_return_if_fail (sprite->parse_frame < sprite->n_frames);
+
+ if (root->root_actions == NULL)
+ root->root_actions = g_new0 (GArray *, sprite->n_frames);
+
+ array = root->root_actions[sprite->parse_frame];
+ if (array == NULL) {
+ root->root_actions[sprite->parse_frame] =
+ g_array_new (FALSE, FALSE, sizeof (SwfdecSpriteAction));
+ array = root->root_actions[sprite->parse_frame];
+...
2019 Jul 30
0
[PATCH libnbd] examples: Fix theoretical cookie race in example.
...- return FALSE;
- }
+ assert (nr_buffers == MAX_BUFFERS);
+ DEBUG (gssrc, "read_data: buffer full, pausing reads from source");
+ reader_paused = true;
+ return FALSE;
+ found:
/* Begin reading into the new buffer. */
assert (buffers[i].data == NULL);
buffers[i].data = g_new (char, BUFFER_SIZE);
@@ -385,11 +384,9 @@ read_data (gpointer user_data)
nr_buffers++;
posn += BUFFER_SIZE;
- buffers[i].rcookie =
- nbd_aio_pread_callback (gssrc->nbd, buffers[i].data,
- BUFFER_SIZE, buffers[i].offset,
- finished...
2007 Oct 31
0
5 commits - libswfdec/swfdec_as_object.c libswfdec/swfdec_audio.c libswfdec/swfdec_sound.c libswfdec/swfdec_xml.c
..._count = 1;
}
if (has_envelope) {
- n_envelopes = swfdec_bits_get_u8 (b);
- if (n_envelopes > 0) {
- envelopes = g_array_sized_new (FALSE, FALSE,
- sizeof (SwfdecSoundEnvelope), n_envelopes);
- }
+ chunk->n_envelopes = swfdec_bits_get_u8 (b);
+ chunk->envelope = g_new0 (SwfdecSoundEnvelope, chunk->n_envelopes);
SWFDEC_LOG (" n_envelopes = %u", chunk->n_envelopes);
- } else {
- n_envelopes = 0;
}
- for (i = 0; i < n_envelopes; i++) {
- SwfdecSoundEnvelope envelope;
+ for (i = 0; i < chunk->n_envelopes; i++) {
+ chun...
2019 Jul 15
2
[PATCH libnbd] examples: Include an example of integrating with the glibc main loop.
** NOT WORKING **
This patch shows how to integrate libnbd and the glib main loop.
Posted mainly as a point of discussion as it doesn't quite work yet.
Rich.
2007 Apr 20
0
8 commits - libswfdec/swfdec_buffer.c libswfdec/swfdec_buffer.h libswfdec/swfdec_root_sprite.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c NEWS test/parse.c
...if (object == NULL) {
SWFDEC_ERROR ("cannot export id %u as %s, id wasn't found", id, name);
g_free (name);
+ } else if (name == NULL) {
+ SWFDEC_ERROR ("cannot export id %u, no name was given", id);
} else {
SwfdecRootExportData *data = g_new (SwfdecRootExportData, 1);
data->name = name;
diff-tree c6976c653468bdd720f0d765781247e7625255f6 (from 15ed4a69b4ffc265fe103ba79a0b60af7e42a9fa)
Author: Benjamin Otte <otte@gnome.org>
Date: Fri Apr 20 10:03:09 2007 +0200
update NEWS
diff --git a/NEWS b/NEWS
index d31b5d2..a7...
2019 Jul 30
4
[PATCH libnbd] examples: Fix theoretical cookie race in example.
Previously discussed here:
https://www.redhat.com/archives/libguestfs/2019-July/msg00213.html
It turns out that deferring callbacks is a PITA. (It would be a bit
easier if C has closures.) However by rewriting the example we can
avoid the need to use the cookie at all and make it run a bit more
efficiently, so let's do that instead.
Rich.
2008 Jan 07
0
12 commits - configure.ac doc/swfdec.types Makefile.am test/crashfinder.c test/dump.c test/Makefile.am test/swfdec-extract.c test/swfdec_out.c test/swfdec_out.h test/swfedit.c test/swfedit_file.c test/swfedit_file.h test/swfedit_list.c test/swfedit_list.h
...e Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-
-#include "swfdec_out.h"
-
-SwfdecOut *
-swfdec_out_open (void)
-{
- SwfdecOut *out = g_new0 (SwfdecOut, 1);
-
- out->data = g_malloc (SWFDEC_OUT_INITIAL);
- out->ptr = out->data;
- out->end = out->data + SWFDEC_OUT_INITIAL;
-
- return out;
-}
-
-static void
-swfdec_out_syncbits (SwfdecOut *out)
-{
- g_return_if_fail (out != NULL);
-
- if (out->idx > 0) {
- o...
2007 Apr 06
0
3 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec/Makefile.am libswfdec/swfdec_codec.c libswfdec/swfdec_codec_ffmpeg.c libswfdec/swfdec_codec_gst.c libswfdec/swfdec_codec.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_codec_video.c
...H263:
- id = CODEC_ID_FLV1;
- break;
- case SWFDEC_VIDEO_FORMAT_SCREEN:
- id = CODEC_ID_FLASHSV;
- break;
- default:
- g_assert_not_reached ();
- id = 0;
- break;
- }
- ctx = swfdec_codec_ffmpeg_init (id);
-
- if (ctx == NULL)
- return NULL;
- codec = g_new (SwfdecCodecFFMpegVideo, 1);
- codec->ctx = ctx;
- codec->frame = avcodec_alloc_frame ();
-
- return codec;
-}
-
-static gboolean
-swfdec_codec_ffmpeg_video_get_size (gpointer codec_data,
- guint *width, guint *height)
-{
- SwfdecCodecFFMpegVideo *codec = codec_data;
- AVCodecContext...
2019 Jul 17
1
Re: [PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...>= MAX_BUFFERS) {
> + DEBUG (gssrc, "read_data: buffer full, pausing reads from source");
> + reader_paused = true;
> + return FALSE;
> + }
> +
> + /* Begin reading into the new buffer. */
> + assert (buffers[i].data == NULL);
> + buffers[i].data = g_new (char, BUFFER_SIZE);
> + buffers[i].state = BUFFER_READING;
> + buffers[i].offset = posn;
> + nr_buffers++;
> + posn += BUFFER_SIZE;
> +
> + buffers[i].cookie =
> + nbd_aio_pread_callback (gssrc->nbd, buffers[i].data,
> + BUFFER_SIZE, bu...
2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...fers decreases.
+ */
+ if (nr_buffers >= MAX_BUFFERS) {
+ DEBUG (gssrc, "read_data: buffer full, pausing reads from source");
+ reader_paused = true;
+ return FALSE;
+ }
+
+ /* Begin reading into the new buffer. */
+ assert (buffers[i].data == NULL);
+ buffers[i].data = g_new (char, BUFFER_SIZE);
+ buffers[i].state = BUFFER_READING;
+ buffers[i].offset = posn;
+ nr_buffers++;
+ posn += BUFFER_SIZE;
+
+ buffers[i].cookie =
+ nbd_aio_pread_callback (gssrc->nbd, buffers[i].data,
+ BUFFER_SIZE, buffers[i].offset,
+...
2019 Jul 17
0
[PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...fers decreases.
+ */
+ if (nr_buffers >= MAX_BUFFERS) {
+ DEBUG (gssrc, "read_data: buffer full, pausing reads from source");
+ reader_paused = true;
+ return FALSE;
+ }
+
+ /* Begin reading into the new buffer. */
+ assert (buffers[i].data == NULL);
+ buffers[i].data = g_new (char, BUFFER_SIZE);
+ buffers[i].state = BUFFER_READING;
+ buffers[i].offset = posn;
+ nr_buffers++;
+ posn += BUFFER_SIZE;
+
+ buffers[i].rcookie =
+ nbd_aio_pread_callback (gssrc->nbd, buffers[i].data,
+ BUFFER_SIZE, buffers[i].offset,
+...
2019 Jul 17
2
[PATCH libnbd v2] examples: Include an example of integrating with glib main loop.
This is working now, and incorporates all of the changes in Eric's
review, *except* that it still doesn't retire commands (although this
seems to make no obvious difference, except possibly a performance and
memory impact).
Rich.