mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-30 07:55:51 +00:00
Fix VS2013 warnings about integer conversions
This commit is contained in:
@@ -598,7 +598,7 @@ public:
|
||||
|
||||
void print (HTTPMessage const& m)
|
||||
{
|
||||
for (std::size_t i = 0; i < m.headers().size(); ++i)
|
||||
for (int i = 0; i < m.headers().size(); ++i)
|
||||
{
|
||||
HTTPField const f (m.headers()[i]);
|
||||
std::stringstream ss;
|
||||
|
||||
@@ -54,13 +54,13 @@ std::size_t HTTPHeaders::size () const
|
||||
return m_fields.size ();
|
||||
}
|
||||
|
||||
HTTPField HTTPHeaders::at (std::size_t index) const
|
||||
HTTPField HTTPHeaders::at (int index) const
|
||||
{
|
||||
return HTTPField (m_fields.getAllKeys () [index],
|
||||
m_fields.getAllValues () [index]);
|
||||
}
|
||||
|
||||
HTTPField HTTPHeaders::operator[] (std::size_t index) const
|
||||
HTTPField HTTPHeaders::operator[] (int index) const
|
||||
{
|
||||
return at (index);
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public:
|
||||
|
||||
/** Random access to fields by index. */
|
||||
/** @{ */
|
||||
HTTPField at (std::size_t index) const;
|
||||
HTTPField operator[] (std::size_t index) const;
|
||||
HTTPField at (int index) const;
|
||||
HTTPField operator[] (int index) const;
|
||||
/** @} */
|
||||
|
||||
/** Associative access to fields by name.
|
||||
|
||||
@@ -85,9 +85,9 @@ public:
|
||||
if (numAllocated != numElements)
|
||||
{
|
||||
if (numElements > 0)
|
||||
elements.realloc ((size_t) numElements);
|
||||
elements.reallocate ((size_t) numElements);
|
||||
else
|
||||
elements.free();
|
||||
elements.free_up();
|
||||
|
||||
numAllocated = numElements;
|
||||
}
|
||||
|
||||
@@ -125,14 +125,14 @@ void MemoryBlock::setSize (const size_t newSize, const bool initialiseToZero)
|
||||
{
|
||||
if (newSize <= 0)
|
||||
{
|
||||
data.free();
|
||||
data.free_up();
|
||||
size = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (data != nullptr)
|
||||
{
|
||||
data.realloc (newSize);
|
||||
data.reallocate (newSize);
|
||||
|
||||
if (initialiseToZero && (newSize > size))
|
||||
zeromem (data + size, newSize - size);
|
||||
|
||||
@@ -76,9 +76,9 @@ public:
|
||||
rowid id,
|
||||
bool readAndWrite = false) noexcept;
|
||||
|
||||
std::size_t get_len();
|
||||
Error read(std::size_t offset, void* buf, std::size_t toRead);
|
||||
Error write(std::size_t offset, void const* buf, std::size_t toWrite);
|
||||
int get_len();
|
||||
Error read(int offset, void* buf, int toRead);
|
||||
Error write(int offset, void const* buf, int toWrite);
|
||||
void close();
|
||||
|
||||
private:
|
||||
|
||||
@@ -91,18 +91,18 @@ Error blob::select(session& s,
|
||||
return detail::sqliteError(__FILE__, __LINE__, result);
|
||||
}
|
||||
|
||||
std::size_t blob::get_len()
|
||||
int blob::get_len()
|
||||
{
|
||||
return sqlite3_blob_bytes(m_blob);
|
||||
}
|
||||
|
||||
Error blob::read(std::size_t offset, void* buf, std::size_t toRead)
|
||||
Error blob::read(int offset, void* buf, int toRead)
|
||||
{
|
||||
return detail::sqliteError(__FILE__, __LINE__,
|
||||
sqlite3_blob_read(m_blob, static_cast<char*>(buf), toRead, offset));
|
||||
}
|
||||
|
||||
Error blob::write(std::size_t offset, void const* buf, std::size_t toWrite)
|
||||
Error blob::write(int offset, void const* buf, int toWrite)
|
||||
{
|
||||
return detail::sqliteError(__FILE__, __LINE__,
|
||||
sqlite3_blob_write(m_blob, buf, toWrite, offset));
|
||||
|
||||
@@ -177,7 +177,7 @@ void standard_use_type::do_use()
|
||||
result = sqlite3_bind_text(m_st->m_stmt,
|
||||
m_iParam,
|
||||
s.c_str(),
|
||||
s.size() * sizeof(s[0]),
|
||||
int(s.size() * sizeof(s[0])),
|
||||
SQLITE_STATIC);
|
||||
}
|
||||
break;
|
||||
@@ -188,7 +188,7 @@ void standard_use_type::do_use()
|
||||
result = sqlite3_bind_text16(m_st->m_stmt,
|
||||
m_iParam,
|
||||
s.c_str(),
|
||||
s.size() * sizeof(s[0]),
|
||||
int(s.size() * sizeof(s[0])),
|
||||
SQLITE_STATIC);
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user