summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/unfs3/unfs3/fix_warnings.patch
blob: ed61ea16fe14ad3282410ac7a098c1adb6c20fd8 (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
exports.*: fix warnings.

Fix these warnings:
lex.yy.c:1207: warning: 'yyunput' defined but not used
lex.yy.c:1248: warning: 'input' defined but not used
exports.y: In function 'set_hostname':
exports.y:334: warning: large integer implicitly truncated to unsigned type
exports.y: In function 'set_ipaddr':
exports.y:350: warning: large integer implicitly truncated to unsigned type

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>

Upstream-Status: Pending

---
 Config/exports.l |    3 +++
 Config/exports.y |    6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

--- a/Config/exports.l
+++ b/Config/exports.l
@@ -48,6 +48,9 @@ NETCOMP [0-9]{1,2}
 NET {IP}"/"{NETCOMP}
 OLDNET {IP}"/"{IP}
 
+%option nounput
+%option noinput
+
 %%
 
 ^{WHITE}*\n		{ /* eat empty line */ }
--- a/Config/exports.y
+++ b/Config/exports.y
@@ -331,7 +331,8 @@ static void set_hostname(const char *nam
 	if (ent) {
 		memcpy(&cur_host.addr, ent->h_addr_list[0],
 		       sizeof(struct in_addr));
-		cur_host.mask.s_addr = ~0UL;
+		cur_host.mask.s_addr = 0;
+		cur_host.mask.s_addr = ~cur_host.mask.s_addr;
 	} else {
 		logmsg(LOG_CRIT, "could not resolve hostname '%s'", name);
 		e_error = TRUE;
@@ -347,7 +348,8 @@ static void set_ipaddr(const char *addr)
 	
 	if (!inet_aton(addr, &cur_host.addr))
 		e_error = TRUE;
-	cur_host.mask.s_addr = ~0UL;
+	cur_host.mask.s_addr = 0;
+	cur_host.mask.s_addr = ~cur_host.mask.s_addr;
 }
 
 /*
OpenPOWER on IntegriCloud