summaryrefslogtreecommitdiff
path: root/girepository
Commit message (Collapse)AuthorAgeFilesLines
* meson: add default compiler warning flags and enable -Werror on CIChristoph Reiter2018-12-182-5/+40
| | | | | | | | This enables various compiler warnings project wide and disables the triggered ones for each library/executable. This should give us roughly the same behaviour as with autotools. Tested with gcc8 and clang7.
* meson: Use `copy` instead of an empty configurationEmmanuele Bassi2018-12-181-1/+1
| | | | | The configure_file target has grown a `copy` argument to avoid using an empty configuration_data object since Meson 0.47.
* girepository: Add version macros and functions. Fixes #200Christoph Reiter2018-12-165-1/+179
| | | | | | | | | | | This adds the following macros and functions: GI_MAJOR_VERSION, GI_MICRO_VERSION, GI_MINOR_VERSION, GI_CHECK_VERSION, gi_get_major_version,gi_get_micro_version, gi_get_minor_version. Since we share a prefix with glib we have to namespace these by using the gi_ prefix. g_gi would also work but we already export symbols with gi_ like gi_cclosure_marshal_generic(), gi_type_tag_get_ffi_type() and gi_type_info_extract_ffi_return_value(), so let's not add another naming scheme.
* baseinfo: don't abort when calling g_base_info_get_name() on a GITypeInfo. ↵Christoph Reiter2018-12-151-0/+1
| | | | | | | | | | Fixes #96 GITypeInfo is a GIBaseInfo so calling g_base_info_get_name() on it should do something sensible. g_base_info_get_name() has always been documented to return NULL in case no name is available so return that instead.
* giobjectinfo: Fix some documentation for find_vfunc_using_interfacesJasper St. Pierre2018-12-151-2/+2
| | | | See #66
* docs: Field offsets are in the units of bytesTomasz Miąsko2018-12-141-1/+1
|
* docs: Remove everything not related to libgirepository and restructure. ↵Christoph Reiter2018-12-143-3/+3
| | | | | | | | | | | | | Fixes #244 The gtk-doc docs were including some bits of overal g-i docs but mostly unfinished and outdated. We now have the general docs in sphinx so remove the duplication and make the gtk-docs just about the libgirepository API and nothing more. This also renames some titles and fixes some missing links in the struct hierarchy while at it.
* docs: fix gtk-doc warnings and update version infosChristoph Reiter2018-12-0922-48/+55
| | | | | | | | Move things around and rename things until gtk-doc is happy. This also moves the "Since" annotations to the next stable releases and adds version added info for g_callable_info_get_instance_ownership_transfer() and g_struct_info_find_field().
* writer: Include documentation and symbol position in source filesThibault Saunier2018-11-281-1/+8
| | | | | | | | | | | Some documentation tool (as hotdoc[0]) need to have information about symbol declaration and documentation positions in the source files to be able to do smart indexing (automatically build the documenation index). [0] https://hotdoc.github.io/ Fixes #175
* girnode: remove wrongly added g_assert_not_reached(). Fixes #218Christoph Reiter2018-08-031-1/+1
| | | | | Added in 9535fc48. After the switch it calls _g_ir_node_build_typelib() again handling the other types.
* girepository: port from g_type_class_add_private() to G_ADD_PRIVATE()Christoph Reiter2018-07-301-5/+2
| | | | This lets us enable -Wdeprecated-declarations
* build: enable -Wredundant-declsChristoph Reiter2018-07-291-9/+0
| | | | | The ffi decls were added in cbdd9ee09e367e4dd to work around broken ffi headers. Let's assume this is fixed now.
* build: enable -Wswitch-defaultChristoph Reiter2018-07-297-0/+24
| | | | | | | In case the surrounding code handles missing cases break, otherwise add a g_assert_not_reached(). The generated parser code triggers this as well, so disable it there only.
* build: enable -Wtype-limitsChristoph Reiter2018-07-291-1/+1
| | | | hashv is unsigned, no need to check if >= 0
* build: enable -Wimplicit-fallthroughChristoph Reiter2018-07-291-1/+1
| | | | and fix a missplaced break
* build: enable -WshadowChristoph Reiter2018-07-294-24/+25
|
* build: enable -Wcast-function-typeChristoph Reiter2018-07-292-2/+2
| | | | | | | | Where it's easy add dummy args to match the cast; where the target is a subset just prevent the warning with a cast to void*. Provide a real copy function for the boxed type code in regress_foo. This code is never executed afaics, but why not.
* build: enable -Wsuggest-attribute=formatChristoph Reiter2018-07-291-0/+3
| | | | And use G_GNUC_PRINTF for the suggested function.
* build: enable -Wdouble-promotionChristoph Reiter2018-07-291-1/+1
|
* build: enable -Wincompatible-pointer-typesChristoph Reiter2018-07-291-1/+1
|
* build: enable -Wdiscarded-qualifiersChristoph Reiter2018-07-292-2/+2
| | | | | Except for the Python module because nothing in the CPython API is marked const and we'd have to cast everywhere.
* gdump: Fix print-format error while GFlagsValue->value is an unsigned intRico Tzschichholz2018-07-041-1/+1
|
* girepository: Properly acquire and check pointer valuesChun-wei Fan2018-04-202-4/+4
| | | | | | | | | | | | | | | | | | | | | On Windows (Visual Studio at least), unsigned longs are always 4 bytes, on both 32-bit and x64 Windows, so we cannot use unsigned longs to deal with pointers on 64-bit builds, as pointers are 8 bytes on 64-bit Windows, which may well render the pointer (which we acquired from libffi) invalid. This will fix crashes in PyGObject which are manifested when launching the cairo-demo example sript (intermittent) and when clicking on "Interactive Dialog" button in the Dialog demo in the PyGObject GTK+ Code demos before entering anything in Entry 1 and Entry 2, when running on x64 Visual Studio builds of the GTK+/PyGObject stack. Also use size_t instead of unsigned long in gthash.c when we check that memory & 0x3 is 0, to silence compiler warnings from enabling /Wp64, which is used to detect portability problems on Visual Studio when doing x86->x64 code builds. https://bugzilla.gnome.org/show_bug.cgi?id=702788
* g-ir-scanner: Don't require SRCDIR and BUILDDIR env varsNirbheek Chauhan2018-03-101-2/+6
| | | | | | | | | | | | | When building with Meson, we cannot set environment variables while running custom targets and our builddir layout is different from Autotools anyway. Now g-ir-scanner and friends can autodetect when they're being run uninstalled by Meson and will find _giscanner.so and the giscanner python files in the build directory. This is very similar to what gdbus-codegen uses in glib/gio. Same for girepository/gdump.c.
* meson: Use glib_dep and configinc for girepositoryNirbheek Chauhan2018-03-102-17/+12
| | | | | | glib_dep is what is actually needed to #include <glib.h>, not gobject_dep. It works incidentally with system gobject/glib but not when built via subprojects.
* Initial work on meson portPatrick Griffis2018-03-102-0/+213
|
* docs: Mention GI_TYPELIB_PATHEmmanuele Bassi2018-01-301-2/+14
| | | | | | | The rules for searching typelib files should be properly documented, as well as the way to modify the search paths. https://bugzilla.gnome.org/show_bug.cgi?id=699328
* Skip unused generic marshallerEmmanuele Bassi2018-01-301-1/+1
| | | | You typically want to use the version in GObject, not this one.
* Remove unnecessary transfer annotationEmmanuele Bassi2018-01-301-1/+1
| | | | Integers do not need a transfer annotation.
* Increase MAX_NAME_LENLeslie Giles2017-12-191-1/+1
| | | | | | | | | | | | | | There is no real limit on the length of an identifier, and some toolchains easily hit the current limit of 200 characters. According to this answer on StackOverflow, 2048 seems to be the limit on MSVC and ICC: https://stackoverflow.com/questions/6007568/what-is-max-length-for-an-c-c-identifier-on-common-build-systems So let's use that. https://bugzilla.gnome.org/show_bug.cgi?id=764791
* girepository: Don't skip g_irepository_get_option_group()Patrick Griffis2017-10-221-1/+1
| | | | | | This function works fine via introspection https://bugzilla.gnome.org/show_bug.cgi?id=786665
* Use locale-independent functions to parse numbersEmmanuele Bassi2017-09-241-3/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=788087
* docs: manifest typelib format portabilityNicola Fontana2017-09-101-0/+3
| | | | | | | Apart the endianness of its scalar values the typelib binary format must be considered arch-independent: make it clear in the docs. https://bugzilla.gnome.org/show_bug.cgi?id=764116
* girepository: Annotate array and array-length parameterRico Tzschichholz2016-12-103-6/+6
|
* girepository: Annotate iterator arguments as (inout)Rico Tzschichholz2016-09-152-2/+2
|
* gthash: free cmph objectsTobias Mueller2016-09-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If not done, it would leak the memory as address sanitizer reports: ==1294==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fa7a94b7602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x44c7a7 in __config_new girepository/cmph/cmph_structs.c:11 #2 0x44aaa7 in cmph_config_new girepository/cmph/cmph.c:291 #3 0x446fb5 in _gi_typelib_hash_builder_prepare girepository/gthash.c:114 #4 0x406cf7 in add_directory_index_section girepository/girmodule.c:270 #5 0x409ee6 in _g_ir_module_build_typelib girepository/girmodule.c:546 #6 0x404ada in main tools/compiler.c:217 #7 0x7fa7a70d482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) ==4091==ERROR: LeakSanitizer: detected memory leaks Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fc20c854602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x44a3f3 in cmph_io_vector_new girepository/cmph/cmph.c:228 #2 0x44a965 in cmph_io_vector_adapter girepository/cmph/cmph.c:276 #3 0x446f9f in _gi_typelib_hash_builder_prepare girepository/gthash.c:113 #4 0x406cf7 in add_directory_index_section girepository/girmodule.c:270 #5 0x409ee6 in _g_ir_module_build_typelib girepository/girmodule.c:546 #6 0x404ada in main tools/compiler.c:217 #7 0x7fc20a47182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
* docs: Clarify return value documentationEmmanuele Bassi2016-05-181-1/+1
| | | | Be a bit more specific than just saying "the transfer".
* docs: Fix return value descriptionEmmanuele Bassi2016-05-181-1/+1
| | | | | The return value of g_callable_info_get_caller_owns() is not a boolean any more.
* gdump: do not leak gfile objectsPaolo Borelli2016-05-081-1/+8
|
* girepository: Merge overrides with the regular search pathCarlos Garnacho2016-05-021-29/+3
| | | | | | | | | | | | | | | | | | | | | | This reverts commit e81c4681cc88a00fcd841c5a68d860d3714b55d7 The GI_TYPELIB_PATH envvar will still allow overriding the default typelib dir (based on gobject-introspection libdir), but applications will have the last say about typelib lookup directories. The resulting lookup order is now: - Paths added through g_irepository_prepend_search_path() - Paths in GI_TYPELIB_PATH - The default gobject introspection lookup dir This makes g_irespository_prepend_search_path() work as announced despite environment variables. If any application was relying on GI_TYPELIB_PATH overriding the paths of this function call (for e.g. make check, or to be able to run code inside the project tree), it is encouraged to set up a similar envvar for their application specific lookup dir, or perform this override through other means. https://bugzilla.gnome.org/show_bug.cgi?id=765735
* Fix code styleChun-wei Fan2016-03-171-4/+6
| | | | | Make my last patch to this file conform to the code style in the rest of this file.
* cmph/bdz.c: Work Around MSVC 2012 x64 Compiler BugChun-wei Fan2016-03-161-0/+6
| | | | | | | | | | | Due to an MSVC 2012 x64 compiler issue, the compiler generates bad code for bdz.c, so the for loop in assign() continues running until the point i falls below zero, causing an access violation when we try to do curr_edge=queue[i]; (line 427 in bdz.c). Address this issue by breaking out of the loop at the end of it when i reaches 0 after doing the necessary processing. https://bugzilla.gnome.org/show_bug.cgi?id=733595
* girepository: Fix some memory leaks in gdump.cPhilip Withnall2016-02-261-0/+8
| | | | | | | | | These were leaking memory when dumping introspection data from projects for building their GIR files. That’s generally not a problem, unless you’re trying to build the project with -fsanitize=address, which causes the GIR build phase to error out due to leaking memory. https://bugzilla.gnome.org/show_bug.cgi?id=762653
* Revert "libgirepository: Refuse to run in setuid applications"Colin Walters2015-12-091-13/+0
| | | | | | | | | | | | This reverts commit 98bb6c91b710a95efe4cfeb303daeec3381b9c98. It breaks programs simply executed *transitively* from a setuid binary like the dbus daemon launch helper. https://bugzilla.redhat.com/show_bug.cgi?id=1285991 Conflicts: girepository/girepository.c
* girepository: Fix memory leak in g_irepository_get_dependencies()Garrett Regier2015-11-201-3/+5
| | | | | | The transitive_dependencies GHashTable was being leaked. https://bugzilla.gnome.org/show_bug.cgi?id=758448
* repository: Fix format string error in previous commitColin Walters2015-10-121-1/+1
| | | | Regression from df21d1f362a810f48a23b7c121bf09ce398539c7
* girepository: Use constant time calculation for sections after Object fieldsSimon Feltman2015-10-106-53/+101
| | | | | | | | | | | | Add "n_field_callbacks" to ObjectBlob which represents the number of object fields which are also callbacks. This a allows a constant time computation for accessing sections after fields. Track writing of this field by passing an extra argument through the girnode writers recursive call structure. This essentally reverts a portion of commit 7027bb256d0d1ab which added a linear time computation for accessing sections after fields. Update typelib validator to also ensure n_field_callbacks is properly set. https://bugzilla.gnome.org/show_bug.cgi?id=700338
* girparser: Avoid a crash with an unset transfer annotationColin Walters2015-10-041-2/+2
| | | | | | Spotted by Coverity. https://bugzilla.gnome.org/show_bug.cgi?id=752549
* girepository: Drop executable bits from cmph .[ch] filesColin Walters2015-10-0410-0/+0
| | | | | | No reason for it. https://bugzilla.gnome.org/show_bug.cgi?id=752931
* girepository: Add missing includeColin Walters2015-09-261-0/+1
| | | | For previous commit.