Hello community, here is the log from the commit of package gjs for openSUSE:Factory checked in at Fri Sep 9 11:15:53 CEST 2011.
-------- --- GNOME/gjs/gjs.changes 2011-07-31 09:15:58.000000000 +0200 +++ /mounts/work_src_done/STABLE/gjs/gjs.changes 2011-09-01 16:28:10.000000000 +0200 @@ -1,0 +2,9 @@ +Thu Sep 1 14:24:20 UTC 2011 - vu...@opensuse.org + +- Update to version 1.29.17: + + Add support for GPtrArrays. + + Bind more cairo API. + + Don't release too much when releasing arrays. + + Misc bug fixes and improvements. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- gjs-1.29.16.tar.bz2 New: ---- gjs-1.29.17.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gjs.spec ++++++ --- /var/tmp/diff_new_pack.pbdzPx/_old 2011-09-09 11:15:46.000000000 +0200 +++ /var/tmp/diff_new_pack.pbdzPx/_new 2011-09-09 11:15:46.000000000 +0200 @@ -22,7 +22,7 @@ %define xulrunner_ver 20 Name: gjs -Version: 1.29.16 +Version: 1.29.17 Release: 1 # FIXME: find out if tapsets should really be in devel package or in main package License: MIT License (or similar) @@ -39,7 +39,7 @@ BuildRequires: systemtap-sdt-devel BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(dbus-glib-1) -BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.29.16 %if ! %{build_with_xulrunner} BuildRequires: pkgconfig(mozjs185) %endif ++++++ gjs-1.29.16.tar.bz2 -> gjs-1.29.17.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/Makefile.in new/gjs-1.29.17/Makefile.in --- old/gjs-1.29.16/Makefile.in 2011-07-30 18:02:36.000000000 +0200 +++ new/gjs-1.29.17/Makefile.in 2011-08-30 04:34:31.000000000 +0200 @@ -50,10 +50,10 @@ $(srcdir)/Makefile-modules.am $(srcdir)/Makefile-test.am \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in $(srcdir)/gjs-1.0.pc.in \ - $(srcdir)/gjs-dbus-1.0.pc.in $(srcdir)/gjs-gi-1.0.pc.in \ - $(srcdir)/gjs-internals-1.0.pc.in $(top_srcdir)/configure \ - AUTHORS COPYING ChangeLog INSTALL NEWS compile config.guess \ - config.sub depcomp install-sh ltmain.sh missing + $(srcdir)/gjs-dbus-1.0.pc.in $(srcdir)/gjs-internals-1.0.pc.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + compile config.guess config.sub depcomp install-sh ltmain.sh \ + missing @HAVE_FIREFOX_JS_LIBDIR_TRUE@am__append_4 = -R $(FIREFOX_JS_LIBDIR) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -64,8 +64,7 @@ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = gjs-1.0.pc gjs-gi-1.0.pc gjs-dbus-1.0.pc \ - gjs-internals-1.0.pc +CONFIG_CLEAN_FILES = gjs-1.0.pc gjs-dbus-1.0.pc gjs-internals-1.0.pc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -922,8 +921,6 @@ -rm -f config.h stamp-h1 gjs-1.0.pc: $(top_builddir)/config.status $(srcdir)/gjs-1.0.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ -gjs-gi-1.0.pc: $(top_builddir)/config.status $(srcdir)/gjs-gi-1.0.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ gjs-dbus-1.0.pc: $(top_builddir)/config.status $(srcdir)/gjs-dbus-1.0.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ gjs-internals-1.0.pc: $(top_builddir)/config.status $(srcdir)/gjs-internals-1.0.pc.in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/configure new/gjs-1.29.17/configure --- old/gjs-1.29.16/configure 2011-07-30 18:02:35.000000000 +0200 +++ new/gjs-1.29.17/configure 2011-08-30 04:34:29.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for gjs 1.29.16. +# Generated by GNU Autoconf 2.68 for gjs 1.29.17. # # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gjs>. # @@ -571,8 +571,8 @@ # Identity of this package. PACKAGE_NAME='gjs' PACKAGE_TARNAME='gjs' -PACKAGE_VERSION='1.29.16' -PACKAGE_STRING='gjs 1.29.16' +PACKAGE_VERSION='1.29.17' +PACKAGE_STRING='gjs 1.29.17' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gjs' PACKAGE_URL='' @@ -800,7 +800,6 @@ enable_libtool_lock enable_coverage with_js_package -enable_introspection enable_systemtap enable_dtrace ' @@ -1376,7 +1375,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gjs 1.29.16 to adapt to many kinds of systems. +\`configure' configures gjs 1.29.17 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1446,7 +1445,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gjs 1.29.16:";; + short | recursive ) echo "Configuration of gjs 1.29.17:";; esac cat <<\_ACEOF @@ -1466,8 +1465,6 @@ optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-coverage enable code coverage - --enable-introspection=[no/auto/yes] - Enable introspection for this build --enable-systemtap Enable inclusion of systemtap trace support --enable-dtrace Enable inclusion of dtrace trace support @@ -1592,7 +1589,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gjs configure 1.29.16 +gjs configure 1.29.17 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2082,7 +2079,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gjs $as_me 1.29.16, which was +It was created by gjs $as_me 1.29.17, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2897,7 +2894,7 @@ # Define the identity of the package. PACKAGE='gjs' - VERSION='1.29.16' + VERSION='1.29.17' cat >>confdefs.h <<_ACEOF @@ -16211,13 +16208,7 @@ - # Check whether --enable-introspection was given. -if test "${enable_introspection+set}" = set; then : - enableval=$enable_introspection; -else - enable_introspection=auto -fi - + enable_introspection=yes { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-introspection" >&5 $as_echo_n "checking for gobject-introspection... " >&6; } @@ -16238,20 +16229,20 @@ as_fn_error $? "gobject-introspection-1.0 is not installed" "$LINENO" 5 fi if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.29.15\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.29.15") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.29.16\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.29.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then found_introspection=yes else - as_fn_error $? "You need to have gobject-introspection >= 1.29.15 installed to build gjs" "$LINENO" 5 + as_fn_error $? "You need to have gobject-introspection >= 1.29.16 installed to build gjs" "$LINENO" 5 fi ;; #( auto) : if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.29.15\""; } >&5 - ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.29.15") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gobject-introspection-1.0 >= 1.29.16\""; } >&5 + ($PKG_CONFIG --exists --print-errors "gobject-introspection-1.0 >= 1.29.16") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then @@ -17231,7 +17222,7 @@ -ac_config_files="$ac_config_files Makefile gjs-1.0.pc gjs-gi-1.0.pc gjs-dbus-1.0.pc gjs-internals-1.0.pc" +ac_config_files="$ac_config_files Makefile gjs-1.0.pc gjs-dbus-1.0.pc gjs-internals-1.0.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -17799,7 +17790,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gjs $as_me 1.29.16, which was +This file was extended by gjs $as_me 1.29.17, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -17865,7 +17856,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gjs config.status 1.29.16 +gjs config.status 1.29.17 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -18376,7 +18367,6 @@ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "gjs-1.0.pc") CONFIG_FILES="$CONFIG_FILES gjs-1.0.pc" ;; - "gjs-gi-1.0.pc") CONFIG_FILES="$CONFIG_FILES gjs-gi-1.0.pc" ;; "gjs-dbus-1.0.pc") CONFIG_FILES="$CONFIG_FILES gjs-dbus-1.0.pc" ;; "gjs-internals-1.0.pc") CONFIG_FILES="$CONFIG_FILES gjs-internals-1.0.pc" ;; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/configure.ac new/gjs-1.29.17/configure.ac --- old/gjs-1.29.16/configure.ac 2011-07-28 22:28:48.000000000 +0200 +++ new/gjs-1.29.17/configure.ac 2011-08-12 09:50:46.000000000 +0200 @@ -3,7 +3,7 @@ m4_define(pkg_major_version, 1) m4_define(pkg_minor_version, 29) -m4_define(pkg_micro_version, 16) +m4_define(pkg_micro_version, 17) m4_define(pkg_version, pkg_major_version.pkg_minor_version.pkg_micro_version) AC_PREREQ(2.61) @@ -231,7 +231,7 @@ fi CFLAGS="$save_CFLAGS" -GOBJECT_INTROSPECTION_CHECK([1.29.15]) +GOBJECT_INTROSPECTION_REQUIRE([1.29.16]) common_packages="gobject-2.0 >= gobject_required_version $JS_PACKAGE" gjs_packages="gmodule-2.0 gthread-2.0 gobject-introspection-1.0 >= 0.10.1 $common_packages" @@ -346,5 +346,5 @@ AC_SUBST([gjsjsdir]) AC_SUBST([gjsnativedir]) -AC_CONFIG_FILES([Makefile gjs-1.0.pc gjs-gi-1.0.pc gjs-dbus-1.0.pc gjs-internals-1.0.pc]) +AC_CONFIG_FILES([Makefile gjs-1.0.pc gjs-dbus-1.0.pc gjs-internals-1.0.pc]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gi/arg.c new/gjs-1.29.17/gi/arg.c --- old/gjs-1.29.16/gi/arg.c 2011-07-18 17:53:53.000000000 +0200 +++ new/gjs-1.29.17/gi/arg.c 2011-08-25 13:42:12.000000000 +0200 @@ -198,6 +198,7 @@ case GI_INFO_TYPE_STRUCT: case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: case GI_INFO_TYPE_OBJECT: case GI_INFO_TYPE_INTERFACE: case GI_INFO_TYPE_UNION: @@ -233,6 +234,49 @@ } } +/* Check if an argument of the given needs to be released if we obtained it + * from out argument (or the return value), and we're transferring ownership + */ +static JSBool +type_needs_out_release(GITypeInfo *type_info, + GITypeTag type_tag) +{ + switch (type_tag) { + case GI_TYPE_TAG_UTF8: + case GI_TYPE_TAG_FILENAME: + case GI_TYPE_TAG_ARRAY: + case GI_TYPE_TAG_GLIST: + case GI_TYPE_TAG_GSLIST: + case GI_TYPE_TAG_GHASH: + return TRUE; + case GI_TYPE_TAG_INTERFACE: { + GIBaseInfo* interface_info; + GIInfoType interface_type; + gboolean needs_release; + + interface_info = g_type_info_get_interface(type_info); + g_assert(interface_info != NULL); + + interface_type = g_base_info_get_type(interface_info); + + switch(interface_type) { + case GI_INFO_TYPE_ENUM: + case GI_INFO_TYPE_FLAGS: + needs_release = FALSE; + + default: + needs_release = TRUE; + } + + g_base_info_unref(interface_info); + + return needs_release; + } + default: + return FALSE; + } +} + static JSBool gjs_array_to_g_list(JSContext *context, jsval array_value, @@ -481,7 +525,7 @@ static JSBool gjs_string_to_intarray(JSContext *context, jsval string_val, - GITypeTag param_tag, + GITypeInfo *param_info, void **arr_p, gsize *length) { @@ -489,7 +533,8 @@ char *result; guint16 *result16; - element_type = replace_gtype(param_tag); + element_type = g_type_info_get_tag(param_info); + element_type = replace_gtype(element_type); switch (element_type) { case GI_TYPE_TAG_INT8: @@ -680,21 +725,21 @@ *arr_p = array; return JS_TRUE; -} +} static JSBool gjs_array_to_array(JSContext *context, jsval array_value, gsize length, GITransfer transfer, - GITypeTag param_tag, GITypeInfo *param_info, void **arr_p) { enum { UNSIGNED=FALSE, SIGNED=TRUE }; GITypeTag element_type; - element_type = replace_gtype(param_tag); + element_type = g_type_info_get_tag(param_info); + element_type = replace_gtype(element_type); if (element_type == GI_TYPE_TAG_INTERFACE) { GIBaseInfo *interface_info = g_type_info_get_interface(param_info); @@ -849,24 +894,15 @@ gsize *length_p) { JSBool ret = JS_TRUE; - GIArrayType array_type = g_type_info_get_array_type(type_info); GITypeInfo *param_info; - GITypeTag param_tag; param_info = g_type_info_get_param_type(type_info, 0); - param_tag = g_type_info_get_tag(param_info); - - if (array_type == GI_ARRAY_TYPE_BYTE_ARRAY) { - /* HACK: ByteArrays are reported as having a param of gpointer (GI_TYPE_TAG_VOID), - which is obviously wrong. Override it here */ - param_tag = GI_TYPE_TAG_UINT8; - } if ((JSVAL_IS_NULL(value) && !may_be_null) || (!JSVAL_IS_STRING(value) && !JSVAL_IS_OBJECT(value) && !JSVAL_IS_NULL(value))) { gchar *display_name = get_argument_display_name(arg_name, arg_type); gjs_throw(context, "Expected type %s for %s but got type '%s' %p", - g_type_tag_to_string(param_tag), + g_type_tag_to_string(g_type_info_get_tag(param_info)), display_name, JS_GetTypeName(context, JS_TypeOfValue(context, value)), @@ -880,7 +916,7 @@ *length_p = 0; } else if (JSVAL_IS_STRING(value)) { /* Allow strings as int8/uint8/int16/uint16 arrays */ - if (!gjs_string_to_intarray(context, value, param_tag, + if (!gjs_string_to_intarray(context, value, param_info, contents, length_p)) ret = JS_FALSE; } else if (gjs_object_has_property(context, @@ -900,7 +936,6 @@ value, length, transfer, - param_tag, param_info, contents)) ret = JS_FALSE; @@ -1376,9 +1411,7 @@ byte_array = gjs_byte_array_get_byte_array(context, JSVAL_TO_OBJECT(value)); if (byte_array) { - /* extra reference will be removed gjs_g_argument_release - (and actually has no effect given that finalizer invokes - g_byte_array_free without caring of refcount) */ + /* extra reference will be removed by gjs_g_argument_release */ arg->v_pointer = g_byte_array_ref(byte_array); break; } @@ -1421,6 +1454,14 @@ arg->v_pointer = byte_array; g_free(data); + } else if (array_type == GI_ARRAY_TYPE_PTR_ARRAY) { + GPtrArray *array = g_ptr_array_sized_new(length); + + g_ptr_array_set_size(array, length); + memcpy(array->pdata, data, sizeof(gpointer) * length); + arg->v_pointer = array; + + g_free(data); } break; } @@ -1800,10 +1841,10 @@ } static JSBool -gjs_array_from_carray (JSContext *context, - jsval *value_p, - GITypeInfo *type_info, - gpointer array) +gjs_array_from_fixed_size_array (JSContext *context, + jsval *value_p, + GITypeInfo *type_info, + gpointer array) { gint length; GITypeInfo *param_info; @@ -1811,10 +1852,7 @@ length = g_type_info_get_array_fixed_size(type_info); - if (length == -1) { - gjs_throw(context, "FIXME: Only supporting fixed size ARRAYs"); - return JS_FALSE; - } + g_assert (length != -1); param_info = g_type_info_get_param_type(type_info, 0); @@ -1845,92 +1883,35 @@ } static JSBool -gjs_array_from_g_array (JSContext *context, - jsval *value_p, - GITypeInfo *param_info, - GArray *array) -{ - JSObject *obj; - jsval elem; - GArgument arg; - JSBool result; - GITypeTag element_type; - guint i; - - element_type = g_type_info_get_tag(param_info); - element_type = replace_gtype(element_type); - - obj = JS_NewArrayObject(context, 0, NULL); - if (obj == NULL) - return JS_FALSE; - - *value_p = OBJECT_TO_JSVAL(obj); - - elem = JSVAL_VOID; - -#define ITERATE(type) \ - for (i = 0; i < array->len; i++) { \ - arg.v_##type = g_array_index(array, g##type, i); \ - if (!gjs_value_from_g_argument(context, &elem, param_info, &arg)) \ - goto finally; \ - if (!JS_DefineElement(context, obj, i, elem, NULL, NULL, \ - JSPROP_ENUMERATE)) \ - goto finally; \ - } - - switch (element_type) { - case GI_TYPE_TAG_UINT8: - ITERATE(uint8); - break; - case GI_TYPE_TAG_INT8: - ITERATE(int8); - break; - case GI_TYPE_TAG_UINT16: - ITERATE(uint16); - break; - case GI_TYPE_TAG_INT16: - ITERATE(int16); - break; - case GI_TYPE_TAG_UINT32: - ITERATE(uint32); - break; - case GI_TYPE_TAG_INT32: - ITERATE(int32); - break; - case GI_TYPE_TAG_UINT64: - ITERATE(uint64); - break; - case GI_TYPE_TAG_INT64: - ITERATE(int64); - break; - case GI_TYPE_TAG_FLOAT: - ITERATE(float); - break; - case GI_TYPE_TAG_DOUBLE: - ITERATE(double); - break; - case GI_TYPE_TAG_UTF8: - case GI_TYPE_TAG_FILENAME: - case GI_TYPE_TAG_ARRAY: - case GI_TYPE_TAG_INTERFACE: - case GI_TYPE_TAG_GLIST: - case GI_TYPE_TAG_GSLIST: - case GI_TYPE_TAG_GHASH: - ITERATE(pointer); - break; - default: - gjs_throw(context, "Unknown GArray element-type %d", element_type); - goto finally; +gjs_array_from_boxed_array (JSContext *context, + jsval *value_p, + GIArrayType array_type, + GITypeInfo *param_info, + GArgument *arg) +{ + GArray *array; + GPtrArray *ptr_array; + gpointer data = NULL; + gsize length = 0; + + switch(array_type) { + case GI_ARRAY_TYPE_BYTE_ARRAY: + /* GByteArray is just a typedef for GArray internally */ + case GI_ARRAY_TYPE_ARRAY: + array = (GArray*)(arg->v_pointer); + data = array->data; + length = array->len; + break; + case GI_ARRAY_TYPE_PTR_ARRAY: + ptr_array = (GPtrArray*)(arg->v_pointer); + data = ptr_array->pdata; + length = ptr_array->len; + break; + default: + g_assert_not_reached(); } -#undef ITERATE - - result = JS_TRUE; - -finally: - JS_RemoveValueRoot(context, &elem); - - return result; + return gjs_array_from_carray_internal(context, value_p, param_info, length, data); } static JSBool @@ -2348,7 +2329,8 @@ return result; } else { - return gjs_array_from_carray(context, value_p, type_info, arg->v_pointer); + /* arrays with length are handled outside of this function */ + return gjs_array_from_fixed_size_array(context, value_p, type_info, arg->v_pointer); } } else if (g_type_info_get_array_type(type_info) == GI_ARRAY_TYPE_BYTE_ARRAY) { JSObject *array = gjs_byte_array_from_byte_array(context, @@ -2367,10 +2349,11 @@ param_info = g_type_info_get_param_type(type_info, 0); g_assert(param_info != NULL); - result = gjs_array_from_g_array(context, - value_p, - param_info, - arg->v_pointer); + result = gjs_array_from_boxed_array(context, + value_p, + g_type_info_get_array_type(type_info), + param_info, + arg); g_base_info_unref((GIBaseInfo*) param_info); @@ -2637,19 +2620,38 @@ case GI_TYPE_TAG_GSLIST: case GI_TYPE_TAG_ARRAY: case GI_TYPE_TAG_GHASH: - if (transfer != GI_TRANSFER_CONTAINER) { - g_assert (g_type_info_is_zero_terminated (type_info)); - gpointer *array; - GArgument elem; - - for (array = arg->v_pointer; *array; array++) { - elem.v_pointer = *array; - if (!gjs_g_arg_release_internal(context, - GI_TRANSFER_EVERYTHING, - param_info, - element_type, - &elem)) { - failed = JS_TRUE; + if (transfer != GI_TRANSFER_CONTAINER + && type_needs_out_release(param_info, element_type)) { + if (g_type_info_is_zero_terminated (type_info)) { + gpointer *array; + GArgument elem; + + for (array = arg->v_pointer; *array; array++) { + elem.v_pointer = *array; + if (!gjs_g_arg_release_internal(context, + GI_TRANSFER_EVERYTHING, + param_info, + element_type, + &elem)) { + failed = JS_TRUE; + } + } + } else { + gint len = g_type_info_get_array_fixed_size(type_info); + gint i; + GArgument elem; + + g_assert(len != -1); + + for (i = 0; i < len; i++) { + elem.v_pointer = ((gpointer*)arg->v_pointer)[i]; + if (!gjs_g_arg_release_internal(context, + GI_TRANSFER_EVERYTHING, + param_info, + element_type, + &elem)) { + failed = TRUE; + } } } } @@ -2693,7 +2695,7 @@ case GI_TYPE_TAG_GHASH: if (transfer == GI_TRANSFER_CONTAINER) { g_array_free((GArray*) arg->v_pointer, TRUE); - } else { + } else if (type_needs_out_release (param_info, element_type)) { GArray *array = arg->v_pointer; guint i; @@ -2701,10 +2703,11 @@ GArgument arg; arg.v_pointer = g_array_index (array, gpointer, i); - gjs_g_argument_release(context, - transfer, - param_info, - &arg); + gjs_g_arg_release_internal(context, + transfer, + param_info, + element_type, + &arg); } g_array_free (array, TRUE); @@ -2721,11 +2724,31 @@ g_base_info_unref((GIBaseInfo*) param_info); } else if (array_type == GI_ARRAY_TYPE_BYTE_ARRAY) { - if (transfer == GI_TRANSFER_CONTAINER) { - g_byte_array_free ((GByteArray*)arg->v_pointer, FALSE); - } else if (transfer == GI_TRANSFER_EVERYTHING) { - g_byte_array_free ((GByteArray*)arg->v_pointer, TRUE); + g_byte_array_unref ((GByteArray*)arg->v_pointer); + } else if (array_type == GI_ARRAY_TYPE_PTR_ARRAY) { + GITypeInfo *param_info; + GPtrArray *array; + + param_info = g_type_info_get_param_type(type_info, 0); + array = arg->v_pointer; + + if (transfer != GI_TRANSFER_CONTAINER) { + guint i; + + for (i = 0; i < array->len; i++) { + GArgument arg; + + arg.v_pointer = g_ptr_array_index (array, i); + gjs_g_argument_release(context, + transfer, + param_info, + &arg); + } } + + g_ptr_array_free(array, TRUE); + + g_base_info_unref((GIBaseInfo*) param_info); } else { g_assert_not_reached(); } @@ -2917,7 +2940,8 @@ param_type = g_type_info_get_param_type(type_info, 0); type_tag = g_type_info_get_tag(param_type); - if (transfer != GI_TRANSFER_CONTAINER) { + if (transfer != GI_TRANSFER_CONTAINER && + type_needs_out_release(param_type, type_tag)) { for (i = 0; i < length; i++) { elem.v_pointer = array[i]; if (!gjs_g_arg_release_internal(context, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gi/boxed.c new/gjs-1.29.17/gi/boxed.c --- old/gjs-1.29.16/gi/boxed.c 2011-07-20 19:47:20.000000000 +0200 +++ new/gjs-1.29.17/gi/boxed.c 2011-08-13 10:10:49.000000000 +0200 @@ -1128,7 +1128,6 @@ case GI_INFO_TYPE_INTERFACE: case GI_INFO_TYPE_FUNCTION: case GI_INFO_TYPE_CONSTANT: - case GI_INFO_TYPE_ERROR_DOMAIN: case GI_INFO_TYPE_VALUE: case GI_INFO_TYPE_SIGNAL: case GI_INFO_TYPE_PROPERTY: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gi/function.c new/gjs-1.29.17/gi/function.c --- old/gjs-1.29.16/gi/function.c 2011-06-24 01:03:32.000000000 +0200 +++ new/gjs-1.29.17/gi/function.c 2011-08-30 04:31:42.000000000 +0200 @@ -1081,8 +1081,9 @@ string = "function () {\n}"; free = FALSE; } else { - string = g_strdup_printf("function %s(){\n\t[native code]\n}", - g_base_info_get_name ((GIBaseInfo *) priv->info)); + string = g_strdup_printf("function %s(){\n\t/* proxy for native symbol %s(); */\n}", + g_base_info_get_name ((GIBaseInfo *) priv->info), + g_function_info_get_symbol (priv->info)); free = TRUE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gi/repo.c new/gjs-1.29.17/gi/repo.c --- old/gjs-1.29.16/gi/repo.c 2011-06-30 17:06:03.000000000 +0200 +++ new/gjs-1.29.17/gi/repo.c 2011-08-13 10:10:49.000000000 +0200 @@ -654,8 +654,6 @@ return "INTERFACE"; case GI_INFO_TYPE_CONSTANT: return "CONSTANT"; - case GI_INFO_TYPE_ERROR_DOMAIN: - return "ERROR_DOMAIN"; case GI_INFO_TYPE_UNION: return "UNION"; case GI_INFO_TYPE_VALUE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gjs/context.c new/gjs-1.29.17/gjs/context.c --- old/gjs-1.29.16/gjs/context.c 2011-07-25 19:53:59.000000000 +0200 +++ new/gjs-1.29.17/gjs/context.c 2011-08-12 09:33:26.000000000 +0200 @@ -669,7 +669,7 @@ } if (!gjs_is_registered_native_module(js_context->context, NULL, "gi")) - gjs_register_native_module("gi", gjs_define_gi_stuff, 0); + gjs_register_native_module("gi", gjs_define_gi_stuff, GJS_NATIVE_SUPPLIES_MODULE_OBJ); /* For GjsDBus */ g_irepository_prepend_search_path(PKGLIBDIR); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gjs/gi.c new/gjs-1.29.17/gjs/gi.c --- old/gjs-1.29.16/gjs/gi.c 2011-06-23 02:01:16.000000000 +0200 +++ new/gjs-1.29.17/gjs/gi.c 2011-08-12 09:33:26.000000000 +0200 @@ -37,10 +37,3 @@ { return gjs_define_repo(context, module_obj, "gi"); } - -/* GJS_NATIVE_SUPPLIES_MODULE_OBJ means we will define "gi" instead - * of defining the stuff inside "gi" only. - */ -GJS_REGISTER_NATIVE_MODULE_WITH_FLAGS("gi", - gjs_define_gi_stuff, - GJS_NATIVE_SUPPLIES_MODULE_OBJ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/gjs-gi-1.0.pc.in new/gjs-1.29.17/gjs-gi-1.0.pc.in --- old/gjs-1.29.16/gjs-gi-1.0.pc.in 2011-06-10 00:31:56.000000000 +0200 +++ new/gjs-1.29.17/gjs-gi-1.0.pc.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,15 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -bindir=@bindir@ -includedir=@includedir@ -datarootdir=@datarootdir@ -datadir=@datadir@ - -Cflags: -I${includedir}/gjs-1.0 -Requires: gjs-1.0 -Libs: -L${libdir} -lgjs-gi - -Name: gjs-gi-1.0 -Description: GObject Introspection for Javascript -Version: @VERSION@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/modules/cairo-image-surface.c new/gjs-1.29.17/modules/cairo-image-surface.c --- old/gjs-1.29.16/modules/cairo-image-surface.c 2011-07-25 19:53:59.000000000 +0200 +++ new/gjs-1.29.17/modules/cairo-image-surface.c 2011-08-12 09:33:26.000000000 +0200 @@ -99,13 +99,109 @@ return JS_TRUE; } +static JSBool +getFormat_func(JSContext *context, + uintN argc, + jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(context, vp); + cairo_surface_t *surface; + cairo_format_t format; + + if (argc > 1) { + gjs_throw(context, "ImageSurface.getFormat() takes no arguments"); + return JS_FALSE; + } + + surface = gjs_cairo_surface_get_surface(context, obj); + format = cairo_image_surface_get_format(surface); + + if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface")) + return JS_FALSE; + + JS_SET_RVAL(context, vp, INT_TO_JSVAL(format)); + return JS_TRUE; +} + +static JSBool +getWidth_func(JSContext *context, + uintN argc, + jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(context, vp); + cairo_surface_t *surface; + int width; + + if (argc > 1) { + gjs_throw(context, "ImageSurface.getWidth() takes no arguments"); + return JS_FALSE; + } + + surface = gjs_cairo_surface_get_surface(context, obj); + width = cairo_image_surface_get_width(surface); + + if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface")) + return JS_FALSE; + + JS_SET_RVAL(context, vp, INT_TO_JSVAL(width)); + return JS_TRUE; +} + +static JSBool +getHeight_func(JSContext *context, + uintN argc, + jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(context, vp); + cairo_surface_t *surface; + int height; + + if (argc > 1) { + gjs_throw(context, "ImageSurface.getHeight() takes no arguments"); + return JS_FALSE; + } + + surface = gjs_cairo_surface_get_surface(context, obj); + height = cairo_image_surface_get_height(surface); + + if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface")) + return JS_FALSE; + + JS_SET_RVAL(context, vp, INT_TO_JSVAL(height)); + return JS_TRUE; +} + +static JSBool +getStride_func(JSContext *context, + uintN argc, + jsval *vp) +{ + JSObject *obj = JS_THIS_OBJECT(context, vp); + cairo_surface_t *surface; + int stride; + + if (argc > 1) { + gjs_throw(context, "ImageSurface.getStride() takes no arguments"); + return JS_FALSE; + } + + surface = gjs_cairo_surface_get_surface(context, obj); + stride = cairo_image_surface_get_stride(surface); + + if (!gjs_cairo_check_status(context, cairo_surface_status(surface), "surface")) + return JS_FALSE; + + JS_SET_RVAL(context, vp, INT_TO_JSVAL(stride)); + return JS_TRUE; +} + static JSFunctionSpec gjs_cairo_image_surface_proto_funcs[] = { { "createFromPNG", (JSNative)createFromPNG_func, 0, JSFUN_FAST_NATIVE}, // getData - // getFormat - // getWidth - // getHeight - // getStride + { "getFormat", (JSNative)getFormat_func, 0, JSFUN_FAST_NATIVE }, + { "getWidth", (JSNative)getWidth_func, 0, JSFUN_FAST_NATIVE }, + { "getHeight", (JSNative)getHeight_func, 0, JSFUN_FAST_NATIVE }, + { "getStride", (JSNative)getStride_func, 0, JSFUN_FAST_NATIVE }, { NULL } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/modules/cairo.js new/gjs-1.29.17/modules/cairo.js --- old/gjs-1.29.16/modules/cairo.js 2011-07-25 19:53:59.000000000 +0200 +++ new/gjs-1.29.17/modules/cairo.js 2011-08-12 09:33:26.000000000 +0200 @@ -100,7 +100,22 @@ DEST_ATOP : 10, XOR : 11, ADD : 12, - SATURATE : 13 + SATURATE : 13, + MULTIPLY : 14, + SCREEN : 15, + OVERLAY : 16, + DARKEN : 17, + LIGHTEN : 18, + COLOR_DODGE : 19, + COLOR_BURN : 20, + HARD_LIGHT : 21, + SOFT_LIGHT : 22, + DIFFERENCE : 23, + EXCLUSION : 24, + HSL_HUE : 25, + HSL_SATURATION : 26, + HSL_COLOR : 27, + HSL_LUMINOSITY : 28 }; const PatternType = { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/test/js/testEverythingBasic.js new/gjs-1.29.17/test/js/testEverythingBasic.js --- old/gjs-1.29.16/test/js/testEverythingBasic.js 2011-06-24 00:22:08.000000000 +0200 +++ new/gjs-1.29.17/test/js/testEverythingBasic.js 2011-08-25 13:42:12.000000000 +0200 @@ -295,6 +295,12 @@ } function testArrayOut() { + function arrayEqual(ref, res) { + assertEquals(ref.length, res.length); + for (let i = 0; i < ref.length; i++) + assertEquals(ref[i], res[i]); + } + let array = Everything.test_array_fixed_size_int_out(); assertEquals(0, array[0]); assertEquals(4, array[4]); @@ -302,7 +308,16 @@ assertEquals(0, array[0]); assertEquals(4, array[4]); - // FIXME: test_array_int_full_out and test_array_int_none_out unimplemented + array = Everything.test_array_int_none_out(); + arrayEqual([1, 2, 3, 4, 5], array); + + array = Everything.test_array_int_full_out(); + arrayEqual([0, 1, 2, 3, 4], array); + + array = Everything.test_array_int_null_out(); + assertEquals(0, array.length); + + Everything.test_array_int_null_in(null); } /* GHash type */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gjs-1.29.16/test/js/testGIMarshalling.js new/gjs-1.29.17/test/js/testGIMarshalling.js --- old/gjs-1.29.16/test/js/testGIMarshalling.js 2011-06-23 02:01:16.000000000 +0200 +++ new/gjs-1.29.17/test/js/testGIMarshalling.js 2011-08-25 13:42:12.000000000 +0200 @@ -102,13 +102,11 @@ function testGArray() { var array; - // Tests disabled due to do g-i typelib compilation bug - // https://bugzilla.gnome.org/show_bug.cgi?id=622335 - //array = GIMarshallingTests.garray_int_none_return(); - //assertEquals(-1, array[0]); - //assertEquals(0, array[1]); - //assertEquals(1, array[2]); - //assertEquals(2, array[3]); + array = GIMarshallingTests.garray_int_none_return(); + assertEquals(-1, array[0]); + assertEquals(0, array[1]); + assertEquals(1, array[2]); + assertEquals(2, array[3]); array = GIMarshallingTests.garray_utf8_none_return() assertEquals("0", array[0]); assertEquals("1", array[1]); @@ -122,8 +120,8 @@ assertEquals("1", array[1]); assertEquals("2", array[2]); - // GIMarshallingTests.garray_int_none_in([-1, 0, 1, 2]) - // GIMarshallingTests.garray_utf8_none_in(["0", "1", "2"]) + GIMarshallingTests.garray_int_none_in([-1, 0, 1, 2]) + GIMarshallingTests.garray_utf8_none_in(["0", "1", "2"]) array = GIMarshallingTests.garray_utf8_none_out() assertEquals("0", array[0]); @@ -151,6 +149,33 @@ for (i = 0; i < refByteArray.length; i++) assertEquals(refByteArray[i], byteArray[i]); GIMarshallingTests.bytearray_none_in(refByteArray); + + // Another test, with a normal array, to test conversion + GIMarshallingTests.bytearray_none_in([0, 49, 0xFF, 51]); + + // Another test, with a string, to test conversion + GIMarshallingTests.bytearray_none_in("\x00\x31\xFF\x33"); +} + +function testPtrArray() { + function arrayEqual(ref, val) { + assertEquals(ref.length, val.length); + for (i = 0; i < ref.length; i++) + assertEquals(ref[i], val[i]); + } + var array; + + GIMarshallingTests.gptrarray_utf8_none_in(["0", "1", "2"]); + + var refArray = ["0", "1", "2"]; + + arrayEqual(refArray, GIMarshallingTests.gptrarray_utf8_none_return()); + arrayEqual(refArray, GIMarshallingTests.gptrarray_utf8_container_return()); + arrayEqual(refArray, GIMarshallingTests.gptrarray_utf8_full_return()); + + arrayEqual(refArray, GIMarshallingTests.gptrarray_utf8_none_out()); + arrayEqual(refArray, GIMarshallingTests.gptrarray_utf8_container_out()); + arrayEqual(refArray, GIMarshallingTests.gptrarray_utf8_full_out()); } gjstestRun(); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org