[PATCH weston v3 14/17] compositor-wayland: refactor backend_init

Benoit Gschwind gschwind at gnu-log.net
Thu May 5 20:45:52 UTC 2016


Rename new_config to config in backend_init function.

Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
---
 src/compositor-wayland.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 67d20d0..335b70e 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -2284,7 +2284,7 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
 	struct wayland_backend *b;
 	struct wayland_output *output;
 	struct wayland_parent_output *poutput;
-	struct weston_wayland_backend_config new_config;
+	struct weston_wayland_backend_config config;
 	int x, count;
 
 	if (config_base == NULL ||
@@ -2294,15 +2294,15 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
 		return -1;
 	}
 
-	config_init_to_defaults(&new_config);
-	memcpy(&new_config, config_base, config_base->struct_size);
+	config_init_to_defaults(&config);
+	memcpy(&config, config_base, config_base->struct_size);
 
-	b = wayland_backend_create(compositor, &new_config);
+	b = wayland_backend_create(compositor, &config);
 
 	if (!b)
 		return -1;
 
-	if (new_config.sprawl || b->parent.fshell) {
+	if (config.sprawl || b->parent.fshell) {
 		b->sprawl_across_outputs = 1;
 		wl_display_roundtrip(b->parent.wl_display);
 
@@ -2312,12 +2312,12 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
 		return 0;
 	}
 
-	if (new_config.fullscreen) {
-		if (new_config.num_outputs != 1 || !new_config.outputs)
+	if (config.fullscreen) {
+		if (config.num_outputs != 1 || !config.outputs)
 			goto err_outputs;
 
 		output = wayland_output_create_for_config(b,
-							  &new_config.outputs[0],
+							  &config.outputs[0],
 							  1, 0, 0);
 		if (!output)
 			goto err_outputs;
@@ -2327,8 +2327,8 @@ backend_init(struct weston_compositor *compositor, int *argc, char *argv[],
 	}
 
 	x = 0;
-	for (count = 0; count < new_config.num_outputs; ++count) {
-		output = wayland_output_create_for_config(b, &new_config.outputs[count],
+	for (count = 0; count < config.num_outputs; ++count) {
+		output = wayland_output_create_for_config(b, &config.outputs[count],
 							  0, x, 0);
 		if (!output)
 			goto err_outputs;
-- 
2.7.3



More information about the wayland-devel mailing list