Ticket #71127: patch-libssh2-1.11-pragmas-older-gcc.diff
File patch-libssh2-1.11-pragmas-older-gcc.diff, 11.5 KB (added by ballapete (Peter "Pete" Dyballa), 3 weeks ago) |
---|
-
src/session.c
old new 568 568 #pragma warning(disable:4054) 569 569 /* 'type cast': from function pointer to data pointer */ 570 570 #pragma warning(disable:4055) 571 #else572 #pragma GCC diagnostic push573 #pragma GCC diagnostic ignored "-Wpedantic"574 571 #endif 575 572 LIBSSH2_API void * 576 573 libssh2_session_callback_set(LIBSSH2_SESSION * session, … … 581 578 } 582 579 #ifdef _MSC_VER 583 580 #pragma warning(pop) 584 #else585 #pragma GCC diagnostic pop586 581 #endif 587 582 588 583 /* … … 675 670 676 671 if(dir & LIBSSH2_SESSION_BLOCK_INBOUND) { 677 672 FD_ZERO(&rfd); 678 #if defined(__GNUC__)679 #pragma GCC diagnostic push680 #pragma GCC diagnostic ignored "-Wsign-conversion"681 #endif682 673 FD_SET(session->socket_fd, &rfd); 683 #if defined(__GNUC__)684 #pragma GCC diagnostic pop685 #endif686 674 readfd = &rfd; 687 675 } 688 676 689 677 if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND) { 690 678 FD_ZERO(&wfd); 691 #if defined(__GNUC__)692 #pragma GCC diagnostic push693 #pragma GCC diagnostic ignored "-Wsign-conversion"694 #endif695 679 FD_SET(session->socket_fd, &wfd); 696 #if defined(__GNUC__)697 #pragma GCC diagnostic pop698 #endif699 680 writefd = &wfd; 700 681 } 701 682 … … 1655 1636 switch(fds[i].type) { 1656 1637 case LIBSSH2_POLLFD_SOCKET: 1657 1638 if(fds[i].events & LIBSSH2_POLLFD_POLLIN) { 1658 #if defined(__GNUC__)1659 #pragma GCC diagnostic push1660 #pragma GCC diagnostic ignored "-Wsign-conversion"1661 #endif1662 1639 FD_SET(fds[i].fd.socket, &rfds); 1663 #if defined(__GNUC__)1664 #pragma GCC diagnostic pop1665 #endif1666 1640 if(fds[i].fd.socket > maxfd) 1667 1641 maxfd = fds[i].fd.socket; 1668 1642 } 1669 1643 if(fds[i].events & LIBSSH2_POLLFD_POLLOUT) { 1670 #if defined(__GNUC__)1671 #pragma GCC diagnostic push1672 #pragma GCC diagnostic ignored "-Wsign-conversion"1673 #endif1674 1644 FD_SET(fds[i].fd.socket, &wfds); 1675 #if defined(__GNUC__)1676 #pragma GCC diagnostic pop1677 #endif1678 1645 if(fds[i].fd.socket > maxfd) 1679 1646 maxfd = fds[i].fd.socket; 1680 1647 } 1681 1648 break; 1682 1649 1683 1650 case LIBSSH2_POLLFD_CHANNEL: 1684 #if defined(__GNUC__)1685 #pragma GCC diagnostic push1686 #pragma GCC diagnostic ignored "-Wsign-conversion"1687 #endif1688 1651 FD_SET(fds[i].fd.channel->session->socket_fd, &rfds); 1689 #if defined(__GNUC__)1690 #pragma GCC diagnostic pop1691 #endif1692 1652 if(fds[i].fd.channel->session->socket_fd > maxfd) 1693 1653 maxfd = fds[i].fd.channel->session->socket_fd; 1694 1654 if(!session) … … 1696 1656 break; 1697 1657 1698 1658 case LIBSSH2_POLLFD_LISTENER: 1699 #if defined(__GNUC__)1700 #pragma GCC diagnostic push1701 #pragma GCC diagnostic ignored "-Wsign-conversion"1702 #endif1703 1659 FD_SET(fds[i].fd.listener->session->socket_fd, &rfds); 1704 #if defined(__GNUC__)1705 #pragma GCC diagnostic pop1706 #endif1707 1660 if(fds[i].fd.listener->session->socket_fd > maxfd) 1708 1661 maxfd = fds[i].fd.listener->session->socket_fd; 1709 1662 if(!session) … … 1880 1833 for(i = 0; i < nfds; i++) { 1881 1834 switch(fds[i].type) { 1882 1835 case LIBSSH2_POLLFD_SOCKET: 1883 #if defined(__GNUC__)1884 #pragma GCC diagnostic push1885 #pragma GCC diagnostic ignored "-Wsign-conversion"1886 #endif1887 1836 if(FD_ISSET(fds[i].fd.socket, &rfds)) { 1888 1837 fds[i].revents |= LIBSSH2_POLLFD_POLLIN; 1889 1838 } … … 1893 1842 if(fds[i].revents) { 1894 1843 active_fds++; 1895 1844 } 1896 #if defined(__GNUC__)1897 #pragma GCC diagnostic pop1898 #endif1899 1845 break; 1900 1846 1901 1847 case LIBSSH2_POLLFD_CHANNEL: -
example/direct_tcpip.c
old new 248 248 for(;;) { 249 249 fd_set fds; 250 250 FD_ZERO(&fds); 251 #if defined(__GNUC__)252 #pragma GCC diagnostic push253 #pragma GCC diagnostic ignored "-Wsign-conversion"254 #endif255 251 FD_SET(forwardsock, &fds); 256 #if defined(__GNUC__)257 #pragma GCC diagnostic pop258 #endif259 252 tv.tv_sec = 0; 260 253 tv.tv_usec = 100000; 261 254 rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); … … 263 256 fprintf(stderr, "failed to select().\n"); 264 257 goto shutdown; 265 258 } 266 #if defined(__GNUC__)267 #pragma GCC diagnostic push268 #pragma GCC diagnostic ignored "-Wsign-conversion"269 #endif270 259 if(rc && FD_ISSET(forwardsock, &fds)) { 271 #if defined(__GNUC__)272 #pragma GCC diagnostic pop273 #endif274 260 len = recv(forwardsock, buf, sizeof(buf), 0); 275 261 if(len < 0) { 276 262 fprintf(stderr, "failed to recv().\n"); -
example/scp_nonblock.c
old new 64 64 65 65 FD_ZERO(&fd); 66 66 67 #if defined(__GNUC__)68 #pragma GCC diagnostic push69 #pragma GCC diagnostic ignored "-Wsign-conversion"70 #endif71 67 FD_SET(socket_fd, &fd); 72 #if defined(__GNUC__)73 #pragma GCC diagnostic pop74 #endif75 68 76 69 /* now make sure we wait in the correct direction */ 77 70 dir = libssh2_session_block_directions(session); -
example/sftp_write_nonblock.c
old new 54 54 55 55 FD_ZERO(&fd); 56 56 57 #if defined(__GNUC__)58 #pragma GCC diagnostic push59 #pragma GCC diagnostic ignored "-Wsign-conversion"60 #endif61 57 FD_SET(socket_fd, &fd); 62 #if defined(__GNUC__)63 #pragma GCC diagnostic pop64 #endif65 58 66 59 /* now make sure we wait in the correct direction */ 67 60 dir = libssh2_session_block_directions(session); -
example/scp_write_nonblock.c
old new 48 48 49 49 FD_ZERO(&fd); 50 50 51 #if defined(__GNUC__)52 #pragma GCC diagnostic push53 #pragma GCC diagnostic ignored "-Wsign-conversion"54 #endif55 51 FD_SET(socket_fd, &fd); 56 #if defined(__GNUC__)57 #pragma GCC diagnostic pop58 #endif59 52 60 53 /* now make sure we wait in the correct direction */ 61 54 dir = libssh2_session_block_directions(session); -
example/sftp_RW_nonblock.c
old new 56 56 57 57 FD_ZERO(&fd); 58 58 59 #if defined(__GNUC__)60 #pragma GCC diagnostic push61 #pragma GCC diagnostic ignored "-Wsign-conversion"62 #endif63 59 FD_SET(socket_fd, &fd); 64 #if defined(__GNUC__)65 #pragma GCC diagnostic pop66 #endif67 60 68 61 /* now make sure we wait in the correct direction */ 69 62 dir = libssh2_session_block_directions(session); … … 258 251 259 252 FD_ZERO(&fd); 260 253 FD_ZERO(&fd2); 261 #if defined(__GNUC__)262 #pragma GCC diagnostic push263 #pragma GCC diagnostic ignored "-Wsign-conversion"264 #endif265 254 FD_SET(sock, &fd); 266 255 FD_SET(sock, &fd2); 267 #if defined(__GNUC__)268 #pragma GCC diagnostic pop269 #endif270 256 271 257 /* wait for readable or writeable */ 272 258 rc = select((int)(sock + 1), &fd, &fd2, NULL, &timeout); … … 329 315 330 316 FD_ZERO(&fd); 331 317 FD_ZERO(&fd2); 332 #if defined(__GNUC__)333 #pragma GCC diagnostic push334 #pragma GCC diagnostic ignored "-Wsign-conversion"335 #endif336 318 FD_SET(sock, &fd); 337 319 FD_SET(sock, &fd2); 338 #if defined(__GNUC__)339 #pragma GCC diagnostic pop340 #endif341 320 342 321 /* wait for readable or writeable */ 343 322 rc = select((int)(sock + 1), &fd, &fd2, NULL, &timeout); -
example/sftp_nonblock.c
old new 65 65 66 66 FD_ZERO(&fd); 67 67 68 #if defined(__GNUC__)69 #pragma GCC diagnostic push70 #pragma GCC diagnostic ignored "-Wsign-conversion"71 #endif72 68 FD_SET(socket_fd, &fd); 73 #if defined(__GNUC__)74 #pragma GCC diagnostic pop75 #endif76 69 77 70 /* now make sure we wait in the correct direction */ 78 71 dir = libssh2_session_block_directions(session); -
example/sftp_write_sliding.c
old new 55 55 56 56 FD_ZERO(&fd); 57 57 58 #if defined(__GNUC__)59 #pragma GCC diagnostic push60 #pragma GCC diagnostic ignored "-Wsign-conversion"61 #endif62 58 FD_SET(socket_fd, &fd); 63 #if defined(__GNUC__)64 #pragma GCC diagnostic pop65 #endif66 59 67 60 /* now make sure we wait in the correct direction */ 68 61 dir = libssh2_session_block_directions(session); -
example/ssh2_agent_forwarding.c
old new 50 50 51 51 FD_ZERO(&fd); 52 52 53 #if defined(__GNUC__)54 #pragma GCC diagnostic push55 #pragma GCC diagnostic ignored "-Wsign-conversion"56 #endif57 53 FD_SET(socket_fd, &fd); 58 #if defined(__GNUC__)59 #pragma GCC diagnostic pop60 #endif61 54 62 55 /* now make sure we wait in the correct direction */ 63 56 dir = libssh2_session_block_directions(session); -
example/ssh2_echo.c
old new 47 47 48 48 FD_ZERO(&fd); 49 49 50 #if defined(__GNUC__)51 #pragma GCC diagnostic push52 #pragma GCC diagnostic ignored "-Wsign-conversion"53 #endif54 50 FD_SET(socket_fd, &fd); 55 #if defined(__GNUC__)56 #pragma GCC diagnostic pop57 #endif58 51 59 52 /* now make sure we wait in the correct direction */ 60 53 dir = libssh2_session_block_directions(session); -
example/ssh2_exec.c
old new 51 51 52 52 FD_ZERO(&fd); 53 53 54 #if defined(__GNUC__)55 #pragma GCC diagnostic push56 #pragma GCC diagnostic ignored "-Wsign-conversion"57 #endif58 54 FD_SET(socket_fd, &fd); 59 #if defined(__GNUC__)60 #pragma GCC diagnostic pop61 #endif62 55 63 56 /* now make sure we wait in the correct direction */ 64 57 dir = libssh2_session_block_directions(session); -
example/tcpip-forward.c
old new 246 246 for(;;) { 247 247 fd_set fds; 248 248 FD_ZERO(&fds); 249 #if defined(__GNUC__)250 #pragma GCC diagnostic push251 #pragma GCC diagnostic ignored "-Wsign-conversion"252 #endif253 249 FD_SET(forwardsock, &fds); 254 #if defined(__GNUC__)255 #pragma GCC diagnostic pop256 #endif257 250 tv.tv_sec = 0; 258 251 tv.tv_usec = 100000; 259 252 rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv); … … 261 254 fprintf(stderr, "failed to select().\n"); 262 255 goto shutdown; 263 256 } 264 #if defined(__GNUC__)265 #pragma GCC diagnostic push266 #pragma GCC diagnostic ignored "-Wsign-conversion"267 #endif268 257 if(rc && FD_ISSET(forwardsock, &fds)) { 269 #if defined(__GNUC__)270 #pragma GCC diagnostic pop271 #endif272 258 ssize_t nwritten; 273 259 len = recv(forwardsock, buf, sizeof(buf), 0); 274 260 if(len < 0) { -
example/x11.c
old new 210 210 timeval_out.tv_usec = 0; 211 211 212 212 FD_ZERO(&set); 213 #if defined(__GNUC__)214 #pragma GCC diagnostic push215 #pragma GCC diagnostic ignored "-Wsign-conversion"216 #endif217 213 FD_SET(sock, &set); 218 #if defined(__GNUC__)219 #pragma GCC diagnostic pop220 #endif221 214 222 215 buf = calloc(bufsize, sizeof(char)); 223 216 if(!buf) … … 415 408 for(;;) { 416 409 417 410 FD_ZERO(&set); 418 #if defined(__GNUC__)419 #pragma GCC diagnostic push420 #pragma GCC diagnostic ignored "-Wsign-conversion"421 #endif422 411 FD_SET(fileno(stdin), &set); 423 #if defined(__GNUC__)424 #pragma GCC diagnostic pop425 #endif426 412 427 413 /* Search if a resize pty has to be send */ 428 414 ioctl(fileno(stdin), TIOCGWINSZ, &w_size);