[krh/weston/next 2/8] Remove some dead code.

John Kåre Alsaker john.kare.alsaker at gmail.com
Fri Oct 12 03:25:06 PDT 2012


---
 clients/editor.c     |  4 +---
 tests/setbacklight.c | 13 +++----------
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/clients/editor.c b/clients/editor.c
index 02ee5da..d185137 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -232,10 +232,8 @@ text_model_commit_string(void *data,
 {
 	struct text_entry *entry = data;
 
-	if (index > strlen(text)) {
+	if (index > strlen(text))
 		fprintf(stderr, "Invalid cursor index %d\n", index);
-		index = strlen(text);
-	}
 
 	text_entry_delete_selected_text(entry);
 	text_entry_insert_at_cursor(entry, text);
diff --git a/tests/setbacklight.c b/tests/setbacklight.c
index f7b298c..8c7eb27 100644
--- a/tests/setbacklight.c
+++ b/tests/setbacklight.c
@@ -140,12 +140,11 @@ int
 main(int argc, char **argv)
 {
 	int blight, connector_id;
-	const char *default_seat = "seat0";
-	const char *path, *device_seat;
+	const char *path;
 	struct udev *udev;
 	struct udev_enumerate *e;
 	struct udev_list_entry *entry;
-	struct udev_device *device, *drm_device;
+	struct udev_device *drm_device;
 
 	if (argc < 3) {
 		printf("Please add connector_id and brightness values from 0-255\n");
@@ -169,13 +168,7 @@ main(int argc, char **argv)
 	drm_device = NULL;
 	udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) {
 		path = udev_list_entry_get_name(entry);
-		device = udev_device_new_from_syspath(udev, path);
-		device_seat =
-			udev_device_get_property_value(device, "ID_SEAT");
-		if (!device_seat)
-			device_seat = default_seat;
-
-		drm_device = device;
+		drm_device = udev_device_new_from_syspath(udev, path);
 		break;
 	}
 
-- 
1.7.12.2



More information about the wayland-devel mailing list