[PATCH xinput 1/5] Enclose property and device names in quotes

Peter Hutterer peter.hutterer at who-t.net
Sun Feb 19 19:36:57 PST 2012


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/buttonmap.c |    4 ++--
 src/feedback.c  |   10 +++++-----
 src/hierarchy.c |   12 ++++++------
 src/property.c  |   44 ++++++++++++++++++++++----------------------
 src/setcp.c     |    2 +-
 src/setint.c    |    2 +-
 src/setmode.c   |    2 +-
 src/setptr.c    |    2 +-
 src/state.c     |    4 ++--
 src/test.c      |    4 ++--
 src/transform.c |    2 +-
 src/xinput.c    |    2 +-
 12 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/src/buttonmap.c b/src/buttonmap.c
index 7fed927..3396e75 100644
--- a/src/buttonmap.c
+++ b/src/buttonmap.c
@@ -45,7 +45,7 @@ get_button_map(Display	*display,
     info = find_device_info(display, argv[0], False);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
@@ -109,7 +109,7 @@ set_button_map(Display	*display,
     info = find_device_info(display, argv[0], False);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
diff --git a/src/feedback.c b/src/feedback.c
index 3fad9a9..71eb155 100644
--- a/src/feedback.c
+++ b/src/feedback.c
@@ -46,14 +46,14 @@ set_ptr_feedback(Display	*display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
-	fprintf(stderr, "unable to open device %s\n", argv[0]);
+	fprintf(stderr, "unable to open device '%s'\n", argv[0]);
 	return 1;
     }
 
@@ -68,7 +68,7 @@ set_ptr_feedback(Display	*display,
     }
 
     if (id == -1) {
-       fprintf(stderr, "unable to find PtrFeedbackClass for %s\n", argv[0]);
+       fprintf(stderr, "unable to find PtrFeedbackClass for '%s'\n", argv[0]);
        return 1;
     }
 
@@ -112,14 +112,14 @@ get_feedbacks(Display	*display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
-	fprintf(stderr, "unable to open device %s\n", argv[0]);
+	fprintf(stderr, "unable to open device '%s'\n", argv[0]);
 	return 1;
     }
 
diff --git a/src/hierarchy.c b/src/hierarchy.c
index 453fb3f..f3eb378 100644
--- a/src/hierarchy.c
+++ b/src/hierarchy.c
@@ -74,7 +74,7 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc)
     info = xi2_find_device_info(dpy, argv[0]);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
@@ -97,7 +97,7 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc)
         if (argc >= 3) {
             info = xi2_find_device_info(dpy, argv[2]);
             if (!info) {
-                fprintf(stderr, "unable to find device %s\n", argv[2]);
+                fprintf(stderr, "unable to find device '%s'\n", argv[2]);
                 return EXIT_FAILURE;
             }
 
@@ -108,7 +108,7 @@ remove_master(Display* dpy, int argc, char** argv, char *name, char *desc)
         if (argc >= 4) {
             info = xi2_find_device_info(dpy, argv[3]);
             if (!info) {
-                fprintf(stderr, "unable to find device %s\n", argv[3]);
+                fprintf(stderr, "unable to find device '%s'\n", argv[3]);
                 return EXIT_FAILURE;
             }
 
@@ -155,12 +155,12 @@ change_attachment(Display* dpy, int argc, char** argv, char *name, char* desc)
     md_info= xi2_find_device_info(dpy, argv[1]);
 
     if (!sd_info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
     if (!md_info) {
-	fprintf(stderr, "unable to find device %s\n", argv[1]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[1]);
 	return EXIT_FAILURE;
     }
 
@@ -191,7 +191,7 @@ float_device(Display* dpy, int argc, char** argv, char* name, char* desc)
     info = xi2_find_device_info(dpy, argv[0]);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
diff --git a/src/property.c b/src/property.c
index ad74f23..7723445 100644
--- a/src/property.c
+++ b/src/property.c
@@ -125,7 +125,7 @@ print_property(Display *dpy, XDevice* dev, Atom property)
                         break;
                     }
 
-                    printf("\t... of unknown type %s\n",
+                    printf("\t... of unknown type '%s'\n",
                             XGetAtomName(dpy, act_type));
                     done = True;
                     break;
@@ -165,7 +165,7 @@ list_props_xi1(Display *dpy, int argc, char** argv, char* name, char *desc)
         info = find_device_info(dpy, argv[i], False);
         if (!info)
         {
-            fprintf(stderr, "unable to find device %s\n", argv[i]);
+            fprintf(stderr, "unable to find device '%s'\n", argv[i]);
             continue;
         }
 
@@ -212,7 +212,7 @@ int watch_props(Display *dpy, int argc, char** argv, char* n, char *desc)
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
@@ -253,7 +253,7 @@ delete_prop_xi1(Display *dpy, int argc, char** argv, char* n, char *desc)
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
@@ -303,14 +303,14 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
     info = find_device_info(dpy, argv[0], False);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
     dev = XOpenDevice(dpy, info->id);
     if (!dev)
     {
-        fprintf(stderr, "unable to open device %s\n", argv[0]);
+        fprintf(stderr, "unable to open device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
@@ -319,7 +319,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
     prop = parse_atom(dpy, name);
 
     if (prop == None) {
-        fprintf(stderr, "invalid property %s\n", name);
+        fprintf(stderr, "invalid property '%s'\n", name);
         return EXIT_FAILURE;
     }
 
@@ -330,7 +330,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
         if (XGetDeviceProperty(dpy, dev, prop, 0, 0, False, AnyPropertyType,
                                &old_type, &old_format, &act_nitems,
                                &bytes_after, &data.c) != Success) {
-            fprintf(stderr, "failed to get property type and format for %s\n",
+            fprintf(stderr, "failed to get property type and format for '%s'\n",
                     name);
             return EXIT_FAILURE;
         } else {
@@ -344,7 +344,7 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
     }
 
     if (type == None) {
-        fprintf(stderr, "property %s doesn't exist, you need to specify "
+        fprintf(stderr, "property '%s' doesn't exist, you need to specify "
                 "its type and format\n", name);
         return EXIT_FAILURE;
     }
@@ -366,29 +366,29 @@ do_set_prop_xi1(Display *dpy, Atom type, int format, int argc, char **argv, char
                     data.l[i] = atoi(argv[2 + i]);
                     break;
                 default:
-                    fprintf(stderr, "unexpected size for property %s", name);
+                    fprintf(stderr, "unexpected size for property '%s'", name);
                     return EXIT_FAILURE;
             }
         } else if (type == float_atom) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
             *(float *)(data.l + i) = strtod(argv[2 + i], &endptr);
             if (endptr == argv[2 + i]) {
-                fprintf(stderr, "argument %s could not be parsed\n", argv[2 + i]);
+                fprintf(stderr, "argument '%s' could not be parsed\n", argv[2 + i]);
                 return EXIT_FAILURE;
             }
         } else if (type == XA_ATOM) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
             data.a[i] = parse_atom(dpy, argv[2 + i]);
         } else {
-            fprintf(stderr, "unexpected type for property %s\n", name);
+            fprintf(stderr, "unexpected type for property '%s'\n", name);
             return EXIT_FAILURE;
         }
     }
@@ -592,7 +592,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
     prop = parse_atom(dpy, name);
 
     if (prop == None) {
-        fprintf(stderr, "invalid property %s\n", name);
+        fprintf(stderr, "invalid property '%s'\n", name);
         return EXIT_FAILURE;
     }
 
@@ -603,7 +603,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
         if (XIGetProperty(dpy, info->deviceid, prop, 0, 0, False,
                           AnyPropertyType, &old_type, &old_format, &act_nitems,
                           &bytes_after, &data.c) != Success) {
-            fprintf(stderr, "failed to get property type and format for %s\n",
+            fprintf(stderr, "failed to get property type and format for '%s'\n",
                     name);
             return EXIT_FAILURE;
         } else {
@@ -617,7 +617,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
     }
 
     if (type == None) {
-        fprintf(stderr, "property %s doesn't exist, you need to specify "
+        fprintf(stderr, "property '%s' doesn't exist, you need to specify "
                 "its type and format\n", name);
         return EXIT_FAILURE;
     }
@@ -644,7 +644,7 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
             }
         } else if (type == float_atom) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
@@ -655,13 +655,13 @@ do_set_prop_xi2(Display *dpy, Atom type, int format, int argc, char **argv, char
             }
         } else if (type == XA_ATOM) {
             if (format != 32) {
-                fprintf(stderr, "unexpected format %d for property %s\n",
+                fprintf(stderr, "unexpected format %d for property '%s'\n",
                         format, name);
                 return EXIT_FAILURE;
             }
             data.l[i] = parse_atom(dpy, argv[2 + i]);
         } else {
-            fprintf(stderr, "unexpected type for property %s\n", name);
+            fprintf(stderr, "unexpected type for property '%s'\n", name);
             return EXIT_FAILURE;
         }
     }
@@ -781,11 +781,11 @@ int set_prop(Display *display, int argc, char *argv[], char *name,
         } else if (!strncmp(argv[i], "--format=", strlen("--format="))) {
             format = atoi(option + 1);
             if (format != 8 && format != 16 && format != 32) {
-                fprintf(stderr, "invalid property format %s\n", option + 1);
+                fprintf(stderr, "invalid property format '%s'\n", option + 1);
                 return EXIT_FAILURE;
             }
         } else {
-            fprintf(stderr, "invalid option %s\n", argv[i]);
+            fprintf(stderr, "invalid option '%s'\n", argv[i]);
             return EXIT_FAILURE;
         }
 
diff --git a/src/setcp.c b/src/setcp.c
index 8a04462..649f301 100644
--- a/src/setcp.c
+++ b/src/setcp.c
@@ -49,7 +49,7 @@ set_clientpointer(Display* dpy, int argc, char** argv, char* name, char *desc)
     info = xi2_find_device_info(dpy, argv[1]);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[1]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[1]);
 	return EXIT_FAILURE;
     }
 
diff --git a/src/setint.c b/src/setint.c
index 7e7870a..050a411 100644
--- a/src/setint.c
+++ b/src/setint.c
@@ -47,7 +47,7 @@ set_integer_feedback(Display	*display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
diff --git a/src/setmode.c b/src/setmode.c
index 6812fdf..4008a74 100644
--- a/src/setmode.c
+++ b/src/setmode.c
@@ -43,7 +43,7 @@ set_mode(Display	*display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
diff --git a/src/setptr.c b/src/setptr.c
index f6f9410..3dcf1ec 100644
--- a/src/setptr.c
+++ b/src/setptr.c
@@ -48,7 +48,7 @@ set_pointer(Display	*display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return EXIT_FAILURE;
     }
 
diff --git a/src/state.c b/src/state.c
index 8b800cb..a160e30 100644
--- a/src/state.c
+++ b/src/state.c
@@ -48,14 +48,14 @@ query_state(Display	*display,
     info = find_device_info(display, argv[0], True);
 
     if (!info) {
-	fprintf(stderr, "unable to find device %s\n", argv[0]);
+	fprintf(stderr, "unable to find device '%s'\n", argv[0]);
 	return 1;
     }
 
     device = XOpenDevice(display, info->id);
 
     if (!device) {
-	fprintf(stderr, "unable to open device %s\n", argv[0]);
+	fprintf(stderr, "unable to open device '%s'\n", argv[0]);
 	return 1;
     }
 
diff --git a/src/test.c b/src/test.c
index 4e2c2e6..97305c5 100644
--- a/src/test.c
+++ b/src/test.c
@@ -54,7 +54,7 @@ register_events(Display		*dpy,
     device = XOpenDevice(dpy, info->id);
 
     if (!device) {
-	fprintf(stderr, "unable to open device %s\n", dev_name);
+	fprintf(stderr, "unable to open device '%s'\n", dev_name);
 	return 0;
     }
 
@@ -181,7 +181,7 @@ test(Display	*display,
 	info = find_device_info(display, argv[idx], True);
 
 	if (!info) {
-	    fprintf(stderr, "unable to find device %s\n", argv[idx]);
+	    fprintf(stderr, "unable to find device '%s'\n", argv[idx]);
 	    return EXIT_FAILURE;
 	} else {
 	    if (register_events(display, info, argv[idx], handle_proximity)) {
diff --git a/src/transform.c b/src/transform.c
index 6a31c83..7717ffb 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -246,7 +246,7 @@ map_to_output(Display *dpy, int argc, char *argv[], char *name, char *desc)
     info = xi2_find_device_info(dpy, argv[0]);
     if (!info)
     {
-        fprintf(stderr, "unable to find device %s\n", argv[0]);
+        fprintf(stderr, "unable to find device '%s'\n", argv[0]);
         return EXIT_FAILURE;
     }
 
diff --git a/src/xinput.c b/src/xinput.c
index 66b967b..a336f53 100644
--- a/src/xinput.c
+++ b/src/xinput.c
@@ -240,7 +240,7 @@ find_device_info(Display	*display,
 	     (is_id && devices[loop].id == id))) {
 	    if (found) {
 	        fprintf(stderr,
-	                "Warning: There are multiple devices named \"%s\".\n"
+	                "Warning: There are multiple devices named '%s'.\n"
 	                "To ensure the correct one is selected, please use "
 	                "the device ID instead.\n\n", name);
 		return NULL;
-- 
1.7.7.5



More information about the xorg-devel mailing list