[PATCH:xf86-input-keyboard 13/21] Fix a shadowing warning, and add const.

Thomas Klausner wiz at NetBSD.org
Sat Jul 27 00:17:52 PDT 2013


On Fri, Jul 26, 2013 at 06:02:25PM -0700, Alan Coopersmith wrote:
> On 07/26/13 02:24 PM, Thomas Klausner wrote:
> >-printWsType(char *type, char *devname)
> >+printWsType(const char *type, char *name)
> >  {
> >-    xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", devname, type);
> >+    xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", name, type);
> >  }
> >  #endif
> 
> Any particular reason you only constified type & not name?

No. I just took the patch as committed, but you're right, const for
both makes more sense -- attached.
 Thomas
-------------- next part --------------
>From 2011e92362b889049501f50c49a46898f01f2535 Mon Sep 17 00:00:00 2001
From: Thomas Klausner <wiz at NetBSD.org>
Date: Fri, 26 Jul 2013 21:37:19 +0200
Subject: [PATCH:xf86-input-keyboard 13/21] Fix a shadowing warning, and add
 const.

>From Izumi Tsutsui <tsutsui at NetBSD.org>
Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
 src/bsd_kbd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/bsd_kbd.c b/src/bsd_kbd.c
index 2959178..76c98ea 100644
--- a/src/bsd_kbd.c
+++ b/src/bsd_kbd.c
@@ -173,8 +173,8 @@ KbdOn(InputInfoPtr pInfo, int what)
 			 xf86Msg(X_ERROR, "KbdOn: tcsetattr: %s\n",
 			     strerror(errno));
 		 }
-                 break; 
-#endif 
+                 break;
+#endif
         }
 #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) || defined (WSCONS_SUPPORT)
         switch (pKbd->consType) {
@@ -321,9 +321,9 @@ WSReadInput(InputInfoPtr pInfo)
 }
 
 static void
-printWsType(char *type, char *devname)
+printWsType(const char *type, const char *name)
 {
-    xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", devname, type); 
+    xf86Msg(X_PROBED, "%s: Keyboard type: %s\n", name, type);
 }
 #endif
 
-- 
1.8.3.3



More information about the xorg-devel mailing list