]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh-domain: Clean up cmdSendKey
authorPeter Krempa <pkrempa@redhat.com>
Thu, 18 Apr 2013 08:40:49 +0000 (10:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 18 Apr 2013 13:23:09 +0000 (15:23 +0200)
Rename the get_integer_keycode helper to vshKeyCodeGetInt and get rid of
a unneeded typecast.

tools/virsh-domain.c

index 4d0cc8f8182be91817f95fb41241a3491b3ae5bc..02555426a12a62e8e5cac4729b0f527436ae02f7 100644 (file)
@@ -6725,7 +6725,7 @@ static const vshCmdOptDef opts_send_key[] = {
 };
 
 static int
-get_integer_keycode(const char *key_name)
+vshKeyCodeGetInt(const char *key_name)
 {
     unsigned int val;
 
@@ -6757,7 +6757,7 @@ cmdSendKey(vshControl *ctl, const vshCmd *cmd)
         holdtime = 0;
 
     codeset = virKeycodeSetTypeFromString(codeset_option);
-    if ((int)codeset < 0) {
+    if (codeset < 0) {
         vshError(ctl, _("unknown codeset: '%s'"), codeset_option);
         goto cleanup;
     }
@@ -6768,7 +6768,7 @@ cmdSendKey(vshControl *ctl, const vshCmd *cmd)
             goto cleanup;
         }
 
-        if ((keycode = get_integer_keycode(opt->data)) <= 0) {
+        if ((keycode = vshKeyCodeGetInt(opt->data)) <= 0) {
             if ((keycode = virKeycodeValueFromString(codeset, opt->data)) <= 0) {
                 vshError(ctl, _("invalid keycode: '%s'"), opt->data);
                 goto cleanup;