sock and intro now builds clean master
authormcc <mcc@duce.noddleisland.org>
Thu, 19 Oct 2017 16:34:38 +0000 (16:34 +0000)
committermcc <mcc@duce.noddleisland.org>
Thu, 19 Oct 2017 16:34:38 +0000 (16:34 +0000)
intro/byteorder.c
sock/cliopen.c
sock/loopudp.c
sock/servopen.c
sock/sock [new file with mode: 0755]
sock/sockopts.c
sock/write.c

index beb40fd..b8b6e4e 100644 (file)
@@ -18,7 +18,7 @@ main(int argc, char **argv)
                else
                        printf("unknown\n");
        } else
-               printf("sizeof(short) = %d\n", sizeof(short));
+               printf("sizeof(short) = %d\n", (int) sizeof(short));
 
        exit(0);
 }
index e982e01..ce4f8e8 100644 (file)
@@ -12,7 +12,8 @@
 int
 cliopen(char *host, char *port)
 {
-       int                                     fd, i, on;
+       int                                     fd, on;
+       socklen_t i;
        const char                      *protocol;
        struct in_addr          inaddr;
        struct servent          *sp;
index 351f5f0..12e57b9 100644 (file)
@@ -16,7 +16,8 @@ void
 loop_udp(int sockfd)
 {
        int                                             maxfdp1, nread, ntowrite, stdineof,
-                                                       clilen, servlen, flags;
+                                                       clilen, flags;
+       socklen_t       servlen;
        fd_set                                  rset;
        struct sockaddr_in              cliaddr;                /* for UDP server */
        struct sockaddr_in              servaddr;               /* for UDP client */
index 08a268a..648d137 100644 (file)
@@ -12,7 +12,8 @@
 int
 servopen(char *host, char *port)
 {
-       int                                     fd, newfd, i, on, pid;
+       int                                     fd, newfd, on, pid;
+       socklen_t i;
        const char                      *protocol;
        struct in_addr          inaddr;
        struct servent          *sp;
diff --git a/sock/sock b/sock/sock
new file mode 100755 (executable)
index 0000000..7479fa0
Binary files /dev/null and b/sock/sock differ
index 6e276de..a47d87a 100644 (file)
 #include       <fcntl.h>
 #include       <sys/ioctl.h>
 
+#ifdef  FIOASYNC
+                static void sigio_func(int);
+#endif
+
 void
 sockopts(int sockfd, int doall)
 {
-    int                        option, optlen;
+    int                        option;
+    socklen_t optlen;
        struct linger   ling;
        struct timeval  timer;
 
@@ -328,7 +333,7 @@ sockopts(int sockfd, int doall)
 
     if (sigio) {
 #ifdef FIOASYNC
-               static void sigio_func(int);
+               /*static void sigio_func(int); */
 
                /*
                 * Should be able to set this with fcntl(O_ASYNC) or fcntl(FASYNC),
index 205524d..ba5341d 100644 (file)
@@ -38,12 +38,12 @@ dowrite(int fd, const void *vptr, size_t nbytes)
        ptr = vptr;
        nleft = nbytes;
        for (i = 0; i < UIO_MAXIOV; i++) {
-               iov[i].iov_base = ptr;
+               iov[i].iov_base = (char *) ptr;
                n = (nleft >= chunksize) ? chunksize : nleft;
                iov[i].iov_len = n;
                if (verbose)
-                       fprintf(stderr, "iov[%2d].iov_base = %x, iov[%2d].iov_len = %d\n",
-                                               i, iov[i].iov_base, i, iov[i].iov_len);
+                       fprintf(stderr, "iov[%2d].iov_base = %p, iov[%2d].iov_len = %d\n",
+                                               i, iov[i].iov_base, i, (int) iov[i].iov_len);
                ptr += n;
                if ((nleft -= n) == 0)
                        break;