blob: cda8655b96890ba35b1d32bfbf5db037bb14a6cf [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001exports.*: fix warnings.
2
3Fix these warnings:
4lex.yy.c:1207: warning: 'yyunput' defined but not used
5lex.yy.c:1248: warning: 'input' defined but not used
6exports.y: In function 'set_hostname':
7exports.y:334: warning: large integer implicitly truncated to unsigned type
8exports.y: In function 'set_ipaddr':
9exports.y:350: warning: large integer implicitly truncated to unsigned type
10
11Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
12
13Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
14
15---
16 Config/exports.l | 3 +++
17 Config/exports.y | 6 ++++--
18 2 files changed, 7 insertions(+), 2 deletions(-)
19
20--- a/Config/exports.l
21+++ b/Config/exports.l
22@@ -48,6 +48,9 @@ NETCOMP [0-9]{1,2}
23 NET {IP}"/"{NETCOMP}
24 OLDNET {IP}"/"{IP}
25
26+%option nounput
27+%option noinput
28+
29 %%
30
31 ^{WHITE}*\n { /* eat empty line */ }
32--- a/Config/exports.y
33+++ b/Config/exports.y
34@@ -331,7 +331,8 @@ static void set_hostname(const char *nam
35 if (ent) {
36 memcpy(&cur_host.addr, ent->h_addr_list[0],
37 sizeof(struct in_addr));
38- cur_host.mask.s_addr = ~0UL;
39+ cur_host.mask.s_addr = 0;
40+ cur_host.mask.s_addr = ~cur_host.mask.s_addr;
41 } else {
42 logmsg(LOG_CRIT, "could not resolve hostname '%s'", name);
43 e_error = TRUE;
44@@ -347,7 +348,8 @@ static void set_ipaddr(const char *addr)
45
46 if (!inet_aton(addr, &cur_host.addr))
47 e_error = TRUE;
48- cur_host.mask.s_addr = ~0UL;
49+ cur_host.mask.s_addr = 0;
50+ cur_host.mask.s_addr = ~cur_host.mask.s_addr;
51 }
52
53 /*