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
|
From ae1a0a0fd0191ccc7dd4bbbf0a1803db0bd7ccca Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 12 Feb 2014 13:40:36 +0000
Subject: [PATCH 1/7] conffile: use standard uint*_t and unsigned char
Use the standard integer types. This fixes compiling errors with musl
libc.
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
---
support/include/conffile.h | 2 +-
support/nfs/conffile.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/support/include/conffile.h b/support/include/conffile.h
index 05ea5d2..94fb005 100644
--- a/support/include/conffile.h
+++ b/support/include/conffile.h
@@ -49,7 +49,7 @@ struct conf_list {
extern char *conf_path;
extern int conf_begin(void);
-extern int conf_decode_base64(u_int8_t *, u_int32_t *, u_char *);
+extern int conf_decode_base64(uint8_t *, uint32_t *, unsigned char *);
extern int conf_end(int, int);
extern void conf_free_list(struct conf_list *);
extern struct sockaddr *conf_get_address(char *, char *);
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index c3434d5..6b94ec0 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -72,10 +72,10 @@ TAILQ_HEAD (conf_trans_head, conf_trans) conf_trans_queue;
/*
* Radix-64 Encoding.
*/
-static const u_int8_t bin2asc[]
+static const uint8_t bin2asc[]
= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static const u_int8_t asc2bin[] =
+static const uint8_t asc2bin[] =
{
255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255,
@@ -109,10 +109,10 @@ LIST_HEAD (conf_bindings, conf_binding) conf_bindings[256];
static char *conf_addr;
-static __inline__ u_int8_t
+static __inline__ uint8_t
conf_hash(char *s)
{
- u_int8_t hash = 0;
+ uint8_t hash = 0;
while (*s) {
hash = ((hash << 1) | (hash >> 7)) ^ tolower (*s);
@@ -603,10 +603,10 @@ cleanup:
/* Decode a PEM encoded buffer. */
int
-conf_decode_base64 (u_int8_t *out, u_int32_t *len, u_char *buf)
+conf_decode_base64 (uint8_t *out, uint32_t *len, unsigned char *buf)
{
- u_int32_t c = 0;
- u_int8_t c1, c2, c3, c4;
+ uint32_t c = 0;
+ uint8_t c1, c2, c3, c4;
while (*buf) {
if (*buf > 127 || (c1 = asc2bin[*buf]) == 255)
--
1.8.5.3
|