Skip to content

Commit 1b92ef2

Browse files
committed
fix warnings
1 parent 1967d88 commit 1b92ef2

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

sdk/src/external/json/jsoncpp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ static inline void fixNumericLocaleInput(char* begin, char* end) {
264264
#pragma warning(disable : 4996)
265265
#endif
266266

267+
#if defined(__GNUG__) && __GNUC__ > 8
268+
#pragma GCC diagnostic ignored "-Wstringop-overflow"
269+
#endif
270+
267271
// Define JSONCPP_DEPRECATED_STACK_LIMIT as an appropriate integer at compile time to change the stack limit
268272
#if !defined(JSONCPP_DEPRECATED_STACK_LIMIT)
269273
#define JSONCPP_DEPRECATED_STACK_LIMIT 1000

sdk/src/model/SelectObjectRequest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ SelectObjectRequest::SelectObjectRequest(const std::string& bucket, const std::s
224224
void SelectObjectRequest::setResponseStreamFactory(const IOStreamFactory& factory)
225225
{
226226
upperResponseStreamFactory_ = factory;
227-
ServiceRequest::setResponseStreamFactory([=]() {
227+
ServiceRequest::setResponseStreamFactory([this]() {
228228
streamBuffer_ = nullptr;
229229
auto content = upperResponseStreamFactory_();
230230
if (!outputFormat_->OutputRawData()) {

sdk/src/model/UploadPartCopyResult.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
using namespace AlibabaCloud::OSS;
2323
using namespace tinyxml2;
2424

25-
static const std::string EMPTY;
26-
2725
UploadPartCopyResult::UploadPartCopyResult() :
2826
OssObjectResult()
2927
{

sdk/src/resumable/ResumableDownloader.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GetObjectOutcome ResumableDownloader::Download()
7575
uint64_t end = start + part.size - 1;
7676
auto getObjectReq = GetObjectRequest(request_.Bucket(), request_.Key(), request_.ModifiedSinceConstraint(), request_.UnmodifiedSinceConstraint(),
7777
request_.MatchingETagsConstraint(), request_.NonmatchingETagsConstraint(), request_.ResponseHeaderParameters());
78-
getObjectReq.setResponseStreamFactory([=]() {
78+
getObjectReq.setResponseStreamFactory([this, pos]() {
7979
auto tmpFstream = GetFstreamByPath(request_.TempFilePath(), request_.TempFilePathW(),
8080
std::ios_base::in | std::ios_base::out | std::ios_base::binary);
8181
tmpFstream->seekp(pos, tmpFstream->beg);
@@ -151,7 +151,7 @@ GetObjectOutcome ResumableDownloader::Download()
151151
root["rangeEnd"] = record.rangeEnd;
152152
}
153153

154-
auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);
154+
auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);
155155
if (recordStream->is_open()) {
156156
*recordStream << root;
157157
recordStream->close();
@@ -275,7 +275,7 @@ int ResumableDownloader::prepare(OssError& err)
275275
root["rangeEnd"] = record_.rangeEnd;
276276
}
277277

278-
auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);
278+
auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);
279279
if (recordStream->is_open()) {
280280
*recordStream << root;
281281
recordStream->close();
@@ -332,7 +332,7 @@ int ResumableDownloader::validateRecord()
332332

333333
int ResumableDownloader::loadRecord()
334334
{
335-
auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::in);
335+
auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::in);
336336
if (recordStream->is_open()) {
337337
Json::Value root;
338338
Json::CharReaderBuilder rbuilder;
@@ -493,8 +493,8 @@ void ResumableDownloader::DownloadPartProcessCallback(size_t increment, int64_t
493493
}
494494
}
495495

496-
bool ResumableDownloader::renameTempFile()
497-
{
496+
bool ResumableDownloader::renameTempFile()
497+
{
498498
#ifdef _WIN32
499499
if (!request_.TempFilePathW().empty()) {
500500
return RenameFile(request_.TempFilePathW(), request_.FilePathW());
@@ -503,9 +503,9 @@ bool ResumableDownloader::renameTempFile()
503503
#endif
504504
{
505505
return RenameFile(request_.TempFilePath(), request_.FilePath());
506-
}
506+
}
507507
}
508-
508+
509509
GetObjectOutcome ResumableDownloader::GetObjectWrap(const GetObjectRequest &request) const
510510
{
511511
return client_->GetObject(request);

0 commit comments

Comments
 (0)