From 107f0d8a79d3b94e20c080c21815440fbd761e12 Mon Sep 17 00:00:00 2001 From: Alexander Ponyatykh Date: Mon, 18 Nov 2019 23:55:27 +0300 Subject: [PATCH] Remove unused variables Global variable keyhandler is declared as pointer to incomplete struct type. Upon closer inspection, it turned out that this variable and client_handles_keys are unused. --- debian/changelog | 3 +- debian/patches/07-reinit-on-any-error.diff | 2 +- .../patches/08-remove-unused-variables.diff | 44 +++++++++++++++++++ debian/patches/series | 1 + 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 debian/patches/08-remove-unused-variables.diff diff --git a/debian/changelog b/debian/changelog index 7ab5203..8497493 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ g15daemon (1.9.5.3-11) unstable; urgency=medium * Reinitialize on eny error code, not only on a negative one. + * Remove unused variables. (Closes: bug#688465) - -- Alexander Ponyatykh Sun, 17 Nov 2019 15:24:00 +0300 + -- Alexander Ponyatykh Mon, 18 Nov 2019 23:57:31 +0300 g15daemon (1.9.5.3-10) unstable; urgency=medium diff --git a/debian/patches/07-reinit-on-any-error.diff b/debian/patches/07-reinit-on-any-error.diff index 69e2e56..a95e5b2 100644 --- a/debian/patches/07-reinit-on-any-error.diff +++ b/debian/patches/07-reinit-on-any-error.diff @@ -3,7 +3,7 @@ Description: Reinitialize on any libusb error. Author: Alexander Ponyatykh Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libusb/+bug/1357556 Forwarded: no -Last-Update: 2015-05-18 +Last-Update: 2019-11-17 =================================================================== --- a/g15daemon/main.c +++ b/g15daemon/main.c diff --git a/debian/patches/08-remove-unused-variables.diff b/debian/patches/08-remove-unused-variables.diff new file mode 100644 index 0000000..6bb1ad9 --- /dev/null +++ b/debian/patches/08-remove-unused-variables.diff @@ -0,0 +1,44 @@ +Description: Remove unused variables + Global variable keyhandler is declared as pointer to incomplete struct type. + Upon closer inspection, it turned out that this variable and + client_handles_keys are unused. +Author: Alexander Ponyatykh +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688465 +Last-Update: 2019-11-18 +=================================================================== +--- a/g15daemon/linked_lists.c ++++ b/g15daemon/linked_lists.c +@@ -30,8 +30,6 @@ + #include + #include + +-extern lcd_t *keyhandler; +-extern unsigned int client_handles_keys; + extern plugin_info_t *generic_info; + + lcd_t static * ll_create_lcd () { +@@ -175,12 +173,6 @@ + (*masterlist)->current->lcd->state_changed = 1; + } + +- if(&oldnode->lcd == (void*)keyhandler) { +- client_handles_keys = 0; +- keyhandler = NULL; +- g15daemon_log(LOG_WARNING,"Client key handler quit, going back to defaults"); +- } +- + if((*masterlist)->head!=oldnode){ + (*next)->prev = oldnode->prev; + (*prev)->next = oldnode->next; +--- a/g15daemon/main.c ++++ b/g15daemon/main.c +@@ -53,9 +53,7 @@ + int keyboard_backlight_off_onexit = 0; + unsigned int g15daemon_debug = 0; + unsigned int cycle_key; +-unsigned int client_handles_keys = 0; + static unsigned int set_backlight = 0; +-struct lcd_t *keyhandler = NULL; + + static int loaded_plugins = 0; + diff --git a/debian/patches/series b/debian/patches/series index c82dd2d..2cb2326 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ 05-send-a-sync-event-after-key-up-down.diff 06-fix-buffer-overflow.diff 07-reinit-on-any-error.diff +08-remove-unused-variables.diff