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 730230 - xcb: Add helper methods for GetPropertyReply
xcb: Add helper methods for GetPropertyReply
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Bindings
0.24.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-16 04:51 UTC by Robert Ancell
Modified: 2014-06-01 10:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add helper methods for GetPropertyReply (1.71 KB, patch)
2014-05-16 04:52 UTC, Robert Ancell
needs-work Details | Review
Add helper methods for GetPropertyReply (1.62 KB, patch)
2014-05-19 02:45 UTC, Robert Ancell
needs-work Details | Review

Description Robert Ancell 2014-05-16 04:51:51 UTC
Add helper methods for GetPropertyReply so you don't have to access a void pointer.
Comment 1 Robert Ancell 2014-05-16 04:52:34 UTC
Created attachment 276650 [details] [review]
Add helper methods for GetPropertyReply
Comment 2 Robert Ancell 2014-05-19 02:45:05 UTC
Created attachment 276739 [details] [review]
Add helper methods for GetPropertyReply

Don't copy arrays
Comment 3 Evan Nemerson 2014-05-31 05:16:13 UTC
Comment on attachment 276650 [details] [review]
Add helper methods for GetPropertyReply

Please eliminate the new line before the {.  "public string value_as_string () {" instead of "public string value_as_string ()\n\t\t{"

For the array functions, I think it would be better to return unowned arrays--vala can copy automatically if you assign the return value to an owned variable, but by returning unowned at least a copy isn't /required/.  Something like:

public unowned uint8[] value_as_uint8_array () {
  GLib.assert (format == 8);
  unowned uint8[] v = (uint8[]) this.value ();
  v.length = this.value_length ();
  return v;
}
Comment 4 Evan Nemerson 2014-05-31 05:18:07 UTC
Comment on attachment 276739 [details] [review]
Add helper methods for GetPropertyReply

Heh, should have looked at both before reviewing the first.  The return values should be unowned, and the curly braces on the previous line, but other than that this looks good.
Comment 5 Robert Ancell 2014-06-01 10:22:58 UTC
Pushed with requested changes, thanks Evan!