Nmap Development mailing list archives
patch for compiler warnings
From: William MacKay <foobaz () gmail com>
Date: Fri, 9 Sep 2005 10:23:39 -0400
I made a patch that fixes a couple compiler warnings that shouldn't
affect nmap's functionality at all:
diff -ru nmap-3.90-orig/nsock/include/nsock.h nmap-3.90-foobaz/nsock/
include/nsock.h
--- nmap-3.90-orig/nsock/include/nsock.h 2005-04-14
21:23:53.000000000 -0400
+++ nmap-3.90-foobaz/nsock/include/nsock.h 2005-09-09
09:51:14.000000000 -0400
@@ -64,8 +64,12 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef __APPLE__
+#include <sys/time.h>
+#else
#include <time.h>
#endif
+#endif
#ifdef __cplusplus
extern "C" {
diff -ru nmap-3.90-orig/nsock/src/nsock_connect.c nmap-3.90-foobaz/
nsock/src/nsock_connect.c
--- nmap-3.90-orig/nsock/src/nsock_connect.c 2005-08-10
23:25:26.000000000 -0400
+++ nmap-3.90-foobaz/nsock/src/nsock_connect.c 2005-09-09
09:51:37.000000000 -0400
@@ -271,7 +271,7 @@
msiod *nsi = (msiod *) ms_iod;
int ret = 1;
struct sockaddr_storage sock;
- int slen = sizeof(struct sockaddr_storage);
+ unsigned int slen = sizeof(struct sockaddr_storage);
int res;
assert(socklen > 0);
diff -ru nmap-3.90-orig/nsock/src/nsock_core.c nmap-3.90-foobaz/nsock/
src/nsock_core.c
--- nmap-3.90-orig/nsock/src/nsock_core.c 2005-04-14
21:23:53.000000000 -0400
+++ nmap-3.90-foobaz/nsock/src/nsock_core.c 2005-09-09
09:52:00.000000000 -0400
@@ -209,7 +209,8 @@
void handle_connect_result(mspool *ms, msevent *nse,
enum nse_status status)
{
- int optval, optlen = sizeof(int);
+ int optval;
+ unsigned int optlen = sizeof(int);
char buf[1024];
msiod *iod = nse->iod;
#if HAVE_OPENSSL
@@ -789,9 +790,8 @@
gettimeofday(&nsock_tod, NULL);
- if (msec_timeout > 0) {
- TIMEVAL_NSEC_ADD(loop_timeout, nsock_tod, msec_timeout);
- } else if (msec_timeout < -1) {
+ TIMEVAL_NSEC_ADD(loop_timeout, nsock_tod, msec_timeout);
+ if (msec_timeout < -1) {
ms->errnum = EINVAL;
return NSOCK_LOOP_ERROR;
}
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Current thread:
- patch for compiler warnings William MacKay (Sep 09)
- Re: patch for compiler warnings Richard Moore (Sep 09)
- Re: patch for compiler warnings Fyodor (Sep 09)
