diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-12-30 22:18:45 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-12-30 22:19:05 +0100 |
commit | 0a5b8af777efbcbc7d2bb0aeb7ae8f34d88270d0 (patch) | |
tree | e38eac6eb90b76089bd72ccfd1c0d73225ec85ec /docs | |
parent | a6d20b89db8ee79b1a5f8188a680fea8047b145e (diff) | |
download | curl-0a5b8af777efbcbc7d2bb0aeb7ae8f34d88270d0.tar.gz |
examples: fix more empty expression statement has no effect
Follow-up to 26e46617b9
Diffstat (limited to 'docs')
-rw-r--r-- | docs/examples/http2-pushinmemory.c | 2 | ||||
-rw-r--r-- | docs/examples/http2-serverpush.c | 2 | ||||
-rw-r--r-- | docs/examples/rtsp.c | 25 |
3 files changed, 16 insertions, 13 deletions
diff --git a/docs/examples/http2-pushinmemory.c b/docs/examples/http2-pushinmemory.c index 74e0bc76e..7610ccc35 100644 --- a/docs/examples/http2-pushinmemory.c +++ b/docs/examples/http2-pushinmemory.c @@ -163,7 +163,7 @@ int main(void) * easy handles but *we* need to clean them up when they are done. */ do { - int msgq = 0;; + int msgq = 0; m = curl_multi_info_read(multi, &msgq); if(m && (m->msg == CURLMSG_DONE)) { CURL *e = m->easy_handle; diff --git a/docs/examples/http2-serverpush.c b/docs/examples/http2-serverpush.c index b3bee16cd..56f463dc7 100644 --- a/docs/examples/http2-serverpush.c +++ b/docs/examples/http2-serverpush.c @@ -315,7 +315,7 @@ int main(void) */ do { - int msgq = 0;; + int msgq = 0; m = curl_multi_info_read(multi_handle, &msgq); if(m && (m->msg == CURLMSG_DONE)) { CURL *e = m->easy_handle; diff --git a/docs/examples/rtsp.c b/docs/examples/rtsp.c index c1fc653ac..dd287d98b 100644 --- a/docs/examples/rtsp.c +++ b/docs/examples/rtsp.c @@ -61,17 +61,20 @@ static int _getch(void) #define VERSION_STR "V1.0" /* error handling macros */ -#define my_curl_easy_setopt(A, B, C) \ - res = curl_easy_setopt((A), (B), (C)); \ - if(res != CURLE_OK) \ - fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \ - #A, #B, #C, res); - -#define my_curl_easy_perform(A) \ - res = curl_easy_perform(A); \ - if(res != CURLE_OK) \ - fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res); - +#define my_curl_easy_setopt(A, B, C) \ + do { \ + res = curl_easy_setopt((A), (B), (C)); \ + if(res != CURLE_OK) \ + fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \ + #A, #B, #C, res); \ + } while(0) + +#define my_curl_easy_perform(A) \ + do { \ + res = curl_easy_perform(A); \ + if(res != CURLE_OK) \ + fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res); \ + } while(0) /* send RTSP OPTIONS request */ static void rtsp_options(CURL *curl, const char *uri) |