mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-03 01:41:10 -05:00
Use WLR_PRIVATE for private fields
This commit is contained in:
parent
e51ce333bc
commit
6006023a37
35 changed files with 262 additions and 249 deletions
|
|
@ -237,6 +237,13 @@ used and `#undef` them after.
|
|||
* Document the contents and container of a `struct wl_list` with a
|
||||
`// content.link` and `// container.list` comment.
|
||||
|
||||
### Private fields
|
||||
|
||||
Wrap private fields of public structures with `struct { … } WLR_PRIVATE`. This
|
||||
ensures that compositor authors don't use them by accident. Within wlroots
|
||||
`WLR_PRIVATE` is expanded to nothing, so private fields are accessed in the same
|
||||
way as public ones.
|
||||
|
||||
### Safety
|
||||
|
||||
* Avoid string manipulation functions which don't take the size of the
|
||||
|
|
@ -325,12 +332,14 @@ struct wlr_compositor {
|
|||
struct wl_global *global;
|
||||
…
|
||||
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
struct {
|
||||
struct wl_signal new_surface;
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
||||
struct {
|
||||
struct wl_listener display_destroy;
|
||||
} WLR_PRIVATE;
|
||||
};
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue