aboutsummaryrefslogtreecommitdiffstats
path: root/main/gpm/fix-highly-illegal-return-of-in-as-char.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/gpm/fix-highly-illegal-return-of-in-as-char.patch')
-rw-r--r--main/gpm/fix-highly-illegal-return-of-in-as-char.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/main/gpm/fix-highly-illegal-return-of-in-as-char.patch b/main/gpm/fix-highly-illegal-return-of-in-as-char.patch
new file mode 100644
index 00000000000..6cf0e22a2d6
--- /dev/null
+++ b/main/gpm/fix-highly-illegal-return-of-in-as-char.patch
@@ -0,0 +1,44 @@
+From 5648239f18ac041fe1a93b8b784bf3ca8e1d83bc Mon Sep 17 00:00:00 2001
+From: nick black <nick.black@sprezzatech.com>
+Date: Fri, 8 Feb 2013 05:52:13 -0500
+Subject: [PATCH] fix highly illegal return of int as char *, and less worrying
+ set-but-not-used warning
+
+---
+ src/twiddler.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/twiddler.c b/src/twiddler.c
+index 1d2bd50..972a616 100644
+--- a/src/twiddler.c
++++ b/src/twiddler.c
+@@ -250,7 +250,6 @@ static inline int twiddler_use_item(char *item)
+ int twiddler_key(unsigned long message)
+ {
+ char **table = twiddler_get_table(message);
+- char *val;
+ /*
+ * These two are needed to avoid transmitting single keys when typing
+ * chords. When the number of keys being held down decreases, data
+@@ -269,7 +268,6 @@ int twiddler_key(unsigned long message)
+
+ if (!table) return 0;
+ message &= 0xff;
+- val = table[message];
+
+ if ((message < last_message) && !marked) { /* ok, do it */
+ marked++; /* don't retransmit on release */
+@@ -428,8 +426,11 @@ char *twiddler_rest_to_value(char *s)
+ buf[ibuf]='\0';
+ return strdup(buf);
+ }
+- if (*ptr == '\\')
+- return (char *)twiddler_escape_sequence(ptr+1, &len /* unused */);
++ if (*ptr == '\\') {
++ buf[ibuf++] = twiddler_escape_sequence(ptr+1, &len /* unused */);
++ buf[ibuf] = '\0';
++ return strdup(buf);
++ }
+
+ if (strlen(ptr)==1) return ((char *)((unsigned long)*ptr & 0xFF));
+