After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 643744 - GDbus: C compile errors when using reserved names as method/signal parameters
GDbus: C compile errors when using reserved names as method/signal parameters
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: D-Bus
0.11.x
Other Linux
: Normal critical
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 643813
 
 
Reported: 2011-03-03 02:42 UTC by Marco Trevisan (Treviño)
Modified: 2011-04-03 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDbus: avoid C compile errors when using reserved names as parameters (8.75 KB, patch)
2011-03-03 02:42 UTC, Marco Trevisan (Treviño)
none Details | Review

Description Marco Trevisan (Treviño) 2011-03-03 02:42:23 UTC
Created attachment 182322 [details] [review]
GDbus: avoid C compile errors when using reserved names as parameters

When using a reserved parameter in a DBus method/signal (like "self")
there are compilation issues.

Example:
[DBus (name = "org.example.Demo")]
public class DemoServer : Object {
	public int ping (string self) {
		print(self+"\n");
	}
}

The same would happen using an interface (DBus client); the attached patch fixes it using the get_variable_cname function to get the valid variable name.
Comment 1 Michael 'Mickey' Lauer 2011-03-03 15:44:50 UTC
Agreed, that should go in.
Comment 2 Jürg Billeter 2011-04-03 15:08:57 UTC
commit 5c1be07f25c27d8ad9e9451826ece43460fa3aee
Author: Marco Trevisan (Treviño) <mail@3v1n0.net>
Date:   Thu Mar 3 03:39:55 2011 +0100

    D-Bus: Avoid invalid C code when using reserved names as parameters
    
    Fixes bug 643744.