#define MSG_ZEROCOPY    0x4000000
 #endif
 
-#define FILE_SZ (1UL << 35)
+#define FILE_SZ (1ULL << 35)
 static int cfg_family = AF_INET6;
 static socklen_t cfg_alen = sizeof(struct sockaddr_in6);
 static int cfg_port = 8787;
                        socklen_t zc_len = sizeof(zc);
                        int res;
 
-                       zc.address = (__u64)addr;
+                       zc.address = (__u64)((unsigned long)addr);
                        zc.length = chunk_size;
                        zc.recv_skip_hint = 0;
                        res = getsockopt(fd, IPPROTO_TCP, TCP_ZEROCOPY_RECEIVE,
 {
        struct sockaddr_storage listenaddr, addr;
        unsigned int max_pacing_rate = 0;
-       unsigned long total = 0;
+       size_t total = 0;
        char *host = NULL;
        int fd, c, on = 1;
        char *buffer;
                zflg = 0;
        }
        while (total < FILE_SZ) {
-               long wr = FILE_SZ - total;
+               ssize_t wr = FILE_SZ - total;
 
                if (wr > chunk_size)
                        wr = chunk_size;