diff --git a/example/direct_tcpip.c b/example/direct_tcpip.c index 5261564a..9a2af732 100644 --- a/example/direct_tcpip.c +++ b/example/direct_tcpip.c @@ -256,7 +256,7 @@ int main(int argc, char *argv[]) /* Must use non-blocking IO hereafter due to the current libssh2 API */ libssh2_session_set_blocking(session, 0); - while(1) { + for(;;) { FD_ZERO(&fds); FD_SET(forwardsock, &fds); tv.tv_sec = 0; @@ -290,7 +290,7 @@ int main(int argc, char *argv[]) wr += i; } } - while(1) { + for(;;) { len = libssh2_channel_read(channel, buf, sizeof(buf)); if(LIBSSH2_ERROR_EAGAIN == len) break; diff --git a/example/scp_write.c b/example/scp_write.c index 58585bef..11e3860b 100644 --- a/example/scp_write.c +++ b/example/scp_write.c @@ -36,6 +36,10 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1900 +#pragma warning(disable:4127) +#endif + int main(int argc, char *argv[]) { unsigned long hostaddr; diff --git a/example/sftp.c b/example/sftp.c index d1e1d508..1f1ddaf3 100644 --- a/example/sftp.c +++ b/example/sftp.c @@ -42,6 +42,9 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1900 +#pragma warning(disable:4127) +#endif const char *keyfile1 = "~/.ssh/id_rsa.pub"; const char *keyfile2 = "~/.ssh/id_rsa"; diff --git a/example/sftp_RW_nonblock.c b/example/sftp_RW_nonblock.c index 8b57c30f..5b8fecec 100644 --- a/example/sftp_RW_nonblock.c +++ b/example/sftp_RW_nonblock.c @@ -39,6 +39,10 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1900 +#pragma warning(disable:4127) +#endif + #define STORAGE "/tmp/sftp-storage" /* this is the local file name this example uses to store the downloaded file in */ diff --git a/example/sftp_nonblock.c b/example/sftp_nonblock.c index 7cbf8630..e12c2a42 100644 --- a/example/sftp_nonblock.c +++ b/example/sftp_nonblock.c @@ -45,6 +45,10 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1900 +#pragma warning(disable:4127) +#endif + #ifdef HAVE_GETTIMEOFDAY /* diff in ms */ static long tvdiff(struct timeval newer, struct timeval older) diff --git a/example/sftpdir.c b/example/sftpdir.c index 3ca3bbf6..5174d14e 100644 --- a/example/sftpdir.c +++ b/example/sftpdir.c @@ -42,6 +42,10 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1900 +#pragma warning(disable:4127) +#endif + #ifdef WIN32 #define __FILESIZE "I64u" #else diff --git a/example/sftpdir_nonblock.c b/example/sftpdir_nonblock.c index d8fa32fc..62de69db 100644 --- a/example/sftpdir_nonblock.c +++ b/example/sftpdir_nonblock.c @@ -42,6 +42,10 @@ #include #include +#if defined(_MSC_VER) && _MSC_VER < 1900 +#pragma warning(disable:4127) +#endif + #ifdef WIN32 #define __FILESIZE "I64u" #else diff --git a/example/ssh2_agent.c b/example/ssh2_agent.c index e4a713cb..a4cf5e15 100644 --- a/example/ssh2_agent.c +++ b/example/ssh2_agent.c @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) rc = 1; goto shutdown; } - while(1) { + for(;;) { rc = libssh2_agent_get_identity(agent, &identity, prev_identity); if(rc == 1) break; diff --git a/example/ssh2_agent_forwarding.c b/example/ssh2_agent_forwarding.c index c65e0036..9735f397 100644 --- a/example/ssh2_agent_forwarding.c +++ b/example/ssh2_agent_forwarding.c @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) rc = 1; goto shutdown; } - while(1) { + for(;;) { rc = libssh2_agent_get_identity(agent, &identity, prev_identity); if(rc == 1) break; diff --git a/example/tcpip-forward.c b/example/tcpip-forward.c index 96d3a95c..3f9e6d7a 100644 --- a/example/tcpip-forward.c +++ b/example/tcpip-forward.c @@ -246,7 +246,7 @@ int main(int argc, char *argv[]) /* Must use non-blocking IO hereafter due to the current libssh2 API */ libssh2_session_set_blocking(session, 0); - while(1) { + for(;;) { FD_ZERO(&fds); FD_SET(forwardsock, &fds); tv.tv_sec = 0; @@ -277,7 +277,7 @@ int main(int argc, char *argv[]) wr += i; } while(i > 0 && wr < len); } - while(1) { + for(;;) { len = libssh2_channel_read(channel, buf, sizeof(buf)); if(LIBSSH2_ERROR_EAGAIN == len) break; diff --git a/example/x11.c b/example/x11.c index c49b64ea..5406b21e 100644 --- a/example/x11.c +++ b/example/x11.c @@ -389,7 +389,7 @@ main (int argc, char *argv[]) memset(&w_size, 0, sizeof(struct winsize)); memset(&w_size_bck, 0, sizeof(struct winsize)); - while(1) { + for(;;) { FD_ZERO(&set); FD_SET(fileno(stdin), &set);