Pārlūkot izejas kodu

- 64 bits warnings fixed

Andrei Pelinescu-Onciul 20 gadi atpakaļ
vecāks
revīzija
2b04f2a819
2 mainītis faili ar 7 papildinājumiem un 7 dzēšanām
  1. 4 4
      io_wait.c
  2. 3 3
      tcp_main.c

+ 4 - 4
io_wait.c

@@ -394,8 +394,8 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method)
 	h->fd_hash=local_malloc(sizeof(*(h->fd_hash))*h->max_fd_no);
 	h->fd_hash=local_malloc(sizeof(*(h->fd_hash))*h->max_fd_no);
 	if (h->fd_hash==0){
 	if (h->fd_hash==0){
 		LOG(L_CRIT, "ERROR: init_io_wait: could not alloc"
 		LOG(L_CRIT, "ERROR: init_io_wait: could not alloc"
-					" fd hashtable (%d bytes)\n",
-					sizeof(*(h->fd_hash))*h->max_fd_no );
+					" fd hashtable (%ld bytes)\n",
+					(long)sizeof(*(h->fd_hash))*h->max_fd_no );
 		goto error;
 		goto error;
 	}
 	}
 	memset((void*)h->fd_hash, 0, sizeof(*(h->fd_hash))*h->max_fd_no);
 	memset((void*)h->fd_hash, 0, sizeof(*(h->fd_hash))*h->max_fd_no);
@@ -411,8 +411,8 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method)
 			h->fd_array=local_malloc(sizeof(*(h->fd_array))*h->max_fd_no);
 			h->fd_array=local_malloc(sizeof(*(h->fd_array))*h->max_fd_no);
 			if (h->fd_array==0){
 			if (h->fd_array==0){
 				LOG(L_CRIT, "ERROR: init_io_wait: could not"
 				LOG(L_CRIT, "ERROR: init_io_wait: could not"
-							" alloc fd array (%d bytes)\n",
-							sizeof(*(h->fd_hash))*h->max_fd_no);
+							" alloc fd array (%ld bytes)\n",
+							(long)sizeof(*(h->fd_hash))*h->max_fd_no);
 				goto error;
 				goto error;
 			}
 			}
 			memset((void*)h->fd_array, 0, sizeof(*(h->fd_array))*h->max_fd_no);
 			memset((void*)h->fd_array, 0, sizeof(*(h->fd_array))*h->max_fd_no);

+ 3 - 3
tcp_main.c

@@ -1133,10 +1133,10 @@ inline static int handle_tcp_child(struct tcp_child* tcp_c, int fd_i)
 			/* EAGAIN is ok if we try to empty the buffer
 			/* EAGAIN is ok if we try to empty the buffer
 			 * e.g.: SIGIO_RT overflow mode or EPOLL ET */
 			 * e.g.: SIGIO_RT overflow mode or EPOLL ET */
 			if ((errno!=EAGAIN) && (errno!=EWOULDBLOCK)){
 			if ((errno!=EAGAIN) && (errno!=EWOULDBLOCK)){
-				LOG(L_CRIT, "ERROR: handle_tcp_child: read from tcp child %d "
+				LOG(L_CRIT, "ERROR: handle_tcp_child: read from tcp child %ld "
 						" (pid %d, no %d) %s [%d]\n",
 						" (pid %d, no %d) %s [%d]\n",
-						tcp_c-&tcp_children[0], tcp_c->pid, tcp_c->proc_no,
-						strerror(errno), errno );
+						(long)(tcp_c-&tcp_children[0]), tcp_c->pid,
+						tcp_c->proc_no, strerror(errno), errno );
 			}else{
 			}else{
 				bytes=0;
 				bytes=0;
 			}
 			}