1 Star 0 Fork 10

orange-snn/gpm

forked from src-openEuler/gpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-highly-illegal-return-of-int-as-char-and-less-wo.patch 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:51 . Package init
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 07/21] 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));
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/orange-snn/gpm.git
git@gitee.com:orange-snn/gpm.git
orange-snn
gpm
gpm
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385