This commit is contained in:
Matt Koscumb 2018-09-06 14:08:44 -07:00
Родитель 6b0d55ae7a
Коммит 0dc15480e0
14 изменённых файлов: 27 добавлений и 22 удалений

Просмотреть файл

@ -91,7 +91,7 @@ namespace ARIASDK_NS_BEGIN
uint32_t filterRate = filterRates[i];
if (nullptr != filterString)
{
assert(filterRates[i] >= 0 && filterRates[i] <= 100);
assert(filterRates[i] <= 100);
_filterRules[std::string(filterString)] = filterRate;
}
}

Просмотреть файл

@ -102,11 +102,11 @@ namespace ARIASDK_NS_BEGIN
public:
// String constant to use for sending a CV through EventProperties.SetProperty API.
ARIASDK_LIBABI static constexpr const char* PropertyName = "__TlgCV__";
static constexpr const char* PropertyName = "__TlgCV__";
// String constant to use when sending a CV through any transport other than
// this telemetry API, e.g. as a name for an HTTP header.
ARIASDK_LIBABI static constexpr const char* HeaderName = "MS-CV";
static constexpr const char* HeaderName = "MS-CV";
private:

Просмотреть файл

@ -209,11 +209,6 @@ SAVE_FAILED:
// nullptr-terminate the buffer (empty buffer)
buffer[0]=0;
goto LOAD_OK;
} else
if (readSize < 0)
{
LOG_ERROR("load offline data failed: pos=%d, left=%d", bufferPosition, bytesToRead);
goto LOAD_FAILED;
}
bytesToRead -= readSize;
@ -223,11 +218,6 @@ SAVE_FAILED:
LOAD_OK:
m_FileStatus = oldStatus;
return RES_SUCC;
LOAD_FAILED:
m_FileStatus = oldStatus;
return RES_ERROR;
}
int FIFOFileStorage::ReadFileHeader()
@ -264,7 +254,7 @@ LOAD_FAILED:
//size_t checkCount = 0;
PhysicalBlockInfo block = {};
AssertAbort(m_FileHeader.physicalBlockCount >= 0 && m_FileHeader.fileSize > 0);
AssertAbort(m_FileHeader.fileSize > 0);
fileOffset += sizeof(struct FileHeader);
@ -438,7 +428,6 @@ LOAD_FAILED:
if (blockId == -1)
{
AssertAbort(m_LogicalBlocks.size() >= 0);
if (m_LogicalBlocks.size() > 0)
{
//if there is no block exist, release one oldest block

Просмотреть файл

@ -113,7 +113,7 @@ namespace ARIASDK_NS_BEGIN {
}
else
{
return idResult < 0;
return false;
}
}
else

Просмотреть файл

@ -179,7 +179,7 @@ namespace ARIASDK_NS_BEGIN {
/// <returns></returns>
unsigned MemoryStorage::LastReadRecordCount()
{
return m_lastReadCount.load();
return static_cast<unsigned>(m_lastReadCount.load());
}
/// <summary>

Просмотреть файл

@ -653,6 +653,8 @@ namespace ARIASDK_NS_BEGIN {
}
// *INDENT-OFF* Uncrustify insists on adding a namespace closing comment after the closing curly brace
#pragma warning(push)
#pragma warning(disable:4296) // expression always false.
#define PREPARE_SQL(var_, stmt_) \
if ((var_ = m_db->prepare(stmt_)) < 0) { return false; }
// *INDENT-ON*
@ -729,6 +731,7 @@ namespace ARIASDK_NS_BEGIN {
"SELECT value FROM " TABLE_NAME_SETTINGS " WHERE name=?");
#undef PREPARE_SQL
#pragma warning(pop)
m_currentlyAddedBytes = 0;
m_isInTransaction = false;

Просмотреть файл

@ -486,7 +486,7 @@ namespace ARIASDK_NS_BEGIN {
SqliteStatement(SqliteDB& db, size_t stmtId)
: m_db(db),
m_stmtId(stmtId),
m_stmt((stmtId >= 0) ? db.statement(stmtId) : nullptr),
m_stmt(db.statement(stmtId)),
m_changes(0),
m_duration(0),
m_ownStmt(false),
@ -499,7 +499,7 @@ namespace ARIASDK_NS_BEGIN {
SqliteStatement(SqliteDB& db, char const* statement)
: m_db(db),
m_stmtId(db.prepare(statement)),
m_stmt((m_stmtId >= 0) ? db.statement(m_stmtId) : nullptr),
m_stmt(db.statement(m_stmtId)),
m_changes(0),
m_duration(0),
m_ownStmt(true),
@ -511,7 +511,7 @@ namespace ARIASDK_NS_BEGIN {
~SqliteStatement()
{
if (m_ownStmt && m_stmtId >= 0) {
if (m_ownStmt) {
m_db.release(m_stmtId);
}
}

Просмотреть файл

@ -1,5 +1,7 @@
#define LOG_MODULE DBG_API
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif
#include "pal/PAL.hpp"
#include "pal/DeviceInformationImpl.hpp"
#include "WindowsEnvironmentInfo.h"

Просмотреть файл

@ -300,6 +300,8 @@ namespace tld
It is ok to create an array of nested structures where fields in the
structure have TypeNone or TypeBinary.
*/
#pragma warning(push)
#pragma warning(disable:4471) //a forward declaration of an unscoped enumeration must have an underlying type. Not fixing Windows code.
enum Type;
/*
@ -345,6 +347,7 @@ namespace tld
The type of a provider trait. Used when building up provider metadata.
*/
enum ProviderTraitType;
#pragma warning(pop)
/*
class ProviderMetadataBuilder (low-level API):

Просмотреть файл

@ -567,7 +567,7 @@ namespace testing {
continue;
}
assert(dwResult >= WSA_WAIT_EVENT_0 && dwResult <= WSA_WAIT_EVENT_0 + m_events.size());
assert(dwResult <= WSA_WAIT_EVENT_0 + m_events.size());
int index = dwResult - WSA_WAIT_EVENT_0;
Socket socket = m_sockets[index].socket;
int flags = m_sockets[index].flags;

Просмотреть файл

@ -1,4 +1,6 @@
#define _CRT_SECURE_NO_WARNINGS
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#pragma warning (disable : 4389)
//#include "gtest/gtest.h"

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif
#include "Common/Common.hpp"
#include "common/HttpServer.hpp"
#include <api/LogManagerImpl.hpp>

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif
#include "common/Common.hpp"
#if ARIASDK_PAL_SKYPE
#include "http/HttpClient_HttpStack.hpp"

Просмотреть файл

@ -1,5 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#endif
#include "common/Common.hpp"
#include "common/HttpServer.hpp"