net/tcpview: Permanently fix LLVM15 errors

Fix int-conversion errors flagged by LLVM15.

detail-domain.c:573:13: error: incompatible pointer to integer conversion
returning 'void *' from a function with result type 'int' [-Wint-conversion]
            return NULL;
                   ^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
                ^~~~~~~~~~~
This commit is contained in:
Cy Schubert 2023-02-14 21:20:04 -08:00
parent e88ae745ad
commit 2d263ddfe1
2 changed files with 128 additions and 9 deletions

View file

@ -13,8 +13,6 @@ USES= bison motif tar:Z
MAKE_ARGS= PREFIX=${STAGEDIR}${PREFIX} MAKE_ARGS= PREFIX=${STAGEDIR}${PREFIX}
MAKE_JOBS_UNSAFE= yes MAKE_JOBS_UNSAFE= yes
CFLAGS= -Wno-int-conversion
post-patch: post-patch:
.for f in nametoaddr.c addrtoname.c print-nfs.c detail-tcp.c tv_addrtoname.c .for f in nametoaddr.c addrtoname.c print-nfs.c detail-tcp.c tv_addrtoname.c
@${REINPLACE_CMD} -e 's/NTOHL/ntohl/ ; s/NTOHS/ntohs/' ${WRKSRC}/${f} @${REINPLACE_CMD} -e 's/NTOHL/ntohl/ ; s/NTOHS/ntohs/' ${WRKSRC}/${f}

View file

@ -1,6 +1,14 @@
--- detail-domain.c.orig 1993-04-22 20:39:51 UTC --- detail-domain.c.orig 1993-04-22 13:39:51.000000000 -0700
+++ detail-domain.c +++ detail-domain.c 2023-02-14 21:16:01.401668000 -0800
@@ -199,6 +199,7 @@ p_type(type) @@ -103,6 +103,7 @@
#define FAIL 1
#define SUCCEED 0
+#define IGNORE 0
#define MIN(a,b) (((a)<(b))?(a):(b))
@@ -199,6 +200,7 @@
case T_ANY: /* matches any type */ case T_ANY: /* matches any type */
strcpy(type_buf, "ANY"); strcpy(type_buf, "ANY");
break; break;
@ -8,7 +16,7 @@
case T_UINFO: case T_UINFO:
strcpy(type_buf, "UINFO"); strcpy(type_buf, "UINFO");
break; break;
@@ -211,6 +212,7 @@ p_type(type) @@ -211,6 +213,7 @@
case T_UNSPEC: case T_UNSPEC:
strcpy(type_buf, "UNSPEC"); strcpy(type_buf, "UNSPEC");
break; break;
@ -16,7 +24,120 @@
default: default:
sprintf(type_buf, "%d", type); sprintf(type_buf, "%d", type);
break; break;
@@ -633,6 +635,7 @@ p_ans(msg, eom) @@ -444,7 +447,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" Canonical name = %s\n", str);
MARK_WINDOW();
@@ -455,7 +458,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" MB domain name = %s\n", str);
MARK_WINDOW();
@@ -466,7 +469,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" MD domain name = %s (obsolete)\n", str);
MARK_WINDOW();
@@ -477,7 +480,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" MF domain name = %s (obsolete)\n", str);
MARK_WINDOW();
@@ -488,7 +491,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" Mail group member = %s\n", str);
MARK_WINDOW();
@@ -499,7 +502,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" Mail rename domain name = %s\n", str);
MARK_WINDOW();
@@ -512,7 +515,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" Mail exchangeer = %s, preference %u\n", str, pref);
MARK_WINDOW();
@@ -523,7 +526,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" Authoritative name server = %s\n", str);
MARK_WINDOW();
@@ -534,7 +537,7 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" Domain name pointer = %s\n", str);
MARK_WINDOW();
@@ -568,7 +571,7 @@
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
MARK_SAVED_WIN(saveind, -1, -1);
- return NULL;
+ return IGNORE;
}
printf(" Origin: %s\n", str);
MARK_WINDOW();
@@ -578,7 +581,7 @@
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
MARK_SAVED_WIN(saveind, -1, -1);
- return NULL;
+ return IGNORE;
}
printf(" Mail Addr: %s\n", str);
MARK_WINDOW();
@@ -621,18 +624,19 @@
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf(" MINFO: requests = %s", str);
str = p_cdname(msg, eom);
if (str == NULL) {
printf(" ** Data truncated **\n");
MARK_WINDOW_NONE();
- return NULL;
+ return IGNORE;
}
printf("; errors = %s\n", str); printf("; errors = %s\n", str);
MARK_WINDOW(); MARK_WINDOW();
@ -24,7 +145,7 @@
case T_UINFO: case T_UINFO:
printf(" UINFO: "); printf(" UINFO: ");
printf("%s\n", cp); printf("%s\n", cp);
@@ -654,6 +657,12 @@ p_ans(msg, eom) @@ -654,6 +658,12 @@
MARK_WINDOW(); MARK_WINDOW();
break; break;
@ -37,7 +158,7 @@
case T_WKS: case T_WKS:
if (rdlength < (int)(sizeof(u_long) + 1)) if (rdlength < (int)(sizeof(u_long) + 1))
break; break;
@@ -730,11 +739,6 @@ p_ans(msg, eom) @@ -730,11 +740,6 @@
break; break;