mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-29 12:45:22 +01:00
latest changes from main repository; added eclipse cdt project files
This commit is contained in:
parent
e46a2d8ed7
commit
cf20ff1bd7
@ -1,7 +1,7 @@
|
||||
//
|
||||
// BufferAllocator.h
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/include/Poco/BufferAllocator.h#2 $
|
||||
// $Id: //poco/Main/Foundation/include/Poco/BufferAllocator.h#3 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Streams
|
||||
@ -42,6 +42,7 @@
|
||||
|
||||
#include "Poco/Foundation.h"
|
||||
#include <ios>
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@ -57,7 +58,7 @@ public:
|
||||
|
||||
static char_type* allocate(std::streamsize size)
|
||||
{
|
||||
return new char_type[size];
|
||||
return new char_type[static_cast<std::size_t>(size)];
|
||||
}
|
||||
|
||||
static void deallocate(char_type* ptr, std::streamsize size)
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// DeflatingStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/DeflatingStream.cpp#13 $
|
||||
// $Id: //poco/Main/Foundation/src/DeflatingStream.cpp#14 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Streams
|
||||
@ -142,7 +142,7 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
if (_pIstr->good())
|
||||
{
|
||||
_pIstr->read(_buffer, DEFLATE_BUFFER_SIZE);
|
||||
n = _pIstr->gcount();
|
||||
n = static_cast<int>(_pIstr->gcount());
|
||||
}
|
||||
if (n > 0)
|
||||
{
|
||||
@ -157,7 +157,7 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
}
|
||||
}
|
||||
_zstr.next_out = (unsigned char*) buffer;
|
||||
_zstr.avail_out = length;
|
||||
_zstr.avail_out = static_cast<unsigned>(length);
|
||||
for (;;)
|
||||
{
|
||||
int rc = deflate(&_zstr, _eof ? Z_FINISH : Z_NO_FLUSH);
|
||||
@ -166,12 +166,12 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
rc = deflateEnd(&_zstr);
|
||||
if (rc != Z_OK) throw IOException(zError(rc));
|
||||
_pIstr = 0;
|
||||
return length - _zstr.avail_out;
|
||||
return static_cast<int>(length) - _zstr.avail_out;
|
||||
}
|
||||
if (rc != Z_OK) throw IOException(zError(rc));
|
||||
if (_zstr.avail_out == 0)
|
||||
{
|
||||
return length;
|
||||
return static_cast<int>(length);
|
||||
}
|
||||
if (_zstr.avail_in == 0)
|
||||
{
|
||||
@ -179,7 +179,7 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
if (_pIstr->good())
|
||||
{
|
||||
_pIstr->read(_buffer, DEFLATE_BUFFER_SIZE);
|
||||
n = _pIstr->gcount();
|
||||
n = static_cast<int>(_pIstr->gcount());
|
||||
}
|
||||
if (n > 0)
|
||||
{
|
||||
@ -202,7 +202,7 @@ int DeflatingStreamBuf::writeToDevice(const char* buffer, std::streamsize length
|
||||
if (length == 0 || !_pOstr) return 0;
|
||||
|
||||
_zstr.next_in = (unsigned char*) buffer;
|
||||
_zstr.avail_in = length;
|
||||
_zstr.avail_in = static_cast<unsigned>(length);
|
||||
_zstr.next_out = (unsigned char*) _buffer;
|
||||
_zstr.avail_out = DEFLATE_BUFFER_SIZE;
|
||||
for (;;)
|
||||
@ -225,7 +225,7 @@ int DeflatingStreamBuf::writeToDevice(const char* buffer, std::streamsize length
|
||||
break;
|
||||
}
|
||||
}
|
||||
return length;
|
||||
return static_cast<int>(length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// DigestStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/DigestStream.cpp#12 $
|
||||
// $Id: //poco/Main/Foundation/src/DigestStream.cpp#13 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Crypt
|
||||
@ -81,8 +81,8 @@ int DigestBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
{
|
||||
_pIstr->read(buffer, length);
|
||||
std::streamsize n = _pIstr->gcount();
|
||||
if (n > 0) _eng.update(buffer, n);
|
||||
return n;
|
||||
if (n > 0) _eng.update(buffer, static_cast<unsigned>(n));
|
||||
return static_cast<int>(n);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@ -92,7 +92,7 @@ int DigestBuf::writeToDevice(const char* buffer, std::streamsize length)
|
||||
{
|
||||
_eng.update(buffer, (unsigned) length);
|
||||
if (_pOstr) _pOstr->write(buffer, length);
|
||||
return length;
|
||||
return static_cast<int>(length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FileStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/FileStream_WIN32.cpp#7 $
|
||||
// $Id: //poco/Main/Foundation/src/FileStream_WIN32.cpp#8 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Streams
|
||||
@ -112,7 +112,7 @@ int FileStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
sync();
|
||||
|
||||
DWORD bytesRead(0);
|
||||
BOOL rc = ReadFile(_handle, buffer, length, &bytesRead, NULL);
|
||||
BOOL rc = ReadFile(_handle, buffer, static_cast<DWORD>(length), &bytesRead, NULL);
|
||||
if (rc == 0)
|
||||
File::handleLastError(_path);
|
||||
|
||||
@ -138,7 +138,7 @@ int FileStreamBuf::writeToDevice(const char* buffer, std::streamsize length)
|
||||
}
|
||||
|
||||
DWORD bytesWritten(0);
|
||||
BOOL rc = WriteFile(_handle, buffer, length, &bytesWritten, NULL);
|
||||
BOOL rc = WriteFile(_handle, buffer, static_cast<DWORD>(length), &bytesWritten, NULL);
|
||||
if (rc == 0)
|
||||
File::handleLastError(_path);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// InflatingStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/InflatingStream.cpp#15 $
|
||||
// $Id: //poco/Main/Foundation/src/InflatingStream.cpp#16 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Streams
|
||||
@ -122,14 +122,14 @@ int InflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
if (_pIstr->good())
|
||||
{
|
||||
_pIstr->read(_buffer, INFLATE_BUFFER_SIZE);
|
||||
n = _pIstr->gcount();
|
||||
n = static_cast<int>(_pIstr->gcount());
|
||||
}
|
||||
if (n == 0) return 0;
|
||||
_zstr.next_in = (unsigned char*) _buffer;
|
||||
_zstr.avail_in = n;
|
||||
}
|
||||
_zstr.next_out = (unsigned char*) buffer;
|
||||
_zstr.avail_out = length;
|
||||
_zstr.avail_out = static_cast<unsigned>(length);
|
||||
for (;;)
|
||||
{
|
||||
int rc = inflate(&_zstr, Z_NO_FLUSH);
|
||||
@ -146,18 +146,18 @@ int InflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
if (rc == Z_STREAM_END)
|
||||
{
|
||||
_eof = true;
|
||||
return length - _zstr.avail_out;
|
||||
return static_cast<int>(length) - _zstr.avail_out;
|
||||
}
|
||||
if (rc != Z_OK) throw IOException(zError(rc));
|
||||
if (_zstr.avail_out == 0)
|
||||
return length;
|
||||
return static_cast<int>(length);
|
||||
if (_zstr.avail_in == 0)
|
||||
{
|
||||
int n = 0;
|
||||
if (_pIstr->good())
|
||||
{
|
||||
_pIstr->read(_buffer, INFLATE_BUFFER_SIZE);
|
||||
n = _pIstr->gcount();
|
||||
n = static_cast<int>(_pIstr->gcount());
|
||||
}
|
||||
if (n > 0)
|
||||
{
|
||||
@ -174,7 +174,7 @@ int InflatingStreamBuf::writeToDevice(const char* buffer, std::streamsize length
|
||||
if (length == 0 || !_pOstr) return 0;
|
||||
|
||||
_zstr.next_in = (unsigned char*) buffer;
|
||||
_zstr.avail_in = length;
|
||||
_zstr.avail_in = static_cast<unsigned>(length);
|
||||
_zstr.next_out = (unsigned char*) _buffer;
|
||||
_zstr.avail_out = INFLATE_BUFFER_SIZE;
|
||||
for (;;)
|
||||
@ -203,7 +203,7 @@ int InflatingStreamBuf::writeToDevice(const char* buffer, std::streamsize length
|
||||
break;
|
||||
}
|
||||
}
|
||||
return length;
|
||||
return static_cast<int>(length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// RandomStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/RandomStream.cpp#11 $
|
||||
// $Id: //poco/Main/Foundation/src/RandomStream.cpp#12 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Crypt
|
||||
@ -67,9 +67,9 @@ int RandomBuf::readFromDevice(char* buffer, std::streamsize length)
|
||||
#if defined(POCO_OS_FAMILY_WINDOWS)
|
||||
HCRYPTPROV hProvider = 0;
|
||||
CryptAcquireContext(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
|
||||
CryptGenRandom(hProvider, length, (BYTE*) buffer);
|
||||
CryptGenRandom(hProvider, (DWORD) length, (BYTE*) buffer);
|
||||
CryptReleaseContext(hProvider, 0);
|
||||
n = length;
|
||||
n = static_cast<int>(length);
|
||||
#else
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
int fd = open("/dev/urandom", O_RDONLY, 0);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// StreamCopier.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Foundation/src/StreamCopier.cpp#11 $
|
||||
// $Id: //poco/Main/Foundation/src/StreamCopier.cpp#12 $
|
||||
//
|
||||
// Library: Foundation
|
||||
// Package: Streams
|
||||
@ -75,7 +75,7 @@ std::streamsize StreamCopier::copyToString(std::istream& istr, std::string& str,
|
||||
while (n > 0)
|
||||
{
|
||||
len += n;
|
||||
str.append(buffer.begin(), n);
|
||||
str.append(buffer.begin(), static_cast<std::string::size_type>(n));
|
||||
if (istr)
|
||||
{
|
||||
istr.read(buffer.begin(), bufferSize);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPChunkedStream.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/src/HTTPChunkedStream.cpp#13 $
|
||||
// $Id: //poco/Main/Net/src/HTTPChunkedStream.cpp#14 $
|
||||
//
|
||||
// Library: Net
|
||||
// Package: HTTP
|
||||
@ -115,10 +115,10 @@ int HTTPChunkedStreamBuf::writeToDevice(const char* buffer, std::streamsize leng
|
||||
{
|
||||
_chunkBuffer = NumberFormatter::formatHex(length);
|
||||
_chunkBuffer.append("\r\n", 2);
|
||||
_chunkBuffer.append(buffer, length);
|
||||
_chunkBuffer.append(buffer, static_cast<std::string::size_type>(length));
|
||||
_chunkBuffer.append("\r\n", 2);
|
||||
_session.write(_chunkBuffer.data(), static_cast<std::streamsize>(_chunkBuffer.size()));
|
||||
return length;
|
||||
return static_cast<int>(length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPClientSessionTest.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/testsuite/src/HTTPClientSessionTest.cpp#6 $
|
||||
// $Id: //poco/Main/Net/testsuite/src/HTTPClientSessionTest.cpp#7 $
|
||||
//
|
||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -245,7 +245,7 @@ void HTTPClientSessionTest::testKeepAlive()
|
||||
assert (response.getChunkedTransferEncoding());
|
||||
assert (response.getKeepAlive());
|
||||
std::ostringstream ostr3;
|
||||
int n = StreamCopier::copyStream(rs3, ostr3);
|
||||
std::streamsize n = StreamCopier::copyStream(rs3, ostr3);
|
||||
assert (ostr3.str() == HTTPTestServer::LARGE_BODY);
|
||||
|
||||
request.setMethod(HTTPRequest::HTTP_HEAD);
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// HTTPServerTest.cpp
|
||||
//
|
||||
// $Id: //poco/Main/Net/testsuite/src/HTTPServerTest.cpp#13 $
|
||||
// $Id: //poco/Main/Net/testsuite/src/HTTPServerTest.cpp#14 $
|
||||
//
|
||||
// Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
|
||||
// and Contributors.
|
||||
@ -78,7 +78,7 @@ namespace
|
||||
|
||||
std::istream& istr = request.stream();
|
||||
std::ostream& ostr = response.send();
|
||||
int n = StreamCopier::copyStream(istr, ostr);
|
||||
std::streamsize n = StreamCopier::copyStream(istr, ostr);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// ParserEngine.cpp
|
||||
//
|
||||
// $Id: //poco/Main/XML/src/ParserEngine.cpp#13 $
|
||||
// $Id: //poco/Main/XML/src/ParserEngine.cpp#14 $
|
||||
//
|
||||
// Library: XML
|
||||
// Package: XML
|
||||
@ -252,7 +252,7 @@ void ParserEngine::parse(InputSource* pInputSource)
|
||||
void ParserEngine::parseByteInputStream(XMLByteInputStream& istr)
|
||||
{
|
||||
istr.read(_pBuffer, PARSE_BUFFER_SIZE);
|
||||
int n = istr.gcount();
|
||||
int n = static_cast<int>(istr.gcount());
|
||||
while (n > 0)
|
||||
{
|
||||
if (!XML_Parse(_parser, _pBuffer, n, 0))
|
||||
@ -260,7 +260,7 @@ void ParserEngine::parseByteInputStream(XMLByteInputStream& istr)
|
||||
if (istr.good())
|
||||
{
|
||||
istr.read(_pBuffer, PARSE_BUFFER_SIZE);
|
||||
n = istr.gcount();
|
||||
n = static_cast<int>(istr.gcount());
|
||||
}
|
||||
else n = 0;
|
||||
}
|
||||
@ -272,7 +272,7 @@ void ParserEngine::parseByteInputStream(XMLByteInputStream& istr)
|
||||
void ParserEngine::parseCharInputStream(XMLCharInputStream& istr)
|
||||
{
|
||||
istr.read(reinterpret_cast<XMLChar*>(_pBuffer), PARSE_BUFFER_SIZE/sizeof(XMLChar));
|
||||
int n = istr.gcount();
|
||||
int n = static_cast<int>(istr.gcount());
|
||||
while (n > 0)
|
||||
{
|
||||
if (!XML_Parse(_parser, _pBuffer, n*sizeof(XMLChar), 0))
|
||||
@ -280,7 +280,7 @@ void ParserEngine::parseCharInputStream(XMLCharInputStream& istr)
|
||||
if (istr.good())
|
||||
{
|
||||
istr.read(reinterpret_cast<XMLChar*>(_pBuffer), PARSE_BUFFER_SIZE/sizeof(XMLChar));
|
||||
n = istr.gcount();
|
||||
n = static_cast<int>(istr.gcount());
|
||||
}
|
||||
else n = 0;
|
||||
}
|
||||
@ -307,7 +307,7 @@ void ParserEngine::parseExternalByteInputStream(XML_Parser extParser, XMLByteInp
|
||||
try
|
||||
{
|
||||
istr.read(pBuffer, PARSE_BUFFER_SIZE);
|
||||
int n = istr.gcount();
|
||||
int n = static_cast<int>(istr.gcount());
|
||||
while (n > 0)
|
||||
{
|
||||
if (!XML_Parse(extParser, pBuffer, n, 0))
|
||||
@ -315,7 +315,7 @@ void ParserEngine::parseExternalByteInputStream(XML_Parser extParser, XMLByteInp
|
||||
if (istr.good())
|
||||
{
|
||||
istr.read(pBuffer, PARSE_BUFFER_SIZE);
|
||||
n = istr.gcount();
|
||||
n = static_cast<int>(istr.gcount());
|
||||
}
|
||||
else n = 0;
|
||||
}
|
||||
@ -337,7 +337,7 @@ void ParserEngine::parseExternalCharInputStream(XML_Parser extParser, XMLCharInp
|
||||
try
|
||||
{
|
||||
istr.read(pBuffer, PARSE_BUFFER_SIZE/sizeof(XMLChar));
|
||||
int n = istr.gcount();
|
||||
int n = static_cast<int>(istr.gcount());
|
||||
while (n > 0)
|
||||
{
|
||||
if (!XML_Parse(extParser, reinterpret_cast<char*>(pBuffer), n*sizeof(XMLChar), 0))
|
||||
@ -345,7 +345,7 @@ void ParserEngine::parseExternalCharInputStream(XML_Parser extParser, XMLCharInp
|
||||
if (istr.good())
|
||||
{
|
||||
istr.read(pBuffer, PARSE_BUFFER_SIZE/sizeof(XMLChar));
|
||||
n = istr.gcount();
|
||||
n = static_cast<int>(istr.gcount());
|
||||
}
|
||||
else n = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user