diff mbox series

[23/27] hotkey: rename list 'hotkeys' to avoid name shadowing

Message ID 20180815131129.24146-24-colin.king@canonical.com
State Accepted
Headers show
Series [01/27] lib: fwts_framework: ensure src pointer is const | expand

Commit Message

Colin Ian King Aug. 15, 2018, 1:11 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Rename the list 'hotkeys' to 'hotkeys_list' to avoid name shadowing
confusion with various functions that use hotkeys as an argument
too.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/hotkey/hotkey/hotkey.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Alex Hung Aug. 15, 2018, 6:11 p.m. UTC | #1
On 2018-08-15 06:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Rename the list 'hotkeys' to 'hotkeys_list' to avoid name shadowing
> confusion with various functions that use hotkeys as an argument
> too.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/hotkey/hotkey/hotkey.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/hotkey/hotkey/hotkey.c b/src/hotkey/hotkey/hotkey.c
> index 79833d2e..640717cd 100644
> --- a/src/hotkey/hotkey/hotkey.c
> +++ b/src/hotkey/hotkey/hotkey.c
> @@ -30,7 +30,7 @@
>   
>   #define AT_KEYBOARD	"AT Translated Set 2 keyboard"
>   
> -static fwts_list *hotkeys;
> +static fwts_list *hotkeys_list;
>   static char *hotkey_dev;
>   static char *hotkey_keymap;
>   
> @@ -215,7 +215,7 @@ static int hotkey_init(fwts_framework *fw)
>   		fwts_log_error(fw, "Cannot determine keymap for this machine.");
>   		return FWTS_ERROR;
>   	}
> -	if ((hotkeys = fwts_keymap_load(hotkey_keymap)) == NULL) {
> +	if ((hotkeys_list = fwts_keymap_load(hotkey_keymap)) == NULL) {
>   		fwts_log_error(fw, "Cannot load keymap for this machine.");
>   		return FWTS_ERROR;
>   	}
> @@ -227,7 +227,7 @@ static int hotkey_deinit(fwts_framework *fw)
>   {
>   	FWTS_UNUSED(fw);
>   
> -	fwts_keymap_free(hotkeys);
> +	fwts_keymap_free(hotkeys_list);
>   	free(hotkey_dev);
>   	free(hotkey_keymap);
>   	return FWTS_OK;
> @@ -241,7 +241,7 @@ static int hotkey_test1(fwts_framework *fw)
>   		"keys.");
>   	fwts_log_nl(fw);
>   	fwts_log_info(fw, "Using %s keymap and %s input device.", hotkey_keymap, hotkey_dev);
> -	hotkey_test(fw, hotkey_dev, hotkeys);
> +	hotkey_test(fw, hotkey_dev, hotkeys_list);
>   
>   	fwts_infoonly(fw);
>   
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 16, 2018, 9:20 a.m. UTC | #2
On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Rename the list 'hotkeys' to 'hotkeys_list' to avoid name shadowing
> confusion with various functions that use hotkeys as an argument
> too.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/hotkey/hotkey/hotkey.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/hotkey/hotkey/hotkey.c b/src/hotkey/hotkey/hotkey.c
> index 79833d2e..640717cd 100644
> --- a/src/hotkey/hotkey/hotkey.c
> +++ b/src/hotkey/hotkey/hotkey.c
> @@ -30,7 +30,7 @@
>  
>  #define AT_KEYBOARD	"AT Translated Set 2 keyboard"
>  
> -static fwts_list *hotkeys;
> +static fwts_list *hotkeys_list;
>  static char *hotkey_dev;
>  static char *hotkey_keymap;
>  
> @@ -215,7 +215,7 @@ static int hotkey_init(fwts_framework *fw)
>  		fwts_log_error(fw, "Cannot determine keymap for this machine.");
>  		return FWTS_ERROR;
>  	}
> -	if ((hotkeys = fwts_keymap_load(hotkey_keymap)) == NULL) {
> +	if ((hotkeys_list = fwts_keymap_load(hotkey_keymap)) == NULL) {
>  		fwts_log_error(fw, "Cannot load keymap for this machine.");
>  		return FWTS_ERROR;
>  	}
> @@ -227,7 +227,7 @@ static int hotkey_deinit(fwts_framework *fw)
>  {
>  	FWTS_UNUSED(fw);
>  
> -	fwts_keymap_free(hotkeys);
> +	fwts_keymap_free(hotkeys_list);
>  	free(hotkey_dev);
>  	free(hotkey_keymap);
>  	return FWTS_OK;
> @@ -241,7 +241,7 @@ static int hotkey_test1(fwts_framework *fw)
>  		"keys.");
>  	fwts_log_nl(fw);
>  	fwts_log_info(fw, "Using %s keymap and %s input device.", hotkey_keymap, hotkey_dev);
> -	hotkey_test(fw, hotkey_dev, hotkeys);
> +	hotkey_test(fw, hotkey_dev, hotkeys_list);
>  
>  	fwts_infoonly(fw);
>  

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/hotkey/hotkey/hotkey.c b/src/hotkey/hotkey/hotkey.c
index 79833d2e..640717cd 100644
--- a/src/hotkey/hotkey/hotkey.c
+++ b/src/hotkey/hotkey/hotkey.c
@@ -30,7 +30,7 @@ 
 
 #define AT_KEYBOARD	"AT Translated Set 2 keyboard"
 
-static fwts_list *hotkeys;
+static fwts_list *hotkeys_list;
 static char *hotkey_dev;
 static char *hotkey_keymap;
 
@@ -215,7 +215,7 @@  static int hotkey_init(fwts_framework *fw)
 		fwts_log_error(fw, "Cannot determine keymap for this machine.");
 		return FWTS_ERROR;
 	}
-	if ((hotkeys = fwts_keymap_load(hotkey_keymap)) == NULL) {
+	if ((hotkeys_list = fwts_keymap_load(hotkey_keymap)) == NULL) {
 		fwts_log_error(fw, "Cannot load keymap for this machine.");
 		return FWTS_ERROR;
 	}
@@ -227,7 +227,7 @@  static int hotkey_deinit(fwts_framework *fw)
 {
 	FWTS_UNUSED(fw);
 
-	fwts_keymap_free(hotkeys);
+	fwts_keymap_free(hotkeys_list);
 	free(hotkey_dev);
 	free(hotkey_keymap);
 	return FWTS_OK;
@@ -241,7 +241,7 @@  static int hotkey_test1(fwts_framework *fw)
 		"keys.");
 	fwts_log_nl(fw);
 	fwts_log_info(fw, "Using %s keymap and %s input device.", hotkey_keymap, hotkey_dev);
-	hotkey_test(fw, hotkey_dev, hotkeys);
+	hotkey_test(fw, hotkey_dev, hotkeys_list);
 
 	fwts_infoonly(fw);