summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Holejsovsky <pavel.holejsovsky@gmail.com>2010-09-28 07:48:50 +0200
committerColin Walters <walters@verbum.org>2010-09-28 10:38:34 -0400
commitbdc1bbdef526cbf08184d5688eeb7dc424ab750b (patch)
treed116ee30ab4a66e1595f33517aaa019422baf76b
parentdaca45a94ec70a30497a43eb1be18ed6d24ee3df (diff)
downloadgobject-introspection-bdc1bbdef526cbf08184d5688eeb7dc424ab750b.tar.gz
Modify Regress impl so that inout args ignore (transfer) for 'in' direction.GOBJECT_INTROSPECTION_0_9_7
... because for 'in' arguments only (transfer none) is correct. https://bugzilla.gnome.org/show_bug.cgi?id=630788
-rw-r--r--tests/scanner/regress.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c
index a6bac2b0..839114f8 100644
--- a/tests/scanner/regress.c
+++ b/tests/scanner/regress.c
@@ -379,7 +379,6 @@ regress_test_utf8_inout (char **inout)
{
/* inout parameter, transfer mode full */
g_assert (strcmp (*inout, utf8_const) == 0);
- g_free(*inout);
*inout = g_strdup (utf8_nonconst);
}
@@ -515,15 +514,16 @@ void
regress_test_array_int_inout (int *n_ints, int **ints)
{
int i;
+ int *new_ints;
- for (i = 1; i < *n_ints; i++) {
- (*ints)[i-1] = (*ints)[i] + 1;
- }
-
- if (0 < *n_ints) {
- *n_ints -= 1;
- }
- *ints = g_realloc(*ints, sizeof(**ints) * *n_ints);
+ if (0 < *n_ints)
+ {
+ *n_ints -= 1;
+ new_ints = g_malloc(sizeof(**ints) * *n_ints);
+ for (i = 0; i < *n_ints; i++)
+ new_ints[i] = (*ints)[i + 1] + 1;
+ *ints = new_ints;
+ }
}
/**