Skip to content

Commit dacdf7c

Browse files
committed
Make lint happy.
1 parent d54fc17 commit dacdf7c

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎test/integ/file_upload.cpp‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <curl/curl.h>
2222
#include <sys/stat.h>
2323
#include <cassert>
24+
#include <cstddef>
2425
#include <fstream>
2526
#include <map>
2627
#include <random>
@@ -93,7 +94,7 @@ static bool file_exists(const string &path) {
9394
return (stat(path.c_str(), &sb) == 0);
9495
}
9596

96-
static std::pair<CURLcode, long> send_file_to_webserver(bool add_second_file, bool append_parameters) {
97+
static std::pair<CURLcode, int32_t> send_file_to_webserver(bool add_second_file, bool append_parameters) {
9798
curl_global_init(CURL_GLOBAL_ALL);
9899

99100
CURL *curl = curl_easy_init();
@@ -119,15 +120,15 @@ static std::pair<CURLcode, long> send_file_to_webserver(bool add_second_file, bo
119120
curl_easy_setopt(curl, CURLOPT_MIMEPOST, form);
120121

121122
res = curl_easy_perform(curl);
122-
long http_code = 0;
123+
long http_code = 0; // NOLINT [runtime/int]
123124
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
124125

125126
curl_easy_cleanup(curl);
126127
curl_mime_free(form);
127128
return {res, http_code};
128129
}
129130

130-
static std::pair<CURLcode, long> send_large_file(string* content, std::string args = "") {
131+
static std::pair<CURLcode, int32_t> send_large_file(string* content, std::string args = "") {
131132
// Generate a large (100K) file of random bytes. Upload the file with
132133
// a curl request, then delete the file. The default chunk size of MHD
133134
// appears to be around 16K, so 100K should be enough to trigger the
@@ -158,7 +159,7 @@ static std::pair<CURLcode, long> send_large_file(string* content, std::string ar
158159
curl_easy_setopt(curl, CURLOPT_MIMEPOST, form);
159160

160161
res = curl_easy_perform(curl);
161-
long http_code = 0;
162+
long http_code = 0; // NOLINT [runtime/int]
162163
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
163164

164165
curl_easy_cleanup(curl);
@@ -167,7 +168,7 @@ static std::pair<CURLcode, long> send_large_file(string* content, std::string ar
167168
return {res, http_code};
168169
}
169170

170-
static std::tuple<bool, CURLcode, long> send_file_via_put() {
171+
static std::tuple<bool, CURLcode, int32_t> send_file_via_put() {
171172
curl_global_init(CURL_GLOBAL_ALL);
172173

173174
CURL *curl;
@@ -196,7 +197,7 @@ static std::tuple<bool, CURLcode, long> send_file_via_put() {
196197
curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t) file_info.st_size);
197198

198199
res = curl_easy_perform(curl);
199-
long http_code = 0;
200+
long http_code = 0; // NOLINT [runtime/int]
200201
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
201202

202203
curl_easy_cleanup(curl);

‎test/integ/ws_start_stop.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ LT_END_AUTO_TEST(ssl_with_trust)
501501
void* start_ws_blocking(void* par) {
502502
httpserver::webserver* ws = (httpserver::webserver*) par;
503503
ok_resource ok;
504-
if (!ws->register_resource("base", &ok)) return PTHREAD_CANCELED;;
504+
if (!ws->register_resource("base", &ok)) return PTHREAD_CANCELED;
505505
try { ws->start(true); } catch (...) { return PTHREAD_CANCELED; }
506506

507507
return nullptr;

0 commit comments

Comments
 (0)