Displaying 20 results from an estimated 49 matches for "g_string_free".
2018 May 15
12
[PATCH libldm 00/12] New API: an ability to retrieve created device-mapper devices back after they have been created.
The main goal of these patch series is to implement a new API that allows to retrieve created device-mapper devices for volumes and partitions back after they have been created.
As part of this patch:
- required libdevmapper version was bumped to 1.02. I think it is safe because it was released more then 10 years ago;
- newer version of libdevmapper allowed to simplify code base a little bit;
-
2007 Mar 13
0
2 commits - libswfdec/swfdec_debugger.c libswfdec/swfdec_script.c libswfdec/swfdec_script.h
...c_bits_get_u8 (&bits);
+ if (first)
+ g_string_append (string, " ");
+ else
+ g_string_append (string, ", ");
+ first = FALSE;
+ switch (type) {
+ case 0: /* string */
+ {
+ const char *s = swfdec_bits_skip_string (&bits);
+ if (!s) {
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+ g_string_append_c (string, '"');
+ g_string_append (string, s);
+ g_string_append_c (string, '"');
+ break;
+ }
+ case 1: /* float */
+ g_string_append_printf (string, "%g", swfdec_bits_get_float (&bits)...
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
...swfdec_bits_init_data (&bits, data, len);
/* FIXME: version! */
- function_name = swfdec_bits_get_string_with_version (&bits, 7);
+ function_name = swfdec_bits_get_string (&bits, 7);
if (function_name == NULL) {
SWFDEC_ERROR ("could not parse function name");
g_string_free (string, TRUE);
@@ -2879,7 +2879,7 @@ swfdec_action_print_define_function (guint action, const guint8 *data, guint len
preload = swfdec_bits_get_u8 (&bits);
else
preload = 0;
- arg_name = swfdec_bits_get_string_with_version (&bits, 7);
+ arg_name = swfdec_bits_get_s...
2007 Nov 10
0
[PATCH] swfdec: better variable parsing.
...;0' && *s <= '9') {
- byte = *s - '0';
- } else if (*s >= 'A' && *s <= 'F') {
- byte = *s - 'A' + 10;
- } else if (*s >= 'a' && *s <= 'f') {
- byte = *s - 'a' + 10;
- } else {
- g_string_free (ret, TRUE);
- *out = s;
- return NULL;
- }
- byte *= 16;
- s++;
- if (*s >= '0' && *s <= '9') {
- byte += *s - '0';
- } else if (*s >= 'A' && *s <= 'F') {
- byte += *s - 'A' + 10;
- } else if...
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
...;0' && *s <= '9') {
- byte = *s - '0';
- } else if (*s >= 'A' && *s <= 'F') {
- byte = *s - 'A' + 10;
- } else if (*s >= 'a' && *s <= 'f') {
- byte = *s - 'a' + 10;
- } else {
- g_string_free (ret, TRUE);
- *out = s;
- return NULL;
- }
- byte *= 16;
- s++;
- if (*s >= '0' && *s <= '9') {
- byte += *s - '0';
- } else if (*s >= 'A' && *s <= 'F') {
- byte += *s - 'A' + 10;
- } else if...
2018 May 15
0
[PATCH libldm v2 1/1] Fix crash while creating mapper for a volume which lacks of partitions.
...Error ** const err)
{
- static GString *name = NULL;
+ GString *name = NULL;
struct dm_target target;
target.start = 0;
@@ -2961,7 +2961,7 @@ ldm_volume_dm_create(const LDMVolume * const o, GString **created,
return TRUE;
}
dm_tree_free(tree); tree = NULL;
- g_string_free(name, TRUE);
+ g_string_free(name, TRUE); name = NULL;
switch (vol->type) {
case LDM_VOLUME_TYPE_SIMPLE:
--
2.17.0
2018 May 15
1
[PATCH libldm v2 0/1] Fix crash while creating mapper for a volume which lacks of partitions.
v1 was here:
https://www.redhat.com/archives/libguestfs/2018-May/msg00058.html
v2:
- more correct explanation of a crash reason.
Mykola Ivanets (1):
Fix crash while creating mapper for a volume which lacks of
partitions.
src/ldm.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--
2.17.0
2007 Oct 31
0
3 commits - libswfdec/swfdec_as_string.c libswfdec/swfdec_load_object_as.c libswfdec/swfdec_movie_asprops.c
...dec_movie_asprops.c
index deb8d7a..990ccf3 100644
--- a/libswfdec/swfdec_movie_asprops.c
+++ b/libswfdec/swfdec_movie_asprops.c
@@ -380,6 +380,7 @@ mc_target_get (SwfdecMovie *movie, SwfdecAsValue *rval)
}
if (s->len == 0) {
SWFDEC_AS_VALUE_SET_STRING (rval, SWFDEC_AS_STR_SLASH);
+ g_string_free (s, TRUE);
} else {
SWFDEC_AS_VALUE_SET_STRING (rval, swfdec_as_context_give_string (
SWFDEC_AS_OBJECT (movie)->context, g_string_free (s, FALSE)));
commit 95923db82b9a6495360a1b0b10f2ea4fe8df5393
Author: Benjamin Otte <otte at gnome.org>
Date: Wed Oct 31 16:59:01 2007 +0100...
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
...t *test = testp;
SwfdecLoader *loader;
SwfdecPlayer *player;
SwfdecBuffer *buffer;
@@ -179,17 +182,27 @@ run_test (Test *test)
g_string_append (output, " OK\n");
test->success = TRUE;
fail:
+ if (test->mutex)
+ g_mutex_lock (test->mutex);
test->output = g_string_free (output, FALSE);
+ if (test->mutex) {
+ g_cond_signal (test->cond);
+ g_mutex_unlock (test->mutex);
+ }
}
int
main (int argc, char **argv)
{
GList *walk, *tests = NULL;
- GString *failed_tests = g_string_new ("");
+ GString *failed_tests;
guint failures = 0;...
2007 Feb 15
0
8 commits - libswfdec/swfdec_bits.h libswfdec/swfdec_font.c libswfdec/swfdec_font.h libswfdec/swfdec_loader.c libswfdec/swfdec_loader_internal.h libswfdec/swfdec_tag.c libswfdec/swfdec_text.c libswfdec/swfdec_text.h test/swfedit_token.c test/various
...n_props; i++) {
+ swfdec_string_append_urlencoded (string, test->names[i], test->values[i]);
+ }
+ if (!g_str_equal (test->encoded, string->str)) {
+ ERROR ("encoded string is \"%s\", but should be \"%s\"", string->str, test->encoded);
+ }
+ g_string_free (string, TRUE);
+ return errors;
+}
+
+static guint
+run_test_decode (Test *test)
+{
+ guint i, errors = 0;
+ char *name, *value;
+ const char *s = test->encoded;
+
+ for (i = 0; i < test->n_props; i++) {
+ if (*s == '\0') {
+ ERROR ("string only contains %u prope...
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
....c b/libswfdec/swfdec_debugger.c
index 71b3ee7..1daf62a 100644
--- a/libswfdec/swfdec_debugger.c
+++ b/libswfdec/swfdec_debugger.c
@@ -70,10 +70,8 @@ swfdec_debugger_print_push (ScriptParser
case 0: /* string */
{
const char *s = swfdec_bits_skip_string (&bits);
- if (!s) {
- g_string_free (string, TRUE);
- return NULL;
- }
+ if (!s)
+ goto error;
g_string_append_c (string, '"');
g_string_append (string, s);
g_string_append_c (string, '"');
@@ -108,15 +106,13 @@ swfdec_debugger_print_push (ScriptParser
if (!parser->constant_p...
2010 Apr 20
2
Parser question + Markdown "wysiwyg"
Hi all
I've started writing an OS X Markdown "editor"[1] that semi-formats your markdown document as you write it. I just wanted to put something together, so went with a regexp-based setup for parsing -- Not ideal! I'd really like to use an existing parser, but I need to get access to the parse-tree *with* character offets, rather than just html output, as I'm adding
2007 Jan 18
0
Branch 'interpreter' - 4 commits - libswfdec/js libswfdec/swfdec_bits.c libswfdec/swfdec_bits.h libswfdec/swfdec_codec_screen.c libswfdec/swfdec_image.c libswfdec/swfdec_script.c libswfdec/swfdec_swf_decoder.c libswfdec/swfdec_tag.c
...c_bits_get_u8 (&bits);
+ if (first)
+ g_string_append (string, " ");
+ else
+ g_string_append (string, ", ");
+ first = FALSE;
+ switch (type) {
+ case 0: /* string */
+ {
+ const char *s = swfdec_bits_skip_string (&bits);
+ if (!s) {
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+ g_string_append_c (string, '"');
+ g_string_append (string, s);
+ g_string_append_c (string, '"');
+ break;
+ }
+ case 1: /* float */
+ g_string_append_printf (string, "%g", swfdec_bits_get_float (&bits)...
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
...static char *
swfdec_action_print_push (guint action, const guint8 *data, guint len)
@@ -2246,7 +2236,7 @@ swfdec_action_print_push (guint action,
break;
default:
SWFDEC_ERROR ("Push: type %u not implemented", type);
- return JS_FALSE;
+ return NULL;
}
}
return g_string_free (string, FALSE);
@@ -2262,7 +2252,7 @@ swfdec_action_print_constant_pool (guint
pool = swfdec_constant_pool_new_from_action (data, len);
if (pool == NULL)
- return JS_FALSE;
+ return NULL;
string = g_string_new ("ConstantPool");
for (i = 0; i < swfdec_constant_pool_...
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
...;
+
+ string = g_string_new (v2 ? "DefineFunction2 " : "DefineFunction ");
+ swfdec_bits_init_data (&bits, data, len);
+ function_name = swfdec_bits_get_string (&bits);
+ if (function_name == NULL) {
+ SWFDEC_ERROR ("could not parse function name");
+ g_string_free (string, TRUE);
+ return NULL;
+ }
+ if (*function_name) {
+ g_string_append (string, function_name);
+ g_string_append_c (string, ' ');
+ }
+ n_args = swfdec_bits_get_u16 (&bits);
+ g_string_append_c (string, '(');
+ if (v2) {
+ /* n_regs = */ swfdec_bits_get_u8...
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
...c_js_movie_to_string (JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
- GString *s;
+ char *s;
JSString *string;
SwfdecMovie *movie;
movie = JS_GetPrivate (cx, obj);
g_assert (movie);
- s = get_name (movie);
- string = JS_NewStringCopyZ (cx, s->str);
- g_string_free (s, TRUE);
+ s = swfdec_movie_get_path (movie);
+ string = JS_NewStringCopyZ (cx, s);
+ g_free (s);
if (string == NULL)
return JS_FALSE;
*rval = STRING_TO_JSVAL (string);
diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index a851cd2..3ab9c88 100644
--- a/libswfdec/swf...
2007 Oct 17
0
6 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_text_field.c libswfdec/swfdec_text_field.h libswfdec/swfdec_text_field_movie_as.c libswfdec/swfdec_text_field_movie.c
...xt_field_movie_html_text_append_paragraph (text, string,
+ p - text->text_display, end - text->text_display);
+
+ if (*end == '\r') {
+ p = end + 1;
+ } else {
+ p = end;
+ }
+ }
+
+ return swfdec_as_context_give_string (SWFDEC_AS_OBJECT (text)->context,
+ g_string_free (string, FALSE));
+}
+
void
swfdec_text_field_movie_set_text (SwfdecTextFieldMovie *text, const char *str,
gboolean html)
{
SwfdecFormatIndex *block;
GSList *iter;
+ const char *html_text, *variable_text;
g_return_if_fail (SWFDEC_IS_TEXT_FIELD_MOVIE (text));
+ g_return_if_fail...
2008 Jan 19
0
11 commits - libswfdec/swfdec_as_strings.c libswfdec/swfdec_sprite_movie_as.c libswfdec/swfdec_xml.c libswfdec/swfdec_xml.h libswfdec/swfdec_xml_node.c libswfdec/swfdec_xml_node.h test/image test/swfdec_test.c test/swfdec_test_image.c test/trace
..._new ((xml->xmlDecl != NULL ? xml->xmlDecl : ""));
+ string = g_string_new ((xml->xml_decl != NULL ? xml->xml_decl : ""));
string = g_string_append_len (string, p, end - p);
- xml->xmlDecl = swfdec_as_context_give_string (SWFDEC_AS_OBJECT (xml)->context,
- g_string_free (string, FALSE));
+ xml->xml_decl = swfdec_as_context_give_string (
+ SWFDEC_AS_OBJECT (xml)->context, g_string_free (string, FALSE));
// in version 5 parsing xmlDecl or docType always adds undefined element to
// the childNodes array
@@ -424,7 +426,7 @@ swfdec_xml_parse_docType...
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
...a/test/trace/trace.c b/test/trace/trace.c
index f42fb0f..bd31799 100644
--- a/test/trace/trace.c
+++ b/test/trace/trace.c
@@ -175,6 +175,7 @@ run_test (gpointer testp, gpointer unuse
g_error_free (error);
} else {
g_string_append (output, result);
+ g_free (result);
}
}
g_string_free (string, TRUE);
2007 Feb 01
0
Branch 'interpreter' - 9 commits - libswfdec/js libswfdec/swfdec_script.c libswfdec/swfdec_script.h player/swfdec_debug_stack.c test/trace
...nstant_pool) {
+ script->constant_pool = swfdec_constant_pool_get_area (cx->fp->swf,
+ cx->fp->constant_pool);
+ }
}
if (script == NULL) {
SWFDEC_ERROR ("failed to create script");
@@ -1638,6 +1662,7 @@ swfdec_action_print_push (guint action,
return g_string_free (string, FALSE);
}
+/* NB: constant pool actions are special in that they are called at init time */
static char *
swfdec_action_print_constant_pool (guint action, const guint8 *data, guint len)
{
@@ -2010,6 +2035,8 @@ swfdec_script_unref (SwfdecScript *scrip
return;
swfdec_buffer_u...