aboutsummaryrefslogtreecommitdiffstats
path: root/main/kbd/0001-Replace-u_short-with-unsigned-short.patch
blob: cefcbe8e155660533a3169fd7c39190d834c9cee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From 4c61d59e9c85e26cee306ed1b964030c1e862e00 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 20 Aug 2014 08:44:41 +0200
Subject: [PATCH 1/4] Replace u_short with unsigned short

u_short is non-standard and causes build failure with musl libc.

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
 src/libkeymap/dump.c    | 6 +++---
 src/libkeymap/kmap.c    | 6 +++---
 src/libkeymap/summary.c | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/libkeymap/dump.c b/src/libkeymap/dump.c
index 0262e24..e0c502e 100644
--- a/src/libkeymap/dump.c
+++ b/src/libkeymap/dump.c
@@ -69,7 +69,7 @@ lk_dump_bkeymap(struct lk_ctx *ctx, FILE *fd)
 			continue;
 
 		for (j = 0; j < NR_KEYS / 2; j++) {
-			u_short v;
+			unsigned short v;
 			v = lk_get_key(ctx, i, j);
 
 			if (fwrite(&v, sizeof(v), 1, fd) != 1)
@@ -130,7 +130,7 @@ lk_dump_ctable(struct lk_ctx *ctx, FILE *fd)
 		if (lk_map_exists(ctx, i)) {
 			if (i)
 				fprintf(fd, "static ");
-			fprintf(fd, "u_short %s_map[NR_KEYS] = {", mk_mapname(i));
+			fprintf(fd, "unsigned short %s_map[NR_KEYS] = {", mk_mapname(i));
 			for (j = 0; j < NR_KEYS; j++) {
 				if (!(j % 8))
 					fprintf(fd, "\n");
@@ -489,7 +489,7 @@ no_shorthands:
 
 		isasexpected = 0;
 		if (isletter) {
-			u_short defs[16];
+			unsigned short defs[16];
 			defs[0] = K(KT_LETTER, val);
 			defs[1] = K(KT_LETTER, val ^ 32);
 			defs[2] = defs[0];
diff --git a/src/libkeymap/kmap.c b/src/libkeymap/kmap.c
index 67be81e..8b90654 100644
--- a/src/libkeymap/kmap.c
+++ b/src/libkeymap/kmap.c
@@ -173,7 +173,7 @@ lk_add_key(struct lk_ctx *ctx, unsigned int k_table, unsigned int k_index, int k
 }
 
 static int
-do_constant_key(struct lk_ctx *ctx, int i, u_short key)
+do_constant_key(struct lk_ctx *ctx, int i, unsigned short key)
 {
 	int typ, val;
 	unsigned int j;
@@ -183,7 +183,7 @@ do_constant_key(struct lk_ctx *ctx, int i, u_short key)
 
 	if ((typ == KT_LATIN || typ == KT_LETTER) &&
 	    ((val >= 'a' && val <= 'z') || (val >= 'A' && val <= 'Z'))) {
-		u_short defs[16];
+		unsigned short defs[16];
 		defs[0] = K(KT_LETTER, val);
 		defs[1] = K(KT_LETTER, val ^ 32);
 		defs[2] = defs[0];
@@ -235,7 +235,7 @@ lk_add_constants(struct lk_ctx *ctx)
 
 	for (i = 0; i < ctx->key_constant->total; i++) {
 		char *constant;
-		u_short key;
+		unsigned short key;
 
 		constant = lk_array_get(ctx->key_constant, i);
 		if (!constant || !(*constant))
diff --git a/src/libkeymap/summary.c b/src/libkeymap/summary.c
index 46df90d..44d4e5f 100644
--- a/src/libkeymap/summary.c
+++ b/src/libkeymap/summary.c
@@ -30,7 +30,7 @@ valid_type(int fd, int t)
 	return (ioctl(fd, KDSKBENT, (unsigned long) &ke) == 0);
 }
 
-static u_char
+static unsigned char
 maximum_val(int fd, int t)
 {
 	struct kbentry ke, ke0;
-- 
2.1.0