summaryrefslogtreecommitdiff
path: root/codegen
Commit message (Collapse)AuthorAgeFilesLines
* codegen: Support renamed signalsRico Tzschichholz2017-06-078-20/+38
| | | | | | | The CCode attribute 'cname' needs to be the canonical representation as it is expected in C. https://bugzilla.gnome.org/show_bug.cgi?id=731547
* codegen: Use *_free_full to free GLib.List, GLib.SList and GLib.QueueRico Tzschichholz2017-05-171-15/+17
| | | | | g_list_free_full and g_slist_free_full are available since 2.28. g_queue_free_full is available since 2.32.
* Require and target GLib >= 2.40Rico Tzschichholz2017-05-174-216/+106
| | | | | | | The next stable release of vala will happen 3.5 years after the release of GLib 2.40.0. https://bugzilla.gnome.org/show_bug.cgi?id=782005
* gdbus: Don't leak nested HashTable on deserializationRico Tzschichholz2017-05-171-3/+7
| | | | | | Additionally make sure types derived from string are freed, e.g. ObjectPath https://bugzilla.gnome.org/show_bug.cgi?id=782719
* codegen: Fix finally blocks with async yieldsLuca Bruno2017-05-095-18/+26
| | | | | | | The Method.yield_count is not correct because in C the finally blocks may be emitted twice. https://bugzilla.gnome.org/show_bug.cgi?id=741929
* Revert "codegen: Don't implicitly initialize local variables with an ↵Rico Tzschichholz2017-05-021-6/+2
| | | | | | | | initializer" This reverts commit f5c654f76eeb1ee887f3d89eb701cf82f75a430a. https://bugzilla.gnome.org/show_bug.cgi?id=782056
* codegen: Unref GLib.AsyncResult on uncaught errors in coroutinesRico Tzschichholz2017-04-301-0/+4
| | | | | | | Ignoring the warning of uncaught error in async methods resulted in leaking a reference to the scopes GLib.AsyncResult. https://bugzilla.gnome.org/show_bug.cgi?id=641171
* build: Make sure to dist all generated headersRico Tzschichholz2017-04-261-1/+1
|
* build: Use --use-header for librariesRico Tzschichholz2017-04-251-0/+1
| | | | Reduces the size of generated c-sources while avoiding redefinitions.
* codegen: Use g_object_notify_by_pspec() to notify property-changesRico Tzschichholz2017-04-172-7/+33
|
* build: Make ccode and codegen private APIRico Tzschichholz2017-04-141-18/+10
| | | | valac is the only consumer and will statically link these libraries.
* codegen: Don't leak target-reference when casting/assigning owned delegatesRico Tzschichholz2017-03-221-3/+1
| | | | | | Regression of 6d07669384cdb70c3c657dba67d5048212f25da9 https://bugzilla.gnome.org/show_bug.cgi?id=780426
* codegen: Fix delegate initializer for instance fieldsRico Tzschichholz2017-03-221-0/+10
| | | | | | Set delegate-target to "self" which is available in *_instance_init(). https://bugzilla.gnome.org/show_bug.cgi?id=683925
* codegen: Properly null-out source on ownership-transfer of delegatesMarvin W2017-03-141-0/+5
|
* signalmodule: Handle nullable ValueTypes properly and treat them as pointerRico Tzschichholz2017-03-141-2/+20
| | | | | | | Nullable value-types are actually pointers to heap-allocated structures. Therefore a pointer-based marshaller is required for those types. https://bugzilla.gnome.org/show_bug.cgi?id=758816
* codegen: Add some missing to predefined marshallers from glibRico Tzschichholz2017-03-131-0/+3
| | | | | | g_cclosure_marshal_VOID__BOXED g_cclosure_marshal_VOID__VARIANT g_cclosure_marshal_BOOLEAN__BOXED_BOXED
* codegen: Property equality check can't be applied to non-automatic-bodiesRico Tzschichholz2017-03-121-1/+1
| | | | | | This is check was introduced with 64b9bfc1bc0abfed45ad07a8ebaef8a5f167f848 https://bugzilla.gnome.org/show_bug.cgi?id=779955
* codegen: Accessor of interface-property might be absentRico Tzschichholz2017-03-111-2/+2
| | | | | Avoid criticals while unconditionaly trying to chain-up to non-existing property-accessors without checking for null.
* codegen: Fix base-access from within overriding struct-property-accessorRico Tzschichholz2017-03-083-5/+29
| | | | | | Based on patch by gandalfn https://bugzilla.gnome.org/show_bug.cgi?id=764481
* signalmodule: Fix deprecation of signalsRico Tzschichholz2017-03-071-1/+1
|
* signalmodule: Add signal-emitter declaration if neededRico Tzschichholz2017-03-071-1/+10
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=779609
* codegen: Check there is a return error location before using itCarlos Garnacho2017-03-061-7/+16
| | | | | | Fixes client-side dbus generation on methods that don't throw any error. https://bugzilla.gnome.org/show_bug.cgi?id=779652
* Add "finish_instance" CCode attributeFlorian Brosch2017-03-064-3/+38
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=710103
* codegen: Avoid early return on sync dbus methods returning an errorCarlos Garnacho2017-03-061-1/+5
| | | | | | | If there are arguments that need freeing, we need to fall through the _error label, if there is any. https://bugzilla.gnome.org/show_bug.cgi?id=778540
* codegen: Only add _error path if there's parameters that require unrefCarlos Garnacho2017-03-061-2/+6
| | | | | | | Fixes the _error label from being set at the end of a compound statement if there are no values to unref. https://bugzilla.gnome.org/show_bug.cgi?id=778540
* signalmodule: Add support for array-parameters with rank > 1Francisco Serna2017-03-052-9/+19
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=778632
* gtkmodule: Preserve order of required-gtype-classes for reproducibilityNiko Tyni2017-03-021-1/+1
| | | | | | | | | | The elements of current_required_app_classes end up in the generated code in g_type_ensure() statements. The order of these can vary between builds when using a HashSet, breaking reproducibilty. See https://wiki.debian.org/ReproducibleBuilds https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802528
* codegen: Default to void-return for vfunc pointer cast of *_async methodsRico Tzschichholz2017-02-281-1/+1
| | | | | | | This make it match vala's generated code of async-module. To properly account for non-void *_async methods we require some additional metadata since only the return-type of *_finish method is known.
* codegen: Fix vfunc pointer cast for async method implementation/overrideRico Tzschichholz2017-02-281-5/+8
|
* codegen: Cast destroy_data for g_cclosure_new to GClosureNotifyRico Tzschichholz2017-02-281-1/+1
|
* codegen: Cast *_destroy_func arg of generic-types calls to GDestroyNotifyRico Tzschichholz2017-02-271-1/+1
|
* codegen: Cast vfunc pointer assigns of abstract overridesRico Tzschichholz2017-02-251-2/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=777958
* codegen: Pass pointer of matching type to property-getterRico Tzschichholz2017-02-251-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=777958
* codegen: Fix instance parameter for property setter in SimpleType structsNikolay Orlyuk2017-02-241-2/+2
| | | | | | | | | Add test-case and fix code generator for call to the setter to pass instance as a value rather than as a pointer to value. Based on patches by Nathan Summers. https://bugzilla.gnome.org/show_bug.cgi?id=657346
* codegen: Don't add static modifier to abstract property settersRico Tzschichholz2017-02-241-2/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=673389
* gdbus: Fix memleak using g_task_propagate_pointermrmacete2017-02-211-1/+9
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=778993
* dbus: Move send_message() call before _error labelCarlos Garnacho2017-02-181-19/+19
| | | | | | | | | | | | | | Commit 09e6818d01 changed dbus server paths so requests fell back to freeing allocated memory on errors. However certain kinds of dbus replies issue a final g_dbus_connection_send_message() there. In case of errors, _reply_message will be NULL, and the error paths would have already issued g_dbus_method_invocation_return_gerror(), so the g_dbus_connection_send_message() call is both unnecessary and warns on the NULL argument. So move the DBus reply before the _error label. https://bugzilla.gnome.org/show_bug.cgi?id=778540
* codegen: Don't create duplicated complete-async codeRico Tzschichholz2017-02-131-1/+2
| | | | | | | | Treat methods with non-void return-type special while they require a return statement. This does not account for a trailing superfluous "return" which will still trigger this code-duplication. https://bugzilla.gnome.org/show_bug.cgi?id=778302
* gdbus: Handle errors when extracting fds from dbus messagesCarlos Garnacho2017-02-133-8/+31
| | | | | | | | | On the right situations (eg. fd exhaustion), both g_dbus_message_get_unix_fd_list() and g_unix_fd_list_get() should be considered failable here. Add proper error handling to avoid triggering glib warnings. https://bugzilla.gnome.org/show_bug.cgi?id=778540
* gdbus: Ensure extracted data from the GVariant is freed on errorCarlos Garnacho2017-02-131-1/+7
| | | | | | | This will make extracted variables properly freed when extracting those fails at some point. https://bugzilla.gnome.org/show_bug.cgi?id=778540
* gdbus: Initialize intermediate variablesCarlos Garnacho2017-02-132-3/+3
| | | | | | | Those may be left uninitialized after error handling paths are introduced, so invalid data might be attempted to be freed later on. https://bugzilla.gnome.org/show_bug.cgi?id=778540
* codegen: Support casting arbitary value-types to arraysRico Tzschichholz2017-02-121-3/+26
| | | | | | | | Also calculate a valid length for the resulting array. This enables easier usage of common uint8[]-based buffer API. https://bugzilla.gnome.org/show_bug.cgi?id=777194
* codegen: Fix memory leak when using object initializer for propertiesRico Tzschichholz2017-02-121-0/+4
| | | | | | | Assigning values to properties this way leads to a ref/copy of the source and therefore requires a unref/destroy afterwards. https://bugzilla.gnome.org/show_bug.cgi?id=766739
* codegen: Don't return void for non-nullable simple-type structsMichael James Gratton2017-02-081-1/+10
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=778224
* Revert "codegen: g_free is already NULL-safe"Rico Tzschichholz2017-01-161-8/+2
| | | | | | This reverts commit 5b024e44077b6738855b6b2e92d913b75fda3444. https://bugzilla.gnome.org/show_bug.cgi?id=777242
* D-Bus: support [DBus (signature = ...)] for propertiesAbderrahim Kitouni2017-01-052-27/+45
| | | | | | | This was working for methods and signals, but not for properties. Also add tests for all cases. https://bugzilla.gnome.org/show_bug.cgi?id=744595
* Move writing of G_GNUC_DEPRECATED down to CCodeDeclarator implementationsRico Tzschichholz2017-01-042-0/+12
| | | | | Doing so in CCodeDeclaration is error-prone. CCodeVariableDeclarator still requires special handling which isn't done here.
* codegen: Re-use CCodeIdentifier ("_data_")Rico Tzschichholz2016-12-142-10/+13
|
* codegen: Compensate for the lack of g_task_get_completed on glib < 2.44Carlos Garnacho2016-12-142-3/+32
| | | | | | | | | | | | | If a target glib between 2.36 and 2.44 is used, store a boolean var in the async task data, which is initialized to FALSE and set to TRUE in the async task callback, so async-forced-to-sync like the async generator example can block until the task is complete. There is one special case, if the async task receives no callback to execute, the boolean flag is set to TRUE right away, as it will be "finished" by the first time it's checked. https://bugzilla.gnome.org/show_bug.cgi?id=763345
* vala: Check inferred generic-types of MemberAccessRico Tzschichholz2016-12-102-0/+12
| | | | | | | Although avoid this check for simple-generic accesses where this would be too strict and not wanted. https://bugzilla.gnome.org/show_bug.cgi?id=775466