style fixes

This commit is contained in:
Günter Obiltschnig 2018-03-05 15:05:04 +01:00
parent 181fc0eea3
commit 7eb1325bba
16 changed files with 48 additions and 46 deletions

View File

@ -38,7 +38,7 @@ enum JSONOptions
/// unicode characters will be escaped in the resulting
/// string.
JSON_WRAP_STRINGS = 4
JSON_WRAP_STRINGS = 4
/// If specified, the object will preserve the items
/// insertion order. Otherwise, items will be sorted
/// by keys.

View File

@ -70,8 +70,7 @@ namespace Poco {
void toJSON(const std::string& value, std::ostream& out, bool wrap)
{
int options = (wrap ? Poco::JSON_WRAP_STRINGS : 0);
writeString<std::ostream,
std::streamsize>(value, out, &std::ostream::write, options);
writeString<std::ostream, std::streamsize>(value, out, &std::ostream::write, options);
}
@ -94,8 +93,7 @@ void toJSON(const std::string& value, std::ostream& out, int options)
std::string toJSON(const std::string& value, int options)
{
std::string ret;
writeString<std::string,
std::string::size_type>(value, ret, &std::string::append, options);
writeString<std::string, std::string::size_type>(value, ret, &std::string::append, options);
return ret;
}

View File

@ -624,6 +624,7 @@ std::string Path::config()
#endif
}
std::string Path::null()
{
return PathImpl::nullImpl();

View File

@ -165,6 +165,7 @@ std::string PathImpl::configImpl()
return result;
}
std::string PathImpl::nullImpl()
{
return "NUL:";

View File

@ -176,6 +176,7 @@ std::string PathImpl::configImpl()
return result;
}
std::string PathImpl::nullImpl()
{
return "NUL:";

View File

@ -203,10 +203,10 @@ void ClassLoaderTest::tearDown()
CppUnit::Test* ClassLoaderTest::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("ClassLoaderTest");
#ifndef POCO_NO_SHAREDMEMORY
CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader1);
CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader2);
CppUnit_addTest(pSuite, ClassLoaderTest, testClassLoader3);
#endif
return pSuite;
}

View File

@ -66,7 +66,8 @@ void NamedEventTest::testNamedEvent()
thr1.start(te);
Timestamp now;
Thread::sleep(2000);
try {
try
{
testEvent.set();
}
catch(Poco::NotImplementedException e)
@ -83,7 +84,8 @@ void NamedEventTest::testNamedEvent()
thr2.start(te);
now.update();
Thread::sleep(2000);
try {
try
{
testEvent.set();
}
catch(Poco::NotImplementedException e)

View File

@ -87,7 +87,8 @@ NamedMutexTest::~NamedMutexTest()
void NamedMutexTest::testLock()
{
try {
try
{
testMutex.lock();
Thread thr;
TestLock tl;
@ -116,7 +117,8 @@ void NamedMutexTest::testTryLock()
#if POCO_OS != POCO_OS_ANDROID
assert (ttl1.locked());
#endif
try {
try
{
testMutex.lock();
Thread thr2;
TestTryLock ttl2;

View File

@ -140,10 +140,10 @@ void SharedLibraryTest::tearDown()
CppUnit::Test* SharedLibraryTest::suite()
{
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("SharedLibraryTest");
#ifndef POCO_NO_SHAREDMEMORY
CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary1);
CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary2);
CppUnit_addTest(pSuite, SharedLibraryTest, testSharedLibrary3);
#endif
return pSuite;
}

View File

@ -160,12 +160,6 @@ inline std::size_t Parser::getDepth() const
return getDepthImpl();
}
/*
inline void Parser::setHandler(const Handler::Ptr& pHandler)
{
setHandlerImpl(pHandler);
}
*/
inline const Handler::Ptr& Parser::getHandler()
{

View File

@ -26,7 +26,7 @@
#include "Poco/UTF8Encoding.h"
#include "Poco/Dynamic/Var.h"
#include <string>
//#include "pdjson.h"
struct json_stream;

View File

@ -24,7 +24,6 @@ namespace Poco {
namespace JSON {
Object::Object(int options):
_preserveInsOrder((options & Poco::JSON_PRESERVE_KEY_ORDER) != 0),
_escapeUnicode((options & Poco::JSON_ESCAPE_UNICODE) != 0),

View File

@ -26,7 +26,10 @@
#include <istream>
#include "pdjson.h"
typedef struct json_stream json_stream;
namespace Poco {
namespace JSON {

View File

@ -37,7 +37,7 @@ class Net_API ICMPv4PacketImpl : public ICMPPacketImpl
{
public:
// ICMPv4 header
struct Header
struct Header
{
Poco::UInt8 type; // ICMP packet type
Poco::UInt8 code; // Type sub code
@ -47,7 +47,7 @@ public:
};
// compile-time shield against misalignment
#ifndef POCO_OS == POCO_OS_ANDROID
#if POCO_OS != POCO_OS_ANDROID
poco_static_assert (offsetof(Header, code) == 0x01);
poco_static_assert (offsetof(Header, checksum) == 0x02);
poco_static_assert (offsetof(Header, id) == 0x04);
@ -126,20 +126,20 @@ public:
struct timeval time(Poco::UInt8* buffer = 0, int length = 0) const;
/// Returns current epoch time if either buffer or length are equal to zero.
/// Otherwise, it extracts the time value from the supplied buffer.
///
///
/// Buffer includes IP header, ICMP header and data.
bool validReplyID(Poco::UInt8* buffer, int length) const;
/// Returns true if the extracted id is recognized
/// Returns true if the extracted id is recognized
/// (i.e. equals the process id).
///
///
/// Buffer includes IP header, ICMP header and data.
virtual std::string errorDescription(Poco::UInt8* buffer, int length);
/// Returns error description string.
/// If supplied buffer contains ICMPv4 echo reply packet, an
/// empty string is returned indicating the absence of error.
///
///
/// Buffer includes IP header, ICMP header and data.
virtual std::string typeDescription(int typeId);

View File

@ -47,7 +47,8 @@ MulticastSocketTest::~MulticastSocketTest()
void MulticastSocketTest::testMulticast()
{
try {
try
{
MulticastEchoServer echoServer;
MulticastSocket ms(SocketAddress::IPv4);
int n = ms.sendTo("hello", 5, echoServer.group());
@ -58,10 +59,10 @@ void MulticastSocketTest::testMulticast()
assert (std::string(buffer, n) == "hello");
ms.close();
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}

View File

@ -75,10 +75,10 @@ void NetworkInterfaceTest::testMap()
std::cout << "=============" << std::endl << std::endl;
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -119,10 +119,10 @@ void NetworkInterfaceTest::testList()
std::cout << "==============" << std::endl << std::endl;
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -139,10 +139,10 @@ void NetworkInterfaceTest::testForName()
assert (ifc.name() == it->second.name());
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -184,10 +184,10 @@ void NetworkInterfaceTest::testForAddress()
}
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -204,10 +204,10 @@ void NetworkInterfaceTest::testForIndex()
assert (ifc.index() == it->second.index());
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -231,10 +231,10 @@ void NetworkInterfaceTest::testMapIpOnly()
std::cout << "MAC Address:" << mac << std::endl;
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -251,10 +251,10 @@ void NetworkInterfaceTest::testMapUpOnly()
assert(it->second.isUp());
}
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}
@ -298,10 +298,10 @@ void NetworkInterfaceTest::testListMapConformance()
assert (counter == l.size());
}
catch(Poco::NotImplementedException e)
catch (Poco::NotImplementedException e)
{
#if POCO_OS != POCO_OS_ANDROID
throw e;
throw;
#endif
}
}