Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | exports.*: fix warnings. |
| 2 | |
| 3 | Fix these warnings: |
| 4 | lex.yy.c:1207: warning: 'yyunput' defined but not used |
| 5 | lex.yy.c:1248: warning: 'input' defined but not used |
| 6 | exports.y: In function 'set_hostname': |
| 7 | exports.y:334: warning: large integer implicitly truncated to unsigned type |
| 8 | exports.y: In function 'set_ipaddr': |
| 9 | exports.y:350: warning: large integer implicitly truncated to unsigned type |
| 10 | |
| 11 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
| 12 | |
| 13 | Upstream-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 | /* |