mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-29 07:58:19 -04:00
wayland-client: Move declarations closer to use
Rather than separating type information from content, move the declaration and the assignment closer together. Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
115b54fb97
commit
d5b19117da
1 changed files with 20 additions and 25 deletions
|
|
@ -240,14 +240,12 @@ wl_proxy_unref(struct wl_proxy *proxy)
|
||||||
static void
|
static void
|
||||||
validate_closure_objects(struct wl_closure *closure)
|
validate_closure_objects(struct wl_closure *closure)
|
||||||
{
|
{
|
||||||
const char *signature;
|
const char *signature = closure->message->signature;
|
||||||
struct argument_details arg;
|
int count = arg_count_for_signature(signature);
|
||||||
int i, count;
|
for (int i = 0; i < count; i++) {
|
||||||
struct wl_proxy *proxy;
|
struct wl_proxy *proxy;
|
||||||
|
struct argument_details arg;
|
||||||
|
|
||||||
signature = closure->message->signature;
|
|
||||||
count = arg_count_for_signature(signature);
|
|
||||||
for (i = 0; i < count; i++) {
|
|
||||||
signature = get_next_argument(signature, &arg);
|
signature = get_next_argument(signature, &arg);
|
||||||
switch (arg.type) {
|
switch (arg.type) {
|
||||||
case 'n':
|
case 'n':
|
||||||
|
|
@ -268,14 +266,13 @@ validate_closure_objects(struct wl_closure *closure)
|
||||||
static void
|
static void
|
||||||
destroy_queued_closure(struct wl_closure *closure)
|
destroy_queued_closure(struct wl_closure *closure)
|
||||||
{
|
{
|
||||||
const char *signature;
|
const char *signature = closure->message->signature;
|
||||||
struct argument_details arg;
|
int count = arg_count_for_signature(signature);
|
||||||
struct wl_proxy *proxy;
|
|
||||||
int i, count;
|
for (int i = 0; i < count; i++) {
|
||||||
|
struct wl_proxy *proxy;
|
||||||
|
struct argument_details arg;
|
||||||
|
|
||||||
signature = closure->message->signature;
|
|
||||||
count = arg_count_for_signature(signature);
|
|
||||||
for (i = 0; i < count; i++) {
|
|
||||||
signature = get_next_argument(signature, &arg);
|
signature = get_next_argument(signature, &arg);
|
||||||
switch (arg.type) {
|
switch (arg.type) {
|
||||||
case 'n':
|
case 'n':
|
||||||
|
|
@ -355,11 +352,11 @@ wl_display_create_queue(struct wl_display *display)
|
||||||
static int
|
static int
|
||||||
message_count_fds(const char *signature)
|
message_count_fds(const char *signature)
|
||||||
{
|
{
|
||||||
unsigned int count, i, fds = 0;
|
unsigned int fds = 0;
|
||||||
struct argument_details arg;
|
|
||||||
|
|
||||||
count = arg_count_for_signature(signature);
|
unsigned int count = arg_count_for_signature(signature);
|
||||||
for (i = 0; i < count; i++) {
|
for (unsigned int i = 0; i < count; i++) {
|
||||||
|
struct argument_details arg;
|
||||||
signature = get_next_argument(signature, &arg);
|
signature = get_next_argument(signature, &arg);
|
||||||
if (arg.type == 'h')
|
if (arg.type == 'h')
|
||||||
fds++;
|
fds++;
|
||||||
|
|
@ -826,14 +823,13 @@ wl_proxy_marshal_array_flags(struct wl_proxy *proxy, uint32_t opcode,
|
||||||
const struct wl_interface *interface, uint32_t version,
|
const struct wl_interface *interface, uint32_t version,
|
||||||
uint32_t flags, union wl_argument *args)
|
uint32_t flags, union wl_argument *args)
|
||||||
{
|
{
|
||||||
struct wl_closure *closure;
|
|
||||||
struct wl_proxy *new_proxy = NULL;
|
struct wl_proxy *new_proxy = NULL;
|
||||||
const struct wl_message *message;
|
|
||||||
struct wl_display *disp = proxy->display;
|
struct wl_display *disp = proxy->display;
|
||||||
|
|
||||||
pthread_mutex_lock(&disp->mutex);
|
pthread_mutex_lock(&disp->mutex);
|
||||||
|
|
||||||
message = &proxy->object.interface->methods[opcode];
|
const struct wl_message *message =
|
||||||
|
&proxy->object.interface->methods[opcode];
|
||||||
if (interface) {
|
if (interface) {
|
||||||
new_proxy = create_outgoing_proxy(proxy, message,
|
new_proxy = create_outgoing_proxy(proxy, message,
|
||||||
args, interface,
|
args, interface,
|
||||||
|
|
@ -846,7 +842,8 @@ wl_proxy_marshal_array_flags(struct wl_proxy *proxy, uint32_t opcode,
|
||||||
goto err_unlock;
|
goto err_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
closure = wl_closure_marshal(&proxy->object, opcode, args, message);
|
struct wl_closure *closure =
|
||||||
|
wl_closure_marshal(&proxy->object, opcode, args, message);
|
||||||
if (closure == NULL) {
|
if (closure == NULL) {
|
||||||
wl_log("Error marshalling request: %s\n", strerror(errno));
|
wl_log("Error marshalling request: %s\n", strerror(errno));
|
||||||
display_fatal_error(proxy->display, errno);
|
display_fatal_error(proxy->display, errno);
|
||||||
|
|
@ -1034,11 +1031,9 @@ display_handle_error(void *data,
|
||||||
static void
|
static void
|
||||||
display_handle_delete_id(void *data, struct wl_display *display, uint32_t id)
|
display_handle_delete_id(void *data, struct wl_display *display, uint32_t id)
|
||||||
{
|
{
|
||||||
struct wl_proxy *proxy;
|
|
||||||
|
|
||||||
pthread_mutex_lock(&display->mutex);
|
pthread_mutex_lock(&display->mutex);
|
||||||
|
|
||||||
proxy = wl_map_lookup(&display->objects, id);
|
struct wl_proxy *proxy = wl_map_lookup(&display->objects, id);
|
||||||
|
|
||||||
if (wl_object_is_zombie(&display->objects, id)) {
|
if (wl_object_is_zombie(&display->objects, id)) {
|
||||||
/* For zombie objects, the 'proxy' is actually the zombie
|
/* For zombie objects, the 'proxy' is actually the zombie
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue