From 8a4a2955d5813ca3cffec73c365f660b267d4dcb Mon Sep 17 00:00:00 2001 From: Matej Kenda Date: Thu, 30 Oct 2025 15:20:53 +0100 Subject: [PATCH] Use nullptr in C++ code (solves #4348) (#5043) * chore(CppParser): 0, NULL --> nullptr * chore(Crypto): 0, NULL --> nullptr * chore(DNSSD): 0, NULL --> nullptr * chore(Encodings): 0, NULL --> nullptr * chore(CppUnit): Correct indentation. * chore(Foundation): 0, NULL --> nullptr * chore(CMake): Always warn about wrong nullptr usage when compiling with GCC or CLang * chore(Net): 0, NULL --> nullptr * chore(Foundation): 0, NULL --> nullptr * chore(Data): 0, NULL --> nullptr * chore(macOS): 0, NULL --> nullptr * chore(XML): 0, NULL --> nullptr * chore(Zip): 0, NULL --> nullptr * chore(Util): 0, NULL --> nullptr * chore(Net/NetSSL): 0, NULL --> nullptr * chore(Bonjour): 0, NULL --> nullptr * chore(MongoDB, Redis): 0, NULL --> nullptr * chore(Poco): 0, NULL --> nullptr * chore(Win32): 0, NULL --> nullptr * chore(CMake): Only warn about nullptr when verbose warnings are enabled. * Potential fix for code scanning alert no. 1634: Guarded Free Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * chore(Net): Fix warning reported by gitlab. * chore(gitlab CI): attempt to clean to gain disk space on the runner. * chore(gitlab CI): Run build with --parallel 4, correct docker cleanup. --------- Co-authored-by: Aleksandar Fabijanic Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 49 +- ApacheConnector/src/ApacheConnector.cpp | 54 +- ApacheConnector/src/ApacheServerRequest.cpp | 4 +- CppParser/include/Poco/CppParser/NameSpace.h | 2 +- CppParser/include/Poco/CppParser/Symbol.h | 2 +- CppParser/src/CppToken.cpp | 10 +- CppParser/src/Function.cpp | 4 +- CppParser/src/NameSpace.cpp | 4 +- CppParser/src/Parameter.cpp | 2 +- CppParser/src/Parser.cpp | 30 +- CppParser/src/Struct.cpp | 6 +- CppParser/src/Symbol.cpp | 2 +- CppUnit/include/CppUnit/CppUnitException.h | 46 +- CppUnit/include/CppUnit/Orthodox.h | 38 +- CppUnit/include/CppUnit/TestCase.h | 78 +- CppUnit/src/TestRunner.cpp | 4 +- CppUnit/src/TextTestResult.cpp | 46 +- Crypto/include/Poco/Crypto/CipherKeyImpl.h | 2 +- Crypto/include/Poco/Crypto/Crypto.h | 2 +- Crypto/include/Poco/Crypto/ECKey.h | 2 +- Crypto/include/Poco/Crypto/ECKeyImpl.h | 2 +- Crypto/include/Poco/Crypto/EVPPKey.h | 20 +- Crypto/include/Poco/Crypto/KeyPair.h | 4 +- Crypto/include/Poco/Crypto/KeyPairImpl.h | 2 +- Crypto/include/Poco/Crypto/PKCS12Container.h | 4 +- Crypto/include/Poco/Crypto/RSAKeyImpl.h | 4 +- Crypto/src/CipherFactory.cpp | 4 +- Crypto/src/CipherImpl.cpp | 8 +- Crypto/src/CipherKeyImpl.cpp | 16 +- Crypto/src/CryptoStream.cpp | 8 +- Crypto/src/DigestEngine.cpp | 4 +- Crypto/src/ECDSADigestEngine.cpp | 14 +- Crypto/src/ECKeyImpl.cpp | 12 +- Crypto/src/EVPCipherImpl.cpp | 22 +- Crypto/src/EVPPKey.cpp | 51 +- Crypto/src/Envelope.cpp | 6 +- Crypto/src/OpenSSLInitializer.cpp | 12 +- Crypto/src/PKCS12Container.cpp | 13 +- Crypto/src/RSACipherImpl.cpp | 10 +- Crypto/src/RSADigestEngine.cpp | 2 +- Crypto/src/RSAKeyImpl.cpp | 89 +- Crypto/src/X509Certificate.cpp | 25 +- Crypto/testsuite/src/EVPTest.cpp | 38 +- Crypto/testsuite/src/RSATest.cpp | 22 +- .../Poco/DNSSD/Avahi/AvahiBrowserImpl.h | 2 +- DNSSD/Avahi/src/AvahiBrowserImpl.cpp | 25 +- DNSSD/Avahi/src/AvahiResponderImpl.cpp | 20 +- .../Poco/DNSSD/Bonjour/BonjourBrowserImpl.h | 2 +- DNSSD/Bonjour/src/BonjourBrowserImpl.cpp | 56 +- DNSSD/Bonjour/src/BonjourResponderImpl.cpp | 164 +- .../HTTPTimeServer/src/HTTPTimeServer.cpp | 2 +- DNSSD/src/DNSSDResponder.cpp | 6 +- DNSSD/src/Record.cpp | 2 +- .../include/Poco/Data/MySQL/SessionHandle.h | 2 +- Data/MySQL/src/Binder.cpp | 8 +- Data/MySQL/src/Connector.cpp | 2 +- Data/MySQL/src/Extractor.cpp | 2 +- Data/MySQL/src/MySQLException.cpp | 2 +- Data/MySQL/src/SessionHandle.cpp | 8 +- Data/MySQL/src/SessionImpl.cpp | 4 +- Data/MySQL/src/StatementExecutor.cpp | 2 +- Data/MySQL/testsuite/src/MySQLTest.cpp | 6 +- Data/MySQL/testsuite/src/SQLExecutor.cpp | 12 +- Data/ODBC/include/Poco/Data/ODBC/Binder.h | 48 +- Data/ODBC/include/Poco/Data/ODBC/Handle.h | 2 +- Data/ODBC/include/Poco/Data/ODBC/Parameter.h | 6 +- Data/ODBC/include/Poco/Data/ODBC/Preparator.h | 2 +- Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h | 2 +- Data/ODBC/src/Binder.cpp | 10 +- Data/ODBC/src/Extractor.cpp | 2 +- Data/ODBC/src/ODBCMetaColumn.cpp | 8 +- Data/ODBC/src/ODBCStatementImpl.cpp | 8 +- Data/ODBC/src/SessionImpl.cpp | 18 +- Data/ODBC/testsuite/src/ODBCAccessTest.cpp | 4 +- Data/ODBC/testsuite/src/ODBCDB2Test.cpp | 2 +- Data/ODBC/testsuite/src/ODBCMySQLTest.cpp | 2 +- Data/ODBC/testsuite/src/ODBCOracleTest.cpp | 2 +- .../ODBC/testsuite/src/ODBCPostgreSQLTest.cpp | 2 +- Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp | 2 +- Data/ODBC/testsuite/src/ODBCSQLiteTest.cpp | 2 +- Data/ODBC/testsuite/src/ODBCTest.cpp | 4 +- Data/ODBC/testsuite/src/SQLExecutor.cpp | 16 +- .../Poco/Data/PostgreSQL/BinaryExtractor.h | 2 +- .../include/Poco/Data/PostgreSQL/Extractor.h | 2 +- .../Poco/Data/PostgreSQL/PostgreSQLTypes.h | 72 +- Data/PostgreSQL/src/Binder.cpp | 2 +- Data/PostgreSQL/src/PostgreSQLException.cpp | 6 +- Data/PostgreSQL/src/SessionHandle.cpp | 14 +- Data/PostgreSQL/src/StatementExecutor.cpp | 28 +- .../testsuite/src/PostgreSQLTest.cpp | 6 +- Data/PostgreSQL/testsuite/src/SQLExecutor.cpp | 28 +- Data/SQLParser/benchmark/benchmark.cpp | 18 +- Data/SQLParser/benchmark/benchmark_utils.cpp | 20 +- Data/SQLParser/benchmark/benchmark_utils.h | 4 +- Data/SQLParser/benchmark/parser_benchmark.cpp | 42 +- Data/SQLParser/benchmark/queries.cpp | 22 +- Data/SQLParser/src/SQLParser.cpp | 20 +- Data/SQLParser/src/SQLParserResult.cpp | 28 +- Data/SQLParser/src/parser/bison_parser.cpp | 4318 +++++++------- Data/SQLParser/src/parser/bison_parser.h | 376 +- Data/SQLParser/src/parser/flex_lexer.cpp | 5238 ++++++++--------- Data/SQLParser/src/parser/flex_lexer.h | 16 +- Data/SQLParser/src/sql/CreateStatement.cpp | 66 +- Data/SQLParser/src/sql/CreateStatement.h | 14 +- Data/SQLParser/src/sql/Expr.cpp | 72 +- Data/SQLParser/src/sql/Expr.h | 8 +- Data/SQLParser/src/sql/SQLStatement.cpp | 6 +- Data/SQLParser/src/sql/statements.cpp | 288 +- Data/SQLParser/src/util/sqlhelper.cpp | 582 +- Data/SQLParser/test/auto_query_file_test.cpp | 78 +- Data/SQLParser/test/prepare_tests.cpp | 2 +- Data/SQLParser/test/select_tests.cpp | 328 +- Data/SQLParser/test/sql_parser.cpp | 4 +- Data/SQLParser/test/sql_tests.cpp | 158 +- .../test/thirdparty/microtest/microtest.h | 104 +- Data/SQLParser/test/tpc_h_tests.cpp | 52 +- .../SQLite/include/Poco/Data/SQLite/Utility.h | 6 +- Data/SQLite/src/Notifier.cpp | 6 +- Data/SQLite/src/SQLiteStatementImpl.cpp | 18 +- Data/SQLite/src/Utility.cpp | 6 +- Data/SQLite/testsuite/src/SQLiteTest.cpp | 18 +- Data/include/Poco/Data/LOB.h | 8 +- Data/include/Poco/Data/RecordSet.h | 4 +- Data/include/Poco/Data/Row.h | 8 +- Data/include/Poco/Data/Transaction.h | 4 +- Data/include/Poco/Data/TypeHandler.h | 32 +- Data/samples/DBLogger/src/SQLLogInserter.h | 4 +- Data/samples/WebNotifier/src/WebNotifier.cpp | 6 +- Data/src/AbstractBinding.cpp | 2 +- Data/src/AbstractExtraction.cpp | 2 +- Data/src/RecordSet.cpp | 6 +- Data/src/Row.cpp | 4 +- Data/src/RowFilter.cpp | 10 +- Data/src/Transaction.cpp | 2 +- Data/testsuite/src/SessionImpl.cpp | 6 +- .../Compiler/src/TextEncodingCompiler.cpp | 3 +- Encodings/include/Poco/DoubleByteEncoding.h | 2 +- Encodings/src/ISO8859_10Encoding.cpp | 2 +- Encodings/src/ISO8859_11Encoding.cpp | 2 +- Encodings/src/ISO8859_13Encoding.cpp | 2 +- Encodings/src/ISO8859_14Encoding.cpp | 2 +- Encodings/src/ISO8859_16Encoding.cpp | 2 +- Encodings/src/ISO8859_3Encoding.cpp | 2 +- Encodings/src/ISO8859_4Encoding.cpp | 2 +- Encodings/src/ISO8859_5Encoding.cpp | 2 +- Encodings/src/ISO8859_6Encoding.cpp | 2 +- Encodings/src/ISO8859_7Encoding.cpp | 2 +- Encodings/src/ISO8859_8Encoding.cpp | 2 +- Encodings/src/ISO8859_9Encoding.cpp | 2 +- Encodings/src/MacCentralEurRomanEncoding.cpp | 2 +- Encodings/src/MacChineseSimpEncoding.cpp | 2 +- Encodings/src/MacChineseTradEncoding.cpp | 2 +- Encodings/src/MacCyrillicEncoding.cpp | 2 +- Encodings/src/MacJapaneseEncoding.cpp | 2 +- Encodings/src/MacKoreanEncoding.cpp | 2 +- Encodings/src/MacRomanEncoding.cpp | 2 +- Encodings/src/Windows1253Encoding.cpp | 2 +- Encodings/src/Windows1254Encoding.cpp | 2 +- Encodings/src/Windows1255Encoding.cpp | 2 +- Encodings/src/Windows1256Encoding.cpp | 2 +- Encodings/src/Windows1257Encoding.cpp | 2 +- Encodings/src/Windows1258Encoding.cpp | 2 +- Encodings/src/Windows874Encoding.cpp | 2 +- Encodings/src/Windows932Encoding.cpp | 2 +- Encodings/src/Windows936Encoding.cpp | 2 +- Encodings/src/Windows949Encoding.cpp | 2 +- Encodings/src/Windows950Encoding.cpp | 2 +- Foundation/include/Poco/AbstractCache.h | 6 +- Foundation/include/Poco/AbstractEvent.h | 4 +- Foundation/include/Poco/ActiveResult.h | 2 +- Foundation/include/Poco/AutoPtr.h | 4 +- Foundation/include/Poco/Buffer.h | 8 +- Foundation/include/Poco/Bugcheck.h | 10 +- Foundation/include/Poco/ByteOrder.h | 2 +- Foundation/include/Poco/ClassLoader.h | 8 +- Foundation/include/Poco/Delegate.h | 6 +- Foundation/include/Poco/Dynamic/VarHolder.h | 4 +- Foundation/include/Poco/FileStreamFactory.h | 14 +- Foundation/include/Poco/FunctionDelegate.h | 6 +- .../include/Poco/FunctionPriorityDelegate.h | 6 +- Foundation/include/Poco/Hash.h | 62 +- Foundation/include/Poco/MemoryPool.h | 4 +- Foundation/include/Poco/MemoryStream.h | 4 +- Foundation/include/Poco/NumberFormatter.h | 18 +- Foundation/include/Poco/NumericString.h | 4 +- Foundation/include/Poco/ObjectPool.h | 4 +- Foundation/include/Poco/Platform.h | 4 +- Foundation/include/Poco/PriorityDelegate.h | 6 +- Foundation/include/Poco/Process.h | 10 +- .../include/Poco/RecursiveDirectoryIterator.h | 2 +- Foundation/include/Poco/RegularExpression.h | 4 +- Foundation/include/Poco/Semaphore_WIN32.h | 2 +- Foundation/include/Poco/SharedMemory.h | 4 +- Foundation/include/Poco/SharedPtr.h | 2 +- Foundation/include/Poco/SingletonHolder.h | 2 +- Foundation/include/Poco/StreamTokenizer.h | 2 +- Foundation/include/Poco/StreamUtil.h | 2 +- Foundation/include/Poco/Task.h | 2 +- Foundation/include/Poco/TextEncoding.h | 2 +- Foundation/include/Poco/Token.h | 4 +- Foundation/include/Poco/UnbufferedStreamBuf.h | 4 +- Foundation/include/Poco/UnicodeConverter.h | 2 +- Foundation/include/Poco/ordered_hash.h | 1896 +++--- Foundation/include/Poco/ordered_map.h | 1334 ++--- Foundation/include/Poco/ordered_set.h | 1126 ++-- .../src/BinaryReaderWriter.cpp | 24 +- Foundation/samples/URI/src/URI.cpp | 8 +- .../samples/base64decode/src/base64decode.cpp | 2 +- .../samples/base64encode/src/base64encode.cpp | 2 +- Foundation/samples/deflate/src/deflate.cpp | 2 +- Foundation/samples/hmacmd5/src/hmacmd5.cpp | 2 +- Foundation/samples/inflate/src/inflate.cpp | 2 +- Foundation/samples/md5/src/md5.cpp | 2 +- Foundation/src/ASCIIEncoding.cpp | 2 +- Foundation/src/ActiveDispatcher.cpp | 4 +- Foundation/src/BinaryReader.cpp | 2 +- Foundation/src/BinaryWriter.cpp | 2 +- Foundation/src/Bugcheck.cpp | 6 +- Foundation/src/CountingStream.cpp | 8 +- Foundation/src/DateTimeFormat.cpp | 30 +- Foundation/src/DateTimeFormatter.cpp | 6 +- Foundation/src/DeflatingStream.cpp | 18 +- Foundation/src/DigestStream.cpp | 8 +- Foundation/src/DirectoryIterator.cpp | 2 +- Foundation/src/DirectoryIteratorStrategy.cpp | 4 +- Foundation/src/DirectoryIterator_UNIX.cpp | 2 +- Foundation/src/DirectoryWatcher.cpp | 4 +- Foundation/src/Environment_UNIX.cpp | 4 +- Foundation/src/Error.cpp | 4 +- Foundation/src/EventLogChannel.cpp | 16 +- Foundation/src/Event_POSIX.cpp | 10 +- Foundation/src/Event_WIN32.cpp | 2 +- Foundation/src/Exception.cpp | 10 +- Foundation/src/FIFOBufferStream.cpp | 10 +- Foundation/src/FileChannel.cpp | 2 +- Foundation/src/FileStream_WIN32.cpp | 6 +- Foundation/src/File_WIN32U.cpp | 8 +- Foundation/src/FormattingChannel.cpp | 6 +- Foundation/src/InflatingStream.cpp | 12 +- Foundation/src/Latin1Encoding.cpp | 2 +- Foundation/src/Latin2Encoding.cpp | 2 +- Foundation/src/Latin9Encoding.cpp | 2 +- Foundation/src/LineEndingConverter.cpp | 4 +- Foundation/src/LocalDateTime.cpp | 6 +- Foundation/src/Logger.cpp | 4 +- Foundation/src/MD4Engine.cpp | 14 +- Foundation/src/MD5Engine.cpp | 2 +- Foundation/src/Message.cpp | 18 +- Foundation/src/Mutex_POSIX.cpp | 6 +- Foundation/src/Mutex_STD.cpp | 6 +- Foundation/src/NamedEvent_WIN32U.cpp | 2 +- Foundation/src/NamedMutex_UNIX.cpp | 4 +- Foundation/src/NamedMutex_WIN32U.cpp | 2 +- Foundation/src/NestedDiagnosticContext.cpp | 2 +- Foundation/src/Path.cpp | 4 +- Foundation/src/Path_UNIX.cpp | 2 +- Foundation/src/Path_WIN32U.cpp | 4 +- Foundation/src/PipeImpl_WIN32.cpp | 6 +- Foundation/src/Process.cpp | 12 +- Foundation/src/Process_UNIX.cpp | 6 +- Foundation/src/Process_WIN32U.cpp | 14 +- Foundation/src/RWLock_POSIX.cpp | 2 +- Foundation/src/RWLock_WIN32.cpp | 12 +- Foundation/src/Random.cpp | 2 +- Foundation/src/RandomStream.cpp | 4 +- Foundation/src/SHA1Engine.cpp | 48 +- Foundation/src/SHA2Engine.cpp | 8 +- Foundation/src/Semaphore_POSIX.cpp | 10 +- Foundation/src/Semaphore_WIN32.cpp | 2 +- Foundation/src/SharedLibrary.cpp | 2 +- Foundation/src/SharedLibrary_UNIX.cpp | 8 +- Foundation/src/SharedMemory.cpp | 6 +- Foundation/src/SharedMemory_POSIX.cpp | 4 +- Foundation/src/SharedMemory_WIN32.cpp | 6 +- Foundation/src/SignalHandler.cpp | 8 +- Foundation/src/StreamConverter.cpp | 4 +- Foundation/src/StreamTokenizer.cpp | 2 +- Foundation/src/Task.cpp | 2 +- Foundation/src/TeeStream.cpp | 4 +- Foundation/src/TextBufferIterator.cpp | 8 +- Foundation/src/TextIterator.cpp | 6 +- Foundation/src/ThreadPool.cpp | 2 +- Foundation/src/Thread_POSIX.cpp | 18 +- Foundation/src/Thread_VX.cpp | 4 +- Foundation/src/Thread_WIN32.cpp | 6 +- Foundation/src/Timer.cpp | 6 +- Foundation/src/Timezone_UNIX.cpp | 2 +- Foundation/src/Timezone_VX.cpp | 4 +- Foundation/src/URI.cpp | 20 +- Foundation/src/UTF16Encoding.cpp | 2 +- Foundation/src/UTF32Encoding.cpp | 2 +- Foundation/src/UTF8Encoding.cpp | 12 +- Foundation/src/UTF8String.cpp | 30 +- Foundation/src/VarIterator.cpp | 2 +- Foundation/src/Windows1250Encoding.cpp | 2 +- Foundation/src/Windows1251Encoding.cpp | 2 +- Foundation/src/Windows1252Encoding.cpp | 2 +- Foundation/src/WindowsConsoleChannel.cpp | 8 +- Foundation/src/double-to-string.h | 0 Foundation/testsuite/src/AnyTest.cpp | 22 +- Foundation/testsuite/src/ArrayTest.cpp | 54 +- Foundation/testsuite/src/AutoPtrTest.cpp | 2 +- Foundation/testsuite/src/FPETest.cpp | 2 +- Foundation/testsuite/src/FileChannelTest.cpp | 10 +- .../testsuite/src/FileStreamRWLockTest.cpp | 2 +- Foundation/testsuite/src/FileStreamTest.cpp | 14 +- Foundation/testsuite/src/FileTest.cpp | 6 +- Foundation/testsuite/src/HMACEngineTest.cpp | 10 +- Foundation/testsuite/src/ListMapTest.cpp | 2 +- .../testsuite/src/LocalDateTimeTest.cpp | 4 +- Foundation/testsuite/src/LoggerTest.cpp | 2 +- .../testsuite/src/LoggingFactoryTest.cpp | 2 +- Foundation/testsuite/src/MemoryPoolTest.cpp | 8 +- Foundation/testsuite/src/NDCTest.cpp | 2 +- .../testsuite/src/OrderedContainersTest.cpp | 2 +- .../testsuite/src/OrderedContainersTest.h | 24 +- Foundation/testsuite/src/PathTest.cpp | 8 +- Foundation/testsuite/src/ProcessTest.cpp | 8 +- Foundation/testsuite/src/SharedPtrTest.cpp | 14 +- Foundation/testsuite/src/StringTest.cpp | 4 +- Foundation/testsuite/src/TestApp.cpp | 4 +- .../src/TimedNotificationQueueTest.cpp | 8 +- .../testsuite/src/URIStreamOpenerTest.cpp | 14 +- .../testsuite/src/UUIDGeneratorTest.cpp | 30 +- Foundation/testsuite/src/UUIDTest.cpp | 52 +- JWT/testsuite/src/SignerTest.cpp | 12 +- MongoDB/include/Poco/MongoDB/Document.h | 4 +- .../Poco/MongoDB/PoolableConnectionFactory.h | 4 +- MongoDB/src/ReplicaSet.cpp | 4 +- MongoDB/testsuite/src/MongoDBTest.cpp | 2 +- Net/include/Poco/Net/FTPClientSession.h | 2 +- Net/include/Poco/Net/HTTPServerResponseImpl.h | 2 +- Net/include/Poco/Net/ICMPPacket.h | 2 +- Net/include/Poco/Net/ICMPPacketImpl.h | 2 +- Net/include/Poco/Net/ICMPv4PacketImpl.h | 4 +- Net/include/Poco/Net/MailMessage.h | 2 +- Net/include/Poco/Net/MessageHeader.h | 2 +- Net/include/Poco/Net/SMTPClientSession.h | 2 +- Net/include/Poco/Net/ServerSocket.h | 2 +- Net/include/Poco/Net/TCPServer.h | 6 +- Net/include/Poco/Net/UDPHandler.h | 52 +- Net/include/Poco/Net/UDPSocketReader.h | 28 +- Net/include/Poco/Net/WebSocket.h | 4 +- .../src/HTTPReactorTimeServer.cpp | 2 +- .../HTTPTimeServer/src/HTTPTimeServer.cpp | 2 +- Net/src/AbstractHTTPRequestHandler.cpp | 6 +- Net/src/DNS.cpp | 24 +- Net/src/DialogSocket.cpp | 24 +- Net/src/FTPClientSession.cpp | 18 +- Net/src/FTPStreamFactory.cpp | 2 +- Net/src/HTMLForm.cpp | 6 +- Net/src/HTTPClientSession.cpp | 10 +- Net/src/HTTPServerRequestImpl.cpp | 2 +- Net/src/HTTPServerResponseImpl.cpp | 4 +- Net/src/HTTPSession.cpp | 26 +- Net/src/HTTPStreamFactory.cpp | 4 +- Net/src/ICMPPacket.cpp | 2 +- Net/src/ICMPSocket.cpp | 4 +- Net/src/ICMPv4PacketImpl.cpp | 4 +- Net/src/IPAddress.cpp | 30 +- Net/src/IPAddressImpl.cpp | 4 +- Net/src/MailMessage.cpp | 58 +- Net/src/MailStream.cpp | 4 +- Net/src/MessageHeader.cpp | 2 +- Net/src/NetworkInterface.cpp | 32 +- Net/src/PollSet.cpp | 6 +- Net/src/RemoteSyslogListener.cpp | 20 +- Net/src/SMTPClientSession.cpp | 2 +- Net/src/SSPINTLMCredentials.cpp | 16 +- Net/src/SocketAddress.cpp | 2 +- Net/src/SocketImpl.cpp | 14 +- Net/src/UDPClient.cpp | 2 +- Net/testsuite/src/FTPStreamFactoryTest.cpp | 8 +- Net/testsuite/src/HTTPResponseTest.cpp | 2 +- Net/testsuite/src/HTTPTestServer.cpp | 12 +- Net/testsuite/src/MailMessageTest.cpp | 72 +- Net/testsuite/src/PollSetTest.cpp | 4 +- Net/testsuite/src/QuotedPrintableTest.cpp | 28 +- Net/testsuite/src/SocketAddressTest.cpp | 4 +- Net/testsuite/src/SocketConnectorTest.cpp | 2 +- .../samples/SetSourceIP/src/SetSourceIP.cpp | 2 +- .../src/CertificateHandlerFactoryMgr.cpp | 2 +- NetSSL_OpenSSL/src/Context.cpp | 54 +- NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp | 10 +- NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp | 2 +- NetSSL_OpenSSL/src/SSLManager.cpp | 4 +- NetSSL_OpenSSL/src/SecureSocketImpl.cpp | 2 +- NetSSL_OpenSSL/src/X509Certificate.cpp | 4 +- .../testsuite/src/HTTPSClientSessionTest.cpp | 4 +- .../testsuite/src/HTTPSServerTest.cpp | 2 +- .../testsuite/src/HTTPSTestServer.cpp | 16 +- .../src/CertificateHandlerFactoryMgr.cpp | 2 +- NetSSL_Win/src/Context.cpp | 46 +- NetSSL_Win/src/HTTPSStreamFactory.cpp | 10 +- NetSSL_Win/src/PrivateKeyFactoryMgr.cpp | 2 +- NetSSL_Win/src/SSLManager.cpp | 26 +- NetSSL_Win/src/SecureSocketImpl.cpp | 150 +- NetSSL_Win/src/SecureStreamSocketImpl.cpp | 2 +- NetSSL_Win/src/X509Certificate.cpp | 28 +- NetSSL_Win/testsuite/src/HTTPSTestServer.cpp | 12 +- PageCompiler/src/PageReader.cpp | 2 +- PocoDoc/src/DocWriter.cpp | 6 +- PocoDoc/src/PocoDoc.cpp | 2 +- Redis/include/Poco/Redis/Array.h | 2 +- Redis/include/Poco/Redis/Client.h | 2 +- Redis/src/Client.cpp | 26 +- Redis/src/RedisEventArgs.cpp | 4 +- Redis/testsuite/src/RedisTest.cpp | 2 +- SevenZip/src/Archive.cpp | 4 +- Util/include/Poco/Util/JSONConfiguration.h | 2 +- .../Poco/Util/WinRegistryConfiguration.h | 6 +- Util/src/Application.cpp | 28 +- Util/src/LayeredConfiguration.cpp | 2 +- Util/src/LoggingConfigurator.cpp | 2 +- Util/src/Option.cpp | 18 +- Util/src/OptionSet.cpp | 2 +- Util/src/ServerApplication.cpp | 8 +- Util/src/WinRegistryKey.cpp | 36 +- Util/src/WinService.cpp | 20 +- Util/src/XMLConfiguration.cpp | 44 +- .../src/LocalConfigurationViewTest.cpp | 110 +- .../src/LocalConfigurationViewTest.h | 14 +- .../src/PropertyFileConfigurationTest.cpp | 4 +- Util/testsuite/src/WinServiceTest.cpp | 2 +- XML/include/Poco/DOM/DOMBuilder.h | 2 +- XML/include/Poco/DOM/DOMParser.h | 2 +- XML/include/Poco/DOM/Document.h | 4 +- XML/include/Poco/DOM/NodeIterator.h | 2 +- XML/include/Poco/DOM/TreeWalker.h | 2 +- XML/include/Poco/XML/XMLStreamParser.h | 4 +- XML/src/AbstractContainerNode.cpp | 20 +- XML/src/AbstractNode.cpp | 32 +- XML/src/Attr.cpp | 4 +- XML/src/AttrMap.cpp | 4 +- XML/src/AttributesImpl.cpp | 4 +- XML/src/DOMBuilder.cpp | 8 +- XML/src/DOMImplementation.cpp | 2 +- XML/src/DOMSerializer.cpp | 12 +- XML/src/DOMWriter.cpp | 2 +- XML/src/DTDMap.cpp | 2 +- XML/src/DefaultHandler.cpp | 2 +- XML/src/Document.cpp | 20 +- XML/src/Element.cpp | 8 +- XML/src/ElementsByTagNameList.cpp | 4 +- XML/src/Event.cpp | 6 +- XML/src/InputSource.cpp | 10 +- XML/src/MutationEvent.cpp | 4 +- XML/src/NodeAppender.cpp | 4 +- XML/src/NodeIterator.cpp | 6 +- XML/src/ParserEngine.cpp | 52 +- XML/src/SAXParser.cpp | 2 +- XML/src/TreeWalker.cpp | 26 +- XML/src/WhitespaceFilter.cpp | 4 +- XML/src/XMLFilterImpl.cpp | 20 +- XML/src/XMLStreamParser.cpp | 26 +- XML/src/XMLWriter.cpp | 10 +- XML/testsuite/src/DocumentTest.cpp | 12 +- XML/testsuite/src/DocumentTypeTest.cpp | 2 +- XML/testsuite/src/ElementTest.cpp | 62 +- XML/testsuite/src/NodeAppenderTest.cpp | 10 +- XML/testsuite/src/NodeIteratorTest.cpp | 16 +- XML/testsuite/src/NodeTest.cpp | 336 +- XML/testsuite/src/SAXParserTest.cpp | 2 +- XML/testsuite/src/TreeWalkerTest.cpp | 92 +- XML/testsuite/src/XMLWriterTest.cpp | 8 +- Zip/src/AutoDetectStream.cpp | 2 +- Zip/src/PartialStream.cpp | 8 +- Zip/src/ZipManipulator.cpp | 2 +- Zip/src/ZipStream.cpp | 18 +- cmake/DefinePlatformSpecific.cmake | 4 + .../v8_double_conversion/src/bignum-dtoa.h | 2 +- .../v8_double_conversion/src/bignum.h | 24 +- .../v8_double_conversion/src/cached-powers.h | 10 +- .../v8_double_conversion/src/diy-fp.h | 92 +- .../v8_double_conversion/src/fast-dtoa.h | 10 +- .../v8_double_conversion/src/fixed-dtoa.h | 2 +- dependencies/v8_double_conversion/src/ieee.h | 354 +- .../src/string-to-double.h | 72 +- .../v8_double_conversion/src/strtod.h | 6 +- dependencies/v8_double_conversion/src/utils.h | 98 +- 480 files changed, 10963 insertions(+), 10932 deletions(-) create mode 100644 Foundation/src/double-to-string.h diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eb9ee219..44a49f0f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: export CXX=clang++-20 cmake -S . -B build -G Ninja -DPOCO_BUILD_MODULES=ON - name: Build - run: cmake --build build + run: cmake --build build --parallel 4 android-arm64-v8a-ndk-latest-cmake: runs-on: ubuntu-22.04 @@ -82,7 +82,7 @@ jobs: - run: >- cmake -S. -Bcmake-build -GNinja -DENABLE_TESTS=ON -DPOCO_MINIMAL_BUILD=TRUE -DENABLE_NET=ON -DENABLE_JSON=ON -DENABLE_XML=ON -DENABLE_ZIP=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 linux-gcc-cmake-cross-armhf: # Converted from a make job, what is essentially different from the above? @@ -100,14 +100,14 @@ jobs: - run: >- cmake -S. -Bcmake-build -GNinja -DENABLE_TESTS=ON -DPOCO_MINIMAL_BUILD=TRUE -DENABLE_NET=ON -DENABLE_JSON=ON -DENABLE_XML=ON -DENABLE_ZIP=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 linux-gcc-cmake: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - run: sudo apt -y update && sudo apt -y install cmake ninja-build libssl-dev unixodbc-dev libmysqlclient-dev redis-server - - run: cmake -S. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all + - run: cmake -S. -Bcmake-build -GNinja -DENABLE_PDF=OFF -DENABLE_TESTS=ON && cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -126,7 +126,7 @@ jobs: - run: >- cmake -S. -Bcmake-build -GNinja -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DENABLE_PDF=ON -DENABLE_TESTS=ON -DENABLE_DATA_MYSQL=ON -DENABLE_DATA_ODBC=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -147,7 +147,7 @@ jobs: - run: >- cmake -S. -Bcmake-build -GNinja -DENABLE_TESTS=ON -DPOCO_UNBUNDLED=ON -DENABLE_DATA_MYSQL=ON -DENABLE_PDF=ON -DENABLE_XML=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -168,7 +168,7 @@ jobs: - run: >- cmake -S. -Bcmake-build -GNinja -DENABLE_TESTS=ON -DPOCO_UNBUNDLED=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_DATA_MYSQL=ON -DENABLE_PDF=ON -DENABLE_XML=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -186,7 +186,7 @@ jobs: - run: sudo apt -y update && sudo apt -y install libssl-dev - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_TRACE=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -219,7 +219,7 @@ jobs: -DENABLE_PAGECOMPILER=ON -DENABLE_POCODOC=ON -DENABLE_PAGECOMPILER_FILE2PAGE=ON -DENABLE_REDIS=OFF -DENABLE_MONGODB=OFF -DENABLE_DATA=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_DATA_MYSQL=OFF - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -252,7 +252,7 @@ jobs: -DENABLE_PAGECOMPILER=ON -DENABLE_POCODOC=ON -DENABLE_PAGECOMPILER_FILE2PAGE=ON -DENABLE_REDIS=OFF -DENABLE_MONGODB=OFF -DENABLE_DATA=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_DATA_MYSQL=OFF - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -279,7 +279,7 @@ jobs: -DENABLE_PAGECOMPILER=ON -DENABLE_POCODOC=ON -DENABLE_PAGECOMPILER_FILE2PAGE=ON -DENABLE_REDIS=OFF -DENABLE_MONGODB=OFF -DENABLE_DATA=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_DATA_MYSQL=OFF - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -314,7 +314,7 @@ jobs: -DENABLE_PAGECOMPILER=ON -DENABLE_POCODOC=ON -DENABLE_PAGECOMPILER_FILE2PAGE=ON -DENABLE_REDIS=OFF -DENABLE_MONGODB=OFF -DENABLE_DATA=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_DATA_POSTGRESQL=OFF -DENABLE_DATA_MYSQL=OFF - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -346,7 +346,7 @@ jobs: - run: >- emcmake cmake -H. -B cmake-build -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DENABLE_ACTIVERECORD_COMPILER=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=off - - run: emmake cmake --build cmake-build --target all -j6 + - run: emmake cmake --build cmake-build --target all --parallel 4 # TODO: How to run unit tests in emscripten? # - uses: ./.github/actions/retry-action # with: @@ -696,7 +696,7 @@ jobs: - run: sudo apt -y update && sudo apt -y install libssl-dev unixodbc-dev libmysqlclient-dev mysql-client - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_DATA_MYSQL=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -723,7 +723,7 @@ jobs: - run: sudo apt -y update && sudo apt -y install libssl-dev unixodbc-dev libmysqlclient-dev odbc-postgresql - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_DATA_POSTGRESQL=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -746,7 +746,7 @@ jobs: sudo apt-get -y install redis - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_REDIS=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -765,7 +765,7 @@ jobs: - run: sudo apt -y update && sudo apt -y install libssl-dev - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_MONGODB=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: @@ -817,6 +817,17 @@ jobs: # wget https://dev.mysql.com/get/Downloads/Connector-ODBC/8.2/mysql-connector-odbc_8.2.0-1ubuntu22.04_amd64.deb # wget https://dev.mysql.com/get/Downloads/MySQL-8.2/mysql-community-client-plugins_8.2.0-1ubuntu22.04_amd64.deb # sudo dpkg -i mysql-community-client-plugins_8.2.0-1ubuntu22.04_amd64.deb mysql-connector-odbc_8.2.0-1ubuntu22.04_amd64.deb + + - name: Free disk space + run: | + sudo df + sudo apt autopurge + sudo apt clean + sudo du -s /usr/local/lib/* + sudo du -s /opt/* + sudo rm -rf /usr/share/dotnet + sudo docker system prune -a --force + sudo df - name: Setup Oracle ODBC connector run: | wget https://www.devart.com/odbc/oracle/devartodbcoracle_amd64.deb @@ -833,7 +844,7 @@ jobs: - run: ls -l /etc/apt/sources.list.d/ - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_DATA_ODBC=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: timeout_minutes: 90 @@ -853,7 +864,7 @@ jobs: - run: >- cmake -S. -Bcmake-build -GNinja -DPOCO_MINIMAL_BUILD=ON -DENABLE_DATA_SQLITE=ON -DPOCO_DATA_NO_SQL_PARSER=ON -DENABLE_TESTS=ON - - run: cmake --build cmake-build --target all + - run: cmake --build cmake-build --target all --parallel 4 - uses: ./.github/actions/retry-action with: diff --git a/ApacheConnector/src/ApacheConnector.cpp b/ApacheConnector/src/ApacheConnector.cpp index af0eac4a1..0b8056358 100644 --- a/ApacheConnector/src/ApacheConnector.cpp +++ b/ApacheConnector/src/ApacheConnector.cpp @@ -164,7 +164,7 @@ void ApacheConnector::log(const char* file, int line, int level, int status, con // ap_log_error() has undergone significant changes in Apache 2.4. // Validate Apache version for using a proper ap_log_error() version. #if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 4 - ap_log_error(file, line, level, 0, NULL, "%s", text); + ap_log_error(file, line, level, 0, nullptr, "%s", text); #else ap_log_error(file, line, level, 0, 0, 0, text); #endif @@ -186,27 +186,27 @@ extern "C" int ApacheConnector_handler(request_rec *r) if (!app.factory().mustHandle(r->uri)) return DECLINED; - apr_status_t rv; + apr_status_t rv; if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK))) return rv; - // The properties conn_rec->remote_ip and conn_rec->remote_addr have undergone significant changes in Apache 2.4. - // Validate Apache version for using conn_rec->remote_ip and conn_rec->remote_addr proper versions. + // The properties conn_rec->remote_ip and conn_rec->remote_addr have undergone significant changes in Apache 2.4. + // Validate Apache version for using conn_rec->remote_ip and conn_rec->remote_addr proper versions. #if AP_SERVER_MAJORVERSION_NUMBER == 2 && AP_SERVER_MINORVERSION_NUMBER < 4 - const char* clientIp = r->connection->remote_ip; - apr_port_t clientPort = r->connection->remote_addr->port; + const char* clientIp = r->connection->remote_ip; + apr_port_t clientPort = r->connection->remote_addr->port; #else - const char* clientIp = r->connection->client_ip; - apr_port_t clientPort = r->connection->client_addr->port; + const char* clientIp = r->connection->client_ip; + apr_port_t clientPort = r->connection->client_addr->port; #endif - std::unique_ptr pRequest(new ApacheServerRequest( - &rec, - r->connection->local_ip, - r->connection->local_addr->port, - clientIp, - clientPort)); + std::unique_ptr pRequest(new ApacheServerRequest( + &rec, + r->connection->local_ip, + r->connection->local_addr->port, + clientIp, + clientPort)); - std::unique_ptr pResponse(new ApacheServerResponse(pRequest.get())); + std::unique_ptr pResponse(new ApacheServerResponse(pRequest.get())); // add header information to request rec.copyHeaders(*pRequest); @@ -245,7 +245,7 @@ extern "C" int ApacheConnector_handler(request_rec *r) extern "C" void ApacheConnector_register_hooks(apr_pool_t *p) { - ap_hook_handler(ApacheConnector_handler, NULL, NULL, APR_HOOK_MIDDLE); + ap_hook_handler(ApacheConnector_handler, nullptr, nullptr, APR_HOOK_MIDDLE); } @@ -263,7 +263,7 @@ extern "C" const char* ApacheConnector_uris(cmd_parms *cmd, void *in_dconf, cons { ApacheConnector::log(__FILE__, __LINE__, ApacheConnector::PRIO_ERROR, 0, "Unknown exception"); } - return 0; + return 0; } @@ -281,35 +281,35 @@ extern "C" const char* ApacheConnector_config(cmd_parms *cmd, void *in_dconf, co { ApacheConnector::log(__FILE__, __LINE__, ApacheConnector::PRIO_ERROR, 0, "Unknown exception"); } - return 0; + return 0; } extern "C" const command_rec ApacheConnector_cmds[] = { - AP_INIT_RAW_ARGS( + AP_INIT_RAW_ARGS( "AddPocoRequestHandler", reinterpret_cast(ApacheConnector_uris), - NULL, + nullptr, RSRC_CONF, "POCO RequestHandlerFactory class name followed by shared library path followed by a list of ' ' separated URIs that must be handled by this module."), - AP_INIT_RAW_ARGS( + AP_INIT_RAW_ARGS( "AddPocoConfig", reinterpret_cast(ApacheConnector_config), - NULL, + nullptr, RSRC_CONF, "Path of the POCO configuration file."), - { NULL } + { nullptr } }; module AP_MODULE_DECLARE_DATA poco_module = { STANDARD20_MODULE_STUFF, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, ApacheConnector_cmds, ApacheConnector_register_hooks }; diff --git a/ApacheConnector/src/ApacheServerRequest.cpp b/ApacheConnector/src/ApacheServerRequest.cpp index d36382b32..ef54469b5 100644 --- a/ApacheConnector/src/ApacheServerRequest.cpp +++ b/ApacheConnector/src/ApacheServerRequest.cpp @@ -22,8 +22,8 @@ ApacheServerRequest::ApacheServerRequest( const char* clientName, int clientPort): _pApacheRequest(pApacheRequest), - _pResponse(0), - _pStream(new ApacheInputStream(_pApacheRequest)), + _pResponse(0), + _pStream(new ApacheInputStream(_pApacheRequest)), _serverAddress(serverName, serverPort), _clientAddress(clientName, clientPort) { diff --git a/CppParser/include/Poco/CppParser/NameSpace.h b/CppParser/include/Poco/CppParser/NameSpace.h index f3c0c56b9..cc3383e9a 100644 --- a/CppParser/include/Poco/CppParser/NameSpace.h +++ b/CppParser/include/Poco/CppParser/NameSpace.h @@ -41,7 +41,7 @@ public: NameSpace(); /// Creates the NameSpace. - NameSpace(const std::string& name, NameSpace* pNameSpace = 0); + NameSpace(const std::string& name, NameSpace* pNameSpace = nullptr); /// Creates the NameSpace. ~NameSpace(); diff --git a/CppParser/include/Poco/CppParser/Symbol.h b/CppParser/include/Poco/CppParser/Symbol.h index 8e9c77f9c..a797a5d85 100644 --- a/CppParser/include/Poco/CppParser/Symbol.h +++ b/CppParser/include/Poco/CppParser/Symbol.h @@ -62,7 +62,7 @@ public: /// Creates the Symbol and assigns the symbol /// a unique ID. - Symbol(const std::string& name, NameSpace* pNameSpace = 0); + Symbol(const std::string& name, NameSpace* pNameSpace = nullptr); /// Creates the Symbol and assigns the symbol /// a unique ID. diff --git a/CppParser/src/CppToken.cpp b/CppParser/src/CppToken.cpp index 342da95e4..b2b1fca4a 100644 --- a/CppParser/src/CppToken.cpp +++ b/CppParser/src/CppToken.cpp @@ -353,8 +353,8 @@ bool IdentifierToken::start(char c, std::istream& /*istr*/) { _value = c; return (c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - (c == '_' || c == '$'); + (c >= 'a' && c <= 'z') || + (c == '_' || c == '$'); } @@ -522,7 +522,7 @@ bool NumberLiteralToken::start(char c, std::istream& istr) _value = c; int next = istr.peek(); return (c >= '0' && c <= '9') || - (c == '.' && next >= '0' && next <= '9'); + (c == '.' && next >= '0' && next <= '9'); } @@ -670,13 +670,13 @@ void NumberLiteralToken::finishSuffix(std::istream& istr, int next) int NumberLiteralToken::asInteger() const { - return static_cast(std::strtol(_value.c_str(), 0, 0)); + return static_cast(std::strtol(_value.c_str(), nullptr, 0)); } double NumberLiteralToken::asFloat() const { - return std::strtod(_value.c_str(), 0); + return std::strtod(_value.c_str(), nullptr); } diff --git a/CppParser/src/Function.cpp b/CppParser/src/Function.cpp index e41db8004..e2f4260dc 100644 --- a/CppParser/src/Function.cpp +++ b/CppParser/src/Function.cpp @@ -213,7 +213,7 @@ bool Function::isVirtual() const Struct* pClass = dynamic_cast(nameSpace()); return pClass && pClass->hasVirtualDestructor(); } - else return getOverridden() != 0; + else return getOverridden() != nullptr; } @@ -235,7 +235,7 @@ Function* Function::getOverridden() const } } } - return 0; + return nullptr; } diff --git a/CppParser/src/NameSpace.cpp b/CppParser/src/NameSpace.cpp index 08862a066..231ea48bf 100644 --- a/CppParser/src/NameSpace.cpp +++ b/CppParser/src/NameSpace.cpp @@ -94,7 +94,7 @@ Symbol* NameSpace::lookup(const std::string& name) const Symbol* NameSpace::lookup(const std::string& name, std::set& alreadyVisited) const { - Symbol* pSymbol = 0; + Symbol* pSymbol = nullptr; if (name.empty()) return pSymbol; @@ -125,7 +125,7 @@ Symbol* NameSpace::lookup(const std::string& name, std::set& a if (pNS) pSymbol = static_cast(pSymbol)->lookup(tail, alreadyVisited); else - pSymbol = 0; + pSymbol = nullptr; } } else if (tail.empty()) diff --git a/CppParser/src/Parameter.cpp b/CppParser/src/Parameter.cpp index f103e080b..8df8b7501 100644 --- a/CppParser/src/Parameter.cpp +++ b/CppParser/src/Parameter.cpp @@ -29,7 +29,7 @@ int Parameter::_count(0); Parameter::Parameter(const std::string& decl, Function* /*pFunction*/): - Decl(handleDecl(decl), 0), // handle init values + Decl(handleDecl(decl), nullptr), // handle init values _type(), _isRef(false), _isPointer(false), diff --git a/CppParser/src/Parser.cpp b/CppParser/src/Parser.cpp index f7f711dae..1183fd670 100644 --- a/CppParser/src/Parser.cpp +++ b/CppParser/src/Parser.cpp @@ -52,7 +52,7 @@ Parser::Parser(NameSpace::SymbolTable& gst, const std::string& file, std::istrea _tokenizer(_istr), _file(file), _inFile(false), - _pCurrentSymbol(0), + _pCurrentSymbol(nullptr), _access(Symbol::ACC_PUBLIC) { Path p(file); @@ -235,7 +235,7 @@ const Token* Parser::parseNameSpace(const Token* pNext) fullName += name; NameSpace* pNS = dynamic_cast(currentNameSpace()->lookup(fullName)); - bool undefined = (pNS == 0); + bool undefined = (pNS == nullptr); if (undefined) pNS = new NameSpace(name, currentNameSpace()); pushNameSpace(pNS, -1, undefined); pNext = next(); @@ -287,7 +287,7 @@ const Token* Parser::parseClass(const Token* pNext, std::string& decl) { poco_assert (isKeyword(pNext, IdentifierToken::KW_CLASS) || isKeyword(pNext, IdentifierToken::KW_STRUCT) || isKeyword(pNext, IdentifierToken::KW_UNION)); - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; bool isClass = isKeyword(pNext, IdentifierToken::KW_CLASS); int line = static_cast(_istr.getCurrentLineNumber()); Symbol::Access prevAccess = _access; @@ -324,7 +324,7 @@ const Token* Parser::parseClass(const Token* pNext, std::string& decl) expectOperator(pNext, OperatorToken::OP_SEMICOLON, ";"); pNext = next(); _access = prevAccess; - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; return pNext; } if (isOperator(pNext, OperatorToken::OP_COLON) || isOperator(pNext, OperatorToken::OP_OPENBRACE)) @@ -346,7 +346,7 @@ const Token* Parser::parseClass(const Token* pNext, std::string& decl) } pNext = next(); _access = prevAccess; - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; return pNext; } @@ -495,7 +495,7 @@ const Token* Parser::parseTypeDef(const Token* pNext) { poco_assert (isKeyword(pNext, IdentifierToken::KW_TYPEDEF)); - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; int line = static_cast(_istr.getCurrentLineNumber()); std::string decl; while (!isOperator(pNext, OperatorToken::OP_SEMICOLON) && !isEOF(pNext)) @@ -507,7 +507,7 @@ const Token* Parser::parseTypeDef(const Token* pNext) addSymbol(pTypeDef, line); pNext = next(); - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; return pNext; } @@ -516,7 +516,7 @@ const Token* Parser::parseUsing(const Token* pNext) { poco_assert (isKeyword(pNext, IdentifierToken::KW_USING)); - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; int line = static_cast(_istr.getCurrentLineNumber()); pNext = next(); if (isKeyword(pNext, IdentifierToken::KW_NAMESPACE)) @@ -560,7 +560,7 @@ const Token* Parser::parseUsing(const Token* pNext) if (!isOperator(pNext, OperatorToken::OP_SEMICOLON)) syntaxError("semicolon"); pNext = next(); - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; return pNext; } @@ -589,7 +589,7 @@ const Token* Parser::parseVarFunc(const Token* pNext) const Token* Parser::parseVarFunc(const Token* pNext, std::string& decl) { - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; std::string attrs; if (isOperator(pNext, OperatorToken::OP_DBL_OPENBRACKET)) { @@ -642,7 +642,7 @@ const Token* Parser::parseVarFunc(const Token* pNext, std::string& decl) pNext = parseFunc(pNext, attrs, decl); } } - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; return pNext; } @@ -674,7 +674,7 @@ const Token* Parser::parseFunc(const Token* pNext, const std::string& attrs, std poco_assert (isOperator(pNext, OperatorToken::OP_OPENPARENT)); int line = static_cast(_istr.getCurrentLineNumber()); - Function* pFunc = 0; + Function* pFunc = nullptr; std::string name = Symbol::extractName(decl); if (name.find(':') == std::string::npos) { @@ -836,7 +836,7 @@ const Token* Parser::parseEnum(const Token* pNext) std::string baseType; int flags = 0; - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; int line = static_cast(_istr.getCurrentLineNumber()); pNext = next(); @@ -883,14 +883,14 @@ const Token* Parser::parseEnum(const Token* pNext) pNext = next(); expectOperator(pNext, OperatorToken::OP_SEMICOLON, ";"); pNext = next(); - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; return pNext; } const Token* Parser::parseEnumValue(const Token* pNext, Enum* pEnum) { - _pCurrentSymbol = 0; + _pCurrentSymbol = nullptr; _doc.clear(); int line = static_cast(_istr.getCurrentLineNumber()); std::string name = pNext->tokenString(); diff --git a/CppParser/src/Struct.cpp b/CppParser/src/Struct.cpp index b57119799..c1ae368ec 100644 --- a/CppParser/src/Struct.cpp +++ b/CppParser/src/Struct.cpp @@ -58,7 +58,7 @@ void Struct::addBase(const std::string& name, Symbol::Access access, bool isVirt base.name = name; base.access = access; base.isVirtual = isVirtual; - base.pClass = 0; + base.pClass = nullptr; _bases.push_back(base); } @@ -154,7 +154,7 @@ Function* Struct::destructor() const if (pFunc && pFunc->isDestructor()) return pFunc; } - return 0; + return nullptr; } @@ -220,7 +220,7 @@ Function* Struct::findFunction(const std::string& signature) const if (pFunc) return pFunc; } } - return 0; + return nullptr; } diff --git a/CppParser/src/Symbol.cpp b/CppParser/src/Symbol.cpp index d6280e260..f71f28c28 100644 --- a/CppParser/src/Symbol.cpp +++ b/CppParser/src/Symbol.cpp @@ -29,7 +29,7 @@ int Symbol::_nextId = 0; Symbol::Symbol(): _id(_nextId++), - _pNameSpace(0), + _pNameSpace(nullptr), _access(ACC_PUBLIC), _line(-1), _order(0) diff --git a/CppUnit/include/CppUnit/CppUnitException.h b/CppUnit/include/CppUnit/CppUnitException.h index 5562ce597..624a6c3d4 100644 --- a/CppUnit/include/CppUnit/CppUnitException.h +++ b/CppUnit/include/CppUnit/CppUnitException.h @@ -21,17 +21,17 @@ class CppUnit_API CppUnitException: public std::exception { public: CppUnitException(const std::string& message = "", - long lineNumber = CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CPPUNIT_UNKNOWNFILENAME); + long lineNumber = CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CPPUNIT_UNKNOWNFILENAME); CppUnitException(const std::string& message, - long lineNumber, - long data1lineNumber, - const std::string& fileName); + long lineNumber, + long data1lineNumber, + const std::string& fileName); CppUnitException(const std::string& message, - long lineNumber, - long data1lineNumber, - long data2lineNumber, - const std::string& fileName); + long lineNumber, + long data1lineNumber, + long data2lineNumber, + const std::string& fileName); CppUnitException(const CppUnitException& other); ~CppUnitException() noexcept override; @@ -58,11 +58,11 @@ private: inline CppUnitException::CppUnitException(const CppUnitException& other): exception (other) { - _message = other._message; - _lineNumber = other._lineNumber; - _data1lineNumber = other._data1lineNumber; - _data2lineNumber = other._data2lineNumber; - _fileName = other._fileName; + _message = other._message; + _lineNumber = other._lineNumber; + _data1lineNumber = other._data1lineNumber; + _data2lineNumber = other._data2lineNumber; + _fileName = other._fileName; } @@ -90,15 +90,15 @@ inline CppUnitException& CppUnitException::operator = (const CppUnitException& o { exception::operator= (other); - if (&other != this) - { - _message = other._message; - _lineNumber = other._lineNumber; - _data1lineNumber = other._data1lineNumber; - _data2lineNumber = other._data2lineNumber; - _fileName = other._fileName; - } - return *this; + if (&other != this) + { + _message = other._message; + _lineNumber = other._lineNumber; + _data1lineNumber = other._data1lineNumber; + _data2lineNumber = other._data2lineNumber; + _fileName = other._fileName; + } + return *this; } diff --git a/CppUnit/include/CppUnit/Orthodox.h b/CppUnit/include/CppUnit/Orthodox.h index 3363e5f66..b738fb2c6 100644 --- a/CppUnit/include/CppUnit/Orthodox.h +++ b/CppUnit/include/CppUnit/Orthodox.h @@ -54,7 +54,7 @@ public: } protected: - ClassUnderTest call(ClassUnderTest object); + ClassUnderTest call(ClassUnderTest object); void runTest () override; }; @@ -63,29 +63,29 @@ protected: template void Orthodox::runTest() { - // make sure we have a default constructor - ClassUnderTest a, b, c; + // make sure we have a default constructor + ClassUnderTest a, b, c; - // make sure we have an equality operator - assert (a == b); + // make sure we have an equality operator + assert (a == b); - // check the inverse - b.operator= (a.operator! ()); - assert (a != b); + // check the inverse + b.operator= (a.operator! ()); + assert (a != b); - // double inversion - b = !!a; - assert (a == b); + // double inversion + b = !!a; + assert (a == b); - // invert again - b = !a; + // invert again + b = !a; - // check calls - c = a; - assert (c == call (a)); + // check calls + c = a; + assert (c == call (a)); - c = b; - assert (c == call (b)); + c = b; + assert (c == call (b)); } @@ -93,7 +93,7 @@ void Orthodox::runTest() template ClassUnderTest Orthodox::call(ClassUnderTest object) { - return object; + return object; } diff --git a/CppUnit/include/CppUnit/TestCase.h b/CppUnit/include/CppUnit/TestCase.h index 73c6bb163..78204777b 100644 --- a/CppUnit/include/CppUnit/TestCase.h +++ b/CppUnit/include/CppUnit/TestCase.h @@ -85,7 +85,7 @@ class TestResult; */ class CppUnit_API TestCase: public Test { - REFERENCEOBJECT (TestCase) + REFERENCEOBJECT (TestCase) public: TestCase(const std::string& name, Test::Type testType = Test::Normal); @@ -108,55 +108,55 @@ protected: TestResult* defaultResult(); void assertImplementation(bool condition, - const std::string& conditionExpression = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& conditionExpression = "", + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void loop1assertImplementation(bool condition, - const std::string& conditionExpression = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - long dataLineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& conditionExpression = "", + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + long dataLineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void loop2assertImplementation(bool condition, - const std::string& conditionExpression = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - long data1LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - long data2LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& conditionExpression = "", + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + long data1LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + long data2LineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); template , T1>, typename = std::enable_if_t, T2>> void assertEquals(T1 expected, - T2 actual, - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME) + T2 actual, + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME) { if (expected != actual) assertImplementation(false, notEqualsMessage(expected, actual), lineNumber, fileName); } void assertEquals(double expected, - double actual, - double delta, - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + double actual, + double delta, + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void assertEquals(const std::string& expected, - const std::string& actual, - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& actual, + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void assertEquals(const char* expected, - const std::string& actual, - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& actual, + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void assertEquals(const void* expected, - const void* actual, - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const void* actual, + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); template , T1>, @@ -170,22 +170,22 @@ protected: std::string notEqualsMessage(const std::string& expected, const std::string& actual); void assertNotNull(const void* pointer, - const std::string& pointerExpression = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& pointerExpression = "", + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void assertNull(const void* pointer, - const std::string& pointerExpression = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + const std::string& pointerExpression = "", + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void fail(const std::string& message = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); void warn(const std::string& message = "", - long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, - const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); + long lineNumber = CppUnitException::CPPUNIT_UNKNOWNLINENUMBER, + const std::string& fileName = CppUnitException::CPPUNIT_UNKNOWNFILENAME); private: diff --git a/CppUnit/src/TestRunner.cpp b/CppUnit/src/TestRunner.cpp index 273467831..6a00d678c 100644 --- a/CppUnit/src/TestRunner.cpp +++ b/CppUnit/src/TestRunner.cpp @@ -34,7 +34,7 @@ TestRunner::~TestRunner() void TestRunner::printBanner() { - _ostr + _ostr << "Usage: driver [-all] [-ignore ] [-long] [-print] [-wait] [name] ..." << std::endl << " where name is the name of a test case class" << std::endl; } @@ -54,7 +54,7 @@ bool TestRunner::run(const std::vector& args, const Test::Callback& std::vector setup; std::vector tests; - for (std::size_t i = 1; i < args.size(); i++) + for (std::size_t i = 1; i < args.size(); i++) { const std::string& arg = args[i]; if (arg == "-wait") diff --git a/CppUnit/src/TextTestResult.cpp b/CppUnit/src/TextTestResult.cpp index ad6b5d922..9fcfef7dc 100644 --- a/CppUnit/src/TextTestResult.cpp +++ b/CppUnit/src/TextTestResult.cpp @@ -167,12 +167,12 @@ void TextTestResult::printErrors(std::ostream& stream) CppUnitException* e = failure->thrownException(); stream << std::setw(2) << i - << ": " - << failure->failedTest()->toString() << "\n" + << ": " + << failure->failedTest()->toString() << "\n" << " \"" << (e ? e->what() : "") << "\"\n" - << " in \"" - << (e ? e->fileName() : std::string()) - << "\", line "; + << " in \"" + << (e ? e->fileName() : std::string()) + << "\", line "; if (e == nullptr) { stream << "0"; @@ -183,7 +183,7 @@ void TextTestResult::printErrors(std::ostream& stream) if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER) { stream << " data lines " << e->data1LineNumber() - << ", " << e->data2LineNumber(); + << ", " << e->data2LineNumber(); } else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER) { @@ -214,12 +214,12 @@ void TextTestResult::printFailures(std::ostream& stream) CppUnitException* e = failure->thrownException(); stream << std::setw(2) << i - << ": " - << failure->failedTest()->toString() << "\n" - << " \"" << (e ? e->what() : "") << "\"\n" - << " in \"" - << (e ? e->fileName() : std::string()) - << "\", line "; + << ": " + << failure->failedTest()->toString() << "\n" + << " \"" << (e ? e->what() : "") << "\"\n" + << " in \"" + << (e ? e->fileName() : std::string()) + << "\", line "; if (e == nullptr) { stream << "0"; @@ -230,8 +230,8 @@ void TextTestResult::printFailures(std::ostream& stream) if (e->data2LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER) { stream << " data lines " - << e->data1LineNumber() - << ", " << e->data2LineNumber(); + << e->data1LineNumber() + << ", " << e->data2LineNumber(); } else if (e->data1LineNumber() != CppUnitException::CPPUNIT_UNKNOWNLINENUMBER) { @@ -258,17 +258,17 @@ void TextTestResult::printHeader(std::ostream& stream) stream << "\n\n"; if (wasSuccessful()) stream << "OK (" - << runTests() << " tests)" - << std::endl; + << runTests() << " tests)" + << std::endl; else stream << "!!!FAILURES!!!" << "\n" - << "Runs: " - << runTests () - << " Failures: " - << testFailures () - << " Errors: " - << testErrors () - << std::endl; + << "Runs: " + << runTests () + << " Failures: " + << testFailures () + << " Errors: " + << testErrors () + << std::endl; } diff --git a/Crypto/include/Poco/Crypto/CipherKeyImpl.h b/Crypto/include/Poco/Crypto/CipherKeyImpl.h index 839745289..4139ab735 100644 --- a/Crypto/include/Poco/Crypto/CipherKeyImpl.h +++ b/Crypto/include/Poco/Crypto/CipherKeyImpl.h @@ -110,7 +110,7 @@ private: void generateKey(const std::string& passphrase, const std::string& salt, int iterationCount); - /// Generates key and IV from a password and optional salt string. + /// Generates key and IV from a password and optional salt string. void generateKey(); /// Generates key and IV from random data. diff --git a/Crypto/include/Poco/Crypto/Crypto.h b/Crypto/include/Poco/Crypto/Crypto.h index 7b842c85e..07d7ec597 100644 --- a/Crypto/include/Poco/Crypto/Crypto.h +++ b/Crypto/include/Poco/Crypto/Crypto.h @@ -119,7 +119,7 @@ inline std::string& getError(std::string& msg) while ((err = ERR_get_error())) { if (!msg.empty()) msg.append(1, '\n'); - msg.append(ERR_error_string(err, 0)); + msg.append(ERR_error_string(err, nullptr)); } return msg; } diff --git a/Crypto/include/Poco/Crypto/ECKey.h b/Crypto/include/Poco/Crypto/ECKey.h index 9bfaf9d20..f74cbfdc3 100644 --- a/Crypto/include/Poco/Crypto/ECKey.h +++ b/Crypto/include/Poco/Crypto/ECKey.h @@ -65,7 +65,7 @@ public: /// If a private key is specified, you don't need to specify a public key file. /// OpenSSL will auto-create the public key from the private key. - ECKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = ""); + ECKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream = nullptr, const std::string& privateKeyPassphrase = ""); /// Creates the ECKey, by reading public and private key from the given streams and /// using the given passphrase for the private key. /// diff --git a/Crypto/include/Poco/Crypto/ECKeyImpl.h b/Crypto/include/Poco/Crypto/ECKeyImpl.h index a832491bb..7110faa22 100644 --- a/Crypto/include/Poco/Crypto/ECKeyImpl.h +++ b/Crypto/include/Poco/Crypto/ECKeyImpl.h @@ -95,7 +95,7 @@ public: /// is not exported. void save(std::ostream* pPublicKeyStream, - std::ostream* pPrivateKeyStream = 0, + std::ostream* pPrivateKeyStream = nullptr, const std::string& privateKeyPassphrase = "") const; /// Exports the public and private key to the given streams. /// diff --git a/Crypto/include/Poco/Crypto/EVPPKey.h b/Crypto/include/Poco/Crypto/EVPPKey.h index 256f1983e..a7ddd6cd7 100644 --- a/Crypto/include/Poco/Crypto/EVPPKey.h +++ b/Crypto/include/Poco/Crypto/EVPPKey.h @@ -149,7 +149,7 @@ public: /// If an empty filename is specified, the corresponding key /// is not exported. - void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = 0, const std::string& privateKeyPassphrase = "") const; + void save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStream = nullptr, const std::string& privateKeyPassphrase = "") const; /// Exports the public and/or private key to the given streams. /// /// If a null pointer is passed for a stream, the corresponding @@ -218,7 +218,7 @@ private: poco_check_ptr (ppKey); poco_assert_dbg (!*ppKey); - FILE* pFile = 0; + FILE* pFile = nullptr; if (!keyFile.empty()) { if (!getFunc) *ppKey = (K*)EVP_PKEY_new(); @@ -236,11 +236,11 @@ private: if (pFile) { - pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB; - void* pPassword = pass.empty() ? (void*)0 : (void*)pass.c_str(); + pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)nullptr : &passCB; + void* pPassword = pass.empty() ? (void*)nullptr : (void*)pass.c_str(); if (readFunc(pFile, &pKey, pCB, pPassword)) { - fclose(pFile); pFile = 0; + fclose(pFile); pFile = nullptr; if(getFunc) { *ppKey = (K*)getFunc(pKey); @@ -288,7 +288,7 @@ private: poco_check_ptr(ppKey); poco_assert_dbg(!*ppKey); - BIO* pBIO = 0; + BIO* pBIO = nullptr; if (pIstr) { std::ostringstream ostr; @@ -301,11 +301,11 @@ private: EVP_PKEY* pKey = getFunc ? EVP_PKEY_new() : (EVP_PKEY*)*ppKey; if (pKey) { - pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB; - void* pPassword = pass.empty() ? (void*)0 : (void*)pass.c_str(); + pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)nullptr : &passCB; + void* pPassword = pass.empty() ? (void*)nullptr : (void*)pass.c_str(); if (readFunc(pBIO, &pKey, pCB, pPassword)) { - BIO_free(pBIO); pBIO = 0; + BIO_free(pBIO); pBIO = nullptr; if (getFunc) { *ppKey = (K*)getFunc(pKey); @@ -335,7 +335,7 @@ private: throw OpenSSLException(msg); } - EVP_PKEY* _pEVPPKey = 0; + EVP_PKEY* _pEVPPKey = nullptr; static const std::map KNOWN_TYPES; friend class ECKeyImpl; diff --git a/Crypto/include/Poco/Crypto/KeyPair.h b/Crypto/include/Poco/Crypto/KeyPair.h index 6f14a5f8e..de12bddc8 100644 --- a/Crypto/include/Poco/Crypto/KeyPair.h +++ b/Crypto/include/Poco/Crypto/KeyPair.h @@ -44,7 +44,7 @@ public: KT_EC = KeyPairImpl::KT_EC_IMPL }; - explicit KeyPair(KeyPairImpl::Ptr pKeyPairImpl = 0); + explicit KeyPair(KeyPairImpl::Ptr pKeyPairImpl = nullptr); /// Extracts the RSA public key from the given certificate. KeyPair(const KeyPair& other); @@ -74,7 +74,7 @@ public: /// is not exported. virtual void save(std::ostream* pPublicKeyPairStream, - std::ostream* pPrivateKeyPairStream = 0, + std::ostream* pPrivateKeyPairStream = nullptr, const std::string& privateKeyPairPassphrase = "") const; /// Exports the public and private key to the given streams. /// diff --git a/Crypto/include/Poco/Crypto/KeyPairImpl.h b/Crypto/include/Poco/Crypto/KeyPairImpl.h index 046c31b8b..c90385c90 100644 --- a/Crypto/include/Poco/Crypto/KeyPairImpl.h +++ b/Crypto/include/Poco/Crypto/KeyPairImpl.h @@ -62,7 +62,7 @@ public: /// is not exported. virtual void save(std::ostream* pPublicKeyStream, - std::ostream* pPrivateKeyStream = 0, + std::ostream* pPrivateKeyStream = nullptr, const std::string& privateKeyPassphrase = "") const = 0; /// Exports the public and private key to the given streams. /// diff --git a/Crypto/include/Poco/Crypto/PKCS12Container.h b/Crypto/include/Poco/Crypto/PKCS12Container.h index 9fbef7fdb..186a8ea9e 100644 --- a/Crypto/include/Poco/Crypto/PKCS12Container.h +++ b/Crypto/include/Poco/Crypto/PKCS12Container.h @@ -103,7 +103,7 @@ private: inline bool PKCS12Container::hasX509Certificate() const { - return _pX509Cert.get() != 0; + return _pX509Cert.get() != nullptr; } @@ -135,7 +135,7 @@ inline const PKCS12Container::CANameList& PKCS12Container::getFriendlyNamesCA() inline bool PKCS12Container::hasKey() const { - return _pKey != 0; + return _pKey != nullptr; } diff --git a/Crypto/include/Poco/Crypto/RSAKeyImpl.h b/Crypto/include/Poco/Crypto/RSAKeyImpl.h index f325d958a..692f432bb 100644 --- a/Crypto/include/Poco/Crypto/RSAKeyImpl.h +++ b/Crypto/include/Poco/Crypto/RSAKeyImpl.h @@ -103,7 +103,7 @@ public: /// is not exported. void save(std::ostream* pPublicKeyStream, - std::ostream* pPrivateKeyStream = 0, + std::ostream* pPrivateKeyStream = nullptr, const std::string& privateKeyPassphrase = "") const; /// Exports the public and private key to the given streams. /// @@ -138,4 +138,4 @@ inline const RSA* RSAKeyImpl::getRSA() const } } // namespace Poco::Crypto -#endif // Crypto_RSAKeyImplImpl_INCLUDED \ No newline at end of file +#endif // Crypto_RSAKeyImplImpl_INCLUDED diff --git a/Crypto/src/CipherFactory.cpp b/Crypto/src/CipherFactory.cpp index e01c73472..48bf772b5 100644 --- a/Crypto/src/CipherFactory.cpp +++ b/Crypto/src/CipherFactory.cpp @@ -34,8 +34,8 @@ namespace Crypto { CipherFactory::CipherFactory() { #if OPENSSL_VERSION_NUMBER >= 0x30000000L - OSSL_PROVIDER_load(NULL, "default"); - OSSL_PROVIDER_load(NULL, "legacy"); + OSSL_PROVIDER_load(nullptr, "default"); + OSSL_PROVIDER_load(nullptr, "legacy"); #endif } diff --git a/Crypto/src/CipherImpl.cpp b/Crypto/src/CipherImpl.cpp index b3d77b883..8aa67e4df 100644 --- a/Crypto/src/CipherImpl.cpp +++ b/Crypto/src/CipherImpl.cpp @@ -34,7 +34,7 @@ namespace { if (!msg.empty()) msg.append("; "); - msg.append(ERR_error_string(err, 0)); + msg.append(ERR_error_string(err, nullptr)); } throw Poco::IOException(msg); @@ -103,7 +103,7 @@ namespace _pContext, _pCipher, &_key[0], - _iv.empty() ? 0 : &_iv[0], + _iv.empty() ? nullptr : &_iv[0], (dir == DIR_ENCRYPT) ? 1 : 0); #else int rc = EVP_CipherInit( @@ -119,9 +119,9 @@ namespace if (_iv.size() != EVP_CIPHER_iv_length(_pCipher) && EVP_CIPHER_mode(_pCipher) == EVP_CIPH_GCM_MODE) { #if OPENSSL_VERSION_NUMBER >= 0x10100000L - int rc = EVP_CIPHER_CTX_ctrl(_pContext, EVP_CTRL_GCM_SET_IVLEN, static_cast(_iv.size()), NULL); + int rc = EVP_CIPHER_CTX_ctrl(_pContext, EVP_CTRL_GCM_SET_IVLEN, static_cast(_iv.size()), nullptr); #else - int rc = EVP_CIPHER_CTX_ctrl(&_context, EVP_CTRL_GCM_SET_IVLEN, static_cast(_iv.size()), NULL); + int rc = EVP_CIPHER_CTX_ctrl(&_context, EVP_CTRL_GCM_SET_IVLEN, static_cast(_iv.size()), nullptr); #endif if (rc == 0) throwError(); } diff --git a/Crypto/src/CipherKeyImpl.cpp b/Crypto/src/CipherKeyImpl.cpp index dd72ab71f..130e02c98 100644 --- a/Crypto/src/CipherKeyImpl.cpp +++ b/Crypto/src/CipherKeyImpl.cpp @@ -32,7 +32,7 @@ namespace { if (!msg.empty()) msg.append("; "); - msg.append(ERR_error_string(err, 0)); + msg.append(ERR_error_string(err, nullptr)); } throw Poco::IOException(msg); @@ -49,8 +49,8 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name, const std::string& salt, int iterationCount, const std::string& digest): - _pCipher(0), - _pDigest(0), + _pCipher(nullptr), + _pDigest(nullptr), _name(name), _key(), _iv() @@ -76,8 +76,8 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name, CipherKeyImpl::CipherKeyImpl(const std::string& name, const ByteVec& key, const ByteVec& iv): - _pCipher(0), - _pDigest(0), + _pCipher(nullptr), + _pDigest(nullptr), _name(name), _key(key), _iv(iv) @@ -92,8 +92,8 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name, CipherKeyImpl::CipherKeyImpl(const std::string& name): - _pCipher(0), - _pDigest(0), + _pCipher(nullptr), + _pDigest(nullptr), _name(name), _key(), _iv() @@ -198,7 +198,7 @@ void CipherKeyImpl::generateKey( int keySize = EVP_BytesToKey( _pCipher, _pDigest ? _pDigest : EVP_md5(), - (salt.empty() ? 0 : saltBytes), + (salt.empty() ? nullptr : saltBytes), reinterpret_cast(password.data()), static_cast(password.size()), iterationCount, diff --git a/Crypto/src/CryptoStream.cpp b/Crypto/src/CryptoStream.cpp index 6892c5410..71fc51152 100644 --- a/Crypto/src/CryptoStream.cpp +++ b/Crypto/src/CryptoStream.cpp @@ -36,7 +36,7 @@ CryptoStreamBuf::CryptoStreamBuf(std::istream& istr, CryptoTransform::Ptr pTrans Poco::BufferedStreamBuf(bufferSize, std::ios::in), _pTransform(pTransform), _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _eof(false), _buffer(static_cast(bufferSize)) { @@ -48,7 +48,7 @@ CryptoStreamBuf::CryptoStreamBuf(std::istream& istr, CryptoTransform::Ptr pTrans CryptoStreamBuf::CryptoStreamBuf(std::ostream& ostr, CryptoTransform::Ptr pTransform, std::streamsize bufferSize): Poco::BufferedStreamBuf(bufferSize, std::ios::out), _pTransform(pTransform), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _eof(false), _buffer(static_cast(bufferSize)) @@ -76,7 +76,7 @@ void CryptoStreamBuf::close() if (_pIstr) { - _pIstr = 0; + _pIstr = nullptr; } else if (_pOstr) { @@ -84,7 +84,7 @@ void CryptoStreamBuf::close() // sure that we call finalize() only once, even if an exception is // thrown. std::ostream* pOstr = _pOstr; - _pOstr = 0; + _pOstr = nullptr; // Finalize transformation. std::streamsize n = _pTransform->finalize(_buffer.begin(), static_cast(_buffer.size())); diff --git a/Crypto/src/DigestEngine.cpp b/Crypto/src/DigestEngine.cpp index db5cf6069..83e49c371 100644 --- a/Crypto/src/DigestEngine.cpp +++ b/Crypto/src/DigestEngine.cpp @@ -26,7 +26,7 @@ DigestEngine::DigestEngine(const std::string& name): { const EVP_MD* md = EVP_get_digestbyname(_name.c_str()); if (!md) throw Poco::NotFoundException(_name); - EVP_DigestInit_ex(_pContext, md, NULL); + EVP_DigestInit_ex(_pContext, md, nullptr); } @@ -60,7 +60,7 @@ void DigestEngine::reset() #endif const EVP_MD* md = EVP_get_digestbyname(_name.c_str()); if (!md) throw Poco::NotFoundException(_name); - EVP_DigestInit_ex(_pContext, md, NULL); + EVP_DigestInit_ex(_pContext, md, nullptr); } diff --git a/Crypto/src/ECDSADigestEngine.cpp b/Crypto/src/ECDSADigestEngine.cpp index ac85a9b75..7c38e8002 100644 --- a/Crypto/src/ECDSADigestEngine.cpp +++ b/Crypto/src/ECDSADigestEngine.cpp @@ -114,7 +114,7 @@ ECDSASignature::ECDSASignature(const ByteVec& derSignature) poco_assert (!derSignature.empty()); const unsigned char* p = &derSignature[0]; - _pSig = d2i_ECDSA_SIG(0, &p, static_cast(derSignature.size())); + _pSig = d2i_ECDSA_SIG(nullptr, &p, static_cast(derSignature.size())); if (!_pSig) throw OpenSSLException(); } @@ -131,12 +131,12 @@ ECDSASignature::ECDSASignature(const ByteVec& rawR, const ByteVec& rawS): { #if OPENSSL_VERSION_NUMBER >= 0x10100000L ECDSA_SIG_set0(_pSig, - BN_bin2bn(&rawR[0], static_cast(rawR.size()), 0), - BN_bin2bn(&rawS[0], static_cast(rawS.size()), 0)); - const BIGNUM* pR = 0; - const BIGNUM* pS = 0; + BN_bin2bn(&rawR[0], static_cast(rawR.size()), nullptr), + BN_bin2bn(&rawS[0], static_cast(rawS.size()), nullptr)); + const BIGNUM* pR = nullptr; + const BIGNUM* pS = nullptr; ECDSA_SIG_get0(_pSig, &pR, &pS); - if (pR == 0 || pS == 0) + if (pR == nullptr || pS == nullptr) throw Poco::Crypto::CryptoException("failed to decode R and S values"); #else if (!BN_bin2bn(&rawR[0], rawR.size(), _pSig->r)) @@ -161,7 +161,7 @@ ECDSASignature::~ECDSASignature() ECDSASignature::ByteVec ECDSASignature::toDER() const { - int size = i2d_ECDSA_SIG(_pSig, 0); + int size = i2d_ECDSA_SIG(_pSig, nullptr); if (size > 0) { ByteVec buffer(size); diff --git a/Crypto/src/ECKeyImpl.cpp b/Crypto/src/ECKeyImpl.cpp index e11b134ca..2a89d3694 100644 --- a/Crypto/src/ECKeyImpl.cpp +++ b/Crypto/src/ECKeyImpl.cpp @@ -38,7 +38,7 @@ ECKeyImpl::ECKeyImpl(const EVPPKey& key): ECKeyImpl::ECKeyImpl(const X509Certificate& cert): KeyPairImpl("ec", KT_EC_IMPL), - _pEC(0) + _pEC(nullptr) { const X509* pCert = cert.certificate(); if (pCert) @@ -78,7 +78,7 @@ ECKeyImpl::ECKeyImpl(int curve): ECKeyImpl::ECKeyImpl(const std::string& publicKeyFile, const std::string& privateKeyFile, - const std::string& privateKeyPassphrase): KeyPairImpl("ec", KT_EC_IMPL), _pEC(0) + const std::string& privateKeyPassphrase): KeyPairImpl("ec", KT_EC_IMPL), _pEC(nullptr) { if (EVPPKey::loadKey(&_pEC, PEM_read_PrivateKey, EVP_PKEY_get1_EC_KEY, privateKeyFile, privateKeyPassphrase)) { @@ -101,7 +101,7 @@ ECKeyImpl::ECKeyImpl(const std::string& publicKeyFile, ECKeyImpl::ECKeyImpl(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream, - const std::string& privateKeyPassphrase): KeyPairImpl("ec", KT_EC_IMPL), _pEC(0) + const std::string& privateKeyPassphrase): KeyPairImpl("ec", KT_EC_IMPL), _pEC(nullptr) { if (EVPPKey::loadKey(&_pEC, PEM_read_bio_PrivateKey, EVP_PKEY_get1_EC_KEY, pPrivateKeyStream, privateKeyPassphrase)) { @@ -141,7 +141,7 @@ void ECKeyImpl::freeEC() if (_pEC) { EC_KEY_free(_pEC); - _pEC = 0; + _pEC = nullptr; } } @@ -181,7 +181,7 @@ int ECKeyImpl::groupId() const std::string ECKeyImpl::getCurveName(int nid) { std::string curveName; - size_t len = EC_get_builtin_curves(NULL, 0); + size_t len = EC_get_builtin_curves(nullptr, 0); EC_builtin_curve* pCurves = (EC_builtin_curve*) OPENSSL_malloc(sizeof(EC_builtin_curve) * len); if (!pCurves) return curveName; @@ -206,7 +206,7 @@ std::string ECKeyImpl::getCurveName(int nid) int ECKeyImpl::getCurveNID(std::string& name) { std::string curveName; - size_t len = EC_get_builtin_curves(NULL, 0); + size_t len = EC_get_builtin_curves(nullptr, 0); EC_builtin_curve* pCurves = (EC_builtin_curve*)OPENSSL_malloc(static_cast(sizeof(EC_builtin_curve) * len)); if (!pCurves) return -1; diff --git a/Crypto/src/EVPCipherImpl.cpp b/Crypto/src/EVPCipherImpl.cpp index 76385c53a..64f9110de 100644 --- a/Crypto/src/EVPCipherImpl.cpp +++ b/Crypto/src/EVPCipherImpl.cpp @@ -33,7 +33,7 @@ namespace while ((err = ERR_get_error())) { if (!msg.empty()) msg.append("; "); - msg.append(ERR_error_string(err, 0)); + msg.append(ERR_error_string(err, nullptr)); } throw Poco::IOException(msg); @@ -43,7 +43,7 @@ namespace { public: EVPPKeyContext() = delete; - EVPPKeyContext(const EVP_PKEY* pEVP) : _pCtx(EVP_PKEY_CTX_new(const_cast(pEVP), NULL)) + EVPPKeyContext(const EVP_PKEY* pEVP) : _pCtx(EVP_PKEY_CTX_new(const_cast(pEVP), nullptr)) { if (!_pCtx) { @@ -73,7 +73,7 @@ namespace _pEVP(pEVP), _pCtx(_pEVP), _pos(0), - _pBuf(0) + _pBuf(nullptr) { std::string fmt = "EVPEncryptImpl():%s()"; poco_check_ptr(_pEVP); @@ -82,7 +82,7 @@ namespace throwError(Poco::format(fmt, std::string("EVP_PKEY_CTX_new"))); if (EVP_PKEY_encrypt_init(_pCtx) <= 0) - throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt_init"))); + throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt_init"))); _blockSize = EVP_PKEY_size(const_cast(_pEVP)); if (!_blockSize) @@ -126,7 +126,7 @@ namespace { poco_assert (outputLength >= evpSize); std::size_t outLen; - if (EVP_PKEY_encrypt(_pCtx, NULL, &outLen, _pBuf, static_cast(maxSize)) <= 0) + if (EVP_PKEY_encrypt(_pCtx, nullptr, &outLen, _pBuf, static_cast(maxSize)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt(NULL)"))); if (EVP_PKEY_encrypt(_pCtx, output, &outLen, _pBuf, static_cast(maxSize)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt"))); @@ -156,7 +156,7 @@ namespace std::size_t outLen = 0; if (_pos > 0) { - if (EVP_PKEY_encrypt(_pCtx, NULL, &outLen, _pBuf, static_cast(_pos)) <= 0) + if (EVP_PKEY_encrypt(_pCtx, nullptr, &outLen, _pBuf, static_cast(_pos)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt"))); if (EVP_PKEY_encrypt(_pCtx, output, &outLen, _pBuf, static_cast(_pos)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt"))); @@ -169,7 +169,7 @@ namespace { std::string fmt = "EVPEncryptImpl::maxDataSize():%s()"; std::size_t outLength = 0; - if (EVP_PKEY_encrypt(_pCtx, NULL, &outLength, pIO, length) <= 0) + if (EVP_PKEY_encrypt(_pCtx, nullptr, &outLength, pIO, length) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_encrypt"))); return outLength; } @@ -189,13 +189,13 @@ namespace _pEVP(pEVP), _pCtx(_pEVP), _pos(0), - _pBuf(0) + _pBuf(nullptr) { std::string fmt = "EVPDecryptImpl():%s()"; poco_check_ptr(_pEVP); if (EVP_PKEY_decrypt_init(_pCtx) <= 0) - throwError(Poco::format(fmt, std::string("EVP_PKEY_decrypt_init"))); + throwError(Poco::format(fmt, std::string("EVP_PKEY_decrypt_init"))); _blockSize = EVP_PKEY_size(const_cast(_pEVP)); if (!_blockSize) @@ -237,7 +237,7 @@ namespace if (missing == 0) { std::size_t outLen = 0; - if (EVP_PKEY_decrypt(_pCtx, NULL, &outLen, _pBuf, static_cast(_pos)) <= 0) + if (EVP_PKEY_decrypt(_pCtx, nullptr, &outLen, _pBuf, static_cast(_pos)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_decrypt(NULL)"))); if (EVP_PKEY_decrypt(_pCtx, output, &outLen, _pBuf, static_cast(_pos)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_decrypt"))); @@ -263,7 +263,7 @@ namespace poco_assert (length >= _blockSize); std::string fmt = "EVPDecryptImpl::finalize():%s()"; std::size_t outLen = 0; - if (EVP_PKEY_decrypt(_pCtx, NULL, &outLen, _pBuf, static_cast(_pos)) <= 0) + if (EVP_PKEY_decrypt(_pCtx, nullptr, &outLen, _pBuf, static_cast(_pos)) <= 0) throwError(Poco::format(fmt, std::string("EVP_PKEY_decrypt(NULL)"))); poco_assert (length >= outLen); if (_pos > 0) diff --git a/Crypto/src/EVPPKey.cpp b/Crypto/src/EVPPKey.cpp index f4fb3a2ec..f8d741cb7 100644 --- a/Crypto/src/EVPPKey.cpp +++ b/Crypto/src/EVPPKey.cpp @@ -39,7 +39,7 @@ const std::map EVPPKey::KNOWN_TYPES = }; -EVPPKey::EVPPKey(const std::string& ecCurveName): _pEVPPKey(0) +EVPPKey::EVPPKey(const std::string& ecCurveName) : _pEVPPKey(nullptr) { newECKey(ecCurveName.c_str()); poco_check_ptr(_pEVPPKey); @@ -47,7 +47,7 @@ EVPPKey::EVPPKey(const std::string& ecCurveName): _pEVPPKey(0) } -EVPPKey::EVPPKey(const char* ecCurveName): _pEVPPKey(0) +EVPPKey::EVPPKey(const char* ecCurveName) : _pEVPPKey(nullptr) { newECKey(ecCurveName); poco_check_ptr(_pEVPPKey); @@ -55,8 +55,7 @@ EVPPKey::EVPPKey(const char* ecCurveName): _pEVPPKey(0) } -EVPPKey::EVPPKey(const X509Certificate& cert): - _pEVPPKey(X509_get_pubkey(const_cast(cert.certificate()))) +EVPPKey::EVPPKey(const X509Certificate& cert): _pEVPPKey(X509_get_pubkey(const_cast(cert.certificate()))) { poco_check_ptr(_pEVPPKey); checkType(); @@ -138,7 +137,7 @@ void EVPPKey::setKeyFromParameters(OSSL_PARAM* parameters) throw OpenSSLException("EVPPKey cannot init create key"); } - if (_pEVPPKey != 0) EVP_PKEY_free(_pEVPPKey); + if (_pEVPPKey != nullptr) EVP_PKEY_free(_pEVPPKey); if (EVP_PKEY_fromdata(ctx, &_pEVPPKey, EVP_PKEY_KEYPAIR, parameters) <= 0) { OSSL_PARAM_free(parameters); @@ -150,7 +149,7 @@ void EVPPKey::setKeyFromParameters(OSSL_PARAM* parameters) } -EVPPKey::EVPPKey(const std::vector* public_key, const std::vector* private_key, unsigned long exponent, int type) : _pEVPPKey(0) +EVPPKey::EVPPKey(const std::vector* public_key, const std::vector* private_key, unsigned long exponent, int type) : _pEVPPKey(nullptr) { if ((EVP_PKEY_RSA != type) || (RSA_F4 != exponent)) { @@ -172,13 +171,13 @@ EVPPKey::EVPPKey(const std::vector* public_key, const std::vector } #endif - + #if OPENSSL_VERSION_NUMBER >= 0x10000000L -EVPPKey::EVPPKey(int type, int param): _pEVPPKey(0) +EVPPKey::EVPPKey(int type, int param) : _pEVPPKey(nullptr) { - EVP_PKEY_CTX *pCtx = EVP_PKEY_CTX_new_id(type, NULL); - if (NULL == pCtx) + EVP_PKEY_CTX* pCtx = EVP_PKEY_CTX_new_id(type, nullptr); + if (nullptr == pCtx) { std::string msg = Poco::format( "EVPPKey(%d, %d):EVP_PKEY_CTX_new_id()\n", type, param); @@ -236,7 +235,7 @@ EVPPKey::EVPPKey(int type, int param): _pEVPPKey(0) #endif // OPENSSL_VERSION_NUMBER >= 0x10000000L -EVPPKey::EVPPKey(EVP_PKEY* pEVPPKey): _pEVPPKey(0) +EVPPKey::EVPPKey(EVP_PKEY* pEVPPKey) : _pEVPPKey(nullptr) { duplicate(pEVPPKey, &_pEVPPKey); poco_check_ptr(_pEVPPKey); @@ -244,19 +243,16 @@ EVPPKey::EVPPKey(EVP_PKEY* pEVPPKey): _pEVPPKey(0) } -EVPPKey::EVPPKey(const std::string& publicKeyFile, - const std::string& privateKeyFile, - const std::string& privateKeyPassphrase): _pEVPPKey(0) +EVPPKey::EVPPKey(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase) : _pEVPPKey(nullptr) { - if (loadKey(&_pEVPPKey, PEM_read_PrivateKey, (EVP_PKEY_get_Key_fn)0, privateKeyFile, privateKeyPassphrase)) + if (loadKey(&_pEVPPKey, PEM_read_PrivateKey, (EVP_PKEY_get_Key_fn) nullptr, privateKeyFile, privateKeyPassphrase)) { poco_check_ptr(_pEVPPKey); return; // private key is enough } // no private key, this must be public key only, otherwise throw - if (!loadKey(&_pEVPPKey, PEM_read_PUBKEY, (EVP_PKEY_get_Key_fn)0, publicKeyFile)) - { + if (!loadKey(&_pEVPPKey, PEM_read_PUBKEY, (EVP_PKEY_get_Key_fn) nullptr, publicKeyFile)) { std::string msg = "EVPPKey(const string&, const string&, const string&)\n"; throw OpenSSLException(getError(msg)); } @@ -265,19 +261,16 @@ EVPPKey::EVPPKey(const std::string& publicKeyFile, } -EVPPKey::EVPPKey(std::istream* pPublicKeyStream, - std::istream* pPrivateKeyStream, - const std::string& privateKeyPassphrase): _pEVPPKey(0) +EVPPKey::EVPPKey(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream, const std::string& privateKeyPassphrase) : _pEVPPKey(nullptr) { - if (loadKey(&_pEVPPKey, PEM_read_bio_PrivateKey, (EVP_PKEY_get_Key_fn)0, pPrivateKeyStream, privateKeyPassphrase)) + if (loadKey(&_pEVPPKey, PEM_read_bio_PrivateKey, (EVP_PKEY_get_Key_fn) nullptr, pPrivateKeyStream, privateKeyPassphrase)) { poco_check_ptr(_pEVPPKey); return; // private key is enough } // no private key, this must be public key only, otherwise throw - if (!loadKey(&_pEVPPKey, PEM_read_bio_PUBKEY, (EVP_PKEY_get_Key_fn)0, pPublicKeyStream)) - { + if (!loadKey(&_pEVPPKey, PEM_read_bio_PUBKEY, (EVP_PKEY_get_Key_fn) nullptr, pPublicKeyStream)) { std::string msg = "EVPPKey(istream* ,istream* const string&)\n"; throw OpenSSLException(getError(msg)); } @@ -416,13 +409,13 @@ void EVPPKey::save(const std::string& publicKeyFile, const std::string& privateK int rc = 0; if (privateKeyPassphrase.empty()) { - rc = PEM_write_bio_PrivateKey(bio, _pEVPPKey, 0, 0, 0, 0, 0); + rc = PEM_write_bio_PrivateKey(bio, _pEVPPKey, nullptr, nullptr, 0, nullptr, nullptr); } else { rc = PEM_write_bio_PrivateKey(bio, _pEVPPKey, EVP_des_ede3_cbc(), - reinterpret_cast(const_cast(privateKeyPassphrase.c_str())), - static_cast(privateKeyPassphrase.length()), 0, 0); + reinterpret_cast( const_cast( privateKeyPassphrase.c_str())), + static_cast(privateKeyPassphrase.length()), nullptr, nullptr); } if (!rc) { @@ -483,11 +476,11 @@ void EVPPKey::save(std::ostream* pPublicKeyStream, std::ostream* pPrivateKeyStre } int rc = 0; if (privateKeyPassphrase.empty()) - rc = PEM_write_bio_PrivateKey(bio, _pEVPPKey, 0, 0, 0, 0, 0); + rc = PEM_write_bio_PrivateKey(bio, _pEVPPKey, nullptr, nullptr, 0, nullptr, nullptr); else rc = PEM_write_bio_PrivateKey(bio, _pEVPPKey, EVP_des_ede3_cbc(), - reinterpret_cast(const_cast(privateKeyPassphrase.c_str())), - static_cast(privateKeyPassphrase.length()), 0, 0); + reinterpret_cast( const_cast(privateKeyPassphrase.c_str())), + static_cast(privateKeyPassphrase.length()), nullptr, nullptr); if (!rc) { std::string msg = "EVPPKey::save(ostream*, ostream*, const string&)\n"; diff --git a/Crypto/src/Envelope.cpp b/Crypto/src/Envelope.cpp index 84d96681f..f19a95d78 100644 --- a/Crypto/src/Envelope.cpp +++ b/Crypto/src/Envelope.cpp @@ -65,7 +65,7 @@ void Envelope::addKey(const EVPPKey& key) const Envelope::ByteVec& Envelope::seal(const ByteVec& plainData) { - std::vector pEncKeys(_encKeys.size(), 0); + std::vector pEncKeys(_encKeys.size(), nullptr); std::vector encKeysSizes(_encKeys.size(), 0); int i = 0; for (const auto& k : _encKeys) @@ -92,7 +92,7 @@ const Envelope::ByteVec& Envelope::seal(const ByteVec& plainData) int cipherTextLen = 0, len = 0; int plainDataSize = static_cast(plainData.size()); - _encContent.resize(plainDataSize + blockSize()); + _encContent.resize(plainDataSize + blockSize()); if (1 != EVP_SealUpdate(_pCtx, &_encContent[0], &len, &plainData[0], plainDataSize)) handleErrors(std::string("Envelope::seal():EVP_SealUpdate()")); @@ -153,7 +153,7 @@ void Envelope::handleErrors(std::string&& msg) while ((err = ERR_get_error())) { if (!msg.empty()) msg.append("\n"); - msg.append(ERR_error_string(err, 0)); + msg.append(ERR_error_string(err, nullptr)); } throw CryptoException(msg); } diff --git a/Crypto/src/OpenSSLInitializer.cpp b/Crypto/src/OpenSSLInitializer.cpp index 0c52a0a3d..41ad319b0 100644 --- a/Crypto/src/OpenSSLInitializer.cpp +++ b/Crypto/src/OpenSSLInitializer.cpp @@ -66,8 +66,8 @@ Poco::FastMutex* OpenSSLInitializer::_mutexes(0); #endif #if OPENSSL_VERSION_NUMBER >= 0x30000000L -OSSL_PROVIDER* OpenSSLInitializer::_defaultProvider(0); -OSSL_PROVIDER* OpenSSLInitializer::_legacyProvider(0); +OSSL_PROVIDER* OpenSSLInitializer::_defaultProvider(nullptr); +OSSL_PROVIDER* OpenSSLInitializer::_legacyProvider(nullptr); #endif @@ -95,9 +95,9 @@ void OpenSSLInitializer::initialize() if (++_rc == 1) { #if OPENSSL_VERSION_NUMBER >= 0x10100000L - CONF_modules_load(NULL, NULL, 0); + CONF_modules_load(nullptr, nullptr, 0); #else - OPENSSL_config(NULL); + OPENSSL_config(nullptr); #endif #if OPENSSL_VERSION_NUMBER < 0x10100000L @@ -131,12 +131,12 @@ void OpenSSLInitializer::initialize() #if OPENSSL_VERSION_NUMBER >= 0x30000000L if (!_defaultProvider) { - _defaultProvider = OSSL_PROVIDER_load(NULL, "default"); + _defaultProvider = OSSL_PROVIDER_load(nullptr, "default"); if (!_defaultProvider) throw CryptoException("Failed to load OpenSSL default provider"); } if (!_legacyProvider) { - _legacyProvider = OSSL_PROVIDER_load(NULL, "legacy"); + _legacyProvider = OSSL_PROVIDER_load(nullptr, "legacy"); // Note: use haveLegacyProvider() to check if legacy provider has been loaded } #endif diff --git a/Crypto/src/PKCS12Container.cpp b/Crypto/src/PKCS12Container.cpp index da961550c..b1f797b35 100644 --- a/Crypto/src/PKCS12Container.cpp +++ b/Crypto/src/PKCS12Container.cpp @@ -19,7 +19,6 @@ #include "Poco/Crypto/PKCS12Container.h" -#include "Poco/NumberFormatter.h" #include "Poco/StreamCopier.h" #include #include @@ -29,7 +28,7 @@ namespace Poco { namespace Crypto { -PKCS12Container::PKCS12Container(std::istream& istr, const std::string& password): _pKey(0) +PKCS12Container::PKCS12Container(std::istream& istr, const std::string& password) : _pKey(nullptr) { std::ostringstream ostr; Poco::StreamCopier::copyStream(istr, ostr); @@ -38,7 +37,7 @@ PKCS12Container::PKCS12Container(std::istream& istr, const std::string& password BIO *pBIO = BIO_new_mem_buf(const_cast(cont.data()), static_cast(cont.size())); if (pBIO) { - PKCS12* pPKCS12 = 0; + PKCS12* pPKCS12 = nullptr; d2i_PKCS12_bio(pBIO, &pPKCS12); BIO_free(pBIO); if (!pPKCS12) throw OpenSSLException("PKCS12Container(istream&, const string&)"); @@ -51,12 +50,12 @@ PKCS12Container::PKCS12Container(std::istream& istr, const std::string& password } -PKCS12Container::PKCS12Container(const std::string& path, const std::string& password): _pKey(0) +PKCS12Container::PKCS12Container(const std::string& path, const std::string& password) : _pKey(nullptr) { FILE* pFile = fopen(path.c_str(), "rb"); if (pFile) { - PKCS12* pPKCS12 = d2i_PKCS12_fp(pFile, NULL); + PKCS12* pPKCS12 = d2i_PKCS12_fp(pFile, nullptr); fclose (pFile); if (!pPKCS12) throw OpenSSLException("PKCS12Container(const string&, const string&)"); load(pPKCS12, password); @@ -145,8 +144,8 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password) { if (pPKCS12) { - X509* pCert = 0; - STACK_OF(X509)* pCA = 0; + X509* pCert = nullptr; + STACK_OF(X509)* pCA = nullptr; if (PKCS12_parse(pPKCS12, password.c_str(), &_pKey, &pCert, &pCA)) { if (pCert) diff --git a/Crypto/src/RSACipherImpl.cpp b/Crypto/src/RSACipherImpl.cpp index f04e4a22b..50228ca98 100644 --- a/Crypto/src/RSACipherImpl.cpp +++ b/Crypto/src/RSACipherImpl.cpp @@ -35,7 +35,7 @@ namespace { if (!msg.empty()) msg.append("; "); - msg.append(ERR_error_string(err, 0)); + msg.append(ERR_error_string(err, nullptr)); } throw Poco::IOException(msg); @@ -76,7 +76,7 @@ namespace unsigned char* output, std::streamsize outputLength); - std::streamsize finalize(unsigned char* output, std::streamsize length); + std::streamsize finalize(unsigned char* output, std::streamsize length); private: const RSA* _pRSA; @@ -90,7 +90,7 @@ namespace _pRSA(pRSA), _paddingMode(paddingMode), _pos(0), - _pBuf(0) + _pBuf(nullptr) { _pBuf = new unsigned char[blockSize()]; } @@ -223,11 +223,11 @@ namespace }; - RSADecryptImpl::RSADecryptImpl(const RSA* pRSA, RSAPaddingMode paddingMode): + RSADecryptImpl::RSADecryptImpl(const RSA *pRSA, RSAPaddingMode paddingMode) : _pRSA(pRSA), _paddingMode(paddingMode), _pos(0), - _pBuf(0) + _pBuf(nullptr) { _pBuf = new unsigned char[blockSize()]; } diff --git a/Crypto/src/RSADigestEngine.cpp b/Crypto/src/RSADigestEngine.cpp index 9786eec3f..4d684ec80 100644 --- a/Crypto/src/RSADigestEngine.cpp +++ b/Crypto/src/RSADigestEngine.cpp @@ -74,7 +74,7 @@ const DigestEngine::Digest& RSADigestEngine::signature() if (sigLen < _signature.size()) _signature.resize(sigLen); } - return _signature; + return _signature; } diff --git a/Crypto/src/RSAKeyImpl.cpp b/Crypto/src/RSAKeyImpl.cpp index 58396ccb4..bd9ffc152 100644 --- a/Crypto/src/RSAKeyImpl.cpp +++ b/Crypto/src/RSAKeyImpl.cpp @@ -15,9 +15,7 @@ #include "Poco/Crypto/RSAKeyImpl.h" #include "Poco/Crypto/X509Certificate.h" #include "Poco/Crypto/PKCS12Container.h" -#include "Poco/FileStream.h" #include "Poco/StreamCopier.h" -#include #include #include #include @@ -38,7 +36,7 @@ RSAKeyImpl::RSAKeyImpl(const EVPPKey& key): RSAKeyImpl::RSAKeyImpl(const X509Certificate& cert): KeyPairImpl("rsa", KT_RSA_IMPL), - _pRSA(0) + _pRSA(nullptr) { const X509* pCert = cert.certificate(); EVP_PKEY* pKey = X509_get_pubkey(const_cast(pCert)); @@ -54,24 +52,24 @@ RSAKeyImpl::RSAKeyImpl(const X509Certificate& cert): RSAKeyImpl::RSAKeyImpl(const PKCS12Container& cont): KeyPairImpl("rsa", KT_RSA_IMPL), - _pRSA(0) + _pRSA(nullptr) { EVPPKey key = cont.getKey(); _pRSA = EVP_PKEY_get1_RSA(key); } -RSAKeyImpl::RSAKeyImpl(int keyLength, unsigned long exponent): KeyPairImpl("rsa", KT_RSA_IMPL), - _pRSA(0) +RSAKeyImpl::RSAKeyImpl(int keyLength, unsigned long exponent) : KeyPairImpl("rsa", KT_RSA_IMPL), + _pRSA(nullptr) { _pRSA = RSA_new(); int ret = 0; - BIGNUM* bn = 0; + BIGNUM* bn = nullptr; try { bn = BN_new(); BN_set_word(bn, exponent); - ret = RSA_generate_key_ex(_pRSA, keyLength, bn, 0); + ret = RSA_generate_key_ex(_pRSA, keyLength, bn, nullptr); BN_free(bn); } catch (...) @@ -83,12 +81,11 @@ RSAKeyImpl::RSAKeyImpl(int keyLength, unsigned long exponent): KeyPairImpl("rsa" } -RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile, - const std::string& privateKeyFile, - const std::string& privateKeyPassphrase): KeyPairImpl("rsa", KT_RSA_IMPL), - _pRSA(0) +RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile, const std::string& privateKeyFile, const std::string& privateKeyPassphrase): + KeyPairImpl("rsa", KT_RSA_IMPL), + _pRSA(nullptr) { - poco_assert_dbg(_pRSA == 0); + poco_assert_dbg(_pRSA == nullptr); _pRSA = RSA_new(); if (!publicKeyFile.empty()) @@ -98,14 +95,14 @@ RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile, int rc = BIO_read_filename(bio, publicKeyFile.c_str()); if (rc) { - RSA* pubKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, 0, 0); + RSA* pubKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, nullptr, nullptr); if (!pubKey) { int rc = BIO_reset(bio); // BIO_reset() normally returns 1 for success and 0 or -1 for failure. // File BIOs are an exception, they return 0 for success and -1 for failure. if (rc != 0) throw Poco::FileException("Failed to load public key", publicKeyFile); - pubKey = PEM_read_bio_RSA_PUBKEY(bio, &_pRSA, 0, 0); + pubKey = PEM_read_bio_RSA_PUBKEY(bio, &_pRSA, nullptr, nullptr); } BIO_free(bio); if (!pubKey) @@ -128,11 +125,11 @@ RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile, int rc = BIO_read_filename(bio, privateKeyFile.c_str()); if (rc) { - RSA* privKey = 0; + RSA* privKey = nullptr; if (privateKeyPassphrase.empty()) - privKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, 0, 0); + privKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, nullptr, nullptr); else - privKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, 0, const_cast(privateKeyPassphrase.c_str())); + privKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, nullptr, const_cast( privateKeyPassphrase.c_str())); BIO_free(bio); if (!privKey) { @@ -149,12 +146,11 @@ RSAKeyImpl::RSAKeyImpl(const std::string& publicKeyFile, } -RSAKeyImpl::RSAKeyImpl(std::istream* pPublicKeyStream, - std::istream* pPrivateKeyStream, - const std::string& privateKeyPassphrase): KeyPairImpl("rsa", KT_RSA_IMPL), - _pRSA(0) +RSAKeyImpl::RSAKeyImpl(std::istream* pPublicKeyStream, std::istream* pPrivateKeyStream, const std::string& privateKeyPassphrase): + KeyPairImpl("rsa", KT_RSA_IMPL), + _pRSA(nullptr) { - poco_assert_dbg(_pRSA == 0); + poco_assert_dbg(_pRSA == nullptr); _pRSA = RSA_new(); if (pPublicKeyStream) @@ -163,14 +159,14 @@ RSAKeyImpl::RSAKeyImpl(std::istream* pPublicKeyStream, Poco::StreamCopier::copyToString(*pPublicKeyStream, publicKeyData); BIO* bio = BIO_new_mem_buf(const_cast(publicKeyData.data()), static_cast(publicKeyData.size())); if (!bio) throw Poco::IOException("Cannot create BIO for reading public key"); - RSA* publicKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, 0, 0); + RSA* publicKey = PEM_read_bio_RSAPublicKey(bio, &_pRSA, nullptr, nullptr); if (!publicKey) { int rc = BIO_reset(bio); // BIO_reset() normally returns 1 for success and 0 or -1 for failure. // File BIOs are an exception, they return 0 for success and -1 for failure. if (rc != 1) throw Poco::FileException("Failed to load public key"); - publicKey = PEM_read_bio_RSA_PUBKEY(bio, &_pRSA, 0, 0); + publicKey = PEM_read_bio_RSA_PUBKEY(bio, &_pRSA, nullptr, nullptr); } BIO_free(bio); if (!publicKey) @@ -186,11 +182,11 @@ RSAKeyImpl::RSAKeyImpl(std::istream* pPublicKeyStream, Poco::StreamCopier::copyToString(*pPrivateKeyStream, privateKeyData); BIO* bio = BIO_new_mem_buf(const_cast(privateKeyData.data()), static_cast(privateKeyData.size())); if (!bio) throw Poco::IOException("Cannot create BIO for reading private key"); - RSA* privateKey = 0; + RSA* privateKey = nullptr; if (privateKeyPassphrase.empty()) - privateKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, 0, 0); + privateKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, nullptr, nullptr); else - privateKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, 0, const_cast(privateKeyPassphrase.c_str())); + privateKey = PEM_read_bio_RSAPrivateKey(bio, &_pRSA, nullptr, const_cast(privateKeyPassphrase.c_str())); BIO_free(bio); if (!privateKey) { @@ -210,7 +206,7 @@ RSAKeyImpl::~RSAKeyImpl() void RSAKeyImpl::freeRSA() { if (_pRSA) RSA_free(_pRSA); - _pRSA = 0; + _pRSA = nullptr; } @@ -223,9 +219,9 @@ int RSAKeyImpl::size() const RSAKeyImpl::ByteVec RSAKeyImpl::modulus() const { #if OPENSSL_VERSION_NUMBER >= 0x10100000L - const BIGNUM* n = 0; - const BIGNUM* e = 0; - const BIGNUM* d = 0; + const BIGNUM* n = nullptr; + const BIGNUM* e = nullptr; + const BIGNUM* d = nullptr; RSA_get0_key(_pRSA, &n, &e, &d); return convertToByteVec(n); #else @@ -237,9 +233,9 @@ RSAKeyImpl::ByteVec RSAKeyImpl::modulus() const RSAKeyImpl::ByteVec RSAKeyImpl::encryptionExponent() const { #if OPENSSL_VERSION_NUMBER >= 0x10100000L - const BIGNUM* n = 0; - const BIGNUM* e = 0; - const BIGNUM* d = 0; + const BIGNUM* n = nullptr; + const BIGNUM* e = nullptr; + const BIGNUM* d = nullptr; RSA_get0_key(_pRSA, &n, &e, &d); return convertToByteVec(e); #else @@ -251,9 +247,9 @@ RSAKeyImpl::ByteVec RSAKeyImpl::encryptionExponent() const RSAKeyImpl::ByteVec RSAKeyImpl::decryptionExponent() const { #if OPENSSL_VERSION_NUMBER >= 0x10100000L - const BIGNUM* n = 0; - const BIGNUM* e = 0; - const BIGNUM* d = 0; + const BIGNUM* n = nullptr; + const BIGNUM* e = nullptr; + const BIGNUM* d = nullptr; RSA_get0_key(_pRSA, &n, &e, &d); return convertToByteVec(d); #else @@ -297,11 +293,11 @@ void RSAKeyImpl::save(const std::string& publicKeyFile, { int rc = 0; if (privateKeyPassphrase.empty()) - rc = PEM_write_bio_RSAPrivateKey(bio, _pRSA, 0, 0, 0, 0, 0); + rc = PEM_write_bio_RSAPrivateKey(bio, _pRSA, nullptr, nullptr, 0, nullptr, nullptr); else rc = PEM_write_bio_RSAPrivateKey(bio, _pRSA, EVP_des_ede3_cbc(), - reinterpret_cast(const_cast(privateKeyPassphrase.c_str())), - static_cast(privateKeyPassphrase.length()), 0, 0); + reinterpret_cast( const_cast( privateKeyPassphrase.c_str())), + static_cast(privateKeyPassphrase.length()), nullptr, nullptr); if (!rc) throw Poco::FileException("Failed to write private key to file", privateKeyFile); } else throw Poco::CreateFileException("Cannot create private key file", privateKeyFile); @@ -341,11 +337,12 @@ void RSAKeyImpl::save(std::ostream* pPublicKeyStream, if (!bio) throw Poco::IOException("Cannot create BIO for writing public key"); int rc = 0; if (privateKeyPassphrase.empty()) - rc = PEM_write_bio_RSAPrivateKey(bio, _pRSA, 0, 0, 0, 0, 0); + rc = PEM_write_bio_RSAPrivateKey(bio, _pRSA, nullptr, nullptr, 0, nullptr, nullptr); else - rc = PEM_write_bio_RSAPrivateKey(bio, _pRSA, EVP_des_ede3_cbc(), - reinterpret_cast(const_cast(privateKeyPassphrase.c_str())), - static_cast(privateKeyPassphrase.length()), 0, 0); + rc = PEM_write_bio_RSAPrivateKey(bio, + _pRSA, EVP_des_ede3_cbc(), + reinterpret_cast( const_cast(privateKeyPassphrase.c_str())), + static_cast(privateKeyPassphrase.length()), nullptr, nullptr); if (!rc) { BIO_free(bio); @@ -376,4 +373,4 @@ RSAKeyImpl::ByteVec RSAKeyImpl::convertToByteVec(const BIGNUM* bn) } -} } // namespace Poco::Crypto \ No newline at end of file +} } // namespace Poco::Crypto diff --git a/Crypto/src/X509Certificate.cpp b/Crypto/src/X509Certificate.cpp index d3f3e5377..c246338f3 100644 --- a/Crypto/src/X509Certificate.cpp +++ b/Crypto/src/X509Certificate.cpp @@ -15,7 +15,6 @@ #include "Poco/Crypto/X509Certificate.h" #include "Poco/Crypto/CryptoException.h" #include "Poco/StreamCopier.h" -#include "Poco/String.h" #include "Poco/DateTimeParser.h" #include "Poco/Format.h" #include @@ -41,15 +40,13 @@ namespace Poco { namespace Crypto { -X509Certificate::X509Certificate(std::istream& istr): - _pCert(0) +X509Certificate::X509Certificate(std::istream& istr) : _pCert(nullptr) { load(istr); } -X509Certificate::X509Certificate(const std::string& path): - _pCert(0) +X509Certificate::X509Certificate(const std::string& path) : _pCert(nullptr) { load(path); } @@ -147,7 +144,7 @@ void X509Certificate::load(std::istream& istr) BIO *pBIO = BIO_new_mem_buf(const_cast(cert.data()), static_cast(cert.size())); if (!pBIO) throw Poco::IOException("Cannot create BIO for reading certificate"); - _pCert = PEM_read_bio_X509(pBIO, 0, 0, 0); + _pCert = PEM_read_bio_X509(pBIO, nullptr, nullptr, nullptr); BIO_free(pBIO); if (!_pCert) throw Poco::IOException("Failed to load certificate from stream"); @@ -168,7 +165,7 @@ void X509Certificate::load(const std::string& path) throw Poco::OpenFileException("Cannot open certificate file for reading", path); } - _pCert = PEM_read_bio_X509(pBIO, 0, 0, 0); + _pCert = PEM_read_bio_X509(pBIO, nullptr, nullptr, nullptr); BIO_free(pBIO); if (!_pCert) throw Poco::ReadFileException("Faild to load certificate from", path); @@ -239,7 +236,7 @@ void X509Certificate::init() { _issuerName = _X509_NAME_oneline_utf8(X509_get_issuer_name(_pCert)); _subjectName = _X509_NAME_oneline_utf8(X509_get_subject_name(_pCert)); - BIGNUM* pBN = ASN1_INTEGER_to_BN(X509_get_serialNumber(const_cast(_pCert)), 0); + BIGNUM* pBN = ASN1_INTEGER_to_BN(X509_get_serialNumber(const_cast(_pCert)), nullptr); if (pBN) { char* pSN = BN_bn2hex(pBN); @@ -286,8 +283,7 @@ std::string X509Certificate::subjectName(NID nid) const void X509Certificate::extractNames(std::string& cmnName, std::set& domainNames) const { domainNames.clear(); - if (STACK_OF(GENERAL_NAME)* names = static_cast(X509_get_ext_d2i(_pCert, NID_subject_alt_name, 0, 0))) - { + if (STACK_OF(GENERAL_NAME) *names = static_cast( X509_get_ext_d2i(_pCert, NID_subject_alt_name, nullptr, nullptr))) { for (int i = 0; i < sk_GENERAL_NAME_num(names); ++i) { const GENERAL_NAME* name = sk_GENERAL_NAME_value(names, i); @@ -416,8 +412,9 @@ X509Certificate::List X509Certificate::readPEM(const std::string& pemFileName) { List caCertList; BIO* pBIO = BIO_new_file(pemFileName.c_str(), "r"); - if (pBIO == NULL) throw OpenFileException(Poco::format("X509Certificate::readPEM(%s)", pemFileName)); - X509* x = PEM_read_bio_X509(pBIO, NULL, 0, NULL); + if (pBIO == nullptr) + throw OpenFileException(Poco::format("X509Certificate::readPEM(%s)", pemFileName)); + X509* x = PEM_read_bio_X509(pBIO, nullptr, nullptr, nullptr); if (!x) { BIO_free(pBIO); @@ -426,7 +423,7 @@ X509Certificate::List X509Certificate::readPEM(const std::string& pemFileName) while (x) { caCertList.push_back(X509Certificate(x)); - x = PEM_read_bio_X509(pBIO, NULL, 0, NULL); + x = PEM_read_bio_X509(pBIO, nullptr, nullptr, nullptr); } BIO_free(pBIO); return caCertList; @@ -436,7 +433,7 @@ X509Certificate::List X509Certificate::readPEM(const std::string& pemFileName) void X509Certificate::writePEM(const std::string& pemFileName, const List& list) { BIO* pBIO = BIO_new_file(pemFileName.c_str(), "a"); - if (pBIO == NULL) throw OpenFileException(Poco::format("X509Certificate::writePEM(%s)", pemFileName)); + if (pBIO == nullptr) throw OpenFileException(Poco::format("X509Certificate::writePEM(%s)", pemFileName)); List::const_iterator it = list.begin(); List::const_iterator end = list.end(); for (; it != end; ++it) diff --git a/Crypto/testsuite/src/EVPTest.cpp b/Crypto/testsuite/src/EVPTest.cpp index 7f8b9a960..c739b3ddf 100644 --- a/Crypto/testsuite/src/EVPTest.cpp +++ b/Crypto/testsuite/src/EVPTest.cpp @@ -123,7 +123,7 @@ void EVPTest::testRSAEVPPKey() BIO* bioPriv1 = BIO_new(BIO_s_mem()); BIO* bioPub1 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv1, *pKey, NULL, NULL, 0, 0, NULL)); + assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv1, *pKey, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub1, *pKey)); char* pPrivData1; long sizePriv1 = BIO_get_mem_data(bioPriv1, &pPrivData1); @@ -138,7 +138,7 @@ void EVPTest::testRSAEVPPKey() BIO* bioPriv2 = BIO_new(BIO_s_mem()); BIO* bioPub2 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey, NULL, NULL, 0, 0, NULL)); + assertTrue ( 0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub2, evpPKey)); char* pPrivData2; long sizePriv2 = BIO_get_mem_data(bioPriv2, &pPrivData2); @@ -158,7 +158,7 @@ void EVPTest::testRSAEVPPKey() assertTrue (evpPKey2.type() == EVP_PKEY_RSA); bioPriv2 = BIO_new(BIO_s_mem()); bioPub2 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey2, NULL, NULL, 0, 0, NULL)); + assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey2, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub2, evpPKey2)); sizePriv2 = BIO_get_mem_data(bioPriv2, &pPrivData2); sizePub2 = BIO_get_mem_data(bioPub2, &pPubData2); @@ -176,7 +176,7 @@ void EVPTest::testRSAEVPPKey() assertTrue (evpPKey3.type() == EVP_PKEY_RSA); bioPriv2 = BIO_new(BIO_s_mem()); bioPub2 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey3, NULL, NULL, 0, 0, NULL)); + assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey3, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub2, evpPKey3)); sizePriv2 = BIO_get_mem_data(bioPriv2, &pPrivData2); sizePub2 = BIO_get_mem_data(bioPub2, &pPubData2); @@ -229,7 +229,7 @@ void EVPTest::testRSAEVPSaveLoadStream() assertTrue (strPub2.str() == pubKey); std::istringstream iPriv2(strPriv2.str()); - EVPPKey key3(0, &iPriv2, "testpwd"); + EVPPKey key3(nullptr, &iPriv2, "testpwd"); std::ostringstream strPub3; key3.save(&strPub3); assertTrue (strPub3.str() == pubKey); @@ -261,7 +261,7 @@ void EVPTest::testRSAEVPSaveLoadStreamNoPass() assertTrue (!(key2 == keyNE)); std::istringstream iPriv2(privKey); - EVPPKey key3(0, &iPriv2); + EVPPKey key3(nullptr, &iPriv2); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -277,7 +277,7 @@ void EVPTest::testECEVPPKey() if (!curveName.empty()) { EVPPKey* pKey = new EVPPKey(curveName); - assertTrue (pKey != 0); + assertTrue(pKey != nullptr); assertTrue (!pKey->isSupported(0)); assertTrue (!pKey->isSupported(-1)); assertTrue (pKey->isSupported(pKey->type())); @@ -285,7 +285,7 @@ void EVPTest::testECEVPPKey() BIO* bioPriv1 = BIO_new(BIO_s_mem()); BIO* bioPub1 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv1, *pKey, NULL, NULL, 0, 0, NULL)); + assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv1, *pKey, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub1, *pKey)); char* pPrivData1; long sizePriv1 = BIO_get_mem_data(bioPriv1, &pPrivData1); @@ -300,7 +300,7 @@ void EVPTest::testECEVPPKey() BIO* bioPriv2 = BIO_new(BIO_s_mem()); BIO* bioPub2 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey, NULL, NULL, 0, 0, NULL)); + assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub2, evpPKey)); char* pPrivData2; long sizePriv2 = BIO_get_mem_data(bioPriv2, &pPrivData2); @@ -320,7 +320,7 @@ void EVPTest::testECEVPPKey() assertTrue (evpPKey2.type() == EVP_PKEY_EC); bioPriv2 = BIO_new(BIO_s_mem()); bioPub2 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey2, NULL, NULL, 0, 0, NULL)); + assertTrue (0 != PEM_write_bio_PrivateKey( bioPriv2, evpPKey2, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub2, evpPKey2)); sizePriv2 = BIO_get_mem_data(bioPriv2, &pPrivData2); sizePub2 = BIO_get_mem_data(bioPub2, &pPubData2); @@ -338,7 +338,7 @@ void EVPTest::testECEVPPKey() assertTrue (evpPKey3.type() == EVP_PKEY_EC); bioPriv2 = BIO_new(BIO_s_mem()); bioPub2 = BIO_new(BIO_s_mem()); - assertTrue (0 != PEM_write_bio_PrivateKey(bioPriv2, evpPKey3, NULL, NULL, 0, 0, NULL)); + assertTrue(0 != PEM_write_bio_PrivateKey( bioPriv2, evpPKey3, nullptr, nullptr, 0, nullptr, nullptr)); assertTrue (0 != PEM_write_bio_PUBKEY(bioPub2, evpPKey3)); sizePriv2 = BIO_get_mem_data(bioPriv2, &pPrivData2); sizePub2 = BIO_get_mem_data(bioPub2, &pPubData2); @@ -402,7 +402,7 @@ void EVPTest::testECEVPSaveLoadStream() assertTrue (strPub2.str() == pubKey); std::istringstream iPriv2(strPriv2.str()); - EVPPKey key3(0, &iPriv2, "testpwd"); + EVPPKey key3(nullptr, &iPriv2, "testpwd"); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -458,7 +458,7 @@ void EVPTest::testECEVPSaveLoadStreamNoPass() assertTrue (strPriv2.str() == privKey); std::istringstream iPriv2(privKey); - EVPPKey key3(0, &iPriv2); + EVPPKey key3(nullptr, &iPriv2); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -577,7 +577,7 @@ void EVPTest::testRSAEVPKeyFromX509() X509Certificate cert(str); EVPPKey publicKey(cert); std::istringstream str2(anyPemRSA); - EVPPKey privateKey(0, &str2, "test"); + EVPPKey privateKey(nullptr, &str2, "test"); Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(publicKey); Cipher::Ptr pCipher2 = CipherFactory::defaultFactory().createCipher(privateKey); std::string val("lets do some encryption"); @@ -631,7 +631,7 @@ void EVPTest::testRSAEVPKeyByLength() assertTrue (!(key2 == keyNE)); std::istringstream iPriv2(privKey); - EVPPKey key3(0, &iPriv2); + EVPPKey key3(nullptr, &iPriv2); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -672,7 +672,7 @@ void EVPTest::testECEVPKeyByLength() assertTrue (!(key2 == keyNE)); std::istringstream iPriv2(privKey); - EVPPKey key3(0, &iPriv2); + EVPPKey key3(nullptr, &iPriv2); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -689,10 +689,10 @@ void EVPTest::testEVPKeyByModulus() { std::string e = "AQAB"; std::string n = "ylJgMkU_bDwCLzMlo47igdZ-AC8oUbtGJUOUHnuJdjflpim7FOxw0zXYf9m0tzND0Bt1y7MPyVtf-3rwInvdgi65CZEJ3kt5PE0g6trPbvyW6hJcVeOsQvSErj33mY6RsjndLhNE-RY36G8o603au64lTOYSb9HjzzRFo4F_faEgQ02jpEYkLIWwf7PboExDbd6NGMV0uume8YA6eB3z5BwfMMHyRZA0FcIzj6F0V-hDqBaJkWegpJsukgpfO7JDKaU5rlor7j6CdbfLaWorYTCUH3F-bXZ1ojBe0wHRGEgEZBNa46A3clgNohQuuNzf4K12NFGnEl_TIFRcLm6M0Q"; - try + try { unsigned long exponent = 0; - if ((e == "AQAB") || (e == "AAEAAQ")) + if ((e == "AQAB") || (e == "AAEAAQ")) { exponent = RSA_F4; //Poco::Crypto::RSAKey::Exponent::EXP_LARGE } @@ -715,7 +715,7 @@ void EVPTest::testEVPKeyByModulus() { std::cerr << ex.displayText() << std::endl; throw; - } + } } #endif // OPENSSL_VERSION_NUMBER >= 0x30000000 diff --git a/Crypto/testsuite/src/RSATest.cpp b/Crypto/testsuite/src/RSATest.cpp index e5a978cfa..71a5e0dec 100644 --- a/Crypto/testsuite/src/RSATest.cpp +++ b/Crypto/testsuite/src/RSATest.cpp @@ -101,7 +101,7 @@ void RSATest::testNewKeys() RSAKey key2(&iPub, &iPriv, "testpwd"); std::istringstream iPriv2(privKey); - RSAKey key3(0, &iPriv2, "testpwd"); + RSAKey key3(nullptr, &iPriv2, "testpwd"); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -124,7 +124,7 @@ void RSATest::testNewKeysNoPassphrase() RSAKey key2(&iPub, &iPriv); std::istringstream iPriv2(privKey); - RSAKey key3(0, &iPriv2); + RSAKey key3(nullptr, &iPriv2); std::ostringstream strPub3; key3.save(&strPub3); std::string pubFromPrivate = strPub3.str(); @@ -219,17 +219,17 @@ void RSATest::testRSACipher() strPub.close(); strPriv.close(); - Poco::Crypto::RSAKey encryptKey(pubKeyFile); + Poco::Crypto::RSAKey encryptKey(pubKeyFile); Poco::Crypto::RSAKey decryptKey(pubKeyFile, privKeyFile); - Poco::Crypto::CipherFactory factory; - auto iengine = factory.createCipher(encryptKey); - auto oengine = factory.createCipher(decryptKey); + Poco::Crypto::CipherFactory factory; + auto iengine = factory.createCipher(encryptKey); + auto oengine = factory.createCipher(decryptKey); - std::string ss = "test_str"; - auto enc = iengine->encryptString(ss); - auto dec = oengine->decryptString(enc); - assertEqual (ss, dec); + std::string ss = "test_str"; + auto enc = iengine->encryptString(ss); + auto dec = oengine->decryptString(enc); + assertEqual (ss, dec); delete iengine; delete oengine; @@ -269,7 +269,7 @@ void RSATest::testCertificate() X509Certificate cert(str); RSAKey publicKey(cert); std::istringstream str2(anyPem); - RSAKey privateKey(0, &str2, "test"); + RSAKey privateKey(nullptr, &str2, "test"); Cipher::Ptr pCipher = CipherFactory::defaultFactory().createCipher(publicKey); Cipher::Ptr pCipher2 = CipherFactory::defaultFactory().createCipher(privateKey); std::string val("lets do some encryption"); diff --git a/DNSSD/Avahi/include/Poco/DNSSD/Avahi/AvahiBrowserImpl.h b/DNSSD/Avahi/include/Poco/DNSSD/Avahi/AvahiBrowserImpl.h index 2ab34fe76..266be4ab5 100644 --- a/DNSSD/Avahi/include/Poco/DNSSD/Avahi/AvahiBrowserImpl.h +++ b/DNSSD/Avahi/include/Poco/DNSSD/Avahi/AvahiBrowserImpl.h @@ -58,7 +58,7 @@ public: void onResolveReply(AvahiServiceResolver* resolver, AvahiIfIndex interface, AvahiProtocol protocol, AvahiResolverEvent event, const char* name, const char* type, const char* domain, const char* host, const AvahiAddress* a, uint16_t port, AvahiStringList* txt, AvahiLookupResultFlags flags); void onEnumerateBrowseDomainsReply(AvahiDomainBrowser* browser, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char* domain, AvahiLookupResultFlags flags, bool isDefault); void onEnumerateRegistrationDomainsReply(AvahiDomainBrowser* browser, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char* domain, AvahiLookupResultFlags flags, bool isDefault); - void onQueryRecordReply(AvahiRecordBrowser* browser, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char* name, uint16_t clazz, uint16_t type, const void* data, std::size_t size, AvahiLookupResultFlags flags); + void onQueryRecordReply(AvahiRecordBrowser* browser, AvahiIfIndex interface, AvahiProtocol protocol, AvahiBrowserEvent event, const char* name, uint16_t clazz, uint16_t type, const void* data, std::size_t size, AvahiLookupResultFlags flags); protected: enum HandleTypes diff --git a/DNSSD/Avahi/src/AvahiBrowserImpl.cpp b/DNSSD/Avahi/src/AvahiBrowserImpl.cpp index fd08dddb1..e115ab491 100644 --- a/DNSSD/Avahi/src/AvahiBrowserImpl.cpp +++ b/DNSSD/Avahi/src/AvahiBrowserImpl.cpp @@ -205,7 +205,10 @@ BrowseHandle AvahiBrowserImpl::browse(const std::string& regType, const std::str AvahiResponderImpl::ScopedLock lock(_responder); AvahiIfIndex ifIndex = networkInterface == 0 ? AVAHI_IF_UNSPEC : networkInterface; - AvahiServiceBrowser* browser = avahi_service_browser_new(_responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, regType.c_str(), domain.empty() ? NULL : domain.c_str(), (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onBrowseReply, this); + AvahiServiceBrowser* browser = avahi_service_browser_new( + _responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, regType.c_str(), + domain.empty() ? nullptr : domain.c_str(), (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onBrowseReply, this + ); if (!browser) { int error = avahi_client_errno(_responder._avahiClient); @@ -235,13 +238,19 @@ BrowseHandle AvahiBrowserImpl::enumerateBrowseDomains(Poco::Int32 networkInterfa AvahiResponderImpl::ScopedLock lock(_responder); AvahiIfIndex ifIndex = networkInterface == 0 ? AVAHI_IF_UNSPEC : networkInterface; - AvahiDomainBrowser* browser = avahi_domain_browser_new(_responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateBrowseDomainsReply, this); + AvahiDomainBrowser* browser = avahi_domain_browser_new( + _responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, nullptr, + AVAHI_DOMAIN_BROWSER_BROWSE, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateBrowseDomainsReply, this + ); if (!browser) { int error = avahi_client_errno(_responder._avahiClient); throw Poco::DNSSD::DNSSDException("Failed to enumerate browse domains", AvahiResponderImpl::describeError(error), error); } - AvahiDomainBrowser* defaultBrowser = avahi_domain_browser_new(_responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_BROWSE_DEFAULT, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateDefaultBrowseDomainsReply, this); + AvahiDomainBrowser* defaultBrowser = avahi_domain_browser_new( + _responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, nullptr, + AVAHI_DOMAIN_BROWSER_BROWSE_DEFAULT, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateDefaultBrowseDomainsReply, this + ); if (!defaultBrowser) { int error = avahi_client_errno(_responder._avahiClient); @@ -257,13 +266,19 @@ BrowseHandle AvahiBrowserImpl::enumerateRegistrationDomains(Poco::Int32 networkI AvahiResponderImpl::ScopedLock lock(_responder); AvahiIfIndex ifIndex = networkInterface == 0 ? AVAHI_IF_UNSPEC : networkInterface; - AvahiDomainBrowser* browser = avahi_domain_browser_new(_responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_REGISTER, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateRegistrationDomainsReply, this); + AvahiDomainBrowser* browser = avahi_domain_browser_new( + _responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, nullptr, + AVAHI_DOMAIN_BROWSER_REGISTER, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateRegistrationDomainsReply, this + ); if (!browser) { int error = avahi_client_errno(_responder._avahiClient); throw Poco::DNSSD::DNSSDException("Failed to enumerate registration domains", AvahiResponderImpl::describeError(error), error); } - AvahiDomainBrowser* defaultBrowser = avahi_domain_browser_new(_responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, NULL, AVAHI_DOMAIN_BROWSER_REGISTER_DEFAULT, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateDefaultRegistrationDomainsReply, this); + AvahiDomainBrowser* defaultBrowser = avahi_domain_browser_new( + _responder._avahiClient, ifIndex, AVAHI_PROTO_UNSPEC, nullptr, + AVAHI_DOMAIN_BROWSER_REGISTER_DEFAULT, (AvahiLookupFlags) 0, Poco::DNSSD::Avahi::onEnumerateDefaultRegistrationDomainsReply, this + ); if (!defaultBrowser) { int error = avahi_client_errno(_responder._avahiClient); diff --git a/DNSSD/Avahi/src/AvahiResponderImpl.cpp b/DNSSD/Avahi/src/AvahiResponderImpl.cpp index dfa1249e4..cc3f31936 100644 --- a/DNSSD/Avahi/src/AvahiResponderImpl.cpp +++ b/DNSSD/Avahi/src/AvahiResponderImpl.cpp @@ -66,8 +66,8 @@ extern "C" void onGroupStateChange(AvahiEntryGroup* avahiGroup, AvahiEntryGroupS AvahiResponderImpl::AvahiResponderImpl(Poco::DNSSD::DNSSDResponder& owner): _owner(owner), _browser(*this), - _avahiPoll(0), - _avahiClient(0), + _avahiPoll(nullptr), + _avahiClient(nullptr), _running(false), _nextRecordId(1) { @@ -299,8 +299,8 @@ void AvahiResponderImpl::setupEntryGroup(AvahiEntryGroup* avahiGroup, const Serv } std::string name(service.name()); if (name.empty()) name = avahi_client_get_host_name(_avahiClient); - const char* domain = service.domain().empty() ? 0 : service.domain().c_str(); - const char* host = service.host().empty() ? 0 : service.host().c_str(); + const char* domain = service.domain().empty() ? nullptr : service.domain().c_str(); + const char* host = service.host().empty() ? nullptr : service.host().c_str(); int error = rename ? AVAHI_ERR_COLLISION : avahi_entry_group_add_service_strlst( avahiGroup, @@ -390,7 +390,7 @@ void AvahiResponderImpl::setupEntryGroup(AvahiEntryGroup* avahiGroup, const Serv AvahiStringList* AvahiResponderImpl::createTXTRecord(const Service::Properties& properties) { - AvahiStringList* avahiList = 0; + AvahiStringList* avahiList = nullptr; Service::Properties::ConstIterator itVers = properties.find("txtvers"); Service::Properties::ConstIterator itEnd = properties.end(); std::string entry; @@ -399,7 +399,7 @@ AvahiStringList* AvahiResponderImpl::createTXTRecord(const Service::Properties& std::string entry(itVers->first); entry += '='; entry += itVers->second; - avahiList = avahi_string_list_new(entry.c_str(), NULL); + avahiList = avahi_string_list_new(entry.c_str(), nullptr); } Service::Properties::ConstIterator it = properties.begin(); @@ -409,7 +409,11 @@ AvahiStringList* AvahiResponderImpl::createTXTRecord(const Service::Properties& { if (avahiList) { - avahiList = avahi_string_list_add_pair_arbitrary(avahiList, it->first.c_str(), reinterpret_cast(it->second.empty() ? NULL : it->second.c_str()), it->second.size()); + avahiList = avahi_string_list_add_pair_arbitrary( + avahiList, it->first.c_str(), reinterpret_cast(it->second.empty() ? + nullptr : + it->second.c_str()), it->second.size() + ); } else { @@ -419,7 +423,7 @@ AvahiStringList* AvahiResponderImpl::createTXTRecord(const Service::Properties& entry += '='; entry += it->second; } - avahiList = avahi_string_list_new(entry.c_str(), NULL); + avahiList = avahi_string_list_new(entry.c_str(), nullptr); } } } diff --git a/DNSSD/Bonjour/include/Poco/DNSSD/Bonjour/BonjourBrowserImpl.h b/DNSSD/Bonjour/include/Poco/DNSSD/Bonjour/BonjourBrowserImpl.h index 8acd77d32..40879c485 100644 --- a/DNSSD/Bonjour/include/Poco/DNSSD/Bonjour/BonjourBrowserImpl.h +++ b/DNSSD/Bonjour/include/Poco/DNSSD/Bonjour/BonjourBrowserImpl.h @@ -60,7 +60,7 @@ public: void onResolveReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* fullName, const char* host, uint16_t port, uint16_t txtLen, const unsigned char* txtRecord); void onEnumerateBrowseDomainsReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* replyDomain); void onEnumerateRegistrationDomainsReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* replyDomain); - void onQueryRecordReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* fullName, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void* rdata, uint32_t ttl); + void onQueryRecordReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* fullName, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void* rdata, uint32_t ttl); void onResolveHostReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* hostname, const struct sockaddr* address, uint32_t ttl); protected: diff --git a/DNSSD/Bonjour/src/BonjourBrowserImpl.cpp b/DNSSD/Bonjour/src/BonjourBrowserImpl.cpp index caef4992c..76290ada3 100644 --- a/DNSSD/Bonjour/src/BonjourBrowserImpl.cpp +++ b/DNSSD/Bonjour/src/BonjourBrowserImpl.cpp @@ -77,12 +77,12 @@ extern "C" void DNSSD_API onResolveReply( extern "C" void DNSSD_API onEnumerateBrowseDomainsReply( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char* replyDomain, - void* context) + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char* replyDomain, + void* context) { try { @@ -96,12 +96,12 @@ extern "C" void DNSSD_API onEnumerateBrowseDomainsReply( extern "C" void DNSSD_API onEnumerateRegistrationDomainsReply( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char* replyDomain, - void* context) + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char* replyDomain, + void* context) { try { @@ -115,17 +115,17 @@ extern "C" void DNSSD_API onEnumerateRegistrationDomainsReply( extern "C" void DNSSD_API onQueryRecordReply( - DNSServiceRef sdRef, - DNSServiceFlags flags, - uint32_t interfaceIndex, - DNSServiceErrorType errorCode, - const char* fullName, - uint16_t rrtype, - uint16_t rrclass, - uint16_t rdlen, - const void* rdata, - uint32_t ttl, - void* context) + DNSServiceRef sdRef, + DNSServiceFlags flags, + uint32_t interfaceIndex, + DNSServiceErrorType errorCode, + const char* fullName, + uint16_t rrtype, + uint16_t rrclass, + uint16_t rdlen, + const void* rdata, + uint32_t ttl, + void* context) { try { @@ -174,7 +174,7 @@ BrowseHandle BonjourBrowserImpl::browse(const std::string& regType, const std::s { DNSServiceRef sdRef(nullptr); EventLoop::ScopedLock lock(_eventLoop); - DNSServiceErrorType err = DNSServiceBrowse(&sdRef, 0, networkInterface, regType.c_str(), domain.empty() ? 0 : domain.c_str(), Poco::DNSSD::Bonjour::onBrowseReply, this); + DNSServiceErrorType err = DNSServiceBrowse(&sdRef, 0, networkInterface, regType.c_str(), domain.empty() ? nullptr : domain.c_str(), Poco::DNSSD::Bonjour::onBrowseReply, this); if (err == kDNSServiceErr_NoError) { _eventLoop.add(sdRef); @@ -186,7 +186,7 @@ BrowseHandle BonjourBrowserImpl::browse(const std::string& regType, const std::s BrowseHandle BonjourBrowserImpl::resolve(const Service& service, int options) { - DNSServiceRef sdRef(0); + DNSServiceRef sdRef(nullptr); Poco::Int32 ifIndex = (options & RESOLVE_ON_ALL_INTERFACES) ? 0 : service.networkInterface(); EventLoop::ScopedLock lock(_eventLoop); DNSServiceErrorType err = DNSServiceResolve(&sdRef, 0, ifIndex, service.name().c_str(), service.type().c_str(), service.domain().c_str(), Poco::DNSSD::Bonjour::onResolveReply, this); @@ -202,7 +202,7 @@ BrowseHandle BonjourBrowserImpl::resolve(const Service& service, int options) BrowseHandle BonjourBrowserImpl::enumerateBrowseDomains(Poco::Int32 networkInterface) { - DNSServiceRef sdRef(0); + DNSServiceRef sdRef(nullptr); EventLoop::ScopedLock lock(_eventLoop); DNSServiceErrorType err = DNSServiceEnumerateDomains(&sdRef, kDNSServiceFlagsBrowseDomains, networkInterface, Poco::DNSSD::Bonjour::onEnumerateBrowseDomainsReply, this); if (err == kDNSServiceErr_NoError) @@ -216,7 +216,7 @@ BrowseHandle BonjourBrowserImpl::enumerateBrowseDomains(Poco::Int32 networkInter BrowseHandle BonjourBrowserImpl::enumerateRegistrationDomains(Poco::Int32 networkInterface) { - DNSServiceRef sdRef(0); + DNSServiceRef sdRef(nullptr); EventLoop::ScopedLock lock(_eventLoop); DNSServiceErrorType err = DNSServiceEnumerateDomains(&sdRef, kDNSServiceFlagsRegistrationDomains, networkInterface, Poco::DNSSD::Bonjour::onEnumerateRegistrationDomainsReply, this); if (err == kDNSServiceErr_NoError) @@ -247,7 +247,7 @@ BrowseHandle BonjourBrowserImpl::queryRecord(const std::string& name, Poco::UInt BrowseHandle BonjourBrowserImpl::resolveHost(const std::string& host, int options, Poco::Int32 networkInterface) { - DNSServiceRef sdRef(0); + DNSServiceRef sdRef(nullptr); DNSServiceFlags flags(0); if (options & BROWSE_FORCE_MULTICAST) flags |= kDNSServiceFlagsForceMulticast; EventLoop::ScopedLock lock(_eventLoop); diff --git a/DNSSD/Bonjour/src/BonjourResponderImpl.cpp b/DNSSD/Bonjour/src/BonjourResponderImpl.cpp index 96cd5ddf8..e3d260ca8 100644 --- a/DNSSD/Bonjour/src/BonjourResponderImpl.cpp +++ b/DNSSD/Bonjour/src/BonjourResponderImpl.cpp @@ -27,13 +27,13 @@ namespace Bonjour { extern "C" void DNSSD_API onRegisterServiceReply( - DNSServiceRef sdRef, - DNSServiceFlags flags, - DNSServiceErrorType errorCode, - const char* name, - const char* regtype, - const char* domain, - void *context) + DNSServiceRef sdRef, + DNSServiceFlags flags, + DNSServiceErrorType errorCode, + const char* name, + const char* regtype, + const char* domain, + void *context) { try { @@ -85,7 +85,13 @@ ServiceHandle BonjourResponderImpl::registerService(const Service& service, int if (options & DNSSDResponder::REG_NON_BROWSABLE) flags |= kDNSServiceFlagsNonBrowsable; #endif std::string txtRecord = createTXTRecord(service.properties()); - DNSServiceErrorType err = DNSServiceRegister(&sdRef, flags, intf, service.name().empty() ? 0 : service.name().c_str(), service.type().c_str(), service.domain().empty() ? 0 : service.domain().c_str(), service.host().empty() ? 0 : service.host().c_str(), Poco::ByteOrder::toNetwork(service.port()), txtRecord.size(), txtRecord.empty() ? 0 : txtRecord.data(), Poco::DNSSD::Bonjour::onRegisterServiceReply, this); + DNSServiceErrorType err = DNSServiceRegister( + &sdRef, flags, intf, + service.name().empty() ? nullptr : service.name().c_str(), + service.type().c_str(), service.domain().empty() ? nullptr : service.domain().c_str(), + service.host().empty() ? nullptr : service.host().c_str(), + Poco::ByteOrder::toNetwork(service.port()), txtRecord.size(), txtRecord.empty() ? nullptr : txtRecord.data(), + Poco::DNSSD::Bonjour::onRegisterServiceReply, this); if (err == kDNSServiceErr_NoError) { _eventLoop.add(sdRef); @@ -105,7 +111,7 @@ void BonjourResponderImpl::unregisterService(ServiceHandle& serviceHandle) RecordHandle BonjourResponderImpl::addRecord(ServiceHandle serviceHandle, const Record& record) { - DNSRecordRef recRef(0); + DNSRecordRef recRef(nullptr); EventLoop::ScopedLock lock(_eventLoop); DNSServiceErrorType err = DNSServiceAddRecord(serviceHandle.cast(), &recRef, 0, record.type(), record.length(), record.data(), record.ttl()); if (err == kDNSServiceErr_NoError) @@ -119,7 +125,9 @@ RecordHandle BonjourResponderImpl::addRecord(ServiceHandle serviceHandle, const void BonjourResponderImpl::updateRecord(ServiceHandle serviceHandle, RecordHandle recordHandle, const Record& record) { EventLoop::ScopedLock lock(_eventLoop); - DNSServiceErrorType err = DNSServiceUpdateRecord(serviceHandle.cast(), recordHandle.cast(), 0, record.length(), record.data(), record.ttl()); + DNSServiceErrorType err = DNSServiceUpdateRecord( + serviceHandle.cast(), recordHandle.cast(), 0, + record.length(), record.data(), record.ttl()); if (err != kDNSServiceErr_NoError) { throw Poco::DNSSD::DNSSDException("Failed to update record " + record.name(), describeError(err), err); @@ -164,67 +172,67 @@ const char* BonjourResponderImpl::describeError(int code) { switch (code) { - case kDNSServiceErr_Unknown: - return "Unknown"; - case kDNSServiceErr_NoSuchName: - return "No such name"; - case kDNSServiceErr_NoMemory: - return "No memory"; - case kDNSServiceErr_BadParam: - return "Bad parameter"; - case kDNSServiceErr_BadReference: - return "Bad reference"; - case kDNSServiceErr_BadState: - return "Bad state"; - case kDNSServiceErr_BadFlags: - return "Bad flags"; - case kDNSServiceErr_Unsupported: - return "Unsupported"; - case kDNSServiceErr_NotInitialized: - return "Not initialized"; - case kDNSServiceErr_AlreadyRegistered: - return "Already registered"; - case kDNSServiceErr_NameConflict: - return "Name conflict"; - case kDNSServiceErr_Invalid: - return "Invalid"; - case kDNSServiceErr_Firewall: - return "Firewall"; - case kDNSServiceErr_Incompatible: - return "Client library incompatible with daemon"; - case kDNSServiceErr_BadInterfaceIndex: - return "Bad interface index"; - case kDNSServiceErr_Refused: - return "Refused"; - case kDNSServiceErr_NoSuchRecord: - return "No such record"; - case kDNSServiceErr_NoAuth: - return "No auth"; - case kDNSServiceErr_NoSuchKey: - return "No such key"; - case kDNSServiceErr_NATTraversal: - return "NAT traversal"; - case kDNSServiceErr_DoubleNAT: - return "Double NAT"; - case kDNSServiceErr_BadTime: - return "Bad time"; - case kDNSServiceErr_BadSig: - return "Bad signature"; - case kDNSServiceErr_BadKey: - return "Bad key"; - case kDNSServiceErr_Transient: - return "Transient error"; - case kDNSServiceErr_ServiceNotRunning: - return "Service not running"; - case kDNSServiceErr_NATPortMappingUnsupported: - return "NAT port mapping not supported"; - case kDNSServiceErr_NATPortMappingDisabled: - return "NAT port mapping disabled"; + case kDNSServiceErr_Unknown: + return "Unknown"; + case kDNSServiceErr_NoSuchName: + return "No such name"; + case kDNSServiceErr_NoMemory: + return "No memory"; + case kDNSServiceErr_BadParam: + return "Bad parameter"; + case kDNSServiceErr_BadReference: + return "Bad reference"; + case kDNSServiceErr_BadState: + return "Bad state"; + case kDNSServiceErr_BadFlags: + return "Bad flags"; + case kDNSServiceErr_Unsupported: + return "Unsupported"; + case kDNSServiceErr_NotInitialized: + return "Not initialized"; + case kDNSServiceErr_AlreadyRegistered: + return "Already registered"; + case kDNSServiceErr_NameConflict: + return "Name conflict"; + case kDNSServiceErr_Invalid: + return "Invalid"; + case kDNSServiceErr_Firewall: + return "Firewall"; + case kDNSServiceErr_Incompatible: + return "Client library incompatible with daemon"; + case kDNSServiceErr_BadInterfaceIndex: + return "Bad interface index"; + case kDNSServiceErr_Refused: + return "Refused"; + case kDNSServiceErr_NoSuchRecord: + return "No such record"; + case kDNSServiceErr_NoAuth: + return "No auth"; + case kDNSServiceErr_NoSuchKey: + return "No such key"; + case kDNSServiceErr_NATTraversal: + return "NAT traversal"; + case kDNSServiceErr_DoubleNAT: + return "Double NAT"; + case kDNSServiceErr_BadTime: + return "Bad time"; + case kDNSServiceErr_BadSig: + return "Bad signature"; + case kDNSServiceErr_BadKey: + return "Bad key"; + case kDNSServiceErr_Transient: + return "Transient error"; + case kDNSServiceErr_ServiceNotRunning: + return "Service not running"; + case kDNSServiceErr_NATPortMappingUnsupported: + return "NAT port mapping not supported"; + case kDNSServiceErr_NATPortMappingDisabled: + return "NAT port mapping disabled"; #if _DNS_SD_H+0 >= 2580000 - case kDNSServiceErr_NoRouter: - return "No router"; - case kDNSServiceErr_PollingMode: - return "Polling mode"; + case kDNSServiceErr_NoRouter: + return "No router"; + case kDNSServiceErr_PollingMode: + return "Polling mode"; #endif default: return "Error"; @@ -268,7 +276,7 @@ std::string BonjourResponderImpl::createTXTRecord(const Service::Properties& pro if (itVers != itEnd) { Poco::UInt8 valueSize = static_cast(itVers->second.size()); - TXTRecordSetValue(&ref, itVers->first.c_str(), valueSize, valueSize == 0 ? 0 : itVers->second.c_str()); + TXTRecordSetValue(&ref, itVers->first.c_str(), valueSize, valueSize == 0 ? nullptr : itVers->second.c_str()); } it = properties.begin(); @@ -277,7 +285,7 @@ std::string BonjourResponderImpl::createTXTRecord(const Service::Properties& pro if (it != itVers) { Poco::UInt8 valueSize = static_cast(it->second.size()); - TXTRecordSetValue(&ref, it->first.c_str(), valueSize, valueSize == 0 ? 0 : it->second.c_str()); + TXTRecordSetValue(&ref, it->first.c_str(), valueSize, valueSize == 0 ? nullptr : it->second.c_str()); } } const void* txtRecord = TXTRecordGetBytesPtr(&ref); @@ -290,12 +298,12 @@ std::string BonjourResponderImpl::createTXTRecord(const Service::Properties& pro void BonjourResponderImpl::onRegisterServiceReply( - DNSServiceRef sdRef, - DNSServiceFlags flags, - DNSServiceErrorType errorCode, - const char* name, - const char* regtype, - const char* domain) + DNSServiceRef sdRef, + DNSServiceFlags flags, + DNSServiceErrorType errorCode, + const char* name, + const char* regtype, + const char* domain) { if (errorCode == kDNSServiceErr_NoError) { diff --git a/DNSSD/samples/HTTPTimeServer/src/HTTPTimeServer.cpp b/DNSSD/samples/HTTPTimeServer/src/HTTPTimeServer.cpp index 9f9e9264f..dd7e10918 100644 --- a/DNSSD/samples/HTTPTimeServer/src/HTTPTimeServer.cpp +++ b/DNSSD/samples/HTTPTimeServer/src/HTTPTimeServer.cpp @@ -108,7 +108,7 @@ public: if (request.getURI() == "/") return new TimeRequestHandler(_format); else - return 0; + return nullptr; } private: diff --git a/DNSSD/src/DNSSDResponder.cpp b/DNSSD/src/DNSSDResponder.cpp index df0c1741c..4c5aadca8 100644 --- a/DNSSD/src/DNSSDResponder.cpp +++ b/DNSSD/src/DNSSDResponder.cpp @@ -23,11 +23,11 @@ namespace Poco { namespace DNSSD { -DNSSDResponderImplFactory* DNSSDResponder::_pImplFactory(0); +DNSSDResponderImplFactory* DNSSDResponder::_pImplFactory(nullptr); DNSSDResponder::DNSSDResponder(): - _pImpl(0) + _pImpl(nullptr) { if (_pImplFactory) { @@ -102,7 +102,7 @@ void DNSSDResponder::registerImplFactory(DNSSDResponderImplFactory& factory) void DNSSDResponder::unregisterImplFactory() { - _pImplFactory = 0; + _pImplFactory = nullptr; } diff --git a/DNSSD/src/Record.cpp b/DNSSD/src/Record.cpp index c09742bb8..c4432bf4b 100644 --- a/DNSSD/src/Record.cpp +++ b/DNSSD/src/Record.cpp @@ -26,7 +26,7 @@ Record::Record(): _type(0), _clazz(0), _length(0), - _data(0), + _data(nullptr), _ttl(0) { } diff --git a/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h b/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h index ebfb73e9c..9cd456334 100644 --- a/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h +++ b/Data/MySQL/include/Poco/Data/MySQL/SessionHandle.h @@ -37,7 +37,7 @@ public: ~SessionHandle(); /// Destroy handle, close connection - void init(MYSQL* mysql = 0); + void init(MYSQL* mysql = nullptr); /// Initializes the handle iff not initialized. void options(mysql_option opt); diff --git a/Data/MySQL/src/Binder.cpp b/Data/MySQL/src/Binder.cpp index 9bb19ee9d..66b189073 100644 --- a/Data/MySQL/src/Binder.cpp +++ b/Data/MySQL/src/Binder.cpp @@ -30,7 +30,7 @@ Binder::~Binder() for (std::vector::iterator it = _dates.begin(); it != _dates.end(); ++it) { delete *it; - *it = 0; + *it = nullptr; } } @@ -220,7 +220,7 @@ void Binder::bind(std::size_t pos, const UUID& val, Direction dir) void Binder::bind(std::size_t pos, const NullData&, Direction dir) { poco_assert(dir == PD_IN); - realBind(pos, MYSQL_TYPE_NULL, 0, 0); + realBind(pos, MYSQL_TYPE_NULL, nullptr, 0); } @@ -234,7 +234,7 @@ MYSQL_BIND* Binder::getBindArray() const { if (_bindArray.size() == 0) { - return 0; + return nullptr; } return const_cast(&_bindArray[0]); @@ -286,7 +286,7 @@ void Binder::realBind(std::size_t pos, enum_field_types type, const void* buffer std::memset(&_bindArray[s], 0, sizeof(MYSQL_BIND) * (_bindArray.size() - s)); } - MYSQL_BIND b = {0}; + MYSQL_BIND b = {nullptr}; b.buffer_type = type; b.buffer = const_cast(buffer); diff --git a/Data/MySQL/src/Connector.cpp b/Data/MySQL/src/Connector.cpp index b30e991a5..286a8d705 100644 --- a/Data/MySQL/src/Connector.cpp +++ b/Data/MySQL/src/Connector.cpp @@ -52,7 +52,7 @@ Poco::AutoPtr Connector::createSession(const std::strin void Connector::registerConnector() { - if (mysql_library_init(0, 0, 0) != 0) + if (mysql_library_init(0, nullptr, nullptr) != 0) { throw Exception("mysql_library_init error"); } diff --git a/Data/MySQL/src/Extractor.cpp b/Data/MySQL/src/Extractor.cpp index 6d4ba0764..b31dffe33 100644 --- a/Data/MySQL/src/Extractor.cpp +++ b/Data/MySQL/src/Extractor.cpp @@ -265,7 +265,7 @@ void Extractor::reset() bool Extractor::realExtractFixed(std::size_t pos, enum_field_types type, void* buffer, bool isUnsigned) { - MYSQL_BIND bind = {0}; + MYSQL_BIND bind = {nullptr}; my_bool isNull = 0; bind.is_null = &isNull; diff --git a/Data/MySQL/src/MySQLException.cpp b/Data/MySQL/src/MySQLException.cpp index a66b83577..c5af6d009 100644 --- a/Data/MySQL/src/MySQLException.cpp +++ b/Data/MySQL/src/MySQLException.cpp @@ -116,7 +116,7 @@ std::string StatementException::compose(const std::string& text, MYSQL_STMT* h, str += "[Comment]: "; str += text; - if (h != 0) + if (h != nullptr) { str += "\t[mysql_stmt_error]: "; str += mysql_stmt_error(h); diff --git a/Data/MySQL/src/SessionHandle.cpp b/Data/MySQL/src/SessionHandle.cpp index 6a167a131..e327c375b 100644 --- a/Data/MySQL/src/SessionHandle.cpp +++ b/Data/MySQL/src/SessionHandle.cpp @@ -67,7 +67,7 @@ private: #endif -SessionHandle::SessionHandle(MYSQL* mysql): _pHandle(0) +SessionHandle::SessionHandle(MYSQL* mysql): _pHandle(nullptr) { init(mysql); #ifdef POCO_OS_FAMILY_UNIX @@ -95,7 +95,7 @@ SessionHandle::~SessionHandle() void SessionHandle::options(mysql_option opt) { - if (mysql_options(_pHandle, opt, 0) != 0) + if (mysql_options(_pHandle, opt, nullptr) != 0) throw ConnectionException("mysql_options error", _pHandle); } @@ -130,7 +130,7 @@ void SessionHandle::options(mysql_option opt, unsigned int i) void SessionHandle::connect(const char* host, const char* user, const char* password, const char* db, unsigned int port) { #ifdef HAVE_MYSQL_REAL_CONNECT - if (!mysql_real_connect(_pHandle, host, user, password, db, port, 0, 0)) + if (!mysql_real_connect(_pHandle, host, user, password, db, port, nullptr, 0)) throw ConnectionFailedException(mysql_error(_pHandle)); #else if (!mysql_connect(_pHandle, host, user, password)) @@ -144,7 +144,7 @@ void SessionHandle::close() if (_pHandle) { mysql_close(_pHandle); - _pHandle = 0; + _pHandle = nullptr; } } diff --git a/Data/MySQL/src/SessionImpl.cpp b/Data/MySQL/src/SessionImpl.cpp index c9051144f..64802320b 100644 --- a/Data/MySQL/src/SessionImpl.cpp +++ b/Data/MySQL/src/SessionImpl.cpp @@ -48,7 +48,7 @@ const std::string SessionImpl::MYSQL_SERIALIZABLE = "SERIALIZABLE"; SessionImpl::SessionImpl(const std::string& connectionString, std::size_t loginTimeout) : Poco::Data::AbstractSessionImpl(connectionString, loginTimeout), _connector("MySQL"), - _handle(0), + _handle(nullptr), _reset(false), _connected(false), _inTransaction(false), @@ -120,7 +120,7 @@ void SessionImpl::open(const std::string& connect) if (options["user"].empty()) throw MySQLException("create session: specify user name"); - const char * db = NULL; + const char * db = nullptr; if (!options["db"].empty()) db = options["db"].c_str(); diff --git a/Data/MySQL/src/StatementExecutor.cpp b/Data/MySQL/src/StatementExecutor.cpp index 28d7b2f4d..954e61574 100644 --- a/Data/MySQL/src/StatementExecutor.cpp +++ b/Data/MySQL/src/StatementExecutor.cpp @@ -76,7 +76,7 @@ void StatementExecutor::bindParams(MYSQL_BIND* params, std::size_t count) throw StatementException("Statement is not compiled yet"); if (count != mysql_stmt_param_count(_pHandle)) - throw StatementException("wrong bind parameters count", 0, _query); + throw StatementException("wrong bind parameters count", nullptr, _query); if (count == 0) return; diff --git a/Data/MySQL/testsuite/src/MySQLTest.cpp b/Data/MySQL/testsuite/src/MySQLTest.cpp index 3ba3b153d..f32c0b766 100644 --- a/Data/MySQL/testsuite/src/MySQLTest.cpp +++ b/Data/MySQL/testsuite/src/MySQLTest.cpp @@ -37,8 +37,8 @@ using Poco::Nullable; using Poco::Tuple; using Poco::NamedTuple; -Poco::SharedPtr MySQLTest::_pSession = 0; -Poco::SharedPtr MySQLTest::_pExecutor = 0; +Poco::SharedPtr MySQLTest::_pSession = nullptr; +Poco::SharedPtr MySQLTest::_pExecutor = nullptr; // // Parameters for barebone-test @@ -936,7 +936,7 @@ CppUnit::Test* MySQLTest::suite() catch (ConnectionFailedException& ex) { std::cout << ex.displayText() << std::endl; - return 0; + return nullptr; } } diff --git a/Data/MySQL/testsuite/src/SQLExecutor.cpp b/Data/MySQL/testsuite/src/SQLExecutor.cpp index 9d5f0a3ac..b13ad48ed 100644 --- a/Data/MySQL/testsuite/src/SQLExecutor.cpp +++ b/Data/MySQL/testsuite/src/SQLExecutor.cpp @@ -158,14 +158,14 @@ SQLExecutor::~SQLExecutor() void SQLExecutor::bareboneMySQLTest(const char* host, const char* user, const char* pwd, const char* db, int port, const char* tableCreateString) { int rc; - MYSQL* hsession = mysql_init(0); - assertTrue (hsession != 0); + MYSQL* hsession = mysql_init(nullptr); + assertTrue (hsession != nullptr); - MYSQL* tmp = mysql_real_connect(hsession, host, user, pwd, db, port, 0, 0); + MYSQL* tmp = mysql_real_connect(hsession, host, user, pwd, db, port, nullptr, 0); assertTrue (tmp == hsession); MYSQL_STMT* hstmt = mysql_stmt_init(hsession); - assertTrue (hstmt != 0); + assertTrue (hstmt != nullptr); std::string sql = "DROP TABLE Test"; mysql_real_query(hsession, sql.c_str(), static_cast(sql.length())); @@ -185,7 +185,7 @@ void SQLExecutor::bareboneMySQLTest(const char* host, const char* user, const ch int fourth = 4; float fifth = 1.5; - MYSQL_BIND bind_param[5] = {{0}}; + MYSQL_BIND bind_param[5] = {{nullptr}}; bind_param[0].buffer = const_cast(str[0].c_str()); bind_param[0].buffer_length = static_cast(str[0].length()); @@ -225,7 +225,7 @@ void SQLExecutor::bareboneMySQLTest(const char* host, const char* user, const ch fourth = 0; fifth = 0.0f; - MYSQL_BIND bind_result[5] = {{0}}; + MYSQL_BIND bind_result[5] = {{nullptr}}; bind_result[0].buffer = chr[0]; bind_result[0].buffer_length = sizeof(chr[0]); diff --git a/Data/ODBC/include/Poco/Data/ODBC/Binder.h b/Data/ODBC/include/Poco/Data/ODBC/Binder.h index 9e7e12292..63552d773 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Binder.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Binder.h @@ -71,7 +71,7 @@ public: Binder(const StatementHandle& rStmt, std::size_t maxFieldSize, ParameterBinding dataBinding = PB_IMMEDIATE, - const TypeInfo* pDataTypes = 0, + const TypeInfo* pDataTypes = nullptr, Poco::TextEncoding::Ptr pFromEncoding = nullptr, Poco::TextEncoding::Ptr pDBEncoding = nullptr); /// Creates the Binder. @@ -427,7 +427,7 @@ private: getColSizeAndPrecision(pos, cDataType, colSize, decDigits); - _lengthIndicator.push_back(0); + _lengthIndicator.push_back(nullptr); if (Utility::isError(SQLBindParameter(_rStmt, (SQLUSMALLINT) pos + 1, @@ -436,7 +436,7 @@ private: Utility::sqlDataType(cDataType), colSize, decDigits, - (SQLPOINTER) &val, 0, 0))) + (SQLPOINTER) &val, 0, nullptr))) { throw StatementException(_rStmt, "ODBC::Binder::SQLBindParameter()"); } @@ -492,7 +492,7 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length); } @@ -544,7 +544,7 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length); } @@ -582,7 +582,7 @@ private: if (PB_IMMEDIATE != _paramBinding) throw InvalidAccessException("Containers can only be bound immediately."); - const C* pVal = 0; + const C* pVal = nullptr; if (!transcodeRequired()) pVal = &valC; else { @@ -614,12 +614,12 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1, SQL_NTS); } if (_charPtrs.size() <= pos) - _charPtrs.resize(pos + 1, 0); + _charPtrs.resize(pos + 1, nullptr); _charPtrs[pos] = (char*) std::calloc(pVal->size() * size, sizeof(char)); @@ -685,12 +685,12 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1, SQL_NTS); } if (_utf16CharPtrs.size() <= pos) - _utf16CharPtrs.resize(pos + 1, 0); + _utf16CharPtrs.resize(pos + 1, nullptr); _utf16CharPtrs[pos] = (UTF16Char*)std::calloc(val.size() * size, sizeof(UTF16Char)); @@ -745,7 +745,7 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1); } @@ -760,7 +760,7 @@ private: } if (_charPtrs.size() <= pos) - _charPtrs.resize(pos + 1, 0); + _charPtrs.resize(pos + 1, nullptr); _charPtrs[pos] = (char*) std::calloc(val.size() * size, sizeof(CharType)); poco_check_ptr (_charPtrs[pos]); @@ -811,13 +811,13 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1); } if (_dateVecVec.size() <= pos) { - _dateVecVec.resize(pos + 1, 0); + _dateVecVec.resize(pos + 1, nullptr); _dateVecVec[pos] = new DateVec(length ? length : 1); } @@ -859,13 +859,13 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1); } if (_timeVecVec.size() <= pos) { - _timeVecVec.resize(pos + 1, 0); + _timeVecVec.resize(pos + 1, nullptr); _timeVecVec[pos] = new TimeVec(length ? length : 1); } @@ -908,13 +908,13 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1); } if (_dateTimeVecVec.size() <= pos) { - _dateTimeVecVec.resize(pos + 1, 0); + _dateTimeVecVec.resize(pos + 1, nullptr); _dateTimeVecVec[pos] = new DateTimeVec(length ? length : 1); } @@ -958,12 +958,12 @@ private: SQLINTEGER size = 16; // UUID is fixed 16 bytes if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length ? length : 1, size); } if (_charPtrs.size() <= pos) - _charPtrs.resize(pos + 1, 0); + _charPtrs.resize(pos + 1, nullptr); _charPtrs[pos] = (char*)std::calloc(val.size() * size, sizeof(char)); std::size_t offset = 0; @@ -1015,7 +1015,7 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length, SQL_NULL_DATA); } @@ -1030,7 +1030,7 @@ private: TypeInfo::sqlDataType(), colSize, decDigits, - 0, + nullptr, 0, &(*_vecLengthIndicator[pos])[0]))) { @@ -1057,7 +1057,7 @@ private: if (_vecLengthIndicator.size() <= pos) { - _vecLengthIndicator.resize(pos + 1, 0); + _vecLengthIndicator.resize(pos + 1, nullptr); _vecLengthIndicator[pos] = new LengthVec(length, SQL_NULL_DATA); auto valIt = val.begin(), valEnd = val.end(); auto lenIt = _vecLengthIndicator[pos]->begin(), lenEnd = _vecLengthIndicator[pos]->end(); @@ -1080,7 +1080,7 @@ private: TypeInfo::sqlDataType(), colSize, decDigits, - 0, + nullptr, 0, &(*_vecLengthIndicator[pos])[0]))) { diff --git a/Data/ODBC/include/Poco/Data/ODBC/Handle.h b/Data/ODBC/include/Poco/Data/ODBC/Handle.h index 740d76a20..e607fa32c 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Handle.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Handle.h @@ -41,7 +41,7 @@ class Handle public: Handle(const ConnectionHandle& rConnection): _rConnection(rConnection), - _handle(0) + _handle(nullptr) /// Creates the Handle. { if (Utility::isError(SQLAllocHandle(handleType, diff --git a/Data/ODBC/include/Poco/Data/ODBC/Parameter.h b/Data/ODBC/include/Poco/Data/ODBC/Parameter.h index 6afc4fec1..5f681c67e 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Parameter.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Parameter.h @@ -63,9 +63,9 @@ private: void init(); SQLSMALLINT _dataType; - SQLULEN _columnSize; - SQLSMALLINT _decimalDigits; - SQLSMALLINT _isNullable; + SQLULEN _columnSize; + SQLSMALLINT _decimalDigits; + SQLSMALLINT _isNullable; const StatementHandle& _rStmt; std::size_t _number; diff --git a/Data/ODBC/include/Poco/Data/ODBC/Preparator.h b/Data/ODBC/include/Poco/Data/ODBC/Preparator.h index 92acf7a81..7030ab0bd 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/Preparator.h +++ b/Data/ODBC/include/Poco/Data/ODBC/Preparator.h @@ -428,7 +428,7 @@ private: Preparator& operator = (const Preparator&); template - void prepareImpl(std::size_t pos, const C* pVal = 0) + void prepareImpl(std::size_t pos, const C* pVal = nullptr) /// Utility function to prepare Any and Dynamic::Var. { ODBCMetaColumn col(_rStmt, pos); diff --git a/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h b/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h index 8eff5070a..11c8131a3 100644 --- a/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h +++ b/Data/ODBC/include/Poco/Data/ODBC/TypeInfo.h @@ -70,7 +70,7 @@ public: SQLSMALLINT> TypeInfoTup; typedef std::vector TypeInfoVec; - explicit TypeInfo(SQLHDBC* pHDBC=0); + explicit TypeInfo(SQLHDBC* pHDBC=nullptr); /// Creates the TypeInfo. ~TypeInfo(); diff --git a/Data/ODBC/src/Binder.cpp b/Data/ODBC/src/Binder.cpp index c168dfe0b..5ffba609d 100644 --- a/Data/ODBC/src/Binder.cpp +++ b/Data/ODBC/src/Binder.cpp @@ -114,7 +114,7 @@ void Binder::freeMemory() void Binder::bind(std::size_t pos, const std::string& val, Direction dir) { - char* pTCVal = 0; + char* pTCVal = nullptr; SQLINTEGER size = 0; if (transcodeRequired()) { @@ -125,7 +125,7 @@ void Binder::bind(std::size_t pos, const std::string& val, Direction dir) std::memcpy(pTCVal, tcVal.data(), size); } else size = static_cast(val.size()); - SQLPOINTER pVal = 0; + SQLPOINTER pVal = nullptr; SQLINTEGER colSize = 0; SQLSMALLINT decDigits = 0; getColSizeAndPrecision(pos, SQL_C_CHAR, colSize, decDigits, val.size()); @@ -183,7 +183,7 @@ void Binder::bind(std::size_t pos, const UTF16String& val, Direction dir) { typedef UTF16String::value_type CharT; - SQLPOINTER pVal = 0; + SQLPOINTER pVal = nullptr; SQLINTEGER size = (SQLINTEGER)(val.size() * sizeof(CharT)); SQLINTEGER colSize = 0; SQLSMALLINT decDigits = 0; @@ -366,7 +366,7 @@ void Binder::bind(std::size_t pos, const NullData& val, Direction dir) if (isOutBound(dir) || !isInBound(dir)) throw NotImplementedException("NULL parameter type can only be inbound."); - _inParams.insert(ParamMap::value_type(SQLPOINTER(0), SQLINTEGER(0))); + _inParams.insert(ParamMap::value_type(SQLPOINTER(nullptr), SQLINTEGER(0))); SQLLEN* pLenIn = new SQLLEN; *pLenIn = SQL_NULL_DATA; @@ -384,7 +384,7 @@ void Binder::bind(std::size_t pos, const NullData& val, Direction dir) TypeInfo::sqlDataType(), colSize, decDigits, - 0, + nullptr, 0, _lengthIndicator.back()))) { diff --git a/Data/ODBC/src/Extractor.cpp b/Data/ODBC/src/Extractor.cpp index b946f67f2..5ce649386 100644 --- a/Data/ODBC/src/Extractor.cpp +++ b/Data/ODBC/src/Extractor.cpp @@ -72,7 +72,7 @@ bool Extractor::extractBoundImpl(std::size_t pos, UTF16String& val) typedef UTF16String::value_type CharT; if (isNull(pos)) return false; std::size_t dataSize = _pPreparator->actualDataSize(pos); - CharT* sp = 0; + CharT* sp = nullptr; UTF16String us; const std::type_info& ti = _pPreparator->at(pos).type(); if (ti == typeid(CharT*)) diff --git a/Data/ODBC/src/ODBCMetaColumn.cpp b/Data/ODBC/src/ODBCMetaColumn.cpp index ef2359d18..03bd86b14 100644 --- a/Data/ODBC/src/ODBCMetaColumn.cpp +++ b/Data/ODBC/src/ODBCMetaColumn.cpp @@ -64,9 +64,9 @@ bool ODBCMetaColumn::isUnsigned() const if (Utility::isError(Poco::Data::ODBC::SQLColAttribute(_rStmt, (SQLUSMALLINT)position() + 1, // ODBC columns are 1-based SQL_DESC_UNSIGNED, + nullptr, 0, - 0, - 0, + nullptr, &val))) { throw StatementException(_rStmt, "ODBCMetaColumn::isUnsigned()"); @@ -82,9 +82,9 @@ void ODBCMetaColumn::init() if (Utility::isError(Poco::Data::ODBC::SQLColAttribute(_rStmt, (SQLUSMALLINT) position() + 1, // ODBC columns are 1-based SQL_DESC_LENGTH, + nullptr, 0, - 0, - 0, + nullptr, &_dataLength))) { throw StatementException(_rStmt, "ODBCMetaColumn::init()"); diff --git a/Data/ODBC/src/ODBCStatementImpl.cpp b/Data/ODBC/src/ODBCStatementImpl.cpp index 82ef08ddc..d5ead3f3f 100644 --- a/Data/ODBC/src/ODBCStatementImpl.cpp +++ b/Data/ODBC/src/ODBCStatementImpl.cpp @@ -92,7 +92,7 @@ void ODBCStatementImpl::compileImpl() Binder::ParameterBinding bind = session().getFeature("autoBind") ? Binder::PB_IMMEDIATE : Binder::PB_AT_EXEC; - const TypeInfo* pDT = 0; + const TypeInfo* pDT = nullptr; try { Poco::Any dti = session().getProperty("dataTypeInfo"); @@ -194,7 +194,7 @@ void ODBCStatementImpl::doPrepare() "SQLSetStmtAttr(SQL_ATTR_ROW_ARRAY_SIZE)"); } - AbstractPreparation::Ptr pAP = 0; + AbstractPreparation::Ptr pAP = nullptr; Poco::Data::AbstractPreparator::Ptr pP = _preparations[curDataSet]; for (std::size_t pos = 0; it != itEnd; ++it) { @@ -295,7 +295,7 @@ void ODBCStatementImpl::execDirectImpl(const std::string& query) void ODBCStatementImpl::putData() { - SQLPOINTER pParam = 0; + SQLPOINTER pParam = nullptr; SQLINTEGER dataSize = 0; SQLRETURN rc; @@ -433,7 +433,7 @@ std::string ODBCStatementImpl::nativeSQL() SQLINTEGER length = (SQLINTEGER) statement.size() * 2; - char* pNative = 0; + char* pNative = nullptr; SQLINTEGER retlen = length; do { diff --git a/Data/ODBC/src/SessionImpl.cpp b/Data/ODBC/src/SessionImpl.cpp index 4217004d1..77a9ff156 100644 --- a/Data/ODBC/src/SessionImpl.cpp +++ b/Data/ODBC/src/SessionImpl.cpp @@ -170,7 +170,7 @@ void SessionImpl::open(const std::string& connect) &SessionImpl::setDataTypeInfo, &SessionImpl::dataTypeInfo); - Poco::Data::ODBC::SQLSetConnectAttr(_db, SQL_ATTR_QUIET_MODE, 0, 0); + Poco::Data::ODBC::SQLSetConnectAttr(_db, SQL_ATTR_QUIET_MODE, nullptr, 0); if (!canTransact()) autoCommit("", true); } @@ -227,7 +227,7 @@ inline Poco::Any SessionImpl::getCursorUse(const std::string&) const #pragma warning (disable : 4995) // ignore marked as deprecated #endif SQLUINTEGER curUse = 0; - Poco::Data::ODBC::SQLGetConnectAttr(_db, SQL_ATTR_ODBC_CURSORS, &curUse, SQL_IS_UINTEGER, 0); + Poco::Data::ODBC::SQLGetConnectAttr(_db, SQL_ATTR_ODBC_CURSORS, &curUse, SQL_IS_UINTEGER, nullptr); switch (curUse) { case SQL_CUR_USE_ODBC: @@ -263,7 +263,7 @@ bool SessionImpl::canTransact() const if (ODBC_TXN_CAPABILITY_UNKNOWN == _canTransact) { SQLUSMALLINT ret; - checkError(Poco::Data::ODBC::SQLGetInfo(_db, SQL_TXN_CAPABLE, &ret, 0, 0), + checkError(Poco::Data::ODBC::SQLGetInfo(_db, SQL_TXN_CAPABLE, &ret, 0, nullptr), "Failed to obtain transaction capability info."); _canTransact = (SQL_TC_NONE != ret) ? @@ -318,7 +318,7 @@ bool SessionImpl::getMultiActiveResultset(const std::string&) const { #ifdef POCO_DATA_ODBC_HAVE_SQL_SERVER_EXT SQLINTEGER mars; - Poco::Data::ODBC::SQLGetConnectAttr(_db, SQL_COPT_SS_MARS_ENABLED, &mars, SQL_IS_INTEGER, 0); + Poco::Data::ODBC::SQLGetConnectAttr(_db, SQL_COPT_SS_MARS_ENABLED, &mars, SQL_IS_INTEGER, nullptr); return mars == SQL_MARS_ENABLED_YES; #else return false; @@ -332,7 +332,7 @@ Poco::UInt32 SessionImpl::getTransactionIsolation() const checkError(SQLGetConnectAttr(_db, SQL_ATTR_TXN_ISOLATION, &isolation, 0, - 0)); + nullptr)); return transactionIsolation(isolation); } @@ -359,7 +359,7 @@ Poco::UInt32 SessionImpl::getDefaultTransactionIsolation() const checkError(SQLGetInfo(_db, SQL_DEFAULT_TXN_ISOLATION, &isolation, 0, - 0)); + nullptr)); return transactionIsolation(isolation); } @@ -418,7 +418,7 @@ bool SessionImpl::isAutoCommit(const std::string&) const SQL_ATTR_AUTOCOMMIT, &value, 0, - 0)); + nullptr)); return (0 != value); } @@ -433,7 +433,7 @@ bool SessionImpl::isTransaction() const SQL_ATTR_AUTOCOMMIT, &value, 0, - 0)); + nullptr)); if (0 == value) return _inTransaction; else return false; @@ -505,7 +505,7 @@ int SessionImpl::maxStatementLength() const SQL_MAXIMUM_STATEMENT_LENGTH, (SQLPOINTER) &info, 0, - 0))) + nullptr))) { throw ConnectionException(_db, "SQLGetInfo(SQL_MAXIMUM_STATEMENT_LENGTH)"); diff --git a/Data/ODBC/testsuite/src/ODBCAccessTest.cpp b/Data/ODBC/testsuite/src/ODBCAccessTest.cpp index 55aec9ba7..b4a07d16f 100644 --- a/Data/ODBC/testsuite/src/ODBCAccessTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCAccessTest.cpp @@ -35,7 +35,7 @@ using Poco::format; using Poco::NotFoundException; -Session* ODBCAccessTest::_pSession = 0; +Session* ODBCAccessTest::_pSession = nullptr; std::string ODBCAccessTest::_dbConnString; Poco::Data::ODBC::Utility::DriverMap ODBCAccessTest::_drivers; @@ -209,5 +209,5 @@ CppUnit::Test* ODBCAccessTest::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCDB2Test.cpp b/Data/ODBC/testsuite/src/ODBCDB2Test.cpp index 109989354..26db6b07a 100644 --- a/Data/ODBC/testsuite/src/ODBCDB2Test.cpp +++ b/Data/ODBC/testsuite/src/ODBCDB2Test.cpp @@ -681,5 +681,5 @@ CppUnit::Test* ODBCDB2Test::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCMySQLTest.cpp b/Data/ODBC/testsuite/src/ODBCMySQLTest.cpp index f85821270..d42466dee 100644 --- a/Data/ODBC/testsuite/src/ODBCMySQLTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCMySQLTest.cpp @@ -506,5 +506,5 @@ CppUnit::Test* ODBCMySQLTest::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCOracleTest.cpp b/Data/ODBC/testsuite/src/ODBCOracleTest.cpp index 0ba4d8175..0571beb42 100644 --- a/Data/ODBC/testsuite/src/ODBCOracleTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCOracleTest.cpp @@ -1024,5 +1024,5 @@ CppUnit::Test* ODBCOracleTest::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp b/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp index 2d5316735..2c0663707 100644 --- a/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCPostgreSQLTest.cpp @@ -687,5 +687,5 @@ CppUnit::Test* ODBCPostgreSQLTest::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp b/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp index bdca51192..6d9172485 100644 --- a/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCSQLServerTest.cpp @@ -1211,5 +1211,5 @@ CppUnit::Test* ODBCSQLServerTest::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCSQLiteTest.cpp b/Data/ODBC/testsuite/src/ODBCSQLiteTest.cpp index 92ada607a..5b6bb2038 100644 --- a/Data/ODBC/testsuite/src/ODBCSQLiteTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCSQLiteTest.cpp @@ -398,5 +398,5 @@ CppUnit::Test* ODBCSQLiteTest::suite() return pSuite; } - return 0; + return nullptr; } diff --git a/Data/ODBC/testsuite/src/ODBCTest.cpp b/Data/ODBC/testsuite/src/ODBCTest.cpp index b6b7eb50a..c8b5d7b26 100644 --- a/Data/ODBC/testsuite/src/ODBCTest.cpp +++ b/Data/ODBC/testsuite/src/ODBCTest.cpp @@ -1454,7 +1454,7 @@ ODBCTest::SessionPtr ODBCTest::init(const std::string& driver, const std::string& dbEncoding) { Utility::drivers(_drivers); - if (!canConnect(driver, dsn, uid, pwd, dbConnString, db)) return 0; + if (!canConnect(driver, dsn, uid, pwd, dbConnString, db)) return nullptr; try { @@ -1466,6 +1466,6 @@ ODBCTest::SessionPtr ODBCTest::init(const std::string& driver, }catch (ConnectionFailedException& ex) { std::cout << ex.displayText() << std::endl; - return 0; + return nullptr; } } diff --git a/Data/ODBC/testsuite/src/SQLExecutor.cpp b/Data/ODBC/testsuite/src/SQLExecutor.cpp index 5662cc5ef..4d62eed29 100644 --- a/Data/ODBC/testsuite/src/SQLExecutor.cpp +++ b/Data/ODBC/testsuite/src/SQLExecutor.cpp @@ -172,7 +172,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, SQLCHAR connectOutput[1024] = {0}; SQLSMALLINT result; rc = SQLDriverConnect(hdbc - , NULL + , nullptr ,(SQLCHAR*) dbConnString.c_str() ,(SQLSMALLINT) SQL_NTS , connectOutput @@ -307,7 +307,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, 0, (SQLPOINTER) &fourth, 0, - 0); + nullptr); poco_odbc_check_stmt (rc, hstmt); rc = SQLBindParameter(hstmt, @@ -319,7 +319,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, 1, (SQLPOINTER) &fifth, 0, - 0); + nullptr); poco_odbc_check_stmt (rc, hstmt); if (dateTimeColSize == 0 || dateTimeDecDigits == -1) @@ -354,7 +354,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, dateTimeDecDigits, (SQLPOINTER) &sixth, 0, - 0); + nullptr); poco_odbc_check_stmt (rc, hstmt); rc = SQLExecute(hstmt); @@ -362,7 +362,7 @@ void SQLExecutor::bareboneODBCTest(const std::string& dbConnString, if (SQL_NEED_DATA == rc) { - SQLPOINTER pParam = 0; + SQLPOINTER pParam = nullptr; while (SQL_NEED_DATA == (rc = SQLParamData(hstmt, &pParam))) { SQLINTEGER dataSize = 0; @@ -600,7 +600,7 @@ void SQLExecutor::bareboneODBCMultiResultTest(const std::string& dbConnString, SQLCHAR connectOutput[512] = {0}; SQLSMALLINT result; rc = SQLDriverConnect(hdbc - , NULL + , nullptr ,(SQLCHAR*) dbConnString.c_str() ,(SQLSMALLINT) SQL_NTS , connectOutput @@ -822,7 +822,7 @@ void SQLExecutor::bareboneODBCStoredFuncTest(const std::string& dbConnString, SQLCHAR connectOutput[1024] = { 0 }; SQLSMALLINT result; rc = SQLDriverConnect(hdbc - , NULL + , nullptr , (SQLCHAR*)dbConnString.c_str() , (SQLSMALLINT)SQL_NTS , connectOutput @@ -944,7 +944,7 @@ void SQLExecutor::bareboneODBCStoredFuncTest(const std::string& dbConnString, if (SQL_NEED_DATA == rc) { - SQLPOINTER pParam = 0; + SQLPOINTER pParam = nullptr; while (SQL_NEED_DATA == (rc = SQLParamData(hstmt, &pParam))) { if ((pParam != (SQLPOINTER)retVal) && diff --git a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/BinaryExtractor.h b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/BinaryExtractor.h index f21ee0583..3f4207f81 100644 --- a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/BinaryExtractor.h +++ b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/BinaryExtractor.h @@ -428,7 +428,7 @@ private: // inline bool BinaryExtractor::isColumnNull(const OutputParameter& anOutputParameter) const { - return anOutputParameter.isNull() || 0 == anOutputParameter.pData(); + return anOutputParameter.isNull() || nullptr == anOutputParameter.pData(); } diff --git a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h index 6a47557ed..9b1cefc13 100644 --- a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h +++ b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/Extractor.h @@ -448,7 +448,7 @@ private: // inline bool Extractor::isColumnNull(const OutputParameter& outputParameter) const { - return outputParameter.isNull() || 0 == outputParameter.pData(); + return outputParameter.isNull() || nullptr == outputParameter.pData(); } diff --git a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/PostgreSQLTypes.h b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/PostgreSQLTypes.h index 489103042..360a44435 100644 --- a/Data/PostgreSQL/include/Poco/Data/PostgreSQL/PostgreSQLTypes.h +++ b/Data/PostgreSQL/include/Poco/Data/PostgreSQL/PostgreSQLTypes.h @@ -148,7 +148,7 @@ private: PQConnectionInfoOptionsFree& operator = (const PQConnectionInfoOptionsFree&); private: - PQconninfoOption* _pConnectionInfoOption; + PQconninfoOption* _pConnectionInfoOption; }; @@ -194,16 +194,16 @@ inline InputParameter::InputParameter(Poco::Data::MetaColumn::ColumnDataType fie _pData(aDataPtr), _size(theSize), _isBinary(Poco::Data::MetaColumn::FDT_BLOB == _fieldType || Poco::Data::MetaColumn::FDT_CLOB == _fieldType), - _pNonStringVersionRepresentation(0) + _pNonStringVersionRepresentation(nullptr) { } inline InputParameter::InputParameter(): _fieldType(Poco::Data::MetaColumn::FDT_UNKNOWN), - _pData(0), + _pData(nullptr), _size(0), _isBinary(false), - _pNonStringVersionRepresentation(0) + _pNonStringVersionRepresentation(nullptr) { } @@ -215,7 +215,7 @@ inline InputParameter::~InputParameter() inline const void* InputParameter::pData() const { - return _pData; + return _pData; } @@ -239,7 +239,7 @@ inline bool InputParameter::isBinary() const inline void InputParameter::setStringVersionRepresentation(const std::string& aString) { - _pNonStringVersionRepresentation = 0; + _pNonStringVersionRepresentation = nullptr; _stringVersionRepresentation = aString; _size = _stringVersionRepresentation.size(); } @@ -281,8 +281,8 @@ inline const void* InputParameter::pInternalRepresentation() const case Poco::Data::MetaColumn::FDT_UNKNOWN: default: - return 0; - } + return nullptr; + } } @@ -306,7 +306,7 @@ inline OutputParameter::OutputParameter(): _fieldType(Poco::Data::MetaColumn::FDT_UNKNOWN), _internalFieldType(static_cast(-1)), _rowNumber(0), - _pData(0), + _pData(nullptr), _size(0), _isNull(true) { @@ -325,48 +325,48 @@ inline void OutputParameter::setValues(Poco::Data::MetaColumn::ColumnDataType aF std::size_t theSize, bool anIsNull) { - _fieldType = aFieldType; - _internalFieldType = anInternalFieldType; - _rowNumber = aRowNumber; - _pData = aDataPtr; - _size = theSize; - _isNull = anIsNull; + _fieldType = aFieldType; + _internalFieldType = anInternalFieldType; + _rowNumber = aRowNumber; + _pData = aDataPtr; + _size = theSize; + _isNull = anIsNull; } inline Poco::Data::MetaColumn::ColumnDataType OutputParameter::fieldType() const { - return _fieldType; + return _fieldType; } inline Oid OutputParameter::internalFieldType() const { - return _internalFieldType; + return _internalFieldType; } inline std::size_t OutputParameter::rowNumber() const { - return _rowNumber; + return _rowNumber; } inline const char* OutputParameter::pData() const { - return _pData; + return _pData; } inline std::size_t OutputParameter::size() const { - return _size; + return _size; } inline bool OutputParameter::isNull() const { - return _isNull; + return _isNull; } @@ -378,11 +378,11 @@ inline PQConnectionInfoOptionsFree::PQConnectionInfoOptionsFree(PQconninfoOption inline PQConnectionInfoOptionsFree::~PQConnectionInfoOptionsFree() { - if (_pConnectionInfoOption) - { - PQconninfoFree(_pConnectionInfoOption); - _pConnectionInfoOption = 0; - } + if (_pConnectionInfoOption) + { + PQconninfoFree(_pConnectionInfoOption); + _pConnectionInfoOption = nullptr; + } } @@ -394,11 +394,11 @@ inline PQResultClear::PQResultClear(PGresult* aPQResultPtr): inline PQResultClear::~PQResultClear() { - if (_pPQResult) - { - PQclear(_pPQResult); - _pPQResult = 0; - } + if (_pPQResult) + { + PQclear(_pPQResult); + _pPQResult = nullptr; + } } @@ -412,11 +412,11 @@ inline PGCancelFree::PGCancelFree(PGcancel* aStatementCancelPtr): inline PGCancelFree::~PGCancelFree() { - if (_pPGCancel) - { - PQfreeCancel(_pPGCancel); - _pPGCancel = 0; - } + if (_pPGCancel) + { + PQfreeCancel(_pPGCancel); + _pPGCancel = nullptr; + } } diff --git a/Data/PostgreSQL/src/Binder.cpp b/Data/PostgreSQL/src/Binder.cpp index 4a6f06561..349b02af3 100644 --- a/Data/PostgreSQL/src/Binder.cpp +++ b/Data/PostgreSQL/src/Binder.cpp @@ -186,7 +186,7 @@ void Binder::bind(std::size_t pos, const UUID& val, Direction dir) void Binder::bind(std::size_t pos, const NullData&, Direction dir) { poco_assert(dir == PD_IN); - realBind(pos, Poco::Data::MetaColumn::FDT_UNKNOWN, 0, 0); + realBind(pos, Poco::Data::MetaColumn::FDT_UNKNOWN, nullptr, 0); } diff --git a/Data/PostgreSQL/src/PostgreSQLException.cpp b/Data/PostgreSQL/src/PostgreSQLException.cpp index 7c6423b0a..958022440 100644 --- a/Data/PostgreSQL/src/PostgreSQLException.cpp +++ b/Data/PostgreSQL/src/PostgreSQLException.cpp @@ -28,12 +28,12 @@ PostgreSQLException::PostgreSQLException(const std::string& aMessage): PostgreSQLException::PostgreSQLException(const std::string& aMessage,const char* pAnSqlState): Poco::Data::DataException(std::string("[PostgreSQL]: ") + aMessage) { - // handle anSqlState - if (pAnSqlState == nullptr) _sqlState[0] = '\0'; + // handle anSqlState + if (pAnSqlState == nullptr) _sqlState[0] = '\0'; else { strncpy(_sqlState,pAnSqlState,5); - _sqlState[5] = '\0'; + _sqlState[5] = '\0'; } } diff --git a/Data/PostgreSQL/src/SessionHandle.cpp b/Data/PostgreSQL/src/SessionHandle.cpp index f8d215a8a..a342ffb6d 100644 --- a/Data/PostgreSQL/src/SessionHandle.cpp +++ b/Data/PostgreSQL/src/SessionHandle.cpp @@ -34,7 +34,7 @@ const std::string SessionHandle::POSTGRESQL_SERIALIZABLE = "SERIALIZABLE"; SessionHandle::SessionHandle(): - _pConnection(0), + _pConnection(nullptr), _inTransaction(false), _isAsynchronousCommit(false), _tranactionIsolationLevel(Session::TRANSACTION_READ_COMMITTED) @@ -86,7 +86,7 @@ void SessionHandle::connect(const std::string& aConnectionString) { // free bad connection PQfinish(_pConnection); - _pConnection = 0; + _pConnection = nullptr; } _pConnection = PQconnectdb(aConnectionString.c_str()); @@ -97,7 +97,7 @@ void SessionHandle::connect(const std::string& aConnectionString) if (_pConnection) { PQfinish(_pConnection); - _pConnection = 0; + _pConnection = nullptr; } throw ConnectionFailedException(msg); } @@ -152,7 +152,7 @@ void SessionHandle::disconnect() { PQfinish(_pConnection); - _pConnection = 0; + _pConnection = nullptr; _connectionString = std::string(); _inTransaction= false; @@ -197,7 +197,7 @@ std::string SessionHandle::lastError() const std::string SessionHandle::lastErrorNoLock() const { // DO NOT ACQUIRE THE MUTEX IN PRIVATE METHODS - std::string lastErrorString (0 != _pConnection ? PQerrorMessage(_pConnection) : "not connected"); + std::string lastErrorString (nullptr != _pConnection ? PQerrorMessage(_pConnection) : "not connected"); return lastErrorString; } @@ -328,7 +328,7 @@ void SessionHandle::cancel() PGCancelFree cancelFreer(ptrPGCancel); - PQcancel(ptrPGCancel, 0, 0); // no error buffer + PQcancel(ptrPGCancel, nullptr, 0); // no error buffer } @@ -565,7 +565,7 @@ SessionParametersMap SessionHandle::connectionParameters() const throw NotConnectedException(); } - PQconninfoOption* ptrConnInfoOptions = 0; + PQconninfoOption* ptrConnInfoOptions = nullptr; { Poco::FastMutex::ScopedLock mutexLocker(_sessionMutex); diff --git a/Data/PostgreSQL/src/StatementExecutor.cpp b/Data/PostgreSQL/src/StatementExecutor.cpp index cdf09ef2a..3bd800d03 100644 --- a/Data/PostgreSQL/src/StatementExecutor.cpp +++ b/Data/PostgreSQL/src/StatementExecutor.cpp @@ -76,7 +76,7 @@ StatementExecutor::StatementExecutor(SessionHandle& sessionHandle, bool binaryEx _sessionHandle(sessionHandle), _binaryExtraction(binaryExtraction), _state(STMT_INITED), - _pResultHandle(0), + _pResultHandle(nullptr), _countPlaceholdersInSQLStatement(0), _currentRow(0), _affectedRowCount(0) @@ -133,23 +133,23 @@ void StatementExecutor::prepare(const std::string& aSQLStatement) std::replace(statementName.begin(), statementName.end(), '-', 'p'); // PostgreSQL doesn't like dashes in prepared statement names const char* pStatementName = statementName.c_str(); - PGresult* ptrPGResult = 0; + PGresult* ptrPGResult = nullptr; { Poco::FastMutex::ScopedLock mutexLocker(_sessionHandle.mutex()); // prepare the statement - temporary PGresult returned - ptrPGResult = PQprepare(_sessionHandle, pStatementName, ptrCSQLStatement, (int)countPlaceholdersInSQLStatement, 0); + ptrPGResult = PQprepare(_sessionHandle, pStatementName, ptrCSQLStatement, (int)countPlaceholdersInSQLStatement, nullptr); } { - // get the sqlState - const char* pSQLState = PQresultErrorField(ptrPGResult, PG_DIAG_SQLSTATE); + // get the sqlState + const char* pSQLState = PQresultErrorField(ptrPGResult, PG_DIAG_SQLSTATE); // setup to clear the result from PQprepare PQResultClear resultClearer(ptrPGResult); - // + // if (!ptrPGResult || PQresultStatus(ptrPGResult) != PGRES_COMMAND_OK ) { throw StatementException(std::string("postgresql_stmt_prepare error: ") + PQresultErrorMessage (ptrPGResult) + " " + aSQLStatement,pSQLState); @@ -164,8 +164,8 @@ void StatementExecutor::prepare(const std::string& aSQLStatement) } { - // get the sqlState - const char* pSQLState = PQresultErrorField(ptrPGResult, PG_DIAG_SQLSTATE); + // get the sqlState + const char* pSQLState = PQresultErrorField(ptrPGResult, PG_DIAG_SQLSTATE); PQResultClear resultClearer(ptrPGResult); @@ -254,15 +254,15 @@ void StatementExecutor::execute() // clear out any result data. One way or another it is now obsolete. clearResults(); - PGresult* ptrPGResult = 0; + PGresult* ptrPGResult = nullptr; { Poco::FastMutex::ScopedLock mutexLocker(_sessionHandle.mutex()); ptrPGResult = PQexecPrepared(_sessionHandle, _preparedStatementName.c_str(), (int)_countPlaceholdersInSQLStatement, - _inputParameterVector.size() != 0 ? &pParameterVector[ 0 ] : 0, - _inputParameterVector.size() != 0 ? ¶meterLengthVector[ 0 ] : 0, - _inputParameterVector.size() != 0 ? ¶meterFormatVector[ 0 ] : 0, + _inputParameterVector.size() != 0 ? &pParameterVector[ 0 ] : nullptr, + _inputParameterVector.size() != 0 ? ¶meterLengthVector[ 0 ] : nullptr, + _inputParameterVector.size() != 0 ? ¶meterFormatVector[ 0 ] : nullptr, _binaryExtraction ? 1 : 0); } @@ -279,7 +279,7 @@ void StatementExecutor::execute() const char* pHint = PQresultErrorField(ptrPGResult, PG_DIAG_MESSAGE_HINT); const char* pConstraint = PQresultErrorField(ptrPGResult, PG_DIAG_CONSTRAINT_NAME); - + throw StatementException(std::string("postgresql_stmt_execute error: ") + PQresultErrorMessage (ptrPGResult) + " Severity: " + (pSeverity ? pSeverity : "N/A") @@ -308,7 +308,7 @@ void StatementExecutor::execute() { // non Select DML statments also have an affected row count. // unfortunately PostgreSQL offers up this count as a char * - go figure! const char * pNonSelectAffectedRowCountString = PQcmdTuples(_pResultHandle); - if (0 != pNonSelectAffectedRowCountString) + if (nullptr != pNonSelectAffectedRowCountString) { if ( Poco::NumberParser::tryParse(pNonSelectAffectedRowCountString, affectedRowCount) && affectedRowCount >= 0 diff --git a/Data/PostgreSQL/testsuite/src/PostgreSQLTest.cpp b/Data/PostgreSQL/testsuite/src/PostgreSQLTest.cpp index 6778cd0ca..a50edcf8e 100644 --- a/Data/PostgreSQL/testsuite/src/PostgreSQLTest.cpp +++ b/Data/PostgreSQL/testsuite/src/PostgreSQLTest.cpp @@ -41,8 +41,8 @@ using Poco::NamedTuple; using Poco::Environment; -Poco::SharedPtr PostgreSQLTest::_pSession = 0; -Poco::SharedPtr PostgreSQLTest::_pExecutor = 0; +Poco::SharedPtr PostgreSQLTest::_pSession = nullptr; +Poco::SharedPtr PostgreSQLTest::_pExecutor = nullptr; // @@ -1254,7 +1254,7 @@ CppUnit::Test* PostgreSQLTest::suite() catch (ConnectionFailedException& ex) { std::cout << ex.displayText() << std::endl; - return 0; + return nullptr; } std::cout << "*** Connected to [" << "PostgreSQL" << "] test database." << std::endl; diff --git a/Data/PostgreSQL/testsuite/src/SQLExecutor.cpp b/Data/PostgreSQL/testsuite/src/SQLExecutor.cpp index 2698f3d24..72cb3c208 100644 --- a/Data/PostgreSQL/testsuite/src/SQLExecutor.cpp +++ b/Data/PostgreSQL/testsuite/src/SQLExecutor.cpp @@ -174,13 +174,13 @@ void SQLExecutor::oidPostgreSQLTest(std::string host, std::string user, std::str connectionString.append("port="); connectionString.append(port); - PGconn * pConnection = 0; + PGconn * pConnection = nullptr; pConnection = PQconnectdb(connectionString.c_str()); assertTrue (PQstatus(pConnection) == CONNECTION_OK); - PGresult * pResult = 0; + PGresult * pResult = nullptr; std::string sql = "DROP TABLE IF EXISTS Test"; pResult = PQexec(pConnection, sql.c_str()); @@ -203,7 +203,7 @@ void SQLExecutor::oidPostgreSQLTest(std::string host, std::string user, std::str sql = "SELECT * FROM Test"; std::string selectStatementName = "SELECT Statement"; - pResult = PQprepare(pConnection, selectStatementName.c_str(), sql.c_str(), 0, 0); + pResult = PQprepare(pConnection, selectStatementName.c_str(), sql.c_str(), 0, nullptr); assertTrue (PQresultStatus(pResult) == PGRES_COMMAND_OK); PQclear(pResult); @@ -273,20 +273,20 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std connectionString.append("port="); connectionString.append(port); - PGconn * pConnection = 0; + PGconn * pConnection = nullptr; pConnection = PQconnectdb(connectionString.c_str()); assertTrue (PQstatus(pConnection) == CONNECTION_OK); - PGresult * pResult = 0; + PGresult * pResult = nullptr; std::string sql = "DROP TABLE IF EXISTS Test"; pResult = PQexec(pConnection, sql.c_str()); std::cout << "Drop Table Test Result: " << PQresStatus(PQresultStatus(pResult)) << " statement: "<< sql.c_str() << std::endl; - assertTrue ( PQresultStatus(pResult) == PGRES_COMMAND_OK + assertTrue (PQresultStatus(pResult) == PGRES_COMMAND_OK || PQresultStatus(pResult) == PGRES_FATAL_ERROR); PQclear(pResult); @@ -306,7 +306,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std insertStatementName.c_str(), sql.c_str(), 5, - 0 + nullptr ); assertTrue (PQresultStatus(pResult) == PGRES_COMMAND_OK); @@ -316,7 +316,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std int fourth = ByteOrder::toNetwork((Poco::UInt32) 4); float fifth = 1.5; - const char *paramValues[5] = { 0 }; + const char *paramValues[5] = { nullptr }; int paramLengths[5] = { 0 }; int paramFormats[5] = { 0 }; @@ -364,7 +364,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std assertTrue (PQntuples(pResult) == 1); - char* pSelectResult[5] = { 0 }; + char* pSelectResult[5] = { nullptr }; int pResultLengths[5] = { 0 }; // column 0 @@ -377,7 +377,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std 0, 0 ); - assertTrue (pSelectResult[ 0 ] != 0); + assertTrue (pSelectResult[ 0 ] != nullptr); assertTrue (pResultLengths[ 0 ] != 0); // column 1 @@ -390,7 +390,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std 0, 1 ); - assertTrue (pSelectResult[ 1 ] != 0); + assertTrue (pSelectResult[ 1 ] != nullptr); assertTrue (pResultLengths[ 1 ] != 0); // column 2 @@ -403,7 +403,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std 0, 2 ); - assertTrue (pSelectResult[ 2 ] != 0); + assertTrue (pSelectResult[ 2 ] != nullptr); assertTrue (pResultLengths[ 2 ] != 0); // column 3 @@ -416,7 +416,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std 0, 3 ); - assertTrue (pSelectResult[ 3 ] != 0); + assertTrue (pSelectResult[ 3 ] != nullptr); assertTrue (pResultLengths[ 3 ] != 0); // column 4 @@ -429,7 +429,7 @@ void SQLExecutor::barebonePostgreSQLTest(std::string host, std::string user, std 0, 4 ); - assertTrue (pSelectResult[ 4 ] != 0); + assertTrue (pSelectResult[ 4 ] != nullptr); assertTrue (pResultLengths[ 4 ] != 0); /* diff --git a/Data/SQLParser/benchmark/benchmark.cpp b/Data/SQLParser/benchmark/benchmark.cpp index e1435504b..60d005fdf 100644 --- a/Data/SQLParser/benchmark/benchmark.cpp +++ b/Data/SQLParser/benchmark/benchmark.cpp @@ -7,20 +7,20 @@ int main(int argc, char** argv) { // Create parse and tokenize benchmarks for TPC-H queries. const auto tpch_queries = getTPCHQueries(); for (const auto& query : tpch_queries) { - std::string p_name = query.first + "-parse"; - benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second); - std::string t_name = query.first + "-tokenize"; - benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second); + std::string p_name = query.first + "-parse"; + benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second); + std::string t_name = query.first + "-tokenize"; + benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second); } // Create parse and tokenize benchmarks for all queries in sql_queries array. for (unsigned i = 0; i < sql_queries.size(); ++i) { - const auto& query = sql_queries[i]; - std::string p_name = getQueryName(i) + "-parse"; - benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second); + const auto& query = sql_queries[i]; + std::string p_name = getQueryName(i) + "-parse"; + benchmark::RegisterBenchmark(p_name.c_str(), &BM_ParseBenchmark, query.second); - std::string t_name = getQueryName(i) + "-tokenize"; - benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second); + std::string t_name = getQueryName(i) + "-tokenize"; + benchmark::RegisterBenchmark(t_name.c_str(), &BM_TokenizeBenchmark, query.second); } benchmark::Initialize(&argc, argv); diff --git a/Data/SQLParser/benchmark/benchmark_utils.cpp b/Data/SQLParser/benchmark/benchmark_utils.cpp index 27fb66c4e..e224e1e85 100644 --- a/Data/SQLParser/benchmark/benchmark_utils.cpp +++ b/Data/SQLParser/benchmark/benchmark_utils.cpp @@ -16,8 +16,8 @@ void BM_TokenizeBenchmark(benchmark::State& st, const std::string& query) { st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { - std::vector tokens(512); - hsql::SQLParser::tokenize(query, &tokens); + std::vector tokens(512); + hsql::SQLParser::tokenize(query, &tokens); } } @@ -26,19 +26,19 @@ void BM_ParseBenchmark(benchmark::State& st, const std::string& query) { st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { - hsql::SQLParserResult result; - hsql::SQLParser::parse(query, &result); - if (!result.isValid()) { - std::cout << query << std::endl; - std::cout << result.errorMsg() << std::endl; - st.SkipWithError("Parsing failed!"); - } + hsql::SQLParserResult result; + hsql::SQLParser::parse(query, &result); + if (!result.isValid()) { + std::cout << query << std::endl; + std::cout << result.errorMsg() << std::endl; + st.SkipWithError("Parsing failed!"); + } } } std::string readFileContents(const std::string& file_path) { std::ifstream t(file_path.c_str()); std::string text((std::istreambuf_iterator(t)), - std::istreambuf_iterator()); + std::istreambuf_iterator()); return text; } diff --git a/Data/SQLParser/benchmark/benchmark_utils.h b/Data/SQLParser/benchmark/benchmark_utils.h index 7eb54d809..0af8625b0 100644 --- a/Data/SQLParser/benchmark/benchmark_utils.h +++ b/Data/SQLParser/benchmark/benchmark_utils.h @@ -22,13 +22,13 @@ std::string readFileContents(const std::string& file_path); #define PARSE_QUERY_BENCHMARK(name, query)\ static void name(benchmark::State& st) {\ - BM_ParseBenchmark(st, query);\ + BM_ParseBenchmark(st, query);\ }\ BENCHMARK(name); #define TOKENIZE_QUERY_BENCHMARK(name, query)\ static void name(benchmark::State& st) {\ - BM_TokenizeBenchmark(st, query);\ + BM_TokenizeBenchmark(st, query);\ }\ BENCHMARK(name); diff --git a/Data/SQLParser/benchmark/parser_benchmark.cpp b/Data/SQLParser/benchmark/parser_benchmark.cpp index 47928f0a7..40d5de190 100644 --- a/Data/SQLParser/benchmark/parser_benchmark.cpp +++ b/Data/SQLParser/benchmark/parser_benchmark.cpp @@ -24,14 +24,14 @@ static void BM_CharacterCount(benchmark::State& st) { st.counters["num_tokens"] = getNumTokens(query); st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { - hsql::SQLParserResult result; - hsql::SQLParser::parse(query, &result); + hsql::SQLParserResult result; + hsql::SQLParser::parse(query, &result); } } BENCHMARK(BM_CharacterCount) ->RangeMultiplier(1 << 2) ->Ranges({{1 << 5, 1 << 15}, - {5, 5}}); + {5, 5}}); // Benchmark the influence of increasing number of tokens, while // the number of characters remains unchanged. @@ -46,42 +46,42 @@ static void BM_ConditionalTokens(benchmark::State& st) { std::stringstream condStream; size_t missingTokens = numTokens - 4; if (missingTokens > 0) { - condStream << " WHERE a"; - missingTokens -= 2; + condStream << " WHERE a"; + missingTokens -= 2; - while (missingTokens > 0) { - condStream << " AND a"; - missingTokens -= 2; - } + while (missingTokens > 0) { + condStream << " AND a"; + missingTokens -= 2; + } } query += condStream.str(); if (targetSize >= query.size()) { - const size_t pad = targetSize - query.size(); - const std::string filler = std::string(pad, 'a'); - query.replace(7, 1, filler); + const size_t pad = targetSize - query.size(); + const std::string filler = std::string(pad, 'a'); + query.replace(7, 1, filler); } else { - // Query can't be the same length as in the other benchmarks. - // Running this will result in unusable data. - fprintf(stderr, "Too many tokens. Query too long for benchmark char limit (%lu > %lu).\n", - query.size(), targetSize); - return; + // Query can't be the same length as in the other benchmarks. + // Running this will result in unusable data. + fprintf(stderr, "Too many tokens. Query too long for benchmark char limit (%lu > %lu).\n", + query.size(), targetSize); + return; } st.counters["num_tokens"] = getNumTokens(query); st.counters["num_chars"] = query.size(); while (st.KeepRunning()) { - hsql::SQLParserResult result; - hsql::SQLParser::parse(query, &result); - if (!result.isValid()) st.SkipWithError("Parsing failed!"); + hsql::SQLParserResult result; + hsql::SQLParser::parse(query, &result); + if (!result.isValid()) st.SkipWithError("Parsing failed!"); } } BENCHMARK(BM_ConditionalTokens) ->RangeMultiplier(1 << 2) ->Ranges({{1 << 14, 1 << 14}, - {1 << 2, 1 << 11}}); + {1 << 2, 1 << 11}}); diff --git a/Data/SQLParser/benchmark/queries.cpp b/Data/SQLParser/benchmark/queries.cpp index f26187d4d..8173f4a7e 100644 --- a/Data/SQLParser/benchmark/queries.cpp +++ b/Data/SQLParser/benchmark/queries.cpp @@ -11,8 +11,8 @@ namespace filesystem = std::filesystem; std::string getQueryName(unsigned i) { if (sql_queries[i].first.empty()) { - std::string name = "#" + std::to_string(i + 1); - return name; + std::string name = "#" + std::to_string(i + 1); + return name; } return std::string("") + sql_queries[i].first; } @@ -22,22 +22,22 @@ std::vector getQueriesFromDirectory(const std::string& dir_path) { std::vector files; for (auto& entry : filesystem::directory_iterator(dir_path)) { - if (filesystem::is_regular_file(entry)) { - std::string path_str = filesystem::path(entry); + if (filesystem::is_regular_file(entry)) { + std::string path_str = filesystem::path(entry); - if (std::regex_search(path_str, query_file_regex)) { - files.push_back(path_str); - } - } + if (std::regex_search(path_str, query_file_regex)) { + files.push_back(path_str); + } + } } std::sort(files.begin(), files.end()); std::vector queries; for (const std::string& file_path : files) { - const filesystem::path p(file_path); - const std::string query = readFileContents(file_path); - queries.emplace_back(p.filename(), query); + const filesystem::path p(file_path); + const std::string query = readFileContents(file_path); + queries.emplace_back(p.filename(), query); } return queries; } diff --git a/Data/SQLParser/src/SQLParser.cpp b/Data/SQLParser/src/SQLParser.cpp index b3bf0dfe1..9ad95a4c7 100644 --- a/Data/SQLParser/src/SQLParser.cpp +++ b/Data/SQLParser/src/SQLParser.cpp @@ -15,9 +15,9 @@ bool SQLParser::parse(const std::string& sql, SQLParserResult* result) { YY_BUFFER_STATE state; if (hsql_lex_init(&scanner)) { - // Couldn't initialize the lexer. - fprintf(stderr, "SQLParser: Error when initializing lexer!\n"); - return false; + // Couldn't initialize the lexer. + fprintf(stderr, "SQLParser: Error when initializing lexer!\n"); + return false; } const char* text = sql.c_str(); state = hsql__scan_string(text, scanner); @@ -44,8 +44,8 @@ bool SQLParser::tokenize(const std::string& sql, std::vector* tokens) { // Initialize the scanner. yyscan_t scanner; if (hsql_lex_init(&scanner)) { - fprintf(stderr, "SQLParser: Error when initializing lexer!\n"); - return false; + fprintf(stderr, "SQLParser: Error when initializing lexer!\n"); + return false; } YY_BUFFER_STATE state; @@ -58,12 +58,12 @@ bool SQLParser::tokenize(const std::string& sql, std::vector* tokens) { // Note: hsql_lex returns int, but we know that its range is within 16 bit. int16_t token = hsql_lex(&yylval, &yylloc, scanner); while (token != 0) { - tokens->push_back(token); - token = hsql_lex(&yylval, &yylloc, scanner); + tokens->push_back(token); + token = hsql_lex(&yylval, &yylloc, scanner); - if (token == SQL_IDENTIFIER || token == SQL_STRING) { - free(yylval.sval); - } + if (token == SQL_IDENTIFIER || token == SQL_STRING) { + free(yylval.sval); + } } hsql__delete_buffer(state, scanner); diff --git a/Data/SQLParser/src/SQLParserResult.cpp b/Data/SQLParser/src/SQLParserResult.cpp index 2d5212f62..58ff6c00a 100644 --- a/Data/SQLParser/src/SQLParserResult.cpp +++ b/Data/SQLParser/src/SQLParserResult.cpp @@ -82,8 +82,8 @@ std::vector SQLParserResult::releaseStatements() { std::vector copy; if (statements_) { - copy = *statements_; - statements_->clear(); + copy = *statements_; + statements_->clear(); } return copy; } @@ -91,28 +91,28 @@ std::vector SQLParserResult::releaseStatements() { void SQLParserResult::reset(bool mv) { if (statements_) { - if (!mv) - { - for (SQLStatement* statement : *statements_) { - delete statement; - } - delete statements_; - } - statements_ = nullptr; + if (!mv) + { + for (SQLStatement* statement : *statements_) { + delete statement; + } + delete statements_; + } + statements_ = nullptr; } if (parameters_) { - if (!mv) delete parameters_; - parameters_ = nullptr; + if (!mv) delete parameters_; + parameters_ = nullptr; } isValid_ = false; if (errorMsg_) { - if (!mv) free(errorMsg_); - errorMsg_ = nullptr; + if (!mv) free(errorMsg_); + errorMsg_ = nullptr; } errorLine_ = -1; errorColumn_ = -1; diff --git a/Data/SQLParser/src/parser/bison_parser.cpp b/Data/SQLParser/src/parser/bison_parser.cpp index 7450cab84..d453d8774 100644 --- a/Data/SQLParser/src/parser/bison_parser.cpp +++ b/Data/SQLParser/src/parser/bison_parser.cpp @@ -103,9 +103,9 @@ using namespace hsql; int yyerror(YYLTYPE * llocp, SQLParserResult * result, yyscan_t scanner, const char* msg) { - result->setIsValid(false); - result->setErrorDetails(strdup(msg), llocp->first_line, llocp->first_column); - return 0; + result->setIsValid(false); + result->setErrorDetails(strdup(msg), llocp->first_line, llocp->first_column); + return 0; } // clang-format off @@ -521,7 +521,7 @@ typedef short yytype_int16; #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST8_MAX <= INT_MAX) + && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; @@ -532,7 +532,7 @@ typedef short yytype_uint8; #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST16_MAX <= INT_MAX) + && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; @@ -571,9 +571,9 @@ typedef int yytype_uint16; #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ - (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ - ? YYPTRDIFF_MAXIMUM \ - : YY_CAST (YYSIZE_T, -1))) + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) @@ -624,16 +624,16 @@ typedef int yy_state_fast_t; #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") # else # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") + _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif @@ -647,10 +647,10 @@ typedef int yy_state_fast_t; #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") + _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN @@ -679,7 +679,7 @@ typedef int yy_state_fast_t; # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif @@ -692,10 +692,10 @@ typedef int yy_state_fast_t; /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else @@ -705,8 +705,8 @@ typedef int yy_state_fast_t; # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -728,9 +728,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #endif /* 1 */ #if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL \ - && defined HSQL_STYPE_IS_TRIVIAL && HSQL_STYPE_IS_TRIVIAL))) + && (! defined __cplusplus \ + || (defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL \ + && defined HSQL_STYPE_IS_TRIVIAL && HSQL_STYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -746,9 +746,9 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ - + YYSIZEOF (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ + + YYSIZEOF (YYLTYPE)) \ + + 2 * YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 @@ -758,15 +758,15 @@ union yyalloc stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF (*yyptr); \ - } \ - while (0) + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) #endif @@ -776,16 +776,16 @@ union yyalloc # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ @@ -819,90 +819,90 @@ union yyalloc as returned by yylex. */ static const yytype_uint8 yytranslate[] = { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 185, 2, 2, - 190, 191, 183, 181, 194, 182, 192, 184, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 193, - 174, 171, 175, 195, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 188, 2, 189, 186, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 172, 173, 176, 177, - 178, 179, 180, 187 + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 185, 2, 2, + 190, 191, 183, 181, 194, 182, 192, 184, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 193, + 174, 171, 175, 195, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 188, 2, 189, 186, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 172, 173, 176, 177, + 178, 179, 180, 187 }; #if HSQL_DEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 322, 322, 341, 347, 354, 358, 362, 363, 364, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 381, 382, 384, 388, 393, 397, 407, 408, 409, 411, - 411, 417, 423, 425, 429, 440, 446, 454, 469, 474, - 475, 481, 487, 498, 499, 504, 515, 528, 540, 547, - 554, 563, 564, 566, 570, 575, 576, 578, 585, 586, - 587, 588, 589, 590, 591, 595, 596, 597, 598, 599, - 600, 601, 602, 603, 604, 605, 607, 608, 610, 611, - 612, 614, 615, 617, 621, 626, 627, 628, 629, 631, - 632, 640, 646, 652, 658, 664, 665, 672, 678, 680, - 690, 697, 708, 715, 723, 724, 731, 738, 742, 747, - 757, 761, 765, 777, 777, 779, 780, 789, 790, 792, - 806, 818, 823, 827, 831, 836, 837, 839, 849, 850, - 852, 854, 855, 857, 859, 860, 862, 867, 869, 870, - 872, 873, 875, 879, 884, 886, 887, 888, 892, 893, - 895, 896, 897, 898, 899, 900, 905, 909, 914, 915, - 917, 921, 926, 934, 934, 934, 934, 934, 936, 937, - 937, 937, 937, 937, 937, 937, 937, 938, 938, 942, - 942, 944, 945, 946, 947, 948, 950, 950, 951, 952, - 953, 954, 955, 956, 957, 958, 959, 961, 962, 964, - 965, 966, 967, 971, 972, 973, 974, 976, 977, 979, - 980, 982, 983, 984, 985, 986, 987, 988, 992, 993, - 997, 998, 1000, 1001, 1006, 1007, 1008, 1012, 1013, 1014, - 1016, 1017, 1018, 1019, 1020, 1022, 1024, 1026, 1027, 1028, - 1029, 1030, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1040, - 1040, 1042, 1044, 1046, 1048, 1049, 1050, 1051, 1053, 1053, - 1053, 1053, 1053, 1053, 1053, 1055, 1057, 1058, 1060, 1061, - 1063, 1065, 1067, 1078, 1082, 1093, 1125, 1134, 1134, 1141, - 1141, 1143, 1143, 1150, 1154, 1159, 1167, 1173, 1177, 1182, - 1183, 1185, 1185, 1187, 1187, 1189, 1190, 1192, 1192, 1198, - 1199, 1201, 1205, 1210, 1216, 1223, 1224, 1225, 1226, 1228, - 1229, 1230, 1236, 1236, 1238, 1240, 1244, 1249, 1259, 1266, - 1274, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, - 1307, 1309, 1315, 1315, 1318, 1322 + 0, 322, 322, 341, 347, 354, 358, 362, 363, 364, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 381, 382, 384, 388, 393, 397, 407, 408, 409, 411, + 411, 417, 423, 425, 429, 440, 446, 454, 469, 474, + 475, 481, 487, 498, 499, 504, 515, 528, 540, 547, + 554, 563, 564, 566, 570, 575, 576, 578, 585, 586, + 587, 588, 589, 590, 591, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 607, 608, 610, 611, + 612, 614, 615, 617, 621, 626, 627, 628, 629, 631, + 632, 640, 646, 652, 658, 664, 665, 672, 678, 680, + 690, 697, 708, 715, 723, 724, 731, 738, 742, 747, + 757, 761, 765, 777, 777, 779, 780, 789, 790, 792, + 806, 818, 823, 827, 831, 836, 837, 839, 849, 850, + 852, 854, 855, 857, 859, 860, 862, 867, 869, 870, + 872, 873, 875, 879, 884, 886, 887, 888, 892, 893, + 895, 896, 897, 898, 899, 900, 905, 909, 914, 915, + 917, 921, 926, 934, 934, 934, 934, 934, 936, 937, + 937, 937, 937, 937, 937, 937, 937, 938, 938, 942, + 942, 944, 945, 946, 947, 948, 950, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 961, 962, 964, + 965, 966, 967, 971, 972, 973, 974, 976, 977, 979, + 980, 982, 983, 984, 985, 986, 987, 988, 992, 993, + 997, 998, 1000, 1001, 1006, 1007, 1008, 1012, 1013, 1014, + 1016, 1017, 1018, 1019, 1020, 1022, 1024, 1026, 1027, 1028, + 1029, 1030, 1031, 1033, 1034, 1035, 1036, 1037, 1038, 1040, + 1040, 1042, 1044, 1046, 1048, 1049, 1050, 1051, 1053, 1053, + 1053, 1053, 1053, 1053, 1053, 1055, 1057, 1058, 1060, 1061, + 1063, 1065, 1067, 1078, 1082, 1093, 1125, 1134, 1134, 1141, + 1141, 1143, 1143, 1150, 1154, 1159, 1167, 1173, 1177, 1182, + 1183, 1185, 1185, 1187, 1187, 1189, 1190, 1192, 1192, 1198, + 1199, 1201, 1205, 1210, 1216, 1223, 1224, 1225, 1226, 1228, + 1229, 1230, 1236, 1236, 1238, 1240, 1244, 1249, 1259, 1266, + 1274, 1298, 1299, 1300, 1301, 1302, 1303, 1304, 1305, 1306, + 1307, 1309, 1315, 1315, 1318, 1322 }; #endif @@ -1003,67 +1003,67 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 577, 63, 101, 112, 195, 101, 188, -39, 108, 67, - 101, 142, 23, 211, 31, 213, 72, 72, 72, 238, - 49, -527, 130, -527, 130, -527, -527, -527, -527, -527, - -527, -527, -527, -527, -527, -527, -527, -23, -527, 252, - 84, -527, 88, 215, -527, 177, 177, 177, 101, 309, - 101, 197, -527, 220, -23, 181, -50, 220, 220, 220, - 101, -527, 193, 143, -527, -527, -527, -527, -527, -527, - 582, -527, 246, -527, -527, 243, 69, -527, 150, -527, - 361, 57, 367, 256, 380, 101, 101, 302, -527, 294, - 203, 402, 374, 101, 232, 236, 424, 424, 424, 426, - 101, 101, -527, 240, 213, -527, 244, 430, 425, -527, - -527, -527, -23, 325, 314, -23, 25, -527, -527, -527, - -527, 441, -527, 442, -527, -527, -527, 266, 265, -527, - -527, -527, -527, 509, -527, -527, -527, -527, -527, -527, - 404, -527, 329, -48, 203, 261, -527, 424, 460, 179, - 293, -46, -527, -527, 373, -527, -527, 353, -527, 353, - 353, -527, -527, -527, -527, -527, 465, -527, -527, 261, - 392, -527, -527, 69, -527, -527, 261, 392, 261, 131, - 350, -527, 259, -527, 57, -527, -527, -527, -527, -527, - -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, - -527, 101, 470, 362, 157, 348, -2, 290, 295, 297, - 135, 349, 296, 369, -527, 257, 40, 395, -527, -527, - -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, - -527, -527, -527, -527, 384, -527, -125, 298, -527, 261, - 402, -527, 450, -527, -527, 444, -527, 302, -527, 300, - 107, -527, 396, 304, -527, 37, 25, -23, 310, -527, - -47, 25, 40, 439, 35, 90, -527, 350, -527, -527, - -527, 306, 411, -527, 668, 385, 318, 133, -527, -527, - -527, 362, 9, 19, 451, 259, 261, 261, -59, 106, - 320, 369, 622, 261, 173, 321, -58, 261, 261, 369, - -527, 369, -28, 323, 71, 369, 369, 369, 369, 369, - 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, - 430, 101, -527, 508, 57, 40, -527, 220, 309, -527, - 57, -527, 465, 24, 302, -527, 261, -527, 511, -527, - -527, -527, -527, 261, -527, -527, -527, 350, 261, 261, - -527, 352, 394, -527, -51, -527, 460, 424, -527, -527, - 327, -527, 330, -527, -527, 334, -527, -527, 337, -527, - -527, -527, -527, 338, -527, -527, 45, 339, 460, -527, - 157, -527, 452, 261, -527, -527, 328, 440, 163, 53, - 180, 261, 261, -527, 451, 434, -3, -527, -527, -527, - 420, 544, 660, 369, 351, 257, -527, 433, 354, 660, - 660, 660, 660, 684, 684, 684, 684, 173, 173, 47, - 47, 47, -89, 356, -527, -527, 138, 537, -527, 140, - -527, 362, -527, 381, -527, 355, -527, 38, -527, 473, - -527, -527, -527, -527, 40, 40, -527, 483, 460, -527, - 386, -527, 147, -527, 541, 547, -527, 548, 549, 550, - -527, 428, -527, -527, 453, -527, 45, -527, 460, 148, - -527, 370, -527, 154, -527, 261, 668, 261, 261, -527, - 122, 185, 366, -527, 369, 660, 257, 371, 169, -527, - -527, -527, -527, -527, 372, 461, -527, -527, -527, 486, - 492, 493, 485, 24, 583, -527, -527, -527, 459, -527, - -527, -108, -527, -527, 397, 174, 400, 403, 405, -527, - -527, -527, 176, -527, 484, 452, -33, 409, 40, 160, - -527, 261, -527, 622, 410, 187, -527, -527, 38, 24, - -527, -527, -527, 24, 399, 412, 261, -527, -527, -527, - 589, -527, -527, -527, -527, 477, 392, -527, -527, -527, - -527, 40, -527, -527, -527, -527, 687, 460, -22, 415, - 261, 226, 417, 261, 191, 261, -527, -527, 304, -527, - -527, -527, 418, 22, 21, 40, -527, -527, 40, -527, - 208, 26, 239, -527, -527, 419, 421, -527, -527, 496, - -527, -527, -527, 26, -527 + 577, 63, 101, 112, 195, 101, 188, -39, 108, 67, + 101, 142, 23, 211, 31, 213, 72, 72, 72, 238, + 49, -527, 130, -527, 130, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -23, -527, 252, + 84, -527, 88, 215, -527, 177, 177, 177, 101, 309, + 101, 197, -527, 220, -23, 181, -50, 220, 220, 220, + 101, -527, 193, 143, -527, -527, -527, -527, -527, -527, + 582, -527, 246, -527, -527, 243, 69, -527, 150, -527, + 361, 57, 367, 256, 380, 101, 101, 302, -527, 294, + 203, 402, 374, 101, 232, 236, 424, 424, 424, 426, + 101, 101, -527, 240, 213, -527, 244, 430, 425, -527, + -527, -527, -23, 325, 314, -23, 25, -527, -527, -527, + -527, 441, -527, 442, -527, -527, -527, 266, 265, -527, + -527, -527, -527, 509, -527, -527, -527, -527, -527, -527, + 404, -527, 329, -48, 203, 261, -527, 424, 460, 179, + 293, -46, -527, -527, 373, -527, -527, 353, -527, 353, + 353, -527, -527, -527, -527, -527, 465, -527, -527, 261, + 392, -527, -527, 69, -527, -527, 261, 392, 261, 131, + 350, -527, 259, -527, 57, -527, -527, -527, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, 101, 470, 362, 157, 348, -2, 290, 295, 297, + 135, 349, 296, 369, -527, 257, 40, 395, -527, -527, + -527, -527, -527, -527, -527, -527, -527, -527, -527, -527, + -527, -527, -527, -527, 384, -527, -125, 298, -527, 261, + 402, -527, 450, -527, -527, 444, -527, 302, -527, 300, + 107, -527, 396, 304, -527, 37, 25, -23, 310, -527, + -47, 25, 40, 439, 35, 90, -527, 350, -527, -527, + -527, 306, 411, -527, 668, 385, 318, 133, -527, -527, + -527, 362, 9, 19, 451, 259, 261, 261, -59, 106, + 320, 369, 622, 261, 173, 321, -58, 261, 261, 369, + -527, 369, -28, 323, 71, 369, 369, 369, 369, 369, + 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, + 430, 101, -527, 508, 57, 40, -527, 220, 309, -527, + 57, -527, 465, 24, 302, -527, 261, -527, 511, -527, + -527, -527, -527, 261, -527, -527, -527, 350, 261, 261, + -527, 352, 394, -527, -51, -527, 460, 424, -527, -527, + 327, -527, 330, -527, -527, 334, -527, -527, 337, -527, + -527, -527, -527, 338, -527, -527, 45, 339, 460, -527, + 157, -527, 452, 261, -527, -527, 328, 440, 163, 53, + 180, 261, 261, -527, 451, 434, -3, -527, -527, -527, + 420, 544, 660, 369, 351, 257, -527, 433, 354, 660, + 660, 660, 660, 684, 684, 684, 684, 173, 173, 47, + 47, 47, -89, 356, -527, -527, 138, 537, -527, 140, + -527, 362, -527, 381, -527, 355, -527, 38, -527, 473, + -527, -527, -527, -527, 40, 40, -527, 483, 460, -527, + 386, -527, 147, -527, 541, 547, -527, 548, 549, 550, + -527, 428, -527, -527, 453, -527, 45, -527, 460, 148, + -527, 370, -527, 154, -527, 261, 668, 261, 261, -527, + 122, 185, 366, -527, 369, 660, 257, 371, 169, -527, + -527, -527, -527, -527, 372, 461, -527, -527, -527, 486, + 492, 493, 485, 24, 583, -527, -527, -527, 459, -527, + -527, -108, -527, -527, 397, 174, 400, 403, 405, -527, + -527, -527, 176, -527, 484, 452, -33, 409, 40, 160, + -527, 261, -527, 622, 410, 187, -527, -527, 38, 24, + -527, -527, -527, 24, 399, 412, 261, -527, -527, -527, + 589, -527, -527, -527, -527, 477, 392, -527, -527, -527, + -527, 40, -527, -527, -527, -527, 687, 460, -22, 415, + 261, 226, 417, 261, 191, 261, -527, -527, 304, -527, + -527, -527, 418, 22, 21, 40, -527, -527, 40, -527, + 208, 26, 239, -527, -527, 419, 421, -527, -527, 496, + -527, -527, -527, 26, -527 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1071,103 +1071,103 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 30, 30, 30, 0, - 333, 3, 21, 19, 21, 18, 8, 9, 7, 11, - 16, 17, 13, 14, 12, 15, 10, 0, 312, 0, - 287, 101, 33, 0, 45, 52, 52, 52, 0, 0, - 0, 0, 286, 96, 0, 0, 0, 96, 96, 96, - 0, 43, 0, 314, 315, 29, 26, 28, 27, 1, - 313, 2, 0, 6, 5, 149, 110, 111, 141, 93, - 0, 159, 0, 0, 290, 0, 0, 135, 37, 0, - 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 44, 0, 0, 4, 0, 0, 129, 123, - 124, 122, 0, 126, 0, 0, 155, 288, 265, 268, - 270, 0, 271, 0, 266, 267, 276, 0, 158, 160, - 258, 259, 260, 269, 261, 262, 263, 264, 32, 31, - 0, 289, 0, 0, 105, 0, 100, 0, 0, 0, - 0, 135, 107, 95, 0, 118, 117, 40, 38, 40, - 40, 94, 91, 92, 317, 316, 0, 148, 128, 0, - 141, 114, 113, 115, 125, 121, 0, 141, 0, 0, - 300, 272, 275, 34, 0, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 273, - 51, 0, 0, 313, 0, 0, 254, 0, 0, 0, - 0, 0, 0, 0, 256, 0, 134, 163, 170, 171, - 172, 165, 167, 173, 166, 186, 174, 175, 176, 177, - 169, 164, 179, 180, 0, 334, 0, 0, 103, 0, - 0, 106, 0, 97, 98, 0, 42, 135, 41, 24, - 0, 22, 132, 130, 156, 298, 155, 0, 140, 142, - 147, 155, 151, 153, 150, 0, 119, 299, 301, 274, - 161, 0, 0, 48, 0, 0, 0, 0, 53, 55, - 56, 313, 129, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 182, 0, 181, 0, 0, 0, 0, 0, - 183, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 104, 0, 0, 109, 108, 96, 0, 36, - 0, 20, 0, 0, 135, 131, 0, 296, 0, 297, - 162, 112, 116, 0, 146, 145, 144, 300, 0, 0, - 305, 0, 0, 307, 311, 302, 0, 0, 74, 68, - 0, 70, 80, 71, 58, 0, 65, 66, 0, 62, - 63, 69, 72, 77, 67, 59, 82, 0, 0, 47, - 0, 50, 221, 0, 255, 257, 0, 0, 0, 0, - 0, 0, 0, 205, 0, 0, 0, 178, 168, 197, - 198, 0, 193, 0, 0, 0, 184, 0, 196, 195, - 211, 212, 213, 214, 215, 216, 217, 188, 187, 190, - 189, 191, 192, 0, 35, 335, 0, 0, 39, 0, - 23, 313, 133, 277, 279, 0, 281, 294, 280, 137, - 157, 295, 143, 120, 154, 152, 308, 0, 0, 310, - 0, 303, 0, 46, 0, 0, 64, 0, 0, 0, - 73, 0, 86, 87, 0, 57, 81, 83, 0, 0, - 54, 0, 218, 0, 209, 0, 0, 0, 0, 203, - 0, 0, 0, 251, 0, 194, 0, 0, 0, 185, - 252, 102, 99, 25, 0, 0, 329, 321, 327, 325, - 328, 323, 0, 0, 0, 293, 285, 291, 0, 127, - 306, 311, 309, 49, 0, 0, 0, 0, 0, 85, - 88, 84, 0, 90, 223, 221, 0, 0, 207, 0, - 206, 0, 210, 253, 0, 0, 201, 199, 294, 0, - 324, 326, 322, 0, 278, 295, 0, 304, 61, 79, - 0, 75, 60, 76, 89, 0, 141, 219, 235, 236, - 204, 208, 202, 200, 282, 318, 330, 0, 139, 0, - 0, 226, 0, 0, 0, 0, 136, 78, 222, 227, - 228, 229, 0, 0, 0, 331, 319, 292, 138, 220, - 0, 0, 0, 234, 224, 254, 0, 233, 231, 0, - 232, 230, 320, 0, 225 + 313, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 30, 30, 30, 0, + 333, 3, 21, 19, 21, 18, 8, 9, 7, 11, + 16, 17, 13, 14, 12, 15, 10, 0, 312, 0, + 287, 101, 33, 0, 45, 52, 52, 52, 0, 0, + 0, 0, 286, 96, 0, 0, 0, 96, 96, 96, + 0, 43, 0, 314, 315, 29, 26, 28, 27, 1, + 313, 2, 0, 6, 5, 149, 110, 111, 141, 93, + 0, 159, 0, 0, 290, 0, 0, 135, 37, 0, + 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 44, 0, 0, 4, 0, 0, 129, 123, + 124, 122, 0, 126, 0, 0, 155, 288, 265, 268, + 270, 0, 271, 0, 266, 267, 276, 0, 158, 160, + 258, 259, 260, 269, 261, 262, 263, 264, 32, 31, + 0, 289, 0, 0, 105, 0, 100, 0, 0, 0, + 0, 135, 107, 95, 0, 118, 117, 40, 38, 40, + 40, 94, 91, 92, 317, 316, 0, 148, 128, 0, + 141, 114, 113, 115, 125, 121, 0, 141, 0, 0, + 300, 272, 275, 34, 0, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 273, + 51, 0, 0, 313, 0, 0, 254, 0, 0, 0, + 0, 0, 0, 0, 256, 0, 134, 163, 170, 171, + 172, 165, 167, 173, 166, 186, 174, 175, 176, 177, + 169, 164, 179, 180, 0, 334, 0, 0, 103, 0, + 0, 106, 0, 97, 98, 0, 42, 135, 41, 24, + 0, 22, 132, 130, 156, 298, 155, 0, 140, 142, + 147, 155, 151, 153, 150, 0, 119, 299, 301, 274, + 161, 0, 0, 48, 0, 0, 0, 0, 53, 55, + 56, 313, 129, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 182, 0, 181, 0, 0, 0, 0, 0, + 183, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 104, 0, 0, 109, 108, 96, 0, 36, + 0, 20, 0, 0, 135, 131, 0, 296, 0, 297, + 162, 112, 116, 0, 146, 145, 144, 300, 0, 0, + 305, 0, 0, 307, 311, 302, 0, 0, 74, 68, + 0, 70, 80, 71, 58, 0, 65, 66, 0, 62, + 63, 69, 72, 77, 67, 59, 82, 0, 0, 47, + 0, 50, 221, 0, 255, 257, 0, 0, 0, 0, + 0, 0, 0, 205, 0, 0, 0, 178, 168, 197, + 198, 0, 193, 0, 0, 0, 184, 0, 196, 195, + 211, 212, 213, 214, 215, 216, 217, 188, 187, 190, + 189, 191, 192, 0, 35, 335, 0, 0, 39, 0, + 23, 313, 133, 277, 279, 0, 281, 294, 280, 137, + 157, 295, 143, 120, 154, 152, 308, 0, 0, 310, + 0, 303, 0, 46, 0, 0, 64, 0, 0, 0, + 73, 0, 86, 87, 0, 57, 81, 83, 0, 0, + 54, 0, 218, 0, 209, 0, 0, 0, 0, 203, + 0, 0, 0, 251, 0, 194, 0, 0, 0, 185, + 252, 102, 99, 25, 0, 0, 329, 321, 327, 325, + 328, 323, 0, 0, 0, 293, 285, 291, 0, 127, + 306, 311, 309, 49, 0, 0, 0, 0, 0, 85, + 88, 84, 0, 90, 223, 221, 0, 0, 207, 0, + 206, 0, 210, 253, 0, 0, 201, 199, 294, 0, + 324, 326, 322, 0, 278, 295, 0, 304, 61, 79, + 0, 75, 60, 76, 89, 0, 141, 219, 235, 236, + 204, 208, 202, 200, 282, 318, 330, 0, 139, 0, + 0, 226, 0, 0, 0, 0, 136, 78, 222, 227, + 228, 229, 0, 0, 0, 331, 319, 292, 138, 220, + 0, 0, 0, 234, 224, 254, 0, 233, 231, 0, + 232, 230, 320, 0, 225 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -527, -527, -527, 540, -527, 591, -527, 284, -527, 401, - -527, -527, -527, -527, 292, -87, 262, -527, -527, -527, - 379, -527, 241, -527, 149, -527, -527, -527, -527, 158, - -527, -527, -52, -527, -527, -527, -527, -527, -527, 482, - -527, -527, 387, -185, -84, -527, 168, -54, -30, -527, - -527, -82, 346, -527, -527, -527, -100, -527, -527, -169, - -527, 288, -527, -527, 30, -289, -527, -242, 301, -142, - -188, -527, -527, -527, -527, -527, -527, 344, -527, -527, - -527, 111, -527, -527, -527, -526, -527, -527, -136, -527, - -527, -527, -527, -527, 54, -79, -83, -527, -527, -91, - -527, -527, -527, -527, -527, -460, 94, -527, -527, -527, - 7, -527, -527, 103, 389, -527, 315, -527, 375, -527, - 128, -527, -527, -527, 543, -527, -527, -527, -527, -336 + -527, -527, -527, 540, -527, 591, -527, 284, -527, 401, + -527, -527, -527, -527, 292, -87, 262, -527, -527, -527, + 379, -527, 241, -527, 149, -527, -527, -527, -527, 158, + -527, -527, -52, -527, -527, -527, -527, -527, -527, 482, + -527, -527, 387, -185, -84, -527, 168, -54, -30, -527, + -527, -82, 346, -527, -527, -527, -100, -527, -527, -169, + -527, 288, -527, -527, 30, -289, -527, -242, 301, -142, + -188, -527, -527, -527, -527, -527, -527, 344, -527, -527, + -527, 111, -527, -527, -527, -526, -527, -527, -136, -527, + -527, -527, -527, -527, 54, -79, -83, -527, -527, -91, + -527, -527, -527, -527, -527, -460, 94, -527, -527, -527, + 7, -527, -527, 103, 389, -527, 315, -527, 375, -527, + 128, -527, -527, -527, 543, -527, -527, -527, -527, -336 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 19, 20, 21, 22, 73, 250, 251, 23, 66, - 24, 139, 25, 26, 89, 157, 246, 27, 28, 29, - 84, 277, 278, 279, 376, 460, 456, 465, 466, 467, - 280, 30, 93, 31, 243, 244, 32, 33, 34, 149, - 35, 151, 152, 36, 170, 171, 172, 77, 112, 113, - 175, 78, 169, 252, 334, 335, 146, 509, 576, 116, - 258, 259, 346, 108, 180, 253, 127, 128, 254, 255, - 217, 218, 219, 220, 221, 222, 223, 289, 224, 225, - 226, 472, 556, 582, 583, 594, 227, 228, 197, 198, - 199, 229, 230, 231, 232, 233, 130, 131, 132, 133, - 134, 135, 136, 137, 432, 433, 434, 435, 436, 51, - 437, 142, 505, 506, 507, 340, 266, 267, 268, 354, - 451, 37, 38, 63, 64, 438, 502, 586, 71, 236 + 0, 19, 20, 21, 22, 73, 250, 251, 23, 66, + 24, 139, 25, 26, 89, 157, 246, 27, 28, 29, + 84, 277, 278, 279, 376, 460, 456, 465, 466, 467, + 280, 30, 93, 31, 243, 244, 32, 33, 34, 149, + 35, 151, 152, 36, 170, 171, 172, 77, 112, 113, + 175, 78, 169, 252, 334, 335, 146, 509, 576, 116, + 258, 259, 346, 108, 180, 253, 127, 128, 254, 255, + 217, 218, 219, 220, 221, 222, 223, 289, 224, 225, + 226, 472, 556, 582, 583, 594, 227, 228, 197, 198, + 199, 229, 230, 231, 232, 233, 130, 131, 132, 133, + 134, 135, 136, 137, 432, 433, 434, 435, 436, 51, + 437, 142, 505, 506, 507, 340, 266, 267, 268, 354, + 451, 37, 38, 63, 64, 438, 502, 586, 71, 236 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1175,331 +1175,331 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 95, 256, 129, 216, 396, 99, 100, 101, 261, 41, - 159, 160, 44, 158, 158, 158, 167, 52, 273, 56, - 452, 168, 384, 292, 595, 294, 40, 40, 590, 575, - 173, 177, 590, 173, 260, 75, 262, 264, 145, 591, - 337, 337, 469, 544, 344, 97, 269, 202, 115, 305, - 60, 241, 449, 450, 287, 87, 48, 90, 297, 297, - 234, 118, 119, 120, 158, 599, 322, 102, 288, 323, - 297, 345, 461, 296, 403, 298, 298, 604, 109, 203, - 178, 448, 426, 566, 297, 98, 323, 298, 429, 39, - 349, 61, 143, 144, 473, 238, 381, 325, 179, 320, - 154, 298, 404, 292, 40, 270, 462, 162, 163, 449, - 450, 401, 511, 402, 110, 42, 488, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, - 421, 422, 522, 398, 206, 118, 119, 120, 206, 118, - 119, 120, 204, 257, 388, 389, 121, 329, 240, 387, - 463, 111, 297, 350, 297, 399, 400, 297, 558, 109, - 274, 295, 122, 477, 338, 504, 50, 54, 464, 298, - 297, 298, 336, 342, 298, 173, 406, 207, 208, 209, - 55, 207, 208, 209, 275, 305, 483, 298, 282, 592, - 283, 336, 593, 592, 407, 110, 593, 535, 43, 391, - 382, 260, 385, 49, 214, 76, 444, 445, 271, 123, - 124, 125, 351, 54, 431, 485, 62, 210, 276, 392, - 121, 210, 94, 53, 121, 393, 352, 114, 65, 423, - 386, 574, 111, 319, 439, 320, 122, 75, 69, 297, - 122, 530, 70, 237, 72, 129, 494, 263, 287, 480, - 481, 129, 126, 353, 211, 79, 298, 568, 211, 45, - 206, 118, 119, 120, 206, 118, 119, 120, 212, 46, - 453, 164, 212, 478, 158, 427, 80, 297, 81, 560, - 297, 578, 57, 123, 124, 125, 341, 123, 124, 125, - 476, 347, 58, 392, 298, 531, 533, 298, 331, 479, - 47, 332, 297, 207, 208, 209, 83, 207, 208, 209, - 82, 305, 88, 213, 214, 75, 96, 213, 214, 298, - 103, 215, 91, 59, 379, 215, 126, 380, 424, 491, - 126, 493, 184, 526, 184, 528, 529, 104, 513, 523, - 482, 323, 323, 210, 106, 525, 121, 210, 336, 92, - 121, 487, 206, 118, 119, 120, 316, 317, 318, 319, - 537, 320, 122, 336, 117, 549, 122, 554, 550, 107, - 323, 138, 206, 118, 119, 120, 597, 598, 563, 140, - 211, 336, 587, 141, 211, 323, 145, 571, 147, 561, - 579, 580, 581, 148, 212, 290, 208, 209, 212, 185, - 186, 187, 188, 189, 190, 150, 495, 600, 601, 123, - 124, 125, 299, 123, 124, 125, 208, 209, 67, 68, - 153, 247, 248, 155, 495, 85, 86, 156, 118, 161, - 54, 585, 534, 588, 166, 210, 120, 168, 121, 213, - 214, 174, 176, 213, 214, 181, 182, 215, 496, 300, - 200, 215, 126, 497, 122, 210, 126, 183, 121, 184, - 498, 499, 201, 235, 239, 242, 496, 245, 249, 114, - 265, 497, 291, 272, 122, 281, 15, 500, 498, 499, - 284, -330, 501, 321, 293, 285, 212, 286, 324, 327, - 330, 333, 291, 328, 348, 500, 356, 301, 336, -330, - 501, 123, 124, 125, 343, 357, 212, 377, 378, 75, - 394, 425, 397, 405, 441, 446, 447, 454, 302, 474, - 455, 123, 124, 125, 457, 303, 304, 458, 459, 468, - 471, 213, 214, 305, 306, 475, 403, 297, 489, 215, - 492, 486, 320, 508, 126, 490, 510, 514, 512, 503, - 519, 213, 214, 515, 516, 517, 518, 532, 520, 215, - 524, 539, 536, 538, 126, 540, 307, 308, 309, 310, - 311, 541, 542, 312, 313, -283, 314, 315, 316, 317, - 318, 319, -332, 320, 1, 543, 545, 546, 548, 1, - 555, 551, 2, -284, 552, 569, 553, 2, 300, 3, - 559, 562, 567, 4, 3, 570, 577, 584, 4, 589, - 105, 283, 602, 603, 5, 74, 430, 6, 7, 5, - 428, 470, 6, 7, 521, 527, 205, 326, 383, 8, - 9, 442, 390, 565, 8, 9, 557, 440, 596, 547, - 10, 564, 355, 11, 339, 10, 301, 165, 11, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 484, 443, 0, 0, 12, 0, 395, 0, 13, - 12, 0, 0, 0, 13, 304, 300, 0, 0, 358, - 0, 0, 305, 306, 0, 14, 0, 0, 0, 0, - 14, 15, 359, 0, 0, 0, 15, 360, 361, 362, - 363, 364, 0, 365, 0, 0, 0, 0, 0, 0, - 0, 366, 495, 0, 300, 307, 308, 309, 310, 311, - 0, 0, 312, 313, 301, 314, 315, 316, 317, 318, - 319, 0, 320, 0, 16, 17, 18, 367, 300, 16, - 17, 18, 0, 0, 0, 395, 0, 0, 0, 0, - 0, 0, 0, 304, 496, 368, 0, 369, 370, 497, - 305, 306, -333, 0, 0, 0, 498, 499, 0, 0, - 572, 0, 371, 0, 0, 0, 0, 372, 0, 373, - 0, 0, 0, 500, 0, 0, 0, 0, 501, 374, - 0, 304, 0, 307, 308, 309, 310, 311, 305, -333, - 312, 313, 0, 314, 315, 316, 317, 318, 319, 0, - 320, 0, 0, 0, 0, 304, 0, 0, 0, 0, - 573, 0, 305, 375, 0, 0, 0, 0, 0, 0, - 0, -333, -333, -333, 310, 311, 0, 0, 312, 313, - 0, 314, 315, 316, 317, 318, 319, 0, 320, 0, - 0, 0, 0, 0, 0, 0, 0, 0, -333, -333, - 0, 0, -333, -333, 0, 314, 315, 316, 317, 318, - 319, 0, 320 + 95, 256, 129, 216, 396, 99, 100, 101, 261, 41, + 159, 160, 44, 158, 158, 158, 167, 52, 273, 56, + 452, 168, 384, 292, 595, 294, 40, 40, 590, 575, + 173, 177, 590, 173, 260, 75, 262, 264, 145, 591, + 337, 337, 469, 544, 344, 97, 269, 202, 115, 305, + 60, 241, 449, 450, 287, 87, 48, 90, 297, 297, + 234, 118, 119, 120, 158, 599, 322, 102, 288, 323, + 297, 345, 461, 296, 403, 298, 298, 604, 109, 203, + 178, 448, 426, 566, 297, 98, 323, 298, 429, 39, + 349, 61, 143, 144, 473, 238, 381, 325, 179, 320, + 154, 298, 404, 292, 40, 270, 462, 162, 163, 449, + 450, 401, 511, 402, 110, 42, 488, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, 422, 522, 398, 206, 118, 119, 120, 206, 118, + 119, 120, 204, 257, 388, 389, 121, 329, 240, 387, + 463, 111, 297, 350, 297, 399, 400, 297, 558, 109, + 274, 295, 122, 477, 338, 504, 50, 54, 464, 298, + 297, 298, 336, 342, 298, 173, 406, 207, 208, 209, + 55, 207, 208, 209, 275, 305, 483, 298, 282, 592, + 283, 336, 593, 592, 407, 110, 593, 535, 43, 391, + 382, 260, 385, 49, 214, 76, 444, 445, 271, 123, + 124, 125, 351, 54, 431, 485, 62, 210, 276, 392, + 121, 210, 94, 53, 121, 393, 352, 114, 65, 423, + 386, 574, 111, 319, 439, 320, 122, 75, 69, 297, + 122, 530, 70, 237, 72, 129, 494, 263, 287, 480, + 481, 129, 126, 353, 211, 79, 298, 568, 211, 45, + 206, 118, 119, 120, 206, 118, 119, 120, 212, 46, + 453, 164, 212, 478, 158, 427, 80, 297, 81, 560, + 297, 578, 57, 123, 124, 125, 341, 123, 124, 125, + 476, 347, 58, 392, 298, 531, 533, 298, 331, 479, + 47, 332, 297, 207, 208, 209, 83, 207, 208, 209, + 82, 305, 88, 213, 214, 75, 96, 213, 214, 298, + 103, 215, 91, 59, 379, 215, 126, 380, 424, 491, + 126, 493, 184, 526, 184, 528, 529, 104, 513, 523, + 482, 323, 323, 210, 106, 525, 121, 210, 336, 92, + 121, 487, 206, 118, 119, 120, 316, 317, 318, 319, + 537, 320, 122, 336, 117, 549, 122, 554, 550, 107, + 323, 138, 206, 118, 119, 120, 597, 598, 563, 140, + 211, 336, 587, 141, 211, 323, 145, 571, 147, 561, + 579, 580, 581, 148, 212, 290, 208, 209, 212, 185, + 186, 187, 188, 189, 190, 150, 495, 600, 601, 123, + 124, 125, 299, 123, 124, 125, 208, 209, 67, 68, + 153, 247, 248, 155, 495, 85, 86, 156, 118, 161, + 54, 585, 534, 588, 166, 210, 120, 168, 121, 213, + 214, 174, 176, 213, 214, 181, 182, 215, 496, 300, + 200, 215, 126, 497, 122, 210, 126, 183, 121, 184, + 498, 499, 201, 235, 239, 242, 496, 245, 249, 114, + 265, 497, 291, 272, 122, 281, 15, 500, 498, 499, + 284, -330, 501, 321, 293, 285, 212, 286, 324, 327, + 330, 333, 291, 328, 348, 500, 356, 301, 336, -330, + 501, 123, 124, 125, 343, 357, 212, 377, 378, 75, + 394, 425, 397, 405, 441, 446, 447, 454, 302, 474, + 455, 123, 124, 125, 457, 303, 304, 458, 459, 468, + 471, 213, 214, 305, 306, 475, 403, 297, 489, 215, + 492, 486, 320, 508, 126, 490, 510, 514, 512, 503, + 519, 213, 214, 515, 516, 517, 518, 532, 520, 215, + 524, 539, 536, 538, 126, 540, 307, 308, 309, 310, + 311, 541, 542, 312, 313, -283, 314, 315, 316, 317, + 318, 319, -332, 320, 1, 543, 545, 546, 548, 1, + 555, 551, 2, -284, 552, 569, 553, 2, 300, 3, + 559, 562, 567, 4, 3, 570, 577, 584, 4, 589, + 105, 283, 602, 603, 5, 74, 430, 6, 7, 5, + 428, 470, 6, 7, 521, 527, 205, 326, 383, 8, + 9, 442, 390, 565, 8, 9, 557, 440, 596, 547, + 10, 564, 355, 11, 339, 10, 301, 165, 11, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 484, 443, 0, 0, 12, 0, 395, 0, 13, + 12, 0, 0, 0, 13, 304, 300, 0, 0, 358, + 0, 0, 305, 306, 0, 14, 0, 0, 0, 0, + 14, 15, 359, 0, 0, 0, 15, 360, 361, 362, + 363, 364, 0, 365, 0, 0, 0, 0, 0, 0, + 0, 366, 495, 0, 300, 307, 308, 309, 310, 311, + 0, 0, 312, 313, 301, 314, 315, 316, 317, 318, + 319, 0, 320, 0, 16, 17, 18, 367, 300, 16, + 17, 18, 0, 0, 0, 395, 0, 0, 0, 0, + 0, 0, 0, 304, 496, 368, 0, 369, 370, 497, + 305, 306, -333, 0, 0, 0, 498, 499, 0, 0, + 572, 0, 371, 0, 0, 0, 0, 372, 0, 373, + 0, 0, 0, 500, 0, 0, 0, 0, 501, 374, + 0, 304, 0, 307, 308, 309, 310, 311, 305, -333, + 312, 313, 0, 314, 315, 316, 317, 318, 319, 0, + 320, 0, 0, 0, 0, 304, 0, 0, 0, 0, + 573, 0, 305, 375, 0, 0, 0, 0, 0, 0, + 0, -333, -333, -333, 310, 311, 0, 0, 312, 313, + 0, 314, 315, 316, 317, 318, 319, 0, 320, 0, + 0, 0, 0, 0, 0, 0, 0, 0, -333, -333, + 0, 0, -333, -333, 0, 314, 315, 316, 317, 318, + 319, 0, 320 }; static const yytype_int16 yycheck[] = { - 54, 170, 81, 145, 293, 57, 58, 59, 177, 2, - 97, 98, 5, 96, 97, 98, 107, 10, 203, 12, - 356, 12, 3, 211, 3, 213, 3, 3, 6, 51, - 112, 115, 6, 115, 176, 58, 178, 179, 84, 17, - 3, 3, 378, 503, 91, 95, 182, 95, 78, 138, - 19, 151, 160, 161, 113, 48, 95, 50, 117, 117, - 147, 4, 5, 6, 147, 591, 191, 60, 210, 194, - 117, 118, 27, 215, 102, 134, 134, 603, 9, 127, - 55, 132, 324, 543, 117, 135, 194, 134, 330, 26, - 55, 60, 85, 86, 383, 149, 281, 239, 73, 188, - 93, 134, 130, 291, 3, 184, 61, 100, 101, 160, - 161, 299, 448, 301, 45, 3, 405, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 468, 191, 3, 4, 5, 6, 3, 4, - 5, 6, 190, 173, 286, 287, 89, 247, 194, 285, - 105, 82, 117, 63, 117, 297, 298, 117, 191, 9, - 3, 215, 105, 110, 127, 127, 99, 190, 123, 134, - 117, 134, 194, 257, 134, 257, 105, 46, 47, 48, - 12, 46, 47, 48, 27, 138, 189, 134, 190, 167, - 192, 194, 170, 167, 123, 45, 170, 486, 3, 93, - 191, 343, 183, 95, 183, 37, 348, 349, 201, 152, - 153, 154, 122, 190, 190, 403, 3, 86, 61, 113, - 89, 86, 54, 81, 89, 119, 136, 77, 156, 320, - 284, 567, 82, 186, 334, 188, 105, 58, 0, 117, - 105, 119, 193, 64, 114, 324, 431, 116, 113, 391, - 392, 330, 195, 163, 123, 3, 134, 546, 123, 71, - 3, 4, 5, 6, 3, 4, 5, 6, 137, 81, - 357, 103, 137, 93, 357, 327, 192, 117, 190, 119, - 117, 570, 71, 152, 153, 154, 256, 152, 153, 154, - 127, 261, 81, 113, 134, 110, 484, 134, 191, 119, - 112, 194, 117, 46, 47, 48, 129, 46, 47, 48, - 95, 138, 3, 182, 183, 58, 135, 182, 183, 134, - 127, 190, 125, 112, 191, 190, 195, 194, 321, 191, - 195, 191, 194, 475, 194, 477, 478, 194, 191, 191, - 394, 194, 194, 86, 98, 191, 89, 86, 194, 129, - 89, 405, 3, 4, 5, 6, 183, 184, 185, 186, - 191, 188, 105, 194, 3, 191, 105, 191, 194, 126, - 194, 4, 3, 4, 5, 6, 168, 169, 191, 123, - 123, 194, 191, 3, 123, 194, 84, 556, 94, 531, - 164, 165, 166, 190, 137, 46, 47, 48, 137, 140, - 141, 142, 143, 144, 145, 3, 25, 168, 169, 152, - 153, 154, 17, 152, 153, 154, 47, 48, 17, 18, - 46, 159, 160, 191, 25, 46, 47, 191, 4, 3, - 190, 573, 486, 575, 190, 86, 6, 12, 89, 182, - 183, 116, 128, 182, 183, 4, 4, 190, 67, 54, - 46, 190, 195, 72, 105, 86, 195, 191, 89, 194, - 79, 80, 133, 3, 171, 92, 67, 114, 3, 77, - 120, 72, 123, 3, 105, 127, 114, 96, 79, 80, - 190, 100, 101, 99, 188, 190, 137, 190, 190, 39, - 190, 95, 123, 49, 55, 96, 190, 102, 194, 100, - 101, 152, 153, 154, 194, 94, 137, 122, 190, 58, - 190, 3, 191, 190, 3, 163, 122, 190, 123, 191, - 190, 152, 153, 154, 190, 130, 131, 190, 190, 190, - 78, 182, 183, 138, 139, 95, 102, 117, 105, 190, - 3, 190, 188, 70, 195, 189, 63, 6, 162, 194, - 122, 182, 183, 6, 6, 6, 6, 191, 105, 190, - 190, 100, 191, 191, 195, 79, 171, 172, 173, 174, - 175, 79, 79, 178, 179, 194, 181, 182, 183, 184, - 185, 186, 0, 188, 7, 100, 3, 128, 191, 7, - 106, 191, 15, 194, 191, 6, 191, 15, 54, 22, - 191, 191, 190, 26, 22, 128, 191, 190, 26, 191, - 70, 192, 191, 117, 37, 24, 332, 40, 41, 37, - 328, 380, 40, 41, 466, 476, 144, 240, 282, 52, - 53, 343, 288, 539, 52, 53, 525, 336, 584, 511, - 63, 538, 267, 66, 255, 63, 102, 104, 66, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 117, 347, -1, -1, 88, -1, 123, -1, 92, - 88, -1, -1, -1, 92, 131, 54, -1, -1, 11, - -1, -1, 138, 139, -1, 108, -1, -1, -1, -1, - 108, 114, 24, -1, -1, -1, 114, 29, 30, 31, - 32, 33, -1, 35, -1, -1, -1, -1, -1, -1, - -1, 43, 25, -1, 54, 171, 172, 173, 174, 175, - -1, -1, 178, 179, 102, 181, 182, 183, 184, 185, - 186, -1, 188, -1, 157, 158, 159, 69, 54, 157, - 158, 159, -1, -1, -1, 123, -1, -1, -1, -1, - -1, -1, -1, 131, 67, 87, -1, 89, 90, 72, - 138, 139, 102, -1, -1, -1, 79, 80, -1, -1, - 83, -1, 104, -1, -1, -1, -1, 109, -1, 111, - -1, -1, -1, 96, -1, -1, -1, -1, 101, 121, - -1, 131, -1, 171, 172, 173, 174, 175, 138, 139, - 178, 179, -1, 181, 182, 183, 184, 185, 186, -1, - 188, -1, -1, -1, -1, 131, -1, -1, -1, -1, - 133, -1, 138, 155, -1, -1, -1, -1, -1, -1, - -1, 171, 172, 173, 174, 175, -1, -1, 178, 179, - -1, 181, 182, 183, 184, 185, 186, -1, 188, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 174, 175, - -1, -1, 178, 179, -1, 181, 182, 183, 184, 185, - 186, -1, 188 + 54, 170, 81, 145, 293, 57, 58, 59, 177, 2, + 97, 98, 5, 96, 97, 98, 107, 10, 203, 12, + 356, 12, 3, 211, 3, 213, 3, 3, 6, 51, + 112, 115, 6, 115, 176, 58, 178, 179, 84, 17, + 3, 3, 378, 503, 91, 95, 182, 95, 78, 138, + 19, 151, 160, 161, 113, 48, 95, 50, 117, 117, + 147, 4, 5, 6, 147, 591, 191, 60, 210, 194, + 117, 118, 27, 215, 102, 134, 134, 603, 9, 127, + 55, 132, 324, 543, 117, 135, 194, 134, 330, 26, + 55, 60, 85, 86, 383, 149, 281, 239, 73, 188, + 93, 134, 130, 291, 3, 184, 61, 100, 101, 160, + 161, 299, 448, 301, 45, 3, 405, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 468, 191, 3, 4, 5, 6, 3, 4, + 5, 6, 190, 173, 286, 287, 89, 247, 194, 285, + 105, 82, 117, 63, 117, 297, 298, 117, 191, 9, + 3, 215, 105, 110, 127, 127, 99, 190, 123, 134, + 117, 134, 194, 257, 134, 257, 105, 46, 47, 48, + 12, 46, 47, 48, 27, 138, 189, 134, 190, 167, + 192, 194, 170, 167, 123, 45, 170, 486, 3, 93, + 191, 343, 183, 95, 183, 37, 348, 349, 201, 152, + 153, 154, 122, 190, 190, 403, 3, 86, 61, 113, + 89, 86, 54, 81, 89, 119, 136, 77, 156, 320, + 284, 567, 82, 186, 334, 188, 105, 58, 0, 117, + 105, 119, 193, 64, 114, 324, 431, 116, 113, 391, + 392, 330, 195, 163, 123, 3, 134, 546, 123, 71, + 3, 4, 5, 6, 3, 4, 5, 6, 137, 81, + 357, 103, 137, 93, 357, 327, 192, 117, 190, 119, + 117, 570, 71, 152, 153, 154, 256, 152, 153, 154, + 127, 261, 81, 113, 134, 110, 484, 134, 191, 119, + 112, 194, 117, 46, 47, 48, 129, 46, 47, 48, + 95, 138, 3, 182, 183, 58, 135, 182, 183, 134, + 127, 190, 125, 112, 191, 190, 195, 194, 321, 191, + 195, 191, 194, 475, 194, 477, 478, 194, 191, 191, + 394, 194, 194, 86, 98, 191, 89, 86, 194, 129, + 89, 405, 3, 4, 5, 6, 183, 184, 185, 186, + 191, 188, 105, 194, 3, 191, 105, 191, 194, 126, + 194, 4, 3, 4, 5, 6, 168, 169, 191, 123, + 123, 194, 191, 3, 123, 194, 84, 556, 94, 531, + 164, 165, 166, 190, 137, 46, 47, 48, 137, 140, + 141, 142, 143, 144, 145, 3, 25, 168, 169, 152, + 153, 154, 17, 152, 153, 154, 47, 48, 17, 18, + 46, 159, 160, 191, 25, 46, 47, 191, 4, 3, + 190, 573, 486, 575, 190, 86, 6, 12, 89, 182, + 183, 116, 128, 182, 183, 4, 4, 190, 67, 54, + 46, 190, 195, 72, 105, 86, 195, 191, 89, 194, + 79, 80, 133, 3, 171, 92, 67, 114, 3, 77, + 120, 72, 123, 3, 105, 127, 114, 96, 79, 80, + 190, 100, 101, 99, 188, 190, 137, 190, 190, 39, + 190, 95, 123, 49, 55, 96, 190, 102, 194, 100, + 101, 152, 153, 154, 194, 94, 137, 122, 190, 58, + 190, 3, 191, 190, 3, 163, 122, 190, 123, 191, + 190, 152, 153, 154, 190, 130, 131, 190, 190, 190, + 78, 182, 183, 138, 139, 95, 102, 117, 105, 190, + 3, 190, 188, 70, 195, 189, 63, 6, 162, 194, + 122, 182, 183, 6, 6, 6, 6, 191, 105, 190, + 190, 100, 191, 191, 195, 79, 171, 172, 173, 174, + 175, 79, 79, 178, 179, 194, 181, 182, 183, 184, + 185, 186, 0, 188, 7, 100, 3, 128, 191, 7, + 106, 191, 15, 194, 191, 6, 191, 15, 54, 22, + 191, 191, 190, 26, 22, 128, 191, 190, 26, 191, + 70, 192, 191, 117, 37, 24, 332, 40, 41, 37, + 328, 380, 40, 41, 466, 476, 144, 240, 282, 52, + 53, 343, 288, 539, 52, 53, 525, 336, 584, 511, + 63, 538, 267, 66, 255, 63, 102, 104, 66, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 117, 347, -1, -1, 88, -1, 123, -1, 92, + 88, -1, -1, -1, 92, 131, 54, -1, -1, 11, + -1, -1, 138, 139, -1, 108, -1, -1, -1, -1, + 108, 114, 24, -1, -1, -1, 114, 29, 30, 31, + 32, 33, -1, 35, -1, -1, -1, -1, -1, -1, + -1, 43, 25, -1, 54, 171, 172, 173, 174, 175, + -1, -1, 178, 179, 102, 181, 182, 183, 184, 185, + 186, -1, 188, -1, 157, 158, 159, 69, 54, 157, + 158, 159, -1, -1, -1, 123, -1, -1, -1, -1, + -1, -1, -1, 131, 67, 87, -1, 89, 90, 72, + 138, 139, 102, -1, -1, -1, 79, 80, -1, -1, + 83, -1, 104, -1, -1, -1, -1, 109, -1, 111, + -1, -1, -1, 96, -1, -1, -1, -1, 101, 121, + -1, 131, -1, 171, 172, 173, 174, 175, 138, 139, + 178, 179, -1, 181, 182, 183, 184, 185, 186, -1, + 188, -1, -1, -1, -1, 131, -1, -1, -1, -1, + 133, -1, 138, 155, -1, -1, -1, -1, -1, -1, + -1, 171, 172, 173, 174, 175, -1, -1, 178, 179, + -1, 181, 182, 183, 184, 185, 186, -1, 188, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 174, 175, + -1, -1, 178, 179, -1, 181, 182, 183, 184, 185, + 186, -1, 188 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_int16 yystos[] = { - 0, 7, 15, 22, 26, 37, 40, 41, 52, 53, - 63, 66, 88, 92, 108, 114, 157, 158, 159, 197, - 198, 199, 200, 204, 206, 208, 209, 213, 214, 215, - 227, 229, 232, 233, 234, 236, 239, 317, 318, 26, - 3, 306, 3, 3, 306, 71, 81, 112, 95, 95, - 99, 305, 306, 81, 190, 242, 306, 71, 81, 112, - 19, 60, 3, 319, 320, 156, 205, 205, 205, 0, - 193, 324, 114, 201, 201, 58, 242, 243, 247, 3, - 192, 190, 95, 129, 216, 216, 216, 306, 3, 210, - 306, 125, 129, 228, 242, 243, 135, 95, 135, 228, - 228, 228, 306, 127, 194, 199, 98, 126, 259, 9, - 45, 82, 244, 245, 77, 244, 255, 3, 4, 5, - 6, 89, 105, 152, 153, 154, 195, 262, 263, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 4, 207, - 123, 3, 307, 306, 306, 84, 252, 94, 190, 235, - 3, 237, 238, 46, 306, 191, 191, 211, 292, 211, - 211, 3, 306, 306, 242, 320, 190, 295, 12, 248, - 240, 241, 242, 247, 116, 246, 128, 240, 55, 73, - 260, 4, 4, 191, 194, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 284, 285, 286, - 46, 133, 95, 127, 190, 235, 3, 46, 47, 48, - 86, 123, 137, 182, 183, 190, 265, 266, 267, 268, - 269, 270, 271, 272, 274, 275, 276, 282, 283, 287, - 288, 289, 290, 291, 211, 3, 325, 64, 243, 171, - 194, 252, 92, 230, 231, 114, 212, 212, 212, 3, - 202, 203, 249, 261, 264, 265, 255, 244, 256, 257, - 265, 255, 265, 116, 265, 120, 312, 313, 314, 284, - 291, 306, 3, 239, 3, 27, 61, 217, 218, 219, - 226, 127, 190, 192, 190, 190, 190, 113, 265, 273, - 46, 123, 266, 188, 266, 243, 265, 117, 134, 17, - 54, 102, 123, 130, 131, 138, 139, 171, 172, 173, - 174, 175, 178, 179, 181, 182, 183, 184, 185, 186, - 188, 99, 191, 194, 190, 265, 238, 39, 49, 252, - 190, 191, 194, 95, 250, 251, 194, 3, 127, 310, - 311, 260, 240, 194, 91, 118, 258, 260, 55, 55, - 63, 122, 136, 163, 315, 314, 190, 94, 11, 24, - 29, 30, 31, 32, 33, 35, 43, 69, 87, 89, - 90, 104, 109, 111, 121, 155, 220, 122, 190, 191, - 194, 239, 191, 248, 3, 183, 243, 284, 265, 265, - 273, 93, 113, 119, 190, 123, 261, 191, 191, 265, - 265, 266, 266, 102, 130, 190, 105, 123, 266, 266, - 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, - 266, 266, 266, 295, 306, 3, 263, 228, 210, 263, - 203, 190, 300, 301, 302, 303, 304, 306, 321, 252, - 264, 3, 257, 312, 265, 265, 163, 122, 132, 160, - 161, 316, 325, 211, 190, 190, 222, 190, 190, 190, - 221, 27, 61, 105, 123, 223, 224, 225, 190, 325, - 218, 78, 277, 261, 191, 95, 127, 110, 93, 119, - 265, 265, 243, 189, 117, 266, 190, 243, 261, 105, - 189, 191, 3, 191, 239, 25, 67, 72, 79, 80, - 96, 101, 322, 194, 127, 308, 309, 310, 70, 253, - 63, 325, 162, 191, 6, 6, 6, 6, 6, 122, - 105, 225, 325, 191, 190, 191, 265, 220, 265, 265, - 119, 110, 191, 266, 243, 261, 191, 191, 191, 100, - 79, 79, 79, 100, 301, 3, 128, 316, 191, 191, - 194, 191, 191, 191, 191, 106, 278, 277, 191, 191, - 119, 265, 191, 191, 309, 302, 301, 190, 261, 6, - 128, 255, 83, 133, 325, 51, 254, 191, 261, 164, - 165, 166, 279, 280, 190, 265, 323, 191, 265, 191, - 6, 17, 167, 170, 281, 3, 290, 168, 169, 281, - 168, 169, 191, 117, 281 + 0, 7, 15, 22, 26, 37, 40, 41, 52, 53, + 63, 66, 88, 92, 108, 114, 157, 158, 159, 197, + 198, 199, 200, 204, 206, 208, 209, 213, 214, 215, + 227, 229, 232, 233, 234, 236, 239, 317, 318, 26, + 3, 306, 3, 3, 306, 71, 81, 112, 95, 95, + 99, 305, 306, 81, 190, 242, 306, 71, 81, 112, + 19, 60, 3, 319, 320, 156, 205, 205, 205, 0, + 193, 324, 114, 201, 201, 58, 242, 243, 247, 3, + 192, 190, 95, 129, 216, 216, 216, 306, 3, 210, + 306, 125, 129, 228, 242, 243, 135, 95, 135, 228, + 228, 228, 306, 127, 194, 199, 98, 126, 259, 9, + 45, 82, 244, 245, 77, 244, 255, 3, 4, 5, + 6, 89, 105, 152, 153, 154, 195, 262, 263, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 4, 207, + 123, 3, 307, 306, 306, 84, 252, 94, 190, 235, + 3, 237, 238, 46, 306, 191, 191, 211, 292, 211, + 211, 3, 306, 306, 242, 320, 190, 295, 12, 248, + 240, 241, 242, 247, 116, 246, 128, 240, 55, 73, + 260, 4, 4, 191, 194, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 284, 285, 286, + 46, 133, 95, 127, 190, 235, 3, 46, 47, 48, + 86, 123, 137, 182, 183, 190, 265, 266, 267, 268, + 269, 270, 271, 272, 274, 275, 276, 282, 283, 287, + 288, 289, 290, 291, 211, 3, 325, 64, 243, 171, + 194, 252, 92, 230, 231, 114, 212, 212, 212, 3, + 202, 203, 249, 261, 264, 265, 255, 244, 256, 257, + 265, 255, 265, 116, 265, 120, 312, 313, 314, 284, + 291, 306, 3, 239, 3, 27, 61, 217, 218, 219, + 226, 127, 190, 192, 190, 190, 190, 113, 265, 273, + 46, 123, 266, 188, 266, 243, 265, 117, 134, 17, + 54, 102, 123, 130, 131, 138, 139, 171, 172, 173, + 174, 175, 178, 179, 181, 182, 183, 184, 185, 186, + 188, 99, 191, 194, 190, 265, 238, 39, 49, 252, + 190, 191, 194, 95, 250, 251, 194, 3, 127, 310, + 311, 260, 240, 194, 91, 118, 258, 260, 55, 55, + 63, 122, 136, 163, 315, 314, 190, 94, 11, 24, + 29, 30, 31, 32, 33, 35, 43, 69, 87, 89, + 90, 104, 109, 111, 121, 155, 220, 122, 190, 191, + 194, 239, 191, 248, 3, 183, 243, 284, 265, 265, + 273, 93, 113, 119, 190, 123, 261, 191, 191, 265, + 265, 266, 266, 102, 130, 190, 105, 123, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 295, 306, 3, 263, 228, 210, 263, + 203, 190, 300, 301, 302, 303, 304, 306, 321, 252, + 264, 3, 257, 312, 265, 265, 163, 122, 132, 160, + 161, 316, 325, 211, 190, 190, 222, 190, 190, 190, + 221, 27, 61, 105, 123, 223, 224, 225, 190, 325, + 218, 78, 277, 261, 191, 95, 127, 110, 93, 119, + 265, 265, 243, 189, 117, 266, 190, 243, 261, 105, + 189, 191, 3, 191, 239, 25, 67, 72, 79, 80, + 96, 101, 322, 194, 127, 308, 309, 310, 70, 253, + 63, 325, 162, 191, 6, 6, 6, 6, 6, 122, + 105, 225, 325, 191, 190, 191, 265, 220, 265, 265, + 119, 110, 191, 266, 243, 261, 191, 191, 191, 100, + 79, 79, 79, 100, 301, 3, 128, 316, 191, 191, + 194, 191, 191, 191, 191, 106, 278, 277, 191, 191, + 119, 265, 191, 191, 309, 302, 301, 190, 261, 6, + 128, 255, 83, 133, 325, 51, 254, 191, 261, 164, + 165, 166, 279, 280, 190, 265, 323, 191, 265, 191, + 6, 17, 167, 170, 281, 3, 290, 168, 169, 281, + 168, 169, 191, 117, 281 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = { - 0, 196, 197, 198, 198, 199, 199, 199, 199, 199, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 201, 201, 202, 202, 203, 203, 204, 204, 204, 205, - 205, 206, 207, 208, 208, 209, 209, 210, 211, 212, - 212, 213, 213, 214, 214, 214, 215, 215, 215, 215, - 215, 216, 216, 217, 217, 218, 218, 219, 220, 220, - 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, - 220, 220, 220, 220, 220, 220, 221, 221, 222, 222, - 222, 223, 223, 224, 224, 225, 225, 225, 225, 226, - 226, 227, 227, 227, 227, 228, 228, 229, 230, 231, - 232, 233, 234, 234, 235, 235, 236, 237, 237, 238, - 239, 239, 239, 240, 240, 241, 241, 242, 242, 243, - 243, 244, 245, 245, 245, 246, 246, 247, 248, 248, - 249, 250, 250, 251, 252, 252, 253, 253, 254, 254, - 255, 255, 256, 256, 257, 258, 258, 258, 259, 259, - 260, 260, 260, 260, 260, 260, 261, 261, 262, 262, - 263, 263, 264, 265, 265, 265, 265, 265, 266, 266, - 266, 266, 266, 266, 266, 266, 266, 266, 266, 267, - 267, 268, 268, 268, 268, 268, 269, 269, 269, 269, - 269, 269, 269, 269, 269, 269, 269, 270, 270, 271, - 271, 271, 271, 272, 272, 272, 272, 273, 273, 274, - 274, 275, 275, 275, 275, 275, 275, 275, 276, 276, - 277, 277, 278, 278, 279, 279, 279, 280, 280, 280, - 281, 281, 281, 281, 281, 282, 283, 284, 284, 284, - 284, 284, 284, 285, 285, 285, 285, 285, 285, 286, - 286, 287, 288, 289, 290, 290, 290, 290, 291, 291, - 291, 291, 291, 291, 291, 292, 293, 293, 294, 294, - 295, 296, 297, 298, 298, 298, 299, 300, 300, 301, - 301, 302, 302, 303, 303, 304, 305, 306, 306, 307, - 307, 308, 308, 309, 309, 310, 310, 311, 311, 312, - 312, 313, 313, 314, 314, 315, 315, 315, 315, 316, - 316, 316, 317, 317, 318, 319, 319, 320, 321, 321, - 321, 322, 322, 322, 322, 322, 322, 322, 322, 322, - 322, 323, 324, 324, 325, 325 + 0, 196, 197, 198, 198, 199, 199, 199, 199, 199, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 201, 201, 202, 202, 203, 203, 204, 204, 204, 205, + 205, 206, 207, 208, 208, 209, 209, 210, 211, 212, + 212, 213, 213, 214, 214, 214, 215, 215, 215, 215, + 215, 216, 216, 217, 217, 218, 218, 219, 220, 220, + 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 220, 221, 221, 222, 222, + 222, 223, 223, 224, 224, 225, 225, 225, 225, 226, + 226, 227, 227, 227, 227, 228, 228, 229, 230, 231, + 232, 233, 234, 234, 235, 235, 236, 237, 237, 238, + 239, 239, 239, 240, 240, 241, 241, 242, 242, 243, + 243, 244, 245, 245, 245, 246, 246, 247, 248, 248, + 249, 250, 250, 251, 252, 252, 253, 253, 254, 254, + 255, 255, 256, 256, 257, 258, 258, 258, 259, 259, + 260, 260, 260, 260, 260, 260, 261, 261, 262, 262, + 263, 263, 264, 265, 265, 265, 265, 265, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 267, + 267, 268, 268, 268, 268, 268, 269, 269, 269, 269, + 269, 269, 269, 269, 269, 269, 269, 270, 270, 271, + 271, 271, 271, 272, 272, 272, 272, 273, 273, 274, + 274, 275, 275, 275, 275, 275, 275, 275, 276, 276, + 277, 277, 278, 278, 279, 279, 279, 280, 280, 280, + 281, 281, 281, 281, 281, 282, 283, 284, 284, 284, + 284, 284, 284, 285, 285, 285, 285, 285, 285, 286, + 286, 287, 288, 289, 290, 290, 290, 290, 291, 291, + 291, 291, 291, 291, 291, 292, 293, 293, 294, 294, + 295, 296, 297, 298, 298, 298, 299, 300, 300, 301, + 301, 302, 302, 303, 303, 304, 305, 306, 306, 307, + 307, 308, 308, 309, 309, 310, 310, 311, 311, 312, + 312, 313, 313, 314, 314, 315, 315, 315, 315, 316, + 316, 316, 317, 317, 318, 319, 319, 320, 321, 321, + 321, 322, 322, 322, 322, 322, 322, 322, 322, 322, + 322, 323, 324, 324, 325, 325 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { - 0, 2, 2, 1, 3, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 5, 0, 1, 3, 1, 4, 2, 2, 2, 1, - 0, 4, 1, 2, 5, 7, 6, 1, 1, 3, - 0, 5, 5, 2, 3, 2, 8, 7, 6, 9, - 7, 3, 0, 1, 3, 1, 1, 3, 1, 1, - 4, 4, 1, 1, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 1, 4, 3, 0, 5, 3, - 0, 1, 0, 1, 2, 2, 1, 1, 2, 5, - 4, 4, 4, 3, 4, 2, 0, 5, 1, 4, - 4, 2, 8, 5, 3, 0, 5, 1, 3, 3, - 2, 2, 6, 1, 1, 1, 3, 3, 3, 4, - 6, 2, 1, 1, 1, 1, 0, 7, 1, 0, - 1, 1, 0, 2, 2, 0, 4, 0, 2, 0, - 3, 0, 1, 3, 2, 1, 1, 0, 2, 0, - 2, 2, 4, 2, 4, 0, 1, 3, 1, 0, - 1, 3, 2, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 1, 2, 2, 2, 3, 4, 1, 3, 3, 3, - 3, 3, 3, 3, 4, 3, 3, 3, 3, 5, - 6, 5, 6, 4, 6, 3, 5, 4, 5, 4, - 5, 3, 3, 3, 3, 3, 3, 3, 4, 6, - 6, 0, 3, 0, 2, 5, 0, 1, 1, 1, - 2, 2, 2, 2, 1, 6, 6, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 4, 4, 5, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 3, 2, 1, 1, 3, 1, - 1, 1, 4, 1, 3, 2, 1, 1, 3, 1, - 0, 1, 5, 1, 0, 2, 1, 1, 0, 1, - 0, 1, 2, 3, 5, 1, 3, 1, 2, 2, - 1, 0, 1, 0, 2, 1, 3, 3, 4, 6, - 8, 1, 2, 1, 2, 1, 2, 1, 1, 1, - 0, 1, 1, 0, 1, 3 + 0, 2, 2, 1, 3, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 5, 0, 1, 3, 1, 4, 2, 2, 2, 1, + 0, 4, 1, 2, 5, 7, 6, 1, 1, 3, + 0, 5, 5, 2, 3, 2, 8, 7, 6, 9, + 7, 3, 0, 1, 3, 1, 1, 3, 1, 1, + 4, 4, 1, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 1, 4, 3, 0, 5, 3, + 0, 1, 0, 1, 2, 2, 1, 1, 2, 5, + 4, 4, 4, 3, 4, 2, 0, 5, 1, 4, + 4, 2, 8, 5, 3, 0, 5, 1, 3, 3, + 2, 2, 6, 1, 1, 1, 3, 3, 3, 4, + 6, 2, 1, 1, 1, 1, 0, 7, 1, 0, + 1, 1, 0, 2, 2, 0, 4, 0, 2, 0, + 3, 0, 1, 3, 2, 1, 1, 0, 2, 0, + 2, 2, 4, 2, 4, 0, 1, 3, 1, 0, + 1, 3, 2, 1, 1, 1, 1, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, + 1, 2, 2, 2, 3, 4, 1, 3, 3, 3, + 3, 3, 3, 3, 4, 3, 3, 3, 3, 5, + 6, 5, 6, 4, 6, 3, 5, 4, 5, 4, + 5, 3, 3, 3, 3, 3, 3, 3, 4, 6, + 6, 0, 3, 0, 2, 5, 0, 1, 1, 1, + 2, 2, 2, 2, 1, 6, 6, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 4, 5, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 3, 2, 1, 1, 3, 1, + 1, 1, 4, 1, 3, 2, 1, 1, 3, 1, + 0, 1, 5, 1, 0, 2, 1, 1, 0, 1, + 0, 1, 2, 3, 5, 1, 3, 1, 2, 2, + 1, 0, 1, 0, 2, 1, 3, 3, 4, 6, + 8, 1, 2, 1, 2, 1, 2, 1, 1, 1, + 0, 1, 1, 0, 1, 3 }; @@ -1518,19 +1518,19 @@ enum { YYENOMEM = -2 }; #define YYBACKUP(Token, Value) \ do \ - if (yychar == SQL_HSQL_EMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (&yylloc, result, scanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ + if (yychar == SQL_HSQL_EMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (&yylloc, result, scanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ while (0) /* Backward compatibility with an undocumented macro. @@ -1543,22 +1543,22 @@ enum { YYENOMEM = -2 }; #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) + do \ + if (N) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (0) #endif #define YYRHSLOC(Rhs, K) ((Rhs)[K]) @@ -1575,7 +1575,7 @@ enum { YYENOMEM = -2 }; # define YYDPRINTF(Args) \ do { \ if (yydebug) \ - YYFPRINTF Args; \ + YYFPRINTF Args; \ } while (0) @@ -1588,7 +1588,7 @@ do { \ # if defined YY_LOCATION_PRINT /* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ + undocumented and private YY_LOCATION_PRINT macros. */ # define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc)) # elif defined HSQL_LTYPE_IS_TRIVIAL && HSQL_LTYPE_IS_TRIVIAL @@ -1602,36 +1602,36 @@ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) - { - res += YYFPRINTF (yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += YYFPRINTF (yyo, ".%d", yylocp->first_column); - } + { + res += YYFPRINTF (yyo, "%d", yylocp->first_line); + if (0 <= yylocp->first_column) + res += YYFPRINTF (yyo, ".%d", yylocp->first_column); + } if (0 <= yylocp->last_line) - { - if (yylocp->first_line < yylocp->last_line) - { - res += YYFPRINTF (yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += YYFPRINTF (yyo, ".%d", end_col); - } - else if (0 <= end_col && yylocp->first_column < end_col) - res += YYFPRINTF (yyo, "-%d", end_col); - } + { + if (yylocp->first_line < yylocp->last_line) + { + res += YYFPRINTF (yyo, "-%d", yylocp->last_line); + if (0 <= end_col) + res += YYFPRINTF (yyo, ".%d", end_col); + } + else if (0 <= end_col && yylocp->first_column < end_col) + res += YYFPRINTF (yyo, "-%d", end_col); + } return res; } # define YYLOCATION_PRINT yy_location_print_ - /* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ # define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc)) # else # define YYLOCATION_PRINT(File, Loc) ((void) 0) - /* Temporary convenience wrapper in case some people defined the - undocumented and private YY_LOCATION_PRINT macros. */ + /* Temporary convenience wrapper in case some people defined the + undocumented and private YY_LOCATION_PRINT macros. */ # define YY_LOCATION_PRINT YYLOCATION_PRINT # endif @@ -1641,12 +1641,12 @@ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Kind, Value, Location, result, scanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, Location, result, scanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ } while (0) @@ -1656,7 +1656,7 @@ do { \ static void yy_symbol_value_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) { FILE *yyoutput = yyo; YY_USE (yyoutput); @@ -1664,7 +1664,7 @@ yy_symbol_value_print (FILE *yyo, YY_USE (result); YY_USE (scanner); if (!yyvaluep) - return; + return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END @@ -1677,10 +1677,10 @@ yy_symbol_value_print (FILE *yyo, static void yy_symbol_print (FILE *yyo, - yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) { YYFPRINTF (yyo, "%s %s (", - yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); YYLOCATION_PRINT (yyo, yylocationp); YYFPRINTF (yyo, ": "); @@ -1698,17 +1698,17 @@ yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ + yy_stack_print ((Bottom), (Top)); \ } while (0) @@ -1718,29 +1718,29 @@ do { \ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, - int yyrule, hsql::SQLParserResult* result, yyscan_t scanner) + int yyrule, hsql::SQLParserResult* result, yyscan_t scanner) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), - &yyvsp[(yyi + 1) - (yynrhs)], - &(yylsp[(yyi + 1) - (yynrhs)]), result, scanner); - YYFPRINTF (stderr, "\n"); - } + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], + &(yylsp[(yyi + 1) - (yynrhs)]), result, scanner); + YYFPRINTF (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, yylsp, Rule, result, scanner); \ + yy_reduce_print (yyssp, yyvsp, yylsp, Rule, result, scanner); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that @@ -1787,35 +1787,35 @@ typedef struct YYARG up to YYARGN. */ static int yypcontext_expected_tokens (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) + yysymbol_kind_t yyarg[], int yyargn) { /* Actual size of YYARG. */ int yycount = 0; int yyn = yypact[+*yyctx->yyssp]; if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); - } - } + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } + } if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; + yyarg[0] = YYSYMBOL_YYEMPTY; return yycount; } @@ -1832,7 +1832,7 @@ yystrlen (const char *yystr) { YYPTRDIFF_T yylen; for (yylen = 0; yystr[yylen]; yylen++) - continue; + continue; return yylen; } # endif @@ -1851,7 +1851,7 @@ yystpcpy (char *yydest, const char *yysrc) const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') - continue; + continue; return yyd - 1; } @@ -1870,87 +1870,87 @@ static YYPTRDIFF_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') - { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } if (yyres) - return yystpcpy (yyres, yystr) - yyres; + return yystpcpy (yyres, yystr) - yyres; else - return yystrlen (yystr); + return yystrlen (yystr); } #endif static int yy_syntax_error_arguments (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) + yysymbol_kind_t yyarg[], int yyargn) { /* Actual size of YYARG. */ int yycount = 0; /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. */ if (yyctx->yytoken != YYSYMBOL_YYEMPTY) - { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens (yyctx, - yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; - } + { + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; + } return yycount; } @@ -1964,13 +1964,13 @@ yy_syntax_error_arguments (const yypcontext_t *yyctx, required number of bytes is too large to store. */ static int yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - const yypcontext_t *yyctx) + const yypcontext_t *yyctx) { enum { YYARGS_MAX = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ + one per "expected"). */ yysymbol_kind_t yyarg[YYARGS_MAX]; /* Cumulated lengths of YYARG. */ YYPTRDIFF_T yysize = 0; @@ -1978,66 +1978,66 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, /* Actual size of YYARG. */ int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); if (yycount == YYENOMEM) - return YYENOMEM; + return YYENOMEM; switch (yycount) - { + { #define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); + case N: \ + yyformat = S; \ + break + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ - } + } /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ + room for the terminator. */ yysize = yystrlen (yyformat) - 2 * yycount + 1; { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } } if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return -1; - } + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return -1; + } /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); - yyformat += 2; - } - else - { - ++yyp; - ++yyformat; - } + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); + yyformat += 2; + } + else + { + ++yyp; + ++yyformat; + } } return 0; } @@ -2049,910 +2049,910 @@ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, static void yydestruct (const char *yymsg, - yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, hsql::SQLParserResult* result, yyscan_t scanner) { YY_USE (yyvaluep); YY_USE (yylocationp); YY_USE (result); YY_USE (scanner); if (!yymsg) - yymsg = "Deleting"; + yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN switch (yykind) - { - case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ + { + case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */ #line 181 "bison_parser.y" - { free( (((*yyvaluep).sval)) ); } + { free( (((*yyvaluep).sval)) ); } #line 2064 "bison_parser.cpp" - break; + break; - case YYSYMBOL_STRING: /* STRING */ + case YYSYMBOL_STRING: /* STRING */ #line 181 "bison_parser.y" - { free( (((*yyvaluep).sval)) ); } + { free( (((*yyvaluep).sval)) ); } #line 2070 "bison_parser.cpp" - break; + break; - case YYSYMBOL_FLOATVAL: /* FLOATVAL */ + case YYSYMBOL_FLOATVAL: /* FLOATVAL */ #line 168 "bison_parser.y" - { } + { } #line 2076 "bison_parser.cpp" - break; + break; - case YYSYMBOL_INTVAL: /* INTVAL */ + case YYSYMBOL_INTVAL: /* INTVAL */ #line 168 "bison_parser.y" - { } + { } #line 2082 "bison_parser.cpp" - break; + break; - case YYSYMBOL_statement_list: /* statement_list */ + case YYSYMBOL_statement_list: /* statement_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).stmt_vec)) { - for (auto ptr : *(((*yyvaluep).stmt_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).stmt_vec)); - } + { + if (((*yyvaluep).stmt_vec)) { + for (auto ptr : *(((*yyvaluep).stmt_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).stmt_vec)); + } #line 2095 "bison_parser.cpp" - break; + break; - case YYSYMBOL_statement: /* statement */ + case YYSYMBOL_statement: /* statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).statement)); } + { delete (((*yyvaluep).statement)); } #line 2101 "bison_parser.cpp" - break; + break; - case YYSYMBOL_preparable_statement: /* preparable_statement */ + case YYSYMBOL_preparable_statement: /* preparable_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).statement)); } + { delete (((*yyvaluep).statement)); } #line 2107 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_hints: /* opt_hints */ + case YYSYMBOL_opt_hints: /* opt_hints */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2120 "bison_parser.cpp" - break; + break; - case YYSYMBOL_hint_list: /* hint_list */ + case YYSYMBOL_hint_list: /* hint_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2133 "bison_parser.cpp" - break; + break; - case YYSYMBOL_hint: /* hint */ + case YYSYMBOL_hint: /* hint */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2139 "bison_parser.cpp" - break; + break; - case YYSYMBOL_transaction_statement: /* transaction_statement */ + case YYSYMBOL_transaction_statement: /* transaction_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).transaction_stmt)); } + { delete (((*yyvaluep).transaction_stmt)); } #line 2145 "bison_parser.cpp" - break; + break; - case YYSYMBOL_prepare_statement: /* prepare_statement */ + case YYSYMBOL_prepare_statement: /* prepare_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).prep_stmt)); } + { delete (((*yyvaluep).prep_stmt)); } #line 2151 "bison_parser.cpp" - break; + break; - case YYSYMBOL_prepare_target_query: /* prepare_target_query */ + case YYSYMBOL_prepare_target_query: /* prepare_target_query */ #line 181 "bison_parser.y" - { free( (((*yyvaluep).sval)) ); } + { free( (((*yyvaluep).sval)) ); } #line 2157 "bison_parser.cpp" - break; + break; - case YYSYMBOL_execute_statement: /* execute_statement */ + case YYSYMBOL_execute_statement: /* execute_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).exec_stmt)); } + { delete (((*yyvaluep).exec_stmt)); } #line 2163 "bison_parser.cpp" - break; + break; - case YYSYMBOL_import_statement: /* import_statement */ + case YYSYMBOL_import_statement: /* import_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).import_stmt)); } + { delete (((*yyvaluep).import_stmt)); } #line 2169 "bison_parser.cpp" - break; + break; - case YYSYMBOL_file_type: /* file_type */ + case YYSYMBOL_file_type: /* file_type */ #line 168 "bison_parser.y" - { } + { } #line 2175 "bison_parser.cpp" - break; + break; - case YYSYMBOL_file_path: /* file_path */ + case YYSYMBOL_file_path: /* file_path */ #line 181 "bison_parser.y" - { free( (((*yyvaluep).sval)) ); } + { free( (((*yyvaluep).sval)) ); } #line 2181 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_file_type: /* opt_file_type */ + case YYSYMBOL_opt_file_type: /* opt_file_type */ #line 168 "bison_parser.y" - { } + { } #line 2187 "bison_parser.cpp" - break; + break; - case YYSYMBOL_export_statement: /* export_statement */ + case YYSYMBOL_export_statement: /* export_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).export_stmt)); } + { delete (((*yyvaluep).export_stmt)); } #line 2193 "bison_parser.cpp" - break; + break; - case YYSYMBOL_show_statement: /* show_statement */ + case YYSYMBOL_show_statement: /* show_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).show_stmt)); } + { delete (((*yyvaluep).show_stmt)); } #line 2199 "bison_parser.cpp" - break; + break; - case YYSYMBOL_create_statement: /* create_statement */ + case YYSYMBOL_create_statement: /* create_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).create_stmt)); } + { delete (((*yyvaluep).create_stmt)); } #line 2205 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_not_exists: /* opt_not_exists */ + case YYSYMBOL_opt_not_exists: /* opt_not_exists */ #line 168 "bison_parser.y" - { } + { } #line 2211 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_elem_commalist: /* table_elem_commalist */ + case YYSYMBOL_table_elem_commalist: /* table_elem_commalist */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).table_element_vec)) { - for (auto ptr : *(((*yyvaluep).table_element_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).table_element_vec)); - } + { + if (((*yyvaluep).table_element_vec)) { + for (auto ptr : *(((*yyvaluep).table_element_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).table_element_vec)); + } #line 2224 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_elem: /* table_elem */ + case YYSYMBOL_table_elem: /* table_elem */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table_element_t)); } + { delete (((*yyvaluep).table_element_t)); } #line 2230 "bison_parser.cpp" - break; + break; - case YYSYMBOL_column_def: /* column_def */ + case YYSYMBOL_column_def: /* column_def */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).column_t)); } + { delete (((*yyvaluep).column_t)); } #line 2236 "bison_parser.cpp" - break; + break; - case YYSYMBOL_column_type: /* column_type */ + case YYSYMBOL_column_type: /* column_type */ #line 168 "bison_parser.y" - { } + { } #line 2242 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_time_precision: /* opt_time_precision */ + case YYSYMBOL_opt_time_precision: /* opt_time_precision */ #line 168 "bison_parser.y" - { } + { } #line 2248 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_decimal_specification: /* opt_decimal_specification */ + case YYSYMBOL_opt_decimal_specification: /* opt_decimal_specification */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).ival_pair)); } + { delete (((*yyvaluep).ival_pair)); } #line 2254 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_column_constraints: /* opt_column_constraints */ + case YYSYMBOL_opt_column_constraints: /* opt_column_constraints */ #line 168 "bison_parser.y" - { } + { } #line 2260 "bison_parser.cpp" - break; + break; - case YYSYMBOL_column_constraint_set: /* column_constraint_set */ + case YYSYMBOL_column_constraint_set: /* column_constraint_set */ #line 168 "bison_parser.y" - { } + { } #line 2266 "bison_parser.cpp" - break; + break; - case YYSYMBOL_column_constraint: /* column_constraint */ + case YYSYMBOL_column_constraint: /* column_constraint */ #line 168 "bison_parser.y" - { } + { } #line 2272 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_constraint: /* table_constraint */ + case YYSYMBOL_table_constraint: /* table_constraint */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table_constraint_t)); } + { delete (((*yyvaluep).table_constraint_t)); } #line 2278 "bison_parser.cpp" - break; + break; - case YYSYMBOL_drop_statement: /* drop_statement */ + case YYSYMBOL_drop_statement: /* drop_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).drop_stmt)); } + { delete (((*yyvaluep).drop_stmt)); } #line 2284 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_exists: /* opt_exists */ + case YYSYMBOL_opt_exists: /* opt_exists */ #line 168 "bison_parser.y" - { } + { } #line 2290 "bison_parser.cpp" - break; + break; - case YYSYMBOL_alter_statement: /* alter_statement */ + case YYSYMBOL_alter_statement: /* alter_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).alter_stmt)); } + { delete (((*yyvaluep).alter_stmt)); } #line 2296 "bison_parser.cpp" - break; + break; - case YYSYMBOL_alter_action: /* alter_action */ + case YYSYMBOL_alter_action: /* alter_action */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).alter_action_t)); } + { delete (((*yyvaluep).alter_action_t)); } #line 2302 "bison_parser.cpp" - break; + break; - case YYSYMBOL_drop_action: /* drop_action */ + case YYSYMBOL_drop_action: /* drop_action */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).drop_action_t)); } + { delete (((*yyvaluep).drop_action_t)); } #line 2308 "bison_parser.cpp" - break; + break; - case YYSYMBOL_delete_statement: /* delete_statement */ + case YYSYMBOL_delete_statement: /* delete_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).delete_stmt)); } + { delete (((*yyvaluep).delete_stmt)); } #line 2314 "bison_parser.cpp" - break; + break; - case YYSYMBOL_truncate_statement: /* truncate_statement */ + case YYSYMBOL_truncate_statement: /* truncate_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).delete_stmt)); } + { delete (((*yyvaluep).delete_stmt)); } #line 2320 "bison_parser.cpp" - break; + break; - case YYSYMBOL_insert_statement: /* insert_statement */ + case YYSYMBOL_insert_statement: /* insert_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).insert_stmt)); } + { delete (((*yyvaluep).insert_stmt)); } #line 2326 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_column_list: /* opt_column_list */ + case YYSYMBOL_opt_column_list: /* opt_column_list */ #line 173 "bison_parser.y" - { - if (((*yyvaluep).str_vec)) { - for (auto ptr : *(((*yyvaluep).str_vec))) { - free(ptr); - } - } - delete (((*yyvaluep).str_vec)); - } + { + if (((*yyvaluep).str_vec)) { + for (auto ptr : *(((*yyvaluep).str_vec))) { + free(ptr); + } + } + delete (((*yyvaluep).str_vec)); + } #line 2339 "bison_parser.cpp" - break; + break; - case YYSYMBOL_update_statement: /* update_statement */ + case YYSYMBOL_update_statement: /* update_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).update_stmt)); } + { delete (((*yyvaluep).update_stmt)); } #line 2345 "bison_parser.cpp" - break; + break; - case YYSYMBOL_update_clause_commalist: /* update_clause_commalist */ + case YYSYMBOL_update_clause_commalist: /* update_clause_commalist */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).update_vec)) { - for (auto ptr : *(((*yyvaluep).update_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).update_vec)); - } + { + if (((*yyvaluep).update_vec)) { + for (auto ptr : *(((*yyvaluep).update_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).update_vec)); + } #line 2358 "bison_parser.cpp" - break; + break; - case YYSYMBOL_update_clause: /* update_clause */ + case YYSYMBOL_update_clause: /* update_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).update_t)); } + { delete (((*yyvaluep).update_t)); } #line 2364 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_statement: /* select_statement */ + case YYSYMBOL_select_statement: /* select_statement */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).select_stmt)); } + { delete (((*yyvaluep).select_stmt)); } #line 2370 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_within_set_operation: /* select_within_set_operation */ + case YYSYMBOL_select_within_set_operation: /* select_within_set_operation */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).select_stmt)); } + { delete (((*yyvaluep).select_stmt)); } #line 2376 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_within_set_operation_no_parentheses: /* select_within_set_operation_no_parentheses */ + case YYSYMBOL_select_within_set_operation_no_parentheses: /* select_within_set_operation_no_parentheses */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).select_stmt)); } + { delete (((*yyvaluep).select_stmt)); } #line 2382 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_with_paren: /* select_with_paren */ + case YYSYMBOL_select_with_paren: /* select_with_paren */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).select_stmt)); } + { delete (((*yyvaluep).select_stmt)); } #line 2388 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_no_paren: /* select_no_paren */ + case YYSYMBOL_select_no_paren: /* select_no_paren */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).select_stmt)); } + { delete (((*yyvaluep).select_stmt)); } #line 2394 "bison_parser.cpp" - break; + break; - case YYSYMBOL_set_operator: /* set_operator */ + case YYSYMBOL_set_operator: /* set_operator */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).set_operator_t)); } + { delete (((*yyvaluep).set_operator_t)); } #line 2400 "bison_parser.cpp" - break; + break; - case YYSYMBOL_set_type: /* set_type */ + case YYSYMBOL_set_type: /* set_type */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).set_operator_t)); } + { delete (((*yyvaluep).set_operator_t)); } #line 2406 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_all: /* opt_all */ + case YYSYMBOL_opt_all: /* opt_all */ #line 168 "bison_parser.y" - { } + { } #line 2412 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_clause: /* select_clause */ + case YYSYMBOL_select_clause: /* select_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).select_stmt)); } + { delete (((*yyvaluep).select_stmt)); } #line 2418 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_distinct: /* opt_distinct */ + case YYSYMBOL_opt_distinct: /* opt_distinct */ #line 168 "bison_parser.y" - { } + { } #line 2424 "bison_parser.cpp" - break; + break; - case YYSYMBOL_select_list: /* select_list */ + case YYSYMBOL_select_list: /* select_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2437 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_from_clause: /* opt_from_clause */ + case YYSYMBOL_opt_from_clause: /* opt_from_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2443 "bison_parser.cpp" - break; + break; - case YYSYMBOL_from_clause: /* from_clause */ + case YYSYMBOL_from_clause: /* from_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2449 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_where: /* opt_where */ + case YYSYMBOL_opt_where: /* opt_where */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2455 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_group: /* opt_group */ + case YYSYMBOL_opt_group: /* opt_group */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).group_t)); } + { delete (((*yyvaluep).group_t)); } #line 2461 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_having: /* opt_having */ + case YYSYMBOL_opt_having: /* opt_having */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2467 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_order: /* opt_order */ + case YYSYMBOL_opt_order: /* opt_order */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).order_vec)) { - for (auto ptr : *(((*yyvaluep).order_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).order_vec)); - } + { + if (((*yyvaluep).order_vec)) { + for (auto ptr : *(((*yyvaluep).order_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).order_vec)); + } #line 2480 "bison_parser.cpp" - break; + break; - case YYSYMBOL_order_list: /* order_list */ + case YYSYMBOL_order_list: /* order_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).order_vec)) { - for (auto ptr : *(((*yyvaluep).order_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).order_vec)); - } + { + if (((*yyvaluep).order_vec)) { + for (auto ptr : *(((*yyvaluep).order_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).order_vec)); + } #line 2493 "bison_parser.cpp" - break; + break; - case YYSYMBOL_order_desc: /* order_desc */ + case YYSYMBOL_order_desc: /* order_desc */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).order)); } + { delete (((*yyvaluep).order)); } #line 2499 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_order_type: /* opt_order_type */ + case YYSYMBOL_opt_order_type: /* opt_order_type */ #line 168 "bison_parser.y" - { } + { } #line 2505 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_top: /* opt_top */ + case YYSYMBOL_opt_top: /* opt_top */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).limit)); } + { delete (((*yyvaluep).limit)); } #line 2511 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_limit: /* opt_limit */ + case YYSYMBOL_opt_limit: /* opt_limit */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).limit)); } + { delete (((*yyvaluep).limit)); } #line 2517 "bison_parser.cpp" - break; + break; - case YYSYMBOL_expr_list: /* expr_list */ + case YYSYMBOL_expr_list: /* expr_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2530 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_literal_list: /* opt_literal_list */ + case YYSYMBOL_opt_literal_list: /* opt_literal_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2543 "bison_parser.cpp" - break; + break; - case YYSYMBOL_literal_list: /* literal_list */ + case YYSYMBOL_literal_list: /* literal_list */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2556 "bison_parser.cpp" - break; + break; - case YYSYMBOL_expr_alias: /* expr_alias */ + case YYSYMBOL_expr_alias: /* expr_alias */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2562 "bison_parser.cpp" - break; + break; - case YYSYMBOL_expr: /* expr */ + case YYSYMBOL_expr: /* expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2568 "bison_parser.cpp" - break; + break; - case YYSYMBOL_operand: /* operand */ + case YYSYMBOL_operand: /* operand */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2574 "bison_parser.cpp" - break; + break; - case YYSYMBOL_scalar_expr: /* scalar_expr */ + case YYSYMBOL_scalar_expr: /* scalar_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2580 "bison_parser.cpp" - break; + break; - case YYSYMBOL_unary_expr: /* unary_expr */ + case YYSYMBOL_unary_expr: /* unary_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2586 "bison_parser.cpp" - break; + break; - case YYSYMBOL_binary_expr: /* binary_expr */ + case YYSYMBOL_binary_expr: /* binary_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2592 "bison_parser.cpp" - break; + break; - case YYSYMBOL_logic_expr: /* logic_expr */ + case YYSYMBOL_logic_expr: /* logic_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2598 "bison_parser.cpp" - break; + break; - case YYSYMBOL_in_expr: /* in_expr */ + case YYSYMBOL_in_expr: /* in_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2604 "bison_parser.cpp" - break; + break; - case YYSYMBOL_case_expr: /* case_expr */ + case YYSYMBOL_case_expr: /* case_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2610 "bison_parser.cpp" - break; + break; - case YYSYMBOL_case_list: /* case_list */ + case YYSYMBOL_case_list: /* case_list */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2616 "bison_parser.cpp" - break; + break; - case YYSYMBOL_exists_expr: /* exists_expr */ + case YYSYMBOL_exists_expr: /* exists_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2622 "bison_parser.cpp" - break; + break; - case YYSYMBOL_comp_expr: /* comp_expr */ + case YYSYMBOL_comp_expr: /* comp_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2628 "bison_parser.cpp" - break; + break; - case YYSYMBOL_function_expr: /* function_expr */ + case YYSYMBOL_function_expr: /* function_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2634 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_window: /* opt_window */ + case YYSYMBOL_opt_window: /* opt_window */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).window_description)); } + { delete (((*yyvaluep).window_description)); } #line 2640 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_partition: /* opt_partition */ + case YYSYMBOL_opt_partition: /* opt_partition */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).expr_vec)) { - for (auto ptr : *(((*yyvaluep).expr_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).expr_vec)); - } + { + if (((*yyvaluep).expr_vec)) { + for (auto ptr : *(((*yyvaluep).expr_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).expr_vec)); + } #line 2653 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_frame_clause: /* opt_frame_clause */ + case YYSYMBOL_opt_frame_clause: /* opt_frame_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).frame_description)); } + { delete (((*yyvaluep).frame_description)); } #line 2659 "bison_parser.cpp" - break; + break; - case YYSYMBOL_frame_type: /* frame_type */ + case YYSYMBOL_frame_type: /* frame_type */ #line 168 "bison_parser.y" - { } + { } #line 2665 "bison_parser.cpp" - break; + break; - case YYSYMBOL_frame_bound: /* frame_bound */ + case YYSYMBOL_frame_bound: /* frame_bound */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).frame_bound)); } + { delete (((*yyvaluep).frame_bound)); } #line 2671 "bison_parser.cpp" - break; + break; - case YYSYMBOL_extract_expr: /* extract_expr */ + case YYSYMBOL_extract_expr: /* extract_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2677 "bison_parser.cpp" - break; + break; - case YYSYMBOL_cast_expr: /* cast_expr */ + case YYSYMBOL_cast_expr: /* cast_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2683 "bison_parser.cpp" - break; + break; - case YYSYMBOL_datetime_field: /* datetime_field */ + case YYSYMBOL_datetime_field: /* datetime_field */ #line 168 "bison_parser.y" - { } + { } #line 2689 "bison_parser.cpp" - break; + break; - case YYSYMBOL_datetime_field_plural: /* datetime_field_plural */ + case YYSYMBOL_datetime_field_plural: /* datetime_field_plural */ #line 168 "bison_parser.y" - { } + { } #line 2695 "bison_parser.cpp" - break; + break; - case YYSYMBOL_duration_field: /* duration_field */ + case YYSYMBOL_duration_field: /* duration_field */ #line 168 "bison_parser.y" - { } + { } #line 2701 "bison_parser.cpp" - break; + break; - case YYSYMBOL_array_expr: /* array_expr */ + case YYSYMBOL_array_expr: /* array_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2707 "bison_parser.cpp" - break; + break; - case YYSYMBOL_array_index: /* array_index */ + case YYSYMBOL_array_index: /* array_index */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2713 "bison_parser.cpp" - break; + break; - case YYSYMBOL_between_expr: /* between_expr */ + case YYSYMBOL_between_expr: /* between_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2719 "bison_parser.cpp" - break; + break; - case YYSYMBOL_column_name: /* column_name */ + case YYSYMBOL_column_name: /* column_name */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2725 "bison_parser.cpp" - break; + break; - case YYSYMBOL_literal: /* literal */ + case YYSYMBOL_literal: /* literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2731 "bison_parser.cpp" - break; + break; - case YYSYMBOL_string_literal: /* string_literal */ + case YYSYMBOL_string_literal: /* string_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2737 "bison_parser.cpp" - break; + break; - case YYSYMBOL_bool_literal: /* bool_literal */ + case YYSYMBOL_bool_literal: /* bool_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2743 "bison_parser.cpp" - break; + break; - case YYSYMBOL_num_literal: /* num_literal */ + case YYSYMBOL_num_literal: /* num_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2749 "bison_parser.cpp" - break; + break; - case YYSYMBOL_int_literal: /* int_literal */ + case YYSYMBOL_int_literal: /* int_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2755 "bison_parser.cpp" - break; + break; - case YYSYMBOL_null_literal: /* null_literal */ + case YYSYMBOL_null_literal: /* null_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2761 "bison_parser.cpp" - break; + break; - case YYSYMBOL_date_literal: /* date_literal */ + case YYSYMBOL_date_literal: /* date_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2767 "bison_parser.cpp" - break; + break; - case YYSYMBOL_interval_literal: /* interval_literal */ + case YYSYMBOL_interval_literal: /* interval_literal */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2773 "bison_parser.cpp" - break; + break; - case YYSYMBOL_param_expr: /* param_expr */ + case YYSYMBOL_param_expr: /* param_expr */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2779 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_ref: /* table_ref */ + case YYSYMBOL_table_ref: /* table_ref */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2785 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_ref_atomic: /* table_ref_atomic */ + case YYSYMBOL_table_ref_atomic: /* table_ref_atomic */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2791 "bison_parser.cpp" - break; + break; - case YYSYMBOL_nonjoin_table_ref_atomic: /* nonjoin_table_ref_atomic */ + case YYSYMBOL_nonjoin_table_ref_atomic: /* nonjoin_table_ref_atomic */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2797 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_ref_commalist: /* table_ref_commalist */ + case YYSYMBOL_table_ref_commalist: /* table_ref_commalist */ #line 182 "bison_parser.y" - { - if (((*yyvaluep).table_vec)) { - for (auto ptr : *(((*yyvaluep).table_vec))) { - delete ptr; - } - } - delete (((*yyvaluep).table_vec)); - } + { + if (((*yyvaluep).table_vec)) { + for (auto ptr : *(((*yyvaluep).table_vec))) { + delete ptr; + } + } + delete (((*yyvaluep).table_vec)); + } #line 2810 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_ref_name: /* table_ref_name */ + case YYSYMBOL_table_ref_name: /* table_ref_name */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2816 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_ref_name_no_alias: /* table_ref_name_no_alias */ + case YYSYMBOL_table_ref_name_no_alias: /* table_ref_name_no_alias */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2822 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_name: /* table_name */ + case YYSYMBOL_table_name: /* table_name */ #line 169 "bison_parser.y" - { - free( (((*yyvaluep).table_name).name) ); - free( (((*yyvaluep).table_name).schema) ); - } + { + free( (((*yyvaluep).table_name).name) ); + free( (((*yyvaluep).table_name).schema) ); + } #line 2831 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_index_name: /* opt_index_name */ + case YYSYMBOL_opt_index_name: /* opt_index_name */ #line 181 "bison_parser.y" - { free( (((*yyvaluep).sval)) ); } + { free( (((*yyvaluep).sval)) ); } #line 2837 "bison_parser.cpp" - break; + break; - case YYSYMBOL_table_alias: /* table_alias */ + case YYSYMBOL_table_alias: /* table_alias */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).alias_t)); } + { delete (((*yyvaluep).alias_t)); } #line 2843 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_table_alias: /* opt_table_alias */ + case YYSYMBOL_opt_table_alias: /* opt_table_alias */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).alias_t)); } + { delete (((*yyvaluep).alias_t)); } #line 2849 "bison_parser.cpp" - break; + break; - case YYSYMBOL_alias: /* alias */ + case YYSYMBOL_alias: /* alias */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).alias_t)); } + { delete (((*yyvaluep).alias_t)); } #line 2855 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_alias: /* opt_alias */ + case YYSYMBOL_opt_alias: /* opt_alias */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).alias_t)); } + { delete (((*yyvaluep).alias_t)); } #line 2861 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_locking_clause: /* opt_locking_clause */ + case YYSYMBOL_opt_locking_clause: /* opt_locking_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).locking_clause_vec)); } + { delete (((*yyvaluep).locking_clause_vec)); } #line 2867 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_locking_clause_list: /* opt_locking_clause_list */ + case YYSYMBOL_opt_locking_clause_list: /* opt_locking_clause_list */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).locking_clause_vec)); } + { delete (((*yyvaluep).locking_clause_vec)); } #line 2873 "bison_parser.cpp" - break; + break; - case YYSYMBOL_locking_clause: /* locking_clause */ + case YYSYMBOL_locking_clause: /* locking_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).locking_t)); } + { delete (((*yyvaluep).locking_t)); } #line 2879 "bison_parser.cpp" - break; + break; - case YYSYMBOL_row_lock_mode: /* row_lock_mode */ + case YYSYMBOL_row_lock_mode: /* row_lock_mode */ #line 168 "bison_parser.y" - { } + { } #line 2885 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_row_lock_policy: /* opt_row_lock_policy */ + case YYSYMBOL_opt_row_lock_policy: /* opt_row_lock_policy */ #line 168 "bison_parser.y" - { } + { } #line 2891 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_with_clause: /* opt_with_clause */ + case YYSYMBOL_opt_with_clause: /* opt_with_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).with_description_vec)); } + { delete (((*yyvaluep).with_description_vec)); } #line 2897 "bison_parser.cpp" - break; + break; - case YYSYMBOL_with_clause: /* with_clause */ + case YYSYMBOL_with_clause: /* with_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).with_description_vec)); } + { delete (((*yyvaluep).with_description_vec)); } #line 2903 "bison_parser.cpp" - break; + break; - case YYSYMBOL_with_description_list: /* with_description_list */ + case YYSYMBOL_with_description_list: /* with_description_list */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).with_description_vec)); } + { delete (((*yyvaluep).with_description_vec)); } #line 2909 "bison_parser.cpp" - break; + break; - case YYSYMBOL_with_description: /* with_description */ + case YYSYMBOL_with_description: /* with_description */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).with_description_t)); } + { delete (((*yyvaluep).with_description_t)); } #line 2915 "bison_parser.cpp" - break; + break; - case YYSYMBOL_join_clause: /* join_clause */ + case YYSYMBOL_join_clause: /* join_clause */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).table)); } + { delete (((*yyvaluep).table)); } #line 2921 "bison_parser.cpp" - break; + break; - case YYSYMBOL_opt_join_type: /* opt_join_type */ + case YYSYMBOL_opt_join_type: /* opt_join_type */ #line 168 "bison_parser.y" - { } + { } #line 2927 "bison_parser.cpp" - break; + break; - case YYSYMBOL_join_condition: /* join_condition */ + case YYSYMBOL_join_condition: /* join_condition */ #line 190 "bison_parser.y" - { delete (((*yyvaluep).expr)); } + { delete (((*yyvaluep).expr)); } #line 2933 "bison_parser.cpp" - break; + break; - case YYSYMBOL_ident_commalist: /* ident_commalist */ + case YYSYMBOL_ident_commalist: /* ident_commalist */ #line 173 "bison_parser.y" - { - if (((*yyvaluep).str_vec)) { - for (auto ptr : *(((*yyvaluep).str_vec))) { - free(ptr); - } - } - delete (((*yyvaluep).str_vec)); - } + { + if (((*yyvaluep).str_vec)) { + for (auto ptr : *(((*yyvaluep).str_vec))) { + free(ptr); + } + } + delete (((*yyvaluep).str_vec)); + } #line 2946 "bison_parser.cpp" - break; + break; - default: - break; - } + default: + break; + } YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -2986,33 +2986,33 @@ static YYLTYPE yyloc_default ; YYLTYPE yylloc = yyloc_default; - /* Number of syntax errors so far. */ - int yynerrs = 0; + /* Number of syntax errors so far. */ + int yynerrs = 0; - yy_state_fast_t yystate = 0; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus = 0; + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; - /* Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ - /* Their size. */ - YYPTRDIFF_T yystacksize = YYINITDEPTH; + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; - /* The state stack: array, bottom, top. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss = yyssa; - yy_state_t *yyssp = yyss; + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; - /* The semantic value stack: array, bottom, top. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp = yyvs; + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; - /* The location stack: array, bottom, top. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp = yyls; + /* The location stack: array, bottom, top. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp = yyls; int yyn; /* The return value of yyparse. */ @@ -3020,7 +3020,7 @@ YYLTYPE yylloc = yyloc_default; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the - action routines. */ + action routines. */ YYSTYPE yyval; YYLTYPE yyloc; @@ -3035,7 +3035,7 @@ YYLTYPE yylloc = yyloc_default; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ + Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -3066,7 +3066,7 @@ YYLTYPE yylloc = yyloc_default; `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; @@ -3083,75 +3083,75 @@ yysetstate: if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE - YYNOMEM; + YYNOMEM; #else - { - /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - YYLTYPE *yyls1 = yyls; + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + YYLTYPE *yyls1 = yyls; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * YYSIZEOF (*yyssp), - &yyvs1, yysize * YYSIZEOF (*yyvsp), - &yyls1, yysize * YYSIZEOF (*yylsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - yyls = yyls1; - } + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yyls1, yysize * YYSIZEOF (*yylsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + yyls = yyls1; + } # else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - YYNOMEM; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; - { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = - YY_CAST (union yyalloc *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); - if (! yyptr) - YYNOMEM; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } # endif - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + yysize - 1; - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF ((stderr, "Stack size increased to %ld\n", - YY_CAST (long, yystacksize))); - YY_IGNORE_USELESS_CAST_END + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) - YYACCEPT; + YYACCEPT; goto yybackup; @@ -3161,63 +3161,63 @@ yysetstate: `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) - goto yydefault; + goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == SQL_HSQL_EMPTY) - { - YYDPRINTF ((stderr, "Reading a token\n")); - yychar = yylex (&yylval, &yylloc, scanner); - } + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, &yylloc, scanner); + } if (yychar <= SQL_YYEOF) - { - yychar = SQL_YYEOF; - yytoken = YYSYMBOL_YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } + { + yychar = SQL_YYEOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } else if (yychar == SQL_HSQL_error) - { - /* The scanner already issued an error message, process directly - to error recovery. But do not keep the error token as - lookahead, it is too special and may lead us to an endless - loop in error recovery. */ - yychar = SQL_HSQL_UNDEF; - yytoken = YYSYMBOL_YYerror; - yyerror_range[1] = yylloc; - goto yyerrlab1; - } + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = SQL_HSQL_UNDEF; + yytoken = YYSYMBOL_YYerror; + yyerror_range[1] = yylloc; + goto yyerrlab1; + } else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ + detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; + goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } + { + if (yytable_value_is_error (yyn)) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } /* Count tokens shifted since error; after three, turn off error - status. */ + status. */ if (yyerrstatus) - yyerrstatus--; + yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); @@ -3238,7 +3238,7 @@ yybackup: yydefault: yyn = yydefact[yystate]; if (yyn == 0) - goto yyerrlab; + goto yyerrlab; goto yyreduce; @@ -3250,13 +3250,13 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. + '$$ = $1'. - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; /* Default location. */ @@ -3264,257 +3264,257 @@ yyreduce: yyerror_range[1] = yyloc; YY_REDUCE_PRINT (yyn); switch (yyn) - { + { case 2: /* input: statement_list opt_semicolon */ #line 322 "bison_parser.y" - { + { for (SQLStatement* stmt : *(yyvsp[-1].stmt_vec)) { - // Transfers ownership of the statement. - result->addStatement(stmt); + // Transfers ownership of the statement. + result->addStatement(stmt); } unsigned param_id = 0; for (void* param : yyloc.param_list) { - if (param) { - Expr* expr = (Expr*)param; - expr->ival = param_id; - result->addParameter(expr); - ++param_id; - } + if (param) { + Expr* expr = (Expr*)param; + expr->ival = param_id; + result->addParameter(expr); + ++param_id; + } } - delete (yyvsp[-1].stmt_vec); + delete (yyvsp[-1].stmt_vec); } #line 3283 "bison_parser.cpp" - break; + break; case 3: /* statement_list: statement */ #line 341 "bison_parser.y" - { + { (yyvsp[0].statement)->stringLength = yylloc.string_length; yylloc.string_length = 0; (yyval.stmt_vec) = new std::vector(); (yyval.stmt_vec)->push_back((yyvsp[0].statement)); } #line 3294 "bison_parser.cpp" - break; + break; case 4: /* statement_list: statement_list ';' statement */ #line 347 "bison_parser.y" - { + { (yyvsp[0].statement)->stringLength = yylloc.string_length; yylloc.string_length = 0; (yyvsp[-2].stmt_vec)->push_back((yyvsp[0].statement)); (yyval.stmt_vec) = (yyvsp[-2].stmt_vec); } #line 3305 "bison_parser.cpp" - break; + break; case 5: /* statement: prepare_statement opt_hints */ #line 354 "bison_parser.y" - { + { (yyval.statement) = (yyvsp[-1].prep_stmt); (yyval.statement)->hints = (yyvsp[0].expr_vec); } #line 3314 "bison_parser.cpp" - break; + break; case 6: /* statement: preparable_statement opt_hints */ #line 358 "bison_parser.y" - { + { (yyval.statement) = (yyvsp[-1].statement); (yyval.statement)->hints = (yyvsp[0].expr_vec); } #line 3323 "bison_parser.cpp" - break; + break; case 7: /* statement: show_statement */ #line 362 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].show_stmt); } + { (yyval.statement) = (yyvsp[0].show_stmt); } #line 3329 "bison_parser.cpp" - break; + break; case 8: /* statement: import_statement */ #line 363 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].import_stmt); } + { (yyval.statement) = (yyvsp[0].import_stmt); } #line 3335 "bison_parser.cpp" - break; + break; case 9: /* statement: export_statement */ #line 364 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].export_stmt); } + { (yyval.statement) = (yyvsp[0].export_stmt); } #line 3341 "bison_parser.cpp" - break; + break; case 10: /* preparable_statement: select_statement */ #line 366 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].select_stmt); } + { (yyval.statement) = (yyvsp[0].select_stmt); } #line 3347 "bison_parser.cpp" - break; + break; case 11: /* preparable_statement: create_statement */ #line 367 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].create_stmt); } + { (yyval.statement) = (yyvsp[0].create_stmt); } #line 3353 "bison_parser.cpp" - break; + break; case 12: /* preparable_statement: insert_statement */ #line 368 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].insert_stmt); } + { (yyval.statement) = (yyvsp[0].insert_stmt); } #line 3359 "bison_parser.cpp" - break; + break; case 13: /* preparable_statement: delete_statement */ #line 369 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].delete_stmt); } + { (yyval.statement) = (yyvsp[0].delete_stmt); } #line 3365 "bison_parser.cpp" - break; + break; case 14: /* preparable_statement: truncate_statement */ #line 370 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].delete_stmt); } + { (yyval.statement) = (yyvsp[0].delete_stmt); } #line 3371 "bison_parser.cpp" - break; + break; case 15: /* preparable_statement: update_statement */ #line 371 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].update_stmt); } + { (yyval.statement) = (yyvsp[0].update_stmt); } #line 3377 "bison_parser.cpp" - break; + break; case 16: /* preparable_statement: drop_statement */ #line 372 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].drop_stmt); } + { (yyval.statement) = (yyvsp[0].drop_stmt); } #line 3383 "bison_parser.cpp" - break; + break; case 17: /* preparable_statement: alter_statement */ #line 373 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].alter_stmt); } + { (yyval.statement) = (yyvsp[0].alter_stmt); } #line 3389 "bison_parser.cpp" - break; + break; case 18: /* preparable_statement: execute_statement */ #line 374 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].exec_stmt); } + { (yyval.statement) = (yyvsp[0].exec_stmt); } #line 3395 "bison_parser.cpp" - break; + break; case 19: /* preparable_statement: transaction_statement */ #line 375 "bison_parser.y" - { (yyval.statement) = (yyvsp[0].transaction_stmt); } + { (yyval.statement) = (yyvsp[0].transaction_stmt); } #line 3401 "bison_parser.cpp" - break; + break; case 20: /* opt_hints: WITH HINT '(' hint_list ')' */ #line 381 "bison_parser.y" - { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } + { (yyval.expr_vec) = (yyvsp[-1].expr_vec); } #line 3407 "bison_parser.cpp" - break; + break; case 21: /* opt_hints: %empty */ #line 382 "bison_parser.y" - { (yyval.expr_vec) = nullptr; } + { (yyval.expr_vec) = nullptr; } #line 3413 "bison_parser.cpp" - break; + break; case 22: /* hint_list: hint */ #line 384 "bison_parser.y" - { + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } #line 3422 "bison_parser.cpp" - break; + break; case 23: /* hint_list: hint_list ',' hint */ #line 388 "bison_parser.y" - { + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 3431 "bison_parser.cpp" - break; + break; case 24: /* hint: IDENTIFIER */ #line 393 "bison_parser.y" - { + { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[0].sval); } #line 3440 "bison_parser.cpp" - break; + break; case 25: /* hint: IDENTIFIER '(' literal_list ')' */ #line 397 "bison_parser.y" - { + { (yyval.expr) = Expr::make(kExprHint); (yyval.expr)->name = (yyvsp[-3].sval); (yyval.expr)->exprList = (yyvsp[-1].expr_vec); } #line 3450 "bison_parser.cpp" - break; + break; case 26: /* transaction_statement: BEGIN opt_transaction_keyword */ #line 407 "bison_parser.y" - { (yyval.transaction_stmt) = new TransactionStatement(kBeginTransaction); } + { (yyval.transaction_stmt) = new TransactionStatement(kBeginTransaction); } #line 3456 "bison_parser.cpp" - break; + break; case 27: /* transaction_statement: ROLLBACK opt_transaction_keyword */ #line 408 "bison_parser.y" - { (yyval.transaction_stmt) = new TransactionStatement(kRollbackTransaction); } + { (yyval.transaction_stmt) = new TransactionStatement(kRollbackTransaction); } #line 3462 "bison_parser.cpp" - break; + break; case 28: /* transaction_statement: COMMIT opt_transaction_keyword */ #line 409 "bison_parser.y" - { (yyval.transaction_stmt) = new TransactionStatement(kCommitTransaction); } + { (yyval.transaction_stmt) = new TransactionStatement(kCommitTransaction); } #line 3468 "bison_parser.cpp" - break; + break; case 31: /* prepare_statement: PREPARE IDENTIFIER FROM prepare_target_query */ #line 417 "bison_parser.y" - { + { (yyval.prep_stmt) = new PrepareStatement(); (yyval.prep_stmt)->name = (yyvsp[-2].sval); (yyval.prep_stmt)->query = (yyvsp[0].sval); } #line 3478 "bison_parser.cpp" - break; + break; case 33: /* execute_statement: EXECUTE IDENTIFIER */ #line 425 "bison_parser.y" - { + { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[0].sval); } #line 3487 "bison_parser.cpp" - break; + break; case 34: /* execute_statement: EXECUTE IDENTIFIER '(' opt_literal_list ')' */ #line 429 "bison_parser.y" - { + { (yyval.exec_stmt) = new ExecuteStatement(); (yyval.exec_stmt)->name = (yyvsp[-3].sval); (yyval.exec_stmt)->parameters = (yyvsp[-1].expr_vec); } #line 3497 "bison_parser.cpp" - break; + break; case 35: /* import_statement: IMPORT FROM file_type FILE file_path INTO table_name */ #line 440 "bison_parser.y" - { + { (yyval.import_stmt) = new ImportStatement((yyvsp[-4].import_type_t)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); (yyval.import_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.import_stmt)->tableName = (yyvsp[0].table_name).name; } #line 3508 "bison_parser.cpp" - break; + break; case 36: /* import_statement: COPY table_name FROM file_path opt_file_type opt_where */ #line 446 "bison_parser.y" - { + { (yyval.import_stmt) = new ImportStatement((yyvsp[-1].import_type_t)); (yyval.import_stmt)->filePath = (yyvsp[-2].sval); (yyval.import_stmt)->schema = (yyvsp[-4].table_name).schema; @@ -3522,116 +3522,116 @@ yyreduce: (yyval.import_stmt)->whereClause = (yyvsp[0].expr); } #line 3520 "bison_parser.cpp" - break; + break; case 37: /* file_type: IDENTIFIER */ #line 454 "bison_parser.y" - { + { if (strcasecmp((yyvsp[0].sval), "csv") == 0) { - (yyval.import_type_t) = kImportCSV; + (yyval.import_type_t) = kImportCSV; } else if (strcasecmp((yyvsp[0].sval), "tbl") == 0) { - (yyval.import_type_t) = kImportTbl; + (yyval.import_type_t) = kImportTbl; } else if (strcasecmp((yyvsp[0].sval), "binary") == 0 || strcasecmp((yyvsp[0].sval), "bin") == 0) { - (yyval.import_type_t) = kImportBinary; + (yyval.import_type_t) = kImportBinary; } else { - free((yyvsp[0].sval)); - yyerror(&yyloc, result, scanner, "File type is unknown."); - YYERROR; + free((yyvsp[0].sval)); + yyerror(&yyloc, result, scanner, "File type is unknown."); + YYERROR; } free((yyvsp[0].sval)); } #line 3539 "bison_parser.cpp" - break; + break; case 38: /* file_path: string_literal */ #line 469 "bison_parser.y" - { + { (yyval.sval) = strdup((yyvsp[0].expr)->name); delete (yyvsp[0].expr); } #line 3548 "bison_parser.cpp" - break; + break; case 39: /* opt_file_type: WITH FORMAT file_type */ #line 474 "bison_parser.y" - { (yyval.import_type_t) = (yyvsp[0].import_type_t); } + { (yyval.import_type_t) = (yyvsp[0].import_type_t); } #line 3554 "bison_parser.cpp" - break; + break; case 40: /* opt_file_type: %empty */ #line 475 "bison_parser.y" - { (yyval.import_type_t) = kImportAuto; } + { (yyval.import_type_t) = kImportAuto; } #line 3560 "bison_parser.cpp" - break; + break; case 41: /* export_statement: COPY table_name TO file_path opt_file_type */ #line 481 "bison_parser.y" - { + { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_type_t)); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); (yyval.export_stmt)->schema = (yyvsp[-3].table_name).schema; (yyval.export_stmt)->tableName = (yyvsp[-3].table_name).name; } #line 3571 "bison_parser.cpp" - break; + break; case 42: /* export_statement: COPY select_with_paren TO file_path opt_file_type */ #line 487 "bison_parser.y" - { + { (yyval.export_stmt) = new ExportStatement((yyvsp[0].import_type_t)); (yyval.export_stmt)->filePath = (yyvsp[-1].sval); (yyval.export_stmt)->select = (yyvsp[-3].select_stmt); } #line 3581 "bison_parser.cpp" - break; + break; case 43: /* show_statement: SHOW TABLES */ #line 498 "bison_parser.y" - { (yyval.show_stmt) = new ShowStatement(kShowTables); } + { (yyval.show_stmt) = new ShowStatement(kShowTables); } #line 3587 "bison_parser.cpp" - break; + break; case 44: /* show_statement: SHOW COLUMNS table_name */ #line 499 "bison_parser.y" - { + { (yyval.show_stmt) = new ShowStatement(kShowColumns); (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } #line 3597 "bison_parser.cpp" - break; + break; case 45: /* show_statement: DESCRIBE table_name */ #line 504 "bison_parser.y" - { + { (yyval.show_stmt) = new ShowStatement(kShowColumns); (yyval.show_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.show_stmt)->name = (yyvsp[0].table_name).name; } #line 3607 "bison_parser.cpp" - break; + break; case 46: /* create_statement: CREATE TABLE opt_not_exists table_name FROM IDENTIFIER FILE file_path */ #line 515 "bison_parser.y" - { + { (yyval.create_stmt) = new CreateStatement(kCreateTableFromTbl); (yyval.create_stmt)->ifNotExists = (yyvsp[-5].bval); (yyval.create_stmt)->schema = (yyvsp[-4].table_name).schema; (yyval.create_stmt)->tableName = (yyvsp[-4].table_name).name; if (strcasecmp((yyvsp[-2].sval), "tbl") != 0) { - free((yyvsp[-2].sval)); - yyerror(&yyloc, result, scanner, "File type is unknown."); - YYERROR; + free((yyvsp[-2].sval)); + yyerror(&yyloc, result, scanner, "File type is unknown."); + YYERROR; } free((yyvsp[-2].sval)); (yyval.create_stmt)->filePath = (yyvsp[0].sval); } #line 3625 "bison_parser.cpp" - break; + break; case 47: /* create_statement: CREATE TABLE opt_not_exists table_name '(' table_elem_commalist ')' */ #line 528 "bison_parser.y" - { + { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); (yyval.create_stmt)->schema = (yyvsp[-3].table_name).schema; @@ -3639,16 +3639,16 @@ yyreduce: (yyval.create_stmt)->setColumnDefsAndConstraints((yyvsp[-1].table_element_vec)); delete (yyvsp[-1].table_element_vec); if (result->errorMsg()) { - delete (yyval.create_stmt); - YYERROR; + delete (yyval.create_stmt); + YYERROR; } } #line 3642 "bison_parser.cpp" - break; + break; case 48: /* create_statement: CREATE TABLE opt_not_exists table_name AS select_statement */ #line 540 "bison_parser.y" - { + { (yyval.create_stmt) = new CreateStatement(kCreateTable); (yyval.create_stmt)->ifNotExists = (yyvsp[-3].bval); (yyval.create_stmt)->schema = (yyvsp[-2].table_name).schema; @@ -3656,11 +3656,11 @@ yyreduce: (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } #line 3654 "bison_parser.cpp" - break; + break; case 49: /* create_statement: CREATE INDEX opt_not_exists opt_index_name ON table_name '(' ident_commalist ')' */ #line 547 "bison_parser.y" - { + { (yyval.create_stmt) = new CreateStatement(kCreateIndex); (yyval.create_stmt)->indexName = (yyvsp[-5].sval); (yyval.create_stmt)->ifNotExists = (yyvsp[-6].bval); @@ -3668,11 +3668,11 @@ yyreduce: (yyval.create_stmt)->indexColumns = (yyvsp[-1].str_vec); } #line 3666 "bison_parser.cpp" - break; + break; case 50: /* create_statement: CREATE VIEW opt_not_exists table_name opt_column_list AS select_statement */ #line 554 "bison_parser.y" - { + { (yyval.create_stmt) = new CreateStatement(kCreateView); (yyval.create_stmt)->ifNotExists = (yyvsp[-4].bval); (yyval.create_stmt)->schema = (yyvsp[-3].table_name).schema; @@ -3681,371 +3681,371 @@ yyreduce: (yyval.create_stmt)->select = (yyvsp[0].select_stmt); } #line 3679 "bison_parser.cpp" - break; + break; case 51: /* opt_not_exists: IF NOT EXISTS */ #line 563 "bison_parser.y" - { (yyval.bval) = true; } + { (yyval.bval) = true; } #line 3685 "bison_parser.cpp" - break; + break; case 52: /* opt_not_exists: %empty */ #line 564 "bison_parser.y" - { (yyval.bval) = false; } + { (yyval.bval) = false; } #line 3691 "bison_parser.cpp" - break; + break; case 53: /* table_elem_commalist: table_elem */ #line 566 "bison_parser.y" - { + { (yyval.table_element_vec) = new std::vector(); (yyval.table_element_vec)->push_back((yyvsp[0].table_element_t)); } #line 3700 "bison_parser.cpp" - break; + break; case 54: /* table_elem_commalist: table_elem_commalist ',' table_elem */ #line 570 "bison_parser.y" - { + { (yyvsp[-2].table_element_vec)->push_back((yyvsp[0].table_element_t)); (yyval.table_element_vec) = (yyvsp[-2].table_element_vec); } #line 3709 "bison_parser.cpp" - break; + break; case 55: /* table_elem: column_def */ #line 575 "bison_parser.y" - { (yyval.table_element_t) = (yyvsp[0].column_t); } + { (yyval.table_element_t) = (yyvsp[0].column_t); } #line 3715 "bison_parser.cpp" - break; + break; case 56: /* table_elem: table_constraint */ #line 576 "bison_parser.y" - { (yyval.table_element_t) = (yyvsp[0].table_constraint_t); } + { (yyval.table_element_t) = (yyvsp[0].table_constraint_t); } #line 3721 "bison_parser.cpp" - break; + break; case 57: /* column_def: IDENTIFIER column_type opt_column_constraints */ #line 578 "bison_parser.y" - { + { (yyval.column_t) = new ColumnDefinition((yyvsp[-2].sval), (yyvsp[-1].column_type_t), (yyvsp[0].column_constraint_set)); if (!(yyval.column_t)->trySetNullableExplicit()) { - yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{(yyvsp[-2].sval)}).c_str()); + yyerror(&yyloc, result, scanner, ("Conflicting nullability constraints for " + std::string{(yyvsp[-2].sval)}).c_str()); } } #line 3732 "bison_parser.cpp" - break; + break; case 58: /* column_type: BIGINT */ #line 585 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::BIGINT}; } + { (yyval.column_type_t) = ColumnType{DataType::BIGINT}; } #line 3738 "bison_parser.cpp" - break; + break; case 59: /* column_type: BOOLEAN */ #line 586 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::BOOLEAN}; } + { (yyval.column_type_t) = ColumnType{DataType::BOOLEAN}; } #line 3744 "bison_parser.cpp" - break; + break; case 60: /* column_type: CHAR '(' INTVAL ')' */ #line 587 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::CHAR, (yyvsp[-1].ival)}; } + { (yyval.column_type_t) = ColumnType{DataType::CHAR, (yyvsp[-1].ival)}; } #line 3750 "bison_parser.cpp" - break; + break; case 61: /* column_type: CHARACTER_VARYING '(' INTVAL ')' */ #line 588 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } + { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } #line 3756 "bison_parser.cpp" - break; + break; case 62: /* column_type: DATE */ #line 589 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::DATE}; } + { (yyval.column_type_t) = ColumnType{DataType::DATE}; } #line 3762 "bison_parser.cpp" - break; + break; case 63: /* column_type: DATETIME */ #line 590 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } + { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } #line 3768 "bison_parser.cpp" - break; + break; case 64: /* column_type: DECIMAL opt_decimal_specification */ #line 591 "bison_parser.y" - { + { (yyval.column_type_t) = ColumnType{DataType::DECIMAL, 0, (yyvsp[0].ival_pair)->first, (yyvsp[0].ival_pair)->second}; delete (yyvsp[0].ival_pair); } #line 3777 "bison_parser.cpp" - break; + break; case 65: /* column_type: DOUBLE */ #line 595 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::DOUBLE}; } + { (yyval.column_type_t) = ColumnType{DataType::DOUBLE}; } #line 3783 "bison_parser.cpp" - break; + break; case 66: /* column_type: FLOAT */ #line 596 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::FLOAT}; } + { (yyval.column_type_t) = ColumnType{DataType::FLOAT}; } #line 3789 "bison_parser.cpp" - break; + break; case 67: /* column_type: INT */ #line 597 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::INT}; } + { (yyval.column_type_t) = ColumnType{DataType::INT}; } #line 3795 "bison_parser.cpp" - break; + break; case 68: /* column_type: INTEGER */ #line 598 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::INT}; } + { (yyval.column_type_t) = ColumnType{DataType::INT}; } #line 3801 "bison_parser.cpp" - break; + break; case 69: /* column_type: LONG */ #line 599 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::LONG}; } + { (yyval.column_type_t) = ColumnType{DataType::LONG}; } #line 3807 "bison_parser.cpp" - break; + break; case 70: /* column_type: REAL */ #line 600 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::REAL}; } + { (yyval.column_type_t) = ColumnType{DataType::REAL}; } #line 3813 "bison_parser.cpp" - break; + break; case 71: /* column_type: SMALLINT */ #line 601 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::SMALLINT}; } + { (yyval.column_type_t) = ColumnType{DataType::SMALLINT}; } #line 3819 "bison_parser.cpp" - break; + break; case 72: /* column_type: TEXT */ #line 602 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::TEXT}; } + { (yyval.column_type_t) = ColumnType{DataType::TEXT}; } #line 3825 "bison_parser.cpp" - break; + break; case 73: /* column_type: TIME opt_time_precision */ #line 603 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::TIME, 0, (yyvsp[0].ival)}; } + { (yyval.column_type_t) = ColumnType{DataType::TIME, 0, (yyvsp[0].ival)}; } #line 3831 "bison_parser.cpp" - break; + break; case 74: /* column_type: TIMESTAMP */ #line 604 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } + { (yyval.column_type_t) = ColumnType{DataType::DATETIME}; } #line 3837 "bison_parser.cpp" - break; + break; case 75: /* column_type: VARCHAR '(' INTVAL ')' */ #line 605 "bison_parser.y" - { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } + { (yyval.column_type_t) = ColumnType{DataType::VARCHAR, (yyvsp[-1].ival)}; } #line 3843 "bison_parser.cpp" - break; + break; case 76: /* opt_time_precision: '(' INTVAL ')' */ #line 607 "bison_parser.y" - { (yyval.ival) = (yyvsp[-1].ival); } + { (yyval.ival) = (yyvsp[-1].ival); } #line 3849 "bison_parser.cpp" - break; + break; case 77: /* opt_time_precision: %empty */ #line 608 "bison_parser.y" - { (yyval.ival) = 0; } + { (yyval.ival) = 0; } #line 3855 "bison_parser.cpp" - break; + break; case 78: /* opt_decimal_specification: '(' INTVAL ',' INTVAL ')' */ #line 610 "bison_parser.y" - { (yyval.ival_pair) = new std::pair{(yyvsp[-3].ival), (yyvsp[-1].ival)}; } + { (yyval.ival_pair) = new std::pair{(yyvsp[-3].ival), (yyvsp[-1].ival)}; } #line 3861 "bison_parser.cpp" - break; + break; case 79: /* opt_decimal_specification: '(' INTVAL ')' */ #line 611 "bison_parser.y" - { (yyval.ival_pair) = new std::pair{(yyvsp[-1].ival), 0}; } + { (yyval.ival_pair) = new std::pair{(yyvsp[-1].ival), 0}; } #line 3867 "bison_parser.cpp" - break; + break; case 80: /* opt_decimal_specification: %empty */ #line 612 "bison_parser.y" - { (yyval.ival_pair) = new std::pair{0, 0}; } + { (yyval.ival_pair) = new std::pair{0, 0}; } #line 3873 "bison_parser.cpp" - break; + break; case 81: /* opt_column_constraints: column_constraint_set */ #line 614 "bison_parser.y" - { (yyval.column_constraint_set) = (yyvsp[0].column_constraint_set); } + { (yyval.column_constraint_set) = (yyvsp[0].column_constraint_set); } #line 3879 "bison_parser.cpp" - break; + break; case 82: /* opt_column_constraints: %empty */ #line 615 "bison_parser.y" - { (yyval.column_constraint_set) = new std::unordered_set(); } + { (yyval.column_constraint_set) = new std::unordered_set(); } #line 3885 "bison_parser.cpp" - break; + break; case 83: /* column_constraint_set: column_constraint */ #line 617 "bison_parser.y" - { + { (yyval.column_constraint_set) = new std::unordered_set(); (yyval.column_constraint_set)->insert((yyvsp[0].column_constraint_t)); } #line 3894 "bison_parser.cpp" - break; + break; case 84: /* column_constraint_set: column_constraint_set column_constraint */ #line 621 "bison_parser.y" - { + { (yyvsp[-1].column_constraint_set)->insert((yyvsp[0].column_constraint_t)); (yyval.column_constraint_set) = (yyvsp[-1].column_constraint_set); } #line 3903 "bison_parser.cpp" - break; + break; case 85: /* column_constraint: PRIMARY KEY */ #line 626 "bison_parser.y" - { (yyval.column_constraint_t) = ConstraintType::PrimaryKey; } + { (yyval.column_constraint_t) = ConstraintType::PrimaryKey; } #line 3909 "bison_parser.cpp" - break; + break; case 86: /* column_constraint: UNIQUE */ #line 627 "bison_parser.y" - { (yyval.column_constraint_t) = ConstraintType::Unique; } + { (yyval.column_constraint_t) = ConstraintType::Unique; } #line 3915 "bison_parser.cpp" - break; + break; case 87: /* column_constraint: NULL */ #line 628 "bison_parser.y" - { (yyval.column_constraint_t) = ConstraintType::Null; } + { (yyval.column_constraint_t) = ConstraintType::Null; } #line 3921 "bison_parser.cpp" - break; + break; case 88: /* column_constraint: NOT NULL */ #line 629 "bison_parser.y" - { (yyval.column_constraint_t) = ConstraintType::NotNull; } + { (yyval.column_constraint_t) = ConstraintType::NotNull; } #line 3927 "bison_parser.cpp" - break; + break; case 89: /* table_constraint: PRIMARY KEY '(' ident_commalist ')' */ #line 631 "bison_parser.y" - { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::PrimaryKey, (yyvsp[-1].str_vec)); } + { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::PrimaryKey, (yyvsp[-1].str_vec)); } #line 3933 "bison_parser.cpp" - break; + break; case 90: /* table_constraint: UNIQUE '(' ident_commalist ')' */ #line 632 "bison_parser.y" - { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::Unique, (yyvsp[-1].str_vec)); } + { (yyval.table_constraint_t) = new TableConstraint(ConstraintType::Unique, (yyvsp[-1].str_vec)); } #line 3939 "bison_parser.cpp" - break; + break; case 91: /* drop_statement: DROP TABLE opt_exists table_name */ #line 640 "bison_parser.y" - { + { (yyval.drop_stmt) = new DropStatement(kDropTable); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } #line 3950 "bison_parser.cpp" - break; + break; case 92: /* drop_statement: DROP VIEW opt_exists table_name */ #line 646 "bison_parser.y" - { + { (yyval.drop_stmt) = new DropStatement(kDropView); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.drop_stmt)->name = (yyvsp[0].table_name).name; } #line 3961 "bison_parser.cpp" - break; + break; case 93: /* drop_statement: DEALLOCATE PREPARE IDENTIFIER */ #line 652 "bison_parser.y" - { + { (yyval.drop_stmt) = new DropStatement(kDropPreparedStatement); (yyval.drop_stmt)->ifExists = false; (yyval.drop_stmt)->name = (yyvsp[0].sval); } #line 3971 "bison_parser.cpp" - break; + break; case 94: /* drop_statement: DROP INDEX opt_exists IDENTIFIER */ #line 658 "bison_parser.y" - { + { (yyval.drop_stmt) = new DropStatement(kDropIndex); (yyval.drop_stmt)->ifExists = (yyvsp[-1].bval); (yyval.drop_stmt)->indexName = (yyvsp[0].sval); } #line 3981 "bison_parser.cpp" - break; + break; case 95: /* opt_exists: IF EXISTS */ #line 664 "bison_parser.y" - { (yyval.bval) = true; } + { (yyval.bval) = true; } #line 3987 "bison_parser.cpp" - break; + break; case 96: /* opt_exists: %empty */ #line 665 "bison_parser.y" - { (yyval.bval) = false; } + { (yyval.bval) = false; } #line 3993 "bison_parser.cpp" - break; + break; case 97: /* alter_statement: ALTER TABLE opt_exists table_name alter_action */ #line 672 "bison_parser.y" - { + { (yyval.alter_stmt) = new AlterStatement((yyvsp[-1].table_name).name, (yyvsp[0].alter_action_t)); (yyval.alter_stmt)->ifTableExists = (yyvsp[-2].bval); (yyval.alter_stmt)->schema = (yyvsp[-1].table_name).schema; } #line 4003 "bison_parser.cpp" - break; + break; case 98: /* alter_action: drop_action */ #line 678 "bison_parser.y" - { (yyval.alter_action_t) = (yyvsp[0].drop_action_t); } + { (yyval.alter_action_t) = (yyvsp[0].drop_action_t); } #line 4009 "bison_parser.cpp" - break; + break; case 99: /* drop_action: DROP COLUMN opt_exists IDENTIFIER */ #line 680 "bison_parser.y" - { + { (yyval.drop_action_t) = new DropColumnAction((yyvsp[0].sval)); (yyval.drop_action_t)->ifExists = (yyvsp[-1].bval); } #line 4018 "bison_parser.cpp" - break; + break; case 100: /* delete_statement: DELETE FROM table_name opt_where */ #line 690 "bison_parser.y" - { + { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->schema = (yyvsp[-1].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[-1].table_name).name; (yyval.delete_stmt)->expr = (yyvsp[0].expr); } #line 4029 "bison_parser.cpp" - break; + break; case 101: /* truncate_statement: TRUNCATE table_name */ #line 697 "bison_parser.y" - { + { (yyval.delete_stmt) = new DeleteStatement(); (yyval.delete_stmt)->schema = (yyvsp[0].table_name).schema; (yyval.delete_stmt)->tableName = (yyvsp[0].table_name).name; } #line 4039 "bison_parser.cpp" - break; + break; case 102: /* insert_statement: INSERT INTO table_name opt_column_list VALUES '(' literal_list ')' */ #line 708 "bison_parser.y" - { + { (yyval.insert_stmt) = new InsertStatement(kInsertValues); (yyval.insert_stmt)->schema = (yyvsp[-5].table_name).schema; (yyval.insert_stmt)->tableName = (yyvsp[-5].table_name).name; @@ -4053,11 +4053,11 @@ yyreduce: (yyval.insert_stmt)->values = (yyvsp[-1].expr_vec); } #line 4051 "bison_parser.cpp" - break; + break; case 103: /* insert_statement: INSERT INTO table_name opt_column_list select_no_paren */ #line 715 "bison_parser.y" - { + { (yyval.insert_stmt) = new InsertStatement(kInsertSelect); (yyval.insert_stmt)->schema = (yyvsp[-2].table_name).schema; (yyval.insert_stmt)->tableName = (yyvsp[-2].table_name).name; @@ -4065,83 +4065,83 @@ yyreduce: (yyval.insert_stmt)->select = (yyvsp[0].select_stmt); } #line 4063 "bison_parser.cpp" - break; + break; case 104: /* opt_column_list: '(' ident_commalist ')' */ #line 723 "bison_parser.y" - { (yyval.str_vec) = (yyvsp[-1].str_vec); } + { (yyval.str_vec) = (yyvsp[-1].str_vec); } #line 4069 "bison_parser.cpp" - break; + break; case 105: /* opt_column_list: %empty */ #line 724 "bison_parser.y" - { (yyval.str_vec) = nullptr; } + { (yyval.str_vec) = nullptr; } #line 4075 "bison_parser.cpp" - break; + break; case 106: /* update_statement: UPDATE table_ref_name_no_alias SET update_clause_commalist opt_where */ #line 731 "bison_parser.y" - { + { (yyval.update_stmt) = new UpdateStatement(); (yyval.update_stmt)->table = (yyvsp[-3].table); (yyval.update_stmt)->updates = (yyvsp[-1].update_vec); (yyval.update_stmt)->where = (yyvsp[0].expr); } #line 4086 "bison_parser.cpp" - break; + break; case 107: /* update_clause_commalist: update_clause */ #line 738 "bison_parser.y" - { + { (yyval.update_vec) = new std::vector(); (yyval.update_vec)->push_back((yyvsp[0].update_t)); } #line 4095 "bison_parser.cpp" - break; + break; case 108: /* update_clause_commalist: update_clause_commalist ',' update_clause */ #line 742 "bison_parser.y" - { + { (yyvsp[-2].update_vec)->push_back((yyvsp[0].update_t)); (yyval.update_vec) = (yyvsp[-2].update_vec); } #line 4104 "bison_parser.cpp" - break; + break; case 109: /* update_clause: IDENTIFIER '=' expr */ #line 747 "bison_parser.y" - { + { (yyval.update_t) = new UpdateClause(); (yyval.update_t)->column = (yyvsp[-2].sval); (yyval.update_t)->value = (yyvsp[0].expr); } #line 4114 "bison_parser.cpp" - break; + break; case 110: /* select_statement: opt_with_clause select_with_paren */ #line 757 "bison_parser.y" - { + { (yyval.select_stmt) = (yyvsp[0].select_stmt); (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); } #line 4123 "bison_parser.cpp" - break; + break; case 111: /* select_statement: opt_with_clause select_no_paren */ #line 761 "bison_parser.y" - { + { (yyval.select_stmt) = (yyvsp[0].select_stmt); (yyval.select_stmt)->withDescriptions = (yyvsp[-1].with_description_vec); } #line 4132 "bison_parser.cpp" - break; + break; case 112: /* select_statement: opt_with_clause select_with_paren set_operator select_within_set_operation opt_order opt_limit */ #line 765 "bison_parser.y" - { + { (yyval.select_stmt) = (yyvsp[-4].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { - (yyval.select_stmt)->setOperations = new std::vector(); + (yyval.select_stmt)->setOperations = new std::vector(); } (yyval.select_stmt)->setOperations->push_back((yyvsp[-3].set_operator_t)); (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[-2].select_stmt); @@ -4150,64 +4150,64 @@ yyreduce: (yyval.select_stmt)->withDescriptions = (yyvsp[-5].with_description_vec); } #line 4148 "bison_parser.cpp" - break; + break; case 115: /* select_within_set_operation_no_parentheses: select_clause */ #line 779 "bison_parser.y" - { (yyval.select_stmt) = (yyvsp[0].select_stmt); } + { (yyval.select_stmt) = (yyvsp[0].select_stmt); } #line 4154 "bison_parser.cpp" - break; + break; case 116: /* select_within_set_operation_no_parentheses: select_clause set_operator select_within_set_operation */ #line 780 "bison_parser.y" - { + { (yyval.select_stmt) = (yyvsp[-2].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { - (yyval.select_stmt)->setOperations = new std::vector(); + (yyval.select_stmt)->setOperations = new std::vector(); } (yyval.select_stmt)->setOperations->push_back((yyvsp[-1].set_operator_t)); (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[0].select_stmt); } #line 4167 "bison_parser.cpp" - break; + break; case 117: /* select_with_paren: '(' select_no_paren ')' */ #line 789 "bison_parser.y" - { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } + { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } #line 4173 "bison_parser.cpp" - break; + break; case 118: /* select_with_paren: '(' select_with_paren ')' */ #line 790 "bison_parser.y" - { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } + { (yyval.select_stmt) = (yyvsp[-1].select_stmt); } #line 4179 "bison_parser.cpp" - break; + break; case 119: /* select_no_paren: select_clause opt_order opt_limit opt_locking_clause */ #line 792 "bison_parser.y" - { + { (yyval.select_stmt) = (yyvsp[-3].select_stmt); (yyval.select_stmt)->order = (yyvsp[-2].order_vec); // Limit could have been set by TOP. if ((yyvsp[-1].limit)) { - delete (yyval.select_stmt)->limit; - (yyval.select_stmt)->limit = (yyvsp[-1].limit); + delete (yyval.select_stmt)->limit; + (yyval.select_stmt)->limit = (yyvsp[-1].limit); } if ((yyvsp[0].locking_clause_vec)) { - (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); + (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); } } #line 4198 "bison_parser.cpp" - break; + break; case 120: /* select_no_paren: select_clause set_operator select_within_set_operation opt_order opt_limit opt_locking_clause */ #line 806 "bison_parser.y" - { + { (yyval.select_stmt) = (yyvsp[-5].select_stmt); if ((yyval.select_stmt)->setOperations == nullptr) { - (yyval.select_stmt)->setOperations = new std::vector(); + (yyval.select_stmt)->setOperations = new std::vector(); } (yyval.select_stmt)->setOperations->push_back((yyvsp[-4].set_operator_t)); (yyval.select_stmt)->setOperations->back()->nestedSelectStatement = (yyvsp[-3].select_stmt); @@ -4216,59 +4216,59 @@ yyreduce: (yyval.select_stmt)->lockings = (yyvsp[0].locking_clause_vec); } #line 4214 "bison_parser.cpp" - break; + break; case 121: /* set_operator: set_type opt_all */ #line 818 "bison_parser.y" - { + { (yyval.set_operator_t) = (yyvsp[-1].set_operator_t); (yyval.set_operator_t)->isAll = (yyvsp[0].bval); } #line 4223 "bison_parser.cpp" - break; + break; case 122: /* set_type: UNION */ #line 823 "bison_parser.y" - { + { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetUnion; } #line 4232 "bison_parser.cpp" - break; + break; case 123: /* set_type: INTERSECT */ #line 827 "bison_parser.y" - { + { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetIntersect; } #line 4241 "bison_parser.cpp" - break; + break; case 124: /* set_type: EXCEPT */ #line 831 "bison_parser.y" - { + { (yyval.set_operator_t) = new SetOperation(); (yyval.set_operator_t)->setType = SetType::kSetExcept; } #line 4250 "bison_parser.cpp" - break; + break; case 125: /* opt_all: ALL */ #line 836 "bison_parser.y" - { (yyval.bval) = true; } + { (yyval.bval) = true; } #line 4256 "bison_parser.cpp" - break; + break; case 126: /* opt_all: %empty */ #line 837 "bison_parser.y" - { (yyval.bval) = false; } + { (yyval.bval) = false; } #line 4262 "bison_parser.cpp" - break; + break; case 127: /* select_clause: SELECT opt_top opt_distinct select_list opt_from_clause opt_where opt_group */ #line 839 "bison_parser.y" - { + { (yyval.select_stmt) = new SelectStatement(); (yyval.select_stmt)->limit = (yyvsp[-5].limit); (yyval.select_stmt)->selectDistinct = (yyvsp[-4].bval); @@ -4278,865 +4278,865 @@ yyreduce: (yyval.select_stmt)->groupBy = (yyvsp[0].group_t); } #line 4276 "bison_parser.cpp" - break; + break; case 128: /* opt_distinct: DISTINCT */ #line 849 "bison_parser.y" - { (yyval.bval) = true; } + { (yyval.bval) = true; } #line 4282 "bison_parser.cpp" - break; + break; case 129: /* opt_distinct: %empty */ #line 850 "bison_parser.y" - { (yyval.bval) = false; } + { (yyval.bval) = false; } #line 4288 "bison_parser.cpp" - break; + break; case 131: /* opt_from_clause: from_clause */ #line 854 "bison_parser.y" - { (yyval.table) = (yyvsp[0].table); } + { (yyval.table) = (yyvsp[0].table); } #line 4294 "bison_parser.cpp" - break; + break; case 132: /* opt_from_clause: %empty */ #line 855 "bison_parser.y" - { (yyval.table) = nullptr; } + { (yyval.table) = nullptr; } #line 4300 "bison_parser.cpp" - break; + break; case 133: /* from_clause: FROM table_ref */ #line 857 "bison_parser.y" - { (yyval.table) = (yyvsp[0].table); } + { (yyval.table) = (yyvsp[0].table); } #line 4306 "bison_parser.cpp" - break; + break; case 134: /* opt_where: WHERE expr */ #line 859 "bison_parser.y" - { (yyval.expr) = (yyvsp[0].expr); } + { (yyval.expr) = (yyvsp[0].expr); } #line 4312 "bison_parser.cpp" - break; + break; case 135: /* opt_where: %empty */ #line 860 "bison_parser.y" - { (yyval.expr) = nullptr; } + { (yyval.expr) = nullptr; } #line 4318 "bison_parser.cpp" - break; + break; case 136: /* opt_group: GROUP BY expr_list opt_having */ #line 862 "bison_parser.y" - { + { (yyval.group_t) = new GroupByDescription(); (yyval.group_t)->columns = (yyvsp[-1].expr_vec); (yyval.group_t)->having = (yyvsp[0].expr); } #line 4328 "bison_parser.cpp" - break; + break; case 137: /* opt_group: %empty */ #line 867 "bison_parser.y" - { (yyval.group_t) = nullptr; } + { (yyval.group_t) = nullptr; } #line 4334 "bison_parser.cpp" - break; + break; case 138: /* opt_having: HAVING expr */ #line 869 "bison_parser.y" - { (yyval.expr) = (yyvsp[0].expr); } + { (yyval.expr) = (yyvsp[0].expr); } #line 4340 "bison_parser.cpp" - break; + break; case 139: /* opt_having: %empty */ #line 870 "bison_parser.y" - { (yyval.expr) = nullptr; } + { (yyval.expr) = nullptr; } #line 4346 "bison_parser.cpp" - break; + break; case 140: /* opt_order: ORDER BY order_list */ #line 872 "bison_parser.y" - { (yyval.order_vec) = (yyvsp[0].order_vec); } + { (yyval.order_vec) = (yyvsp[0].order_vec); } #line 4352 "bison_parser.cpp" - break; + break; case 141: /* opt_order: %empty */ #line 873 "bison_parser.y" - { (yyval.order_vec) = nullptr; } + { (yyval.order_vec) = nullptr; } #line 4358 "bison_parser.cpp" - break; + break; case 142: /* order_list: order_desc */ #line 875 "bison_parser.y" - { + { (yyval.order_vec) = new std::vector(); (yyval.order_vec)->push_back((yyvsp[0].order)); } #line 4367 "bison_parser.cpp" - break; + break; case 143: /* order_list: order_list ',' order_desc */ #line 879 "bison_parser.y" - { + { (yyvsp[-2].order_vec)->push_back((yyvsp[0].order)); (yyval.order_vec) = (yyvsp[-2].order_vec); } #line 4376 "bison_parser.cpp" - break; + break; case 144: /* order_desc: expr opt_order_type */ #line 884 "bison_parser.y" - { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } + { (yyval.order) = new OrderDescription((yyvsp[0].order_type), (yyvsp[-1].expr)); } #line 4382 "bison_parser.cpp" - break; + break; case 145: /* opt_order_type: ASC */ #line 886 "bison_parser.y" - { (yyval.order_type) = kOrderAsc; } + { (yyval.order_type) = kOrderAsc; } #line 4388 "bison_parser.cpp" - break; + break; case 146: /* opt_order_type: DESC */ #line 887 "bison_parser.y" - { (yyval.order_type) = kOrderDesc; } + { (yyval.order_type) = kOrderDesc; } #line 4394 "bison_parser.cpp" - break; + break; case 147: /* opt_order_type: %empty */ #line 888 "bison_parser.y" - { (yyval.order_type) = kOrderAsc; } + { (yyval.order_type) = kOrderAsc; } #line 4400 "bison_parser.cpp" - break; + break; case 148: /* opt_top: TOP int_literal */ #line 892 "bison_parser.y" - { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } + { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } #line 4406 "bison_parser.cpp" - break; + break; case 149: /* opt_top: %empty */ #line 893 "bison_parser.y" - { (yyval.limit) = nullptr; } + { (yyval.limit) = nullptr; } #line 4412 "bison_parser.cpp" - break; + break; case 150: /* opt_limit: LIMIT expr */ #line 895 "bison_parser.y" - { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } + { (yyval.limit) = new LimitDescription((yyvsp[0].expr), nullptr); } #line 4418 "bison_parser.cpp" - break; + break; case 151: /* opt_limit: OFFSET expr */ #line 896 "bison_parser.y" - { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } + { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } #line 4424 "bison_parser.cpp" - break; + break; case 152: /* opt_limit: LIMIT expr OFFSET expr */ #line 897 "bison_parser.y" - { (yyval.limit) = new LimitDescription((yyvsp[-2].expr), (yyvsp[0].expr)); } + { (yyval.limit) = new LimitDescription((yyvsp[-2].expr), (yyvsp[0].expr)); } #line 4430 "bison_parser.cpp" - break; + break; case 153: /* opt_limit: LIMIT ALL */ #line 898 "bison_parser.y" - { (yyval.limit) = new LimitDescription(nullptr, nullptr); } + { (yyval.limit) = new LimitDescription(nullptr, nullptr); } #line 4436 "bison_parser.cpp" - break; + break; case 154: /* opt_limit: LIMIT ALL OFFSET expr */ #line 899 "bison_parser.y" - { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } + { (yyval.limit) = new LimitDescription(nullptr, (yyvsp[0].expr)); } #line 4442 "bison_parser.cpp" - break; + break; case 155: /* opt_limit: %empty */ #line 900 "bison_parser.y" - { (yyval.limit) = nullptr; } + { (yyval.limit) = nullptr; } #line 4448 "bison_parser.cpp" - break; + break; case 156: /* expr_list: expr_alias */ #line 905 "bison_parser.y" - { + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } #line 4457 "bison_parser.cpp" - break; + break; case 157: /* expr_list: expr_list ',' expr_alias */ #line 909 "bison_parser.y" - { + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 4466 "bison_parser.cpp" - break; + break; case 158: /* opt_literal_list: literal_list */ #line 914 "bison_parser.y" - { (yyval.expr_vec) = (yyvsp[0].expr_vec); } + { (yyval.expr_vec) = (yyvsp[0].expr_vec); } #line 4472 "bison_parser.cpp" - break; + break; case 159: /* opt_literal_list: %empty */ #line 915 "bison_parser.y" - { (yyval.expr_vec) = nullptr; } + { (yyval.expr_vec) = nullptr; } #line 4478 "bison_parser.cpp" - break; + break; case 160: /* literal_list: literal */ #line 917 "bison_parser.y" - { + { (yyval.expr_vec) = new std::vector(); (yyval.expr_vec)->push_back((yyvsp[0].expr)); } #line 4487 "bison_parser.cpp" - break; + break; case 161: /* literal_list: literal_list ',' literal */ #line 921 "bison_parser.y" - { + { (yyvsp[-2].expr_vec)->push_back((yyvsp[0].expr)); (yyval.expr_vec) = (yyvsp[-2].expr_vec); } #line 4496 "bison_parser.cpp" - break; + break; case 162: /* expr_alias: expr opt_alias */ #line 926 "bison_parser.y" - { + { (yyval.expr) = (yyvsp[-1].expr); if ((yyvsp[0].alias_t)) { - (yyval.expr)->alias = strdup((yyvsp[0].alias_t)->name); - delete (yyvsp[0].alias_t); + (yyval.expr)->alias = strdup((yyvsp[0].alias_t)->name); + delete (yyvsp[0].alias_t); } } #line 4508 "bison_parser.cpp" - break; + break; case 168: /* operand: '(' expr ')' */ #line 936 "bison_parser.y" - { (yyval.expr) = (yyvsp[-1].expr); } + { (yyval.expr) = (yyvsp[-1].expr); } #line 4514 "bison_parser.cpp" - break; + break; case 178: /* operand: '(' select_no_paren ')' */ #line 938 "bison_parser.y" - { + { (yyval.expr) = Expr::makeSelect((yyvsp[-1].select_stmt)); } #line 4522 "bison_parser.cpp" - break; + break; case 181: /* unary_expr: '-' operand */ #line 944 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpUnary(kOpUnaryMinus, (yyvsp[0].expr)); } #line 4528 "bison_parser.cpp" - break; + break; case 182: /* unary_expr: NOT operand */ #line 945 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpUnary(kOpNot, (yyvsp[0].expr)); } #line 4534 "bison_parser.cpp" - break; + break; case 183: /* unary_expr: operand ISNULL */ #line 946 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } + { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-1].expr)); } #line 4540 "bison_parser.cpp" - break; + break; case 184: /* unary_expr: operand IS NULL */ #line 947 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } + { (yyval.expr) = Expr::makeOpUnary(kOpIsNull, (yyvsp[-2].expr)); } #line 4546 "bison_parser.cpp" - break; + break; case 185: /* unary_expr: operand IS NOT NULL */ #line 948 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeOpUnary(kOpIsNull, (yyvsp[-3].expr))); } #line 4552 "bison_parser.cpp" - break; + break; case 187: /* binary_expr: operand '-' operand */ #line 950 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpMinus, (yyvsp[0].expr)); } #line 4558 "bison_parser.cpp" - break; + break; case 188: /* binary_expr: operand '+' operand */ #line 951 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPlus, (yyvsp[0].expr)); } #line 4564 "bison_parser.cpp" - break; + break; case 189: /* binary_expr: operand '/' operand */ #line 952 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpSlash, (yyvsp[0].expr)); } #line 4570 "bison_parser.cpp" - break; + break; case 190: /* binary_expr: operand '*' operand */ #line 953 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAsterisk, (yyvsp[0].expr)); } #line 4576 "bison_parser.cpp" - break; + break; case 191: /* binary_expr: operand '%' operand */ #line 954 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpPercentage, (yyvsp[0].expr)); } #line 4582 "bison_parser.cpp" - break; + break; case 192: /* binary_expr: operand '^' operand */ #line 955 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpCaret, (yyvsp[0].expr)); } #line 4588 "bison_parser.cpp" - break; + break; case 193: /* binary_expr: operand LIKE operand */ #line 956 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLike, (yyvsp[0].expr)); } #line 4594 "bison_parser.cpp" - break; + break; case 194: /* binary_expr: operand NOT LIKE operand */ #line 957 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-3].expr), kOpNotLike, (yyvsp[0].expr)); } #line 4600 "bison_parser.cpp" - break; + break; case 195: /* binary_expr: operand ILIKE operand */ #line 958 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpILike, (yyvsp[0].expr)); } #line 4606 "bison_parser.cpp" - break; + break; case 196: /* binary_expr: operand CONCAT operand */ #line 959 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpConcat, (yyvsp[0].expr)); } #line 4612 "bison_parser.cpp" - break; + break; case 197: /* logic_expr: expr AND expr */ #line 961 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpAnd, (yyvsp[0].expr)); } #line 4618 "bison_parser.cpp" - break; + break; case 198: /* logic_expr: expr OR expr */ #line 962 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpOr, (yyvsp[0].expr)); } #line 4624 "bison_parser.cpp" - break; + break; case 199: /* in_expr: operand IN '(' expr_list ')' */ #line 964 "bison_parser.y" - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].expr_vec)); } #line 4630 "bison_parser.cpp" - break; + break; case 200: /* in_expr: operand NOT IN '(' expr_list ')' */ #line 965 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].expr_vec))); } #line 4636 "bison_parser.cpp" - break; + break; case 201: /* in_expr: operand IN '(' select_no_paren ')' */ #line 966 "bison_parser.y" - { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } + { (yyval.expr) = Expr::makeInOperator((yyvsp[-4].expr), (yyvsp[-1].select_stmt)); } #line 4642 "bison_parser.cpp" - break; + break; case 202: /* in_expr: operand NOT IN '(' select_no_paren ')' */ #line 967 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeInOperator((yyvsp[-5].expr), (yyvsp[-1].select_stmt))); } #line 4648 "bison_parser.cpp" - break; + break; case 203: /* case_expr: CASE expr case_list END */ #line 971 "bison_parser.y" - { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } + { (yyval.expr) = Expr::makeCase((yyvsp[-2].expr), (yyvsp[-1].expr), nullptr); } #line 4654 "bison_parser.cpp" - break; + break; case 204: /* case_expr: CASE expr case_list ELSE expr END */ #line 972 "bison_parser.y" - { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } + { (yyval.expr) = Expr::makeCase((yyvsp[-4].expr), (yyvsp[-3].expr), (yyvsp[-1].expr)); } #line 4660 "bison_parser.cpp" - break; + break; case 205: /* case_expr: CASE case_list END */ #line 973 "bison_parser.y" - { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } + { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-1].expr), nullptr); } #line 4666 "bison_parser.cpp" - break; + break; case 206: /* case_expr: CASE case_list ELSE expr END */ #line 974 "bison_parser.y" - { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } + { (yyval.expr) = Expr::makeCase(nullptr, (yyvsp[-3].expr), (yyvsp[-1].expr)); } #line 4672 "bison_parser.cpp" - break; + break; case 207: /* case_list: WHEN expr THEN expr */ #line 976 "bison_parser.y" - { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } + { (yyval.expr) = Expr::makeCaseList(Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } #line 4678 "bison_parser.cpp" - break; + break; case 208: /* case_list: case_list WHEN expr THEN expr */ #line 977 "bison_parser.y" - { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } + { (yyval.expr) = Expr::caseListAppend((yyvsp[-4].expr), Expr::makeCaseListElement((yyvsp[-2].expr), (yyvsp[0].expr))); } #line 4684 "bison_parser.cpp" - break; + break; case 209: /* exists_expr: EXISTS '(' select_no_paren ')' */ #line 979 "bison_parser.y" - { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } + { (yyval.expr) = Expr::makeExists((yyvsp[-1].select_stmt)); } #line 4690 "bison_parser.cpp" - break; + break; case 210: /* exists_expr: NOT EXISTS '(' select_no_paren ')' */ #line 980 "bison_parser.y" - { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } + { (yyval.expr) = Expr::makeOpUnary(kOpNot, Expr::makeExists((yyvsp[-1].select_stmt))); } #line 4696 "bison_parser.cpp" - break; + break; case 211: /* comp_expr: operand '=' operand */ #line 982 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } #line 4702 "bison_parser.cpp" - break; + break; case 212: /* comp_expr: operand EQUALS operand */ #line 983 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpEquals, (yyvsp[0].expr)); } #line 4708 "bison_parser.cpp" - break; + break; case 213: /* comp_expr: operand NOTEQUALS operand */ #line 984 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpNotEquals, (yyvsp[0].expr)); } #line 4714 "bison_parser.cpp" - break; + break; case 214: /* comp_expr: operand '<' operand */ #line 985 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLess, (yyvsp[0].expr)); } #line 4720 "bison_parser.cpp" - break; + break; case 215: /* comp_expr: operand '>' operand */ #line 986 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreater, (yyvsp[0].expr)); } #line 4726 "bison_parser.cpp" - break; + break; case 216: /* comp_expr: operand LESSEQ operand */ #line 987 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpLessEq, (yyvsp[0].expr)); } #line 4732 "bison_parser.cpp" - break; + break; case 217: /* comp_expr: operand GREATEREQ operand */ #line 988 "bison_parser.y" - { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeOpBinary((yyvsp[-2].expr), kOpGreaterEq, (yyvsp[0].expr)); } #line 4738 "bison_parser.cpp" - break; + break; case 218: /* function_expr: IDENTIFIER '(' ')' opt_window */ #line 992 "bison_parser.y" - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-3].sval), new std::vector(), false, (yyvsp[0].window_description)); } + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-3].sval), new std::vector(), false, (yyvsp[0].window_description)); } #line 4744 "bison_parser.cpp" - break; + break; case 219: /* function_expr: IDENTIFIER '(' opt_distinct expr_list ')' opt_window */ #line 993 "bison_parser.y" - { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-5].sval), (yyvsp[-2].expr_vec), (yyvsp[-3].bval), (yyvsp[0].window_description)); } + { (yyval.expr) = Expr::makeFunctionRef((yyvsp[-5].sval), (yyvsp[-2].expr_vec), (yyvsp[-3].bval), (yyvsp[0].window_description)); } #line 4750 "bison_parser.cpp" - break; + break; case 220: /* opt_window: OVER '(' opt_partition opt_order opt_frame_clause ')' */ #line 997 "bison_parser.y" - { (yyval.window_description) = new WindowDescription((yyvsp[-3].expr_vec), (yyvsp[-2].order_vec), (yyvsp[-1].frame_description)); } + { (yyval.window_description) = new WindowDescription((yyvsp[-3].expr_vec), (yyvsp[-2].order_vec), (yyvsp[-1].frame_description)); } #line 4756 "bison_parser.cpp" - break; + break; case 221: /* opt_window: %empty */ #line 998 "bison_parser.y" - { (yyval.window_description) = nullptr; } + { (yyval.window_description) = nullptr; } #line 4762 "bison_parser.cpp" - break; + break; case 222: /* opt_partition: PARTITION BY expr_list */ #line 1000 "bison_parser.y" - { (yyval.expr_vec) = (yyvsp[0].expr_vec); } + { (yyval.expr_vec) = (yyvsp[0].expr_vec); } #line 4768 "bison_parser.cpp" - break; + break; case 223: /* opt_partition: %empty */ #line 1001 "bison_parser.y" - { (yyval.expr_vec) = nullptr; } + { (yyval.expr_vec) = nullptr; } #line 4774 "bison_parser.cpp" - break; + break; case 224: /* opt_frame_clause: frame_type frame_bound */ #line 1006 "bison_parser.y" - { (yyval.frame_description) = new FrameDescription{(yyvsp[-1].frame_type), (yyvsp[0].frame_bound), new FrameBound{0, kCurrentRow, false}}; } + { (yyval.frame_description) = new FrameDescription{(yyvsp[-1].frame_type), (yyvsp[0].frame_bound), new FrameBound{0, kCurrentRow, false}}; } #line 4780 "bison_parser.cpp" - break; + break; case 225: /* opt_frame_clause: frame_type BETWEEN frame_bound AND frame_bound */ #line 1007 "bison_parser.y" - { (yyval.frame_description) = new FrameDescription{(yyvsp[-4].frame_type), (yyvsp[-2].frame_bound), (yyvsp[0].frame_bound)}; } + { (yyval.frame_description) = new FrameDescription{(yyvsp[-4].frame_type), (yyvsp[-2].frame_bound), (yyvsp[0].frame_bound)}; } #line 4786 "bison_parser.cpp" - break; + break; case 226: /* opt_frame_clause: %empty */ #line 1008 "bison_parser.y" - { + { (yyval.frame_description) = new FrameDescription{kRange, new FrameBound{0, kPreceding, true}, new FrameBound{0, kCurrentRow, false}}; } #line 4794 "bison_parser.cpp" - break; + break; case 227: /* frame_type: RANGE */ #line 1012 "bison_parser.y" - { (yyval.frame_type) = kRange; } + { (yyval.frame_type) = kRange; } #line 4800 "bison_parser.cpp" - break; + break; case 228: /* frame_type: ROWS */ #line 1013 "bison_parser.y" - { (yyval.frame_type) = kRows; } + { (yyval.frame_type) = kRows; } #line 4806 "bison_parser.cpp" - break; + break; case 229: /* frame_type: GROUPS */ #line 1014 "bison_parser.y" - { (yyval.frame_type) = kGroups; } + { (yyval.frame_type) = kGroups; } #line 4812 "bison_parser.cpp" - break; + break; case 230: /* frame_bound: UNBOUNDED PRECEDING */ #line 1016 "bison_parser.y" - { (yyval.frame_bound) = new FrameBound{0, kPreceding, true}; } + { (yyval.frame_bound) = new FrameBound{0, kPreceding, true}; } #line 4818 "bison_parser.cpp" - break; + break; case 231: /* frame_bound: INTVAL PRECEDING */ #line 1017 "bison_parser.y" - { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kPreceding, false}; } + { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kPreceding, false}; } #line 4824 "bison_parser.cpp" - break; + break; case 232: /* frame_bound: UNBOUNDED FOLLOWING */ #line 1018 "bison_parser.y" - { (yyval.frame_bound) = new FrameBound{0, kFollowing, true}; } + { (yyval.frame_bound) = new FrameBound{0, kFollowing, true}; } #line 4830 "bison_parser.cpp" - break; + break; case 233: /* frame_bound: INTVAL FOLLOWING */ #line 1019 "bison_parser.y" - { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kFollowing, false}; } + { (yyval.frame_bound) = new FrameBound{(yyvsp[-1].ival), kFollowing, false}; } #line 4836 "bison_parser.cpp" - break; + break; case 234: /* frame_bound: CURRENT_ROW */ #line 1020 "bison_parser.y" - { (yyval.frame_bound) = new FrameBound{0, kCurrentRow, false}; } + { (yyval.frame_bound) = new FrameBound{0, kCurrentRow, false}; } #line 4842 "bison_parser.cpp" - break; + break; case 235: /* extract_expr: EXTRACT '(' datetime_field FROM expr ')' */ #line 1022 "bison_parser.y" - { (yyval.expr) = Expr::makeExtract((yyvsp[-3].datetime_field), (yyvsp[-1].expr)); } + { (yyval.expr) = Expr::makeExtract((yyvsp[-3].datetime_field), (yyvsp[-1].expr)); } #line 4848 "bison_parser.cpp" - break; + break; case 236: /* cast_expr: CAST '(' expr AS column_type ')' */ #line 1024 "bison_parser.y" - { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } + { (yyval.expr) = Expr::makeCast((yyvsp[-3].expr), (yyvsp[-1].column_type_t)); } #line 4854 "bison_parser.cpp" - break; + break; case 237: /* datetime_field: SECOND */ #line 1026 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeSecond; } + { (yyval.datetime_field) = kDatetimeSecond; } #line 4860 "bison_parser.cpp" - break; + break; case 238: /* datetime_field: MINUTE */ #line 1027 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeMinute; } + { (yyval.datetime_field) = kDatetimeMinute; } #line 4866 "bison_parser.cpp" - break; + break; case 239: /* datetime_field: HOUR */ #line 1028 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeHour; } + { (yyval.datetime_field) = kDatetimeHour; } #line 4872 "bison_parser.cpp" - break; + break; case 240: /* datetime_field: DAY */ #line 1029 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeDay; } + { (yyval.datetime_field) = kDatetimeDay; } #line 4878 "bison_parser.cpp" - break; + break; case 241: /* datetime_field: MONTH */ #line 1030 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeMonth; } + { (yyval.datetime_field) = kDatetimeMonth; } #line 4884 "bison_parser.cpp" - break; + break; case 242: /* datetime_field: YEAR */ #line 1031 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeYear; } + { (yyval.datetime_field) = kDatetimeYear; } #line 4890 "bison_parser.cpp" - break; + break; case 243: /* datetime_field_plural: SECONDS */ #line 1033 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeSecond; } + { (yyval.datetime_field) = kDatetimeSecond; } #line 4896 "bison_parser.cpp" - break; + break; case 244: /* datetime_field_plural: MINUTES */ #line 1034 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeMinute; } + { (yyval.datetime_field) = kDatetimeMinute; } #line 4902 "bison_parser.cpp" - break; + break; case 245: /* datetime_field_plural: HOURS */ #line 1035 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeHour; } + { (yyval.datetime_field) = kDatetimeHour; } #line 4908 "bison_parser.cpp" - break; + break; case 246: /* datetime_field_plural: DAYS */ #line 1036 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeDay; } + { (yyval.datetime_field) = kDatetimeDay; } #line 4914 "bison_parser.cpp" - break; + break; case 247: /* datetime_field_plural: MONTHS */ #line 1037 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeMonth; } + { (yyval.datetime_field) = kDatetimeMonth; } #line 4920 "bison_parser.cpp" - break; + break; case 248: /* datetime_field_plural: YEARS */ #line 1038 "bison_parser.y" - { (yyval.datetime_field) = kDatetimeYear; } + { (yyval.datetime_field) = kDatetimeYear; } #line 4926 "bison_parser.cpp" - break; + break; case 251: /* array_expr: ARRAY '[' expr_list ']' */ #line 1042 "bison_parser.y" - { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } + { (yyval.expr) = Expr::makeArray((yyvsp[-1].expr_vec)); } #line 4932 "bison_parser.cpp" - break; + break; case 252: /* array_index: operand '[' int_literal ']' */ #line 1044 "bison_parser.y" - { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } + { (yyval.expr) = Expr::makeArrayIndex((yyvsp[-3].expr), (yyvsp[-1].expr)->ival); } #line 4938 "bison_parser.cpp" - break; + break; case 253: /* between_expr: operand BETWEEN operand AND operand */ #line 1046 "bison_parser.y" - { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } + { (yyval.expr) = Expr::makeBetween((yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } #line 4944 "bison_parser.cpp" - break; + break; case 254: /* column_name: IDENTIFIER */ #line 1048 "bison_parser.y" - { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } + { (yyval.expr) = Expr::makeColumnRef((yyvsp[0].sval)); } #line 4950 "bison_parser.cpp" - break; + break; case 255: /* column_name: IDENTIFIER '.' IDENTIFIER */ #line 1049 "bison_parser.y" - { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } + { (yyval.expr) = Expr::makeColumnRef((yyvsp[-2].sval), (yyvsp[0].sval)); } #line 4956 "bison_parser.cpp" - break; + break; case 256: /* column_name: '*' */ #line 1050 "bison_parser.y" - { (yyval.expr) = Expr::makeStar(); } + { (yyval.expr) = Expr::makeStar(); } #line 4962 "bison_parser.cpp" - break; + break; case 257: /* column_name: IDENTIFIER '.' '*' */ #line 1051 "bison_parser.y" - { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } + { (yyval.expr) = Expr::makeStar((yyvsp[-2].sval)); } #line 4968 "bison_parser.cpp" - break; + break; case 265: /* string_literal: STRING */ #line 1055 "bison_parser.y" - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].sval)); } #line 4974 "bison_parser.cpp" - break; + break; case 266: /* bool_literal: TRUE */ #line 1057 "bison_parser.y" - { (yyval.expr) = Expr::makeLiteral(true); } + { (yyval.expr) = Expr::makeLiteral(true); } #line 4980 "bison_parser.cpp" - break; + break; case 267: /* bool_literal: FALSE */ #line 1058 "bison_parser.y" - { (yyval.expr) = Expr::makeLiteral(false); } + { (yyval.expr) = Expr::makeLiteral(false); } #line 4986 "bison_parser.cpp" - break; + break; case 268: /* num_literal: FLOATVAL */ #line 1060 "bison_parser.y" - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].fval)); } #line 4992 "bison_parser.cpp" - break; + break; case 270: /* int_literal: INTVAL */ #line 1063 "bison_parser.y" - { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } + { (yyval.expr) = Expr::makeLiteral((yyvsp[0].ival)); } #line 4998 "bison_parser.cpp" - break; + break; case 271: /* null_literal: NULL */ #line 1065 "bison_parser.y" - { (yyval.expr) = Expr::makeNullLiteral(); } + { (yyval.expr) = Expr::makeNullLiteral(); } #line 5004 "bison_parser.cpp" - break; + break; case 272: /* date_literal: DATE STRING */ #line 1067 "bison_parser.y" - { + { int day{0}, month{0}, year{0}, chars_parsed{0}; // If the whole string is parsed, chars_parsed points to the terminating null byte after the last character if (sscanf((yyvsp[0].sval), "%4d-%2d-%2d%n", &day, &month, &year, &chars_parsed) != 3 || (yyvsp[0].sval)[chars_parsed] != 0) { - free((yyvsp[0].sval)); - yyerror(&yyloc, result, scanner, "Found incorrect date format. Expected format: YYYY-MM-DD"); - YYERROR; + free((yyvsp[0].sval)); + yyerror(&yyloc, result, scanner, "Found incorrect date format. Expected format: YYYY-MM-DD"); + YYERROR; } (yyval.expr) = Expr::makeDateLiteral((yyvsp[0].sval)); } #line 5019 "bison_parser.cpp" - break; + break; case 273: /* interval_literal: int_literal duration_field */ #line 1078 "bison_parser.y" - { + { (yyval.expr) = Expr::makeIntervalLiteral((yyvsp[-1].expr)->ival, (yyvsp[0].datetime_field)); delete (yyvsp[-1].expr); } #line 5028 "bison_parser.cpp" - break; + break; case 274: /* interval_literal: INTERVAL STRING datetime_field */ #line 1082 "bison_parser.y" - { + { int duration{0}, chars_parsed{0}; // If the whole string is parsed, chars_parsed points to the terminating null byte after the last character if (sscanf((yyvsp[-1].sval), "%d%n", &duration, &chars_parsed) != 1 || (yyvsp[-1].sval)[chars_parsed] != 0) { - free((yyvsp[-1].sval)); - yyerror(&yyloc, result, scanner, "Found incorrect interval format. Expected format: INTEGER"); - YYERROR; + free((yyvsp[-1].sval)); + yyerror(&yyloc, result, scanner, "Found incorrect interval format. Expected format: INTEGER"); + YYERROR; } free((yyvsp[-1].sval)); (yyval.expr) = Expr::makeIntervalLiteral(duration, (yyvsp[0].datetime_field)); } #line 5044 "bison_parser.cpp" - break; + break; case 275: /* interval_literal: INTERVAL STRING */ #line 1093 "bison_parser.y" - { + { int duration{0}, chars_parsed{0}; // 'seconds' and 'minutes' are the longest accepted interval qualifiers (7 chars) + null byte char unit_string[8]; // If the whole string is parsed, chars_parsed points to the terminating null byte after the last character if (sscanf((yyvsp[0].sval), "%d %7s%n", &duration, unit_string, &chars_parsed) != 2 || (yyvsp[0].sval)[chars_parsed] != 0) { - free((yyvsp[0].sval)); - yyerror(&yyloc, result, scanner, "Found incorrect interval format. Expected format: INTEGER INTERVAL_QUALIIFIER"); - YYERROR; + free((yyvsp[0].sval)); + yyerror(&yyloc, result, scanner, "Found incorrect interval format. Expected format: INTEGER INTERVAL_QUALIIFIER"); + YYERROR; } free((yyvsp[0].sval)); DatetimeField unit; if (strcasecmp(unit_string, "second") == 0 || strcasecmp(unit_string, "seconds") == 0) { - unit = kDatetimeSecond; + unit = kDatetimeSecond; } else if (strcasecmp(unit_string, "minute") == 0 || strcasecmp(unit_string, "minutes") == 0) { - unit = kDatetimeMinute; + unit = kDatetimeMinute; } else if (strcasecmp(unit_string, "hour") == 0 || strcasecmp(unit_string, "hours") == 0) { - unit = kDatetimeHour; + unit = kDatetimeHour; } else if (strcasecmp(unit_string, "day") == 0 || strcasecmp(unit_string, "days") == 0) { - unit = kDatetimeDay; + unit = kDatetimeDay; } else if (strcasecmp(unit_string, "month") == 0 || strcasecmp(unit_string, "months") == 0) { - unit = kDatetimeMonth; + unit = kDatetimeMonth; } else if (strcasecmp(unit_string, "year") == 0 || strcasecmp(unit_string, "years") == 0) { - unit = kDatetimeYear; + unit = kDatetimeYear; } else { - yyerror(&yyloc, result, scanner, "Interval qualifier is unknown."); - YYERROR; + yyerror(&yyloc, result, scanner, "Interval qualifier is unknown."); + YYERROR; } (yyval.expr) = Expr::makeIntervalLiteral(duration, unit); } #line 5080 "bison_parser.cpp" - break; + break; case 276: /* param_expr: '?' */ #line 1125 "bison_parser.y" - { + { (yyval.expr) = Expr::makeParameter(yylloc.total_column); (yyval.expr)->ival2 = yyloc.param_list.size(); yyloc.param_list.push_back((yyval.expr)); } #line 5090 "bison_parser.cpp" - break; + break; case 278: /* table_ref: table_ref_commalist ',' table_ref_atomic */ #line 1134 "bison_parser.y" - { + { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); auto tbl = new TableRef(kTableCrossProduct); tbl->list = (yyvsp[-2].table_vec); (yyval.table) = tbl; } #line 5101 "bison_parser.cpp" - break; + break; case 282: /* nonjoin_table_ref_atomic: '(' select_statement ')' opt_table_alias */ #line 1143 "bison_parser.y" - { + { auto tbl = new TableRef(kTableSelect); tbl->select = (yyvsp[-2].select_stmt); tbl->alias = (yyvsp[0].alias_t); (yyval.table) = tbl; } #line 5112 "bison_parser.cpp" - break; + break; case 283: /* table_ref_commalist: table_ref_atomic */ #line 1150 "bison_parser.y" - { + { (yyval.table_vec) = new std::vector(); (yyval.table_vec)->push_back((yyvsp[0].table)); } #line 5121 "bison_parser.cpp" - break; + break; case 284: /* table_ref_commalist: table_ref_commalist ',' table_ref_atomic */ #line 1154 "bison_parser.y" - { + { (yyvsp[-2].table_vec)->push_back((yyvsp[0].table)); (yyval.table_vec) = (yyvsp[-2].table_vec); } #line 5130 "bison_parser.cpp" - break; + break; case 285: /* table_ref_name: table_name opt_table_alias */ #line 1159 "bison_parser.y" - { + { auto tbl = new TableRef(kTableName); tbl->schema = (yyvsp[-1].table_name).schema; tbl->name = (yyvsp[-1].table_name).name; @@ -5144,215 +5144,215 @@ yyreduce: (yyval.table) = tbl; } #line 5142 "bison_parser.cpp" - break; + break; case 286: /* table_ref_name_no_alias: table_name */ #line 1167 "bison_parser.y" - { + { (yyval.table) = new TableRef(kTableName); (yyval.table)->schema = (yyvsp[0].table_name).schema; (yyval.table)->name = (yyvsp[0].table_name).name; } #line 5152 "bison_parser.cpp" - break; + break; case 287: /* table_name: IDENTIFIER */ #line 1173 "bison_parser.y" - { + { (yyval.table_name).schema = nullptr; (yyval.table_name).name = (yyvsp[0].sval); } #line 5161 "bison_parser.cpp" - break; + break; case 288: /* table_name: IDENTIFIER '.' IDENTIFIER */ #line 1177 "bison_parser.y" - { + { (yyval.table_name).schema = (yyvsp[-2].sval); (yyval.table_name).name = (yyvsp[0].sval); } #line 5170 "bison_parser.cpp" - break; + break; case 289: /* opt_index_name: IDENTIFIER */ #line 1182 "bison_parser.y" - { (yyval.sval) = (yyvsp[0].sval); } + { (yyval.sval) = (yyvsp[0].sval); } #line 5176 "bison_parser.cpp" - break; + break; case 290: /* opt_index_name: %empty */ #line 1183 "bison_parser.y" - { (yyval.sval) = nullptr; } + { (yyval.sval) = nullptr; } #line 5182 "bison_parser.cpp" - break; + break; case 292: /* table_alias: AS IDENTIFIER '(' ident_commalist ')' */ #line 1185 "bison_parser.y" - { (yyval.alias_t) = new Alias((yyvsp[-3].sval), (yyvsp[-1].str_vec)); } + { (yyval.alias_t) = new Alias((yyvsp[-3].sval), (yyvsp[-1].str_vec)); } #line 5188 "bison_parser.cpp" - break; + break; case 294: /* opt_table_alias: %empty */ #line 1187 "bison_parser.y" - { (yyval.alias_t) = nullptr; } + { (yyval.alias_t) = nullptr; } #line 5194 "bison_parser.cpp" - break; + break; case 295: /* alias: AS IDENTIFIER */ #line 1189 "bison_parser.y" - { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } + { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } #line 5200 "bison_parser.cpp" - break; + break; case 296: /* alias: IDENTIFIER */ #line 1190 "bison_parser.y" - { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } + { (yyval.alias_t) = new Alias((yyvsp[0].sval)); } #line 5206 "bison_parser.cpp" - break; + break; case 298: /* opt_alias: %empty */ #line 1192 "bison_parser.y" - { (yyval.alias_t) = nullptr; } + { (yyval.alias_t) = nullptr; } #line 5212 "bison_parser.cpp" - break; + break; case 299: /* opt_locking_clause: opt_locking_clause_list */ #line 1198 "bison_parser.y" - { (yyval.locking_clause_vec) = (yyvsp[0].locking_clause_vec); } + { (yyval.locking_clause_vec) = (yyvsp[0].locking_clause_vec); } #line 5218 "bison_parser.cpp" - break; + break; case 300: /* opt_locking_clause: %empty */ #line 1199 "bison_parser.y" - { (yyval.locking_clause_vec) = nullptr; } + { (yyval.locking_clause_vec) = nullptr; } #line 5224 "bison_parser.cpp" - break; + break; case 301: /* opt_locking_clause_list: locking_clause */ #line 1201 "bison_parser.y" - { + { (yyval.locking_clause_vec) = new std::vector(); (yyval.locking_clause_vec)->push_back((yyvsp[0].locking_t)); } #line 5233 "bison_parser.cpp" - break; + break; case 302: /* opt_locking_clause_list: opt_locking_clause_list locking_clause */ #line 1205 "bison_parser.y" - { + { (yyvsp[-1].locking_clause_vec)->push_back((yyvsp[0].locking_t)); (yyval.locking_clause_vec) = (yyvsp[-1].locking_clause_vec); } #line 5242 "bison_parser.cpp" - break; + break; case 303: /* locking_clause: FOR row_lock_mode opt_row_lock_policy */ #line 1210 "bison_parser.y" - { + { (yyval.locking_t) = new LockingClause(); (yyval.locking_t)->rowLockMode = (yyvsp[-1].lock_mode_t); (yyval.locking_t)->rowLockWaitPolicy = (yyvsp[0].lock_wait_policy_t); (yyval.locking_t)->tables = nullptr; } #line 5253 "bison_parser.cpp" - break; + break; case 304: /* locking_clause: FOR row_lock_mode OF ident_commalist opt_row_lock_policy */ #line 1216 "bison_parser.y" - { + { (yyval.locking_t) = new LockingClause(); (yyval.locking_t)->rowLockMode = (yyvsp[-3].lock_mode_t); (yyval.locking_t)->tables = (yyvsp[-1].str_vec); (yyval.locking_t)->rowLockWaitPolicy = (yyvsp[0].lock_wait_policy_t); } #line 5264 "bison_parser.cpp" - break; + break; case 305: /* row_lock_mode: UPDATE */ #line 1223 "bison_parser.y" - { (yyval.lock_mode_t) = RowLockMode::ForUpdate; } + { (yyval.lock_mode_t) = RowLockMode::ForUpdate; } #line 5270 "bison_parser.cpp" - break; + break; case 306: /* row_lock_mode: NO KEY UPDATE */ #line 1224 "bison_parser.y" - { (yyval.lock_mode_t) = RowLockMode::ForNoKeyUpdate; } + { (yyval.lock_mode_t) = RowLockMode::ForNoKeyUpdate; } #line 5276 "bison_parser.cpp" - break; + break; case 307: /* row_lock_mode: SHARE */ #line 1225 "bison_parser.y" - { (yyval.lock_mode_t) = RowLockMode::ForShare; } + { (yyval.lock_mode_t) = RowLockMode::ForShare; } #line 5282 "bison_parser.cpp" - break; + break; case 308: /* row_lock_mode: KEY SHARE */ #line 1226 "bison_parser.y" - { (yyval.lock_mode_t) = RowLockMode::ForKeyShare; } + { (yyval.lock_mode_t) = RowLockMode::ForKeyShare; } #line 5288 "bison_parser.cpp" - break; + break; case 309: /* opt_row_lock_policy: SKIP LOCKED */ #line 1228 "bison_parser.y" - { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::SkipLocked; } + { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::SkipLocked; } #line 5294 "bison_parser.cpp" - break; + break; case 310: /* opt_row_lock_policy: NOWAIT */ #line 1229 "bison_parser.y" - { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::NoWait; } + { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::NoWait; } #line 5300 "bison_parser.cpp" - break; + break; case 311: /* opt_row_lock_policy: %empty */ #line 1230 "bison_parser.y" - { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::None; } + { (yyval.lock_wait_policy_t) = RowLockWaitPolicy::None; } #line 5306 "bison_parser.cpp" - break; + break; case 313: /* opt_with_clause: %empty */ #line 1236 "bison_parser.y" - { (yyval.with_description_vec) = nullptr; } + { (yyval.with_description_vec) = nullptr; } #line 5312 "bison_parser.cpp" - break; + break; case 314: /* with_clause: WITH with_description_list */ #line 1238 "bison_parser.y" - { (yyval.with_description_vec) = (yyvsp[0].with_description_vec); } + { (yyval.with_description_vec) = (yyvsp[0].with_description_vec); } #line 5318 "bison_parser.cpp" - break; + break; case 315: /* with_description_list: with_description */ #line 1240 "bison_parser.y" - { + { (yyval.with_description_vec) = new std::vector(); (yyval.with_description_vec)->push_back((yyvsp[0].with_description_t)); } #line 5327 "bison_parser.cpp" - break; + break; case 316: /* with_description_list: with_description_list ',' with_description */ #line 1244 "bison_parser.y" - { + { (yyvsp[-2].with_description_vec)->push_back((yyvsp[0].with_description_t)); (yyval.with_description_vec) = (yyvsp[-2].with_description_vec); } #line 5336 "bison_parser.cpp" - break; + break; case 317: /* with_description: IDENTIFIER AS select_with_paren */ #line 1249 "bison_parser.y" - { + { (yyval.with_description_t) = new WithDescription(); (yyval.with_description_t)->alias = (yyvsp[-2].sval); (yyval.with_description_t)->select = (yyvsp[0].select_stmt); } #line 5346 "bison_parser.cpp" - break; + break; case 318: /* join_clause: table_ref_atomic NATURAL JOIN nonjoin_table_ref_atomic */ #line 1259 "bison_parser.y" - { + { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = kJoinNatural; @@ -5360,11 +5360,11 @@ yyreduce: (yyval.table)->join->right = (yyvsp[0].table); } #line 5358 "bison_parser.cpp" - break; + break; case 319: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic ON join_condition */ #line 1266 "bison_parser.y" - { + { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = (JoinType)(yyvsp[-4].join_type); @@ -5373,11 +5373,11 @@ yyreduce: (yyval.table)->join->condition = (yyvsp[0].expr); } #line 5371 "bison_parser.cpp" - break; + break; case 320: /* join_clause: table_ref_atomic opt_join_type JOIN table_ref_atomic USING '(' column_name ')' */ #line 1274 "bison_parser.y" - { + { (yyval.table) = new TableRef(kTableJoin); (yyval.table)->join = new JoinDefinition(); (yyval.table)->join->type = (JoinType)(yyvsp[-6].join_type); @@ -5385,118 +5385,118 @@ yyreduce: (yyval.table)->join->right = (yyvsp[-4].table); auto left_col = Expr::makeColumnRef(strdup((yyvsp[-1].expr)->name)); if ((yyvsp[-1].expr)->alias) { - left_col->alias = strdup((yyvsp[-1].expr)->alias); + left_col->alias = strdup((yyvsp[-1].expr)->alias); } if ((yyvsp[-7].table)->getName()) { - left_col->table = strdup((yyvsp[-7].table)->getName()); + left_col->table = strdup((yyvsp[-7].table)->getName()); } auto right_col = Expr::makeColumnRef(strdup((yyvsp[-1].expr)->name)); if ((yyvsp[-1].expr)->alias) { - right_col->alias = strdup((yyvsp[-1].expr)->alias); + right_col->alias = strdup((yyvsp[-1].expr)->alias); } if ((yyvsp[-4].table)->getName()) { - right_col->table = strdup((yyvsp[-4].table)->getName()); + right_col->table = strdup((yyvsp[-4].table)->getName()); } (yyval.table)->join->condition = Expr::makeOpBinary(left_col, kOpEquals, right_col); delete (yyvsp[-1].expr); } #line 5399 "bison_parser.cpp" - break; + break; case 321: /* opt_join_type: INNER */ #line 1298 "bison_parser.y" - { (yyval.join_type) = kJoinInner; } + { (yyval.join_type) = kJoinInner; } #line 5405 "bison_parser.cpp" - break; + break; case 322: /* opt_join_type: LEFT OUTER */ #line 1299 "bison_parser.y" - { (yyval.join_type) = kJoinLeft; } + { (yyval.join_type) = kJoinLeft; } #line 5411 "bison_parser.cpp" - break; + break; case 323: /* opt_join_type: LEFT */ #line 1300 "bison_parser.y" - { (yyval.join_type) = kJoinLeft; } + { (yyval.join_type) = kJoinLeft; } #line 5417 "bison_parser.cpp" - break; + break; case 324: /* opt_join_type: RIGHT OUTER */ #line 1301 "bison_parser.y" - { (yyval.join_type) = kJoinRight; } + { (yyval.join_type) = kJoinRight; } #line 5423 "bison_parser.cpp" - break; + break; case 325: /* opt_join_type: RIGHT */ #line 1302 "bison_parser.y" - { (yyval.join_type) = kJoinRight; } + { (yyval.join_type) = kJoinRight; } #line 5429 "bison_parser.cpp" - break; + break; case 326: /* opt_join_type: FULL OUTER */ #line 1303 "bison_parser.y" - { (yyval.join_type) = kJoinFull; } + { (yyval.join_type) = kJoinFull; } #line 5435 "bison_parser.cpp" - break; + break; case 327: /* opt_join_type: OUTER */ #line 1304 "bison_parser.y" - { (yyval.join_type) = kJoinFull; } + { (yyval.join_type) = kJoinFull; } #line 5441 "bison_parser.cpp" - break; + break; case 328: /* opt_join_type: FULL */ #line 1305 "bison_parser.y" - { (yyval.join_type) = kJoinFull; } + { (yyval.join_type) = kJoinFull; } #line 5447 "bison_parser.cpp" - break; + break; case 329: /* opt_join_type: CROSS */ #line 1306 "bison_parser.y" - { (yyval.join_type) = kJoinCross; } + { (yyval.join_type) = kJoinCross; } #line 5453 "bison_parser.cpp" - break; + break; case 330: /* opt_join_type: %empty */ #line 1307 "bison_parser.y" - { (yyval.join_type) = kJoinInner; } + { (yyval.join_type) = kJoinInner; } #line 5459 "bison_parser.cpp" - break; + break; case 334: /* ident_commalist: IDENTIFIER */ #line 1318 "bison_parser.y" - { + { (yyval.str_vec) = new std::vector(); (yyval.str_vec)->push_back((yyvsp[0].sval)); } #line 5468 "bison_parser.cpp" - break; + break; case 335: /* ident_commalist: ident_commalist ',' IDENTIFIER */ #line 1322 "bison_parser.y" - { + { (yyvsp[-2].str_vec)->push_back((yyvsp[0].sval)); (yyval.str_vec) = (yyvsp[-2].str_vec); } #line 5477 "bison_parser.cpp" - break; + break; #line 5481 "bison_parser.cpp" - default: break; - } + default: break; + } /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); @@ -5506,14 +5506,14 @@ yyreduce: *++yylsp = yyloc; /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + that goes to, based on the state we popped back to and the rule + number reduced by. */ { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); } goto yynewstate; @@ -5524,67 +5524,67 @@ yyreduce: `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ + user semantic actions for why this is necessary. */ yytoken = yychar == SQL_HSQL_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) - { - ++yynerrs; - { - yypcontext_t yyctx - = {yyssp, yytoken, &yylloc}; - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == -1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (yymsg) - { - yysyntax_error_status - = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; - } - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; - } - } - yyerror (&yylloc, result, scanner, yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; - } - } + { + ++yynerrs; + { + yypcontext_t yyctx + = {yyssp, yytoken, &yylloc}; + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == -1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) + { + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yymsgp = yymsg; + } + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; + } + } + yyerror (&yylloc, result, scanner, yymsgp); + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; + } + } yyerror_range[1] = yylloc; if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ - if (yychar <= SQL_YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == SQL_YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc, result, scanner); - yychar = SQL_HSQL_EMPTY; - } - } + if (yychar <= SQL_YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == SQL_YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, &yylloc, result, scanner); + yychar = SQL_HSQL_EMPTY; + } + } /* Else will try to reuse lookahead token after shifting the error - token. */ + token. */ goto yyerrlab1; @@ -5593,13 +5593,13 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ + label yyerrorlab therefore never appears in user code. */ if (0) - YYERROR; + YYERROR; ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ + this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); @@ -5615,30 +5615,30 @@ yyerrlab1: /* Pop stack until we find a state that shifts the error token. */ for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYSYMBOL_YYerror; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyerror_range[1] = *yylsp; - yydestruct ("Error: popping", - YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, result, scanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } + yyerror_range[1] = *yylsp; + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, result, scanner); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; @@ -5685,29 +5685,29 @@ yyexhaustedlab: `----------------------------------------------------------*/ yyreturnlab: if (yychar != SQL_HSQL_EMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc, result, scanner); - } + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, result, scanner); + } /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ + this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, result, scanner); - YYPOPSTACK (1); - } + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, result, scanner); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) - YYSTACK_FREE (yyss); + YYSTACK_FREE (yyss); #endif if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + YYSTACK_FREE (yymsg); return yyresult; } @@ -5717,9 +5717,9 @@ yyreturnlab: #pragma warning(default : 4996) #endif - // clang-format on - /********************************* + // clang-format on + /********************************* ** Section 4: Additional C code *********************************/ - /* empty */ + /* empty */ diff --git a/Data/SQLParser/src/parser/bison_parser.h b/Data/SQLParser/src/parser/bison_parser.h index 6005a0815..d3ab02968 100644 --- a/Data/SQLParser/src/parser/bison_parser.h +++ b/Data/SQLParser/src/parser/bison_parser.h @@ -66,14 +66,14 @@ extern int hsql_debug; yylloc->first_line = yylloc->last_line; \ yylloc->first_column = yylloc->last_column; \ for (int i = 0; yytext[i] != '\0'; i++) { \ - yylloc->total_column++; \ - yylloc->string_length++; \ - if (yytext[i] == '\n') { \ - yylloc->last_line++; \ - yylloc->last_column = 0; \ - } else { \ - yylloc->last_column++; \ - } \ + yylloc->total_column++; \ + yylloc->string_length++; \ + if (yytext[i] == '\n') { \ + yylloc->last_line++; \ + yylloc->last_column = 0; \ + } else { \ + yylloc->last_column++; \ + } \ } #line 80 "bison_parser.h" @@ -83,186 +83,186 @@ extern int hsql_debug; # define HSQL_TOKENTYPE enum hsql_tokentype { - SQL_HSQL_EMPTY = -2, - SQL_YYEOF = 0, /* "end of file" */ - SQL_HSQL_error = 256, /* error */ - SQL_HSQL_UNDEF = 257, /* "invalid token" */ - SQL_IDENTIFIER = 258, /* IDENTIFIER */ - SQL_STRING = 259, /* STRING */ - SQL_FLOATVAL = 260, /* FLOATVAL */ - SQL_INTVAL = 261, /* INTVAL */ - SQL_DEALLOCATE = 262, /* DEALLOCATE */ - SQL_PARAMETERS = 263, /* PARAMETERS */ - SQL_INTERSECT = 264, /* INTERSECT */ - SQL_TEMPORARY = 265, /* TEMPORARY */ - SQL_TIMESTAMP = 266, /* TIMESTAMP */ - SQL_DISTINCT = 267, /* DISTINCT */ - SQL_NVARCHAR = 268, /* NVARCHAR */ - SQL_RESTRICT = 269, /* RESTRICT */ - SQL_TRUNCATE = 270, /* TRUNCATE */ - SQL_ANALYZE = 271, /* ANALYZE */ - SQL_BETWEEN = 272, /* BETWEEN */ - SQL_CASCADE = 273, /* CASCADE */ - SQL_COLUMNS = 274, /* COLUMNS */ - SQL_CONTROL = 275, /* CONTROL */ - SQL_DEFAULT = 276, /* DEFAULT */ - SQL_EXECUTE = 277, /* EXECUTE */ - SQL_EXPLAIN = 278, /* EXPLAIN */ - SQL_INTEGER = 279, /* INTEGER */ - SQL_NATURAL = 280, /* NATURAL */ - SQL_PREPARE = 281, /* PREPARE */ - SQL_PRIMARY = 282, /* PRIMARY */ - SQL_SCHEMAS = 283, /* SCHEMAS */ - SQL_CHARACTER_VARYING = 284, /* CHARACTER_VARYING */ - SQL_REAL = 285, /* REAL */ - SQL_DECIMAL = 286, /* DECIMAL */ - SQL_SMALLINT = 287, /* SMALLINT */ - SQL_BIGINT = 288, /* BIGINT */ - SQL_SPATIAL = 289, /* SPATIAL */ - SQL_VARCHAR = 290, /* VARCHAR */ - SQL_VIRTUAL = 291, /* VIRTUAL */ - SQL_DESCRIBE = 292, /* DESCRIBE */ - SQL_BEFORE = 293, /* BEFORE */ - SQL_COLUMN = 294, /* COLUMN */ - SQL_CREATE = 295, /* CREATE */ - SQL_DELETE = 296, /* DELETE */ - SQL_DIRECT = 297, /* DIRECT */ - SQL_DOUBLE = 298, /* DOUBLE */ - SQL_ESCAPE = 299, /* ESCAPE */ - SQL_EXCEPT = 300, /* EXCEPT */ - SQL_EXISTS = 301, /* EXISTS */ - SQL_EXTRACT = 302, /* EXTRACT */ - SQL_CAST = 303, /* CAST */ - SQL_FORMAT = 304, /* FORMAT */ - SQL_GLOBAL = 305, /* GLOBAL */ - SQL_HAVING = 306, /* HAVING */ - SQL_IMPORT = 307, /* IMPORT */ - SQL_INSERT = 308, /* INSERT */ - SQL_ISNULL = 309, /* ISNULL */ - SQL_OFFSET = 310, /* OFFSET */ - SQL_RENAME = 311, /* RENAME */ - SQL_SCHEMA = 312, /* SCHEMA */ - SQL_SELECT = 313, /* SELECT */ - SQL_SORTED = 314, /* SORTED */ - SQL_TABLES = 315, /* TABLES */ - SQL_UNIQUE = 316, /* UNIQUE */ - SQL_UNLOAD = 317, /* UNLOAD */ - SQL_UPDATE = 318, /* UPDATE */ - SQL_VALUES = 319, /* VALUES */ - SQL_AFTER = 320, /* AFTER */ - SQL_ALTER = 321, /* ALTER */ - SQL_CROSS = 322, /* CROSS */ - SQL_DELTA = 323, /* DELTA */ - SQL_FLOAT = 324, /* FLOAT */ - SQL_GROUP = 325, /* GROUP */ - SQL_INDEX = 326, /* INDEX */ - SQL_INNER = 327, /* INNER */ - SQL_LIMIT = 328, /* LIMIT */ - SQL_LOCAL = 329, /* LOCAL */ - SQL_MERGE = 330, /* MERGE */ - SQL_MINUS = 331, /* MINUS */ - SQL_ORDER = 332, /* ORDER */ - SQL_OVER = 333, /* OVER */ - SQL_OUTER = 334, /* OUTER */ - SQL_RIGHT = 335, /* RIGHT */ - SQL_TABLE = 336, /* TABLE */ - SQL_UNION = 337, /* UNION */ - SQL_USING = 338, /* USING */ - SQL_WHERE = 339, /* WHERE */ - SQL_CALL = 340, /* CALL */ - SQL_CASE = 341, /* CASE */ - SQL_CHAR = 342, /* CHAR */ - SQL_COPY = 343, /* COPY */ - SQL_DATE = 344, /* DATE */ - SQL_DATETIME = 345, /* DATETIME */ - SQL_DESC = 346, /* DESC */ - SQL_DROP = 347, /* DROP */ - SQL_ELSE = 348, /* ELSE */ - SQL_FILE = 349, /* FILE */ - SQL_FROM = 350, /* FROM */ - SQL_FULL = 351, /* FULL */ - SQL_HASH = 352, /* HASH */ - SQL_HINT = 353, /* HINT */ - SQL_INTO = 354, /* INTO */ - SQL_JOIN = 355, /* JOIN */ - SQL_LEFT = 356, /* LEFT */ - SQL_LIKE = 357, /* LIKE */ - SQL_LOAD = 358, /* LOAD */ - SQL_LONG = 359, /* LONG */ - SQL_NULL = 360, /* NULL */ - SQL_PARTITION = 361, /* PARTITION */ - SQL_PLAN = 362, /* PLAN */ - SQL_SHOW = 363, /* SHOW */ - SQL_TEXT = 364, /* TEXT */ - SQL_THEN = 365, /* THEN */ - SQL_TIME = 366, /* TIME */ - SQL_VIEW = 367, /* VIEW */ - SQL_WHEN = 368, /* WHEN */ - SQL_WITH = 369, /* WITH */ - SQL_ADD = 370, /* ADD */ - SQL_ALL = 371, /* ALL */ - SQL_AND = 372, /* AND */ - SQL_ASC = 373, /* ASC */ - SQL_END = 374, /* END */ - SQL_FOR = 375, /* FOR */ - SQL_INT = 376, /* INT */ - SQL_KEY = 377, /* KEY */ - SQL_NOT = 378, /* NOT */ - SQL_OFF = 379, /* OFF */ - SQL_SET = 380, /* SET */ - SQL_TOP = 381, /* TOP */ - SQL_AS = 382, /* AS */ - SQL_BY = 383, /* BY */ - SQL_IF = 384, /* IF */ - SQL_IN = 385, /* IN */ - SQL_IS = 386, /* IS */ - SQL_OF = 387, /* OF */ - SQL_ON = 388, /* ON */ - SQL_OR = 389, /* OR */ - SQL_TO = 390, /* TO */ - SQL_NO = 391, /* NO */ - SQL_ARRAY = 392, /* ARRAY */ - SQL_CONCAT = 393, /* CONCAT */ - SQL_ILIKE = 394, /* ILIKE */ - SQL_SECOND = 395, /* SECOND */ - SQL_MINUTE = 396, /* MINUTE */ - SQL_HOUR = 397, /* HOUR */ - SQL_DAY = 398, /* DAY */ - SQL_MONTH = 399, /* MONTH */ - SQL_YEAR = 400, /* YEAR */ - SQL_SECONDS = 401, /* SECONDS */ - SQL_MINUTES = 402, /* MINUTES */ - SQL_HOURS = 403, /* HOURS */ - SQL_DAYS = 404, /* DAYS */ - SQL_MONTHS = 405, /* MONTHS */ - SQL_YEARS = 406, /* YEARS */ - SQL_INTERVAL = 407, /* INTERVAL */ - SQL_TRUE = 408, /* TRUE */ - SQL_FALSE = 409, /* FALSE */ - SQL_BOOLEAN = 410, /* BOOLEAN */ - SQL_TRANSACTION = 411, /* TRANSACTION */ - SQL_BEGIN = 412, /* BEGIN */ - SQL_COMMIT = 413, /* COMMIT */ - SQL_ROLLBACK = 414, /* ROLLBACK */ - SQL_NOWAIT = 415, /* NOWAIT */ - SQL_SKIP = 416, /* SKIP */ - SQL_LOCKED = 417, /* LOCKED */ - SQL_SHARE = 418, /* SHARE */ - SQL_RANGE = 419, /* RANGE */ - SQL_ROWS = 420, /* ROWS */ - SQL_GROUPS = 421, /* GROUPS */ - SQL_UNBOUNDED = 422, /* UNBOUNDED */ - SQL_FOLLOWING = 423, /* FOLLOWING */ - SQL_PRECEDING = 424, /* PRECEDING */ - SQL_CURRENT_ROW = 425, /* CURRENT_ROW */ - SQL_EQUALS = 426, /* EQUALS */ - SQL_NOTEQUALS = 427, /* NOTEQUALS */ - SQL_LESS = 428, /* LESS */ - SQL_GREATER = 429, /* GREATER */ - SQL_LESSEQ = 430, /* LESSEQ */ - SQL_GREATEREQ = 431, /* GREATEREQ */ - SQL_NOTNULL = 432, /* NOTNULL */ - SQL_UMINUS = 433 /* UMINUS */ + SQL_HSQL_EMPTY = -2, + SQL_YYEOF = 0, /* "end of file" */ + SQL_HSQL_error = 256, /* error */ + SQL_HSQL_UNDEF = 257, /* "invalid token" */ + SQL_IDENTIFIER = 258, /* IDENTIFIER */ + SQL_STRING = 259, /* STRING */ + SQL_FLOATVAL = 260, /* FLOATVAL */ + SQL_INTVAL = 261, /* INTVAL */ + SQL_DEALLOCATE = 262, /* DEALLOCATE */ + SQL_PARAMETERS = 263, /* PARAMETERS */ + SQL_INTERSECT = 264, /* INTERSECT */ + SQL_TEMPORARY = 265, /* TEMPORARY */ + SQL_TIMESTAMP = 266, /* TIMESTAMP */ + SQL_DISTINCT = 267, /* DISTINCT */ + SQL_NVARCHAR = 268, /* NVARCHAR */ + SQL_RESTRICT = 269, /* RESTRICT */ + SQL_TRUNCATE = 270, /* TRUNCATE */ + SQL_ANALYZE = 271, /* ANALYZE */ + SQL_BETWEEN = 272, /* BETWEEN */ + SQL_CASCADE = 273, /* CASCADE */ + SQL_COLUMNS = 274, /* COLUMNS */ + SQL_CONTROL = 275, /* CONTROL */ + SQL_DEFAULT = 276, /* DEFAULT */ + SQL_EXECUTE = 277, /* EXECUTE */ + SQL_EXPLAIN = 278, /* EXPLAIN */ + SQL_INTEGER = 279, /* INTEGER */ + SQL_NATURAL = 280, /* NATURAL */ + SQL_PREPARE = 281, /* PREPARE */ + SQL_PRIMARY = 282, /* PRIMARY */ + SQL_SCHEMAS = 283, /* SCHEMAS */ + SQL_CHARACTER_VARYING = 284, /* CHARACTER_VARYING */ + SQL_REAL = 285, /* REAL */ + SQL_DECIMAL = 286, /* DECIMAL */ + SQL_SMALLINT = 287, /* SMALLINT */ + SQL_BIGINT = 288, /* BIGINT */ + SQL_SPATIAL = 289, /* SPATIAL */ + SQL_VARCHAR = 290, /* VARCHAR */ + SQL_VIRTUAL = 291, /* VIRTUAL */ + SQL_DESCRIBE = 292, /* DESCRIBE */ + SQL_BEFORE = 293, /* BEFORE */ + SQL_COLUMN = 294, /* COLUMN */ + SQL_CREATE = 295, /* CREATE */ + SQL_DELETE = 296, /* DELETE */ + SQL_DIRECT = 297, /* DIRECT */ + SQL_DOUBLE = 298, /* DOUBLE */ + SQL_ESCAPE = 299, /* ESCAPE */ + SQL_EXCEPT = 300, /* EXCEPT */ + SQL_EXISTS = 301, /* EXISTS */ + SQL_EXTRACT = 302, /* EXTRACT */ + SQL_CAST = 303, /* CAST */ + SQL_FORMAT = 304, /* FORMAT */ + SQL_GLOBAL = 305, /* GLOBAL */ + SQL_HAVING = 306, /* HAVING */ + SQL_IMPORT = 307, /* IMPORT */ + SQL_INSERT = 308, /* INSERT */ + SQL_ISNULL = 309, /* ISNULL */ + SQL_OFFSET = 310, /* OFFSET */ + SQL_RENAME = 311, /* RENAME */ + SQL_SCHEMA = 312, /* SCHEMA */ + SQL_SELECT = 313, /* SELECT */ + SQL_SORTED = 314, /* SORTED */ + SQL_TABLES = 315, /* TABLES */ + SQL_UNIQUE = 316, /* UNIQUE */ + SQL_UNLOAD = 317, /* UNLOAD */ + SQL_UPDATE = 318, /* UPDATE */ + SQL_VALUES = 319, /* VALUES */ + SQL_AFTER = 320, /* AFTER */ + SQL_ALTER = 321, /* ALTER */ + SQL_CROSS = 322, /* CROSS */ + SQL_DELTA = 323, /* DELTA */ + SQL_FLOAT = 324, /* FLOAT */ + SQL_GROUP = 325, /* GROUP */ + SQL_INDEX = 326, /* INDEX */ + SQL_INNER = 327, /* INNER */ + SQL_LIMIT = 328, /* LIMIT */ + SQL_LOCAL = 329, /* LOCAL */ + SQL_MERGE = 330, /* MERGE */ + SQL_MINUS = 331, /* MINUS */ + SQL_ORDER = 332, /* ORDER */ + SQL_OVER = 333, /* OVER */ + SQL_OUTER = 334, /* OUTER */ + SQL_RIGHT = 335, /* RIGHT */ + SQL_TABLE = 336, /* TABLE */ + SQL_UNION = 337, /* UNION */ + SQL_USING = 338, /* USING */ + SQL_WHERE = 339, /* WHERE */ + SQL_CALL = 340, /* CALL */ + SQL_CASE = 341, /* CASE */ + SQL_CHAR = 342, /* CHAR */ + SQL_COPY = 343, /* COPY */ + SQL_DATE = 344, /* DATE */ + SQL_DATETIME = 345, /* DATETIME */ + SQL_DESC = 346, /* DESC */ + SQL_DROP = 347, /* DROP */ + SQL_ELSE = 348, /* ELSE */ + SQL_FILE = 349, /* FILE */ + SQL_FROM = 350, /* FROM */ + SQL_FULL = 351, /* FULL */ + SQL_HASH = 352, /* HASH */ + SQL_HINT = 353, /* HINT */ + SQL_INTO = 354, /* INTO */ + SQL_JOIN = 355, /* JOIN */ + SQL_LEFT = 356, /* LEFT */ + SQL_LIKE = 357, /* LIKE */ + SQL_LOAD = 358, /* LOAD */ + SQL_LONG = 359, /* LONG */ + SQL_NULL = 360, /* NULL */ + SQL_PARTITION = 361, /* PARTITION */ + SQL_PLAN = 362, /* PLAN */ + SQL_SHOW = 363, /* SHOW */ + SQL_TEXT = 364, /* TEXT */ + SQL_THEN = 365, /* THEN */ + SQL_TIME = 366, /* TIME */ + SQL_VIEW = 367, /* VIEW */ + SQL_WHEN = 368, /* WHEN */ + SQL_WITH = 369, /* WITH */ + SQL_ADD = 370, /* ADD */ + SQL_ALL = 371, /* ALL */ + SQL_AND = 372, /* AND */ + SQL_ASC = 373, /* ASC */ + SQL_END = 374, /* END */ + SQL_FOR = 375, /* FOR */ + SQL_INT = 376, /* INT */ + SQL_KEY = 377, /* KEY */ + SQL_NOT = 378, /* NOT */ + SQL_OFF = 379, /* OFF */ + SQL_SET = 380, /* SET */ + SQL_TOP = 381, /* TOP */ + SQL_AS = 382, /* AS */ + SQL_BY = 383, /* BY */ + SQL_IF = 384, /* IF */ + SQL_IN = 385, /* IN */ + SQL_IS = 386, /* IS */ + SQL_OF = 387, /* OF */ + SQL_ON = 388, /* ON */ + SQL_OR = 389, /* OR */ + SQL_TO = 390, /* TO */ + SQL_NO = 391, /* NO */ + SQL_ARRAY = 392, /* ARRAY */ + SQL_CONCAT = 393, /* CONCAT */ + SQL_ILIKE = 394, /* ILIKE */ + SQL_SECOND = 395, /* SECOND */ + SQL_MINUTE = 396, /* MINUTE */ + SQL_HOUR = 397, /* HOUR */ + SQL_DAY = 398, /* DAY */ + SQL_MONTH = 399, /* MONTH */ + SQL_YEAR = 400, /* YEAR */ + SQL_SECONDS = 401, /* SECONDS */ + SQL_MINUTES = 402, /* MINUTES */ + SQL_HOURS = 403, /* HOURS */ + SQL_DAYS = 404, /* DAYS */ + SQL_MONTHS = 405, /* MONTHS */ + SQL_YEARS = 406, /* YEARS */ + SQL_INTERVAL = 407, /* INTERVAL */ + SQL_TRUE = 408, /* TRUE */ + SQL_FALSE = 409, /* FALSE */ + SQL_BOOLEAN = 410, /* BOOLEAN */ + SQL_TRANSACTION = 411, /* TRANSACTION */ + SQL_BEGIN = 412, /* BEGIN */ + SQL_COMMIT = 413, /* COMMIT */ + SQL_ROLLBACK = 414, /* ROLLBACK */ + SQL_NOWAIT = 415, /* NOWAIT */ + SQL_SKIP = 416, /* SKIP */ + SQL_LOCKED = 417, /* LOCKED */ + SQL_SHARE = 418, /* SHARE */ + SQL_RANGE = 419, /* RANGE */ + SQL_ROWS = 420, /* ROWS */ + SQL_GROUPS = 421, /* GROUPS */ + SQL_UNBOUNDED = 422, /* UNBOUNDED */ + SQL_FOLLOWING = 423, /* FOLLOWING */ + SQL_PRECEDING = 424, /* PRECEDING */ + SQL_CURRENT_ROW = 425, /* CURRENT_ROW */ + SQL_EQUALS = 426, /* EQUALS */ + SQL_NOTEQUALS = 427, /* NOTEQUALS */ + SQL_LESS = 428, /* LESS */ + SQL_GREATER = 429, /* GREATER */ + SQL_LESSEQ = 430, /* LESSEQ */ + SQL_GREATEREQ = 431, /* GREATEREQ */ + SQL_NOTNULL = 432, /* NOTNULL */ + SQL_UMINUS = 433 /* UMINUS */ }; typedef enum hsql_tokentype hsql_token_kind_t; #endif diff --git a/Data/SQLParser/src/parser/flex_lexer.cpp b/Data/SQLParser/src/parser/flex_lexer.cpp index 3fc8cc569..1d7fe0a74 100644 --- a/Data/SQLParser/src/parser/flex_lexer.cpp +++ b/Data/SQLParser/src/parser/flex_lexer.cpp @@ -417,17 +417,17 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = yyg->yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ @@ -474,8 +474,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -508,8 +508,8 @@ struct yy_buffer_state * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ - : NULL) + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -540,18 +540,18 @@ void yyfree ( void * , yyscan_t yyscanner ); #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (yyscanner); \ + yyensure_buffer_stack (yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } @@ -591,2455 +591,2455 @@ struct yy_trans_info flex_int32_t yy_nxt; }; static const flex_int16_t yy_accept[1332] = - { 0, - 0, 0, 183, 183, 2, 2, 187, 185, 4, 4, - 185, 185, 174, 181, 174, 174, 178, 174, 174, 174, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 174, 183, 184, 2, 2, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 4, 169, 0, 1, 0, - 176, 175, 178, 171, 170, 168, 172, 180, 180, 180, + { 0, + 0, 0, 183, 183, 2, 2, 187, 185, 4, 4, + 185, 185, 174, 181, 174, 174, 178, 174, 174, 174, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 174, 183, 184, 2, 2, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 4, 169, 0, 1, 0, + 176, 175, 178, 171, 170, 168, 172, 180, 180, 180, - 180, 180, 180, 12, 180, 180, 180, 19, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 71, 180, 180, 74, 83, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 101, 180, 180, - 106, 109, 110, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 146, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 173, 183, 182, 2, 2, 2, 2, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 180, 180, 180, 12, 180, 180, 180, 19, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 71, 180, 180, 74, 83, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 101, 180, 180, + 106, 109, 110, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 146, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 173, 183, 182, 2, 2, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 179, 0, 175, 5, - 180, 7, 180, 180, 10, 180, 13, 180, 180, 180, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 179, 0, 175, 5, + 180, 7, 180, 180, 10, 180, 13, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 34, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 48, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 59, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 78, - 180, 180, 86, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 102, 180, 180, 180, 107, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 132, 180, 180, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 147, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 34, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 48, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 59, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 78, + 180, 180, 86, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 102, 180, 180, 180, 107, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 132, 180, 180, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 147, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 180, - 180, 180, 180, 180, 180, 180, 180, 180, 20, 180, - 22, 23, 24, 180, 180, 180, 29, 180, 180, 180, - 32, 35, 180, 180, 180, 180, 180, 41, 180, 180, - 180, 46, 47, 180, 180, 180, 180, 180, 180, 180, - 56, 180, 180, 180, 61, 62, 180, 180, 66, 180, - 68, 69, 180, 180, 180, 180, 180, 180, 82, 180, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 180, + 180, 180, 180, 180, 180, 180, 180, 180, 20, 180, + 22, 23, 24, 180, 180, 180, 29, 180, 180, 180, + 32, 35, 180, 180, 180, 180, 180, 41, 180, 180, + 180, 46, 47, 180, 180, 180, 180, 180, 180, 180, + 56, 180, 180, 180, 61, 62, 180, 180, 66, 180, + 68, 69, 180, 180, 180, 180, 180, 180, 82, 180, - 85, 87, 88, 180, 90, 180, 180, 93, 180, 180, - 180, 180, 180, 104, 180, 180, 180, 180, 113, 180, - 180, 116, 180, 180, 180, 180, 121, 180, 180, 180, - 180, 126, 180, 180, 180, 180, 134, 135, 180, 180, - 180, 180, 180, 142, 143, 144, 180, 149, 180, 180, - 180, 180, 180, 180, 180, 180, 180, 159, 180, 161, - 180, 163, 164, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 85, 87, 88, 180, 90, 180, 180, 93, 180, 180, + 180, 180, 180, 104, 180, 180, 180, 180, 113, 180, + 180, 116, 180, 180, 180, 180, 121, 180, 180, 180, + 180, 126, 180, 180, 180, 180, 134, 135, 180, 180, + 180, 180, 180, 142, 143, 144, 180, 149, 180, 180, + 180, 180, 180, 180, 180, 180, 180, 159, 180, 161, + 180, 163, 164, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 0, 6, - 8, 180, 11, 180, 15, 180, 180, 180, 180, 180, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 6, + 8, 180, 11, 180, 15, 180, 180, 180, 180, 180, - 180, 180, 180, 180, 31, 180, 180, 180, 180, 180, - 180, 40, 180, 180, 180, 180, 180, 180, 180, 180, - 180, 180, 55, 57, 180, 180, 180, 64, 180, 70, - 72, 180, 75, 76, 180, 180, 180, 180, 89, 91, - 180, 94, 95, 180, 98, 180, 180, 180, 180, 111, - 112, 180, 180, 180, 180, 180, 120, 180, 180, 124, - 180, 180, 180, 180, 133, 180, 180, 180, 139, 180, - 180, 180, 180, 180, 152, 180, 180, 180, 156, 180, - 180, 180, 162, 165, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 180, 180, 180, 180, 31, 180, 180, 180, 180, 180, + 180, 40, 180, 180, 180, 180, 180, 180, 180, 180, + 180, 180, 55, 57, 180, 180, 180, 64, 180, 70, + 72, 180, 75, 76, 180, 180, 180, 180, 89, 91, + 180, 94, 95, 180, 98, 180, 180, 180, 180, 111, + 112, 180, 180, 180, 180, 180, 120, 180, 180, 124, + 180, 180, 180, 180, 133, 180, 180, 180, 139, 180, + 180, 180, 180, 180, 152, 180, 180, 180, 156, 180, + 180, 180, 162, 165, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 0, 180, 14, 180, 17, 180, 180, 180, 25, 27, - 180, 30, 180, 180, 180, 180, 180, 39, 180, 43, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 0, 180, 14, 180, 17, 180, 180, 180, 25, 27, + 180, 30, 180, 180, 180, 180, 180, 39, 180, 43, - 180, 45, 49, 50, 180, 52, 180, 180, 180, 60, - 63, 65, 67, 73, 77, 180, 180, 180, 84, 92, - 96, 99, 180, 103, 180, 108, 180, 180, 180, 180, - 180, 122, 180, 180, 127, 129, 131, 180, 137, 180, - 140, 180, 180, 180, 180, 180, 153, 154, 155, 157, - 180, 180, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 180, 45, 49, 50, 180, 52, 180, 180, 180, 60, + 63, 65, 67, 73, 77, 180, 180, 180, 84, 92, + 96, 99, 180, 103, 180, 108, 180, 180, 180, 180, + 180, 122, 180, 180, 127, 129, 131, 180, 137, 180, + 140, 180, 180, 180, 180, 180, 153, 154, 155, 157, + 180, 180, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 0, 9, 16, 18, 21, 180, - 26, 28, 180, 180, 180, 37, 38, 180, 180, 51, - 53, 54, 180, 79, 180, 180, 97, 100, 180, 180, - 180, 180, 118, 119, 180, 180, 128, 130, 180, 138, - 180, 180, 180, 180, 180, 158, 160, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 9, 16, 18, 21, 180, + 26, 28, 180, 180, 180, 37, 38, 180, 180, 51, + 53, 54, 180, 79, 180, 180, 97, 100, 180, 180, + 180, 180, 118, 119, 180, 180, 128, 130, 180, 138, + 180, 180, 180, 180, 180, 158, 160, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 0, 180, 0, 33, 180, 42, 44, 180, 180, 81, - 105, 180, 180, 180, 123, 125, 136, 180, 180, 180, - 150, 180, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 0, 180, 0, 180, 58, 80, - 180, 115, 117, 141, 145, 180, 151, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 0, 0, 0, 36, 114, 180, 2, 2, 2, 2, - 2, 2, 0, 0, 166, 148, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 0, 180, 0, 33, 180, 42, 44, 180, 180, 81, + 105, 180, 180, 180, 123, 125, 136, 180, 180, 180, + 150, 180, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 180, 0, 180, 58, 80, + 180, 115, 117, 141, 145, 180, 151, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 0, 0, 0, 36, 114, 180, 2, 2, 2, 2, + 2, 2, 0, 0, 166, 148, 2, 2, 2, 2, - 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, - 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, - 0, 167, 2, 2, 0, 2, 0, 2, 177, 2, - 0 - } ; + 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, + 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, + 0, 167, 2, 2, 0, 2, 0, 2, 177, 2, + 0 + } ; static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 1, 1, 6, 1, 7, 6, - 6, 6, 6, 6, 8, 9, 6, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 6, 6, 20, - 21, 22, 6, 1, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 6, 1, 6, 6, 49, 1, 50, 51, 52, 53, + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 1, 1, 6, 1, 7, 6, + 6, 6, 6, 6, 8, 9, 6, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 6, 6, 20, + 21, 22, 6, 1, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 6, 1, 6, 6, 49, 1, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 6, 76, 6, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 6, 76, 6, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; static const YY_CHAR yy_meta[77] = - { 0, - 1, 1, 2, 1, 3, 1, 4, 1, 1, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, - 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 1 - } ; + { 0, + 1, 1, 2, 1, 3, 1, 4, 1, 1, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, + 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 1 + } ; static const flex_int16_t yy_base[1339] = - { 0, - 0, 0, 839, 837, 76, 0, 842, 8771, 151, 153, - 785, 0, 8771, 8771, 149, 148, 160, 159, 783, 782, - 156, 156, 165, 210, 202, 255, 151, 163, 265, 152, - 171, 215, 218, 244, 295, 257, 0, 309, 349, 392, - 163, 279, 226, 180, 723, 0, 791, 0, 237, 251, - 775, 743, 0, 0, 243, 378, 451, 237, 682, 680, - 470, 546, 600, 652, 700, 752, 384, 458, 795, 466, - 532, 533, 534, 846, 895, 944, 547, 602, 990, 1042, - 307, 650, 587, 651, 596, 301, 8771, 666, 8771, 657, - 1107, 1117, 1128, 8771, 8771, 8771, 8771, 0, 218, 243, + { 0, + 0, 0, 839, 837, 76, 0, 842, 8771, 151, 153, + 785, 0, 8771, 8771, 149, 148, 160, 159, 783, 782, + 156, 156, 165, 210, 202, 255, 151, 163, 265, 152, + 171, 215, 218, 244, 295, 257, 0, 309, 349, 392, + 163, 279, 226, 180, 723, 0, 791, 0, 237, 251, + 775, 743, 0, 0, 243, 378, 451, 237, 682, 680, + 470, 546, 600, 652, 700, 752, 384, 458, 795, 466, + 532, 533, 534, 846, 895, 944, 547, 602, 990, 1042, + 307, 650, 587, 651, 596, 301, 8771, 666, 8771, 657, + 1107, 1117, 1128, 8771, 8771, 8771, 8771, 0, 218, 243, - 300, 328, 250, 305, 379, 315, 319, 0, 376, 354, - 694, 389, 345, 440, 710, 387, 388, 436, 439, 462, - 469, 763, 465, 467, 465, 542, 480, 484, 498, 521, - 531, 553, 572, 0, 588, 588, 654, 592, 601, 588, - 608, 651, 717, 598, 649, 655, 651, 707, 660, 716, - 715, 0, 719, 708, 754, 744, 762, 760, 757, 802, - 768, 792, 770, 846, 810, 776, 812, 799, 817, 821, - 838, 821, 816, 816, 854, 861, 829, 848, 853, 894, - 872, 859, 879, 8771, 0, 8771, 0, 396, 0, 663, - 0, 636, 1138, 1148, 1159, 0, 0, 0, 0, 906, + 300, 328, 250, 305, 379, 315, 319, 0, 376, 354, + 694, 389, 345, 440, 710, 387, 388, 436, 439, 462, + 469, 763, 465, 467, 465, 542, 480, 484, 498, 521, + 531, 553, 572, 0, 588, 588, 654, 592, 601, 588, + 608, 651, 717, 598, 649, 655, 651, 707, 660, 716, + 715, 0, 719, 708, 754, 744, 762, 760, 757, 802, + 768, 792, 770, 846, 810, 776, 812, 799, 817, 821, + 838, 821, 816, 816, 854, 861, 829, 848, 853, 894, + 872, 859, 879, 8771, 0, 8771, 0, 396, 0, 663, + 0, 636, 1138, 1148, 1159, 0, 0, 0, 0, 906, - 942, 955, 1015, 1156, 1034, 1155, 1202, 1152, 1040, 1195, - 1199, 1232, 1272, 1257, 1272, 1301, 1353, 1350, 1361, 1388, - 1402, 1413, 1443, 1492, 1437, 1479, 1491, 1528, 1536, 1536, - 1561, 1575, 1577, 1590, 1618, 1621, 1629, 1668, 1717, 1639, - 1682, 1683, 1707, 1764, 1816, 1762, 1714, 1808, 1817, 1857, - 1860, 1881, 1904, 1873, 1917, 1940, 1773, 1952, 1984, 1993, - 1991, 2027, 2040, 2046, 2076, 2125, 2098, 2089, 2137, 2138, - 2176, 2173, 2207, 2191, 2225, 2247, 2263, 2310, 2271, 2295, - 2314, 2325, 2339, 2363, 2375, 0, 8771, 601, 2440, 0, - 882, 0, 900, 896, 0, 921, 0, 912, 925, 918, + 942, 955, 1015, 1156, 1034, 1155, 1202, 1152, 1040, 1195, + 1199, 1232, 1272, 1257, 1272, 1301, 1353, 1350, 1361, 1388, + 1402, 1413, 1443, 1492, 1437, 1479, 1491, 1528, 1536, 1536, + 1561, 1575, 1577, 1590, 1618, 1621, 1629, 1668, 1717, 1639, + 1682, 1683, 1707, 1764, 1816, 1762, 1714, 1808, 1817, 1857, + 1860, 1881, 1904, 1873, 1917, 1940, 1773, 1952, 1984, 1993, + 1991, 2027, 2040, 2046, 2076, 2125, 2098, 2089, 2137, 2138, + 2176, 2173, 2207, 2191, 2225, 2247, 2263, 2310, 2271, 2295, + 2314, 2325, 2339, 2363, 2375, 0, 8771, 601, 2440, 0, + 882, 0, 900, 896, 0, 921, 0, 912, 925, 918, - 941, 943, 951, 1158, 951, 960, 972, 984, 984, 1009, - 992, 995, 1009, 998, 1047, 1054, 1063, 1210, 1159, 1160, - 1152, 1210, 1209, 1223, 0, 1231, 1229, 1262, 1248, 1256, - 1256, 1256, 1271, 1279, 1286, 1287, 1292, 1307, 1318, 1301, - 1320, 1321, 1311, 1316, 1325, 1324, 1339, 1346, 1347, 1403, - 1339, 1370, 0, 1368, 1401, 1414, 1427, 1464, 1429, 1432, - 1421, 1427, 1439, 0, 1471, 1465, 1468, 1486, 1504, 1505, - 1493, 1648, 1512, 1555, 1516, 1547, 1553, 1582, 1574, 1587, - 1607, 1601, 1620, 1628, 1643, 0, 1637, 1651, 1663, 1684, - 1683, 1697, 1715, 1729, 1737, 1752, 1762, 0, 1756, 1807, + 941, 943, 951, 1158, 951, 960, 972, 984, 984, 1009, + 992, 995, 1009, 998, 1047, 1054, 1063, 1210, 1159, 1160, + 1152, 1210, 1209, 1223, 0, 1231, 1229, 1262, 1248, 1256, + 1256, 1256, 1271, 1279, 1286, 1287, 1292, 1307, 1318, 1301, + 1320, 1321, 1311, 1316, 1325, 1324, 1339, 1346, 1347, 1403, + 1339, 1370, 0, 1368, 1401, 1414, 1427, 1464, 1429, 1432, + 1421, 1427, 1439, 0, 1471, 1465, 1468, 1486, 1504, 1505, + 1493, 1648, 1512, 1555, 1516, 1547, 1553, 1582, 1574, 1587, + 1607, 1601, 1620, 1628, 1643, 0, 1637, 1651, 1663, 1684, + 1683, 1697, 1715, 1729, 1737, 1752, 1762, 0, 1756, 1807, - 1768, 1809, 1772, 1790, 1797, 1802, 1830, 1811, 1823, 1872, - 1867, 1870, 0, 600, 2450, 2443, 2444, 2445, 2446, 2373, - 2480, 2488, 2489, 2500, 2528, 2536, 2541, 2543, 2557, 2606, - 2582, 2607, 2620, 2656, 2632, 2668, 2666, 2697, 2709, 2711, - 2725, 2750, 2768, 2765, 2800, 2809, 2818, 2844, 2859, 2857, - 2862, 2907, 2898, 2912, 2912, 2933, 2957, 2954, 2982, 3008, - 2980, 3029, 3033, 3037, 3075, 3079, 3078, 3123, 3126, 3135, - 3161, 3176, 3179, 3191, 3205, 3217, 3229, 3244, 3248, 3272, - 3273, 3292, 3317, 3369, 3295, 3331, 3366, 3330, 3391, 3394, - 3419, 3426, 3440, 3454, 3465, 3479, 3494, 3546, 3494, 3596, + 1768, 1809, 1772, 1790, 1797, 1802, 1830, 1811, 1823, 1872, + 1867, 1870, 0, 600, 2450, 2443, 2444, 2445, 2446, 2373, + 2480, 2488, 2489, 2500, 2528, 2536, 2541, 2543, 2557, 2606, + 2582, 2607, 2620, 2656, 2632, 2668, 2666, 2697, 2709, 2711, + 2725, 2750, 2768, 2765, 2800, 2809, 2818, 2844, 2859, 2857, + 2862, 2907, 2898, 2912, 2912, 2933, 2957, 2954, 2982, 3008, + 2980, 3029, 3033, 3037, 3075, 3079, 3078, 3123, 3126, 3135, + 3161, 3176, 3179, 3191, 3205, 3217, 3229, 3244, 3248, 3272, + 3273, 3292, 3317, 3369, 3295, 3331, 3366, 3330, 3391, 3394, + 3419, 3426, 3440, 3454, 3465, 3479, 3494, 3546, 3494, 3596, - 3529, 3572, 3513, 3624, 3583, 3632, 3645, 3668, 3680, 3685, - 3688, 3693, 3729, 3734, 3737, 3736, 3744, 3780, 3784, 3793, - 3826, 3829, 3846, 3849, 3875, 3878, 3898, 3903, 3900, 3948, - 3919, 3947, 3975, 3989, 4003, 4019, 4033, 4057, 582, 1908, - 1917, 1913, 1914, 1924, 1930, 1941, 1933, 1944, 0, 1950, - 0, 0, 1979, 1977, 1983, 1977, 0, 1976, 1981, 2001, - 1991, 0, 2001, 2008, 2013, 2024, 2048, 2032, 2050, 2047, - 2050, 0, 0, 2059, 2066, 2072, 2085, 2105, 2107, 2119, - 0, 2137, 2144, 2159, 0, 0, 2166, 2152, 0, 2183, - 0, 2191, 2209, 2199, 2198, 2214, 2221, 2311, 0, 2230, + 3529, 3572, 3513, 3624, 3583, 3632, 3645, 3668, 3680, 3685, + 3688, 3693, 3729, 3734, 3737, 3736, 3744, 3780, 3784, 3793, + 3826, 3829, 3846, 3849, 3875, 3878, 3898, 3903, 3900, 3948, + 3919, 3947, 3975, 3989, 4003, 4019, 4033, 4057, 582, 1908, + 1917, 1913, 1914, 1924, 1930, 1941, 1933, 1944, 0, 1950, + 0, 0, 1979, 1977, 1983, 1977, 0, 1976, 1981, 2001, + 1991, 0, 2001, 2008, 2013, 2024, 2048, 2032, 2050, 2047, + 2050, 0, 0, 2059, 2066, 2072, 2085, 2105, 2107, 2119, + 0, 2137, 2144, 2159, 0, 0, 2166, 2152, 0, 2183, + 0, 2191, 2209, 2199, 2198, 2214, 2221, 2311, 0, 2230, - 0, 0, 0, 2235, 0, 2248, 2263, 0, 2265, 2374, - 2266, 2276, 2300, 0, 2311, 2319, 2351, 2356, 0, 2366, - 2373, 0, 2381, 2388, 2397, 2451, 0, 2444, 2445, 2444, - 2464, 0, 2498, 2503, 2517, 2517, 0, 0, 2536, 2553, - 2554, 2560, 2559, 0, 0, 2560, 2594, 0, 2614, 2598, - 2609, 2646, 2669, 2655, 2672, 2681, 2687, 0, 2678, 0, - 2696, 0, 2700, 544, 4068, 4071, 4096, 4115, 4118, 4125, - 4120, 4161, 4169, 4172, 4181, 4210, 4211, 4229, 4251, 4263, - 4264, 4265, 4293, 4300, 4317, 4318, 4343, 4343, 4359, 4390, - 4401, 4425, 4443, 4451, 4468, 4484, 4487, 4493, 4529, 4535, + 0, 0, 0, 2235, 0, 2248, 2263, 0, 2265, 2374, + 2266, 2276, 2300, 0, 2311, 2319, 2351, 2356, 0, 2366, + 2373, 0, 2381, 2388, 2397, 2451, 0, 2444, 2445, 2444, + 2464, 0, 2498, 2503, 2517, 2517, 0, 0, 2536, 2553, + 2554, 2560, 2559, 0, 0, 2560, 2594, 0, 2614, 2598, + 2609, 2646, 2669, 2655, 2672, 2681, 2687, 0, 2678, 0, + 2696, 0, 2700, 544, 4068, 4071, 4096, 4115, 4118, 4125, + 4120, 4161, 4169, 4172, 4181, 4210, 4211, 4229, 4251, 4263, + 4264, 4265, 4293, 4300, 4317, 4318, 4343, 4343, 4359, 4390, + 4401, 4425, 4443, 4451, 4468, 4484, 4487, 4493, 4529, 4535, - 4543, 4573, 4576, 4597, 4504, 4598, 4624, 4626, 4652, 4650, - 4664, 4682, 4696, 4694, 4701, 4731, 4737, 4748, 4749, 4783, - 4791, 4794, 4839, 4835, 4836, 4877, 4880, 4881, 4921, 4924, - 4925, 4964, 4969, 4972, 4971, 4974, 5014, 5014, 5022, 5058, - 5066, 5067, 5096, 5108, 5111, 5120, 5149, 5150, 5168, 5194, - 5202, 5203, 5216, 5242, 5244, 5268, 5256, 5290, 5295, 5299, - 5312, 5334, 5342, 5341, 5347, 5366, 5388, 5391, 5396, 5410, - 5398, 5417, 5441, 5447, 5455, 5471, 5490, 5504, 5501, 5532, - 5544, 5549, 5583, 5584, 5585, 5597, 5598, 5629, 543, 0, - 0, 2701, 0, 2724, 0, 2726, 2713, 2739, 2764, 2769, + 4543, 4573, 4576, 4597, 4504, 4598, 4624, 4626, 4652, 4650, + 4664, 4682, 4696, 4694, 4701, 4731, 4737, 4748, 4749, 4783, + 4791, 4794, 4839, 4835, 4836, 4877, 4880, 4881, 4921, 4924, + 4925, 4964, 4969, 4972, 4971, 4974, 5014, 5014, 5022, 5058, + 5066, 5067, 5096, 5108, 5111, 5120, 5149, 5150, 5168, 5194, + 5202, 5203, 5216, 5242, 5244, 5268, 5256, 5290, 5295, 5299, + 5312, 5334, 5342, 5341, 5347, 5366, 5388, 5391, 5396, 5410, + 5398, 5417, 5441, 5447, 5455, 5471, 5490, 5504, 5501, 5532, + 5544, 5549, 5583, 5584, 5585, 5597, 5598, 5629, 543, 0, + 0, 2701, 0, 2724, 0, 2726, 2713, 2739, 2764, 2769, - 2765, 2761, 2769, 2784, 0, 2780, 2804, 2813, 2828, 2819, - 2858, 0, 2869, 2859, 2869, 2887, 2923, 2909, 2913, 2919, - 2952, 2959, 0, 0, 2960, 2965, 2989, 2992, 3020, 0, - 0, 3012, 0, 0, 3015, 3032, 3036, 3027, 0, 0, - 3077, 0, 0, 3090, 3077, 3105, 3087, 3101, 3090, 0, - 0, 3107, 3095, 3143, 3134, 3138, 0, 3158, 3173, 0, - 3191, 3197, 3198, 3204, 0, 3230, 3242, 3247, 3233, 3258, - 3286, 3313, 3315, 3316, 0, 3347, 3354, 3356, 0, 3349, - 3385, 3389, 0, 0, 536, 5632, 5633, 5673, 5674, 5685, - 5686, 5724, 5725, 5743, 5738, 5778, 5770, 5793, 5810, 5813, + 2765, 2761, 2769, 2784, 0, 2780, 2804, 2813, 2828, 2819, + 2858, 0, 2869, 2859, 2869, 2887, 2923, 2909, 2913, 2919, + 2952, 2959, 0, 0, 2960, 2965, 2989, 2992, 3020, 0, + 0, 3012, 0, 0, 3015, 3032, 3036, 3027, 0, 0, + 3077, 0, 0, 3090, 3077, 3105, 3087, 3101, 3090, 0, + 0, 3107, 3095, 3143, 3134, 3138, 0, 3158, 3173, 0, + 3191, 3197, 3198, 3204, 0, 3230, 3242, 3247, 3233, 3258, + 3286, 3313, 3315, 3316, 0, 3347, 3354, 3356, 0, 3349, + 3385, 3389, 0, 0, 536, 5632, 5633, 5673, 5674, 5685, + 5686, 5724, 5725, 5743, 5738, 5778, 5770, 5793, 5810, 5813, - 5818, 5812, 5832, 5862, 5871, 5869, 5870, 5896, 5920, 5921, - 5925, 5945, 5950, 5969, 5994, 5971, 6018, 6042, 6023, 6064, - 6072, 6098, 6025, 6107, 6113, 6137, 6143, 6151, 6167, 6181, - 6195, 6220, 6209, 6225, 6249, 6255, 6273, 6279, 6297, 6308, - 6315, 6345, 6351, 6364, 6392, 6395, 6406, 6412, 6446, 6454, - 6482, 6490, 6504, 6516, 6528, 6540, 6558, 6570, 6584, 6598, - 6572, 6596, 6637, 6628, 6635, 6653, 6671, 6695, 6701, 6714, - 6725, 6752, 6754, 6778, 6786, 6788, 6807, 6831, 6828, 6837, - 526, 3399, 0, 3396, 0, 3401, 3417, 3409, 3416, 0, - 3436, 0, 3440, 3456, 3480, 3477, 3482, 0, 3520, 0, + 5818, 5812, 5832, 5862, 5871, 5869, 5870, 5896, 5920, 5921, + 5925, 5945, 5950, 5969, 5994, 5971, 6018, 6042, 6023, 6064, + 6072, 6098, 6025, 6107, 6113, 6137, 6143, 6151, 6167, 6181, + 6195, 6220, 6209, 6225, 6249, 6255, 6273, 6279, 6297, 6308, + 6315, 6345, 6351, 6364, 6392, 6395, 6406, 6412, 6446, 6454, + 6482, 6490, 6504, 6516, 6528, 6540, 6558, 6570, 6584, 6598, + 6572, 6596, 6637, 6628, 6635, 6653, 6671, 6695, 6701, 6714, + 6725, 6752, 6754, 6778, 6786, 6788, 6807, 6831, 6828, 6837, + 526, 3399, 0, 3396, 0, 3401, 3417, 3409, 3416, 0, + 3436, 0, 3440, 3456, 3480, 3477, 3482, 0, 3520, 0, - 3520, 0, 0, 0, 3533, 0, 3542, 3538, 3551, 0, - 0, 0, 0, 0, 0, 3544, 3558, 3566, 0, 0, - 3554, 0, 3565, 0, 3591, 0, 3581, 3596, 3605, 3622, - 3606, 0, 3630, 3642, 3630, 3631, 0, 3647, 0, 3662, - 0, 3678, 3698, 3701, 3731, 3784, 0, 0, 0, 0, - 3775, 3785, 525, 6866, 6875, 6873, 6882, 6891, 6884, 6920, - 6927, 6935, 6936, 6971, 6977, 6980, 7022, 7018, 7031, 7062, - 7073, 7076, 7104, 7117, 7118, 7148, 7156, 7161, 7161, 7197, - 7205, 7210, 7224, 7246, 7249, 7254, 7268, 7290, 7298, 7316, - 7324, 7338, 7343, 7359, 7367, 7373, 7403, 7397, 7421, 7441, + 3520, 0, 0, 0, 3533, 0, 3542, 3538, 3551, 0, + 0, 0, 0, 0, 0, 3544, 3558, 3566, 0, 0, + 3554, 0, 3565, 0, 3591, 0, 3581, 3596, 3605, 3622, + 3606, 0, 3630, 3642, 3630, 3631, 0, 3647, 0, 3662, + 0, 3678, 3698, 3701, 3731, 3784, 0, 0, 0, 0, + 3775, 3785, 525, 6866, 6875, 6873, 6882, 6891, 6884, 6920, + 6927, 6935, 6936, 6971, 6977, 6980, 7022, 7018, 7031, 7062, + 7073, 7076, 7104, 7117, 7118, 7148, 7156, 7161, 7161, 7197, + 7205, 7210, 7224, 7246, 7249, 7254, 7268, 7290, 7298, 7316, + 7324, 7338, 7343, 7359, 7367, 7373, 7403, 7397, 7421, 7441, - 7446, 7454, 7476, 7490, 7504, 7518, 7525, 7533, 7539, 7563, - 7569, 7577, 7593, 7612, 7636, 7635, 7659, 7680, 7677, 7683, - 7701, 7724, 7727, 7743, 529, 0, 0, 0, 0, 3796, - 0, 0, 436, 3797, 3805, 0, 0, 3805, 3802, 0, - 0, 0, 3828, 0, 3849, 3845, 0, 0, 3841, 3861, - 3880, 3886, 0, 0, 3917, 3937, 0, 0, 3934, 0, - 3938, 3956, 3957, 3974, 3977, 0, 0, 527, 7757, 7771, - 7785, 7799, 7620, 7810, 7824, 7863, 7848, 7866, 7878, 7892, - 7904, 7907, 7916, 7942, 7955, 7957, 7971, 7990, 7987, 8011, - 8020, 8046, 8058, 8063, 8062, 8065, 8095, 8106, 8137, 8119, + 7446, 7454, 7476, 7490, 7504, 7518, 7525, 7533, 7539, 7563, + 7569, 7577, 7593, 7612, 7636, 7635, 7659, 7680, 7677, 7683, + 7701, 7724, 7727, 7743, 529, 0, 0, 0, 0, 3796, + 0, 0, 436, 3797, 3805, 0, 0, 3805, 3802, 0, + 0, 0, 3828, 0, 3849, 3845, 0, 0, 3841, 3861, + 3880, 3886, 0, 0, 3917, 3937, 0, 0, 3934, 0, + 3938, 3956, 3957, 3974, 3977, 0, 0, 527, 7757, 7771, + 7785, 7799, 7620, 7810, 7824, 7863, 7848, 7866, 7878, 7892, + 7904, 7907, 7916, 7942, 7955, 7957, 7971, 7990, 7987, 8011, + 8020, 8046, 8058, 8063, 8062, 8065, 8095, 8106, 8137, 8119, - 8150, 8173, 8186, 8197, 8194, 8227, 8244, 8245, 8247, 8279, - 526, 3973, 4081, 0, 3972, 0, 0, 3990, 3982, 0, - 0, 3989, 4018, 4029, 0, 0, 0, 4021, 4035, 4057, - 0, 4063, 524, 8298, 4259, 8293, 8317, 8342, 8343, 8356, - 8357, 8371, 8396, 8397, 8406, 8412, 8442, 8448, 8456, 8481, - 8495, 8500, 8503, 8525, 514, 438, 4062, 4083, 0, 0, - 4072, 0, 0, 0, 0, 4116, 0, 506, 8563, 4119, - 8544, 8549, 8578, 8551, 8570, 8594, 8605, 8613, 8633, 8638, - 470, 4161, 4142, 0, 0, 4154, 468, 4396, 4168, 8652, - 8657, 8659, 465, 4221, 8771, 0, 418, 4227, 0, 8667, + 8150, 8173, 8186, 8197, 8194, 8227, 8244, 8245, 8247, 8279, + 526, 3973, 4081, 0, 3972, 0, 0, 3990, 3982, 0, + 0, 3989, 4018, 4029, 0, 0, 0, 4021, 4035, 4057, + 0, 4063, 524, 8298, 4259, 8293, 8317, 8342, 8343, 8356, + 8357, 8371, 8396, 8397, 8406, 8412, 8442, 8448, 8456, 8481, + 8495, 8500, 8503, 8525, 514, 438, 4062, 4083, 0, 0, + 4072, 0, 0, 0, 0, 4116, 0, 506, 8563, 4119, + 8544, 8549, 8578, 8551, 8570, 8594, 8605, 8613, 8633, 8638, + 470, 4161, 4142, 0, 0, 4154, 468, 4396, 4168, 8652, + 8657, 8659, 465, 4221, 8771, 0, 418, 4227, 0, 8667, - 418, 4213, 390, 4214, 388, 4223, 386, 4242, 347, 4275, - 343, 4301, 338, 4306, 335, 4320, 334, 4329, 332, 4357, - 303, 8771, 293, 0, 299, 286, 248, 243, 8771, 0, - 8771, 8740, 8745, 201, 8750, 8755, 8760, 8765 - } ; + 418, 4213, 390, 4214, 388, 4223, 386, 4242, 347, 4275, + 343, 4301, 338, 4306, 335, 4320, 334, 4329, 332, 4357, + 303, 8771, 293, 0, 299, 286, 248, 243, 8771, 0, + 8771, 8740, 8745, 201, 8750, 8755, 8760, 8765 + } ; static const flex_int16_t yy_def[1339] = - { 0, - 1331, 1, 1332, 1332, 1331, 5, 1331, 1331, 1331, 1331, - 1331, 1333, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1331, 1335, 1331, 1336, 1336, 1331, - 1336, 1337, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, - 1338, 1338, 62, 62, 62, 63, 65, 62, 65, 62, - 62, 62, 62, 63, 63, 63, 62, 62, 62, 62, - 65, 62, 62, 62, 1336, 1331, 1331, 1333, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1334, 1334, 1334, + { 0, + 1331, 1, 1332, 1332, 1331, 5, 1331, 1331, 1331, 1331, + 1331, 1333, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1331, 1335, 1331, 1336, 1336, 1331, + 1336, 1337, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, + 1338, 1338, 62, 62, 62, 63, 65, 62, 65, 62, + 62, 62, 62, 63, 63, 63, 62, 62, 62, 62, + 65, 62, 62, 62, 1336, 1331, 1331, 1333, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1331, 1335, 1331, 1336, 1336, 1336, 1337, - 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 62, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1331, 1335, 1331, 1336, 1336, 1336, 1337, + 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 1336, 62, - 62, 62, 65, 65, 65, 65, 65, 65, 62, 62, - 65, 65, 65, 62, 62, 62, 65, 65, 65, 62, - 65, 65, 65, 62, 65, 65, 62, 65, 62, 65, - 62, 62, 65, 65, 65, 65, 62, 62, 65, 65, - 62, 62, 62, 62, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 62, 62, 62, 62, - 65, 65, 65, 65, 65, 65, 62, 62, 62, 62, - 62, 62, 65, 62, 62, 62, 63, 62, 62, 62, - 65, 62, 62, 62, 62, 1336, 1331, 1331, 1331, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 62, 62, 65, 65, 65, 65, 65, 65, 62, 62, + 65, 65, 65, 62, 62, 62, 65, 65, 65, 62, + 65, 65, 65, 62, 65, 65, 62, 65, 62, 65, + 62, 62, 65, 65, 65, 65, 62, 62, 65, 65, + 62, 62, 62, 62, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 62, 62, 62, 62, + 65, 65, 65, 65, 65, 65, 62, 62, 62, 62, + 62, 62, 65, 62, 62, 62, 63, 62, 62, 62, + 65, 62, 62, 62, 62, 1336, 1331, 1331, 1331, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1336, 1336, 1336, 62, 62, 62, 62, 65, - 65, 65, 65, 62, 62, 62, 62, 65, 65, 62, - 62, 62, 62, 62, 62, 62, 65, 65, 62, 65, - 65, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 65, 65, 65, 65, 62, 62, - 65, 65, 65, 65, 65, 65, 65, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 65, 65, 65, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 65, 65, 65, 62, 62, 62, 62, 65, 65, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1336, 1336, 1336, 62, 62, 62, 62, 65, + 65, 65, 65, 62, 62, 62, 62, 65, 65, 62, + 62, 62, 62, 62, 62, 62, 65, 65, 62, 65, + 65, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 65, 65, 65, 65, 62, 62, + 65, 65, 65, 65, 65, 65, 65, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 65, 65, 65, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 65, 65, 65, 62, 62, 62, 62, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 62, 62, - 62, 62, 62, 62, 62, 65, 65, 65, 65, 65, - 65, 65, 62, 62, 65, 65, 62, 62, 62, 62, - 65, 65, 65, 65, 65, 65, 65, 65, 1331, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 65, 65, 65, 65, 65, 65, 65, 65, 62, 62, + 62, 62, 62, 62, 62, 65, 65, 65, 65, 65, + 65, 65, 62, 62, 65, 65, 62, 62, 62, 62, + 65, 65, 65, 65, 65, 65, 65, 65, 1331, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1336, 65, 65, 62, 62, 62, 65, - 62, 65, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 65, 62, 62, 62, 65, 65, 65, - 65, 65, 65, 65, 62, 65, 65, 65, 65, 65, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1336, 65, 65, 62, 62, 62, 65, + 62, 65, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 65, 62, 62, 62, 65, 65, 65, + 65, 65, 65, 65, 62, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 65, 65, 65, 62, 62, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 62, 62, 62, 65, 65, 65, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 65, 65, - 62, 62, 62, 65, 62, 62, 62, 62, 62, 62, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 62, 62, 62, 62, 62, 62, 62, 65, 1331, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 65, 65, 65, 65, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 65, 65, 65, 62, 62, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 62, 62, 62, 65, 65, 65, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 65, 65, + 62, 62, 62, 65, 62, 62, 62, 62, 62, 62, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 62, 62, 62, 62, 62, 62, 62, 65, 1331, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1336, 65, 65, 65, 65, 62, - 62, 62, 62, 62, 62, 62, 65, 65, 62, 62, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1336, 65, 65, 65, 65, 62, + 62, 62, 62, 62, 62, 62, 65, 65, 62, 62, - 62, 65, 62, 62, 62, 65, 62, 62, 62, 62, - 65, 62, 62, 62, 62, 65, 62, 62, 62, 62, - 62, 62, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 62, 65, 65, 65, 65, 65, 65, 65, 62, - 65, 65, 65, 65, 65, 65, 65, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 65, 65, 65, 65, 65, 65, - 65, 62, 62, 62, 62, 65, 65, 65, 65, 65, - 1331, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 62, 65, 62, 62, 62, 65, 62, 62, 62, 62, + 65, 62, 62, 62, 62, 65, 62, 62, 62, 62, + 62, 62, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 62, 65, 65, 65, 65, 65, 65, 65, 62, + 65, 65, 65, 65, 65, 65, 65, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 65, 65, 65, 65, 65, 65, + 65, 62, 62, 62, 62, 65, 65, 65, 65, 65, + 1331, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1336, 62, 62, 65, 65, 65, 62, 62, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 62, 62, 65, 65, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 65, 65, 65, 65, 65, 65, 65, 62, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1336, 62, 62, 65, 65, 65, 62, 62, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 62, 62, 65, 65, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 65, 65, 65, 65, 65, 65, 65, 62, - 62, 62, 62, 62, 62, 62, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 1331, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1336, 65, 65, - 65, 65, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 65, 65, 65, 65, 65, - 65, 65, 62, 62, 65, 65, 65, 65, 65, 65, + 62, 62, 62, 62, 62, 62, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 1331, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1336, 65, 65, + 65, 65, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 65, 65, 65, 65, 65, + 65, 65, 62, 62, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 65, 65, 65, 62, 62, 62, 62, - 1331, 1334, 1331, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, - 1334, 1334, 1336, 62, 1336, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 65, 65, 65, 65, 65, 62, - 62, 62, 62, 62, 1331, 1334, 1331, 1334, 1334, 1334, - 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1336, 62, 1336, - 62, 62, 62, 65, 65, 65, 65, 65, 62, 62, - 1331, 1331, 1331, 1334, 1334, 1334, 1336, 1336, 1336, 62, - 62, 65, 1331, 1331, 1331, 1334, 1336, 1336, 1336, 65, + 65, 65, 65, 65, 65, 65, 62, 62, 62, 62, + 1331, 1334, 1331, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1334, + 1334, 1334, 1336, 62, 1336, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 65, 65, 65, 65, 65, 62, + 62, 62, 62, 62, 1331, 1334, 1331, 1334, 1334, 1334, + 1334, 1334, 1334, 1334, 1334, 1334, 1334, 1336, 62, 1336, + 62, 62, 62, 65, 65, 65, 65, 65, 62, 62, + 1331, 1331, 1331, 1334, 1334, 1334, 1336, 1336, 1336, 62, + 62, 65, 1331, 1331, 1331, 1334, 1336, 1336, 1336, 65, - 1331, 1331, 1336, 1336, 1331, 1331, 1336, 1336, 1331, 1331, - 1336, 1336, 1331, 1331, 1336, 1336, 1331, 1331, 1336, 1336, - 1331, 1331, 1336, 1336, 1331, 1336, 1331, 1336, 1331, 1336, - 0, 1331, 1331, 1331, 1331, 1331, 1331, 1331 - } ; + 1331, 1331, 1336, 1336, 1331, 1331, 1336, 1336, 1331, 1331, + 1336, 1336, 1331, 1331, 1336, 1336, 1331, 1331, 1336, 1336, + 1331, 1331, 1336, 1336, 1331, 1336, 1331, 1336, 1331, 1336, + 0, 1331, 1331, 1331, 1331, 1331, 1331, 1331 + } ; static const flex_int16_t yy_nxt[8848] = - { 0, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 37, 44, 37, 8, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 37, 44, 37, 45, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 58, 59, 60, 61, 62, - - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 77, 84, 77, 48, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 77, 84, - 77, 85, 86, 86, 86, 86, 89, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 91, 90, 92, 93, - 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, - 95, 99, 105, 100, 129, 131, 106, 109, 139, 101, - 130, 102, 107, 132, 110, 103, 104, 140, 176, 133, - - 177, 111, 108, 178, 112, 98, 183, 113, 99, 105, - 100, 129, 131, 106, 109, 139, 101, 130, 102, 107, - 132, 110, 103, 104, 140, 176, 133, 177, 111, 108, - 178, 112, 114, 183, 113, 119, 115, 120, 188, 86, - 116, 141, 121, 290, 144, 142, 117, 122, 145, 118, - 191, 143, 86, 86, 146, 181, 182, 196, 197, 114, - 1330, 192, 119, 115, 120, 1329, 147, 116, 141, 121, - 290, 144, 142, 117, 122, 145, 118, 123, 143, 156, - 148, 146, 181, 182, 291, 124, 149, 150, 125, 296, - 157, 126, 134, 147, 127, 1328, 158, 128, 135, 136, - - 137, 179, 86, 86, 123, 138, 156, 148, 1327, 180, - 1326, 291, 124, 149, 150, 125, 296, 157, 126, 134, - 1325, 127, 151, 158, 128, 135, 136, 137, 179, 297, - 152, 159, 138, 292, 153, 160, 180, 154, 155, 161, - 200, 293, 278, 301, 279, 162, 1323, 280, 1321, 151, - 294, 1319, 200, 295, 1317, 302, 297, 152, 159, 1315, - 292, 153, 160, 1313, 154, 155, 161, 200, 293, 278, - 301, 279, 162, 163, 280, 164, 305, 294, 165, 200, - 295, 166, 302, 167, 312, 168, 169, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 188, 86, 1311, - - 163, 1309, 164, 305, 1307, 165, 298, 299, 166, 303, - 167, 312, 168, 169, 170, 310, 304, 231, 171, 200, - 300, 172, 173, 232, 200, 311, 320, 321, 174, 200, - 322, 175, 1305, 298, 299, 1303, 303, 1213, 1213, 1282, - 1282, 170, 310, 304, 231, 171, 200, 300, 172, 173, - 232, 200, 311, 320, 321, 174, 200, 322, 175, 194, - 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 187, 187, 323, 187, 187, 187, 187, 187, 187, 324, - 233, 313, 1301, 1297, 200, 1293, 314, 325, 234, 187, - 187, 187, 200, 326, 235, 201, 200, 202, 332, 323, - - 333, 334, 241, 203, 200, 204, 324, 233, 313, 205, - 206, 200, 200, 314, 325, 234, 337, 338, 1287, 200, - 326, 235, 201, 200, 202, 332, 1281, 333, 334, 241, - 203, 200, 204, 1268, 339, 1255, 205, 206, 1233, 200, - 1211, 1168, 1125, 337, 338, 187, 187, 187, 1053, 187, - 187, 187, 187, 187, 187, 981, 885, 340, 242, 243, - 246, 339, 200, 244, 247, 187, 187, 187, 200, 245, - 248, 341, 207, 200, 342, 335, 208, 200, 200, 200, - 200, 336, 209, 200, 340, 242, 243, 246, 343, 200, - 244, 247, 210, 200, 789, 200, 245, 248, 341, 207, - - 200, 342, 335, 208, 200, 200, 200, 200, 336, 209, - 200, 664, 539, 200, 344, 343, 283, 284, 345, 210, - 200, 187, 211, 200, 261, 346, 200, 351, 262, 212, - 200, 352, 263, 200, 353, 354, 213, 360, 264, 214, - 200, 344, 215, 283, 284, 345, 200, 414, 200, 211, - 200, 261, 346, 200, 351, 262, 212, 200, 352, 263, - 200, 353, 354, 213, 360, 264, 214, 413, 288, 215, - 287, 286, 281, 200, 216, 200, 200, 285, 217, 347, - 282, 200, 218, 355, 361, 356, 200, 200, 219, 348, - 362, 220, 363, 366, 349, 350, 200, 200, 200, 281, - - 199, 216, 198, 200, 285, 217, 347, 282, 200, 218, - 355, 361, 356, 200, 200, 219, 348, 362, 220, 363, - 366, 349, 350, 200, 200, 200, 200, 306, 307, 308, - 200, 309, 315, 221, 316, 222, 200, 317, 367, 357, - 223, 358, 368, 318, 369, 224, 200, 187, 364, 370, - 319, 365, 359, 200, 306, 307, 308, 200, 309, 315, - 221, 316, 222, 200, 317, 367, 357, 223, 358, 368, - 318, 369, 224, 200, 225, 364, 370, 319, 365, 359, - 371, 200, 226, 372, 373, 227, 374, 327, 228, 328, - 375, 229, 376, 329, 230, 189, 380, 186, 184, 383, - - 330, 225, 97, 96, 331, 87, 389, 371, 200, 226, - 372, 373, 227, 374, 327, 228, 328, 375, 229, 376, - 329, 230, 236, 380, 377, 381, 383, 330, 237, 238, - 239, 331, 387, 389, 390, 240, 382, 378, 391, 392, - 200, 1331, 379, 47, 393, 47, 388, 396, 1331, 236, - 397, 377, 381, 398, 404, 237, 238, 239, 1331, 387, - 1331, 390, 240, 382, 378, 391, 392, 200, 249, 379, - 384, 393, 394, 388, 396, 200, 399, 397, 405, 385, - 398, 404, 250, 395, 401, 200, 406, 386, 251, 252, - 1331, 402, 407, 1331, 403, 249, 400, 384, 410, 394, - - 411, 412, 200, 399, 1331, 405, 385, 1331, 540, 250, - 395, 401, 200, 406, 386, 251, 252, 200, 402, 407, - 408, 403, 253, 400, 200, 410, 541, 411, 412, 542, - 254, 200, 200, 409, 255, 540, 200, 256, 257, 1331, - 1331, 1331, 200, 543, 200, 1331, 1331, 408, 544, 253, - 1331, 200, 200, 541, 1331, 545, 542, 254, 200, 200, - 409, 255, 546, 200, 256, 257, 258, 416, 200, 200, - 543, 547, 200, 200, 1331, 544, 548, 259, 200, 200, - 200, 200, 545, 260, 549, 200, 200, 1331, 200, 546, - 553, 200, 1331, 258, 416, 200, 417, 1331, 547, 200, - - 200, 200, 554, 548, 259, 200, 555, 200, 200, 1331, - 260, 549, 200, 200, 265, 200, 266, 553, 200, 267, - 200, 1331, 268, 417, 269, 556, 270, 271, 200, 554, - 557, 558, 559, 555, 560, 561, 200, 1331, 562, 1331, - 1331, 265, 1331, 266, 1331, 1331, 267, 200, 418, 268, - 200, 269, 556, 270, 271, 200, 419, 557, 558, 559, - 200, 560, 561, 200, 272, 562, 200, 200, 273, 200, - 200, 274, 275, 422, 200, 418, 428, 200, 276, 200, - 563, 277, 200, 419, 564, 565, 200, 200, 200, 1331, - 1331, 272, 1331, 200, 200, 273, 200, 200, 274, 275, - - 422, 200, 1331, 428, 1331, 276, 200, 563, 277, 1331, - 1331, 564, 565, 200, 1331, 200, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 289, 289, 289, 289, - 289, 289, 289, 289, 289, 289, 92, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 194, 195, 195, - 195, 195, 195, 195, 195, 195, 195, 195, 420, 423, - 427, 421, 550, 568, 551, 200, 569, 200, 200, 200, - 200, 200, 200, 570, 1331, 200, 200, 200, 1331, 552, - - 200, 200, 1331, 1331, 1331, 420, 423, 427, 421, 550, - 568, 551, 200, 569, 200, 200, 200, 200, 200, 200, - 570, 200, 200, 200, 200, 200, 552, 200, 200, 424, - 425, 200, 429, 571, 200, 200, 566, 200, 1331, 430, - 1331, 200, 200, 426, 200, 1331, 572, 200, 200, 573, - 1331, 567, 200, 574, 431, 575, 424, 425, 200, 429, - 571, 200, 200, 566, 200, 200, 430, 200, 200, 200, - 426, 200, 200, 572, 200, 1331, 573, 200, 567, 1331, - 574, 431, 575, 436, 1331, 1331, 576, 200, 577, 578, - 1331, 1331, 200, 437, 200, 579, 580, 581, 200, 200, - - 1331, 582, 200, 200, 200, 432, 433, 434, 200, 435, - 436, 438, 200, 576, 200, 577, 578, 200, 200, 583, - 437, 584, 579, 580, 581, 200, 585, 200, 582, 200, - 200, 200, 432, 433, 434, 200, 435, 200, 438, 200, - 586, 587, 439, 588, 200, 200, 583, 440, 584, 589, - 1331, 590, 591, 585, 200, 592, 1331, 593, 200, 1331, - 594, 1331, 1331, 1331, 200, 595, 1331, 586, 587, 439, - 588, 1331, 596, 597, 440, 441, 589, 442, 590, 591, - 443, 600, 592, 200, 593, 200, 444, 594, 200, 446, - 447, 1331, 595, 445, 200, 200, 200, 1331, 200, 596, - - 597, 200, 441, 448, 442, 601, 200, 443, 600, 602, - 200, 1331, 200, 444, 200, 200, 446, 447, 200, 1331, - 445, 200, 200, 200, 449, 200, 1331, 603, 200, 598, - 448, 1331, 601, 200, 200, 200, 602, 200, 451, 599, - 1331, 200, 450, 1331, 604, 200, 200, 200, 200, 1331, - 1331, 449, 605, 200, 603, 1331, 598, 608, 200, 1331, - 609, 200, 200, 610, 200, 451, 599, 452, 611, 450, - 458, 604, 200, 200, 200, 200, 200, 200, 200, 605, - 200, 612, 200, 200, 608, 200, 606, 609, 200, 1331, - 610, 1331, 1331, 613, 452, 611, 607, 458, 614, 200, - - 1331, 1331, 1331, 200, 200, 200, 1331, 615, 612, 200, - 200, 1331, 459, 606, 200, 200, 453, 200, 454, 200, - 613, 200, 455, 607, 200, 614, 616, 460, 200, 456, - 617, 618, 619, 457, 615, 1331, 1331, 200, 200, 459, - 1331, 200, 1331, 453, 200, 454, 200, 622, 200, 455, - 625, 200, 1331, 616, 460, 200, 456, 617, 618, 619, - 457, 461, 200, 200, 200, 200, 200, 462, 200, 464, - 1331, 200, 463, 200, 622, 626, 200, 625, 1331, 623, - 1331, 200, 200, 1331, 1331, 1331, 627, 200, 461, 200, - 200, 200, 624, 200, 462, 200, 464, 465, 200, 463, - - 200, 200, 626, 200, 628, 200, 623, 200, 200, 200, - 200, 466, 200, 627, 200, 629, 630, 467, 200, 624, - 468, 200, 200, 200, 465, 469, 1331, 1331, 200, 1331, - 200, 628, 200, 1331, 200, 200, 1331, 200, 466, 200, - 631, 632, 629, 630, 467, 1331, 633, 468, 200, 200, - 200, 200, 469, 200, 200, 200, 200, 200, 200, 471, - 470, 200, 200, 200, 634, 200, 200, 631, 632, 635, - 620, 1331, 200, 633, 477, 200, 636, 1331, 200, 200, - 200, 200, 200, 200, 200, 200, 471, 470, 200, 621, - 200, 634, 200, 200, 200, 637, 635, 620, 200, 200, - - 638, 477, 200, 636, 200, 472, 200, 1331, 200, 200, - 1331, 200, 478, 200, 200, 1331, 621, 639, 200, 200, - 1331, 200, 637, 1331, 640, 200, 1331, 638, 200, 479, - 1331, 200, 472, 200, 480, 200, 200, 200, 641, 478, - 200, 200, 473, 200, 639, 200, 200, 200, 642, 487, - 200, 640, 474, 200, 200, 200, 479, 475, 476, 200, - 200, 480, 200, 1331, 200, 641, 643, 1331, 1331, 473, - 200, 1331, 1331, 1331, 200, 642, 487, 200, 644, 474, - 200, 200, 1331, 1331, 475, 476, 200, 645, 646, 200, - 200, 647, 1331, 643, 200, 200, 481, 200, 482, 497, - - 200, 486, 200, 200, 650, 644, 1331, 200, 653, 200, - 200, 1331, 654, 1331, 645, 646, 1331, 200, 647, 200, - 1331, 200, 200, 481, 200, 482, 497, 200, 486, 200, - 200, 650, 655, 648, 200, 653, 200, 200, 483, 654, - 484, 200, 649, 488, 656, 651, 200, 652, 200, 200, - 200, 485, 200, 200, 657, 658, 200, 200, 489, 655, - 648, 200, 200, 1331, 659, 483, 1331, 484, 200, 649, - 488, 656, 651, 1331, 652, 200, 200, 200, 485, 200, - 200, 657, 658, 200, 200, 489, 1331, 1331, 200, 200, - 200, 659, 200, 492, 1331, 200, 662, 200, 490, 1331, - - 200, 491, 200, 493, 1331, 200, 200, 660, 200, 663, - 1331, 661, 1331, 200, 200, 1331, 200, 200, 200, 200, - 492, 200, 200, 662, 200, 490, 200, 200, 491, 200, - 493, 494, 200, 200, 660, 200, 663, 200, 661, 200, - 200, 200, 495, 200, 200, 200, 1331, 790, 200, 200, - 200, 1331, 200, 200, 1331, 1331, 791, 200, 494, 792, - 793, 1331, 200, 794, 200, 795, 200, 796, 797, 495, - 798, 200, 799, 200, 790, 200, 200, 200, 200, 200, - 200, 496, 200, 791, 200, 200, 792, 793, 200, 200, - 794, 498, 795, 1331, 796, 797, 1331, 798, 200, 799, - - 200, 800, 200, 1331, 1331, 200, 499, 200, 496, 200, - 200, 801, 200, 802, 200, 200, 803, 804, 498, 500, - 200, 805, 1331, 501, 200, 200, 502, 806, 800, 200, - 200, 200, 807, 499, 808, 1331, 200, 200, 801, 200, - 802, 200, 809, 803, 804, 1331, 500, 200, 805, 503, - 501, 200, 1331, 502, 806, 810, 200, 200, 200, 807, - 200, 808, 504, 200, 1331, 811, 200, 505, 506, 809, - 812, 813, 200, 200, 814, 200, 503, 815, 1331, 507, - 200, 200, 810, 816, 1331, 200, 200, 200, 1331, 504, - 508, 200, 811, 1331, 505, 506, 817, 812, 813, 200, - - 200, 814, 200, 818, 815, 509, 507, 200, 200, 200, - 816, 200, 200, 200, 819, 200, 200, 508, 200, 515, - 513, 200, 1331, 817, 200, 200, 820, 821, 200, 822, - 818, 1331, 509, 1331, 514, 200, 200, 1331, 200, 1331, - 1331, 819, 200, 200, 200, 823, 515, 513, 200, 510, - 1331, 200, 200, 820, 821, 200, 822, 1331, 511, 516, - 200, 514, 200, 200, 200, 200, 512, 200, 200, 1331, - 200, 200, 823, 200, 200, 1331, 510, 517, 824, 1331, - 825, 826, 1331, 200, 200, 511, 516, 200, 827, 828, - 200, 200, 200, 512, 200, 200, 519, 200, 518, 200, - - 200, 200, 200, 200, 517, 824, 200, 825, 826, 200, - 200, 200, 200, 1331, 1331, 827, 828, 522, 829, 200, - 1331, 200, 200, 519, 1331, 518, 200, 200, 1331, 200, - 200, 830, 1331, 200, 1331, 831, 200, 200, 832, 200, - 200, 520, 200, 833, 522, 829, 200, 200, 200, 200, - 1331, 200, 521, 834, 200, 200, 1331, 1331, 830, 523, - 835, 200, 831, 838, 200, 832, 1331, 200, 520, 200, - 833, 200, 1331, 200, 200, 1331, 839, 200, 200, 521, - 834, 840, 200, 200, 524, 525, 523, 835, 200, 841, - 838, 842, 200, 200, 1331, 845, 530, 200, 200, 200, - - 200, 200, 200, 839, 200, 526, 1331, 200, 840, 1331, - 200, 524, 525, 1331, 1331, 846, 841, 200, 842, 200, - 200, 200, 845, 530, 200, 531, 200, 1331, 200, 200, - 847, 200, 526, 527, 200, 848, 200, 1331, 1331, 836, - 528, 200, 846, 529, 200, 849, 200, 532, 200, 200, - 837, 534, 531, 533, 200, 200, 200, 847, 200, 200, - 527, 200, 848, 200, 535, 536, 836, 528, 200, 200, - 529, 200, 849, 200, 532, 200, 200, 837, 534, 1331, - 533, 200, 200, 200, 1331, 200, 200, 1331, 200, 200, - 850, 535, 536, 200, 1331, 851, 200, 538, 200, 200, - - 852, 200, 200, 853, 537, 200, 667, 854, 200, 200, - 855, 200, 200, 200, 843, 844, 200, 850, 200, 856, - 200, 200, 851, 1331, 538, 1331, 200, 852, 200, 1331, - 853, 537, 200, 667, 854, 200, 200, 855, 200, 1331, - 200, 843, 844, 1331, 1331, 200, 856, 1331, 200, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 200, - 665, 200, 666, 200, 200, 200, 200, 857, 858, 200, - 200, 200, 200, 1331, 859, 860, 1331, 861, 1331, 200, - 200, 200, 200, 1331, 1331, 1331, 200, 665, 200, 666, - - 200, 200, 200, 200, 857, 858, 200, 200, 200, 200, - 668, 859, 860, 200, 861, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 1331, 200, 200, - 200, 1331, 862, 200, 200, 1331, 669, 668, 863, 1331, - 200, 864, 200, 865, 1331, 1331, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 670, 862, - 200, 200, 200, 669, 200, 863, 200, 200, 864, 866, - 865, 672, 200, 200, 200, 1331, 673, 200, 200, 867, - 671, 200, 200, 200, 868, 670, 869, 200, 200, 200, - 674, 200, 200, 200, 200, 870, 866, 200, 672, 200, - - 871, 200, 200, 673, 200, 200, 867, 671, 200, 200, - 200, 868, 200, 869, 200, 200, 1331, 674, 200, 200, - 1331, 678, 870, 1331, 200, 1331, 1331, 871, 200, 200, - 675, 1331, 676, 200, 872, 200, 200, 200, 873, 200, - 874, 1331, 200, 200, 875, 200, 200, 677, 678, 679, - 200, 1331, 200, 200, 680, 200, 200, 675, 200, 676, - 200, 872, 200, 200, 200, 873, 200, 874, 200, 200, - 200, 875, 1331, 200, 677, 1331, 679, 200, 682, 200, - 200, 680, 200, 200, 1331, 200, 200, 1331, 876, 200, - 683, 877, 200, 200, 200, 200, 878, 681, 200, 200, - - 879, 200, 200, 1331, 200, 682, 684, 880, 1331, 200, - 1331, 200, 1331, 200, 200, 876, 881, 683, 877, 200, - 882, 200, 883, 878, 681, 200, 200, 879, 200, 200, - 200, 200, 200, 684, 880, 686, 685, 200, 200, 200, - 884, 200, 200, 881, 200, 200, 200, 882, 982, 883, - 983, 687, 984, 1331, 985, 200, 200, 200, 688, 200, - 200, 986, 686, 685, 200, 200, 200, 884, 1331, 200, - 200, 200, 200, 200, 1331, 982, 200, 983, 687, 984, - 689, 985, 200, 200, 1331, 688, 200, 200, 986, 987, - 690, 691, 200, 988, 200, 200, 200, 200, 200, 1331, - - 989, 200, 990, 200, 200, 991, 692, 689, 1331, 1331, - 992, 200, 1331, 200, 200, 993, 987, 690, 691, 1331, - 988, 200, 200, 200, 693, 200, 200, 989, 200, 990, - 200, 200, 991, 692, 994, 694, 200, 992, 200, 200, - 1331, 200, 993, 1331, 200, 200, 200, 1331, 200, 995, - 996, 693, 997, 200, 200, 200, 1331, 200, 1331, 695, - 1331, 994, 694, 200, 200, 1331, 200, 696, 1331, 1331, - 200, 200, 200, 200, 200, 200, 995, 996, 1331, 997, - 200, 200, 200, 698, 998, 200, 695, 200, 200, 200, - 200, 200, 200, 200, 696, 200, 697, 200, 200, 999, - - 1000, 200, 1331, 200, 1001, 200, 1331, 200, 200, 1331, - 698, 998, 200, 1002, 200, 200, 200, 200, 1331, 200, - 200, 1331, 200, 697, 700, 200, 999, 1000, 200, 699, - 200, 1001, 200, 200, 200, 200, 701, 200, 200, 1331, - 1002, 1331, 200, 200, 200, 200, 1331, 200, 200, 1003, - 1004, 700, 702, 200, 1005, 200, 699, 200, 200, 1006, - 200, 200, 1331, 701, 200, 200, 703, 1331, 200, 200, - 200, 200, 200, 200, 200, 200, 1003, 1004, 200, 702, - 200, 1005, 1007, 1008, 200, 200, 1006, 200, 1331, 200, - 200, 1331, 200, 703, 705, 200, 704, 200, 1331, 200, - - 200, 1331, 200, 1331, 1009, 200, 1010, 1331, 706, 1007, - 1008, 1331, 200, 708, 200, 200, 200, 200, 200, 200, - 200, 705, 1011, 704, 200, 200, 200, 1331, 200, 200, - 707, 1009, 1012, 1010, 200, 706, 1331, 1331, 200, 200, - 708, 1331, 200, 1331, 200, 200, 1331, 200, 1013, 1011, - 1331, 1331, 200, 1014, 200, 200, 1015, 707, 1016, 1012, - 1019, 200, 200, 709, 200, 200, 200, 710, 200, 200, - 711, 200, 200, 200, 200, 1013, 1017, 200, 200, 1018, - 1014, 200, 200, 1015, 1331, 1016, 1331, 1019, 1331, 200, - 709, 200, 1331, 200, 710, 200, 200, 711, 712, 200, - - 200, 200, 1020, 1017, 200, 200, 1018, 714, 200, 200, - 200, 200, 200, 200, 200, 200, 1021, 1022, 200, 200, - 200, 713, 1331, 200, 200, 712, 1331, 1023, 1024, 1020, - 1025, 1026, 1331, 1027, 714, 200, 1028, 200, 200, 200, - 200, 200, 200, 1021, 1022, 200, 200, 200, 713, 200, - 200, 200, 200, 715, 1023, 1024, 200, 1025, 1026, 200, - 1027, 200, 200, 1028, 1331, 200, 1331, 716, 1029, 200, - 1331, 200, 200, 1030, 717, 1331, 200, 1031, 1331, 200, - 715, 200, 1331, 200, 1032, 1331, 200, 200, 200, 200, - 1331, 200, 200, 718, 716, 1029, 200, 200, 200, 200, - - 1030, 717, 200, 1033, 1031, 720, 200, 200, 200, 200, - 1331, 1032, 719, 1034, 200, 200, 1331, 721, 200, 1035, - 718, 200, 200, 1036, 200, 200, 1331, 200, 1331, 200, - 1033, 722, 720, 200, 200, 200, 200, 200, 1331, 719, - 1034, 200, 200, 723, 721, 1037, 1035, 200, 200, 200, - 1036, 200, 200, 724, 200, 200, 1331, 1331, 722, 200, - 1038, 1331, 200, 200, 200, 200, 1331, 1039, 200, 1040, - 723, 725, 1037, 1041, 200, 200, 1331, 200, 200, 726, - 724, 200, 200, 200, 200, 1331, 200, 1038, 200, 200, - 200, 1331, 200, 200, 1039, 1331, 1040, 1042, 725, 728, - - 1041, 1331, 200, 200, 200, 200, 726, 200, 200, 200, - 200, 200, 200, 727, 1331, 200, 200, 200, 200, 200, - 200, 200, 729, 733, 1042, 200, 728, 1043, 200, 1331, - 200, 200, 200, 1331, 200, 1044, 200, 1045, 200, 200, - 727, 200, 730, 200, 200, 200, 200, 200, 200, 729, - 733, 1046, 200, 200, 1043, 200, 200, 200, 200, 734, - 200, 200, 1044, 200, 1045, 200, 200, 200, 200, 730, - 200, 736, 1331, 1047, 200, 1331, 200, 200, 1046, 1048, - 200, 1331, 1049, 200, 200, 1331, 734, 200, 200, 1050, - 200, 731, 200, 200, 200, 200, 200, 1331, 736, 200, - - 1047, 732, 200, 200, 200, 200, 1048, 1051, 735, 1049, - 1331, 1052, 200, 1331, 1331, 200, 1050, 200, 731, 200, - 200, 200, 200, 200, 200, 1126, 200, 200, 732, 200, - 200, 1127, 200, 737, 1051, 735, 1128, 200, 1052, 200, - 200, 738, 200, 1129, 200, 200, 1331, 200, 200, 200, - 1130, 200, 1126, 1331, 200, 200, 1131, 200, 1127, 739, - 737, 200, 1331, 1128, 200, 200, 200, 200, 738, 1132, - 1129, 200, 200, 200, 1331, 200, 200, 1130, 1331, 740, - 200, 1133, 200, 1131, 1331, 200, 739, 200, 200, 200, - 1134, 742, 200, 200, 741, 200, 1132, 1331, 200, 200, - - 200, 200, 200, 1331, 1135, 743, 740, 200, 1133, 200, - 1136, 200, 200, 1331, 200, 200, 200, 1134, 742, 1331, - 200, 741, 200, 1137, 200, 200, 200, 200, 200, 747, - 200, 1135, 743, 744, 200, 1331, 200, 1136, 200, 200, - 200, 1331, 200, 1138, 1139, 1331, 752, 200, 200, 1331, - 1137, 200, 200, 200, 200, 1331, 747, 200, 200, 1140, - 744, 200, 200, 750, 200, 1331, 200, 200, 745, 200, - 1138, 1139, 200, 752, 200, 200, 200, 1141, 1331, 1142, - 200, 1143, 200, 1144, 1145, 200, 1140, 746, 1146, 200, - 750, 200, 200, 1331, 1147, 745, 200, 1331, 1148, 200, - - 751, 200, 1331, 200, 1141, 200, 1142, 200, 1143, 200, - 1144, 1145, 200, 1149, 746, 1146, 200, 200, 200, 200, - 748, 1147, 1150, 200, 754, 1148, 1151, 751, 200, 200, - 1331, 200, 200, 749, 200, 1152, 200, 1331, 1331, 200, - 1149, 200, 1331, 200, 200, 200, 753, 748, 1153, 1150, - 200, 754, 1154, 1151, 1155, 200, 200, 200, 200, 200, - 749, 755, 1152, 200, 200, 200, 1156, 200, 200, 200, - 1157, 1158, 200, 753, 1331, 1153, 1331, 200, 756, 1154, - 200, 1155, 1159, 1331, 200, 200, 200, 1331, 755, 1331, - 200, 200, 200, 1156, 200, 1160, 200, 1157, 1158, 200, - - 1161, 200, 1331, 200, 200, 756, 758, 200, 757, 1159, - 200, 200, 200, 200, 760, 200, 200, 200, 200, 200, - 1162, 759, 1160, 200, 200, 1163, 200, 1161, 200, 200, - 200, 200, 1331, 758, 200, 757, 1331, 200, 200, 200, - 200, 760, 200, 200, 1331, 200, 200, 1162, 759, 1331, - 200, 200, 1163, 200, 1331, 200, 200, 1331, 200, 200, - 200, 200, 1331, 200, 200, 200, 200, 200, 761, 764, - 200, 200, 1164, 200, 763, 200, 200, 200, 762, 200, - 200, 200, 200, 200, 200, 765, 200, 200, 1331, 200, - 200, 200, 200, 1331, 200, 761, 764, 200, 200, 1164, - - 200, 763, 200, 200, 200, 762, 200, 200, 200, 1165, - 200, 200, 765, 200, 1166, 200, 200, 767, 1167, 200, - 200, 766, 1212, 1214, 200, 200, 200, 1215, 200, 200, - 768, 1216, 1331, 200, 1331, 1331, 1165, 1331, 200, 1331, - 200, 1166, 200, 1217, 767, 1167, 200, 200, 766, 1212, - 1214, 200, 200, 200, 1215, 200, 200, 768, 1216, 200, - 200, 200, 200, 1218, 770, 200, 200, 769, 1331, 200, - 1217, 200, 771, 1219, 200, 200, 200, 1331, 1220, 200, - 1221, 1331, 200, 1331, 1331, 200, 200, 1222, 200, 200, - 1218, 770, 200, 200, 769, 200, 200, 1331, 200, 771, - - 1219, 200, 200, 200, 773, 1220, 200, 1221, 200, 200, - 772, 200, 200, 774, 1222, 200, 1223, 1331, 200, 200, - 200, 1224, 200, 200, 200, 1331, 200, 1331, 200, 200, - 200, 773, 1331, 200, 775, 200, 778, 772, 200, 776, - 774, 777, 200, 1223, 200, 200, 200, 200, 1224, 200, - 200, 200, 200, 200, 780, 200, 200, 200, 1225, 200, - 200, 775, 1331, 778, 200, 1331, 776, 1331, 777, 1226, - 779, 200, 1331, 200, 200, 1227, 200, 1228, 200, 200, - 200, 780, 200, 1331, 200, 1225, 200, 200, 1331, 781, - 1229, 200, 200, 1331, 200, 1331, 1226, 779, 1230, 782, - - 1231, 200, 1227, 1232, 1228, 200, 1331, 200, 200, 200, - 200, 200, 1256, 1258, 200, 200, 781, 1229, 1259, 200, - 200, 200, 200, 1260, 200, 1230, 782, 1231, 1261, 200, - 1232, 1331, 1331, 783, 200, 200, 200, 200, 200, 1256, - 1258, 1331, 200, 200, 784, 1259, 1331, 200, 200, 200, - 1260, 200, 200, 1262, 785, 1261, 200, 1263, 786, 200, - 783, 200, 787, 200, 200, 200, 200, 1264, 200, 1331, - 200, 784, 1265, 200, 1331, 200, 1331, 1331, 200, 200, - 1262, 785, 1213, 1213, 1263, 786, 200, 1266, 1267, 787, - 200, 200, 200, 200, 1264, 200, 788, 200, 1283, 1265, - - 200, 200, 200, 200, 200, 200, 200, 886, 200, 1284, - 887, 200, 1285, 200, 1266, 1267, 200, 200, 1331, 200, - 1257, 1331, 200, 788, 200, 1283, 200, 1331, 200, 200, - 200, 200, 200, 200, 886, 200, 1284, 887, 200, 1285, - 200, 200, 888, 200, 200, 200, 892, 1257, 200, 200, - 200, 200, 1286, 200, 200, 1289, 200, 890, 200, 200, - 891, 889, 1282, 1282, 200, 200, 200, 1331, 200, 888, - 200, 200, 200, 892, 1331, 200, 1331, 200, 200, 1286, - 1331, 200, 1289, 200, 890, 200, 1295, 891, 889, 1296, - 1331, 200, 200, 200, 200, 894, 893, 200, 200, 200, - - 1331, 200, 200, 895, 1294, 200, 200, 200, 200, 1331, - 1331, 200, 1299, 1295, 1331, 200, 1296, 200, 200, 1331, - 1331, 200, 894, 893, 1331, 200, 200, 200, 200, 200, - 895, 1294, 200, 200, 200, 200, 200, 200, 200, 1299, - 200, 200, 200, 1302, 200, 200, 200, 200, 1331, 1304, - 1331, 896, 1306, 1308, 200, 200, 200, 200, 1331, 200, - 1235, 1213, 1331, 200, 200, 200, 1331, 200, 200, 1310, - 1302, 1331, 1331, 200, 200, 200, 1304, 200, 896, 1306, - 1308, 200, 200, 200, 200, 897, 200, 200, 1312, 200, - 200, 200, 200, 898, 200, 200, 1310, 200, 1270, 200, - - 200, 200, 200, 899, 200, 1314, 1331, 1331, 200, 200, - 200, 200, 897, 1331, 200, 1312, 200, 200, 200, 200, - 898, 200, 200, 200, 200, 1270, 200, 200, 200, 200, - 899, 1316, 1314, 200, 900, 200, 200, 200, 200, 200, - 901, 1318, 1331, 902, 200, 200, 200, 200, 200, 1331, - 200, 1331, 1331, 200, 200, 1320, 200, 1322, 1316, 903, - 200, 900, 200, 200, 200, 1331, 200, 901, 1318, 200, - 902, 200, 200, 200, 200, 200, 904, 1331, 200, 200, - 200, 200, 1320, 200, 1322, 1324, 903, 1331, 200, 200, - 200, 200, 200, 905, 200, 1331, 200, 1288, 1282, 200, - - 200, 1331, 1331, 904, 200, 200, 200, 1331, 1331, 1331, - 200, 1331, 1324, 1331, 1331, 200, 200, 1331, 1331, 200, - 905, 200, 1331, 200, 1331, 200, 200, 1331, 1331, 1331, - 200, 200, 906, 1331, 200, 200, 200, 1331, 1331, 1298, - 1331, 200, 907, 1331, 1331, 1331, 200, 908, 1331, 1331, - 200, 1331, 200, 1331, 1331, 1331, 1331, 200, 200, 906, - 200, 200, 200, 200, 1331, 200, 1298, 1331, 200, 907, - 200, 1331, 1331, 200, 908, 910, 200, 1331, 200, 1331, - 1331, 1331, 909, 200, 200, 200, 200, 200, 200, 1331, - 1331, 200, 200, 1331, 200, 1331, 200, 200, 911, 1331, - - 1331, 1331, 910, 200, 200, 200, 1331, 1331, 1331, 909, - 200, 200, 1331, 200, 200, 200, 1331, 912, 200, 200, - 200, 200, 200, 200, 200, 911, 200, 200, 200, 200, - 919, 200, 200, 200, 200, 1331, 1331, 1331, 200, 1331, - 200, 200, 1331, 1331, 912, 1331, 200, 200, 1331, 200, - 200, 200, 1331, 200, 200, 200, 200, 919, 1331, 200, - 200, 200, 200, 1331, 200, 200, 913, 200, 200, 200, - 200, 1331, 914, 1331, 200, 200, 200, 200, 200, 1331, - 200, 1331, 1331, 200, 1331, 915, 1331, 1331, 200, 200, - 1331, 200, 1331, 913, 1331, 200, 200, 200, 917, 914, - - 1331, 200, 200, 200, 1331, 200, 200, 200, 200, 200, - 200, 200, 915, 200, 916, 200, 200, 1331, 200, 918, - 1331, 200, 1331, 1331, 200, 917, 1331, 1331, 200, 1331, - 200, 1331, 200, 200, 200, 200, 200, 200, 200, 1331, - 200, 916, 200, 200, 200, 200, 918, 1331, 200, 1331, - 200, 200, 200, 1331, 200, 200, 200, 200, 1331, 200, - 200, 200, 921, 1331, 200, 920, 1331, 1331, 1331, 200, - 200, 200, 200, 1331, 922, 1331, 200, 200, 200, 200, - 200, 200, 200, 200, 1331, 1331, 200, 200, 200, 921, - 200, 1331, 920, 1331, 200, 1331, 200, 200, 200, 200, - - 200, 922, 1331, 200, 923, 200, 1331, 200, 200, 200, - 200, 1331, 200, 200, 1331, 200, 1331, 200, 200, 1331, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 1331, - 200, 923, 200, 924, 200, 200, 925, 200, 1331, 200, - 200, 200, 200, 1331, 1331, 200, 200, 200, 1331, 200, - 1331, 200, 1331, 200, 1331, 200, 1331, 200, 1331, 200, - 924, 200, 1331, 925, 200, 1331, 200, 200, 200, 200, - 200, 200, 200, 200, 927, 200, 200, 926, 200, 200, - 1331, 1331, 200, 1331, 200, 200, 1331, 1331, 928, 1331, - 1331, 200, 1331, 200, 200, 200, 1331, 200, 200, 200, - - 1331, 927, 200, 200, 926, 200, 200, 1331, 1331, 200, - 1331, 200, 200, 1331, 1331, 928, 200, 1331, 200, 1331, - 1331, 200, 200, 200, 200, 1331, 200, 200, 929, 200, - 930, 200, 1331, 931, 200, 1331, 200, 1331, 1331, 200, - 1331, 1331, 1331, 200, 1331, 200, 1331, 1331, 1331, 1331, - 200, 200, 1331, 200, 200, 929, 200, 930, 200, 1331, - 931, 200, 1331, 200, 1331, 1331, 200, 932, 200, 934, - 200, 200, 200, 1331, 200, 200, 200, 1331, 933, 200, - 200, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 932, 200, 934, 200, 200, 200, - - 1331, 200, 200, 200, 1331, 933, 200, 200, 200, 1331, - 200, 200, 200, 200, 200, 200, 200, 200, 1331, 1331, - 200, 200, 200, 1331, 1331, 200, 200, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 200, 1331, 200, - 200, 200, 200, 200, 200, 1331, 1331, 200, 200, 200, - 1331, 1331, 200, 200, 200, 1331, 200, 200, 936, 200, - 200, 200, 935, 1331, 200, 200, 200, 1331, 1331, 200, - 200, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 200, 1331, 200, 200, 936, 200, 200, 200, 935, - 937, 200, 200, 200, 200, 200, 200, 200, 938, 200, - - 200, 1331, 200, 941, 200, 200, 200, 200, 200, 200, - 200, 939, 940, 1331, 200, 200, 200, 937, 200, 200, - 1331, 200, 200, 1331, 1331, 938, 200, 200, 1331, 200, - 941, 200, 200, 200, 200, 200, 200, 200, 939, 940, - 200, 200, 200, 200, 943, 200, 200, 200, 200, 200, - 200, 1331, 200, 942, 200, 1331, 1331, 1331, 200, 200, - 200, 1331, 1331, 1331, 1331, 1331, 1331, 200, 200, 1331, - 1331, 943, 1331, 1331, 200, 200, 200, 200, 1331, 200, - 942, 200, 944, 1331, 200, 200, 200, 200, 200, 1331, - 1331, 1331, 945, 200, 200, 200, 200, 200, 1331, 1331, - - 1331, 1331, 200, 200, 200, 1331, 946, 1331, 1331, 944, - 1331, 200, 200, 200, 1331, 200, 1331, 1331, 1331, 945, - 200, 200, 200, 200, 200, 1331, 200, 1331, 1331, 200, - 200, 200, 200, 946, 200, 947, 1331, 200, 200, 200, - 200, 200, 200, 1331, 200, 948, 200, 200, 1331, 200, - 949, 1331, 1331, 200, 200, 1331, 200, 200, 1331, 200, - 1331, 200, 947, 1331, 200, 200, 200, 1331, 200, 200, - 1331, 200, 948, 200, 200, 200, 950, 949, 1331, 200, - 200, 200, 1331, 200, 200, 200, 200, 1331, 1331, 1331, - 951, 1331, 1331, 200, 200, 200, 200, 1331, 200, 1331, - - 1331, 1331, 200, 950, 200, 1331, 200, 200, 1331, 1331, - 1331, 1331, 200, 200, 200, 1331, 952, 951, 1331, 1331, - 200, 200, 200, 200, 200, 200, 1331, 1331, 953, 200, - 200, 200, 200, 200, 1331, 1331, 1331, 1331, 200, 200, - 200, 200, 200, 952, 1331, 1331, 200, 200, 200, 200, - 954, 200, 200, 1331, 1331, 953, 200, 200, 1331, 200, - 200, 1331, 200, 1331, 1331, 200, 200, 200, 200, 200, - 200, 1331, 200, 200, 200, 200, 200, 954, 200, 200, - 200, 955, 200, 1331, 1331, 956, 200, 1331, 200, 200, - 200, 957, 200, 1331, 200, 200, 1331, 200, 200, 200, - - 1331, 200, 200, 1331, 200, 200, 1331, 200, 955, 200, - 1331, 1331, 956, 200, 200, 200, 200, 200, 957, 200, - 200, 200, 1331, 960, 958, 200, 200, 1331, 200, 200, - 959, 200, 200, 1331, 200, 200, 200, 1331, 961, 200, - 200, 200, 200, 200, 200, 1331, 1331, 200, 200, 1331, - 960, 958, 1331, 200, 1331, 200, 1331, 959, 200, 200, - 200, 200, 200, 200, 200, 961, 200, 200, 200, 200, - 200, 200, 200, 963, 962, 200, 200, 200, 200, 1331, - 200, 200, 1331, 200, 1331, 200, 200, 200, 200, 1331, - 1331, 200, 200, 200, 1331, 200, 964, 200, 1331, 200, - - 963, 962, 200, 200, 200, 200, 1331, 200, 200, 1331, - 200, 1331, 200, 200, 965, 200, 1331, 200, 200, 200, - 200, 200, 200, 964, 200, 1331, 200, 966, 1331, 200, - 1331, 200, 200, 200, 200, 1331, 200, 200, 967, 200, - 200, 965, 200, 200, 200, 200, 200, 1331, 200, 200, - 200, 200, 200, 200, 966, 1331, 200, 968, 200, 200, - 200, 200, 200, 200, 200, 967, 1331, 200, 1331, 200, - 200, 969, 1331, 200, 200, 1331, 200, 200, 1331, 200, - 200, 200, 200, 200, 968, 1331, 200, 200, 200, 200, - 200, 1331, 200, 1331, 1331, 200, 1331, 970, 969, 1331, - - 200, 200, 1331, 200, 200, 1331, 971, 200, 200, 200, - 1331, 200, 1331, 200, 200, 200, 200, 200, 1331, 200, - 1331, 1331, 200, 200, 970, 200, 973, 200, 1331, 1331, - 200, 200, 972, 971, 200, 200, 200, 200, 200, 200, - 1331, 200, 974, 200, 200, 1331, 200, 1331, 1331, 200, - 200, 1331, 200, 973, 1331, 1331, 1331, 200, 1331, 972, - 975, 200, 200, 200, 200, 200, 200, 200, 200, 974, - 976, 200, 200, 200, 200, 200, 200, 200, 977, 200, - 200, 1331, 1331, 1331, 1331, 200, 1331, 975, 1331, 1331, - 200, 1331, 200, 1331, 200, 200, 1331, 976, 1331, 200, - - 1331, 200, 200, 1331, 200, 977, 200, 200, 1331, 200, - 200, 200, 200, 200, 200, 200, 1331, 200, 1331, 200, - 200, 200, 200, 979, 200, 1331, 978, 200, 200, 200, - 200, 200, 1331, 200, 200, 1331, 200, 200, 200, 1331, - 200, 200, 200, 200, 200, 1331, 200, 200, 200, 1331, - 979, 200, 1331, 978, 200, 200, 200, 200, 200, 1331, - 200, 200, 200, 1331, 200, 200, 200, 200, 200, 980, - 200, 200, 200, 200, 200, 1331, 1331, 200, 200, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 200, - 1331, 200, 200, 200, 200, 200, 980, 1331, 1331, 200, - - 200, 200, 1331, 1331, 200, 200, 200, 200, 200, 200, - 1331, 1055, 200, 200, 200, 200, 200, 1331, 200, 200, - 1054, 200, 200, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 200, 200, 200, 200, 200, 200, 1331, 1055, 200, - 200, 200, 200, 200, 1331, 200, 200, 1054, 200, 200, - 1056, 200, 1331, 1331, 200, 200, 1331, 1331, 200, 200, - 200, 200, 1331, 1059, 200, 1058, 1057, 1331, 200, 200, - 200, 200, 1331, 200, 200, 1331, 1331, 1056, 200, 200, - 1331, 200, 200, 1331, 200, 1331, 1331, 200, 200, 200, - 1059, 200, 1058, 1057, 1331, 200, 200, 200, 200, 1331, - - 200, 200, 1060, 200, 200, 1061, 200, 1331, 200, 1331, - 200, 200, 1331, 1331, 200, 200, 200, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 200, 1331, 200, 1331, 200, 1060, - 200, 200, 1061, 200, 1062, 200, 200, 200, 200, 1064, - 200, 200, 200, 200, 200, 200, 1063, 1065, 200, 200, - 1331, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 1062, 1066, 200, 200, 200, 1064, 200, 200, 1331, - 200, 200, 200, 1063, 1065, 200, 200, 1331, 200, 200, - 1331, 200, 1331, 200, 200, 200, 200, 1331, 200, 1066, - 1331, 200, 200, 1068, 1331, 200, 1070, 200, 1067, 1331, - - 200, 200, 1069, 1331, 200, 200, 200, 200, 200, 200, - 1331, 1331, 1331, 1331, 200, 200, 200, 200, 1331, 200, - 1068, 1331, 200, 1070, 200, 1067, 200, 200, 200, 1069, - 1331, 200, 200, 200, 200, 200, 200, 1331, 1331, 1331, - 1331, 200, 200, 200, 200, 1331, 200, 200, 1331, 200, - 1071, 200, 1331, 200, 1331, 1331, 200, 200, 200, 200, - 1073, 1331, 1072, 1331, 1331, 200, 200, 200, 1331, 200, - 200, 1074, 1331, 200, 200, 200, 1075, 1071, 200, 1331, - 200, 200, 1331, 200, 200, 200, 200, 1073, 1331, 1072, - 1331, 200, 200, 200, 200, 200, 200, 200, 1074, 200, - - 1331, 1331, 200, 1075, 200, 200, 200, 200, 200, 1331, - 1076, 1078, 1331, 200, 1331, 200, 200, 1331, 200, 1331, - 200, 1331, 200, 200, 200, 1331, 200, 1331, 1331, 1331, - 200, 200, 200, 200, 1331, 1077, 1331, 1076, 1078, 1331, - 200, 1331, 200, 200, 200, 1331, 1331, 200, 1079, 200, - 1331, 200, 1331, 200, 200, 1331, 1331, 200, 1083, 200, - 200, 1331, 1077, 1331, 200, 200, 1080, 200, 200, 200, - 200, 200, 200, 1331, 1331, 1079, 200, 1331, 200, 1331, - 200, 200, 1331, 1331, 1331, 1083, 200, 200, 200, 1331, - 200, 200, 200, 1080, 200, 200, 200, 200, 200, 200, - - 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 200, 1331, - 200, 1331, 1331, 1331, 1331, 200, 1081, 200, 200, 1331, - 1331, 200, 1331, 1331, 200, 200, 1331, 200, 200, 200, - 1331, 1331, 1331, 1331, 200, 200, 1331, 200, 1331, 1082, - 200, 1085, 200, 1081, 200, 200, 200, 1084, 200, 1331, - 1331, 200, 200, 200, 1331, 200, 1331, 1331, 200, 1331, - 1331, 200, 1331, 1331, 1331, 1331, 1082, 200, 1085, 200, - 200, 200, 200, 200, 1084, 200, 200, 200, 200, 200, - 200, 1331, 200, 200, 200, 200, 200, 1331, 200, 1331, - 1331, 200, 1086, 1331, 1331, 1331, 200, 200, 1331, 200, - - 200, 1331, 200, 200, 200, 200, 1331, 200, 1331, 200, - 200, 200, 200, 200, 200, 200, 200, 1331, 200, 1086, - 1331, 200, 1331, 200, 1331, 1331, 200, 200, 200, 200, - 200, 1331, 1331, 1331, 200, 200, 1087, 1331, 1331, 200, - 200, 200, 200, 200, 200, 1331, 1088, 1331, 200, 1089, - 200, 1331, 1090, 200, 200, 200, 200, 200, 1091, 1331, - 200, 1331, 200, 1087, 1331, 200, 200, 200, 1331, 200, - 200, 200, 1331, 1088, 1331, 1331, 1089, 200, 1331, 1090, - 1331, 200, 200, 200, 200, 1091, 1331, 200, 200, 200, - 200, 1331, 200, 200, 200, 200, 1331, 200, 1092, 1331, - - 200, 1331, 1331, 1331, 1331, 1331, 200, 1331, 200, 200, - 1331, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 1331, 200, 200, 1331, 200, 1092, 1331, 200, 1331, 1331, - 200, 1331, 200, 200, 1093, 200, 1331, 200, 200, 200, - 200, 200, 200, 1331, 200, 200, 200, 1331, 200, 1331, - 200, 200, 1331, 1331, 200, 1094, 1331, 200, 1331, 200, - 200, 1093, 1331, 1331, 200, 200, 1331, 1095, 1331, 200, - 1331, 200, 1331, 1331, 1331, 200, 1331, 200, 200, 1331, - 200, 200, 1094, 1331, 200, 200, 200, 200, 1331, 1331, - 200, 200, 1096, 1097, 1095, 1331, 200, 200, 1331, 200, - - 1331, 1331, 1331, 1331, 200, 200, 1331, 200, 1331, 200, - 1331, 200, 200, 200, 1331, 1331, 1331, 200, 200, 1096, - 1097, 1331, 1331, 200, 200, 200, 200, 200, 200, 1331, - 200, 200, 200, 1098, 1331, 200, 200, 200, 1099, 200, - 200, 200, 200, 1331, 1331, 1331, 200, 1331, 200, 1331, - 1331, 200, 200, 1331, 200, 200, 1331, 200, 200, 200, - 1098, 1331, 200, 1331, 200, 1099, 200, 200, 200, 200, - 1331, 1331, 200, 200, 1331, 200, 200, 1331, 200, 1101, - 200, 1331, 200, 1331, 200, 200, 1331, 1100, 1331, 1331, - 200, 1331, 200, 1331, 1331, 1331, 1331, 1331, 1331, 200, - - 200, 1331, 1331, 200, 1331, 1331, 1101, 200, 200, 200, - 1331, 200, 200, 1331, 1100, 1331, 200, 200, 200, 200, - 200, 1102, 1331, 1331, 1331, 1331, 200, 200, 200, 1103, - 200, 1331, 1331, 1331, 200, 200, 200, 1331, 1331, 200, - 200, 1331, 1104, 200, 1331, 200, 200, 200, 1102, 1331, - 200, 1331, 200, 200, 200, 200, 1103, 200, 1105, 1331, - 1331, 200, 200, 200, 200, 1331, 200, 200, 1331, 1104, - 200, 1331, 1331, 200, 200, 1331, 200, 200, 1331, 200, - 1106, 200, 1331, 1331, 200, 1105, 200, 1331, 200, 200, - 1331, 200, 1107, 200, 200, 1331, 200, 200, 200, 1331, - - 200, 200, 200, 200, 200, 1331, 200, 1106, 200, 1108, - 200, 200, 1331, 200, 200, 200, 200, 1331, 200, 1107, - 200, 200, 200, 200, 200, 200, 1110, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 1108, 200, 1331, 1109, - 1331, 200, 200, 200, 200, 200, 1331, 200, 1331, 200, - 1112, 200, 1331, 1110, 200, 200, 1331, 200, 200, 200, - 1331, 200, 1111, 200, 200, 1331, 1109, 200, 200, 200, - 200, 200, 1331, 200, 200, 1113, 1331, 1112, 1331, 1331, - 200, 200, 1331, 200, 1331, 200, 200, 1331, 200, 1111, - 200, 200, 1114, 200, 200, 200, 1331, 200, 200, 1331, - - 200, 200, 1113, 1331, 200, 1331, 200, 200, 1331, 1331, - 200, 200, 1115, 200, 1331, 200, 200, 1116, 1331, 1114, - 200, 1331, 1331, 1117, 1331, 200, 1331, 1331, 200, 1331, - 200, 200, 1331, 200, 200, 200, 200, 1331, 200, 1115, - 200, 200, 1331, 200, 1116, 1331, 200, 200, 1331, 1118, - 1117, 1331, 1331, 1331, 200, 200, 1331, 200, 200, 200, - 200, 200, 200, 200, 1331, 200, 1331, 200, 200, 1331, - 200, 1331, 1331, 200, 200, 1331, 1118, 1331, 1119, 1120, - 200, 200, 200, 1331, 200, 200, 200, 200, 200, 1331, - 200, 1331, 200, 1331, 1331, 1331, 1331, 200, 200, 1331, - - 200, 1331, 1331, 1331, 1121, 1119, 1120, 200, 200, 200, - 1331, 200, 200, 1331, 200, 200, 200, 200, 1331, 1331, - 1331, 200, 200, 200, 200, 200, 1331, 200, 1122, 1123, - 1331, 1121, 200, 200, 1331, 200, 1331, 1331, 1331, 200, - 200, 200, 200, 200, 1331, 1331, 1331, 200, 200, 200, - 200, 200, 200, 1124, 1331, 1122, 1123, 1331, 1331, 200, - 200, 200, 1331, 200, 200, 1331, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 1331, 200, 200, 1331, 200, - 1124, 1331, 200, 1331, 1331, 1331, 1331, 1331, 200, 1331, - 200, 200, 1169, 200, 1331, 200, 200, 200, 200, 200, - - 200, 200, 200, 200, 200, 200, 200, 1331, 1170, 200, - 1172, 200, 200, 200, 200, 200, 1331, 200, 200, 1169, - 200, 200, 200, 200, 200, 1331, 1171, 200, 200, 200, - 200, 200, 200, 200, 1331, 1170, 200, 1172, 200, 200, - 200, 200, 200, 1331, 200, 200, 200, 200, 200, 200, - 200, 200, 1331, 1171, 200, 1331, 200, 200, 200, 1331, - 200, 1173, 200, 200, 1331, 1331, 200, 1174, 200, 1175, - 200, 200, 200, 200, 1331, 200, 200, 200, 1331, 1331, - 200, 200, 1331, 200, 1331, 1331, 1331, 200, 1173, 200, - 1331, 1331, 1331, 200, 1174, 200, 1175, 200, 200, 200, - - 1331, 1331, 200, 200, 200, 1331, 200, 200, 200, 1331, - 200, 200, 200, 200, 1177, 200, 200, 200, 1176, 1331, - 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, - 1331, 200, 1331, 200, 1331, 1331, 1331, 200, 200, 200, - 200, 1177, 200, 200, 200, 1176, 1178, 200, 1331, 200, - 1331, 1179, 200, 200, 1331, 200, 1331, 200, 200, 1331, - 1331, 1331, 200, 200, 200, 1331, 200, 200, 1331, 1331, - 1331, 200, 1180, 1178, 1331, 1331, 200, 1331, 1179, 1331, - 200, 1331, 200, 1331, 200, 200, 1331, 1331, 1331, 200, - 200, 200, 1331, 200, 200, 200, 1181, 200, 200, 1180, - - 1331, 1331, 200, 200, 1331, 1331, 200, 200, 200, 200, - 1331, 200, 1331, 200, 1331, 1331, 200, 1331, 200, 1331, - 1331, 200, 200, 1181, 200, 1331, 1331, 1331, 1182, 200, - 1331, 1331, 1331, 200, 200, 200, 200, 200, 200, 200, - 200, 1331, 1331, 200, 200, 200, 1331, 1331, 200, 200, - 200, 200, 200, 200, 1331, 1182, 1331, 200, 200, 1331, - 1331, 1331, 200, 200, 200, 1331, 200, 1331, 1331, 1331, - 1331, 200, 1331, 1331, 1331, 1331, 200, 200, 200, 200, - 200, 200, 1183, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 1331, 1184, 200, 1331, 1331, - - 1331, 200, 200, 1331, 1331, 1331, 200, 200, 200, 1183, - 200, 1331, 1331, 200, 200, 200, 1331, 1331, 200, 200, - 200, 200, 1331, 1184, 200, 1331, 1331, 1331, 200, 200, - 200, 200, 200, 200, 200, 1186, 200, 200, 1185, 1331, - 200, 200, 200, 1331, 1331, 1331, 200, 1331, 1331, 1331, - 200, 200, 1331, 1331, 200, 1331, 200, 200, 200, 200, - 200, 1331, 1186, 200, 200, 1185, 1331, 200, 200, 200, - 200, 1331, 200, 200, 1331, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 1331, 200, 1331, 1331, - 200, 1331, 200, 1331, 200, 200, 1331, 200, 200, 200, - - 200, 1331, 200, 200, 200, 1331, 200, 200, 1331, 200, - 1331, 200, 200, 1331, 200, 1331, 200, 200, 1331, 200, - 200, 200, 200, 1331, 1188, 200, 200, 200, 200, 1187, - 1331, 200, 1331, 1331, 200, 1331, 200, 1331, 1189, 1331, - 1331, 200, 200, 200, 200, 1331, 200, 200, 1331, 1331, - 200, 1188, 200, 200, 200, 200, 1187, 1331, 1331, 1331, - 200, 200, 200, 200, 200, 1189, 1331, 1331, 200, 200, - 200, 200, 1331, 200, 200, 1331, 200, 200, 200, 200, - 1331, 200, 1331, 1190, 200, 1331, 1331, 200, 200, 200, - 1331, 200, 200, 1331, 200, 200, 1331, 200, 1331, 200, - - 1191, 200, 200, 200, 200, 200, 200, 200, 200, 1331, - 1190, 200, 200, 200, 1331, 200, 1331, 1331, 200, 200, - 1331, 200, 1331, 1331, 1331, 1192, 200, 1191, 1331, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 1331, 200, 200, 1331, 200, 1331, 1331, 200, 1331, - 1331, 1331, 1192, 1331, 200, 1331, 200, 200, 1331, 200, - 1331, 200, 1193, 200, 200, 200, 200, 200, 1331, 200, - 200, 1194, 200, 1331, 1331, 200, 1195, 200, 1331, 1331, - 1196, 200, 200, 200, 200, 1331, 1331, 200, 200, 1193, - 200, 1331, 200, 200, 200, 1331, 1331, 1331, 1194, 200, - - 200, 1331, 200, 1195, 200, 1331, 200, 1196, 1331, 200, - 1331, 200, 200, 1331, 200, 1331, 200, 200, 1331, 200, - 200, 1331, 1197, 1331, 1331, 1331, 200, 200, 1198, 200, - 200, 1331, 1331, 200, 200, 1331, 200, 1331, 1331, 200, - 200, 1331, 1199, 200, 200, 1331, 1331, 200, 200, 1197, - 200, 1331, 1331, 200, 200, 1198, 1331, 200, 200, 1331, - 200, 200, 1331, 200, 200, 1200, 200, 200, 200, 1199, - 200, 200, 200, 1201, 200, 200, 1331, 200, 200, 200, - 1331, 200, 1331, 1331, 200, 200, 1331, 200, 1331, 1331, - 1331, 200, 1200, 200, 1331, 200, 200, 200, 1202, 200, - - 1201, 200, 200, 200, 200, 200, 200, 1331, 200, 200, - 1203, 200, 200, 1331, 200, 1331, 1331, 200, 1331, 1331, - 1331, 1331, 200, 200, 1331, 1202, 200, 1331, 200, 200, - 200, 200, 1331, 200, 1204, 200, 200, 1203, 200, 200, - 1331, 200, 1331, 1331, 200, 200, 1234, 200, 1331, 200, - 200, 1331, 200, 200, 1331, 200, 200, 200, 1205, 1206, - 200, 1204, 1331, 1331, 1331, 200, 200, 1331, 200, 200, - 200, 200, 200, 1234, 200, 200, 200, 200, 1331, 200, - 200, 200, 1331, 200, 200, 1205, 1206, 1331, 1331, 1331, - 1331, 1331, 200, 200, 200, 200, 200, 200, 200, 200, - - 1207, 1331, 200, 200, 200, 1208, 1331, 200, 200, 1331, - 200, 1331, 200, 200, 1331, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 1331, 200, 200, 1207, 200, 1331, - 1331, 200, 1208, 1331, 200, 1331, 200, 200, 1331, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 1331, 200, - 200, 1331, 200, 1331, 1331, 200, 1331, 200, 1331, 200, - 200, 200, 200, 200, 200, 1331, 1209, 200, 200, 200, - 1331, 1331, 200, 200, 1331, 1331, 1210, 1331, 200, 1331, - 1331, 1331, 1331, 200, 200, 1331, 200, 200, 200, 200, - 200, 200, 200, 1209, 200, 1331, 200, 200, 1331, 200, - - 1331, 1331, 200, 1210, 200, 200, 200, 1331, 1331, 1331, - 200, 200, 1331, 1331, 1331, 200, 200, 200, 200, 200, - 200, 1331, 1331, 1331, 200, 200, 1331, 1331, 1331, 200, - 200, 200, 200, 200, 200, 1331, 200, 1331, 200, 200, - 200, 1331, 1331, 200, 200, 200, 200, 200, 1331, 1331, - 200, 1331, 200, 1331, 200, 1331, 200, 200, 1331, 200, - 200, 200, 1331, 200, 1235, 1213, 200, 200, 1331, 1331, - 200, 200, 1331, 200, 1236, 1331, 1331, 200, 200, 1331, - 1331, 200, 1331, 200, 200, 1331, 1331, 200, 1237, 200, - 1331, 1331, 200, 200, 200, 1331, 200, 200, 1331, 200, - - 1331, 1236, 200, 1331, 200, 200, 1331, 1331, 200, 200, - 1331, 200, 200, 1331, 200, 1237, 200, 1331, 200, 200, - 200, 200, 200, 200, 200, 1331, 200, 1331, 200, 200, - 1238, 200, 1331, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 1331, 200, 200, 1331, 1239, 200, - 200, 200, 200, 200, 1331, 200, 1331, 1238, 1331, 1331, - 200, 200, 200, 1331, 200, 200, 1331, 200, 200, 200, - 200, 1331, 200, 200, 1331, 1239, 1331, 200, 200, 200, - 200, 200, 1331, 1331, 1331, 200, 1331, 1331, 200, 200, - 200, 200, 1240, 1331, 1331, 200, 1331, 200, 1331, 200, - - 1331, 200, 200, 1331, 200, 200, 200, 1331, 200, 1331, - 1331, 200, 200, 1331, 1241, 200, 200, 200, 200, 1240, - 1242, 1331, 200, 200, 200, 200, 1331, 200, 200, 200, - 200, 200, 200, 200, 1331, 200, 1331, 1331, 200, 1331, - 1331, 1241, 1331, 200, 200, 1331, 200, 1242, 1331, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 1331, 200, - 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, - 1331, 200, 1331, 200, 1331, 1331, 1331, 1331, 200, 200, - 200, 200, 200, 200, 1244, 1243, 200, 200, 200, 200, - 1331, 200, 200, 200, 200, 200, 1331, 1246, 200, 1245, - - 200, 1331, 200, 1331, 200, 200, 200, 200, 200, 200, - 200, 1244, 1243, 200, 1331, 200, 200, 1331, 200, 1331, - 200, 200, 200, 1331, 1246, 200, 1245, 200, 200, 200, - 200, 200, 200, 1331, 200, 200, 200, 200, 1331, 200, - 200, 200, 1331, 1331, 1331, 1331, 200, 1247, 1331, 1331, - 1331, 200, 200, 1331, 200, 200, 1331, 200, 1331, 200, - 1331, 1331, 200, 1331, 200, 1331, 200, 200, 200, 1248, - 200, 1331, 200, 200, 1247, 1331, 1331, 200, 200, 200, - 1331, 200, 200, 200, 1331, 200, 200, 1331, 1331, 1331, - 200, 200, 1331, 1331, 1331, 200, 1248, 200, 1331, 200, - - 1331, 1331, 1331, 1331, 200, 1331, 200, 1331, 200, 200, - 200, 1331, 200, 200, 1249, 1331, 1331, 200, 200, 200, - 1331, 200, 200, 1331, 1331, 1331, 200, 200, 1251, 200, - 200, 200, 200, 200, 200, 200, 1250, 200, 1331, 200, - 200, 1249, 200, 1331, 1331, 200, 200, 1331, 200, 1331, - 1331, 1331, 1331, 200, 200, 1251, 200, 200, 200, 200, - 200, 200, 200, 1250, 200, 1331, 200, 200, 1252, 200, - 1253, 1254, 200, 200, 200, 200, 1331, 200, 1331, 1331, - 200, 200, 1331, 200, 1331, 1331, 1331, 200, 1331, 200, - 200, 200, 1331, 200, 200, 1252, 1331, 1253, 1254, 200, - - 200, 200, 200, 1331, 200, 200, 1331, 200, 200, 200, - 200, 1331, 1331, 1331, 1331, 200, 1331, 200, 200, 200, - 200, 1331, 1331, 200, 200, 200, 1331, 1331, 200, 200, - 1331, 1331, 200, 1331, 200, 1331, 200, 1269, 1331, 200, - 1331, 1331, 200, 200, 200, 1331, 200, 200, 1331, 1331, - 200, 200, 200, 200, 1331, 200, 200, 1331, 1271, 1331, - 1331, 200, 1331, 200, 1269, 1331, 200, 1331, 200, 200, - 200, 200, 200, 200, 200, 1331, 1331, 1331, 200, 200, - 200, 1331, 200, 200, 1272, 1271, 200, 200, 200, 200, - 200, 1331, 200, 200, 1331, 200, 200, 200, 1273, 200, - - 200, 200, 200, 200, 1331, 200, 200, 200, 1331, 200, - 200, 1272, 1331, 200, 200, 200, 200, 200, 1331, 200, - 200, 1331, 200, 200, 200, 1273, 200, 200, 200, 200, - 200, 1331, 200, 200, 200, 1331, 1274, 1331, 1331, 200, - 1276, 1275, 200, 200, 200, 200, 200, 200, 1331, 200, - 200, 200, 200, 200, 200, 1331, 1331, 200, 1331, 200, - 200, 1331, 1331, 1274, 1331, 1331, 200, 1276, 1275, 200, - 200, 1331, 200, 200, 200, 200, 1331, 200, 200, 200, - 1331, 200, 200, 200, 200, 1331, 1331, 200, 200, 200, - 1331, 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 1331, - - 1331, 200, 200, 1331, 200, 1331, 1331, 200, 200, 200, - 200, 200, 1331, 1331, 200, 200, 200, 200, 200, 1331, - 200, 200, 1331, 200, 1331, 200, 200, 1277, 200, 200, - 1279, 200, 1278, 200, 200, 1331, 200, 1331, 200, 200, - 1331, 200, 1331, 1331, 200, 1331, 200, 1331, 200, 200, - 1280, 200, 200, 200, 1277, 200, 200, 1279, 200, 1278, - 200, 200, 1331, 200, 1288, 1282, 200, 1331, 200, 1331, - 1290, 200, 1331, 200, 200, 200, 200, 1280, 200, 200, - 200, 1331, 200, 1331, 200, 200, 200, 1331, 200, 200, - 200, 1291, 1331, 200, 1331, 200, 200, 1290, 200, 200, - - 1331, 200, 200, 200, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 200, 200, 200, 200, 200, 1291, 1331, - 200, 1331, 200, 200, 200, 1331, 200, 200, 1331, 200, - 200, 200, 200, 1331, 200, 200, 200, 200, 200, 200, - 200, 200, 200, 1331, 1331, 200, 200, 1331, 200, 1331, - 200, 200, 1331, 200, 200, 1331, 200, 1331, 200, 200, - 1331, 200, 1331, 200, 200, 200, 200, 200, 200, 1292, - 1331, 1331, 200, 200, 200, 200, 1331, 200, 200, 200, - 200, 1331, 200, 200, 200, 200, 200, 200, 200, 1331, - 200, 200, 200, 200, 1300, 200, 1292, 1331, 200, 200, - - 200, 200, 200, 200, 200, 200, 200, 200, 1331, 200, - 200, 200, 200, 1331, 200, 200, 1331, 1331, 1331, 200, - 200, 1300, 1331, 1331, 1331, 200, 200, 200, 1331, 200, - 200, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, 200, - 46, 46, 46, 46, 46, 88, 1331, 1331, 88, 88, - 185, 185, 185, 1331, 185, 187, 1331, 187, 187, 187, - 190, 1331, 190, 190, 190, 200, 1331, 200, 200, 200, - 7, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331 - } ; + { 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 37, 44, 37, 8, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 37, 44, 37, 45, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 57, 58, 59, 60, 61, 62, + + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 77, 84, 77, 48, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 77, 84, + 77, 85, 86, 86, 86, 86, 89, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 91, 90, 92, 93, + 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, + 95, 99, 105, 100, 129, 131, 106, 109, 139, 101, + 130, 102, 107, 132, 110, 103, 104, 140, 176, 133, + + 177, 111, 108, 178, 112, 98, 183, 113, 99, 105, + 100, 129, 131, 106, 109, 139, 101, 130, 102, 107, + 132, 110, 103, 104, 140, 176, 133, 177, 111, 108, + 178, 112, 114, 183, 113, 119, 115, 120, 188, 86, + 116, 141, 121, 290, 144, 142, 117, 122, 145, 118, + 191, 143, 86, 86, 146, 181, 182, 196, 197, 114, + 1330, 192, 119, 115, 120, 1329, 147, 116, 141, 121, + 290, 144, 142, 117, 122, 145, 118, 123, 143, 156, + 148, 146, 181, 182, 291, 124, 149, 150, 125, 296, + 157, 126, 134, 147, 127, 1328, 158, 128, 135, 136, + + 137, 179, 86, 86, 123, 138, 156, 148, 1327, 180, + 1326, 291, 124, 149, 150, 125, 296, 157, 126, 134, + 1325, 127, 151, 158, 128, 135, 136, 137, 179, 297, + 152, 159, 138, 292, 153, 160, 180, 154, 155, 161, + 200, 293, 278, 301, 279, 162, 1323, 280, 1321, 151, + 294, 1319, 200, 295, 1317, 302, 297, 152, 159, 1315, + 292, 153, 160, 1313, 154, 155, 161, 200, 293, 278, + 301, 279, 162, 163, 280, 164, 305, 294, 165, 200, + 295, 166, 302, 167, 312, 168, 169, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 188, 86, 1311, + + 163, 1309, 164, 305, 1307, 165, 298, 299, 166, 303, + 167, 312, 168, 169, 170, 310, 304, 231, 171, 200, + 300, 172, 173, 232, 200, 311, 320, 321, 174, 200, + 322, 175, 1305, 298, 299, 1303, 303, 1213, 1213, 1282, + 1282, 170, 310, 304, 231, 171, 200, 300, 172, 173, + 232, 200, 311, 320, 321, 174, 200, 322, 175, 194, + 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 187, 187, 323, 187, 187, 187, 187, 187, 187, 324, + 233, 313, 1301, 1297, 200, 1293, 314, 325, 234, 187, + 187, 187, 200, 326, 235, 201, 200, 202, 332, 323, + + 333, 334, 241, 203, 200, 204, 324, 233, 313, 205, + 206, 200, 200, 314, 325, 234, 337, 338, 1287, 200, + 326, 235, 201, 200, 202, 332, 1281, 333, 334, 241, + 203, 200, 204, 1268, 339, 1255, 205, 206, 1233, 200, + 1211, 1168, 1125, 337, 338, 187, 187, 187, 1053, 187, + 187, 187, 187, 187, 187, 981, 885, 340, 242, 243, + 246, 339, 200, 244, 247, 187, 187, 187, 200, 245, + 248, 341, 207, 200, 342, 335, 208, 200, 200, 200, + 200, 336, 209, 200, 340, 242, 243, 246, 343, 200, + 244, 247, 210, 200, 789, 200, 245, 248, 341, 207, + + 200, 342, 335, 208, 200, 200, 200, 200, 336, 209, + 200, 664, 539, 200, 344, 343, 283, 284, 345, 210, + 200, 187, 211, 200, 261, 346, 200, 351, 262, 212, + 200, 352, 263, 200, 353, 354, 213, 360, 264, 214, + 200, 344, 215, 283, 284, 345, 200, 414, 200, 211, + 200, 261, 346, 200, 351, 262, 212, 200, 352, 263, + 200, 353, 354, 213, 360, 264, 214, 413, 288, 215, + 287, 286, 281, 200, 216, 200, 200, 285, 217, 347, + 282, 200, 218, 355, 361, 356, 200, 200, 219, 348, + 362, 220, 363, 366, 349, 350, 200, 200, 200, 281, + + 199, 216, 198, 200, 285, 217, 347, 282, 200, 218, + 355, 361, 356, 200, 200, 219, 348, 362, 220, 363, + 366, 349, 350, 200, 200, 200, 200, 306, 307, 308, + 200, 309, 315, 221, 316, 222, 200, 317, 367, 357, + 223, 358, 368, 318, 369, 224, 200, 187, 364, 370, + 319, 365, 359, 200, 306, 307, 308, 200, 309, 315, + 221, 316, 222, 200, 317, 367, 357, 223, 358, 368, + 318, 369, 224, 200, 225, 364, 370, 319, 365, 359, + 371, 200, 226, 372, 373, 227, 374, 327, 228, 328, + 375, 229, 376, 329, 230, 189, 380, 186, 184, 383, + + 330, 225, 97, 96, 331, 87, 389, 371, 200, 226, + 372, 373, 227, 374, 327, 228, 328, 375, 229, 376, + 329, 230, 236, 380, 377, 381, 383, 330, 237, 238, + 239, 331, 387, 389, 390, 240, 382, 378, 391, 392, + 200, 1331, 379, 47, 393, 47, 388, 396, 1331, 236, + 397, 377, 381, 398, 404, 237, 238, 239, 1331, 387, + 1331, 390, 240, 382, 378, 391, 392, 200, 249, 379, + 384, 393, 394, 388, 396, 200, 399, 397, 405, 385, + 398, 404, 250, 395, 401, 200, 406, 386, 251, 252, + 1331, 402, 407, 1331, 403, 249, 400, 384, 410, 394, + + 411, 412, 200, 399, 1331, 405, 385, 1331, 540, 250, + 395, 401, 200, 406, 386, 251, 252, 200, 402, 407, + 408, 403, 253, 400, 200, 410, 541, 411, 412, 542, + 254, 200, 200, 409, 255, 540, 200, 256, 257, 1331, + 1331, 1331, 200, 543, 200, 1331, 1331, 408, 544, 253, + 1331, 200, 200, 541, 1331, 545, 542, 254, 200, 200, + 409, 255, 546, 200, 256, 257, 258, 416, 200, 200, + 543, 547, 200, 200, 1331, 544, 548, 259, 200, 200, + 200, 200, 545, 260, 549, 200, 200, 1331, 200, 546, + 553, 200, 1331, 258, 416, 200, 417, 1331, 547, 200, + + 200, 200, 554, 548, 259, 200, 555, 200, 200, 1331, + 260, 549, 200, 200, 265, 200, 266, 553, 200, 267, + 200, 1331, 268, 417, 269, 556, 270, 271, 200, 554, + 557, 558, 559, 555, 560, 561, 200, 1331, 562, 1331, + 1331, 265, 1331, 266, 1331, 1331, 267, 200, 418, 268, + 200, 269, 556, 270, 271, 200, 419, 557, 558, 559, + 200, 560, 561, 200, 272, 562, 200, 200, 273, 200, + 200, 274, 275, 422, 200, 418, 428, 200, 276, 200, + 563, 277, 200, 419, 564, 565, 200, 200, 200, 1331, + 1331, 272, 1331, 200, 200, 273, 200, 200, 274, 275, + + 422, 200, 1331, 428, 1331, 276, 200, 563, 277, 1331, + 1331, 564, 565, 200, 1331, 200, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 289, 289, 289, 289, + 289, 289, 289, 289, 289, 289, 92, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 415, 415, 415, + 415, 415, 415, 415, 415, 415, 415, 194, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 420, 423, + 427, 421, 550, 568, 551, 200, 569, 200, 200, 200, + 200, 200, 200, 570, 1331, 200, 200, 200, 1331, 552, + + 200, 200, 1331, 1331, 1331, 420, 423, 427, 421, 550, + 568, 551, 200, 569, 200, 200, 200, 200, 200, 200, + 570, 200, 200, 200, 200, 200, 552, 200, 200, 424, + 425, 200, 429, 571, 200, 200, 566, 200, 1331, 430, + 1331, 200, 200, 426, 200, 1331, 572, 200, 200, 573, + 1331, 567, 200, 574, 431, 575, 424, 425, 200, 429, + 571, 200, 200, 566, 200, 200, 430, 200, 200, 200, + 426, 200, 200, 572, 200, 1331, 573, 200, 567, 1331, + 574, 431, 575, 436, 1331, 1331, 576, 200, 577, 578, + 1331, 1331, 200, 437, 200, 579, 580, 581, 200, 200, + + 1331, 582, 200, 200, 200, 432, 433, 434, 200, 435, + 436, 438, 200, 576, 200, 577, 578, 200, 200, 583, + 437, 584, 579, 580, 581, 200, 585, 200, 582, 200, + 200, 200, 432, 433, 434, 200, 435, 200, 438, 200, + 586, 587, 439, 588, 200, 200, 583, 440, 584, 589, + 1331, 590, 591, 585, 200, 592, 1331, 593, 200, 1331, + 594, 1331, 1331, 1331, 200, 595, 1331, 586, 587, 439, + 588, 1331, 596, 597, 440, 441, 589, 442, 590, 591, + 443, 600, 592, 200, 593, 200, 444, 594, 200, 446, + 447, 1331, 595, 445, 200, 200, 200, 1331, 200, 596, + + 597, 200, 441, 448, 442, 601, 200, 443, 600, 602, + 200, 1331, 200, 444, 200, 200, 446, 447, 200, 1331, + 445, 200, 200, 200, 449, 200, 1331, 603, 200, 598, + 448, 1331, 601, 200, 200, 200, 602, 200, 451, 599, + 1331, 200, 450, 1331, 604, 200, 200, 200, 200, 1331, + 1331, 449, 605, 200, 603, 1331, 598, 608, 200, 1331, + 609, 200, 200, 610, 200, 451, 599, 452, 611, 450, + 458, 604, 200, 200, 200, 200, 200, 200, 200, 605, + 200, 612, 200, 200, 608, 200, 606, 609, 200, 1331, + 610, 1331, 1331, 613, 452, 611, 607, 458, 614, 200, + + 1331, 1331, 1331, 200, 200, 200, 1331, 615, 612, 200, + 200, 1331, 459, 606, 200, 200, 453, 200, 454, 200, + 613, 200, 455, 607, 200, 614, 616, 460, 200, 456, + 617, 618, 619, 457, 615, 1331, 1331, 200, 200, 459, + 1331, 200, 1331, 453, 200, 454, 200, 622, 200, 455, + 625, 200, 1331, 616, 460, 200, 456, 617, 618, 619, + 457, 461, 200, 200, 200, 200, 200, 462, 200, 464, + 1331, 200, 463, 200, 622, 626, 200, 625, 1331, 623, + 1331, 200, 200, 1331, 1331, 1331, 627, 200, 461, 200, + 200, 200, 624, 200, 462, 200, 464, 465, 200, 463, + + 200, 200, 626, 200, 628, 200, 623, 200, 200, 200, + 200, 466, 200, 627, 200, 629, 630, 467, 200, 624, + 468, 200, 200, 200, 465, 469, 1331, 1331, 200, 1331, + 200, 628, 200, 1331, 200, 200, 1331, 200, 466, 200, + 631, 632, 629, 630, 467, 1331, 633, 468, 200, 200, + 200, 200, 469, 200, 200, 200, 200, 200, 200, 471, + 470, 200, 200, 200, 634, 200, 200, 631, 632, 635, + 620, 1331, 200, 633, 477, 200, 636, 1331, 200, 200, + 200, 200, 200, 200, 200, 200, 471, 470, 200, 621, + 200, 634, 200, 200, 200, 637, 635, 620, 200, 200, + + 638, 477, 200, 636, 200, 472, 200, 1331, 200, 200, + 1331, 200, 478, 200, 200, 1331, 621, 639, 200, 200, + 1331, 200, 637, 1331, 640, 200, 1331, 638, 200, 479, + 1331, 200, 472, 200, 480, 200, 200, 200, 641, 478, + 200, 200, 473, 200, 639, 200, 200, 200, 642, 487, + 200, 640, 474, 200, 200, 200, 479, 475, 476, 200, + 200, 480, 200, 1331, 200, 641, 643, 1331, 1331, 473, + 200, 1331, 1331, 1331, 200, 642, 487, 200, 644, 474, + 200, 200, 1331, 1331, 475, 476, 200, 645, 646, 200, + 200, 647, 1331, 643, 200, 200, 481, 200, 482, 497, + + 200, 486, 200, 200, 650, 644, 1331, 200, 653, 200, + 200, 1331, 654, 1331, 645, 646, 1331, 200, 647, 200, + 1331, 200, 200, 481, 200, 482, 497, 200, 486, 200, + 200, 650, 655, 648, 200, 653, 200, 200, 483, 654, + 484, 200, 649, 488, 656, 651, 200, 652, 200, 200, + 200, 485, 200, 200, 657, 658, 200, 200, 489, 655, + 648, 200, 200, 1331, 659, 483, 1331, 484, 200, 649, + 488, 656, 651, 1331, 652, 200, 200, 200, 485, 200, + 200, 657, 658, 200, 200, 489, 1331, 1331, 200, 200, + 200, 659, 200, 492, 1331, 200, 662, 200, 490, 1331, + + 200, 491, 200, 493, 1331, 200, 200, 660, 200, 663, + 1331, 661, 1331, 200, 200, 1331, 200, 200, 200, 200, + 492, 200, 200, 662, 200, 490, 200, 200, 491, 200, + 493, 494, 200, 200, 660, 200, 663, 200, 661, 200, + 200, 200, 495, 200, 200, 200, 1331, 790, 200, 200, + 200, 1331, 200, 200, 1331, 1331, 791, 200, 494, 792, + 793, 1331, 200, 794, 200, 795, 200, 796, 797, 495, + 798, 200, 799, 200, 790, 200, 200, 200, 200, 200, + 200, 496, 200, 791, 200, 200, 792, 793, 200, 200, + 794, 498, 795, 1331, 796, 797, 1331, 798, 200, 799, + + 200, 800, 200, 1331, 1331, 200, 499, 200, 496, 200, + 200, 801, 200, 802, 200, 200, 803, 804, 498, 500, + 200, 805, 1331, 501, 200, 200, 502, 806, 800, 200, + 200, 200, 807, 499, 808, 1331, 200, 200, 801, 200, + 802, 200, 809, 803, 804, 1331, 500, 200, 805, 503, + 501, 200, 1331, 502, 806, 810, 200, 200, 200, 807, + 200, 808, 504, 200, 1331, 811, 200, 505, 506, 809, + 812, 813, 200, 200, 814, 200, 503, 815, 1331, 507, + 200, 200, 810, 816, 1331, 200, 200, 200, 1331, 504, + 508, 200, 811, 1331, 505, 506, 817, 812, 813, 200, + + 200, 814, 200, 818, 815, 509, 507, 200, 200, 200, + 816, 200, 200, 200, 819, 200, 200, 508, 200, 515, + 513, 200, 1331, 817, 200, 200, 820, 821, 200, 822, + 818, 1331, 509, 1331, 514, 200, 200, 1331, 200, 1331, + 1331, 819, 200, 200, 200, 823, 515, 513, 200, 510, + 1331, 200, 200, 820, 821, 200, 822, 1331, 511, 516, + 200, 514, 200, 200, 200, 200, 512, 200, 200, 1331, + 200, 200, 823, 200, 200, 1331, 510, 517, 824, 1331, + 825, 826, 1331, 200, 200, 511, 516, 200, 827, 828, + 200, 200, 200, 512, 200, 200, 519, 200, 518, 200, + + 200, 200, 200, 200, 517, 824, 200, 825, 826, 200, + 200, 200, 200, 1331, 1331, 827, 828, 522, 829, 200, + 1331, 200, 200, 519, 1331, 518, 200, 200, 1331, 200, + 200, 830, 1331, 200, 1331, 831, 200, 200, 832, 200, + 200, 520, 200, 833, 522, 829, 200, 200, 200, 200, + 1331, 200, 521, 834, 200, 200, 1331, 1331, 830, 523, + 835, 200, 831, 838, 200, 832, 1331, 200, 520, 200, + 833, 200, 1331, 200, 200, 1331, 839, 200, 200, 521, + 834, 840, 200, 200, 524, 525, 523, 835, 200, 841, + 838, 842, 200, 200, 1331, 845, 530, 200, 200, 200, + + 200, 200, 200, 839, 200, 526, 1331, 200, 840, 1331, + 200, 524, 525, 1331, 1331, 846, 841, 200, 842, 200, + 200, 200, 845, 530, 200, 531, 200, 1331, 200, 200, + 847, 200, 526, 527, 200, 848, 200, 1331, 1331, 836, + 528, 200, 846, 529, 200, 849, 200, 532, 200, 200, + 837, 534, 531, 533, 200, 200, 200, 847, 200, 200, + 527, 200, 848, 200, 535, 536, 836, 528, 200, 200, + 529, 200, 849, 200, 532, 200, 200, 837, 534, 1331, + 533, 200, 200, 200, 1331, 200, 200, 1331, 200, 200, + 850, 535, 536, 200, 1331, 851, 200, 538, 200, 200, + + 852, 200, 200, 853, 537, 200, 667, 854, 200, 200, + 855, 200, 200, 200, 843, 844, 200, 850, 200, 856, + 200, 200, 851, 1331, 538, 1331, 200, 852, 200, 1331, + 853, 537, 200, 667, 854, 200, 200, 855, 200, 1331, + 200, 843, 844, 1331, 1331, 200, 856, 1331, 200, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 415, + 415, 415, 415, 415, 415, 415, 415, 415, 415, 200, + 665, 200, 666, 200, 200, 200, 200, 857, 858, 200, + 200, 200, 200, 1331, 859, 860, 1331, 861, 1331, 200, + 200, 200, 200, 1331, 1331, 1331, 200, 665, 200, 666, + + 200, 200, 200, 200, 857, 858, 200, 200, 200, 200, + 668, 859, 860, 200, 861, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 1331, 200, 200, + 200, 1331, 862, 200, 200, 1331, 669, 668, 863, 1331, + 200, 864, 200, 865, 1331, 1331, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 670, 862, + 200, 200, 200, 669, 200, 863, 200, 200, 864, 866, + 865, 672, 200, 200, 200, 1331, 673, 200, 200, 867, + 671, 200, 200, 200, 868, 670, 869, 200, 200, 200, + 674, 200, 200, 200, 200, 870, 866, 200, 672, 200, + + 871, 200, 200, 673, 200, 200, 867, 671, 200, 200, + 200, 868, 200, 869, 200, 200, 1331, 674, 200, 200, + 1331, 678, 870, 1331, 200, 1331, 1331, 871, 200, 200, + 675, 1331, 676, 200, 872, 200, 200, 200, 873, 200, + 874, 1331, 200, 200, 875, 200, 200, 677, 678, 679, + 200, 1331, 200, 200, 680, 200, 200, 675, 200, 676, + 200, 872, 200, 200, 200, 873, 200, 874, 200, 200, + 200, 875, 1331, 200, 677, 1331, 679, 200, 682, 200, + 200, 680, 200, 200, 1331, 200, 200, 1331, 876, 200, + 683, 877, 200, 200, 200, 200, 878, 681, 200, 200, + + 879, 200, 200, 1331, 200, 682, 684, 880, 1331, 200, + 1331, 200, 1331, 200, 200, 876, 881, 683, 877, 200, + 882, 200, 883, 878, 681, 200, 200, 879, 200, 200, + 200, 200, 200, 684, 880, 686, 685, 200, 200, 200, + 884, 200, 200, 881, 200, 200, 200, 882, 982, 883, + 983, 687, 984, 1331, 985, 200, 200, 200, 688, 200, + 200, 986, 686, 685, 200, 200, 200, 884, 1331, 200, + 200, 200, 200, 200, 1331, 982, 200, 983, 687, 984, + 689, 985, 200, 200, 1331, 688, 200, 200, 986, 987, + 690, 691, 200, 988, 200, 200, 200, 200, 200, 1331, + + 989, 200, 990, 200, 200, 991, 692, 689, 1331, 1331, + 992, 200, 1331, 200, 200, 993, 987, 690, 691, 1331, + 988, 200, 200, 200, 693, 200, 200, 989, 200, 990, + 200, 200, 991, 692, 994, 694, 200, 992, 200, 200, + 1331, 200, 993, 1331, 200, 200, 200, 1331, 200, 995, + 996, 693, 997, 200, 200, 200, 1331, 200, 1331, 695, + 1331, 994, 694, 200, 200, 1331, 200, 696, 1331, 1331, + 200, 200, 200, 200, 200, 200, 995, 996, 1331, 997, + 200, 200, 200, 698, 998, 200, 695, 200, 200, 200, + 200, 200, 200, 200, 696, 200, 697, 200, 200, 999, + + 1000, 200, 1331, 200, 1001, 200, 1331, 200, 200, 1331, + 698, 998, 200, 1002, 200, 200, 200, 200, 1331, 200, + 200, 1331, 200, 697, 700, 200, 999, 1000, 200, 699, + 200, 1001, 200, 200, 200, 200, 701, 200, 200, 1331, + 1002, 1331, 200, 200, 200, 200, 1331, 200, 200, 1003, + 1004, 700, 702, 200, 1005, 200, 699, 200, 200, 1006, + 200, 200, 1331, 701, 200, 200, 703, 1331, 200, 200, + 200, 200, 200, 200, 200, 200, 1003, 1004, 200, 702, + 200, 1005, 1007, 1008, 200, 200, 1006, 200, 1331, 200, + 200, 1331, 200, 703, 705, 200, 704, 200, 1331, 200, + + 200, 1331, 200, 1331, 1009, 200, 1010, 1331, 706, 1007, + 1008, 1331, 200, 708, 200, 200, 200, 200, 200, 200, + 200, 705, 1011, 704, 200, 200, 200, 1331, 200, 200, + 707, 1009, 1012, 1010, 200, 706, 1331, 1331, 200, 200, + 708, 1331, 200, 1331, 200, 200, 1331, 200, 1013, 1011, + 1331, 1331, 200, 1014, 200, 200, 1015, 707, 1016, 1012, + 1019, 200, 200, 709, 200, 200, 200, 710, 200, 200, + 711, 200, 200, 200, 200, 1013, 1017, 200, 200, 1018, + 1014, 200, 200, 1015, 1331, 1016, 1331, 1019, 1331, 200, + 709, 200, 1331, 200, 710, 200, 200, 711, 712, 200, + + 200, 200, 1020, 1017, 200, 200, 1018, 714, 200, 200, + 200, 200, 200, 200, 200, 200, 1021, 1022, 200, 200, + 200, 713, 1331, 200, 200, 712, 1331, 1023, 1024, 1020, + 1025, 1026, 1331, 1027, 714, 200, 1028, 200, 200, 200, + 200, 200, 200, 1021, 1022, 200, 200, 200, 713, 200, + 200, 200, 200, 715, 1023, 1024, 200, 1025, 1026, 200, + 1027, 200, 200, 1028, 1331, 200, 1331, 716, 1029, 200, + 1331, 200, 200, 1030, 717, 1331, 200, 1031, 1331, 200, + 715, 200, 1331, 200, 1032, 1331, 200, 200, 200, 200, + 1331, 200, 200, 718, 716, 1029, 200, 200, 200, 200, + + 1030, 717, 200, 1033, 1031, 720, 200, 200, 200, 200, + 1331, 1032, 719, 1034, 200, 200, 1331, 721, 200, 1035, + 718, 200, 200, 1036, 200, 200, 1331, 200, 1331, 200, + 1033, 722, 720, 200, 200, 200, 200, 200, 1331, 719, + 1034, 200, 200, 723, 721, 1037, 1035, 200, 200, 200, + 1036, 200, 200, 724, 200, 200, 1331, 1331, 722, 200, + 1038, 1331, 200, 200, 200, 200, 1331, 1039, 200, 1040, + 723, 725, 1037, 1041, 200, 200, 1331, 200, 200, 726, + 724, 200, 200, 200, 200, 1331, 200, 1038, 200, 200, + 200, 1331, 200, 200, 1039, 1331, 1040, 1042, 725, 728, + + 1041, 1331, 200, 200, 200, 200, 726, 200, 200, 200, + 200, 200, 200, 727, 1331, 200, 200, 200, 200, 200, + 200, 200, 729, 733, 1042, 200, 728, 1043, 200, 1331, + 200, 200, 200, 1331, 200, 1044, 200, 1045, 200, 200, + 727, 200, 730, 200, 200, 200, 200, 200, 200, 729, + 733, 1046, 200, 200, 1043, 200, 200, 200, 200, 734, + 200, 200, 1044, 200, 1045, 200, 200, 200, 200, 730, + 200, 736, 1331, 1047, 200, 1331, 200, 200, 1046, 1048, + 200, 1331, 1049, 200, 200, 1331, 734, 200, 200, 1050, + 200, 731, 200, 200, 200, 200, 200, 1331, 736, 200, + + 1047, 732, 200, 200, 200, 200, 1048, 1051, 735, 1049, + 1331, 1052, 200, 1331, 1331, 200, 1050, 200, 731, 200, + 200, 200, 200, 200, 200, 1126, 200, 200, 732, 200, + 200, 1127, 200, 737, 1051, 735, 1128, 200, 1052, 200, + 200, 738, 200, 1129, 200, 200, 1331, 200, 200, 200, + 1130, 200, 1126, 1331, 200, 200, 1131, 200, 1127, 739, + 737, 200, 1331, 1128, 200, 200, 200, 200, 738, 1132, + 1129, 200, 200, 200, 1331, 200, 200, 1130, 1331, 740, + 200, 1133, 200, 1131, 1331, 200, 739, 200, 200, 200, + 1134, 742, 200, 200, 741, 200, 1132, 1331, 200, 200, + + 200, 200, 200, 1331, 1135, 743, 740, 200, 1133, 200, + 1136, 200, 200, 1331, 200, 200, 200, 1134, 742, 1331, + 200, 741, 200, 1137, 200, 200, 200, 200, 200, 747, + 200, 1135, 743, 744, 200, 1331, 200, 1136, 200, 200, + 200, 1331, 200, 1138, 1139, 1331, 752, 200, 200, 1331, + 1137, 200, 200, 200, 200, 1331, 747, 200, 200, 1140, + 744, 200, 200, 750, 200, 1331, 200, 200, 745, 200, + 1138, 1139, 200, 752, 200, 200, 200, 1141, 1331, 1142, + 200, 1143, 200, 1144, 1145, 200, 1140, 746, 1146, 200, + 750, 200, 200, 1331, 1147, 745, 200, 1331, 1148, 200, + + 751, 200, 1331, 200, 1141, 200, 1142, 200, 1143, 200, + 1144, 1145, 200, 1149, 746, 1146, 200, 200, 200, 200, + 748, 1147, 1150, 200, 754, 1148, 1151, 751, 200, 200, + 1331, 200, 200, 749, 200, 1152, 200, 1331, 1331, 200, + 1149, 200, 1331, 200, 200, 200, 753, 748, 1153, 1150, + 200, 754, 1154, 1151, 1155, 200, 200, 200, 200, 200, + 749, 755, 1152, 200, 200, 200, 1156, 200, 200, 200, + 1157, 1158, 200, 753, 1331, 1153, 1331, 200, 756, 1154, + 200, 1155, 1159, 1331, 200, 200, 200, 1331, 755, 1331, + 200, 200, 200, 1156, 200, 1160, 200, 1157, 1158, 200, + + 1161, 200, 1331, 200, 200, 756, 758, 200, 757, 1159, + 200, 200, 200, 200, 760, 200, 200, 200, 200, 200, + 1162, 759, 1160, 200, 200, 1163, 200, 1161, 200, 200, + 200, 200, 1331, 758, 200, 757, 1331, 200, 200, 200, + 200, 760, 200, 200, 1331, 200, 200, 1162, 759, 1331, + 200, 200, 1163, 200, 1331, 200, 200, 1331, 200, 200, + 200, 200, 1331, 200, 200, 200, 200, 200, 761, 764, + 200, 200, 1164, 200, 763, 200, 200, 200, 762, 200, + 200, 200, 200, 200, 200, 765, 200, 200, 1331, 200, + 200, 200, 200, 1331, 200, 761, 764, 200, 200, 1164, + + 200, 763, 200, 200, 200, 762, 200, 200, 200, 1165, + 200, 200, 765, 200, 1166, 200, 200, 767, 1167, 200, + 200, 766, 1212, 1214, 200, 200, 200, 1215, 200, 200, + 768, 1216, 1331, 200, 1331, 1331, 1165, 1331, 200, 1331, + 200, 1166, 200, 1217, 767, 1167, 200, 200, 766, 1212, + 1214, 200, 200, 200, 1215, 200, 200, 768, 1216, 200, + 200, 200, 200, 1218, 770, 200, 200, 769, 1331, 200, + 1217, 200, 771, 1219, 200, 200, 200, 1331, 1220, 200, + 1221, 1331, 200, 1331, 1331, 200, 200, 1222, 200, 200, + 1218, 770, 200, 200, 769, 200, 200, 1331, 200, 771, + + 1219, 200, 200, 200, 773, 1220, 200, 1221, 200, 200, + 772, 200, 200, 774, 1222, 200, 1223, 1331, 200, 200, + 200, 1224, 200, 200, 200, 1331, 200, 1331, 200, 200, + 200, 773, 1331, 200, 775, 200, 778, 772, 200, 776, + 774, 777, 200, 1223, 200, 200, 200, 200, 1224, 200, + 200, 200, 200, 200, 780, 200, 200, 200, 1225, 200, + 200, 775, 1331, 778, 200, 1331, 776, 1331, 777, 1226, + 779, 200, 1331, 200, 200, 1227, 200, 1228, 200, 200, + 200, 780, 200, 1331, 200, 1225, 200, 200, 1331, 781, + 1229, 200, 200, 1331, 200, 1331, 1226, 779, 1230, 782, + + 1231, 200, 1227, 1232, 1228, 200, 1331, 200, 200, 200, + 200, 200, 1256, 1258, 200, 200, 781, 1229, 1259, 200, + 200, 200, 200, 1260, 200, 1230, 782, 1231, 1261, 200, + 1232, 1331, 1331, 783, 200, 200, 200, 200, 200, 1256, + 1258, 1331, 200, 200, 784, 1259, 1331, 200, 200, 200, + 1260, 200, 200, 1262, 785, 1261, 200, 1263, 786, 200, + 783, 200, 787, 200, 200, 200, 200, 1264, 200, 1331, + 200, 784, 1265, 200, 1331, 200, 1331, 1331, 200, 200, + 1262, 785, 1213, 1213, 1263, 786, 200, 1266, 1267, 787, + 200, 200, 200, 200, 1264, 200, 788, 200, 1283, 1265, + + 200, 200, 200, 200, 200, 200, 200, 886, 200, 1284, + 887, 200, 1285, 200, 1266, 1267, 200, 200, 1331, 200, + 1257, 1331, 200, 788, 200, 1283, 200, 1331, 200, 200, + 200, 200, 200, 200, 886, 200, 1284, 887, 200, 1285, + 200, 200, 888, 200, 200, 200, 892, 1257, 200, 200, + 200, 200, 1286, 200, 200, 1289, 200, 890, 200, 200, + 891, 889, 1282, 1282, 200, 200, 200, 1331, 200, 888, + 200, 200, 200, 892, 1331, 200, 1331, 200, 200, 1286, + 1331, 200, 1289, 200, 890, 200, 1295, 891, 889, 1296, + 1331, 200, 200, 200, 200, 894, 893, 200, 200, 200, + + 1331, 200, 200, 895, 1294, 200, 200, 200, 200, 1331, + 1331, 200, 1299, 1295, 1331, 200, 1296, 200, 200, 1331, + 1331, 200, 894, 893, 1331, 200, 200, 200, 200, 200, + 895, 1294, 200, 200, 200, 200, 200, 200, 200, 1299, + 200, 200, 200, 1302, 200, 200, 200, 200, 1331, 1304, + 1331, 896, 1306, 1308, 200, 200, 200, 200, 1331, 200, + 1235, 1213, 1331, 200, 200, 200, 1331, 200, 200, 1310, + 1302, 1331, 1331, 200, 200, 200, 1304, 200, 896, 1306, + 1308, 200, 200, 200, 200, 897, 200, 200, 1312, 200, + 200, 200, 200, 898, 200, 200, 1310, 200, 1270, 200, + + 200, 200, 200, 899, 200, 1314, 1331, 1331, 200, 200, + 200, 200, 897, 1331, 200, 1312, 200, 200, 200, 200, + 898, 200, 200, 200, 200, 1270, 200, 200, 200, 200, + 899, 1316, 1314, 200, 900, 200, 200, 200, 200, 200, + 901, 1318, 1331, 902, 200, 200, 200, 200, 200, 1331, + 200, 1331, 1331, 200, 200, 1320, 200, 1322, 1316, 903, + 200, 900, 200, 200, 200, 1331, 200, 901, 1318, 200, + 902, 200, 200, 200, 200, 200, 904, 1331, 200, 200, + 200, 200, 1320, 200, 1322, 1324, 903, 1331, 200, 200, + 200, 200, 200, 905, 200, 1331, 200, 1288, 1282, 200, + + 200, 1331, 1331, 904, 200, 200, 200, 1331, 1331, 1331, + 200, 1331, 1324, 1331, 1331, 200, 200, 1331, 1331, 200, + 905, 200, 1331, 200, 1331, 200, 200, 1331, 1331, 1331, + 200, 200, 906, 1331, 200, 200, 200, 1331, 1331, 1298, + 1331, 200, 907, 1331, 1331, 1331, 200, 908, 1331, 1331, + 200, 1331, 200, 1331, 1331, 1331, 1331, 200, 200, 906, + 200, 200, 200, 200, 1331, 200, 1298, 1331, 200, 907, + 200, 1331, 1331, 200, 908, 910, 200, 1331, 200, 1331, + 1331, 1331, 909, 200, 200, 200, 200, 200, 200, 1331, + 1331, 200, 200, 1331, 200, 1331, 200, 200, 911, 1331, + + 1331, 1331, 910, 200, 200, 200, 1331, 1331, 1331, 909, + 200, 200, 1331, 200, 200, 200, 1331, 912, 200, 200, + 200, 200, 200, 200, 200, 911, 200, 200, 200, 200, + 919, 200, 200, 200, 200, 1331, 1331, 1331, 200, 1331, + 200, 200, 1331, 1331, 912, 1331, 200, 200, 1331, 200, + 200, 200, 1331, 200, 200, 200, 200, 919, 1331, 200, + 200, 200, 200, 1331, 200, 200, 913, 200, 200, 200, + 200, 1331, 914, 1331, 200, 200, 200, 200, 200, 1331, + 200, 1331, 1331, 200, 1331, 915, 1331, 1331, 200, 200, + 1331, 200, 1331, 913, 1331, 200, 200, 200, 917, 914, + + 1331, 200, 200, 200, 1331, 200, 200, 200, 200, 200, + 200, 200, 915, 200, 916, 200, 200, 1331, 200, 918, + 1331, 200, 1331, 1331, 200, 917, 1331, 1331, 200, 1331, + 200, 1331, 200, 200, 200, 200, 200, 200, 200, 1331, + 200, 916, 200, 200, 200, 200, 918, 1331, 200, 1331, + 200, 200, 200, 1331, 200, 200, 200, 200, 1331, 200, + 200, 200, 921, 1331, 200, 920, 1331, 1331, 1331, 200, + 200, 200, 200, 1331, 922, 1331, 200, 200, 200, 200, + 200, 200, 200, 200, 1331, 1331, 200, 200, 200, 921, + 200, 1331, 920, 1331, 200, 1331, 200, 200, 200, 200, + + 200, 922, 1331, 200, 923, 200, 1331, 200, 200, 200, + 200, 1331, 200, 200, 1331, 200, 1331, 200, 200, 1331, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 1331, + 200, 923, 200, 924, 200, 200, 925, 200, 1331, 200, + 200, 200, 200, 1331, 1331, 200, 200, 200, 1331, 200, + 1331, 200, 1331, 200, 1331, 200, 1331, 200, 1331, 200, + 924, 200, 1331, 925, 200, 1331, 200, 200, 200, 200, + 200, 200, 200, 200, 927, 200, 200, 926, 200, 200, + 1331, 1331, 200, 1331, 200, 200, 1331, 1331, 928, 1331, + 1331, 200, 1331, 200, 200, 200, 1331, 200, 200, 200, + + 1331, 927, 200, 200, 926, 200, 200, 1331, 1331, 200, + 1331, 200, 200, 1331, 1331, 928, 200, 1331, 200, 1331, + 1331, 200, 200, 200, 200, 1331, 200, 200, 929, 200, + 930, 200, 1331, 931, 200, 1331, 200, 1331, 1331, 200, + 1331, 1331, 1331, 200, 1331, 200, 1331, 1331, 1331, 1331, + 200, 200, 1331, 200, 200, 929, 200, 930, 200, 1331, + 931, 200, 1331, 200, 1331, 1331, 200, 932, 200, 934, + 200, 200, 200, 1331, 200, 200, 200, 1331, 933, 200, + 200, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 932, 200, 934, 200, 200, 200, + + 1331, 200, 200, 200, 1331, 933, 200, 200, 200, 1331, + 200, 200, 200, 200, 200, 200, 200, 200, 1331, 1331, + 200, 200, 200, 1331, 1331, 200, 200, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 200, 1331, 200, + 200, 200, 200, 200, 200, 1331, 1331, 200, 200, 200, + 1331, 1331, 200, 200, 200, 1331, 200, 200, 936, 200, + 200, 200, 935, 1331, 200, 200, 200, 1331, 1331, 200, + 200, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 200, 1331, 200, 200, 936, 200, 200, 200, 935, + 937, 200, 200, 200, 200, 200, 200, 200, 938, 200, + + 200, 1331, 200, 941, 200, 200, 200, 200, 200, 200, + 200, 939, 940, 1331, 200, 200, 200, 937, 200, 200, + 1331, 200, 200, 1331, 1331, 938, 200, 200, 1331, 200, + 941, 200, 200, 200, 200, 200, 200, 200, 939, 940, + 200, 200, 200, 200, 943, 200, 200, 200, 200, 200, + 200, 1331, 200, 942, 200, 1331, 1331, 1331, 200, 200, + 200, 1331, 1331, 1331, 1331, 1331, 1331, 200, 200, 1331, + 1331, 943, 1331, 1331, 200, 200, 200, 200, 1331, 200, + 942, 200, 944, 1331, 200, 200, 200, 200, 200, 1331, + 1331, 1331, 945, 200, 200, 200, 200, 200, 1331, 1331, + + 1331, 1331, 200, 200, 200, 1331, 946, 1331, 1331, 944, + 1331, 200, 200, 200, 1331, 200, 1331, 1331, 1331, 945, + 200, 200, 200, 200, 200, 1331, 200, 1331, 1331, 200, + 200, 200, 200, 946, 200, 947, 1331, 200, 200, 200, + 200, 200, 200, 1331, 200, 948, 200, 200, 1331, 200, + 949, 1331, 1331, 200, 200, 1331, 200, 200, 1331, 200, + 1331, 200, 947, 1331, 200, 200, 200, 1331, 200, 200, + 1331, 200, 948, 200, 200, 200, 950, 949, 1331, 200, + 200, 200, 1331, 200, 200, 200, 200, 1331, 1331, 1331, + 951, 1331, 1331, 200, 200, 200, 200, 1331, 200, 1331, + + 1331, 1331, 200, 950, 200, 1331, 200, 200, 1331, 1331, + 1331, 1331, 200, 200, 200, 1331, 952, 951, 1331, 1331, + 200, 200, 200, 200, 200, 200, 1331, 1331, 953, 200, + 200, 200, 200, 200, 1331, 1331, 1331, 1331, 200, 200, + 200, 200, 200, 952, 1331, 1331, 200, 200, 200, 200, + 954, 200, 200, 1331, 1331, 953, 200, 200, 1331, 200, + 200, 1331, 200, 1331, 1331, 200, 200, 200, 200, 200, + 200, 1331, 200, 200, 200, 200, 200, 954, 200, 200, + 200, 955, 200, 1331, 1331, 956, 200, 1331, 200, 200, + 200, 957, 200, 1331, 200, 200, 1331, 200, 200, 200, + + 1331, 200, 200, 1331, 200, 200, 1331, 200, 955, 200, + 1331, 1331, 956, 200, 200, 200, 200, 200, 957, 200, + 200, 200, 1331, 960, 958, 200, 200, 1331, 200, 200, + 959, 200, 200, 1331, 200, 200, 200, 1331, 961, 200, + 200, 200, 200, 200, 200, 1331, 1331, 200, 200, 1331, + 960, 958, 1331, 200, 1331, 200, 1331, 959, 200, 200, + 200, 200, 200, 200, 200, 961, 200, 200, 200, 200, + 200, 200, 200, 963, 962, 200, 200, 200, 200, 1331, + 200, 200, 1331, 200, 1331, 200, 200, 200, 200, 1331, + 1331, 200, 200, 200, 1331, 200, 964, 200, 1331, 200, + + 963, 962, 200, 200, 200, 200, 1331, 200, 200, 1331, + 200, 1331, 200, 200, 965, 200, 1331, 200, 200, 200, + 200, 200, 200, 964, 200, 1331, 200, 966, 1331, 200, + 1331, 200, 200, 200, 200, 1331, 200, 200, 967, 200, + 200, 965, 200, 200, 200, 200, 200, 1331, 200, 200, + 200, 200, 200, 200, 966, 1331, 200, 968, 200, 200, + 200, 200, 200, 200, 200, 967, 1331, 200, 1331, 200, + 200, 969, 1331, 200, 200, 1331, 200, 200, 1331, 200, + 200, 200, 200, 200, 968, 1331, 200, 200, 200, 200, + 200, 1331, 200, 1331, 1331, 200, 1331, 970, 969, 1331, + + 200, 200, 1331, 200, 200, 1331, 971, 200, 200, 200, + 1331, 200, 1331, 200, 200, 200, 200, 200, 1331, 200, + 1331, 1331, 200, 200, 970, 200, 973, 200, 1331, 1331, + 200, 200, 972, 971, 200, 200, 200, 200, 200, 200, + 1331, 200, 974, 200, 200, 1331, 200, 1331, 1331, 200, + 200, 1331, 200, 973, 1331, 1331, 1331, 200, 1331, 972, + 975, 200, 200, 200, 200, 200, 200, 200, 200, 974, + 976, 200, 200, 200, 200, 200, 200, 200, 977, 200, + 200, 1331, 1331, 1331, 1331, 200, 1331, 975, 1331, 1331, + 200, 1331, 200, 1331, 200, 200, 1331, 976, 1331, 200, + + 1331, 200, 200, 1331, 200, 977, 200, 200, 1331, 200, + 200, 200, 200, 200, 200, 200, 1331, 200, 1331, 200, + 200, 200, 200, 979, 200, 1331, 978, 200, 200, 200, + 200, 200, 1331, 200, 200, 1331, 200, 200, 200, 1331, + 200, 200, 200, 200, 200, 1331, 200, 200, 200, 1331, + 979, 200, 1331, 978, 200, 200, 200, 200, 200, 1331, + 200, 200, 200, 1331, 200, 200, 200, 200, 200, 980, + 200, 200, 200, 200, 200, 1331, 1331, 200, 200, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 200, + 1331, 200, 200, 200, 200, 200, 980, 1331, 1331, 200, + + 200, 200, 1331, 1331, 200, 200, 200, 200, 200, 200, + 1331, 1055, 200, 200, 200, 200, 200, 1331, 200, 200, + 1054, 200, 200, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 200, 200, 200, 200, 200, 200, 1331, 1055, 200, + 200, 200, 200, 200, 1331, 200, 200, 1054, 200, 200, + 1056, 200, 1331, 1331, 200, 200, 1331, 1331, 200, 200, + 200, 200, 1331, 1059, 200, 1058, 1057, 1331, 200, 200, + 200, 200, 1331, 200, 200, 1331, 1331, 1056, 200, 200, + 1331, 200, 200, 1331, 200, 1331, 1331, 200, 200, 200, + 1059, 200, 1058, 1057, 1331, 200, 200, 200, 200, 1331, + + 200, 200, 1060, 200, 200, 1061, 200, 1331, 200, 1331, + 200, 200, 1331, 1331, 200, 200, 200, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 200, 1331, 200, 1331, 200, 1060, + 200, 200, 1061, 200, 1062, 200, 200, 200, 200, 1064, + 200, 200, 200, 200, 200, 200, 1063, 1065, 200, 200, + 1331, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 1062, 1066, 200, 200, 200, 1064, 200, 200, 1331, + 200, 200, 200, 1063, 1065, 200, 200, 1331, 200, 200, + 1331, 200, 1331, 200, 200, 200, 200, 1331, 200, 1066, + 1331, 200, 200, 1068, 1331, 200, 1070, 200, 1067, 1331, + + 200, 200, 1069, 1331, 200, 200, 200, 200, 200, 200, + 1331, 1331, 1331, 1331, 200, 200, 200, 200, 1331, 200, + 1068, 1331, 200, 1070, 200, 1067, 200, 200, 200, 1069, + 1331, 200, 200, 200, 200, 200, 200, 1331, 1331, 1331, + 1331, 200, 200, 200, 200, 1331, 200, 200, 1331, 200, + 1071, 200, 1331, 200, 1331, 1331, 200, 200, 200, 200, + 1073, 1331, 1072, 1331, 1331, 200, 200, 200, 1331, 200, + 200, 1074, 1331, 200, 200, 200, 1075, 1071, 200, 1331, + 200, 200, 1331, 200, 200, 200, 200, 1073, 1331, 1072, + 1331, 200, 200, 200, 200, 200, 200, 200, 1074, 200, + + 1331, 1331, 200, 1075, 200, 200, 200, 200, 200, 1331, + 1076, 1078, 1331, 200, 1331, 200, 200, 1331, 200, 1331, + 200, 1331, 200, 200, 200, 1331, 200, 1331, 1331, 1331, + 200, 200, 200, 200, 1331, 1077, 1331, 1076, 1078, 1331, + 200, 1331, 200, 200, 200, 1331, 1331, 200, 1079, 200, + 1331, 200, 1331, 200, 200, 1331, 1331, 200, 1083, 200, + 200, 1331, 1077, 1331, 200, 200, 1080, 200, 200, 200, + 200, 200, 200, 1331, 1331, 1079, 200, 1331, 200, 1331, + 200, 200, 1331, 1331, 1331, 1083, 200, 200, 200, 1331, + 200, 200, 200, 1080, 200, 200, 200, 200, 200, 200, + + 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 200, 1331, + 200, 1331, 1331, 1331, 1331, 200, 1081, 200, 200, 1331, + 1331, 200, 1331, 1331, 200, 200, 1331, 200, 200, 200, + 1331, 1331, 1331, 1331, 200, 200, 1331, 200, 1331, 1082, + 200, 1085, 200, 1081, 200, 200, 200, 1084, 200, 1331, + 1331, 200, 200, 200, 1331, 200, 1331, 1331, 200, 1331, + 1331, 200, 1331, 1331, 1331, 1331, 1082, 200, 1085, 200, + 200, 200, 200, 200, 1084, 200, 200, 200, 200, 200, + 200, 1331, 200, 200, 200, 200, 200, 1331, 200, 1331, + 1331, 200, 1086, 1331, 1331, 1331, 200, 200, 1331, 200, + + 200, 1331, 200, 200, 200, 200, 1331, 200, 1331, 200, + 200, 200, 200, 200, 200, 200, 200, 1331, 200, 1086, + 1331, 200, 1331, 200, 1331, 1331, 200, 200, 200, 200, + 200, 1331, 1331, 1331, 200, 200, 1087, 1331, 1331, 200, + 200, 200, 200, 200, 200, 1331, 1088, 1331, 200, 1089, + 200, 1331, 1090, 200, 200, 200, 200, 200, 1091, 1331, + 200, 1331, 200, 1087, 1331, 200, 200, 200, 1331, 200, + 200, 200, 1331, 1088, 1331, 1331, 1089, 200, 1331, 1090, + 1331, 200, 200, 200, 200, 1091, 1331, 200, 200, 200, + 200, 1331, 200, 200, 200, 200, 1331, 200, 1092, 1331, + + 200, 1331, 1331, 1331, 1331, 1331, 200, 1331, 200, 200, + 1331, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 1331, 200, 200, 1331, 200, 1092, 1331, 200, 1331, 1331, + 200, 1331, 200, 200, 1093, 200, 1331, 200, 200, 200, + 200, 200, 200, 1331, 200, 200, 200, 1331, 200, 1331, + 200, 200, 1331, 1331, 200, 1094, 1331, 200, 1331, 200, + 200, 1093, 1331, 1331, 200, 200, 1331, 1095, 1331, 200, + 1331, 200, 1331, 1331, 1331, 200, 1331, 200, 200, 1331, + 200, 200, 1094, 1331, 200, 200, 200, 200, 1331, 1331, + 200, 200, 1096, 1097, 1095, 1331, 200, 200, 1331, 200, + + 1331, 1331, 1331, 1331, 200, 200, 1331, 200, 1331, 200, + 1331, 200, 200, 200, 1331, 1331, 1331, 200, 200, 1096, + 1097, 1331, 1331, 200, 200, 200, 200, 200, 200, 1331, + 200, 200, 200, 1098, 1331, 200, 200, 200, 1099, 200, + 200, 200, 200, 1331, 1331, 1331, 200, 1331, 200, 1331, + 1331, 200, 200, 1331, 200, 200, 1331, 200, 200, 200, + 1098, 1331, 200, 1331, 200, 1099, 200, 200, 200, 200, + 1331, 1331, 200, 200, 1331, 200, 200, 1331, 200, 1101, + 200, 1331, 200, 1331, 200, 200, 1331, 1100, 1331, 1331, + 200, 1331, 200, 1331, 1331, 1331, 1331, 1331, 1331, 200, + + 200, 1331, 1331, 200, 1331, 1331, 1101, 200, 200, 200, + 1331, 200, 200, 1331, 1100, 1331, 200, 200, 200, 200, + 200, 1102, 1331, 1331, 1331, 1331, 200, 200, 200, 1103, + 200, 1331, 1331, 1331, 200, 200, 200, 1331, 1331, 200, + 200, 1331, 1104, 200, 1331, 200, 200, 200, 1102, 1331, + 200, 1331, 200, 200, 200, 200, 1103, 200, 1105, 1331, + 1331, 200, 200, 200, 200, 1331, 200, 200, 1331, 1104, + 200, 1331, 1331, 200, 200, 1331, 200, 200, 1331, 200, + 1106, 200, 1331, 1331, 200, 1105, 200, 1331, 200, 200, + 1331, 200, 1107, 200, 200, 1331, 200, 200, 200, 1331, + + 200, 200, 200, 200, 200, 1331, 200, 1106, 200, 1108, + 200, 200, 1331, 200, 200, 200, 200, 1331, 200, 1107, + 200, 200, 200, 200, 200, 200, 1110, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 1108, 200, 1331, 1109, + 1331, 200, 200, 200, 200, 200, 1331, 200, 1331, 200, + 1112, 200, 1331, 1110, 200, 200, 1331, 200, 200, 200, + 1331, 200, 1111, 200, 200, 1331, 1109, 200, 200, 200, + 200, 200, 1331, 200, 200, 1113, 1331, 1112, 1331, 1331, + 200, 200, 1331, 200, 1331, 200, 200, 1331, 200, 1111, + 200, 200, 1114, 200, 200, 200, 1331, 200, 200, 1331, + + 200, 200, 1113, 1331, 200, 1331, 200, 200, 1331, 1331, + 200, 200, 1115, 200, 1331, 200, 200, 1116, 1331, 1114, + 200, 1331, 1331, 1117, 1331, 200, 1331, 1331, 200, 1331, + 200, 200, 1331, 200, 200, 200, 200, 1331, 200, 1115, + 200, 200, 1331, 200, 1116, 1331, 200, 200, 1331, 1118, + 1117, 1331, 1331, 1331, 200, 200, 1331, 200, 200, 200, + 200, 200, 200, 200, 1331, 200, 1331, 200, 200, 1331, + 200, 1331, 1331, 200, 200, 1331, 1118, 1331, 1119, 1120, + 200, 200, 200, 1331, 200, 200, 200, 200, 200, 1331, + 200, 1331, 200, 1331, 1331, 1331, 1331, 200, 200, 1331, + + 200, 1331, 1331, 1331, 1121, 1119, 1120, 200, 200, 200, + 1331, 200, 200, 1331, 200, 200, 200, 200, 1331, 1331, + 1331, 200, 200, 200, 200, 200, 1331, 200, 1122, 1123, + 1331, 1121, 200, 200, 1331, 200, 1331, 1331, 1331, 200, + 200, 200, 200, 200, 1331, 1331, 1331, 200, 200, 200, + 200, 200, 200, 1124, 1331, 1122, 1123, 1331, 1331, 200, + 200, 200, 1331, 200, 200, 1331, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 1331, 200, 200, 1331, 200, + 1124, 1331, 200, 1331, 1331, 1331, 1331, 1331, 200, 1331, + 200, 200, 1169, 200, 1331, 200, 200, 200, 200, 200, + + 200, 200, 200, 200, 200, 200, 200, 1331, 1170, 200, + 1172, 200, 200, 200, 200, 200, 1331, 200, 200, 1169, + 200, 200, 200, 200, 200, 1331, 1171, 200, 200, 200, + 200, 200, 200, 200, 1331, 1170, 200, 1172, 200, 200, + 200, 200, 200, 1331, 200, 200, 200, 200, 200, 200, + 200, 200, 1331, 1171, 200, 1331, 200, 200, 200, 1331, + 200, 1173, 200, 200, 1331, 1331, 200, 1174, 200, 1175, + 200, 200, 200, 200, 1331, 200, 200, 200, 1331, 1331, + 200, 200, 1331, 200, 1331, 1331, 1331, 200, 1173, 200, + 1331, 1331, 1331, 200, 1174, 200, 1175, 200, 200, 200, + + 1331, 1331, 200, 200, 200, 1331, 200, 200, 200, 1331, + 200, 200, 200, 200, 1177, 200, 200, 200, 1176, 1331, + 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, + 1331, 200, 1331, 200, 1331, 1331, 1331, 200, 200, 200, + 200, 1177, 200, 200, 200, 1176, 1178, 200, 1331, 200, + 1331, 1179, 200, 200, 1331, 200, 1331, 200, 200, 1331, + 1331, 1331, 200, 200, 200, 1331, 200, 200, 1331, 1331, + 1331, 200, 1180, 1178, 1331, 1331, 200, 1331, 1179, 1331, + 200, 1331, 200, 1331, 200, 200, 1331, 1331, 1331, 200, + 200, 200, 1331, 200, 200, 200, 1181, 200, 200, 1180, + + 1331, 1331, 200, 200, 1331, 1331, 200, 200, 200, 200, + 1331, 200, 1331, 200, 1331, 1331, 200, 1331, 200, 1331, + 1331, 200, 200, 1181, 200, 1331, 1331, 1331, 1182, 200, + 1331, 1331, 1331, 200, 200, 200, 200, 200, 200, 200, + 200, 1331, 1331, 200, 200, 200, 1331, 1331, 200, 200, + 200, 200, 200, 200, 1331, 1182, 1331, 200, 200, 1331, + 1331, 1331, 200, 200, 200, 1331, 200, 1331, 1331, 1331, + 1331, 200, 1331, 1331, 1331, 1331, 200, 200, 200, 200, + 200, 200, 1183, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 1331, 1184, 200, 1331, 1331, + + 1331, 200, 200, 1331, 1331, 1331, 200, 200, 200, 1183, + 200, 1331, 1331, 200, 200, 200, 1331, 1331, 200, 200, + 200, 200, 1331, 1184, 200, 1331, 1331, 1331, 200, 200, + 200, 200, 200, 200, 200, 1186, 200, 200, 1185, 1331, + 200, 200, 200, 1331, 1331, 1331, 200, 1331, 1331, 1331, + 200, 200, 1331, 1331, 200, 1331, 200, 200, 200, 200, + 200, 1331, 1186, 200, 200, 1185, 1331, 200, 200, 200, + 200, 1331, 200, 200, 1331, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 1331, 200, 1331, 1331, + 200, 1331, 200, 1331, 200, 200, 1331, 200, 200, 200, + + 200, 1331, 200, 200, 200, 1331, 200, 200, 1331, 200, + 1331, 200, 200, 1331, 200, 1331, 200, 200, 1331, 200, + 200, 200, 200, 1331, 1188, 200, 200, 200, 200, 1187, + 1331, 200, 1331, 1331, 200, 1331, 200, 1331, 1189, 1331, + 1331, 200, 200, 200, 200, 1331, 200, 200, 1331, 1331, + 200, 1188, 200, 200, 200, 200, 1187, 1331, 1331, 1331, + 200, 200, 200, 200, 200, 1189, 1331, 1331, 200, 200, + 200, 200, 1331, 200, 200, 1331, 200, 200, 200, 200, + 1331, 200, 1331, 1190, 200, 1331, 1331, 200, 200, 200, + 1331, 200, 200, 1331, 200, 200, 1331, 200, 1331, 200, + + 1191, 200, 200, 200, 200, 200, 200, 200, 200, 1331, + 1190, 200, 200, 200, 1331, 200, 1331, 1331, 200, 200, + 1331, 200, 1331, 1331, 1331, 1192, 200, 1191, 1331, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 1331, 200, 200, 1331, 200, 1331, 1331, 200, 1331, + 1331, 1331, 1192, 1331, 200, 1331, 200, 200, 1331, 200, + 1331, 200, 1193, 200, 200, 200, 200, 200, 1331, 200, + 200, 1194, 200, 1331, 1331, 200, 1195, 200, 1331, 1331, + 1196, 200, 200, 200, 200, 1331, 1331, 200, 200, 1193, + 200, 1331, 200, 200, 200, 1331, 1331, 1331, 1194, 200, + + 200, 1331, 200, 1195, 200, 1331, 200, 1196, 1331, 200, + 1331, 200, 200, 1331, 200, 1331, 200, 200, 1331, 200, + 200, 1331, 1197, 1331, 1331, 1331, 200, 200, 1198, 200, + 200, 1331, 1331, 200, 200, 1331, 200, 1331, 1331, 200, + 200, 1331, 1199, 200, 200, 1331, 1331, 200, 200, 1197, + 200, 1331, 1331, 200, 200, 1198, 1331, 200, 200, 1331, + 200, 200, 1331, 200, 200, 1200, 200, 200, 200, 1199, + 200, 200, 200, 1201, 200, 200, 1331, 200, 200, 200, + 1331, 200, 1331, 1331, 200, 200, 1331, 200, 1331, 1331, + 1331, 200, 1200, 200, 1331, 200, 200, 200, 1202, 200, + + 1201, 200, 200, 200, 200, 200, 200, 1331, 200, 200, + 1203, 200, 200, 1331, 200, 1331, 1331, 200, 1331, 1331, + 1331, 1331, 200, 200, 1331, 1202, 200, 1331, 200, 200, + 200, 200, 1331, 200, 1204, 200, 200, 1203, 200, 200, + 1331, 200, 1331, 1331, 200, 200, 1234, 200, 1331, 200, + 200, 1331, 200, 200, 1331, 200, 200, 200, 1205, 1206, + 200, 1204, 1331, 1331, 1331, 200, 200, 1331, 200, 200, + 200, 200, 200, 1234, 200, 200, 200, 200, 1331, 200, + 200, 200, 1331, 200, 200, 1205, 1206, 1331, 1331, 1331, + 1331, 1331, 200, 200, 200, 200, 200, 200, 200, 200, + + 1207, 1331, 200, 200, 200, 1208, 1331, 200, 200, 1331, + 200, 1331, 200, 200, 1331, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 1331, 200, 200, 1207, 200, 1331, + 1331, 200, 1208, 1331, 200, 1331, 200, 200, 1331, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 1331, 200, + 200, 1331, 200, 1331, 1331, 200, 1331, 200, 1331, 200, + 200, 200, 200, 200, 200, 1331, 1209, 200, 200, 200, + 1331, 1331, 200, 200, 1331, 1331, 1210, 1331, 200, 1331, + 1331, 1331, 1331, 200, 200, 1331, 200, 200, 200, 200, + 200, 200, 200, 1209, 200, 1331, 200, 200, 1331, 200, + + 1331, 1331, 200, 1210, 200, 200, 200, 1331, 1331, 1331, + 200, 200, 1331, 1331, 1331, 200, 200, 200, 200, 200, + 200, 1331, 1331, 1331, 200, 200, 1331, 1331, 1331, 200, + 200, 200, 200, 200, 200, 1331, 200, 1331, 200, 200, + 200, 1331, 1331, 200, 200, 200, 200, 200, 1331, 1331, + 200, 1331, 200, 1331, 200, 1331, 200, 200, 1331, 200, + 200, 200, 1331, 200, 1235, 1213, 200, 200, 1331, 1331, + 200, 200, 1331, 200, 1236, 1331, 1331, 200, 200, 1331, + 1331, 200, 1331, 200, 200, 1331, 1331, 200, 1237, 200, + 1331, 1331, 200, 200, 200, 1331, 200, 200, 1331, 200, + + 1331, 1236, 200, 1331, 200, 200, 1331, 1331, 200, 200, + 1331, 200, 200, 1331, 200, 1237, 200, 1331, 200, 200, + 200, 200, 200, 200, 200, 1331, 200, 1331, 200, 200, + 1238, 200, 1331, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 1331, 200, 200, 1331, 1239, 200, + 200, 200, 200, 200, 1331, 200, 1331, 1238, 1331, 1331, + 200, 200, 200, 1331, 200, 200, 1331, 200, 200, 200, + 200, 1331, 200, 200, 1331, 1239, 1331, 200, 200, 200, + 200, 200, 1331, 1331, 1331, 200, 1331, 1331, 200, 200, + 200, 200, 1240, 1331, 1331, 200, 1331, 200, 1331, 200, + + 1331, 200, 200, 1331, 200, 200, 200, 1331, 200, 1331, + 1331, 200, 200, 1331, 1241, 200, 200, 200, 200, 1240, + 1242, 1331, 200, 200, 200, 200, 1331, 200, 200, 200, + 200, 200, 200, 200, 1331, 200, 1331, 1331, 200, 1331, + 1331, 1241, 1331, 200, 200, 1331, 200, 1242, 1331, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 1331, 200, + 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, + 1331, 200, 1331, 200, 1331, 1331, 1331, 1331, 200, 200, + 200, 200, 200, 200, 1244, 1243, 200, 200, 200, 200, + 1331, 200, 200, 200, 200, 200, 1331, 1246, 200, 1245, + + 200, 1331, 200, 1331, 200, 200, 200, 200, 200, 200, + 200, 1244, 1243, 200, 1331, 200, 200, 1331, 200, 1331, + 200, 200, 200, 1331, 1246, 200, 1245, 200, 200, 200, + 200, 200, 200, 1331, 200, 200, 200, 200, 1331, 200, + 200, 200, 1331, 1331, 1331, 1331, 200, 1247, 1331, 1331, + 1331, 200, 200, 1331, 200, 200, 1331, 200, 1331, 200, + 1331, 1331, 200, 1331, 200, 1331, 200, 200, 200, 1248, + 200, 1331, 200, 200, 1247, 1331, 1331, 200, 200, 200, + 1331, 200, 200, 200, 1331, 200, 200, 1331, 1331, 1331, + 200, 200, 1331, 1331, 1331, 200, 1248, 200, 1331, 200, + + 1331, 1331, 1331, 1331, 200, 1331, 200, 1331, 200, 200, + 200, 1331, 200, 200, 1249, 1331, 1331, 200, 200, 200, + 1331, 200, 200, 1331, 1331, 1331, 200, 200, 1251, 200, + 200, 200, 200, 200, 200, 200, 1250, 200, 1331, 200, + 200, 1249, 200, 1331, 1331, 200, 200, 1331, 200, 1331, + 1331, 1331, 1331, 200, 200, 1251, 200, 200, 200, 200, + 200, 200, 200, 1250, 200, 1331, 200, 200, 1252, 200, + 1253, 1254, 200, 200, 200, 200, 1331, 200, 1331, 1331, + 200, 200, 1331, 200, 1331, 1331, 1331, 200, 1331, 200, + 200, 200, 1331, 200, 200, 1252, 1331, 1253, 1254, 200, + + 200, 200, 200, 1331, 200, 200, 1331, 200, 200, 200, + 200, 1331, 1331, 1331, 1331, 200, 1331, 200, 200, 200, + 200, 1331, 1331, 200, 200, 200, 1331, 1331, 200, 200, + 1331, 1331, 200, 1331, 200, 1331, 200, 1269, 1331, 200, + 1331, 1331, 200, 200, 200, 1331, 200, 200, 1331, 1331, + 200, 200, 200, 200, 1331, 200, 200, 1331, 1271, 1331, + 1331, 200, 1331, 200, 1269, 1331, 200, 1331, 200, 200, + 200, 200, 200, 200, 200, 1331, 1331, 1331, 200, 200, + 200, 1331, 200, 200, 1272, 1271, 200, 200, 200, 200, + 200, 1331, 200, 200, 1331, 200, 200, 200, 1273, 200, + + 200, 200, 200, 200, 1331, 200, 200, 200, 1331, 200, + 200, 1272, 1331, 200, 200, 200, 200, 200, 1331, 200, + 200, 1331, 200, 200, 200, 1273, 200, 200, 200, 200, + 200, 1331, 200, 200, 200, 1331, 1274, 1331, 1331, 200, + 1276, 1275, 200, 200, 200, 200, 200, 200, 1331, 200, + 200, 200, 200, 200, 200, 1331, 1331, 200, 1331, 200, + 200, 1331, 1331, 1274, 1331, 1331, 200, 1276, 1275, 200, + 200, 1331, 200, 200, 200, 200, 1331, 200, 200, 200, + 1331, 200, 200, 200, 200, 1331, 1331, 200, 200, 200, + 1331, 200, 1331, 200, 1331, 1331, 200, 1331, 1331, 1331, + + 1331, 200, 200, 1331, 200, 1331, 1331, 200, 200, 200, + 200, 200, 1331, 1331, 200, 200, 200, 200, 200, 1331, + 200, 200, 1331, 200, 1331, 200, 200, 1277, 200, 200, + 1279, 200, 1278, 200, 200, 1331, 200, 1331, 200, 200, + 1331, 200, 1331, 1331, 200, 1331, 200, 1331, 200, 200, + 1280, 200, 200, 200, 1277, 200, 200, 1279, 200, 1278, + 200, 200, 1331, 200, 1288, 1282, 200, 1331, 200, 1331, + 1290, 200, 1331, 200, 200, 200, 200, 1280, 200, 200, + 200, 1331, 200, 1331, 200, 200, 200, 1331, 200, 200, + 200, 1291, 1331, 200, 1331, 200, 200, 1290, 200, 200, + + 1331, 200, 200, 200, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 200, 200, 1291, 1331, + 200, 1331, 200, 200, 200, 1331, 200, 200, 1331, 200, + 200, 200, 200, 1331, 200, 200, 200, 200, 200, 200, + 200, 200, 200, 1331, 1331, 200, 200, 1331, 200, 1331, + 200, 200, 1331, 200, 200, 1331, 200, 1331, 200, 200, + 1331, 200, 1331, 200, 200, 200, 200, 200, 200, 1292, + 1331, 1331, 200, 200, 200, 200, 1331, 200, 200, 200, + 200, 1331, 200, 200, 200, 200, 200, 200, 200, 1331, + 200, 200, 200, 200, 1300, 200, 1292, 1331, 200, 200, + + 200, 200, 200, 200, 200, 200, 200, 200, 1331, 200, + 200, 200, 200, 1331, 200, 200, 1331, 1331, 1331, 200, + 200, 1300, 1331, 1331, 1331, 200, 200, 200, 1331, 200, + 200, 200, 1331, 1331, 200, 1331, 1331, 1331, 1331, 200, + 46, 46, 46, 46, 46, 88, 1331, 1331, 88, 88, + 185, 185, 185, 1331, 185, 187, 1331, 187, 187, 187, + 190, 1331, 190, 190, 190, 200, 1331, 200, 200, 200, + 7, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331 + } ; static const flex_int16_t yy_chk[8848] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 9, 9, 10, 10, 15, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 15, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, - 18, 21, 22, 21, 27, 28, 22, 23, 30, 21, - 27, 21, 22, 28, 23, 21, 21, 31, 41, 28, - - 41, 23, 22, 41, 23, 1334, 44, 23, 21, 22, - 21, 27, 28, 22, 23, 30, 21, 27, 21, 22, - 28, 23, 21, 21, 31, 41, 28, 41, 23, 22, - 41, 23, 24, 44, 23, 25, 24, 25, 49, 49, - 24, 32, 25, 99, 33, 32, 24, 25, 33, 24, - 55, 32, 50, 50, 33, 43, 43, 58, 58, 24, - 1328, 55, 25, 24, 25, 1327, 34, 24, 32, 25, - 99, 33, 32, 24, 25, 33, 24, 26, 32, 36, - 34, 33, 43, 43, 100, 26, 34, 34, 26, 103, - 36, 26, 29, 34, 26, 1326, 36, 26, 29, 29, - - 29, 42, 86, 86, 26, 29, 36, 34, 1325, 42, - 1323, 100, 26, 34, 34, 26, 103, 36, 26, 29, - 1321, 26, 35, 36, 26, 29, 29, 29, 42, 104, - 35, 38, 29, 101, 35, 38, 42, 35, 35, 38, - 81, 101, 81, 106, 81, 38, 1319, 81, 1317, 35, - 102, 1315, 81, 102, 1313, 107, 104, 35, 38, 1311, - 101, 35, 38, 1309, 35, 35, 38, 81, 101, 81, - 106, 81, 38, 39, 81, 39, 110, 102, 39, 81, - 102, 39, 107, 39, 113, 39, 39, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 188, 188, 1307, - - 39, 1305, 39, 110, 1303, 39, 105, 105, 39, 109, - 39, 113, 39, 39, 40, 112, 109, 67, 40, 67, - 105, 40, 40, 67, 67, 112, 116, 116, 40, 67, - 117, 40, 1301, 105, 105, 1297, 109, 1133, 1133, 1256, - 1256, 40, 112, 109, 67, 40, 67, 105, 40, 40, - 67, 67, 112, 116, 116, 40, 67, 117, 40, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 61, 61, 118, 61, 61, 61, 61, 61, 61, 119, - 68, 114, 1293, 1287, 68, 1281, 114, 120, 68, 61, - 61, 61, 70, 121, 68, 61, 70, 61, 123, 118, - - 124, 125, 70, 61, 68, 61, 119, 68, 114, 61, - 61, 68, 70, 114, 120, 68, 127, 128, 1268, 70, - 121, 68, 61, 70, 61, 123, 1255, 124, 125, 70, - 61, 68, 61, 1233, 129, 1211, 61, 61, 1168, 70, - 1125, 1053, 981, 127, 128, 61, 62, 62, 885, 62, - 62, 62, 62, 62, 62, 789, 664, 130, 71, 72, - 73, 129, 71, 72, 73, 62, 62, 62, 71, 72, - 73, 131, 62, 77, 131, 126, 62, 77, 71, 72, - 73, 126, 62, 77, 130, 71, 72, 73, 132, 71, - 72, 73, 62, 77, 539, 71, 72, 73, 131, 62, - - 77, 131, 126, 62, 77, 71, 72, 73, 126, 62, - 77, 414, 288, 83, 133, 132, 83, 83, 135, 62, - 77, 62, 63, 83, 78, 136, 63, 138, 78, 63, - 63, 139, 78, 83, 140, 141, 63, 144, 78, 63, - 83, 133, 63, 83, 83, 135, 63, 192, 78, 63, - 83, 78, 136, 63, 138, 78, 63, 63, 139, 78, - 83, 140, 141, 63, 144, 78, 63, 190, 90, 63, - 88, 85, 82, 63, 64, 78, 82, 84, 64, 137, - 82, 84, 64, 142, 145, 142, 82, 84, 64, 137, - 146, 64, 147, 149, 137, 137, 82, 84, 64, 82, - - 60, 64, 59, 82, 84, 64, 137, 82, 84, 64, - 142, 145, 142, 82, 84, 64, 137, 146, 64, 147, - 149, 137, 137, 82, 84, 64, 65, 111, 111, 111, - 65, 111, 115, 65, 115, 65, 65, 115, 150, 143, - 65, 143, 151, 115, 153, 65, 65, 52, 148, 154, - 115, 148, 143, 65, 111, 111, 111, 65, 111, 115, - 65, 115, 65, 65, 115, 150, 143, 65, 143, 151, - 115, 153, 65, 65, 66, 148, 154, 115, 148, 143, - 155, 66, 66, 156, 157, 66, 158, 122, 66, 122, - 158, 66, 159, 122, 66, 51, 161, 47, 45, 163, - - 122, 66, 20, 19, 122, 11, 166, 155, 66, 66, - 156, 157, 66, 158, 122, 66, 122, 158, 66, 159, - 122, 66, 69, 161, 160, 162, 163, 122, 69, 69, - 69, 122, 165, 166, 167, 69, 162, 160, 168, 169, - 69, 7, 160, 4, 170, 3, 165, 172, 0, 69, - 173, 160, 162, 174, 177, 69, 69, 69, 0, 165, - 0, 167, 69, 162, 160, 168, 169, 69, 74, 160, - 164, 170, 171, 165, 172, 74, 175, 173, 178, 164, - 174, 177, 74, 171, 176, 74, 179, 164, 74, 74, - 0, 176, 179, 0, 176, 74, 175, 164, 181, 171, - - 182, 183, 74, 175, 0, 178, 164, 0, 291, 74, - 171, 176, 74, 179, 164, 74, 74, 75, 176, 179, - 180, 176, 75, 175, 75, 181, 293, 182, 183, 294, - 75, 75, 200, 180, 75, 291, 200, 75, 75, 0, - 0, 0, 200, 296, 75, 0, 0, 180, 298, 75, - 0, 75, 200, 293, 0, 299, 294, 75, 75, 200, - 180, 75, 300, 200, 75, 75, 76, 201, 201, 200, - 296, 301, 201, 76, 0, 298, 302, 76, 201, 200, - 76, 202, 299, 76, 303, 202, 76, 0, 201, 300, - 305, 202, 0, 76, 201, 201, 202, 0, 301, 201, - - 76, 202, 306, 302, 76, 201, 307, 76, 202, 0, - 76, 303, 202, 76, 79, 201, 79, 305, 202, 79, - 79, 0, 79, 202, 79, 308, 79, 79, 202, 306, - 309, 310, 311, 307, 312, 313, 79, 0, 314, 0, - 0, 79, 0, 79, 0, 0, 79, 79, 203, 79, - 203, 79, 308, 79, 79, 203, 203, 309, 310, 311, - 203, 312, 313, 79, 80, 314, 209, 205, 80, 205, - 209, 80, 80, 205, 205, 203, 209, 203, 80, 205, - 315, 80, 203, 203, 316, 317, 209, 203, 80, 0, - 0, 80, 0, 209, 205, 80, 205, 209, 80, 80, - - 205, 205, 0, 209, 0, 80, 205, 315, 80, 0, - 0, 316, 317, 209, 0, 80, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, - 93, 93, 93, 93, 93, 93, 93, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, - 195, 195, 195, 195, 195, 195, 195, 195, 204, 206, - 208, 204, 304, 319, 304, 208, 320, 208, 206, 204, - 206, 204, 208, 321, 0, 206, 204, 208, 0, 304, - - 206, 204, 0, 0, 0, 204, 206, 208, 204, 304, - 319, 304, 208, 320, 208, 206, 204, 206, 204, 208, - 321, 210, 206, 204, 208, 210, 304, 206, 204, 207, - 207, 210, 211, 322, 211, 207, 318, 207, 0, 211, - 0, 210, 207, 207, 211, 0, 323, 207, 210, 324, - 0, 318, 210, 326, 212, 327, 207, 207, 210, 211, - 322, 211, 207, 318, 207, 212, 211, 212, 210, 207, - 207, 211, 212, 323, 207, 0, 324, 212, 318, 0, - 326, 212, 327, 214, 0, 0, 328, 214, 329, 330, - 0, 0, 212, 214, 212, 331, 332, 333, 215, 212, - - 0, 334, 215, 214, 212, 213, 213, 213, 215, 213, - 214, 215, 213, 328, 214, 329, 330, 213, 215, 335, - 214, 336, 331, 332, 333, 215, 337, 216, 334, 215, - 214, 216, 213, 213, 213, 215, 213, 216, 215, 213, - 338, 339, 216, 340, 213, 215, 335, 216, 336, 341, - 0, 342, 343, 337, 216, 344, 0, 345, 216, 0, - 346, 0, 0, 0, 216, 347, 0, 338, 339, 216, - 340, 0, 348, 349, 216, 217, 341, 217, 342, 343, - 217, 351, 344, 218, 345, 218, 217, 346, 217, 218, - 218, 0, 347, 217, 219, 218, 219, 0, 217, 348, - - 349, 219, 217, 219, 217, 352, 219, 217, 351, 354, - 218, 0, 218, 217, 220, 217, 218, 218, 220, 0, - 217, 219, 218, 219, 220, 217, 0, 355, 219, 350, - 219, 0, 352, 219, 220, 221, 354, 221, 222, 350, - 0, 220, 221, 0, 356, 220, 222, 221, 222, 0, - 0, 220, 357, 222, 355, 0, 350, 359, 222, 0, - 360, 220, 221, 361, 221, 222, 350, 223, 362, 221, - 225, 356, 225, 222, 221, 222, 223, 225, 223, 357, - 222, 363, 225, 223, 359, 222, 358, 360, 223, 0, - 361, 0, 0, 365, 223, 362, 358, 225, 366, 225, - - 0, 0, 0, 223, 225, 223, 0, 367, 363, 225, - 223, 0, 226, 358, 226, 223, 224, 227, 224, 226, - 365, 227, 224, 358, 226, 366, 368, 227, 224, 224, - 369, 370, 371, 224, 367, 0, 0, 227, 224, 226, - 0, 226, 0, 224, 227, 224, 226, 373, 227, 224, - 375, 226, 0, 368, 227, 224, 224, 369, 370, 371, - 224, 228, 229, 228, 227, 224, 229, 228, 228, 230, - 0, 230, 229, 228, 373, 376, 230, 375, 0, 374, - 0, 230, 229, 0, 0, 0, 377, 231, 228, 229, - 228, 231, 374, 229, 228, 228, 230, 231, 230, 229, - - 228, 232, 376, 230, 378, 232, 374, 231, 230, 229, - 233, 232, 233, 377, 231, 379, 380, 233, 231, 374, - 233, 232, 233, 234, 231, 234, 0, 0, 232, 0, - 234, 378, 232, 0, 231, 234, 0, 233, 232, 233, - 381, 382, 379, 380, 233, 0, 383, 233, 232, 233, - 234, 235, 234, 235, 236, 237, 236, 234, 235, 237, - 235, 236, 234, 235, 384, 237, 236, 381, 382, 385, - 372, 0, 240, 383, 240, 237, 387, 0, 235, 240, - 235, 236, 237, 236, 240, 235, 237, 235, 236, 372, - 235, 384, 237, 236, 238, 388, 385, 372, 238, 240, - - 389, 240, 237, 387, 238, 238, 240, 0, 241, 242, - 0, 240, 241, 242, 238, 0, 372, 390, 241, 242, - 0, 238, 388, 0, 391, 238, 0, 389, 241, 242, - 0, 238, 238, 243, 243, 241, 242, 243, 392, 241, - 242, 238, 239, 243, 390, 241, 242, 247, 393, 247, - 239, 391, 239, 243, 247, 241, 242, 239, 239, 247, - 243, 243, 239, 0, 243, 392, 394, 0, 0, 239, - 243, 0, 0, 0, 247, 393, 247, 239, 395, 239, - 243, 247, 0, 0, 239, 239, 247, 396, 397, 239, - 244, 399, 0, 394, 244, 246, 244, 246, 244, 257, - - 244, 246, 246, 257, 401, 395, 0, 246, 403, 257, - 244, 0, 404, 0, 396, 397, 0, 244, 399, 257, - 0, 244, 246, 244, 246, 244, 257, 244, 246, 246, - 257, 401, 405, 400, 246, 403, 257, 244, 245, 404, - 245, 248, 400, 248, 406, 402, 257, 402, 248, 245, - 249, 245, 249, 248, 407, 408, 245, 249, 249, 405, - 400, 245, 249, 0, 409, 245, 0, 245, 248, 400, - 248, 406, 402, 0, 402, 248, 245, 249, 245, 249, - 248, 407, 408, 245, 249, 249, 0, 0, 245, 249, - 250, 409, 250, 251, 0, 251, 411, 250, 250, 0, - - 251, 250, 250, 252, 0, 251, 254, 410, 254, 412, - 0, 410, 0, 254, 252, 0, 252, 250, 254, 250, - 251, 252, 251, 411, 250, 250, 252, 251, 250, 250, - 252, 253, 251, 254, 410, 254, 412, 253, 410, 253, - 254, 252, 255, 252, 253, 254, 0, 540, 252, 253, - 255, 0, 255, 252, 0, 0, 541, 255, 253, 542, - 543, 0, 255, 544, 253, 545, 253, 546, 547, 255, - 548, 253, 550, 256, 540, 256, 253, 255, 258, 255, - 256, 256, 258, 541, 255, 256, 542, 543, 258, 255, - 544, 258, 545, 0, 546, 547, 0, 548, 258, 550, - - 256, 553, 256, 0, 0, 258, 259, 256, 256, 258, - 259, 554, 256, 555, 259, 258, 556, 558, 258, 260, - 259, 559, 0, 260, 261, 258, 261, 560, 553, 260, - 259, 261, 561, 259, 563, 0, 261, 259, 554, 260, - 555, 259, 564, 556, 558, 0, 260, 259, 559, 262, - 260, 261, 0, 261, 560, 565, 260, 259, 261, 561, - 262, 563, 262, 261, 0, 566, 260, 262, 263, 564, - 567, 568, 262, 263, 569, 263, 262, 570, 0, 264, - 263, 264, 565, 571, 0, 263, 264, 262, 0, 262, - 264, 264, 566, 0, 262, 263, 574, 567, 568, 262, - - 263, 569, 263, 575, 570, 265, 264, 263, 264, 265, - 571, 265, 263, 264, 576, 268, 265, 264, 264, 268, - 267, 265, 0, 574, 267, 268, 577, 578, 267, 579, - 575, 0, 265, 0, 267, 268, 265, 0, 265, 0, - 0, 576, 268, 265, 267, 580, 268, 267, 265, 266, - 0, 267, 268, 577, 578, 267, 579, 0, 266, 269, - 266, 267, 268, 269, 270, 266, 266, 269, 270, 0, - 266, 267, 580, 269, 270, 0, 266, 270, 582, 0, - 583, 584, 0, 269, 270, 266, 269, 266, 587, 588, - 269, 270, 266, 266, 269, 270, 272, 266, 271, 272, - - 269, 270, 271, 272, 270, 582, 271, 583, 584, 272, - 269, 270, 271, 0, 0, 587, 588, 274, 590, 272, - 0, 274, 271, 272, 0, 271, 272, 274, 0, 271, - 272, 592, 0, 271, 0, 593, 272, 274, 594, 271, - 273, 273, 273, 595, 274, 590, 272, 273, 274, 271, - 0, 275, 273, 596, 274, 275, 0, 0, 592, 275, - 597, 275, 593, 600, 274, 594, 0, 273, 273, 273, - 595, 275, 0, 276, 273, 0, 604, 276, 275, 273, - 596, 606, 275, 276, 276, 277, 275, 597, 275, 607, - 600, 609, 277, 276, 0, 611, 279, 279, 275, 277, - - 276, 279, 277, 604, 276, 277, 0, 279, 606, 0, - 276, 276, 277, 0, 0, 612, 607, 279, 609, 277, - 276, 280, 611, 279, 279, 280, 277, 0, 279, 277, - 613, 280, 277, 278, 279, 615, 278, 0, 0, 598, - 278, 280, 612, 278, 279, 616, 278, 281, 280, 281, - 598, 282, 280, 281, 281, 282, 278, 613, 280, 281, - 278, 282, 615, 278, 282, 283, 598, 278, 280, 283, - 278, 282, 616, 278, 281, 283, 281, 598, 282, 0, - 281, 281, 282, 278, 0, 283, 281, 0, 282, 284, - 617, 282, 283, 284, 0, 618, 283, 285, 282, 284, - - 620, 285, 283, 621, 284, 285, 420, 623, 420, 284, - 624, 285, 283, 420, 610, 610, 284, 617, 420, 625, - 284, 285, 618, 0, 285, 0, 284, 620, 285, 0, - 621, 284, 285, 420, 623, 420, 284, 624, 285, 0, - 420, 610, 610, 0, 0, 420, 625, 0, 285, 289, - 289, 289, 289, 289, 289, 289, 289, 289, 289, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 416, - 417, 418, 419, 416, 417, 418, 419, 626, 628, 416, - 417, 418, 419, 0, 629, 630, 0, 631, 0, 416, - 417, 418, 419, 0, 0, 0, 416, 417, 418, 419, - - 416, 417, 418, 419, 626, 628, 416, 417, 418, 419, - 422, 629, 630, 421, 631, 421, 416, 417, 418, 419, - 421, 422, 423, 422, 423, 421, 424, 0, 422, 423, - 424, 0, 633, 422, 423, 0, 424, 422, 634, 0, - 421, 635, 421, 636, 0, 0, 424, 421, 422, 423, - 422, 423, 421, 424, 425, 422, 423, 424, 425, 633, - 422, 423, 426, 424, 425, 634, 426, 427, 635, 639, - 636, 427, 426, 424, 425, 0, 428, 427, 428, 640, - 426, 425, 426, 428, 641, 425, 642, 427, 428, 426, - 429, 425, 429, 426, 427, 643, 639, 429, 427, 426, - - 646, 425, 429, 428, 427, 428, 640, 426, 431, 426, - 428, 641, 431, 642, 427, 428, 0, 429, 431, 429, - 0, 431, 643, 0, 429, 0, 0, 646, 431, 429, - 430, 0, 430, 432, 647, 431, 430, 432, 649, 431, - 650, 0, 430, 432, 651, 431, 433, 430, 431, 432, - 433, 0, 430, 432, 433, 431, 433, 430, 435, 430, - 432, 647, 435, 430, 432, 649, 433, 650, 435, 430, - 432, 651, 0, 433, 430, 0, 432, 433, 435, 430, - 432, 433, 434, 433, 0, 435, 434, 0, 652, 435, - 436, 653, 434, 433, 436, 435, 654, 434, 436, 437, - - 655, 437, 434, 0, 436, 435, 437, 656, 0, 434, - 0, 437, 0, 434, 436, 652, 657, 436, 653, 434, - 659, 436, 661, 654, 434, 436, 437, 655, 437, 434, - 438, 436, 438, 437, 656, 439, 438, 438, 437, 439, - 663, 436, 438, 657, 440, 439, 440, 659, 792, 661, - 794, 440, 796, 0, 797, 439, 440, 438, 441, 438, - 441, 798, 439, 438, 438, 441, 439, 663, 0, 438, - 441, 440, 439, 440, 0, 792, 442, 794, 440, 796, - 442, 797, 439, 440, 0, 441, 442, 441, 798, 799, - 443, 444, 441, 800, 443, 444, 442, 441, 443, 0, - - 801, 444, 802, 442, 443, 803, 444, 442, 0, 0, - 804, 444, 0, 442, 443, 806, 799, 443, 444, 0, - 800, 443, 444, 442, 445, 443, 445, 801, 444, 802, - 445, 443, 803, 444, 807, 446, 445, 804, 444, 446, - 0, 443, 806, 0, 447, 446, 445, 0, 447, 808, - 809, 445, 810, 445, 447, 446, 0, 445, 0, 447, - 0, 807, 446, 445, 447, 0, 446, 448, 0, 0, - 448, 447, 446, 445, 448, 447, 808, 809, 0, 810, - 448, 447, 446, 450, 811, 449, 447, 450, 451, 449, - 448, 447, 451, 450, 448, 449, 449, 448, 451, 813, - - 814, 448, 0, 450, 815, 449, 0, 448, 451, 0, - 450, 811, 449, 816, 450, 451, 449, 448, 0, 451, - 450, 0, 449, 449, 453, 451, 813, 814, 453, 452, - 450, 815, 449, 452, 453, 451, 454, 452, 454, 0, - 816, 0, 454, 452, 453, 455, 0, 455, 454, 817, - 818, 453, 455, 452, 819, 453, 452, 455, 454, 820, - 452, 453, 0, 454, 452, 454, 456, 0, 456, 454, - 452, 453, 455, 456, 455, 454, 817, 818, 456, 455, - 452, 819, 821, 822, 455, 454, 820, 458, 0, 458, - 457, 0, 457, 456, 458, 456, 457, 457, 0, 458, - - 456, 0, 457, 0, 825, 456, 826, 0, 459, 821, - 822, 0, 459, 461, 458, 461, 458, 457, 459, 457, - 461, 458, 827, 457, 457, 461, 458, 0, 459, 457, - 460, 825, 828, 826, 460, 459, 0, 0, 460, 459, - 461, 0, 461, 0, 460, 459, 0, 461, 829, 827, - 0, 0, 461, 832, 460, 459, 835, 460, 836, 828, - 838, 460, 462, 462, 462, 460, 463, 463, 463, 462, - 464, 460, 464, 463, 462, 829, 837, 464, 463, 837, - 832, 460, 464, 835, 0, 836, 0, 838, 0, 462, - 462, 462, 0, 463, 463, 463, 462, 464, 465, 464, - - 463, 462, 841, 837, 464, 463, 837, 467, 465, 464, - 465, 467, 466, 467, 466, 465, 844, 845, 467, 466, - 465, 466, 0, 467, 466, 465, 0, 846, 847, 841, - 848, 849, 0, 852, 467, 465, 853, 465, 467, 466, - 467, 466, 465, 844, 845, 467, 466, 465, 466, 468, - 467, 466, 469, 468, 846, 847, 469, 848, 849, 468, - 852, 470, 469, 853, 0, 470, 0, 469, 854, 468, - 0, 470, 469, 855, 470, 0, 468, 856, 0, 469, - 468, 470, 0, 469, 858, 0, 468, 471, 470, 469, - 0, 471, 470, 471, 469, 854, 468, 471, 470, 469, - - 855, 470, 472, 859, 856, 473, 472, 471, 470, 473, - 0, 858, 472, 861, 471, 473, 0, 474, 471, 862, - 471, 474, 472, 863, 471, 473, 0, 474, 0, 472, - 859, 475, 473, 472, 471, 475, 473, 474, 0, 472, - 861, 475, 473, 476, 474, 864, 862, 476, 474, 472, - 863, 475, 473, 476, 474, 477, 0, 0, 475, 477, - 866, 0, 475, 476, 474, 477, 0, 867, 475, 868, - 476, 477, 864, 869, 476, 477, 0, 478, 475, 478, - 476, 479, 477, 479, 478, 0, 477, 866, 479, 478, - 476, 0, 477, 479, 867, 0, 868, 870, 477, 481, - - 869, 0, 477, 481, 478, 480, 478, 480, 479, 481, - 479, 478, 480, 480, 0, 479, 478, 480, 482, 481, - 479, 485, 482, 485, 870, 485, 481, 871, 482, 0, - 481, 485, 480, 0, 480, 872, 481, 873, 482, 480, - 480, 485, 483, 483, 480, 482, 481, 483, 485, 482, - 485, 874, 485, 483, 871, 482, 488, 486, 485, 486, - 488, 486, 872, 483, 873, 482, 488, 486, 485, 483, - 483, 488, 0, 876, 483, 0, 488, 486, 874, 877, - 483, 0, 878, 488, 486, 0, 486, 488, 486, 880, - 483, 484, 487, 488, 486, 484, 487, 0, 488, 484, - - 876, 484, 487, 488, 486, 484, 877, 881, 487, 878, - 0, 882, 487, 0, 0, 484, 880, 489, 484, 487, - 490, 489, 484, 487, 490, 982, 484, 489, 484, 487, - 490, 984, 484, 489, 881, 487, 986, 489, 882, 487, - 490, 491, 484, 987, 489, 491, 0, 490, 489, 491, - 988, 490, 982, 0, 489, 491, 989, 490, 984, 492, - 489, 492, 0, 986, 489, 491, 492, 490, 491, 991, - 987, 492, 491, 493, 0, 493, 491, 988, 0, 493, - 493, 993, 491, 989, 0, 493, 492, 494, 492, 494, - 994, 495, 491, 492, 494, 495, 991, 0, 492, 494, - - 493, 495, 493, 0, 995, 496, 493, 493, 993, 496, - 996, 495, 493, 0, 494, 496, 494, 994, 495, 0, - 497, 494, 495, 997, 497, 496, 494, 499, 495, 499, - 497, 995, 496, 497, 499, 0, 496, 996, 495, 499, - 497, 0, 496, 999, 1001, 0, 503, 497, 503, 0, - 997, 497, 496, 503, 499, 0, 499, 497, 503, 1005, - 497, 499, 501, 501, 501, 0, 499, 497, 498, 501, - 999, 1001, 498, 503, 501, 503, 498, 1007, 0, 1008, - 503, 1009, 498, 1016, 1017, 503, 1005, 498, 1018, 501, - 501, 501, 498, 0, 1021, 498, 501, 0, 1023, 498, - - 502, 501, 0, 498, 1007, 502, 1008, 502, 1009, 498, - 1016, 1017, 502, 1025, 498, 1018, 505, 502, 505, 498, - 500, 1021, 1027, 505, 505, 1023, 1028, 502, 505, 500, - 0, 500, 502, 500, 502, 1029, 500, 0, 0, 502, - 1025, 500, 0, 505, 502, 505, 504, 500, 1030, 1027, - 505, 505, 1031, 1028, 1033, 505, 500, 504, 500, 504, - 500, 506, 1029, 500, 504, 506, 1034, 506, 500, 504, - 1035, 1036, 506, 504, 0, 1030, 0, 506, 507, 1031, - 507, 1033, 1038, 0, 504, 507, 504, 0, 506, 0, - 507, 504, 506, 1034, 506, 1040, 504, 1035, 1036, 506, - - 1042, 508, 0, 508, 506, 507, 509, 507, 508, 1038, - 509, 510, 507, 508, 511, 510, 509, 507, 511, 512, - 1043, 510, 1040, 512, 511, 1044, 509, 1042, 508, 512, - 508, 510, 0, 509, 511, 508, 0, 509, 510, 512, - 508, 511, 510, 509, 0, 511, 512, 1043, 510, 0, - 512, 511, 1044, 509, 0, 513, 512, 0, 510, 513, - 514, 511, 0, 515, 514, 513, 512, 515, 513, 516, - 514, 516, 1045, 515, 515, 513, 516, 517, 514, 517, - 514, 516, 513, 515, 517, 517, 513, 514, 0, 517, - 515, 514, 513, 0, 515, 513, 516, 514, 516, 1045, - - 515, 515, 513, 516, 517, 514, 517, 514, 516, 1046, - 515, 517, 517, 518, 1051, 518, 517, 519, 1052, 519, - 518, 518, 1130, 1134, 519, 518, 520, 1135, 520, 519, - 520, 1138, 0, 520, 0, 0, 1046, 0, 520, 0, - 518, 1051, 518, 1139, 519, 1052, 519, 518, 518, 1130, - 1134, 519, 518, 520, 1135, 520, 519, 520, 1138, 521, - 520, 521, 522, 1143, 522, 520, 521, 521, 0, 522, - 1139, 521, 523, 1145, 522, 524, 523, 0, 1146, 524, - 1149, 0, 523, 0, 0, 524, 521, 1150, 521, 522, - 1143, 522, 523, 521, 521, 524, 522, 0, 521, 523, - - 1145, 522, 524, 523, 526, 1146, 524, 1149, 525, 523, - 525, 526, 524, 526, 1150, 525, 1151, 0, 526, 523, - 525, 1152, 524, 526, 527, 0, 529, 0, 527, 528, - 529, 526, 0, 528, 527, 525, 529, 525, 526, 528, - 526, 528, 525, 1151, 527, 526, 529, 525, 1152, 528, - 526, 527, 531, 529, 531, 527, 528, 529, 1155, 531, - 528, 527, 0, 529, 531, 0, 528, 0, 528, 1156, - 530, 527, 0, 529, 530, 1159, 528, 1161, 530, 531, - 532, 531, 532, 0, 530, 1155, 531, 532, 0, 532, - 1162, 531, 532, 0, 530, 0, 1156, 530, 1163, 533, - - 1164, 530, 1159, 1165, 1161, 530, 0, 532, 533, 532, - 533, 530, 1212, 1215, 532, 533, 532, 1162, 1218, 532, - 533, 530, 534, 1219, 534, 1163, 533, 1164, 1222, 534, - 1165, 0, 0, 534, 534, 533, 535, 533, 535, 1212, - 1215, 0, 533, 535, 535, 1218, 0, 533, 535, 534, - 1219, 534, 536, 1223, 536, 1222, 534, 1224, 536, 536, - 534, 534, 537, 535, 536, 535, 537, 1228, 537, 0, - 535, 535, 1229, 537, 0, 535, 0, 0, 537, 536, - 1223, 536, 1213, 1213, 1224, 536, 536, 1230, 1232, 537, - 538, 536, 538, 537, 1228, 537, 538, 538, 1257, 1229, - - 537, 665, 538, 665, 666, 537, 666, 665, 665, 1258, - 666, 666, 1261, 665, 1230, 1232, 666, 538, 0, 538, - 1213, 0, 667, 538, 538, 1257, 667, 0, 665, 538, - 665, 666, 667, 666, 665, 665, 1258, 666, 666, 1261, - 665, 668, 667, 666, 669, 668, 671, 1213, 669, 667, - 671, 668, 1266, 667, 669, 1270, 671, 669, 670, 667, - 670, 668, 1282, 1282, 669, 670, 671, 0, 668, 667, - 670, 669, 668, 671, 0, 669, 0, 671, 668, 1266, - 0, 669, 1270, 671, 669, 670, 1283, 670, 668, 1286, - 0, 669, 670, 671, 672, 673, 672, 670, 674, 673, - - 0, 672, 674, 675, 1282, 673, 672, 675, 674, 0, - 0, 675, 1289, 1283, 0, 673, 1286, 675, 674, 0, - 0, 672, 673, 672, 0, 674, 673, 675, 672, 674, - 675, 1282, 673, 672, 675, 674, 676, 677, 675, 1289, - 676, 677, 673, 1294, 675, 674, 676, 677, 0, 1298, - 0, 678, 1302, 1304, 675, 678, 676, 677, 0, 678, - 1235, 1235, 0, 676, 677, 678, 0, 676, 677, 1306, - 1294, 0, 0, 676, 677, 678, 1298, 679, 678, 1302, - 1304, 679, 678, 676, 677, 679, 678, 679, 1308, 680, - 681, 682, 678, 680, 681, 682, 1306, 679, 1235, 680, - - 681, 682, 678, 681, 679, 1310, 0, 0, 679, 680, - 681, 682, 679, 0, 679, 1308, 680, 681, 682, 683, - 680, 681, 682, 683, 679, 1235, 680, 681, 682, 683, - 681, 1312, 1310, 684, 683, 684, 680, 681, 682, 683, - 684, 1314, 0, 685, 686, 684, 683, 685, 686, 0, - 683, 0, 0, 685, 686, 1316, 683, 1318, 1312, 686, - 684, 683, 684, 685, 686, 0, 683, 684, 1314, 687, - 685, 686, 684, 687, 685, 686, 688, 0, 688, 687, - 685, 686, 1316, 688, 1318, 1320, 686, 0, 688, 687, - 685, 686, 689, 689, 689, 0, 687, 1288, 1288, 689, - - 687, 0, 0, 688, 689, 688, 687, 0, 0, 0, - 688, 0, 1320, 0, 0, 688, 687, 0, 0, 689, - 689, 689, 0, 690, 0, 690, 689, 0, 0, 0, - 690, 689, 690, 0, 691, 690, 691, 0, 0, 1288, - 0, 691, 691, 0, 0, 0, 691, 692, 0, 0, - 690, 0, 690, 0, 0, 0, 0, 690, 692, 690, - 692, 691, 690, 691, 0, 692, 1288, 0, 691, 691, - 692, 0, 0, 691, 692, 694, 693, 0, 693, 0, - 0, 0, 693, 693, 694, 692, 694, 692, 693, 0, - 0, 694, 692, 0, 695, 0, 694, 692, 695, 0, - - 0, 0, 694, 693, 695, 693, 0, 0, 0, 693, - 693, 694, 0, 694, 695, 693, 0, 696, 694, 696, - 697, 695, 697, 694, 696, 695, 698, 697, 698, 696, - 705, 695, 697, 698, 705, 0, 0, 0, 698, 0, - 705, 695, 0, 0, 696, 0, 696, 697, 0, 697, - 705, 696, 0, 698, 697, 698, 696, 705, 0, 697, - 698, 705, 699, 0, 699, 698, 699, 705, 700, 699, - 700, 0, 700, 0, 699, 700, 701, 705, 701, 0, - 700, 0, 0, 701, 0, 701, 0, 0, 701, 699, - 0, 699, 0, 699, 0, 700, 699, 700, 703, 700, - - 0, 699, 700, 701, 0, 701, 702, 700, 702, 703, - 701, 703, 701, 702, 702, 701, 703, 0, 702, 704, - 0, 703, 0, 0, 706, 703, 0, 0, 706, 0, - 704, 0, 704, 702, 706, 702, 703, 704, 703, 0, - 702, 702, 704, 703, 706, 702, 704, 0, 703, 0, - 707, 706, 708, 0, 707, 706, 708, 704, 0, 704, - 707, 706, 708, 0, 704, 707, 0, 0, 0, 704, - 707, 706, 708, 0, 709, 0, 710, 707, 709, 708, - 710, 707, 709, 708, 0, 0, 710, 707, 709, 708, - 711, 0, 707, 0, 711, 0, 710, 707, 709, 708, - - 711, 709, 0, 710, 712, 709, 0, 710, 712, 709, - 711, 0, 712, 710, 0, 709, 0, 711, 712, 0, - 714, 711, 713, 710, 714, 709, 713, 711, 712, 0, - 714, 712, 713, 713, 715, 712, 715, 711, 0, 712, - 714, 715, 713, 0, 0, 712, 715, 714, 0, 713, - 0, 714, 0, 713, 0, 712, 0, 714, 0, 713, - 713, 715, 0, 715, 716, 0, 716, 714, 715, 713, - 717, 716, 717, 715, 718, 719, 716, 717, 718, 719, - 0, 0, 717, 0, 718, 719, 0, 0, 719, 0, - 0, 716, 0, 716, 718, 719, 0, 717, 716, 717, - - 0, 718, 719, 716, 717, 718, 719, 0, 0, 717, - 0, 718, 719, 0, 0, 719, 720, 0, 720, 0, - 0, 718, 719, 720, 721, 0, 721, 722, 720, 722, - 721, 721, 0, 722, 722, 0, 721, 0, 0, 722, - 0, 0, 0, 720, 0, 720, 0, 0, 0, 0, - 720, 721, 0, 721, 722, 720, 722, 721, 721, 0, - 722, 722, 0, 721, 0, 0, 722, 723, 724, 725, - 724, 725, 723, 0, 723, 724, 725, 0, 723, 723, - 724, 725, 0, 0, 723, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 723, 724, 725, 724, 725, 723, - - 0, 723, 724, 725, 0, 723, 723, 724, 725, 0, - 726, 723, 726, 727, 728, 727, 728, 726, 0, 0, - 727, 728, 726, 0, 0, 727, 728, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 726, 0, 726, - 727, 728, 727, 728, 726, 0, 0, 727, 728, 726, - 0, 0, 727, 728, 729, 0, 729, 730, 731, 730, - 731, 729, 729, 0, 730, 731, 729, 0, 0, 730, - 731, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 729, 0, 729, 730, 731, 730, 731, 729, 729, - 732, 730, 731, 729, 732, 733, 730, 731, 734, 733, - - 732, 0, 734, 736, 735, 733, 735, 736, 734, 736, - 732, 735, 735, 0, 736, 733, 735, 732, 734, 736, - 0, 732, 733, 0, 0, 734, 733, 732, 0, 734, - 736, 735, 733, 735, 736, 734, 736, 732, 735, 735, - 738, 736, 733, 735, 738, 734, 736, 737, 739, 737, - 738, 0, 739, 737, 737, 0, 0, 0, 739, 737, - 738, 0, 0, 0, 0, 0, 0, 738, 739, 0, - 0, 738, 0, 0, 737, 739, 737, 738, 0, 739, - 737, 737, 740, 0, 740, 739, 737, 738, 740, 0, - 0, 0, 741, 742, 740, 739, 741, 742, 0, 0, - - 0, 0, 741, 742, 740, 0, 742, 0, 0, 740, - 0, 740, 741, 742, 0, 740, 0, 0, 0, 741, - 742, 740, 743, 741, 742, 0, 743, 0, 0, 741, - 742, 740, 743, 742, 744, 743, 0, 745, 744, 741, - 742, 745, 743, 0, 744, 745, 746, 745, 0, 743, - 746, 0, 0, 743, 744, 0, 746, 745, 0, 743, - 0, 744, 743, 0, 745, 744, 746, 0, 745, 743, - 0, 744, 745, 746, 745, 747, 748, 746, 0, 747, - 748, 744, 0, 746, 745, 747, 748, 0, 0, 0, - 749, 0, 0, 746, 749, 747, 748, 0, 749, 0, - - 0, 0, 747, 748, 749, 0, 747, 748, 0, 0, - 0, 0, 747, 748, 749, 0, 750, 749, 0, 0, - 750, 749, 747, 748, 750, 749, 0, 0, 751, 752, - 750, 749, 751, 752, 0, 0, 0, 0, 751, 752, - 750, 749, 753, 750, 0, 0, 753, 750, 751, 752, - 753, 750, 753, 0, 0, 751, 752, 750, 0, 751, - 752, 0, 753, 0, 0, 751, 752, 750, 754, 753, - 755, 0, 754, 753, 755, 751, 752, 753, 754, 753, - 755, 754, 757, 0, 0, 755, 757, 0, 754, 753, - 755, 756, 757, 0, 756, 754, 0, 755, 756, 754, - - 0, 755, 757, 0, 756, 754, 0, 755, 754, 757, - 0, 0, 755, 757, 756, 754, 758, 755, 756, 757, - 758, 756, 0, 760, 758, 756, 758, 0, 759, 757, - 759, 756, 760, 0, 760, 759, 758, 0, 761, 760, - 759, 756, 761, 758, 760, 0, 0, 758, 761, 0, - 760, 758, 0, 758, 0, 759, 0, 759, 761, 760, - 762, 760, 759, 758, 762, 761, 760, 759, 763, 761, - 762, 760, 763, 765, 764, 761, 764, 765, 763, 0, - 762, 764, 0, 765, 0, 761, 764, 762, 763, 0, - 0, 762, 766, 765, 0, 763, 766, 762, 0, 763, - - 765, 764, 766, 764, 765, 763, 0, 762, 764, 0, - 765, 0, 766, 764, 767, 763, 0, 768, 767, 766, - 765, 768, 769, 766, 767, 0, 769, 768, 0, 766, - 0, 771, 769, 771, 767, 0, 770, 768, 771, 766, - 770, 767, 769, 771, 768, 767, 770, 0, 768, 769, - 772, 767, 772, 769, 768, 0, 770, 772, 771, 769, - 771, 767, 772, 770, 768, 771, 0, 770, 0, 769, - 771, 774, 0, 770, 773, 0, 773, 772, 0, 772, - 774, 773, 774, 770, 772, 0, 773, 774, 775, 772, - 775, 0, 774, 0, 0, 775, 0, 775, 774, 0, - - 775, 773, 0, 773, 776, 0, 776, 774, 773, 774, - 0, 776, 0, 773, 774, 775, 776, 775, 0, 774, - 0, 0, 775, 777, 775, 777, 778, 775, 0, 0, - 777, 776, 777, 776, 779, 777, 779, 778, 776, 778, - 0, 779, 779, 776, 778, 0, 779, 0, 0, 778, - 777, 0, 777, 778, 0, 0, 0, 777, 0, 777, - 780, 779, 777, 779, 778, 780, 778, 780, 779, 779, - 781, 778, 780, 779, 781, 782, 778, 780, 782, 782, - 781, 0, 0, 0, 0, 782, 0, 780, 0, 0, - 781, 0, 780, 0, 780, 782, 0, 781, 0, 780, - - 0, 781, 782, 0, 780, 782, 782, 781, 0, 783, - 784, 785, 782, 783, 784, 785, 0, 781, 0, 783, - 784, 785, 782, 786, 787, 0, 784, 786, 787, 783, - 784, 785, 0, 786, 787, 0, 783, 784, 785, 0, - 783, 784, 785, 786, 787, 0, 783, 784, 785, 0, - 786, 787, 0, 784, 786, 787, 783, 784, 785, 0, - 786, 787, 788, 0, 788, 886, 887, 886, 887, 788, - 786, 787, 886, 887, 788, 0, 0, 886, 887, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, - 0, 788, 886, 887, 886, 887, 788, 0, 0, 886, - - 887, 788, 0, 0, 886, 887, 888, 889, 888, 889, - 0, 890, 891, 888, 889, 890, 891, 0, 888, 889, - 888, 890, 891, 0, 0, 0, 0, 0, 0, 0, - 0, 890, 891, 888, 889, 888, 889, 0, 890, 891, - 888, 889, 890, 891, 0, 888, 889, 888, 890, 891, - 892, 893, 0, 0, 892, 893, 0, 0, 890, 891, - 892, 893, 0, 895, 895, 894, 893, 0, 895, 894, - 892, 893, 0, 894, 895, 0, 0, 892, 893, 894, - 0, 892, 893, 0, 895, 0, 0, 892, 893, 894, - 895, 895, 894, 893, 0, 895, 894, 892, 893, 0, - - 894, 895, 896, 897, 896, 897, 894, 0, 896, 0, - 897, 895, 0, 0, 896, 897, 894, 0, 0, 0, - 0, 0, 0, 0, 896, 0, 898, 0, 898, 896, - 897, 896, 897, 898, 898, 896, 899, 897, 898, 900, - 899, 896, 897, 900, 901, 902, 899, 902, 901, 900, - 0, 896, 902, 898, 901, 898, 899, 902, 903, 900, - 898, 898, 903, 899, 901, 898, 900, 899, 903, 0, - 900, 901, 902, 899, 902, 901, 900, 0, 903, 902, - 0, 901, 0, 899, 902, 903, 900, 0, 904, 903, - 0, 901, 904, 905, 0, 903, 907, 905, 904, 0, - - 907, 905, 906, 0, 906, 903, 907, 905, 904, 906, - 0, 0, 0, 0, 906, 904, 907, 905, 0, 904, - 905, 0, 908, 907, 905, 904, 908, 907, 905, 906, - 0, 906, 908, 907, 905, 904, 906, 0, 0, 0, - 0, 906, 908, 907, 905, 0, 909, 910, 0, 908, - 909, 910, 0, 908, 0, 0, 909, 910, 911, 908, - 911, 0, 910, 0, 0, 911, 909, 910, 0, 908, - 911, 912, 0, 909, 910, 912, 913, 909, 910, 0, - 913, 912, 0, 909, 910, 911, 913, 911, 0, 910, - 0, 912, 911, 909, 910, 914, 913, 911, 912, 914, - - 0, 0, 912, 913, 916, 914, 916, 913, 912, 0, - 914, 916, 0, 913, 0, 914, 916, 0, 912, 0, - 915, 0, 914, 913, 915, 0, 914, 0, 0, 0, - 915, 916, 914, 916, 0, 915, 0, 914, 916, 0, - 915, 0, 914, 916, 917, 0, 0, 915, 917, 919, - 0, 915, 0, 919, 917, 0, 0, 915, 923, 919, - 923, 0, 915, 0, 917, 923, 918, 915, 918, 919, - 923, 917, 918, 0, 0, 917, 919, 0, 918, 0, - 919, 917, 0, 0, 0, 923, 919, 923, 918, 0, - 920, 917, 923, 918, 920, 918, 919, 923, 921, 918, - - 920, 0, 921, 0, 0, 918, 0, 0, 921, 0, - 920, 0, 0, 0, 0, 918, 921, 920, 921, 0, - 0, 920, 0, 0, 922, 921, 0, 920, 922, 921, - 0, 0, 0, 0, 922, 921, 0, 920, 0, 922, - 924, 925, 924, 921, 922, 921, 925, 924, 925, 0, - 0, 922, 924, 925, 0, 922, 0, 0, 925, 0, - 0, 922, 0, 0, 0, 0, 922, 924, 925, 924, - 926, 922, 926, 925, 924, 925, 927, 926, 927, 924, - 925, 0, 926, 927, 928, 925, 928, 0, 927, 0, - 0, 928, 928, 0, 0, 0, 928, 926, 0, 926, - - 929, 0, 929, 927, 926, 927, 0, 929, 0, 926, - 927, 928, 929, 928, 930, 927, 930, 0, 928, 928, - 0, 930, 0, 928, 0, 0, 930, 929, 931, 929, - 931, 0, 0, 0, 929, 931, 931, 0, 0, 929, - 931, 930, 933, 930, 933, 0, 932, 0, 930, 933, - 932, 0, 933, 930, 933, 931, 932, 931, 934, 0, - 934, 0, 931, 931, 0, 934, 932, 931, 0, 933, - 934, 933, 0, 932, 0, 0, 933, 932, 0, 933, - 0, 933, 935, 932, 935, 934, 0, 934, 936, 935, - 936, 0, 934, 932, 935, 936, 0, 934, 937, 0, - - 936, 0, 0, 0, 0, 0, 937, 0, 937, 935, - 0, 935, 938, 937, 938, 936, 935, 936, 937, 938, - 0, 935, 936, 0, 938, 937, 0, 936, 0, 0, - 939, 0, 939, 937, 940, 937, 0, 939, 940, 938, - 937, 938, 939, 0, 940, 937, 938, 0, 941, 0, - 941, 938, 0, 0, 940, 941, 0, 939, 0, 939, - 941, 940, 0, 0, 939, 940, 0, 942, 0, 939, - 0, 940, 0, 0, 0, 941, 0, 941, 942, 0, - 942, 940, 941, 0, 943, 942, 943, 941, 0, 0, - 942, 943, 943, 944, 942, 0, 943, 944, 0, 944, - - 0, 0, 0, 0, 944, 942, 0, 942, 0, 944, - 0, 943, 942, 943, 0, 0, 0, 942, 943, 943, - 944, 0, 0, 943, 944, 945, 944, 945, 946, 0, - 946, 944, 945, 945, 0, 946, 944, 945, 948, 947, - 946, 947, 948, 0, 0, 0, 947, 0, 948, 0, - 0, 947, 945, 0, 945, 946, 0, 946, 948, 945, - 945, 0, 946, 0, 945, 948, 947, 946, 947, 948, - 0, 0, 949, 947, 0, 948, 949, 0, 947, 950, - 950, 0, 949, 0, 950, 948, 0, 949, 0, 0, - 950, 0, 949, 0, 0, 0, 0, 0, 0, 949, - - 950, 0, 0, 949, 0, 0, 950, 950, 951, 949, - 0, 950, 951, 0, 949, 0, 952, 950, 951, 949, - 952, 951, 0, 0, 0, 0, 952, 950, 951, 952, - 953, 0, 0, 0, 953, 951, 952, 0, 0, 951, - 953, 0, 954, 952, 0, 951, 954, 952, 951, 0, - 953, 0, 954, 952, 955, 951, 952, 953, 955, 0, - 0, 953, 954, 952, 955, 0, 956, 953, 0, 954, - 956, 0, 0, 954, 955, 0, 956, 953, 0, 954, - 957, 955, 0, 0, 957, 955, 956, 0, 957, 954, - 0, 955, 958, 956, 957, 0, 958, 956, 961, 0, - - 958, 955, 961, 956, 957, 0, 958, 957, 961, 959, - 959, 957, 0, 956, 959, 957, 958, 0, 961, 958, - 959, 957, 962, 958, 960, 961, 962, 958, 960, 961, - 959, 957, 962, 958, 960, 961, 959, 959, 0, 960, - 0, 959, 962, 958, 960, 961, 0, 959, 0, 962, - 964, 960, 0, 962, 964, 960, 0, 959, 964, 962, - 0, 960, 963, 963, 964, 0, 960, 963, 965, 962, - 965, 960, 0, 963, 964, 965, 0, 964, 0, 0, - 965, 964, 0, 963, 0, 964, 966, 0, 966, 963, - 963, 964, 966, 966, 963, 965, 0, 965, 966, 0, - - 963, 964, 965, 0, 967, 0, 967, 965, 0, 0, - 963, 967, 967, 966, 0, 966, 967, 968, 0, 966, - 966, 0, 0, 969, 0, 966, 0, 0, 968, 0, - 968, 967, 0, 967, 969, 968, 969, 0, 967, 967, - 968, 969, 0, 967, 968, 0, 969, 970, 0, 970, - 969, 0, 0, 0, 970, 968, 0, 968, 971, 970, - 971, 969, 968, 969, 0, 971, 0, 968, 969, 0, - 971, 0, 0, 969, 970, 0, 970, 0, 972, 973, - 973, 970, 972, 0, 973, 971, 970, 971, 972, 0, - 973, 0, 971, 0, 0, 0, 0, 971, 972, 0, - - 973, 0, 0, 0, 974, 972, 973, 973, 974, 972, - 0, 973, 975, 0, 974, 972, 975, 973, 0, 0, - 0, 976, 975, 976, 974, 972, 0, 973, 976, 977, - 0, 974, 975, 976, 0, 974, 0, 0, 0, 975, - 977, 974, 977, 975, 0, 0, 0, 977, 976, 975, - 976, 974, 977, 978, 0, 976, 977, 0, 0, 975, - 976, 979, 0, 979, 978, 0, 978, 977, 979, 977, - 980, 978, 980, 979, 977, 0, 978, 980, 0, 977, - 978, 0, 980, 0, 0, 0, 0, 0, 979, 0, - 979, 978, 1054, 978, 0, 979, 1054, 980, 978, 980, - - 979, 1055, 1054, 978, 980, 1055, 1056, 0, 1056, 980, - 1059, 1055, 1054, 1056, 1059, 1057, 0, 1057, 1056, 1054, - 1059, 1055, 1057, 1054, 1058, 0, 1058, 1057, 1055, 1054, - 1059, 1058, 1055, 1056, 0, 1056, 1058, 1059, 1055, 1054, - 1056, 1059, 1057, 0, 1057, 1056, 1060, 1059, 1055, 1057, - 1060, 1058, 0, 1058, 1057, 0, 1060, 1059, 1058, 0, - 1061, 1060, 1061, 1058, 0, 0, 1060, 1061, 1062, 1063, - 1062, 1063, 1061, 1060, 0, 1062, 1063, 1060, 0, 0, - 1062, 1063, 0, 1060, 0, 0, 0, 1061, 1060, 1061, - 0, 0, 0, 1060, 1061, 1062, 1063, 1062, 1063, 1061, - - 0, 0, 1062, 1063, 1064, 0, 1064, 1062, 1063, 0, - 1065, 1064, 1065, 1066, 1066, 1066, 1064, 1065, 1065, 0, - 1066, 0, 1065, 0, 0, 1066, 0, 0, 0, 0, - 0, 1064, 0, 1064, 0, 0, 0, 1065, 1064, 1065, - 1066, 1066, 1066, 1064, 1065, 1065, 1067, 1066, 0, 1065, - 0, 1068, 1066, 1068, 0, 1067, 0, 1067, 1068, 0, - 0, 0, 1067, 1068, 1069, 0, 1069, 1067, 0, 0, - 0, 1069, 1069, 1067, 0, 0, 1069, 0, 1068, 0, - 1068, 0, 1067, 0, 1067, 1068, 0, 0, 0, 1067, - 1068, 1069, 0, 1069, 1067, 1070, 1071, 1070, 1069, 1069, - - 0, 0, 1070, 1069, 0, 0, 1071, 1070, 1071, 1072, - 0, 1072, 0, 1071, 0, 0, 1072, 0, 1071, 0, - 0, 1072, 1070, 1071, 1070, 0, 0, 0, 1073, 1070, - 0, 0, 0, 1071, 1070, 1071, 1072, 1073, 1072, 1073, - 1071, 0, 0, 1072, 1073, 1071, 0, 0, 1072, 1073, - 1074, 1075, 1074, 1075, 0, 1073, 0, 1074, 1075, 0, - 0, 0, 1074, 1075, 1073, 0, 1073, 0, 0, 0, - 0, 1073, 0, 0, 0, 0, 1073, 1074, 1075, 1074, - 1075, 1076, 1077, 1076, 1074, 1075, 1077, 1078, 1076, 1074, - 1075, 1078, 1077, 1076, 1079, 0, 1079, 1078, 0, 0, - - 0, 1079, 1077, 0, 0, 0, 1079, 1078, 1076, 1077, - 1076, 0, 0, 1077, 1078, 1076, 0, 0, 1078, 1077, - 1076, 1079, 0, 1079, 1078, 0, 0, 0, 1079, 1077, - 1080, 1081, 1080, 1079, 1078, 1081, 1082, 1080, 1080, 0, - 1082, 1081, 1080, 0, 0, 0, 1082, 0, 0, 0, - 1083, 1081, 0, 0, 1083, 0, 1082, 1080, 1081, 1080, - 1083, 0, 1081, 1082, 1080, 1080, 0, 1082, 1081, 1080, - 1083, 0, 1084, 1082, 0, 1085, 1084, 1083, 1081, 1085, - 1086, 1083, 1084, 1082, 1086, 1085, 0, 1083, 0, 0, - 1086, 0, 1084, 0, 1087, 1085, 0, 1083, 1087, 1084, - - 1086, 0, 1085, 1084, 1087, 0, 1085, 1086, 0, 1084, - 0, 1086, 1085, 0, 1087, 0, 1088, 1086, 0, 1084, - 1088, 1087, 1085, 0, 1089, 1087, 1088, 1086, 1089, 1088, - 0, 1087, 0, 0, 1089, 0, 1088, 0, 1090, 0, - 0, 1087, 1090, 1088, 1089, 0, 1090, 1088, 0, 0, - 1091, 1089, 1090, 1088, 1091, 1089, 1088, 0, 0, 0, - 1091, 1089, 1090, 1088, 1092, 1090, 0, 0, 1092, 1090, - 1091, 1089, 0, 1090, 1092, 0, 1093, 1091, 1093, 1090, - 0, 1091, 0, 1093, 1092, 0, 0, 1091, 1093, 1090, - 0, 1092, 1094, 0, 1094, 1092, 0, 1091, 0, 1094, - - 1095, 1092, 1095, 1093, 1094, 1093, 1096, 1095, 1096, 0, - 1093, 1092, 1095, 1096, 0, 1093, 0, 0, 1096, 1094, - 0, 1094, 0, 0, 0, 1097, 1094, 1095, 0, 1095, - 1098, 1094, 1098, 1096, 1095, 1096, 1097, 1098, 1097, 1095, - 1096, 0, 1098, 1097, 0, 1096, 0, 0, 1097, 0, - 0, 0, 1097, 0, 1099, 0, 1099, 1098, 0, 1098, - 0, 1099, 1099, 1097, 1098, 1097, 1099, 1100, 0, 1098, - 1097, 1100, 1101, 0, 0, 1097, 1101, 1100, 0, 0, - 1102, 1099, 1101, 1099, 1102, 0, 0, 1100, 1099, 1099, - 1102, 0, 1101, 1099, 1100, 0, 0, 0, 1100, 1101, - - 1102, 0, 1103, 1101, 1100, 0, 1103, 1102, 0, 1101, - 0, 1102, 1103, 0, 1100, 0, 1104, 1102, 0, 1101, - 1104, 0, 1103, 0, 0, 0, 1104, 1102, 1105, 1103, - 1105, 0, 0, 1103, 1105, 0, 1104, 0, 0, 1103, - 1105, 0, 1106, 1104, 1106, 0, 0, 1104, 1106, 1103, - 1105, 0, 0, 1104, 1106, 1105, 0, 1105, 1107, 0, - 1107, 1105, 0, 1104, 1106, 1107, 1108, 1105, 1108, 1106, - 1107, 1106, 1109, 1108, 1109, 1106, 0, 1105, 1108, 1109, - 0, 1106, 0, 0, 1109, 1107, 0, 1107, 0, 0, - 0, 1106, 1107, 1108, 0, 1108, 1110, 1107, 1110, 1109, - - 1108, 1109, 1111, 1110, 1111, 1108, 1109, 0, 1110, 1111, - 1112, 1109, 1112, 0, 1111, 0, 0, 1112, 0, 0, - 0, 0, 1112, 1110, 0, 1110, 1113, 0, 1113, 1111, - 1110, 1111, 0, 1113, 1114, 1110, 1111, 1112, 1113, 1112, - 0, 1111, 0, 0, 1112, 1114, 1173, 1114, 0, 1112, - 1173, 0, 1114, 1113, 0, 1113, 1173, 1114, 1115, 1116, - 1113, 1114, 0, 0, 0, 1113, 1173, 0, 1116, 1115, - 1116, 1115, 1114, 1173, 1114, 1116, 1115, 1173, 0, 1114, - 1116, 1115, 0, 1173, 1114, 1115, 1116, 0, 0, 0, - 0, 0, 1117, 1173, 1117, 1116, 1115, 1116, 1115, 1117, - - 1117, 0, 1116, 1115, 1117, 1118, 0, 1116, 1115, 0, - 1119, 0, 1119, 1118, 0, 1118, 1120, 1119, 1120, 1117, - 1118, 1117, 1119, 1120, 0, 1118, 1117, 1117, 1120, 0, - 0, 1117, 1118, 0, 1121, 0, 1121, 1119, 0, 1119, - 1118, 1121, 1118, 1120, 1119, 1120, 1121, 1118, 0, 1119, - 1120, 0, 1118, 0, 0, 1120, 0, 1122, 0, 1122, - 1123, 1121, 1123, 1121, 1122, 0, 1123, 1123, 1121, 1122, - 0, 0, 1123, 1121, 0, 0, 1124, 0, 1124, 0, - 0, 0, 0, 1124, 1122, 0, 1122, 1123, 1124, 1123, - 1169, 1122, 1169, 1123, 1123, 0, 1122, 1169, 0, 1123, - - 0, 0, 1169, 1124, 1170, 1124, 1170, 0, 0, 0, - 1124, 1170, 0, 0, 0, 1124, 1170, 1169, 1171, 1169, - 1171, 0, 0, 0, 1169, 1171, 0, 0, 0, 1169, - 1171, 1170, 1172, 1170, 1172, 0, 1174, 0, 1170, 1172, - 1174, 0, 0, 1170, 1172, 1171, 1174, 1171, 0, 0, - 1175, 0, 1171, 0, 1175, 0, 1174, 1171, 0, 1172, - 1175, 1172, 0, 1174, 1176, 1176, 1172, 1174, 0, 0, - 1175, 1172, 0, 1174, 1177, 0, 0, 1175, 1177, 0, - 0, 1175, 0, 1174, 1177, 0, 0, 1175, 1178, 1176, - 0, 0, 1178, 1176, 1177, 0, 1178, 1175, 0, 1176, - - 0, 1177, 1178, 0, 1179, 1177, 0, 0, 1179, 1176, - 0, 1177, 1178, 0, 1179, 1178, 1176, 0, 1180, 1178, - 1176, 1177, 1180, 1178, 1179, 0, 1176, 0, 1180, 1178, - 1181, 1179, 0, 1182, 1181, 1179, 1176, 1182, 1180, 1178, - 1181, 1179, 1183, 1182, 0, 1180, 1183, 0, 1182, 1180, - 1181, 1179, 1183, 1182, 0, 1180, 0, 1181, 0, 0, - 1182, 1181, 1183, 0, 1182, 1180, 0, 1181, 1184, 1183, - 1182, 0, 1184, 1183, 0, 1182, 0, 1181, 1184, 1183, - 1182, 1185, 0, 0, 0, 1185, 0, 0, 1184, 1183, - 1186, 1185, 1186, 0, 0, 1184, 0, 1186, 0, 1184, - - 0, 1185, 1186, 0, 1187, 1184, 1187, 0, 1185, 0, - 0, 1187, 1185, 0, 1188, 1184, 1187, 1186, 1185, 1186, - 1189, 0, 1189, 1188, 1186, 1188, 0, 1189, 1185, 1186, - 1188, 1187, 1189, 1187, 0, 1188, 0, 0, 1187, 0, - 0, 1188, 0, 1187, 1190, 0, 1190, 1189, 0, 1189, - 1188, 1190, 1188, 1191, 1189, 1191, 1190, 1188, 0, 1189, - 1191, 0, 1188, 0, 0, 1191, 0, 0, 0, 0, - 0, 1190, 0, 1190, 0, 0, 0, 0, 1190, 1192, - 1191, 1192, 1191, 1190, 1193, 1192, 1192, 1191, 1193, 1194, - 0, 1192, 1191, 1194, 1193, 1195, 0, 1195, 1196, 1194, - - 1196, 0, 1195, 0, 1193, 1196, 1192, 1195, 1192, 1194, - 1196, 1193, 1192, 1192, 0, 1193, 1194, 0, 1192, 0, - 1194, 1193, 1195, 0, 1195, 1196, 1194, 1196, 1197, 1195, - 1197, 1193, 1196, 0, 1195, 1197, 1194, 1196, 0, 1198, - 1197, 1198, 0, 0, 0, 0, 1198, 1198, 0, 0, - 0, 1198, 1200, 0, 1200, 1197, 0, 1197, 0, 1200, - 0, 0, 1197, 0, 1200, 0, 1198, 1197, 1198, 1199, - 1199, 0, 1199, 1198, 1198, 0, 0, 1199, 1198, 1200, - 0, 1200, 1199, 1201, 0, 1201, 1200, 0, 0, 0, - 1201, 1200, 0, 0, 0, 1201, 1199, 1199, 0, 1199, - - 0, 0, 0, 0, 1199, 0, 1202, 0, 1202, 1199, - 1201, 0, 1201, 1202, 1202, 0, 0, 1201, 1202, 1203, - 0, 1203, 1201, 0, 0, 0, 1203, 1205, 1205, 1205, - 1204, 1203, 1204, 1202, 1205, 1202, 1204, 1204, 0, 1205, - 1202, 1202, 1204, 0, 0, 1202, 1203, 0, 1203, 0, - 0, 0, 0, 1203, 1205, 1205, 1205, 1204, 1203, 1204, - 1206, 1205, 1206, 1204, 1204, 0, 1205, 1206, 1206, 1204, - 1207, 1208, 1206, 1209, 1207, 1208, 0, 1209, 0, 0, - 1207, 1208, 0, 1209, 0, 0, 0, 1206, 0, 1206, - 1207, 1208, 0, 1209, 1206, 1206, 0, 1207, 1208, 1206, - - 1209, 1207, 1208, 0, 1209, 1210, 0, 1207, 1208, 1210, - 1209, 0, 0, 0, 0, 1210, 0, 1207, 1208, 1236, - 1209, 0, 0, 1236, 1234, 1210, 0, 0, 1234, 1236, - 0, 0, 1210, 0, 1234, 0, 1210, 1234, 0, 1236, - 0, 0, 1210, 1237, 1234, 0, 1236, 1237, 0, 0, - 1236, 1234, 1210, 1237, 0, 1234, 1236, 0, 1237, 0, - 0, 1234, 0, 1237, 1234, 0, 1236, 0, 1238, 1239, - 1237, 1234, 1238, 1239, 1237, 0, 0, 0, 1238, 1239, - 1237, 0, 1240, 1241, 1240, 1237, 1240, 1241, 1238, 1239, - 1237, 0, 1240, 1241, 0, 1238, 1239, 1242, 1241, 1238, - - 1239, 1242, 1240, 1241, 0, 1238, 1239, 1242, 0, 1240, - 1241, 1240, 0, 1240, 1241, 1238, 1239, 1242, 0, 1240, - 1241, 0, 1243, 1244, 1242, 1241, 1243, 1244, 1242, 1240, - 1241, 0, 1243, 1244, 1242, 0, 1244, 0, 0, 1245, - 1246, 1245, 1243, 1244, 1242, 1246, 1245, 1246, 0, 1243, - 1244, 1245, 1246, 1243, 1244, 0, 0, 1246, 0, 1243, - 1244, 0, 0, 1244, 0, 0, 1245, 1246, 1245, 1243, - 1244, 0, 1246, 1245, 1246, 1247, 0, 1247, 1245, 1246, - 0, 1248, 1247, 1248, 1246, 0, 0, 1247, 1248, 1249, - 0, 1249, 0, 1248, 0, 0, 1249, 0, 0, 0, - - 0, 1249, 1247, 0, 1247, 0, 0, 1250, 1248, 1247, - 1248, 1250, 0, 0, 1247, 1248, 1249, 1250, 1249, 0, - 1248, 1251, 0, 1249, 0, 1251, 1252, 1250, 1249, 1253, - 1252, 1251, 1251, 1253, 1250, 0, 1252, 0, 1250, 1253, - 0, 1251, 0, 0, 1250, 0, 1252, 0, 1251, 1253, - 1254, 1254, 1251, 1252, 1250, 1254, 1253, 1252, 1251, 1251, - 1253, 1254, 0, 1252, 1269, 1269, 1253, 0, 1251, 0, - 1271, 1254, 0, 1252, 1271, 1272, 1253, 1254, 1254, 1272, - 1271, 0, 1254, 0, 1274, 1272, 1274, 0, 1254, 1269, - 1271, 1274, 0, 1269, 0, 1272, 1274, 1271, 1254, 1269, - - 0, 1271, 1272, 1275, 1273, 1275, 1272, 1271, 1273, 1269, - 1275, 1274, 1272, 1274, 1273, 1275, 1269, 1271, 1274, 0, - 1269, 0, 1272, 1274, 1273, 0, 1269, 1276, 0, 1276, - 1275, 1273, 1275, 0, 1276, 1273, 1269, 1275, 1277, 1276, - 1277, 1273, 1275, 0, 0, 1277, 1278, 0, 1278, 0, - 1277, 1273, 0, 1278, 1276, 0, 1276, 0, 1278, 1279, - 0, 1276, 0, 1279, 1280, 1277, 1276, 1277, 1280, 1279, - 0, 0, 1277, 1278, 1280, 1278, 0, 1277, 1290, 1279, - 1278, 0, 1290, 1291, 1280, 1278, 1279, 1291, 1290, 0, - 1279, 1280, 1292, 1291, 1292, 1280, 1279, 0, 1290, 1292, - - 1300, 1280, 1300, 1291, 1292, 1290, 1279, 1300, 0, 1290, - 1291, 1280, 1300, 0, 1291, 1290, 0, 0, 0, 1292, - 1291, 1292, 0, 0, 0, 1290, 1292, 1300, 0, 1300, - 1291, 1292, 0, 0, 1300, 0, 0, 0, 0, 1300, - 1332, 1332, 1332, 1332, 1332, 1333, 0, 0, 1333, 1333, - 1335, 1335, 1335, 0, 1335, 1336, 0, 1336, 1336, 1336, - 1337, 0, 1337, 1337, 1337, 1338, 0, 1338, 1338, 1338, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, - 1331, 1331, 1331, 1331, 1331, 1331, 1331 - } ; + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 9, 9, 10, 10, 15, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 15, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, + 18, 21, 22, 21, 27, 28, 22, 23, 30, 21, + 27, 21, 22, 28, 23, 21, 21, 31, 41, 28, + + 41, 23, 22, 41, 23, 1334, 44, 23, 21, 22, + 21, 27, 28, 22, 23, 30, 21, 27, 21, 22, + 28, 23, 21, 21, 31, 41, 28, 41, 23, 22, + 41, 23, 24, 44, 23, 25, 24, 25, 49, 49, + 24, 32, 25, 99, 33, 32, 24, 25, 33, 24, + 55, 32, 50, 50, 33, 43, 43, 58, 58, 24, + 1328, 55, 25, 24, 25, 1327, 34, 24, 32, 25, + 99, 33, 32, 24, 25, 33, 24, 26, 32, 36, + 34, 33, 43, 43, 100, 26, 34, 34, 26, 103, + 36, 26, 29, 34, 26, 1326, 36, 26, 29, 29, + + 29, 42, 86, 86, 26, 29, 36, 34, 1325, 42, + 1323, 100, 26, 34, 34, 26, 103, 36, 26, 29, + 1321, 26, 35, 36, 26, 29, 29, 29, 42, 104, + 35, 38, 29, 101, 35, 38, 42, 35, 35, 38, + 81, 101, 81, 106, 81, 38, 1319, 81, 1317, 35, + 102, 1315, 81, 102, 1313, 107, 104, 35, 38, 1311, + 101, 35, 38, 1309, 35, 35, 38, 81, 101, 81, + 106, 81, 38, 39, 81, 39, 110, 102, 39, 81, + 102, 39, 107, 39, 113, 39, 39, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 188, 188, 1307, + + 39, 1305, 39, 110, 1303, 39, 105, 105, 39, 109, + 39, 113, 39, 39, 40, 112, 109, 67, 40, 67, + 105, 40, 40, 67, 67, 112, 116, 116, 40, 67, + 117, 40, 1301, 105, 105, 1297, 109, 1133, 1133, 1256, + 1256, 40, 112, 109, 67, 40, 67, 105, 40, 40, + 67, 67, 112, 116, 116, 40, 67, 117, 40, 57, + 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, + 61, 61, 118, 61, 61, 61, 61, 61, 61, 119, + 68, 114, 1293, 1287, 68, 1281, 114, 120, 68, 61, + 61, 61, 70, 121, 68, 61, 70, 61, 123, 118, + + 124, 125, 70, 61, 68, 61, 119, 68, 114, 61, + 61, 68, 70, 114, 120, 68, 127, 128, 1268, 70, + 121, 68, 61, 70, 61, 123, 1255, 124, 125, 70, + 61, 68, 61, 1233, 129, 1211, 61, 61, 1168, 70, + 1125, 1053, 981, 127, 128, 61, 62, 62, 885, 62, + 62, 62, 62, 62, 62, 789, 664, 130, 71, 72, + 73, 129, 71, 72, 73, 62, 62, 62, 71, 72, + 73, 131, 62, 77, 131, 126, 62, 77, 71, 72, + 73, 126, 62, 77, 130, 71, 72, 73, 132, 71, + 72, 73, 62, 77, 539, 71, 72, 73, 131, 62, + + 77, 131, 126, 62, 77, 71, 72, 73, 126, 62, + 77, 414, 288, 83, 133, 132, 83, 83, 135, 62, + 77, 62, 63, 83, 78, 136, 63, 138, 78, 63, + 63, 139, 78, 83, 140, 141, 63, 144, 78, 63, + 83, 133, 63, 83, 83, 135, 63, 192, 78, 63, + 83, 78, 136, 63, 138, 78, 63, 63, 139, 78, + 83, 140, 141, 63, 144, 78, 63, 190, 90, 63, + 88, 85, 82, 63, 64, 78, 82, 84, 64, 137, + 82, 84, 64, 142, 145, 142, 82, 84, 64, 137, + 146, 64, 147, 149, 137, 137, 82, 84, 64, 82, + + 60, 64, 59, 82, 84, 64, 137, 82, 84, 64, + 142, 145, 142, 82, 84, 64, 137, 146, 64, 147, + 149, 137, 137, 82, 84, 64, 65, 111, 111, 111, + 65, 111, 115, 65, 115, 65, 65, 115, 150, 143, + 65, 143, 151, 115, 153, 65, 65, 52, 148, 154, + 115, 148, 143, 65, 111, 111, 111, 65, 111, 115, + 65, 115, 65, 65, 115, 150, 143, 65, 143, 151, + 115, 153, 65, 65, 66, 148, 154, 115, 148, 143, + 155, 66, 66, 156, 157, 66, 158, 122, 66, 122, + 158, 66, 159, 122, 66, 51, 161, 47, 45, 163, + + 122, 66, 20, 19, 122, 11, 166, 155, 66, 66, + 156, 157, 66, 158, 122, 66, 122, 158, 66, 159, + 122, 66, 69, 161, 160, 162, 163, 122, 69, 69, + 69, 122, 165, 166, 167, 69, 162, 160, 168, 169, + 69, 7, 160, 4, 170, 3, 165, 172, 0, 69, + 173, 160, 162, 174, 177, 69, 69, 69, 0, 165, + 0, 167, 69, 162, 160, 168, 169, 69, 74, 160, + 164, 170, 171, 165, 172, 74, 175, 173, 178, 164, + 174, 177, 74, 171, 176, 74, 179, 164, 74, 74, + 0, 176, 179, 0, 176, 74, 175, 164, 181, 171, + + 182, 183, 74, 175, 0, 178, 164, 0, 291, 74, + 171, 176, 74, 179, 164, 74, 74, 75, 176, 179, + 180, 176, 75, 175, 75, 181, 293, 182, 183, 294, + 75, 75, 200, 180, 75, 291, 200, 75, 75, 0, + 0, 0, 200, 296, 75, 0, 0, 180, 298, 75, + 0, 75, 200, 293, 0, 299, 294, 75, 75, 200, + 180, 75, 300, 200, 75, 75, 76, 201, 201, 200, + 296, 301, 201, 76, 0, 298, 302, 76, 201, 200, + 76, 202, 299, 76, 303, 202, 76, 0, 201, 300, + 305, 202, 0, 76, 201, 201, 202, 0, 301, 201, + + 76, 202, 306, 302, 76, 201, 307, 76, 202, 0, + 76, 303, 202, 76, 79, 201, 79, 305, 202, 79, + 79, 0, 79, 202, 79, 308, 79, 79, 202, 306, + 309, 310, 311, 307, 312, 313, 79, 0, 314, 0, + 0, 79, 0, 79, 0, 0, 79, 79, 203, 79, + 203, 79, 308, 79, 79, 203, 203, 309, 310, 311, + 203, 312, 313, 79, 80, 314, 209, 205, 80, 205, + 209, 80, 80, 205, 205, 203, 209, 203, 80, 205, + 315, 80, 203, 203, 316, 317, 209, 203, 80, 0, + 0, 80, 0, 209, 205, 80, 205, 209, 80, 80, + + 205, 205, 0, 209, 0, 80, 205, 315, 80, 0, + 0, 316, 317, 209, 0, 80, 91, 91, 91, 91, + 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, + 93, 93, 93, 93, 93, 93, 93, 193, 193, 193, + 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, + 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, + 195, 195, 195, 195, 195, 195, 195, 195, 204, 206, + 208, 204, 304, 319, 304, 208, 320, 208, 206, 204, + 206, 204, 208, 321, 0, 206, 204, 208, 0, 304, + + 206, 204, 0, 0, 0, 204, 206, 208, 204, 304, + 319, 304, 208, 320, 208, 206, 204, 206, 204, 208, + 321, 210, 206, 204, 208, 210, 304, 206, 204, 207, + 207, 210, 211, 322, 211, 207, 318, 207, 0, 211, + 0, 210, 207, 207, 211, 0, 323, 207, 210, 324, + 0, 318, 210, 326, 212, 327, 207, 207, 210, 211, + 322, 211, 207, 318, 207, 212, 211, 212, 210, 207, + 207, 211, 212, 323, 207, 0, 324, 212, 318, 0, + 326, 212, 327, 214, 0, 0, 328, 214, 329, 330, + 0, 0, 212, 214, 212, 331, 332, 333, 215, 212, + + 0, 334, 215, 214, 212, 213, 213, 213, 215, 213, + 214, 215, 213, 328, 214, 329, 330, 213, 215, 335, + 214, 336, 331, 332, 333, 215, 337, 216, 334, 215, + 214, 216, 213, 213, 213, 215, 213, 216, 215, 213, + 338, 339, 216, 340, 213, 215, 335, 216, 336, 341, + 0, 342, 343, 337, 216, 344, 0, 345, 216, 0, + 346, 0, 0, 0, 216, 347, 0, 338, 339, 216, + 340, 0, 348, 349, 216, 217, 341, 217, 342, 343, + 217, 351, 344, 218, 345, 218, 217, 346, 217, 218, + 218, 0, 347, 217, 219, 218, 219, 0, 217, 348, + + 349, 219, 217, 219, 217, 352, 219, 217, 351, 354, + 218, 0, 218, 217, 220, 217, 218, 218, 220, 0, + 217, 219, 218, 219, 220, 217, 0, 355, 219, 350, + 219, 0, 352, 219, 220, 221, 354, 221, 222, 350, + 0, 220, 221, 0, 356, 220, 222, 221, 222, 0, + 0, 220, 357, 222, 355, 0, 350, 359, 222, 0, + 360, 220, 221, 361, 221, 222, 350, 223, 362, 221, + 225, 356, 225, 222, 221, 222, 223, 225, 223, 357, + 222, 363, 225, 223, 359, 222, 358, 360, 223, 0, + 361, 0, 0, 365, 223, 362, 358, 225, 366, 225, + + 0, 0, 0, 223, 225, 223, 0, 367, 363, 225, + 223, 0, 226, 358, 226, 223, 224, 227, 224, 226, + 365, 227, 224, 358, 226, 366, 368, 227, 224, 224, + 369, 370, 371, 224, 367, 0, 0, 227, 224, 226, + 0, 226, 0, 224, 227, 224, 226, 373, 227, 224, + 375, 226, 0, 368, 227, 224, 224, 369, 370, 371, + 224, 228, 229, 228, 227, 224, 229, 228, 228, 230, + 0, 230, 229, 228, 373, 376, 230, 375, 0, 374, + 0, 230, 229, 0, 0, 0, 377, 231, 228, 229, + 228, 231, 374, 229, 228, 228, 230, 231, 230, 229, + + 228, 232, 376, 230, 378, 232, 374, 231, 230, 229, + 233, 232, 233, 377, 231, 379, 380, 233, 231, 374, + 233, 232, 233, 234, 231, 234, 0, 0, 232, 0, + 234, 378, 232, 0, 231, 234, 0, 233, 232, 233, + 381, 382, 379, 380, 233, 0, 383, 233, 232, 233, + 234, 235, 234, 235, 236, 237, 236, 234, 235, 237, + 235, 236, 234, 235, 384, 237, 236, 381, 382, 385, + 372, 0, 240, 383, 240, 237, 387, 0, 235, 240, + 235, 236, 237, 236, 240, 235, 237, 235, 236, 372, + 235, 384, 237, 236, 238, 388, 385, 372, 238, 240, + + 389, 240, 237, 387, 238, 238, 240, 0, 241, 242, + 0, 240, 241, 242, 238, 0, 372, 390, 241, 242, + 0, 238, 388, 0, 391, 238, 0, 389, 241, 242, + 0, 238, 238, 243, 243, 241, 242, 243, 392, 241, + 242, 238, 239, 243, 390, 241, 242, 247, 393, 247, + 239, 391, 239, 243, 247, 241, 242, 239, 239, 247, + 243, 243, 239, 0, 243, 392, 394, 0, 0, 239, + 243, 0, 0, 0, 247, 393, 247, 239, 395, 239, + 243, 247, 0, 0, 239, 239, 247, 396, 397, 239, + 244, 399, 0, 394, 244, 246, 244, 246, 244, 257, + + 244, 246, 246, 257, 401, 395, 0, 246, 403, 257, + 244, 0, 404, 0, 396, 397, 0, 244, 399, 257, + 0, 244, 246, 244, 246, 244, 257, 244, 246, 246, + 257, 401, 405, 400, 246, 403, 257, 244, 245, 404, + 245, 248, 400, 248, 406, 402, 257, 402, 248, 245, + 249, 245, 249, 248, 407, 408, 245, 249, 249, 405, + 400, 245, 249, 0, 409, 245, 0, 245, 248, 400, + 248, 406, 402, 0, 402, 248, 245, 249, 245, 249, + 248, 407, 408, 245, 249, 249, 0, 0, 245, 249, + 250, 409, 250, 251, 0, 251, 411, 250, 250, 0, + + 251, 250, 250, 252, 0, 251, 254, 410, 254, 412, + 0, 410, 0, 254, 252, 0, 252, 250, 254, 250, + 251, 252, 251, 411, 250, 250, 252, 251, 250, 250, + 252, 253, 251, 254, 410, 254, 412, 253, 410, 253, + 254, 252, 255, 252, 253, 254, 0, 540, 252, 253, + 255, 0, 255, 252, 0, 0, 541, 255, 253, 542, + 543, 0, 255, 544, 253, 545, 253, 546, 547, 255, + 548, 253, 550, 256, 540, 256, 253, 255, 258, 255, + 256, 256, 258, 541, 255, 256, 542, 543, 258, 255, + 544, 258, 545, 0, 546, 547, 0, 548, 258, 550, + + 256, 553, 256, 0, 0, 258, 259, 256, 256, 258, + 259, 554, 256, 555, 259, 258, 556, 558, 258, 260, + 259, 559, 0, 260, 261, 258, 261, 560, 553, 260, + 259, 261, 561, 259, 563, 0, 261, 259, 554, 260, + 555, 259, 564, 556, 558, 0, 260, 259, 559, 262, + 260, 261, 0, 261, 560, 565, 260, 259, 261, 561, + 262, 563, 262, 261, 0, 566, 260, 262, 263, 564, + 567, 568, 262, 263, 569, 263, 262, 570, 0, 264, + 263, 264, 565, 571, 0, 263, 264, 262, 0, 262, + 264, 264, 566, 0, 262, 263, 574, 567, 568, 262, + + 263, 569, 263, 575, 570, 265, 264, 263, 264, 265, + 571, 265, 263, 264, 576, 268, 265, 264, 264, 268, + 267, 265, 0, 574, 267, 268, 577, 578, 267, 579, + 575, 0, 265, 0, 267, 268, 265, 0, 265, 0, + 0, 576, 268, 265, 267, 580, 268, 267, 265, 266, + 0, 267, 268, 577, 578, 267, 579, 0, 266, 269, + 266, 267, 268, 269, 270, 266, 266, 269, 270, 0, + 266, 267, 580, 269, 270, 0, 266, 270, 582, 0, + 583, 584, 0, 269, 270, 266, 269, 266, 587, 588, + 269, 270, 266, 266, 269, 270, 272, 266, 271, 272, + + 269, 270, 271, 272, 270, 582, 271, 583, 584, 272, + 269, 270, 271, 0, 0, 587, 588, 274, 590, 272, + 0, 274, 271, 272, 0, 271, 272, 274, 0, 271, + 272, 592, 0, 271, 0, 593, 272, 274, 594, 271, + 273, 273, 273, 595, 274, 590, 272, 273, 274, 271, + 0, 275, 273, 596, 274, 275, 0, 0, 592, 275, + 597, 275, 593, 600, 274, 594, 0, 273, 273, 273, + 595, 275, 0, 276, 273, 0, 604, 276, 275, 273, + 596, 606, 275, 276, 276, 277, 275, 597, 275, 607, + 600, 609, 277, 276, 0, 611, 279, 279, 275, 277, + + 276, 279, 277, 604, 276, 277, 0, 279, 606, 0, + 276, 276, 277, 0, 0, 612, 607, 279, 609, 277, + 276, 280, 611, 279, 279, 280, 277, 0, 279, 277, + 613, 280, 277, 278, 279, 615, 278, 0, 0, 598, + 278, 280, 612, 278, 279, 616, 278, 281, 280, 281, + 598, 282, 280, 281, 281, 282, 278, 613, 280, 281, + 278, 282, 615, 278, 282, 283, 598, 278, 280, 283, + 278, 282, 616, 278, 281, 283, 281, 598, 282, 0, + 281, 281, 282, 278, 0, 283, 281, 0, 282, 284, + 617, 282, 283, 284, 0, 618, 283, 285, 282, 284, + + 620, 285, 283, 621, 284, 285, 420, 623, 420, 284, + 624, 285, 283, 420, 610, 610, 284, 617, 420, 625, + 284, 285, 618, 0, 285, 0, 284, 620, 285, 0, + 621, 284, 285, 420, 623, 420, 284, 624, 285, 0, + 420, 610, 610, 0, 0, 420, 625, 0, 285, 289, + 289, 289, 289, 289, 289, 289, 289, 289, 289, 415, + 415, 415, 415, 415, 415, 415, 415, 415, 415, 416, + 417, 418, 419, 416, 417, 418, 419, 626, 628, 416, + 417, 418, 419, 0, 629, 630, 0, 631, 0, 416, + 417, 418, 419, 0, 0, 0, 416, 417, 418, 419, + + 416, 417, 418, 419, 626, 628, 416, 417, 418, 419, + 422, 629, 630, 421, 631, 421, 416, 417, 418, 419, + 421, 422, 423, 422, 423, 421, 424, 0, 422, 423, + 424, 0, 633, 422, 423, 0, 424, 422, 634, 0, + 421, 635, 421, 636, 0, 0, 424, 421, 422, 423, + 422, 423, 421, 424, 425, 422, 423, 424, 425, 633, + 422, 423, 426, 424, 425, 634, 426, 427, 635, 639, + 636, 427, 426, 424, 425, 0, 428, 427, 428, 640, + 426, 425, 426, 428, 641, 425, 642, 427, 428, 426, + 429, 425, 429, 426, 427, 643, 639, 429, 427, 426, + + 646, 425, 429, 428, 427, 428, 640, 426, 431, 426, + 428, 641, 431, 642, 427, 428, 0, 429, 431, 429, + 0, 431, 643, 0, 429, 0, 0, 646, 431, 429, + 430, 0, 430, 432, 647, 431, 430, 432, 649, 431, + 650, 0, 430, 432, 651, 431, 433, 430, 431, 432, + 433, 0, 430, 432, 433, 431, 433, 430, 435, 430, + 432, 647, 435, 430, 432, 649, 433, 650, 435, 430, + 432, 651, 0, 433, 430, 0, 432, 433, 435, 430, + 432, 433, 434, 433, 0, 435, 434, 0, 652, 435, + 436, 653, 434, 433, 436, 435, 654, 434, 436, 437, + + 655, 437, 434, 0, 436, 435, 437, 656, 0, 434, + 0, 437, 0, 434, 436, 652, 657, 436, 653, 434, + 659, 436, 661, 654, 434, 436, 437, 655, 437, 434, + 438, 436, 438, 437, 656, 439, 438, 438, 437, 439, + 663, 436, 438, 657, 440, 439, 440, 659, 792, 661, + 794, 440, 796, 0, 797, 439, 440, 438, 441, 438, + 441, 798, 439, 438, 438, 441, 439, 663, 0, 438, + 441, 440, 439, 440, 0, 792, 442, 794, 440, 796, + 442, 797, 439, 440, 0, 441, 442, 441, 798, 799, + 443, 444, 441, 800, 443, 444, 442, 441, 443, 0, + + 801, 444, 802, 442, 443, 803, 444, 442, 0, 0, + 804, 444, 0, 442, 443, 806, 799, 443, 444, 0, + 800, 443, 444, 442, 445, 443, 445, 801, 444, 802, + 445, 443, 803, 444, 807, 446, 445, 804, 444, 446, + 0, 443, 806, 0, 447, 446, 445, 0, 447, 808, + 809, 445, 810, 445, 447, 446, 0, 445, 0, 447, + 0, 807, 446, 445, 447, 0, 446, 448, 0, 0, + 448, 447, 446, 445, 448, 447, 808, 809, 0, 810, + 448, 447, 446, 450, 811, 449, 447, 450, 451, 449, + 448, 447, 451, 450, 448, 449, 449, 448, 451, 813, + + 814, 448, 0, 450, 815, 449, 0, 448, 451, 0, + 450, 811, 449, 816, 450, 451, 449, 448, 0, 451, + 450, 0, 449, 449, 453, 451, 813, 814, 453, 452, + 450, 815, 449, 452, 453, 451, 454, 452, 454, 0, + 816, 0, 454, 452, 453, 455, 0, 455, 454, 817, + 818, 453, 455, 452, 819, 453, 452, 455, 454, 820, + 452, 453, 0, 454, 452, 454, 456, 0, 456, 454, + 452, 453, 455, 456, 455, 454, 817, 818, 456, 455, + 452, 819, 821, 822, 455, 454, 820, 458, 0, 458, + 457, 0, 457, 456, 458, 456, 457, 457, 0, 458, + + 456, 0, 457, 0, 825, 456, 826, 0, 459, 821, + 822, 0, 459, 461, 458, 461, 458, 457, 459, 457, + 461, 458, 827, 457, 457, 461, 458, 0, 459, 457, + 460, 825, 828, 826, 460, 459, 0, 0, 460, 459, + 461, 0, 461, 0, 460, 459, 0, 461, 829, 827, + 0, 0, 461, 832, 460, 459, 835, 460, 836, 828, + 838, 460, 462, 462, 462, 460, 463, 463, 463, 462, + 464, 460, 464, 463, 462, 829, 837, 464, 463, 837, + 832, 460, 464, 835, 0, 836, 0, 838, 0, 462, + 462, 462, 0, 463, 463, 463, 462, 464, 465, 464, + + 463, 462, 841, 837, 464, 463, 837, 467, 465, 464, + 465, 467, 466, 467, 466, 465, 844, 845, 467, 466, + 465, 466, 0, 467, 466, 465, 0, 846, 847, 841, + 848, 849, 0, 852, 467, 465, 853, 465, 467, 466, + 467, 466, 465, 844, 845, 467, 466, 465, 466, 468, + 467, 466, 469, 468, 846, 847, 469, 848, 849, 468, + 852, 470, 469, 853, 0, 470, 0, 469, 854, 468, + 0, 470, 469, 855, 470, 0, 468, 856, 0, 469, + 468, 470, 0, 469, 858, 0, 468, 471, 470, 469, + 0, 471, 470, 471, 469, 854, 468, 471, 470, 469, + + 855, 470, 472, 859, 856, 473, 472, 471, 470, 473, + 0, 858, 472, 861, 471, 473, 0, 474, 471, 862, + 471, 474, 472, 863, 471, 473, 0, 474, 0, 472, + 859, 475, 473, 472, 471, 475, 473, 474, 0, 472, + 861, 475, 473, 476, 474, 864, 862, 476, 474, 472, + 863, 475, 473, 476, 474, 477, 0, 0, 475, 477, + 866, 0, 475, 476, 474, 477, 0, 867, 475, 868, + 476, 477, 864, 869, 476, 477, 0, 478, 475, 478, + 476, 479, 477, 479, 478, 0, 477, 866, 479, 478, + 476, 0, 477, 479, 867, 0, 868, 870, 477, 481, + + 869, 0, 477, 481, 478, 480, 478, 480, 479, 481, + 479, 478, 480, 480, 0, 479, 478, 480, 482, 481, + 479, 485, 482, 485, 870, 485, 481, 871, 482, 0, + 481, 485, 480, 0, 480, 872, 481, 873, 482, 480, + 480, 485, 483, 483, 480, 482, 481, 483, 485, 482, + 485, 874, 485, 483, 871, 482, 488, 486, 485, 486, + 488, 486, 872, 483, 873, 482, 488, 486, 485, 483, + 483, 488, 0, 876, 483, 0, 488, 486, 874, 877, + 483, 0, 878, 488, 486, 0, 486, 488, 486, 880, + 483, 484, 487, 488, 486, 484, 487, 0, 488, 484, + + 876, 484, 487, 488, 486, 484, 877, 881, 487, 878, + 0, 882, 487, 0, 0, 484, 880, 489, 484, 487, + 490, 489, 484, 487, 490, 982, 484, 489, 484, 487, + 490, 984, 484, 489, 881, 487, 986, 489, 882, 487, + 490, 491, 484, 987, 489, 491, 0, 490, 489, 491, + 988, 490, 982, 0, 489, 491, 989, 490, 984, 492, + 489, 492, 0, 986, 489, 491, 492, 490, 491, 991, + 987, 492, 491, 493, 0, 493, 491, 988, 0, 493, + 493, 993, 491, 989, 0, 493, 492, 494, 492, 494, + 994, 495, 491, 492, 494, 495, 991, 0, 492, 494, + + 493, 495, 493, 0, 995, 496, 493, 493, 993, 496, + 996, 495, 493, 0, 494, 496, 494, 994, 495, 0, + 497, 494, 495, 997, 497, 496, 494, 499, 495, 499, + 497, 995, 496, 497, 499, 0, 496, 996, 495, 499, + 497, 0, 496, 999, 1001, 0, 503, 497, 503, 0, + 997, 497, 496, 503, 499, 0, 499, 497, 503, 1005, + 497, 499, 501, 501, 501, 0, 499, 497, 498, 501, + 999, 1001, 498, 503, 501, 503, 498, 1007, 0, 1008, + 503, 1009, 498, 1016, 1017, 503, 1005, 498, 1018, 501, + 501, 501, 498, 0, 1021, 498, 501, 0, 1023, 498, + + 502, 501, 0, 498, 1007, 502, 1008, 502, 1009, 498, + 1016, 1017, 502, 1025, 498, 1018, 505, 502, 505, 498, + 500, 1021, 1027, 505, 505, 1023, 1028, 502, 505, 500, + 0, 500, 502, 500, 502, 1029, 500, 0, 0, 502, + 1025, 500, 0, 505, 502, 505, 504, 500, 1030, 1027, + 505, 505, 1031, 1028, 1033, 505, 500, 504, 500, 504, + 500, 506, 1029, 500, 504, 506, 1034, 506, 500, 504, + 1035, 1036, 506, 504, 0, 1030, 0, 506, 507, 1031, + 507, 1033, 1038, 0, 504, 507, 504, 0, 506, 0, + 507, 504, 506, 1034, 506, 1040, 504, 1035, 1036, 506, + + 1042, 508, 0, 508, 506, 507, 509, 507, 508, 1038, + 509, 510, 507, 508, 511, 510, 509, 507, 511, 512, + 1043, 510, 1040, 512, 511, 1044, 509, 1042, 508, 512, + 508, 510, 0, 509, 511, 508, 0, 509, 510, 512, + 508, 511, 510, 509, 0, 511, 512, 1043, 510, 0, + 512, 511, 1044, 509, 0, 513, 512, 0, 510, 513, + 514, 511, 0, 515, 514, 513, 512, 515, 513, 516, + 514, 516, 1045, 515, 515, 513, 516, 517, 514, 517, + 514, 516, 513, 515, 517, 517, 513, 514, 0, 517, + 515, 514, 513, 0, 515, 513, 516, 514, 516, 1045, + + 515, 515, 513, 516, 517, 514, 517, 514, 516, 1046, + 515, 517, 517, 518, 1051, 518, 517, 519, 1052, 519, + 518, 518, 1130, 1134, 519, 518, 520, 1135, 520, 519, + 520, 1138, 0, 520, 0, 0, 1046, 0, 520, 0, + 518, 1051, 518, 1139, 519, 1052, 519, 518, 518, 1130, + 1134, 519, 518, 520, 1135, 520, 519, 520, 1138, 521, + 520, 521, 522, 1143, 522, 520, 521, 521, 0, 522, + 1139, 521, 523, 1145, 522, 524, 523, 0, 1146, 524, + 1149, 0, 523, 0, 0, 524, 521, 1150, 521, 522, + 1143, 522, 523, 521, 521, 524, 522, 0, 521, 523, + + 1145, 522, 524, 523, 526, 1146, 524, 1149, 525, 523, + 525, 526, 524, 526, 1150, 525, 1151, 0, 526, 523, + 525, 1152, 524, 526, 527, 0, 529, 0, 527, 528, + 529, 526, 0, 528, 527, 525, 529, 525, 526, 528, + 526, 528, 525, 1151, 527, 526, 529, 525, 1152, 528, + 526, 527, 531, 529, 531, 527, 528, 529, 1155, 531, + 528, 527, 0, 529, 531, 0, 528, 0, 528, 1156, + 530, 527, 0, 529, 530, 1159, 528, 1161, 530, 531, + 532, 531, 532, 0, 530, 1155, 531, 532, 0, 532, + 1162, 531, 532, 0, 530, 0, 1156, 530, 1163, 533, + + 1164, 530, 1159, 1165, 1161, 530, 0, 532, 533, 532, + 533, 530, 1212, 1215, 532, 533, 532, 1162, 1218, 532, + 533, 530, 534, 1219, 534, 1163, 533, 1164, 1222, 534, + 1165, 0, 0, 534, 534, 533, 535, 533, 535, 1212, + 1215, 0, 533, 535, 535, 1218, 0, 533, 535, 534, + 1219, 534, 536, 1223, 536, 1222, 534, 1224, 536, 536, + 534, 534, 537, 535, 536, 535, 537, 1228, 537, 0, + 535, 535, 1229, 537, 0, 535, 0, 0, 537, 536, + 1223, 536, 1213, 1213, 1224, 536, 536, 1230, 1232, 537, + 538, 536, 538, 537, 1228, 537, 538, 538, 1257, 1229, + + 537, 665, 538, 665, 666, 537, 666, 665, 665, 1258, + 666, 666, 1261, 665, 1230, 1232, 666, 538, 0, 538, + 1213, 0, 667, 538, 538, 1257, 667, 0, 665, 538, + 665, 666, 667, 666, 665, 665, 1258, 666, 666, 1261, + 665, 668, 667, 666, 669, 668, 671, 1213, 669, 667, + 671, 668, 1266, 667, 669, 1270, 671, 669, 670, 667, + 670, 668, 1282, 1282, 669, 670, 671, 0, 668, 667, + 670, 669, 668, 671, 0, 669, 0, 671, 668, 1266, + 0, 669, 1270, 671, 669, 670, 1283, 670, 668, 1286, + 0, 669, 670, 671, 672, 673, 672, 670, 674, 673, + + 0, 672, 674, 675, 1282, 673, 672, 675, 674, 0, + 0, 675, 1289, 1283, 0, 673, 1286, 675, 674, 0, + 0, 672, 673, 672, 0, 674, 673, 675, 672, 674, + 675, 1282, 673, 672, 675, 674, 676, 677, 675, 1289, + 676, 677, 673, 1294, 675, 674, 676, 677, 0, 1298, + 0, 678, 1302, 1304, 675, 678, 676, 677, 0, 678, + 1235, 1235, 0, 676, 677, 678, 0, 676, 677, 1306, + 1294, 0, 0, 676, 677, 678, 1298, 679, 678, 1302, + 1304, 679, 678, 676, 677, 679, 678, 679, 1308, 680, + 681, 682, 678, 680, 681, 682, 1306, 679, 1235, 680, + + 681, 682, 678, 681, 679, 1310, 0, 0, 679, 680, + 681, 682, 679, 0, 679, 1308, 680, 681, 682, 683, + 680, 681, 682, 683, 679, 1235, 680, 681, 682, 683, + 681, 1312, 1310, 684, 683, 684, 680, 681, 682, 683, + 684, 1314, 0, 685, 686, 684, 683, 685, 686, 0, + 683, 0, 0, 685, 686, 1316, 683, 1318, 1312, 686, + 684, 683, 684, 685, 686, 0, 683, 684, 1314, 687, + 685, 686, 684, 687, 685, 686, 688, 0, 688, 687, + 685, 686, 1316, 688, 1318, 1320, 686, 0, 688, 687, + 685, 686, 689, 689, 689, 0, 687, 1288, 1288, 689, + + 687, 0, 0, 688, 689, 688, 687, 0, 0, 0, + 688, 0, 1320, 0, 0, 688, 687, 0, 0, 689, + 689, 689, 0, 690, 0, 690, 689, 0, 0, 0, + 690, 689, 690, 0, 691, 690, 691, 0, 0, 1288, + 0, 691, 691, 0, 0, 0, 691, 692, 0, 0, + 690, 0, 690, 0, 0, 0, 0, 690, 692, 690, + 692, 691, 690, 691, 0, 692, 1288, 0, 691, 691, + 692, 0, 0, 691, 692, 694, 693, 0, 693, 0, + 0, 0, 693, 693, 694, 692, 694, 692, 693, 0, + 0, 694, 692, 0, 695, 0, 694, 692, 695, 0, + + 0, 0, 694, 693, 695, 693, 0, 0, 0, 693, + 693, 694, 0, 694, 695, 693, 0, 696, 694, 696, + 697, 695, 697, 694, 696, 695, 698, 697, 698, 696, + 705, 695, 697, 698, 705, 0, 0, 0, 698, 0, + 705, 695, 0, 0, 696, 0, 696, 697, 0, 697, + 705, 696, 0, 698, 697, 698, 696, 705, 0, 697, + 698, 705, 699, 0, 699, 698, 699, 705, 700, 699, + 700, 0, 700, 0, 699, 700, 701, 705, 701, 0, + 700, 0, 0, 701, 0, 701, 0, 0, 701, 699, + 0, 699, 0, 699, 0, 700, 699, 700, 703, 700, + + 0, 699, 700, 701, 0, 701, 702, 700, 702, 703, + 701, 703, 701, 702, 702, 701, 703, 0, 702, 704, + 0, 703, 0, 0, 706, 703, 0, 0, 706, 0, + 704, 0, 704, 702, 706, 702, 703, 704, 703, 0, + 702, 702, 704, 703, 706, 702, 704, 0, 703, 0, + 707, 706, 708, 0, 707, 706, 708, 704, 0, 704, + 707, 706, 708, 0, 704, 707, 0, 0, 0, 704, + 707, 706, 708, 0, 709, 0, 710, 707, 709, 708, + 710, 707, 709, 708, 0, 0, 710, 707, 709, 708, + 711, 0, 707, 0, 711, 0, 710, 707, 709, 708, + + 711, 709, 0, 710, 712, 709, 0, 710, 712, 709, + 711, 0, 712, 710, 0, 709, 0, 711, 712, 0, + 714, 711, 713, 710, 714, 709, 713, 711, 712, 0, + 714, 712, 713, 713, 715, 712, 715, 711, 0, 712, + 714, 715, 713, 0, 0, 712, 715, 714, 0, 713, + 0, 714, 0, 713, 0, 712, 0, 714, 0, 713, + 713, 715, 0, 715, 716, 0, 716, 714, 715, 713, + 717, 716, 717, 715, 718, 719, 716, 717, 718, 719, + 0, 0, 717, 0, 718, 719, 0, 0, 719, 0, + 0, 716, 0, 716, 718, 719, 0, 717, 716, 717, + + 0, 718, 719, 716, 717, 718, 719, 0, 0, 717, + 0, 718, 719, 0, 0, 719, 720, 0, 720, 0, + 0, 718, 719, 720, 721, 0, 721, 722, 720, 722, + 721, 721, 0, 722, 722, 0, 721, 0, 0, 722, + 0, 0, 0, 720, 0, 720, 0, 0, 0, 0, + 720, 721, 0, 721, 722, 720, 722, 721, 721, 0, + 722, 722, 0, 721, 0, 0, 722, 723, 724, 725, + 724, 725, 723, 0, 723, 724, 725, 0, 723, 723, + 724, 725, 0, 0, 723, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 723, 724, 725, 724, 725, 723, + + 0, 723, 724, 725, 0, 723, 723, 724, 725, 0, + 726, 723, 726, 727, 728, 727, 728, 726, 0, 0, + 727, 728, 726, 0, 0, 727, 728, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 726, 0, 726, + 727, 728, 727, 728, 726, 0, 0, 727, 728, 726, + 0, 0, 727, 728, 729, 0, 729, 730, 731, 730, + 731, 729, 729, 0, 730, 731, 729, 0, 0, 730, + 731, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 729, 0, 729, 730, 731, 730, 731, 729, 729, + 732, 730, 731, 729, 732, 733, 730, 731, 734, 733, + + 732, 0, 734, 736, 735, 733, 735, 736, 734, 736, + 732, 735, 735, 0, 736, 733, 735, 732, 734, 736, + 0, 732, 733, 0, 0, 734, 733, 732, 0, 734, + 736, 735, 733, 735, 736, 734, 736, 732, 735, 735, + 738, 736, 733, 735, 738, 734, 736, 737, 739, 737, + 738, 0, 739, 737, 737, 0, 0, 0, 739, 737, + 738, 0, 0, 0, 0, 0, 0, 738, 739, 0, + 0, 738, 0, 0, 737, 739, 737, 738, 0, 739, + 737, 737, 740, 0, 740, 739, 737, 738, 740, 0, + 0, 0, 741, 742, 740, 739, 741, 742, 0, 0, + + 0, 0, 741, 742, 740, 0, 742, 0, 0, 740, + 0, 740, 741, 742, 0, 740, 0, 0, 0, 741, + 742, 740, 743, 741, 742, 0, 743, 0, 0, 741, + 742, 740, 743, 742, 744, 743, 0, 745, 744, 741, + 742, 745, 743, 0, 744, 745, 746, 745, 0, 743, + 746, 0, 0, 743, 744, 0, 746, 745, 0, 743, + 0, 744, 743, 0, 745, 744, 746, 0, 745, 743, + 0, 744, 745, 746, 745, 747, 748, 746, 0, 747, + 748, 744, 0, 746, 745, 747, 748, 0, 0, 0, + 749, 0, 0, 746, 749, 747, 748, 0, 749, 0, + + 0, 0, 747, 748, 749, 0, 747, 748, 0, 0, + 0, 0, 747, 748, 749, 0, 750, 749, 0, 0, + 750, 749, 747, 748, 750, 749, 0, 0, 751, 752, + 750, 749, 751, 752, 0, 0, 0, 0, 751, 752, + 750, 749, 753, 750, 0, 0, 753, 750, 751, 752, + 753, 750, 753, 0, 0, 751, 752, 750, 0, 751, + 752, 0, 753, 0, 0, 751, 752, 750, 754, 753, + 755, 0, 754, 753, 755, 751, 752, 753, 754, 753, + 755, 754, 757, 0, 0, 755, 757, 0, 754, 753, + 755, 756, 757, 0, 756, 754, 0, 755, 756, 754, + + 0, 755, 757, 0, 756, 754, 0, 755, 754, 757, + 0, 0, 755, 757, 756, 754, 758, 755, 756, 757, + 758, 756, 0, 760, 758, 756, 758, 0, 759, 757, + 759, 756, 760, 0, 760, 759, 758, 0, 761, 760, + 759, 756, 761, 758, 760, 0, 0, 758, 761, 0, + 760, 758, 0, 758, 0, 759, 0, 759, 761, 760, + 762, 760, 759, 758, 762, 761, 760, 759, 763, 761, + 762, 760, 763, 765, 764, 761, 764, 765, 763, 0, + 762, 764, 0, 765, 0, 761, 764, 762, 763, 0, + 0, 762, 766, 765, 0, 763, 766, 762, 0, 763, + + 765, 764, 766, 764, 765, 763, 0, 762, 764, 0, + 765, 0, 766, 764, 767, 763, 0, 768, 767, 766, + 765, 768, 769, 766, 767, 0, 769, 768, 0, 766, + 0, 771, 769, 771, 767, 0, 770, 768, 771, 766, + 770, 767, 769, 771, 768, 767, 770, 0, 768, 769, + 772, 767, 772, 769, 768, 0, 770, 772, 771, 769, + 771, 767, 772, 770, 768, 771, 0, 770, 0, 769, + 771, 774, 0, 770, 773, 0, 773, 772, 0, 772, + 774, 773, 774, 770, 772, 0, 773, 774, 775, 772, + 775, 0, 774, 0, 0, 775, 0, 775, 774, 0, + + 775, 773, 0, 773, 776, 0, 776, 774, 773, 774, + 0, 776, 0, 773, 774, 775, 776, 775, 0, 774, + 0, 0, 775, 777, 775, 777, 778, 775, 0, 0, + 777, 776, 777, 776, 779, 777, 779, 778, 776, 778, + 0, 779, 779, 776, 778, 0, 779, 0, 0, 778, + 777, 0, 777, 778, 0, 0, 0, 777, 0, 777, + 780, 779, 777, 779, 778, 780, 778, 780, 779, 779, + 781, 778, 780, 779, 781, 782, 778, 780, 782, 782, + 781, 0, 0, 0, 0, 782, 0, 780, 0, 0, + 781, 0, 780, 0, 780, 782, 0, 781, 0, 780, + + 0, 781, 782, 0, 780, 782, 782, 781, 0, 783, + 784, 785, 782, 783, 784, 785, 0, 781, 0, 783, + 784, 785, 782, 786, 787, 0, 784, 786, 787, 783, + 784, 785, 0, 786, 787, 0, 783, 784, 785, 0, + 783, 784, 785, 786, 787, 0, 783, 784, 785, 0, + 786, 787, 0, 784, 786, 787, 783, 784, 785, 0, + 786, 787, 788, 0, 788, 886, 887, 886, 887, 788, + 786, 787, 886, 887, 788, 0, 0, 886, 887, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 788, + 0, 788, 886, 887, 886, 887, 788, 0, 0, 886, + + 887, 788, 0, 0, 886, 887, 888, 889, 888, 889, + 0, 890, 891, 888, 889, 890, 891, 0, 888, 889, + 888, 890, 891, 0, 0, 0, 0, 0, 0, 0, + 0, 890, 891, 888, 889, 888, 889, 0, 890, 891, + 888, 889, 890, 891, 0, 888, 889, 888, 890, 891, + 892, 893, 0, 0, 892, 893, 0, 0, 890, 891, + 892, 893, 0, 895, 895, 894, 893, 0, 895, 894, + 892, 893, 0, 894, 895, 0, 0, 892, 893, 894, + 0, 892, 893, 0, 895, 0, 0, 892, 893, 894, + 895, 895, 894, 893, 0, 895, 894, 892, 893, 0, + + 894, 895, 896, 897, 896, 897, 894, 0, 896, 0, + 897, 895, 0, 0, 896, 897, 894, 0, 0, 0, + 0, 0, 0, 0, 896, 0, 898, 0, 898, 896, + 897, 896, 897, 898, 898, 896, 899, 897, 898, 900, + 899, 896, 897, 900, 901, 902, 899, 902, 901, 900, + 0, 896, 902, 898, 901, 898, 899, 902, 903, 900, + 898, 898, 903, 899, 901, 898, 900, 899, 903, 0, + 900, 901, 902, 899, 902, 901, 900, 0, 903, 902, + 0, 901, 0, 899, 902, 903, 900, 0, 904, 903, + 0, 901, 904, 905, 0, 903, 907, 905, 904, 0, + + 907, 905, 906, 0, 906, 903, 907, 905, 904, 906, + 0, 0, 0, 0, 906, 904, 907, 905, 0, 904, + 905, 0, 908, 907, 905, 904, 908, 907, 905, 906, + 0, 906, 908, 907, 905, 904, 906, 0, 0, 0, + 0, 906, 908, 907, 905, 0, 909, 910, 0, 908, + 909, 910, 0, 908, 0, 0, 909, 910, 911, 908, + 911, 0, 910, 0, 0, 911, 909, 910, 0, 908, + 911, 912, 0, 909, 910, 912, 913, 909, 910, 0, + 913, 912, 0, 909, 910, 911, 913, 911, 0, 910, + 0, 912, 911, 909, 910, 914, 913, 911, 912, 914, + + 0, 0, 912, 913, 916, 914, 916, 913, 912, 0, + 914, 916, 0, 913, 0, 914, 916, 0, 912, 0, + 915, 0, 914, 913, 915, 0, 914, 0, 0, 0, + 915, 916, 914, 916, 0, 915, 0, 914, 916, 0, + 915, 0, 914, 916, 917, 0, 0, 915, 917, 919, + 0, 915, 0, 919, 917, 0, 0, 915, 923, 919, + 923, 0, 915, 0, 917, 923, 918, 915, 918, 919, + 923, 917, 918, 0, 0, 917, 919, 0, 918, 0, + 919, 917, 0, 0, 0, 923, 919, 923, 918, 0, + 920, 917, 923, 918, 920, 918, 919, 923, 921, 918, + + 920, 0, 921, 0, 0, 918, 0, 0, 921, 0, + 920, 0, 0, 0, 0, 918, 921, 920, 921, 0, + 0, 920, 0, 0, 922, 921, 0, 920, 922, 921, + 0, 0, 0, 0, 922, 921, 0, 920, 0, 922, + 924, 925, 924, 921, 922, 921, 925, 924, 925, 0, + 0, 922, 924, 925, 0, 922, 0, 0, 925, 0, + 0, 922, 0, 0, 0, 0, 922, 924, 925, 924, + 926, 922, 926, 925, 924, 925, 927, 926, 927, 924, + 925, 0, 926, 927, 928, 925, 928, 0, 927, 0, + 0, 928, 928, 0, 0, 0, 928, 926, 0, 926, + + 929, 0, 929, 927, 926, 927, 0, 929, 0, 926, + 927, 928, 929, 928, 930, 927, 930, 0, 928, 928, + 0, 930, 0, 928, 0, 0, 930, 929, 931, 929, + 931, 0, 0, 0, 929, 931, 931, 0, 0, 929, + 931, 930, 933, 930, 933, 0, 932, 0, 930, 933, + 932, 0, 933, 930, 933, 931, 932, 931, 934, 0, + 934, 0, 931, 931, 0, 934, 932, 931, 0, 933, + 934, 933, 0, 932, 0, 0, 933, 932, 0, 933, + 0, 933, 935, 932, 935, 934, 0, 934, 936, 935, + 936, 0, 934, 932, 935, 936, 0, 934, 937, 0, + + 936, 0, 0, 0, 0, 0, 937, 0, 937, 935, + 0, 935, 938, 937, 938, 936, 935, 936, 937, 938, + 0, 935, 936, 0, 938, 937, 0, 936, 0, 0, + 939, 0, 939, 937, 940, 937, 0, 939, 940, 938, + 937, 938, 939, 0, 940, 937, 938, 0, 941, 0, + 941, 938, 0, 0, 940, 941, 0, 939, 0, 939, + 941, 940, 0, 0, 939, 940, 0, 942, 0, 939, + 0, 940, 0, 0, 0, 941, 0, 941, 942, 0, + 942, 940, 941, 0, 943, 942, 943, 941, 0, 0, + 942, 943, 943, 944, 942, 0, 943, 944, 0, 944, + + 0, 0, 0, 0, 944, 942, 0, 942, 0, 944, + 0, 943, 942, 943, 0, 0, 0, 942, 943, 943, + 944, 0, 0, 943, 944, 945, 944, 945, 946, 0, + 946, 944, 945, 945, 0, 946, 944, 945, 948, 947, + 946, 947, 948, 0, 0, 0, 947, 0, 948, 0, + 0, 947, 945, 0, 945, 946, 0, 946, 948, 945, + 945, 0, 946, 0, 945, 948, 947, 946, 947, 948, + 0, 0, 949, 947, 0, 948, 949, 0, 947, 950, + 950, 0, 949, 0, 950, 948, 0, 949, 0, 0, + 950, 0, 949, 0, 0, 0, 0, 0, 0, 949, + + 950, 0, 0, 949, 0, 0, 950, 950, 951, 949, + 0, 950, 951, 0, 949, 0, 952, 950, 951, 949, + 952, 951, 0, 0, 0, 0, 952, 950, 951, 952, + 953, 0, 0, 0, 953, 951, 952, 0, 0, 951, + 953, 0, 954, 952, 0, 951, 954, 952, 951, 0, + 953, 0, 954, 952, 955, 951, 952, 953, 955, 0, + 0, 953, 954, 952, 955, 0, 956, 953, 0, 954, + 956, 0, 0, 954, 955, 0, 956, 953, 0, 954, + 957, 955, 0, 0, 957, 955, 956, 0, 957, 954, + 0, 955, 958, 956, 957, 0, 958, 956, 961, 0, + + 958, 955, 961, 956, 957, 0, 958, 957, 961, 959, + 959, 957, 0, 956, 959, 957, 958, 0, 961, 958, + 959, 957, 962, 958, 960, 961, 962, 958, 960, 961, + 959, 957, 962, 958, 960, 961, 959, 959, 0, 960, + 0, 959, 962, 958, 960, 961, 0, 959, 0, 962, + 964, 960, 0, 962, 964, 960, 0, 959, 964, 962, + 0, 960, 963, 963, 964, 0, 960, 963, 965, 962, + 965, 960, 0, 963, 964, 965, 0, 964, 0, 0, + 965, 964, 0, 963, 0, 964, 966, 0, 966, 963, + 963, 964, 966, 966, 963, 965, 0, 965, 966, 0, + + 963, 964, 965, 0, 967, 0, 967, 965, 0, 0, + 963, 967, 967, 966, 0, 966, 967, 968, 0, 966, + 966, 0, 0, 969, 0, 966, 0, 0, 968, 0, + 968, 967, 0, 967, 969, 968, 969, 0, 967, 967, + 968, 969, 0, 967, 968, 0, 969, 970, 0, 970, + 969, 0, 0, 0, 970, 968, 0, 968, 971, 970, + 971, 969, 968, 969, 0, 971, 0, 968, 969, 0, + 971, 0, 0, 969, 970, 0, 970, 0, 972, 973, + 973, 970, 972, 0, 973, 971, 970, 971, 972, 0, + 973, 0, 971, 0, 0, 0, 0, 971, 972, 0, + + 973, 0, 0, 0, 974, 972, 973, 973, 974, 972, + 0, 973, 975, 0, 974, 972, 975, 973, 0, 0, + 0, 976, 975, 976, 974, 972, 0, 973, 976, 977, + 0, 974, 975, 976, 0, 974, 0, 0, 0, 975, + 977, 974, 977, 975, 0, 0, 0, 977, 976, 975, + 976, 974, 977, 978, 0, 976, 977, 0, 0, 975, + 976, 979, 0, 979, 978, 0, 978, 977, 979, 977, + 980, 978, 980, 979, 977, 0, 978, 980, 0, 977, + 978, 0, 980, 0, 0, 0, 0, 0, 979, 0, + 979, 978, 1054, 978, 0, 979, 1054, 980, 978, 980, + + 979, 1055, 1054, 978, 980, 1055, 1056, 0, 1056, 980, + 1059, 1055, 1054, 1056, 1059, 1057, 0, 1057, 1056, 1054, + 1059, 1055, 1057, 1054, 1058, 0, 1058, 1057, 1055, 1054, + 1059, 1058, 1055, 1056, 0, 1056, 1058, 1059, 1055, 1054, + 1056, 1059, 1057, 0, 1057, 1056, 1060, 1059, 1055, 1057, + 1060, 1058, 0, 1058, 1057, 0, 1060, 1059, 1058, 0, + 1061, 1060, 1061, 1058, 0, 0, 1060, 1061, 1062, 1063, + 1062, 1063, 1061, 1060, 0, 1062, 1063, 1060, 0, 0, + 1062, 1063, 0, 1060, 0, 0, 0, 1061, 1060, 1061, + 0, 0, 0, 1060, 1061, 1062, 1063, 1062, 1063, 1061, + + 0, 0, 1062, 1063, 1064, 0, 1064, 1062, 1063, 0, + 1065, 1064, 1065, 1066, 1066, 1066, 1064, 1065, 1065, 0, + 1066, 0, 1065, 0, 0, 1066, 0, 0, 0, 0, + 0, 1064, 0, 1064, 0, 0, 0, 1065, 1064, 1065, + 1066, 1066, 1066, 1064, 1065, 1065, 1067, 1066, 0, 1065, + 0, 1068, 1066, 1068, 0, 1067, 0, 1067, 1068, 0, + 0, 0, 1067, 1068, 1069, 0, 1069, 1067, 0, 0, + 0, 1069, 1069, 1067, 0, 0, 1069, 0, 1068, 0, + 1068, 0, 1067, 0, 1067, 1068, 0, 0, 0, 1067, + 1068, 1069, 0, 1069, 1067, 1070, 1071, 1070, 1069, 1069, + + 0, 0, 1070, 1069, 0, 0, 1071, 1070, 1071, 1072, + 0, 1072, 0, 1071, 0, 0, 1072, 0, 1071, 0, + 0, 1072, 1070, 1071, 1070, 0, 0, 0, 1073, 1070, + 0, 0, 0, 1071, 1070, 1071, 1072, 1073, 1072, 1073, + 1071, 0, 0, 1072, 1073, 1071, 0, 0, 1072, 1073, + 1074, 1075, 1074, 1075, 0, 1073, 0, 1074, 1075, 0, + 0, 0, 1074, 1075, 1073, 0, 1073, 0, 0, 0, + 0, 1073, 0, 0, 0, 0, 1073, 1074, 1075, 1074, + 1075, 1076, 1077, 1076, 1074, 1075, 1077, 1078, 1076, 1074, + 1075, 1078, 1077, 1076, 1079, 0, 1079, 1078, 0, 0, + + 0, 1079, 1077, 0, 0, 0, 1079, 1078, 1076, 1077, + 1076, 0, 0, 1077, 1078, 1076, 0, 0, 1078, 1077, + 1076, 1079, 0, 1079, 1078, 0, 0, 0, 1079, 1077, + 1080, 1081, 1080, 1079, 1078, 1081, 1082, 1080, 1080, 0, + 1082, 1081, 1080, 0, 0, 0, 1082, 0, 0, 0, + 1083, 1081, 0, 0, 1083, 0, 1082, 1080, 1081, 1080, + 1083, 0, 1081, 1082, 1080, 1080, 0, 1082, 1081, 1080, + 1083, 0, 1084, 1082, 0, 1085, 1084, 1083, 1081, 1085, + 1086, 1083, 1084, 1082, 1086, 1085, 0, 1083, 0, 0, + 1086, 0, 1084, 0, 1087, 1085, 0, 1083, 1087, 1084, + + 1086, 0, 1085, 1084, 1087, 0, 1085, 1086, 0, 1084, + 0, 1086, 1085, 0, 1087, 0, 1088, 1086, 0, 1084, + 1088, 1087, 1085, 0, 1089, 1087, 1088, 1086, 1089, 1088, + 0, 1087, 0, 0, 1089, 0, 1088, 0, 1090, 0, + 0, 1087, 1090, 1088, 1089, 0, 1090, 1088, 0, 0, + 1091, 1089, 1090, 1088, 1091, 1089, 1088, 0, 0, 0, + 1091, 1089, 1090, 1088, 1092, 1090, 0, 0, 1092, 1090, + 1091, 1089, 0, 1090, 1092, 0, 1093, 1091, 1093, 1090, + 0, 1091, 0, 1093, 1092, 0, 0, 1091, 1093, 1090, + 0, 1092, 1094, 0, 1094, 1092, 0, 1091, 0, 1094, + + 1095, 1092, 1095, 1093, 1094, 1093, 1096, 1095, 1096, 0, + 1093, 1092, 1095, 1096, 0, 1093, 0, 0, 1096, 1094, + 0, 1094, 0, 0, 0, 1097, 1094, 1095, 0, 1095, + 1098, 1094, 1098, 1096, 1095, 1096, 1097, 1098, 1097, 1095, + 1096, 0, 1098, 1097, 0, 1096, 0, 0, 1097, 0, + 0, 0, 1097, 0, 1099, 0, 1099, 1098, 0, 1098, + 0, 1099, 1099, 1097, 1098, 1097, 1099, 1100, 0, 1098, + 1097, 1100, 1101, 0, 0, 1097, 1101, 1100, 0, 0, + 1102, 1099, 1101, 1099, 1102, 0, 0, 1100, 1099, 1099, + 1102, 0, 1101, 1099, 1100, 0, 0, 0, 1100, 1101, + + 1102, 0, 1103, 1101, 1100, 0, 1103, 1102, 0, 1101, + 0, 1102, 1103, 0, 1100, 0, 1104, 1102, 0, 1101, + 1104, 0, 1103, 0, 0, 0, 1104, 1102, 1105, 1103, + 1105, 0, 0, 1103, 1105, 0, 1104, 0, 0, 1103, + 1105, 0, 1106, 1104, 1106, 0, 0, 1104, 1106, 1103, + 1105, 0, 0, 1104, 1106, 1105, 0, 1105, 1107, 0, + 1107, 1105, 0, 1104, 1106, 1107, 1108, 1105, 1108, 1106, + 1107, 1106, 1109, 1108, 1109, 1106, 0, 1105, 1108, 1109, + 0, 1106, 0, 0, 1109, 1107, 0, 1107, 0, 0, + 0, 1106, 1107, 1108, 0, 1108, 1110, 1107, 1110, 1109, + + 1108, 1109, 1111, 1110, 1111, 1108, 1109, 0, 1110, 1111, + 1112, 1109, 1112, 0, 1111, 0, 0, 1112, 0, 0, + 0, 0, 1112, 1110, 0, 1110, 1113, 0, 1113, 1111, + 1110, 1111, 0, 1113, 1114, 1110, 1111, 1112, 1113, 1112, + 0, 1111, 0, 0, 1112, 1114, 1173, 1114, 0, 1112, + 1173, 0, 1114, 1113, 0, 1113, 1173, 1114, 1115, 1116, + 1113, 1114, 0, 0, 0, 1113, 1173, 0, 1116, 1115, + 1116, 1115, 1114, 1173, 1114, 1116, 1115, 1173, 0, 1114, + 1116, 1115, 0, 1173, 1114, 1115, 1116, 0, 0, 0, + 0, 0, 1117, 1173, 1117, 1116, 1115, 1116, 1115, 1117, + + 1117, 0, 1116, 1115, 1117, 1118, 0, 1116, 1115, 0, + 1119, 0, 1119, 1118, 0, 1118, 1120, 1119, 1120, 1117, + 1118, 1117, 1119, 1120, 0, 1118, 1117, 1117, 1120, 0, + 0, 1117, 1118, 0, 1121, 0, 1121, 1119, 0, 1119, + 1118, 1121, 1118, 1120, 1119, 1120, 1121, 1118, 0, 1119, + 1120, 0, 1118, 0, 0, 1120, 0, 1122, 0, 1122, + 1123, 1121, 1123, 1121, 1122, 0, 1123, 1123, 1121, 1122, + 0, 0, 1123, 1121, 0, 0, 1124, 0, 1124, 0, + 0, 0, 0, 1124, 1122, 0, 1122, 1123, 1124, 1123, + 1169, 1122, 1169, 1123, 1123, 0, 1122, 1169, 0, 1123, + + 0, 0, 1169, 1124, 1170, 1124, 1170, 0, 0, 0, + 1124, 1170, 0, 0, 0, 1124, 1170, 1169, 1171, 1169, + 1171, 0, 0, 0, 1169, 1171, 0, 0, 0, 1169, + 1171, 1170, 1172, 1170, 1172, 0, 1174, 0, 1170, 1172, + 1174, 0, 0, 1170, 1172, 1171, 1174, 1171, 0, 0, + 1175, 0, 1171, 0, 1175, 0, 1174, 1171, 0, 1172, + 1175, 1172, 0, 1174, 1176, 1176, 1172, 1174, 0, 0, + 1175, 1172, 0, 1174, 1177, 0, 0, 1175, 1177, 0, + 0, 1175, 0, 1174, 1177, 0, 0, 1175, 1178, 1176, + 0, 0, 1178, 1176, 1177, 0, 1178, 1175, 0, 1176, + + 0, 1177, 1178, 0, 1179, 1177, 0, 0, 1179, 1176, + 0, 1177, 1178, 0, 1179, 1178, 1176, 0, 1180, 1178, + 1176, 1177, 1180, 1178, 1179, 0, 1176, 0, 1180, 1178, + 1181, 1179, 0, 1182, 1181, 1179, 1176, 1182, 1180, 1178, + 1181, 1179, 1183, 1182, 0, 1180, 1183, 0, 1182, 1180, + 1181, 1179, 1183, 1182, 0, 1180, 0, 1181, 0, 0, + 1182, 1181, 1183, 0, 1182, 1180, 0, 1181, 1184, 1183, + 1182, 0, 1184, 1183, 0, 1182, 0, 1181, 1184, 1183, + 1182, 1185, 0, 0, 0, 1185, 0, 0, 1184, 1183, + 1186, 1185, 1186, 0, 0, 1184, 0, 1186, 0, 1184, + + 0, 1185, 1186, 0, 1187, 1184, 1187, 0, 1185, 0, + 0, 1187, 1185, 0, 1188, 1184, 1187, 1186, 1185, 1186, + 1189, 0, 1189, 1188, 1186, 1188, 0, 1189, 1185, 1186, + 1188, 1187, 1189, 1187, 0, 1188, 0, 0, 1187, 0, + 0, 1188, 0, 1187, 1190, 0, 1190, 1189, 0, 1189, + 1188, 1190, 1188, 1191, 1189, 1191, 1190, 1188, 0, 1189, + 1191, 0, 1188, 0, 0, 1191, 0, 0, 0, 0, + 0, 1190, 0, 1190, 0, 0, 0, 0, 1190, 1192, + 1191, 1192, 1191, 1190, 1193, 1192, 1192, 1191, 1193, 1194, + 0, 1192, 1191, 1194, 1193, 1195, 0, 1195, 1196, 1194, + + 1196, 0, 1195, 0, 1193, 1196, 1192, 1195, 1192, 1194, + 1196, 1193, 1192, 1192, 0, 1193, 1194, 0, 1192, 0, + 1194, 1193, 1195, 0, 1195, 1196, 1194, 1196, 1197, 1195, + 1197, 1193, 1196, 0, 1195, 1197, 1194, 1196, 0, 1198, + 1197, 1198, 0, 0, 0, 0, 1198, 1198, 0, 0, + 0, 1198, 1200, 0, 1200, 1197, 0, 1197, 0, 1200, + 0, 0, 1197, 0, 1200, 0, 1198, 1197, 1198, 1199, + 1199, 0, 1199, 1198, 1198, 0, 0, 1199, 1198, 1200, + 0, 1200, 1199, 1201, 0, 1201, 1200, 0, 0, 0, + 1201, 1200, 0, 0, 0, 1201, 1199, 1199, 0, 1199, + + 0, 0, 0, 0, 1199, 0, 1202, 0, 1202, 1199, + 1201, 0, 1201, 1202, 1202, 0, 0, 1201, 1202, 1203, + 0, 1203, 1201, 0, 0, 0, 1203, 1205, 1205, 1205, + 1204, 1203, 1204, 1202, 1205, 1202, 1204, 1204, 0, 1205, + 1202, 1202, 1204, 0, 0, 1202, 1203, 0, 1203, 0, + 0, 0, 0, 1203, 1205, 1205, 1205, 1204, 1203, 1204, + 1206, 1205, 1206, 1204, 1204, 0, 1205, 1206, 1206, 1204, + 1207, 1208, 1206, 1209, 1207, 1208, 0, 1209, 0, 0, + 1207, 1208, 0, 1209, 0, 0, 0, 1206, 0, 1206, + 1207, 1208, 0, 1209, 1206, 1206, 0, 1207, 1208, 1206, + + 1209, 1207, 1208, 0, 1209, 1210, 0, 1207, 1208, 1210, + 1209, 0, 0, 0, 0, 1210, 0, 1207, 1208, 1236, + 1209, 0, 0, 1236, 1234, 1210, 0, 0, 1234, 1236, + 0, 0, 1210, 0, 1234, 0, 1210, 1234, 0, 1236, + 0, 0, 1210, 1237, 1234, 0, 1236, 1237, 0, 0, + 1236, 1234, 1210, 1237, 0, 1234, 1236, 0, 1237, 0, + 0, 1234, 0, 1237, 1234, 0, 1236, 0, 1238, 1239, + 1237, 1234, 1238, 1239, 1237, 0, 0, 0, 1238, 1239, + 1237, 0, 1240, 1241, 1240, 1237, 1240, 1241, 1238, 1239, + 1237, 0, 1240, 1241, 0, 1238, 1239, 1242, 1241, 1238, + + 1239, 1242, 1240, 1241, 0, 1238, 1239, 1242, 0, 1240, + 1241, 1240, 0, 1240, 1241, 1238, 1239, 1242, 0, 1240, + 1241, 0, 1243, 1244, 1242, 1241, 1243, 1244, 1242, 1240, + 1241, 0, 1243, 1244, 1242, 0, 1244, 0, 0, 1245, + 1246, 1245, 1243, 1244, 1242, 1246, 1245, 1246, 0, 1243, + 1244, 1245, 1246, 1243, 1244, 0, 0, 1246, 0, 1243, + 1244, 0, 0, 1244, 0, 0, 1245, 1246, 1245, 1243, + 1244, 0, 1246, 1245, 1246, 1247, 0, 1247, 1245, 1246, + 0, 1248, 1247, 1248, 1246, 0, 0, 1247, 1248, 1249, + 0, 1249, 0, 1248, 0, 0, 1249, 0, 0, 0, + + 0, 1249, 1247, 0, 1247, 0, 0, 1250, 1248, 1247, + 1248, 1250, 0, 0, 1247, 1248, 1249, 1250, 1249, 0, + 1248, 1251, 0, 1249, 0, 1251, 1252, 1250, 1249, 1253, + 1252, 1251, 1251, 1253, 1250, 0, 1252, 0, 1250, 1253, + 0, 1251, 0, 0, 1250, 0, 1252, 0, 1251, 1253, + 1254, 1254, 1251, 1252, 1250, 1254, 1253, 1252, 1251, 1251, + 1253, 1254, 0, 1252, 1269, 1269, 1253, 0, 1251, 0, + 1271, 1254, 0, 1252, 1271, 1272, 1253, 1254, 1254, 1272, + 1271, 0, 1254, 0, 1274, 1272, 1274, 0, 1254, 1269, + 1271, 1274, 0, 1269, 0, 1272, 1274, 1271, 1254, 1269, + + 0, 1271, 1272, 1275, 1273, 1275, 1272, 1271, 1273, 1269, + 1275, 1274, 1272, 1274, 1273, 1275, 1269, 1271, 1274, 0, + 1269, 0, 1272, 1274, 1273, 0, 1269, 1276, 0, 1276, + 1275, 1273, 1275, 0, 1276, 1273, 1269, 1275, 1277, 1276, + 1277, 1273, 1275, 0, 0, 1277, 1278, 0, 1278, 0, + 1277, 1273, 0, 1278, 1276, 0, 1276, 0, 1278, 1279, + 0, 1276, 0, 1279, 1280, 1277, 1276, 1277, 1280, 1279, + 0, 0, 1277, 1278, 1280, 1278, 0, 1277, 1290, 1279, + 1278, 0, 1290, 1291, 1280, 1278, 1279, 1291, 1290, 0, + 1279, 1280, 1292, 1291, 1292, 1280, 1279, 0, 1290, 1292, + + 1300, 1280, 1300, 1291, 1292, 1290, 1279, 1300, 0, 1290, + 1291, 1280, 1300, 0, 1291, 1290, 0, 0, 0, 1292, + 1291, 1292, 0, 0, 0, 1290, 1292, 1300, 0, 1300, + 1291, 1292, 0, 0, 1300, 0, 0, 0, 0, 1300, + 1332, 1332, 1332, 1332, 1332, 1333, 0, 0, 1333, 1333, + 1335, 1335, 1335, 0, 1335, 1336, 0, 1336, 1336, 1336, + 1337, 0, 1337, 1337, 1337, 1338, 0, 1338, 1338, 1338, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, 1331, + 1331, 1331, 1331, 1331, 1331, 1331, 1331 + } ; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. @@ -3096,9 +3096,9 @@ static thread_local std::stringstream strbuf; * The user has a chance to override it with an option. */ #if defined(_WIN32) || defined(_WIN64) - #include + #include #else - #include + #include #endif #endif @@ -3108,50 +3108,50 @@ static thread_local std::stringstream strbuf; /* Holds the entire state of the reentrant scanner. */ struct yyguts_t - { + { - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - int yy_n_chars; - int yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; - int yylineno_r; - int yy_flex_debug_r; + int yylineno_r; + int yy_flex_debug_r; - char *yytext_r; - int yy_more_flag; - int yy_more_len; + char *yytext_r; + int yy_more_flag; + int yy_more_len; - YYSTYPE * yylval_r; + YYSTYPE * yylval_r; - YYLTYPE * yylloc_r; + YYLTYPE * yylloc_r; - }; /* end struct yyguts_t */ + }; /* end struct yyguts_t */ static int yy_init_globals ( yyscan_t yyscanner ); - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - - # define yylloc yyg->yylloc_r - + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + int yylex_init (yyscan_t* scanner); int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); @@ -3193,10 +3193,10 @@ YYSTYPE * yyget_lval ( yyscan_t yyscanner ); void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); - - void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); - + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -3210,7 +3210,7 @@ extern int yywrap ( yyscan_t yyscanner ); #endif #ifndef YY_NO_UNPUT - + #endif #ifndef yytext_ptr @@ -3258,7 +3258,7 @@ static int input ( yyscan_t yyscanner ); int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ @@ -3311,10 +3311,10 @@ static int input ( yyscan_t yyscanner ); #define YY_DECL_IS_OURS 1 extern int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); #define YY_DECL int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng @@ -3339,11 +3339,11 @@ YY_DECL yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; + yylval = yylval_param; - yylloc = yylloc_param; + yylloc = yylloc_param; if ( !yyg->yy_init ) { @@ -4333,8 +4333,8 @@ YY_RULE_SETUP errno = 0; yylval->ival = strtoll(yytext, nullptr, 0); if (errno) { - return fprintf(stderr, "[SQL-Lexer-Error] Integer cannot be parsed - is it out of range?"); - return 0; + return fprintf(stderr, "[SQL-Lexer-Error] Integer cannot be parsed - is it out of range?"); + return 0; } return SQL_INTVAL; } @@ -4536,7 +4536,7 @@ case YY_STATE_EOF(COMMENT): */ static int yy_get_next_buffer (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = yyg->yytext_ptr; int number_to_move, i; @@ -4673,11 +4673,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* yy_get_previous_state - get the state just before the EOB char was reached */ - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { yy_state_type yy_current_state; char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; @@ -4706,10 +4706,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ char *yy_cp = yyg->yy_c_buf_p; YY_CHAR yy_c = 1; @@ -4737,14 +4737,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) #ifndef YY_NO_INPUT #ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) + static int yyinput (yyscan_t yyscanner) #else - static int input (yyscan_t yyscanner) + static int input (yyscan_t yyscanner) #endif { int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; *yyg->yy_c_buf_p = yyg->yy_hold_char; @@ -4815,14 +4815,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ - void yyrestart (FILE * input_file , yyscan_t yyscanner) + void yyrestart (FILE * input_file , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (yyscanner); + yyensure_buffer_stack (yyscanner); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); } yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); @@ -4833,15 +4833,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) * @param new_buffer The new input buffer. * @param yyscanner The scanner object. */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); - */ + */ yyensure_buffer_stack (yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; @@ -4867,7 +4867,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static void yy_load_buffer_state (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; @@ -4880,10 +4880,10 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the allocated buffer state. */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -4908,9 +4908,9 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * @param b a buffer created with yy_create_buffer() * @param yyscanner The scanner object. */ - void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -4928,28 +4928,28 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) { int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_flush_buffer( b , yyscanner); b->yy_input_file = file; b->yy_fill_buffer = 1; - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } - b->yy_is_interactive = 0; - + b->yy_is_interactive = 0; + errno = oerrno; } @@ -4957,9 +4957,9 @@ static void yy_load_buffer_state (yyscan_t yyscanner) * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param yyscanner The scanner object. */ - void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( ! b ) return; @@ -4989,7 +4989,7 @@ static void yy_load_buffer_state (yyscan_t yyscanner) */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (new_buffer == NULL) return; @@ -5020,7 +5020,7 @@ void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) */ void yypop_buffer_state (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!YY_CURRENT_BUFFER) return; @@ -5041,15 +5041,15 @@ void yypop_buffer_state (yyscan_t yyscanner) static void yyensure_buffer_stack (yyscan_t yyscanner) { yy_size_t num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); @@ -5091,10 +5091,10 @@ static void yyensure_buffer_stack (yyscan_t yyscanner) YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) { YY_BUFFER_STATE b; - + if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return NULL; @@ -5127,7 +5127,7 @@ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscann */ YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) { - + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); } @@ -5144,7 +5144,7 @@ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n , yyscanner ); @@ -5187,8 +5187,8 @@ static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) do \ { \ /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = yyg->yy_hold_char; \ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ yyg->yy_hold_char = *yyg->yy_c_buf_p; \ @@ -5204,8 +5204,8 @@ static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner) */ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; } /** Get the current line number. @@ -5213,12 +5213,12 @@ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) */ int yyget_lineno (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; } /** Get the current column number. @@ -5226,12 +5226,12 @@ int yyget_lineno (yyscan_t yyscanner) */ int yyget_column (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; } /** Get the input stream. @@ -5239,8 +5239,8 @@ int yyget_column (yyscan_t yyscanner) */ FILE *yyget_in (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; } /** Get the output stream. @@ -5248,8 +5248,8 @@ FILE *yyget_in (yyscan_t yyscanner) */ FILE *yyget_out (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; } /** Get the length of the current token. @@ -5257,8 +5257,8 @@ FILE *yyget_out (yyscan_t yyscanner) */ int yyget_leng (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; } /** Get the current token. @@ -5267,8 +5267,8 @@ int yyget_leng (yyscan_t yyscanner) char *yyget_text (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; } /** Set the user-defined data. This data is never touched by the scanner. @@ -5277,8 +5277,8 @@ char *yyget_text (yyscan_t yyscanner) */ void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; } /** Set the current line number. @@ -5287,13 +5287,13 @@ void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) */ void yyset_lineno (int _line_number , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); - - yylineno = _line_number; + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; } /** Set the current column. @@ -5302,13 +5302,13 @@ void yyset_lineno (int _line_number , yyscan_t yyscanner) */ void yyset_column (int _column_no , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "yyset_column called with no buffer" ); - - yycolumn = _column_no; + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; } /** Set the input stream. This does not discard the current @@ -5319,54 +5319,54 @@ void yyset_column (int _column_no , yyscan_t yyscanner) */ void yyset_in (FILE * _in_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = _in_str ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; } void yyset_out (FILE * _out_str , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = _out_str ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; } int yyget_debug (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; } void yyset_debug (int _bdebug , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = _bdebug ; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ YYSTYPE * yyget_lval (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; } void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; } YYLTYPE *yyget_lloc (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylloc; } - + void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylloc = yylloc_param; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylloc = yylloc_param; } - + /* User-visible API */ /* yylex_init is special because it creates the scanner itself, so it is @@ -5375,22 +5375,22 @@ void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) */ int yylex_init(yyscan_t* ptr_yy_globals) { - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } /* yylex_init_extra has the same functionality as yylex_init, but follows the @@ -5402,70 +5402,70 @@ int yylex_init(yyscan_t* ptr_yy_globals) */ int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) { - struct yyguts_t dummy_yyguts; + struct yyguts_t dummy_yyguts; - yyset_extra (yy_user_defined, &dummy_yyguts); + yyset_extra (yy_user_defined, &dummy_yyguts); - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } - *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - yyset_extra (yy_user_defined, *ptr_yy_globals); + yyset_extra (yy_user_defined, *ptr_yy_globals); - return yy_init_globals ( *ptr_yy_globals ); + return yy_init_globals ( *ptr_yy_globals ); } static int yy_init_globals (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ - yyg->yy_buffer_stack = NULL; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = NULL; - yyg->yy_init = 0; - yyg->yy_start = 0; + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; + yyin = stdin; + yyout = stdout; #else - yyin = NULL; - yyout = NULL; + yyin = NULL; + yyout = NULL; #endif - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (yyscan_t yyscanner) { - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Pop the buffer stack, destroying each element. */ + /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; @@ -5476,18 +5476,18 @@ int yylex_destroy (yyscan_t yyscanner) yyfree(yyg->yy_buffer_stack , yyscanner); yyg->yy_buffer_stack = NULL; - /* Destroy the start condition stack. */ - yyfree( yyg->yy_start_stack , yyscanner ); - yyg->yy_start_stack = NULL; + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( yyscanner); + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); - /* Destroy the main struct (reentrant only). */ - yyfree ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; } /* @@ -5555,7 +5555,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) ***************************/ int yyerror(const char *msg) { - fprintf(stderr, "[SQL-Lexer-Error] %s\n",msg); return 0; + fprintf(stderr, "[SQL-Lexer-Error] %s\n",msg); return 0; } #if defined(_WIN32) || defined(_WIN64) diff --git a/Data/SQLParser/src/parser/flex_lexer.h b/Data/SQLParser/src/parser/flex_lexer.h index e33f7b06f..5c9c015a7 100644 --- a/Data/SQLParser/src/parser/flex_lexer.h +++ b/Data/SQLParser/src/parser/flex_lexer.h @@ -419,8 +419,8 @@ struct yy_buffer_state */ int yy_at_bol; - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. @@ -519,10 +519,10 @@ YYSTYPE * yyget_lval ( yyscan_t yyscanner ); void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); - YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); - - void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); - + YYLTYPE *yyget_lloc ( yyscan_t yyscanner ); + + void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner ); + /* Macros after this point can all be overridden by user definitions in * section 1. */ @@ -569,10 +569,10 @@ static int yy_flex_strlen ( const char * , yyscan_t yyscanner); #define YY_DECL_IS_OURS 1 extern int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner); #define YY_DECL int yylex \ - (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ diff --git a/Data/SQLParser/src/sql/CreateStatement.cpp b/Data/SQLParser/src/sql/CreateStatement.cpp index d69b4179e..dec0f9947 100644 --- a/Data/SQLParser/src/sql/CreateStatement.cpp +++ b/Data/SQLParser/src/sql/CreateStatement.cpp @@ -5,18 +5,18 @@ namespace hsql { // CreateStatemnet CreateStatement::CreateStatement(CreateType type) - : SQLStatement(kStmtCreate), - type(type), - ifNotExists(false), - filePath(nullptr), - schema(nullptr), - tableName(nullptr), - indexName(nullptr), - indexColumns(nullptr), - columns(nullptr), - tableConstraints(nullptr), - viewColumns(nullptr), - select(nullptr) {} + : SQLStatement(kStmtCreate), + type(type), + ifNotExists(false), + filePath(nullptr), + schema(nullptr), + tableName(nullptr), + indexName(nullptr), + indexColumns(nullptr), + columns(nullptr), + tableConstraints(nullptr), + viewColumns(nullptr), + select(nullptr) {} CreateStatement::~CreateStatement() { free(filePath); @@ -26,31 +26,31 @@ CreateStatement::~CreateStatement() { delete select; if (columns) { - for (ColumnDefinition* def : *columns) { - delete def; - } - delete columns; + for (ColumnDefinition* def : *columns) { + delete def; + } + delete columns; } if (tableConstraints) { - for (TableConstraint* def : *tableConstraints) { - delete def; - } - delete tableConstraints; + for (TableConstraint* def : *tableConstraints) { + delete def; + } + delete tableConstraints; } if (indexColumns) { - for (char* column : *indexColumns) { - free(column); - } - delete indexColumns; + for (char* column : *indexColumns) { + free(column); + } + delete indexColumns; } if (viewColumns) { - for (char* column : *viewColumns) { - free(column); - } - delete viewColumns; + for (char* column : *viewColumns) { + free(column); + } + delete viewColumns; } } @@ -59,11 +59,11 @@ void CreateStatement::setColumnDefsAndConstraints(std::vector* ta tableConstraints = new std::vector(); for (auto tableElem : *tableElements) { - if (auto* colDef = dynamic_cast(tableElem)) { - columns->emplace_back(colDef); - } else if (auto* tableConstraint = dynamic_cast(tableElem)) { - tableConstraints->emplace_back(tableConstraint); - } + if (auto* colDef = dynamic_cast(tableElem)) { + columns->emplace_back(colDef); + } else if (auto* tableConstraint = dynamic_cast(tableElem)) { + tableConstraints->emplace_back(tableConstraint); + } } } diff --git a/Data/SQLParser/src/sql/CreateStatement.h b/Data/SQLParser/src/sql/CreateStatement.h index 2ba4c90a8..dd89deb55 100644 --- a/Data/SQLParser/src/sql/CreateStatement.h +++ b/Data/SQLParser/src/sql/CreateStatement.h @@ -37,14 +37,14 @@ struct SQLParser_API ColumnDefinition : TableElement { // By default, columns are nullable. However, we track if a column is explicitly requested to be nullable to // notice conflicts with PRIMARY KEY table constraints. bool trySetNullableExplicit() { - if (column_constraints->count(ConstraintType::NotNull) || column_constraints->count(ConstraintType::PrimaryKey)) { - if (column_constraints->count(ConstraintType::Null)) { - return false; - } - nullable = false; - } + if (column_constraints->count(ConstraintType::NotNull) || column_constraints->count(ConstraintType::PrimaryKey)) { + if (column_constraints->count(ConstraintType::Null)) { + return false; + } + nullable = false; + } - return true; + return true; } std::unordered_set* column_constraints; diff --git a/Data/SQLParser/src/sql/Expr.cpp b/Data/SQLParser/src/sql/Expr.cpp index f47dbdb1d..6ec0f45a3 100644 --- a/Data/SQLParser/src/sql/Expr.cpp +++ b/Data/SQLParser/src/sql/Expr.cpp @@ -6,10 +6,10 @@ namespace hsql { FrameBound::FrameBound(int64_t offset, FrameBoundType type, bool unbounded) - : offset{offset}, type{type}, unbounded{unbounded} {} + : offset{offset}, type{type}, unbounded{unbounded} {} FrameDescription::FrameDescription(FrameType type, FrameBound* start, FrameBound* end) - : type{type}, start{start}, end{end} {} + : type{type}, start{start}, end{end} {} FrameDescription::~FrameDescription() { delete start; @@ -17,45 +17,45 @@ FrameDescription::~FrameDescription() { } WindowDescription::WindowDescription(std::vector* partitionList, std::vector* orderList, - FrameDescription* frameDescription) - : partitionList{partitionList}, orderList{orderList}, frameDescription{frameDescription} {} + FrameDescription* frameDescription) + : partitionList{partitionList}, orderList{orderList}, frameDescription{frameDescription} {} WindowDescription::~WindowDescription() { if (partitionList) { - for (Expr* e : *partitionList) { - delete e; - } - delete partitionList; + for (Expr* e : *partitionList) { + delete e; + } + delete partitionList; } if (orderList) { - for (OrderDescription* orderDescription : *orderList) { - delete orderDescription; - } - delete orderList; + for (OrderDescription* orderDescription : *orderList) { + delete orderDescription; + } + delete orderList; } delete frameDescription; } Expr::Expr(ExprType type) - : type(type), - expr(nullptr), - expr2(nullptr), - exprList(nullptr), - select(nullptr), - name(nullptr), - table(nullptr), - alias(nullptr), - fval(0), - ival(0), - ival2(0), - datetimeField(kDatetimeNone), - columnType(DataType::UNKNOWN, 0), - isBoolLiteral(false), - opType(kOpNone), - distinct(false), - windowDescription(nullptr) {} + : type(type), + expr(nullptr), + expr2(nullptr), + exprList(nullptr), + select(nullptr), + name(nullptr), + table(nullptr), + alias(nullptr), + fval(0), + ival(0), + ival2(0), + datetimeField(kDatetimeNone), + columnType(DataType::UNKNOWN, 0), + isBoolLiteral(false), + opType(kOpNone), + distinct(false), + windowDescription(nullptr) {} Expr::~Expr() { delete expr; @@ -68,10 +68,10 @@ Expr::~Expr() { free(alias); if (exprList) { - for (Expr* e : *exprList) { - delete e; - } - delete exprList; + for (Expr* e : *exprList) { + delete e; + } + delete exprList; } } @@ -284,7 +284,7 @@ bool Expr::isType(ExprType exprType) const { return exprType == type; } bool Expr::isLiteral() const { return isType(kExprLiteralInt) || isType(kExprLiteralFloat) || isType(kExprLiteralString) || isType(kExprParameter) || - isType(kExprLiteralNull) || isType(kExprLiteralDate) || isType(kExprLiteralInterval); + isType(kExprLiteralNull) || isType(kExprLiteralDate) || isType(kExprLiteralInterval); } bool Expr::hasAlias() const { return alias != nullptr; } @@ -293,9 +293,9 @@ bool Expr::hasTable() const { return table != nullptr; } const char* Expr::getName() const { if (alias) - return alias; + return alias; else - return name; + return name; } char* substr(const char* source, int from, int to) { diff --git a/Data/SQLParser/src/sql/Expr.h b/Data/SQLParser/src/sql/Expr.h index 893432de7..37bfb88c8 100644 --- a/Data/SQLParser/src/sql/Expr.h +++ b/Data/SQLParser/src/sql/Expr.h @@ -109,7 +109,7 @@ typedef struct Expr Expr; // Description of additional fields for a window expression. struct SQLParser_API WindowDescription { WindowDescription(std::vector* partitionList, std::vector* orderList, - FrameDescription* frameDescription); + FrameDescription* frameDescription); virtual ~WindowDescription(); std::vector* partitionList; @@ -226,9 +226,9 @@ struct SQLParser_API Expr { #define ALLOC_EXPR(var, type) \ Expr* var; \ do { \ - Expr zero = {type}; \ - var = (Expr*)malloc(sizeof *var); \ - *var = zero; \ + Expr zero = {type}; \ + var = (Expr*)malloc(sizeof *var); \ + *var = zero; \ } while (0); #undef ALLOC_EXPR diff --git a/Data/SQLParser/src/sql/SQLStatement.cpp b/Data/SQLParser/src/sql/SQLStatement.cpp index 52ecbec4a..0dbcdbdb1 100644 --- a/Data/SQLParser/src/sql/SQLStatement.cpp +++ b/Data/SQLParser/src/sql/SQLStatement.cpp @@ -8,9 +8,9 @@ SQLStatement::SQLStatement(StatementType type) : hints(nullptr), type_(type) {} SQLStatement::~SQLStatement() { if (hints) { - for (Expr* hint : *hints) { - delete hint; - } + for (Expr* hint : *hints) { + delete hint; + } } delete hints; } diff --git a/Data/SQLParser/src/sql/statements.cpp b/Data/SQLParser/src/sql/statements.cpp index c1394b15e..b4205f108 100644 --- a/Data/SQLParser/src/sql/statements.cpp +++ b/Data/SQLParser/src/sql/statements.cpp @@ -5,18 +5,18 @@ namespace hsql { // KeyConstraints TableConstraint::TableConstraint(ConstraintType type, std::vector* columnNames) - : type(type), columnNames(columnNames) {} + : type(type), columnNames(columnNames) {} TableConstraint::~TableConstraint() { for (char* def : *columnNames) { - free(def); + free(def); } delete columnNames; } // ColumnDefinition ColumnDefinition::ColumnDefinition(char* name, ColumnType type, std::unordered_set* column_constraints) - : column_constraints(column_constraints), name(name), type(type), nullable(true) {} + : column_constraints(column_constraints), name(name), type(type), nullable(true) {} ColumnDefinition::~ColumnDefinition() { free(name); @@ -24,7 +24,7 @@ ColumnDefinition::~ColumnDefinition() { } ColumnType::ColumnType(DataType data_type, int64_t length, int64_t precision, int64_t scale) - : data_type(data_type), length(length), precision(precision), scale(scale) {} + : data_type(data_type), length(length), precision(precision), scale(scale) {} bool operator==(const ColumnType& lhs, const ColumnType& rhs) { if (lhs.data_type != rhs.data_type) return false; @@ -35,54 +35,54 @@ bool operator!=(const ColumnType& lhs, const ColumnType& rhs) { return !(lhs == std::ostream& operator<<(std::ostream& stream, const ColumnType& column_type) { switch (column_type.data_type) { - case DataType::UNKNOWN: - stream << "UNKNOWN"; - break; - case DataType::INT: - stream << "INT"; - break; - case DataType::BIGINT: - stream << "BIGINT"; - break; - case DataType::LONG: - stream << "LONG"; - break; - case DataType::FLOAT: - stream << "FLOAT"; - break; - case DataType::DOUBLE: - stream << "DOUBLE"; - break; - case DataType::REAL: - stream << "REAL"; - break; - case DataType::CHAR: - stream << "CHAR(" << column_type.length << ")"; - break; - case DataType::VARCHAR: - stream << "VARCHAR(" << column_type.length << ")"; - break; - case DataType::DECIMAL: - stream << "DECIMAL"; - break; - case DataType::TEXT: - stream << "TEXT"; - break; - case DataType::DATETIME: - stream << "DATETIME"; - break; - case DataType::DATE: - stream << "DATE"; - break; - case DataType::TIME: - stream << "TIME"; - break; - case DataType::SMALLINT: - stream << "SMALLINT"; - break; - case DataType::BOOLEAN: - stream << "BOOLEAN"; - break; + case DataType::UNKNOWN: + stream << "UNKNOWN"; + break; + case DataType::INT: + stream << "INT"; + break; + case DataType::BIGINT: + stream << "BIGINT"; + break; + case DataType::LONG: + stream << "LONG"; + break; + case DataType::FLOAT: + stream << "FLOAT"; + break; + case DataType::DOUBLE: + stream << "DOUBLE"; + break; + case DataType::REAL: + stream << "REAL"; + break; + case DataType::CHAR: + stream << "CHAR(" << column_type.length << ")"; + break; + case DataType::VARCHAR: + stream << "VARCHAR(" << column_type.length << ")"; + break; + case DataType::DECIMAL: + stream << "DECIMAL"; + break; + case DataType::TEXT: + stream << "TEXT"; + break; + case DataType::DATETIME: + stream << "DATETIME"; + break; + case DataType::DATE: + stream << "DATE"; + break; + case DataType::TIME: + stream << "TIME"; + break; + case DataType::SMALLINT: + stream << "SMALLINT"; + break; + case DataType::BOOLEAN: + stream << "BOOLEAN"; + break; } return stream; } @@ -98,7 +98,7 @@ DeleteStatement::~DeleteStatement() { // DropStatement DropStatement::DropStatement(DropType type) - : SQLStatement(kStmtDrop), type(type), schema(nullptr), name(nullptr), indexName(nullptr) {} + : SQLStatement(kStmtDrop), type(type), schema(nullptr), name(nullptr), indexName(nullptr) {} DropStatement::~DropStatement() { free(schema); @@ -113,12 +113,12 @@ AlterAction::AlterAction(ActionType type) : type(type) {} AlterAction::~AlterAction() = default; DropColumnAction::DropColumnAction(char* column_name) - : AlterAction(ActionType::DropColumn), columnName(column_name), ifExists(false) {} + : AlterAction(ActionType::DropColumn), columnName(column_name), ifExists(false) {} DropColumnAction::~DropColumnAction() { free(columnName); } AlterStatement::AlterStatement(char* name, AlterAction* action) - : SQLStatement(kStmtAlter), schema(nullptr), ifTableExists(false), name(name), action(action) {} + : SQLStatement(kStmtAlter), schema(nullptr), ifTableExists(false), name(name), action(action) {} AlterStatement::~AlterStatement() { free(schema); @@ -128,7 +128,7 @@ AlterStatement::~AlterStatement() { // TransactionStatement TransactionStatement::TransactionStatement(TransactionCommand command) - : SQLStatement(kStmtTransaction), command(command) {} + : SQLStatement(kStmtTransaction), command(command) {} TransactionStatement::~TransactionStatement() {} @@ -139,16 +139,16 @@ ExecuteStatement::~ExecuteStatement() { free(name); if (parameters) { - for (Expr* param : *parameters) { - delete param; - } - delete parameters; + for (Expr* param : *parameters) { + delete param; + } + delete parameters; } } // ExportStatement ExportStatement::ExportStatement(ImportType type) - : SQLStatement(kStmtExport), type(type), filePath(nullptr), schema(nullptr), tableName(nullptr), select(nullptr) {} + : SQLStatement(kStmtExport), type(type), filePath(nullptr), schema(nullptr), tableName(nullptr), select(nullptr) {} ExportStatement::~ExportStatement() { free(filePath); @@ -159,12 +159,12 @@ ExportStatement::~ExportStatement() { // ImportStatement ImportStatement::ImportStatement(ImportType type) - : SQLStatement(kStmtImport), - type(type), - filePath(nullptr), - schema(nullptr), - tableName(nullptr), - whereClause(nullptr) {} + : SQLStatement(kStmtImport), + type(type), + filePath(nullptr), + schema(nullptr), + tableName(nullptr), + whereClause(nullptr) {} ImportStatement::~ImportStatement() { free(filePath); @@ -175,13 +175,13 @@ ImportStatement::~ImportStatement() { // InsertStatement InsertStatement::InsertStatement(InsertType type) - : SQLStatement(kStmtInsert), - type(type), - schema(nullptr), - tableName(nullptr), - columns(nullptr), - values(nullptr), - select(nullptr) {} + : SQLStatement(kStmtInsert), + type(type), + schema(nullptr), + tableName(nullptr), + columns(nullptr), + values(nullptr), + select(nullptr) {} InsertStatement::~InsertStatement() { free(schema); @@ -189,17 +189,17 @@ InsertStatement::~InsertStatement() { delete select; if (columns) { - for (char* column : *columns) { - free(column); - } - delete columns; + for (char* column : *columns) { + free(column); + } + delete columns; } if (values) { - for (Expr* expr : *values) { - delete expr; - } - delete values; + for (Expr* expr : *values) { + delete expr; + } + delete values; } } @@ -233,10 +233,10 @@ GroupByDescription::~GroupByDescription() { delete having; if (columns) { - for (Expr* expr : *columns) { - delete expr; - } - delete columns; + for (Expr* expr : *columns) { + delete expr; + } + delete columns; } } @@ -247,17 +247,17 @@ WithDescription::~WithDescription() { // SelectStatement SelectStatement::SelectStatement() - : SQLStatement(kStmtSelect), - fromTable(nullptr), - selectDistinct(false), - selectList(nullptr), - whereClause(nullptr), - groupBy(nullptr), - setOperations(nullptr), - order(nullptr), - withDescriptions(nullptr), - limit(nullptr), - lockings(nullptr) {} + : SQLStatement(kStmtSelect), + fromTable(nullptr), + selectDistinct(false), + selectList(nullptr), + whereClause(nullptr), + groupBy(nullptr), + setOperations(nullptr), + order(nullptr), + withDescriptions(nullptr), + limit(nullptr), + lockings(nullptr) {} SelectStatement::~SelectStatement() { delete fromTable; @@ -267,44 +267,44 @@ SelectStatement::~SelectStatement() { // Delete each element in the select list. if (selectList) { - for (Expr* expr : *selectList) { - delete expr; - } - delete selectList; + for (Expr* expr : *selectList) { + delete expr; + } + delete selectList; } if (order) { - for (OrderDescription* desc : *order) { - delete desc; - } - delete order; + for (OrderDescription* desc : *order) { + delete desc; + } + delete order; } if (withDescriptions) { - for (WithDescription* desc : *withDescriptions) { - delete desc; - } - delete withDescriptions; + for (WithDescription* desc : *withDescriptions) { + delete desc; + } + delete withDescriptions; } if (setOperations) { - for (SetOperation* setOperation : *setOperations) { - delete setOperation; - } - delete setOperations; + for (SetOperation* setOperation : *setOperations) { + delete setOperation; + } + delete setOperations; } if (lockings) { - for (LockingClause* lockingClause : *lockings) { - if (lockingClause->tables) { - for (char* dtable : *lockingClause->tables) { - free(dtable); - } - delete lockingClause->tables; - } - delete lockingClause; - } - delete lockings; + for (LockingClause* lockingClause : *lockings) { + if (lockingClause->tables) { + for (char* dtable : *lockingClause->tables) { + free(dtable); + } + delete lockingClause->tables; + } + delete lockingClause; + } + delete lockings; } } @@ -316,12 +316,12 @@ UpdateStatement::~UpdateStatement() { delete where; if (updates) { - for (UpdateClause* update : *updates) { - free(update->column); - delete update->value; - delete update; - } - delete updates; + for (UpdateClause* update : *updates) { + free(update->column); + delete update->value; + delete update; + } + delete updates; } } @@ -331,16 +331,16 @@ Alias::Alias(char* name, std::vector* columns) : name(name), columns(colu Alias::~Alias() { free(name); if (columns) { - for (char* column : *columns) { - free(column); - } - delete columns; + for (char* column : *columns) { + free(column); + } + delete columns; } } // TableRef TableRef::TableRef(TableRefType type) - : type(type), schema(nullptr), name(nullptr), alias(nullptr), select(nullptr), list(nullptr), join(nullptr) {} + : type(type), schema(nullptr), name(nullptr), alias(nullptr), select(nullptr), list(nullptr), join(nullptr) {} TableRef::~TableRef() { free(schema); @@ -351,10 +351,10 @@ TableRef::~TableRef() { delete alias; if (list) { - for (TableRef* table : *list) { - delete table; - } - delete list; + for (TableRef* table : *list) { + delete table; + } + delete list; } } @@ -362,9 +362,9 @@ bool TableRef::hasSchema() const { return schema != nullptr; } const char* TableRef::getName() const { if (alias) - return alias->name; + return alias->name; else - return name; + return name; } // JoinDefinition @@ -383,10 +383,10 @@ SetOperation::~SetOperation() { delete resultLimit; if (resultOrder) { - for (OrderDescription* desc : *resultOrder) { - delete desc; - } - delete resultOrder; + for (OrderDescription* desc : *resultOrder) { + delete desc; + } + delete resultOrder; } } diff --git a/Data/SQLParser/src/util/sqlhelper.cpp b/Data/SQLParser/src/util/sqlhelper.cpp index 7c2f16d98..e90ccf240 100644 --- a/Data/SQLParser/src/util/sqlhelper.cpp +++ b/Data/SQLParser/src/util/sqlhelper.cpp @@ -32,32 +32,32 @@ void inprint(const DatetimeField& colType, uintmax_t num_indent) { void printTableRefInfo(TableRef* table, uintmax_t num_indent) { switch (table->type) { - case kTableName: - inprint(table->name, num_indent); - if (table->schema) { - inprint("Schema", num_indent + 1); - inprint(table->schema, num_indent + 2); - } - break; - case kTableSelect: - printSelectStatementInfo(table->select, num_indent); - break; - case kTableJoin: - inprint("Join Table", num_indent); - inprint("Left", num_indent + 1); - printTableRefInfo(table->join->left, num_indent + 2); - inprint("Right", num_indent + 1); - printTableRefInfo(table->join->right, num_indent + 2); - inprint("Join Condition", num_indent + 1); - printExpression(table->join->condition, num_indent + 2); - break; - case kTableCrossProduct: - for (TableRef* tbl : *table->list) printTableRefInfo(tbl, num_indent); - break; + case kTableName: + inprint(table->name, num_indent); + if (table->schema) { + inprint("Schema", num_indent + 1); + inprint(table->schema, num_indent + 2); + } + break; + case kTableSelect: + printSelectStatementInfo(table->select, num_indent); + break; + case kTableJoin: + inprint("Join Table", num_indent); + inprint("Left", num_indent + 1); + printTableRefInfo(table->join->left, num_indent + 2); + inprint("Right", num_indent + 1); + printTableRefInfo(table->join->right, num_indent + 2); + inprint("Join Condition", num_indent + 1); + printExpression(table->join->condition, num_indent + 2); + break; + case kTableCrossProduct: + for (TableRef* tbl : *table->list) printTableRefInfo(tbl, num_indent); + break; } if (table->alias) { - printAlias(table->alias, num_indent); + printAlias(table->alias, num_indent); } } @@ -66,150 +66,150 @@ void printAlias(Alias* alias, uintmax_t num_indent) { inprint(alias->name, num_indent + 2); if (alias->columns) { - for (char* column : *(alias->columns)) { - inprint(column, num_indent + 3); - } + for (char* column : *(alias->columns)) { + inprint(column, num_indent + 3); + } } } void printOperatorExpression(Expr* expr, uintmax_t num_indent) { if (expr == nullptr) { - inprint("null", num_indent); - return; + inprint("null", num_indent); + return; } inprint(expr->opType, num_indent); printExpression(expr->expr, num_indent + 1); if (expr->expr2) { - printExpression(expr->expr2, num_indent + 1); + printExpression(expr->expr2, num_indent + 1); } else if (expr->exprList) { - for (Expr* e : *expr->exprList) printExpression(e, num_indent + 1); + for (Expr* e : *expr->exprList) printExpression(e, num_indent + 1); } } void printExpression(Expr* expr, uintmax_t num_indent) { if (!expr) return; switch (expr->type) { - case kExprStar: - inprint("*", num_indent); - break; - case kExprColumnRef: - inprint(expr->name, num_indent); - if (expr->table) { - inprint("Table:", num_indent + 1); - inprint(expr->table, num_indent + 2); - } - break; - // case kExprTableColumnRef: inprint(expr->table, expr->name, num_indent); break; - case kExprLiteralFloat: - inprint(expr->fval, num_indent); - break; - case kExprLiteralInt: - inprint(expr->ival, num_indent); - break; - case kExprLiteralString: - inprint(expr->name, num_indent); - break; - case kExprLiteralDate: - inprint(expr->name, num_indent); - break; - case kExprLiteralNull: - inprint("NULL", num_indent); - break; - case kExprLiteralInterval: - inprint("INTERVAL", num_indent); - inprint(expr->ival, num_indent + 1); - inprint(expr->datetimeField, num_indent + 1); - break; - case kExprFunctionRef: - inprint(expr->name, num_indent); - for (Expr* e : *expr->exprList) { - printExpression(e, num_indent + 1); - } + case kExprStar: + inprint("*", num_indent); + break; + case kExprColumnRef: + inprint(expr->name, num_indent); + if (expr->table) { + inprint("Table:", num_indent + 1); + inprint(expr->table, num_indent + 2); + } + break; + // case kExprTableColumnRef: inprint(expr->table, expr->name, num_indent); break; + case kExprLiteralFloat: + inprint(expr->fval, num_indent); + break; + case kExprLiteralInt: + inprint(expr->ival, num_indent); + break; + case kExprLiteralString: + inprint(expr->name, num_indent); + break; + case kExprLiteralDate: + inprint(expr->name, num_indent); + break; + case kExprLiteralNull: + inprint("NULL", num_indent); + break; + case kExprLiteralInterval: + inprint("INTERVAL", num_indent); + inprint(expr->ival, num_indent + 1); + inprint(expr->datetimeField, num_indent + 1); + break; + case kExprFunctionRef: + inprint(expr->name, num_indent); + for (Expr* e : *expr->exprList) { + printExpression(e, num_indent + 1); + } - if (expr->windowDescription) { - printWindowDescription(expr->windowDescription, num_indent + 1); - } - break; - case kExprExtract: - inprint("EXTRACT", num_indent); - inprint(expr->datetimeField, num_indent + 1); - printExpression(expr->expr, num_indent + 1); - break; - case kExprCast: - inprint("CAST", num_indent); - inprint(expr->columnType, num_indent + 1); - printExpression(expr->expr, num_indent + 1); - break; - case kExprOperator: - printOperatorExpression(expr, num_indent); - break; - case kExprSelect: - printSelectStatementInfo(expr->select, num_indent); - break; - case kExprParameter: - inprint(expr->ival, num_indent); - break; - case kExprArray: - for (Expr* e : *expr->exprList) { - printExpression(e, num_indent + 1); - } - break; - case kExprArrayIndex: - printExpression(expr->expr, num_indent + 1); - inprint(expr->ival, num_indent); - break; - default: - std::cerr << "Unrecognized expression type " << expr->type << std::endl; - return; + if (expr->windowDescription) { + printWindowDescription(expr->windowDescription, num_indent + 1); + } + break; + case kExprExtract: + inprint("EXTRACT", num_indent); + inprint(expr->datetimeField, num_indent + 1); + printExpression(expr->expr, num_indent + 1); + break; + case kExprCast: + inprint("CAST", num_indent); + inprint(expr->columnType, num_indent + 1); + printExpression(expr->expr, num_indent + 1); + break; + case kExprOperator: + printOperatorExpression(expr, num_indent); + break; + case kExprSelect: + printSelectStatementInfo(expr->select, num_indent); + break; + case kExprParameter: + inprint(expr->ival, num_indent); + break; + case kExprArray: + for (Expr* e : *expr->exprList) { + printExpression(e, num_indent + 1); + } + break; + case kExprArrayIndex: + printExpression(expr->expr, num_indent + 1); + inprint(expr->ival, num_indent); + break; + default: + std::cerr << "Unrecognized expression type " << expr->type << std::endl; + return; } if (expr->alias) { - inprint("Alias", num_indent + 1); - inprint(expr->alias, num_indent + 2); + inprint("Alias", num_indent + 1); + inprint(expr->alias, num_indent + 2); } } void printOrderBy(const std::vector* expr, uintmax_t num_indent) { if (!expr) return; for (const auto& order_description : *expr) { - printExpression(order_description->expr, num_indent); - if (order_description->type == kOrderAsc) { - inprint("ascending", num_indent); - } else { - inprint("descending", num_indent); - } + printExpression(order_description->expr, num_indent); + if (order_description->type == kOrderAsc) { + inprint("ascending", num_indent); + } else { + inprint("descending", num_indent); + } } } void printWindowDescription(WindowDescription* window_description, uintmax_t num_indent) { inprint("OVER", num_indent); if (window_description->partitionList) { - inprint("PARTITION BY", num_indent + 1); - for (const auto e : *window_description->partitionList) { - printExpression(e, num_indent + 2); - } + inprint("PARTITION BY", num_indent + 1); + for (const auto e : *window_description->partitionList) { + printExpression(e, num_indent + 2); + } } if (window_description->orderList) { - inprint("ORDER BY", num_indent + 1); - printOrderBy(window_description->orderList, num_indent + 2); + inprint("ORDER BY", num_indent + 1); + printOrderBy(window_description->orderList, num_indent + 2); } std::stringstream stream; switch (window_description->frameDescription->type) { - case kRows: - stream << "ROWS"; - break; - case kRange: - stream << "RANGE"; - break; - case kGroups: - stream << "GROUPS"; - break; + case kRows: + stream << "ROWS"; + break; + case kRange: + stream << "RANGE"; + break; + case kGroups: + stream << "GROUPS"; + break; } stream << " BETWEEN " << *window_description->frameDescription->start << " AND " - << *window_description->frameDescription->end; + << *window_description->frameDescription->end; inprint(stream.str().c_str(), num_indent + 1); } @@ -219,100 +219,100 @@ void printSelectStatementInfo(const SelectStatement* stmt, uintmax_t num_indent) for (Expr* expr : *stmt->selectList) printExpression(expr, num_indent + 2); if (stmt->fromTable) { - inprint("Sources:", num_indent + 1); - printTableRefInfo(stmt->fromTable, num_indent + 2); + inprint("Sources:", num_indent + 1); + printTableRefInfo(stmt->fromTable, num_indent + 2); } if (stmt->whereClause) { - inprint("Search Conditions:", num_indent + 1); - printExpression(stmt->whereClause, num_indent + 2); + inprint("Search Conditions:", num_indent + 1); + printExpression(stmt->whereClause, num_indent + 2); } if (stmt->groupBy) { - inprint("GroupBy:", num_indent + 1); - for (Expr* expr : *stmt->groupBy->columns) printExpression(expr, num_indent + 2); - if (stmt->groupBy->having) { - inprint("Having:", num_indent + 1); - printExpression(stmt->groupBy->having, num_indent + 2); - } + inprint("GroupBy:", num_indent + 1); + for (Expr* expr : *stmt->groupBy->columns) printExpression(expr, num_indent + 2); + if (stmt->groupBy->having) { + inprint("Having:", num_indent + 1); + printExpression(stmt->groupBy->having, num_indent + 2); + } } if (stmt->lockings) { - inprint("Lock Info:", num_indent + 1); - for (LockingClause* lockingClause : *stmt->lockings) { - inprint("Type", num_indent + 2); - if (lockingClause->rowLockMode == RowLockMode::ForUpdate) { - inprint("FOR UPDATE", num_indent + 3); - } else if (lockingClause->rowLockMode == RowLockMode::ForNoKeyUpdate) { - inprint("FOR NO KEY UPDATE", num_indent + 3); - } else if (lockingClause->rowLockMode == RowLockMode::ForShare) { - inprint("FOR SHARE", num_indent + 3); - } else if (lockingClause->rowLockMode == RowLockMode::ForKeyShare) { - inprint("FOR KEY SHARE", num_indent + 3); - } - if (lockingClause->tables) { - inprint("Target tables:", num_indent + 2); - for (char* dtable : *lockingClause->tables) { - inprint(dtable, num_indent + 3); - } - } - if (lockingClause->rowLockWaitPolicy != RowLockWaitPolicy::None) { - inprint("Waiting policy: ", num_indent + 2); - if (lockingClause->rowLockWaitPolicy == RowLockWaitPolicy::NoWait) - inprint("NOWAIT", num_indent + 3); - else - inprint("SKIP LOCKED", num_indent + 3); - } - } + inprint("Lock Info:", num_indent + 1); + for (LockingClause* lockingClause : *stmt->lockings) { + inprint("Type", num_indent + 2); + if (lockingClause->rowLockMode == RowLockMode::ForUpdate) { + inprint("FOR UPDATE", num_indent + 3); + } else if (lockingClause->rowLockMode == RowLockMode::ForNoKeyUpdate) { + inprint("FOR NO KEY UPDATE", num_indent + 3); + } else if (lockingClause->rowLockMode == RowLockMode::ForShare) { + inprint("FOR SHARE", num_indent + 3); + } else if (lockingClause->rowLockMode == RowLockMode::ForKeyShare) { + inprint("FOR KEY SHARE", num_indent + 3); + } + if (lockingClause->tables) { + inprint("Target tables:", num_indent + 2); + for (char* dtable : *lockingClause->tables) { + inprint(dtable, num_indent + 3); + } + } + if (lockingClause->rowLockWaitPolicy != RowLockWaitPolicy::None) { + inprint("Waiting policy: ", num_indent + 2); + if (lockingClause->rowLockWaitPolicy == RowLockWaitPolicy::NoWait) + inprint("NOWAIT", num_indent + 3); + else + inprint("SKIP LOCKED", num_indent + 3); + } + } } if (stmt->setOperations) { - for (SetOperation* setOperation : *stmt->setOperations) { - switch (setOperation->setType) { - case SetType::kSetIntersect: - inprint("Intersect:", num_indent + 1); - break; - case SetType::kSetUnion: - inprint("Union:", num_indent + 1); - break; - case SetType::kSetExcept: - inprint("Except:", num_indent + 1); - break; - } + for (SetOperation* setOperation : *stmt->setOperations) { + switch (setOperation->setType) { + case SetType::kSetIntersect: + inprint("Intersect:", num_indent + 1); + break; + case SetType::kSetUnion: + inprint("Union:", num_indent + 1); + break; + case SetType::kSetExcept: + inprint("Except:", num_indent + 1); + break; + } - printSelectStatementInfo(setOperation->nestedSelectStatement, num_indent + 2); + printSelectStatementInfo(setOperation->nestedSelectStatement, num_indent + 2); - if (setOperation->resultOrder) { - inprint("SetResultOrderBy:", num_indent + 1); - printOrderBy(setOperation->resultOrder, num_indent + 2); - } + if (setOperation->resultOrder) { + inprint("SetResultOrderBy:", num_indent + 1); + printOrderBy(setOperation->resultOrder, num_indent + 2); + } - if (setOperation->resultLimit) { - if (setOperation->resultLimit->limit) { - inprint("SetResultLimit:", num_indent + 1); - printExpression(setOperation->resultLimit->limit, num_indent + 2); - } + if (setOperation->resultLimit) { + if (setOperation->resultLimit->limit) { + inprint("SetResultLimit:", num_indent + 1); + printExpression(setOperation->resultLimit->limit, num_indent + 2); + } - if (setOperation->resultLimit->offset) { - inprint("SetResultOffset:", num_indent + 1); - printExpression(setOperation->resultLimit->offset, num_indent + 2); - } - } - } + if (setOperation->resultLimit->offset) { + inprint("SetResultOffset:", num_indent + 1); + printExpression(setOperation->resultLimit->offset, num_indent + 2); + } + } + } } if (stmt->order) { - inprint("OrderBy:", num_indent + 1); - printOrderBy(stmt->order, num_indent + 2); + inprint("OrderBy:", num_indent + 1); + printOrderBy(stmt->order, num_indent + 2); } if (stmt->limit && stmt->limit->limit) { - inprint("Limit:", num_indent + 1); - printExpression(stmt->limit->limit, num_indent + 2); + inprint("Limit:", num_indent + 1); + printExpression(stmt->limit->limit, num_indent + 2); } if (stmt->limit && stmt->limit->offset) { - inprint("Offset:", num_indent + 1); - printExpression(stmt->limit->offset, num_indent + 2); + inprint("Offset:", num_indent + 1); + printExpression(stmt->limit->offset, num_indent + 2); } } @@ -320,23 +320,23 @@ void printImportStatementInfo(const ImportStatement* stmt, uintmax_t num_indent) inprint("ImportStatement", num_indent); inprint(stmt->filePath, num_indent + 1); switch (stmt->type) { - case ImportType::kImportCSV: - inprint("CSV", num_indent + 1); - break; - case ImportType::kImportTbl: - inprint("TBL", num_indent + 1); - break; - case ImportType::kImportBinary: - inprint("BINARY", num_indent + 1); - break; - case ImportType::kImportAuto: - inprint("AUTO", num_indent + 1); - break; + case ImportType::kImportCSV: + inprint("CSV", num_indent + 1); + break; + case ImportType::kImportTbl: + inprint("TBL", num_indent + 1); + break; + case ImportType::kImportBinary: + inprint("BINARY", num_indent + 1); + break; + case ImportType::kImportAuto: + inprint("AUTO", num_indent + 1); + break; } inprint(stmt->tableName, num_indent + 1); if (stmt->whereClause) { - inprint("WHERE:", num_indent + 1); - printExpression(stmt->whereClause, num_indent + 2); + inprint("WHERE:", num_indent + 1); + printExpression(stmt->whereClause, num_indent + 2); } } @@ -344,24 +344,24 @@ void printExportStatementInfo(const ExportStatement* stmt, uintmax_t num_indent) inprint("ExportStatement", num_indent); inprint(stmt->filePath, num_indent + 1); switch (stmt->type) { - case ImportType::kImportCSV: - inprint("CSV", num_indent + 1); - break; - case ImportType::kImportTbl: - inprint("TBL", num_indent + 1); - break; - case ImportType::kImportBinary: - inprint("BINARY", num_indent + 1); - break; - case ImportType::kImportAuto: - inprint("AUTO", num_indent + 1); - break; + case ImportType::kImportCSV: + inprint("CSV", num_indent + 1); + break; + case ImportType::kImportTbl: + inprint("TBL", num_indent + 1); + break; + case ImportType::kImportBinary: + inprint("BINARY", num_indent + 1); + break; + case ImportType::kImportAuto: + inprint("AUTO", num_indent + 1); + break; } if (stmt->tableName) { - inprint(stmt->tableName, num_indent + 1); + inprint(stmt->tableName, num_indent + 1); } else { - printSelectStatementInfo(stmt->select, num_indent + 1); + printSelectStatementInfo(stmt->select, num_indent + 1); } } @@ -375,120 +375,120 @@ void printInsertStatementInfo(const InsertStatement* stmt, uintmax_t num_indent) inprint("InsertStatement", num_indent); inprint(stmt->tableName, num_indent + 1); if (stmt->columns) { - inprint("Columns", num_indent + 1); - for (char* col_name : *stmt->columns) { - inprint(col_name, num_indent + 2); - } + inprint("Columns", num_indent + 1); + for (char* col_name : *stmt->columns) { + inprint(col_name, num_indent + 2); + } } switch (stmt->type) { - case kInsertValues: - inprint("Values", num_indent + 1); - for (Expr* expr : *stmt->values) { - printExpression(expr, num_indent + 2); - } - break; - case kInsertSelect: - printSelectStatementInfo(stmt->select, num_indent + 1); - break; + case kInsertValues: + inprint("Values", num_indent + 1); + for (Expr* expr : *stmt->values) { + printExpression(expr, num_indent + 2); + } + break; + case kInsertSelect: + printSelectStatementInfo(stmt->select, num_indent + 1); + break; } } void printTransactionStatementInfo(const TransactionStatement* stmt, uintmax_t num_indent) { inprint("TransactionStatement", num_indent); switch (stmt->command) { - case kBeginTransaction: - inprint("BEGIN", num_indent + 1); - break; - case kCommitTransaction: - inprint("COMMIT", num_indent + 1); - break; - case kRollbackTransaction: - inprint("ROLLBACK", num_indent + 1); - break; + case kBeginTransaction: + inprint("BEGIN", num_indent + 1); + break; + case kCommitTransaction: + inprint("COMMIT", num_indent + 1); + break; + case kRollbackTransaction: + inprint("ROLLBACK", num_indent + 1); + break; } } void printStatementInfo(const SQLStatement* stmt) { switch (stmt->type()) { - case kStmtSelect: - printSelectStatementInfo((const SelectStatement*)stmt, 0); - break; - case kStmtInsert: - printInsertStatementInfo((const InsertStatement*)stmt, 0); - break; - case kStmtCreate: - printCreateStatementInfo((const CreateStatement*)stmt, 0); - break; - case kStmtImport: - printImportStatementInfo((const ImportStatement*)stmt, 0); - break; - case kStmtExport: - printExportStatementInfo((const ExportStatement*)stmt, 0); - break; - case kStmtTransaction: - printTransactionStatementInfo((const TransactionStatement*)stmt, 0); - break; - default: - break; + case kStmtSelect: + printSelectStatementInfo((const SelectStatement*)stmt, 0); + break; + case kStmtInsert: + printInsertStatementInfo((const InsertStatement*)stmt, 0); + break; + case kStmtCreate: + printCreateStatementInfo((const CreateStatement*)stmt, 0); + break; + case kStmtImport: + printImportStatementInfo((const ImportStatement*)stmt, 0); + break; + case kStmtExport: + printExportStatementInfo((const ExportStatement*)stmt, 0); + break; + case kStmtTransaction: + printTransactionStatementInfo((const TransactionStatement*)stmt, 0); + break; + default: + break; } } std::ostream& operator<<(std::ostream& os, const OperatorType& op) { static const std::map operatorToToken = { - {kOpNone, "None"}, {kOpBetween, "BETWEEN"}, - {kOpCase, "CASE"}, {kOpCaseListElement, "CASE LIST ELEMENT"}, - {kOpPlus, "+"}, {kOpMinus, "-"}, - {kOpAsterisk, "*"}, {kOpSlash, "/"}, - {kOpPercentage, "%"}, {kOpCaret, "^"}, - {kOpEquals, "="}, {kOpNotEquals, "!="}, - {kOpLess, "<"}, {kOpLessEq, "<="}, - {kOpGreater, ">"}, {kOpGreaterEq, ">="}, - {kOpLike, "LIKE"}, {kOpNotLike, "NOT LIKE"}, - {kOpILike, "ILIKE"}, {kOpAnd, "AND"}, - {kOpOr, "OR"}, {kOpIn, "IN"}, - {kOpConcat, "CONCAT"}, {kOpNot, "NOT"}, - {kOpUnaryMinus, "-"}, {kOpIsNull, "IS NULL"}, - {kOpExists, "EXISTS"}}; + {kOpNone, "None"}, {kOpBetween, "BETWEEN"}, + {kOpCase, "CASE"}, {kOpCaseListElement, "CASE LIST ELEMENT"}, + {kOpPlus, "+"}, {kOpMinus, "-"}, + {kOpAsterisk, "*"}, {kOpSlash, "/"}, + {kOpPercentage, "%"}, {kOpCaret, "^"}, + {kOpEquals, "="}, {kOpNotEquals, "!="}, + {kOpLess, "<"}, {kOpLessEq, "<="}, + {kOpGreater, ">"}, {kOpGreaterEq, ">="}, + {kOpLike, "LIKE"}, {kOpNotLike, "NOT LIKE"}, + {kOpILike, "ILIKE"}, {kOpAnd, "AND"}, + {kOpOr, "OR"}, {kOpIn, "IN"}, + {kOpConcat, "CONCAT"}, {kOpNot, "NOT"}, + {kOpUnaryMinus, "-"}, {kOpIsNull, "IS NULL"}, + {kOpExists, "EXISTS"}}; const auto found = operatorToToken.find(op); if (found == operatorToToken.cend()) { - return os << static_cast(op); + return os << static_cast(op); } else { - return os << (*found).second; + return os << (*found).second; } } std::ostream& operator<<(std::ostream& os, const DatetimeField& datetime) { static const std::map operatorToToken = { - {kDatetimeNone, "None"}, {kDatetimeSecond, "SECOND"}, {kDatetimeMinute, "MINUTE"}, {kDatetimeHour, "HOUR"}, - {kDatetimeDay, "DAY"}, {kDatetimeMonth, "MONTH"}, {kDatetimeYear, "YEAR"}}; + {kDatetimeNone, "None"}, {kDatetimeSecond, "SECOND"}, {kDatetimeMinute, "MINUTE"}, {kDatetimeHour, "HOUR"}, + {kDatetimeDay, "DAY"}, {kDatetimeMonth, "MONTH"}, {kDatetimeYear, "YEAR"}}; const auto found = operatorToToken.find(datetime); if (found == operatorToToken.cend()) { - return os << static_cast(datetime); + return os << static_cast(datetime); } else { - return os << (*found).second; + return os << (*found).second; } } std::ostream& operator<<(std::ostream& os, const FrameBound& frame_bound) { if (frame_bound.type == kCurrentRow) { - os << "CURRENT ROW"; - return os; + os << "CURRENT ROW"; + return os; } if (frame_bound.unbounded) { - os << "UNBOUNDED"; + os << "UNBOUNDED"; } else { - os << frame_bound.offset; + os << frame_bound.offset; } os << " "; if (frame_bound.type == kPreceding) { - os << "PRECEDING"; + os << "PRECEDING"; } else { - os << "FOLLOWING"; + os << "FOLLOWING"; } return os; diff --git a/Data/SQLParser/test/auto_query_file_test.cpp b/Data/SQLParser/test/auto_query_file_test.cpp index 627b0399f..55f4856e0 100644 --- a/Data/SQLParser/test/auto_query_file_test.cpp +++ b/Data/SQLParser/test/auto_query_file_test.cpp @@ -22,59 +22,59 @@ TEST(AutoQueryFileTest) { // Parse command line arguments to retrieve query files. uint i = 1; for (; i < args.size(); ++i) { - if (args[i] == "-f") { - query_files.push_back(args[++i]); - } + if (args[i] == "-f") { + query_files.push_back(args[++i]); + } } // Read list of queries from all input files. std::vector lines; for (std::string path : query_files) { - std::vector tmp = readlines(path); - lines.insert(lines.end(), tmp.begin(), tmp.end()); + std::vector tmp = readlines(path); + lines.insert(lines.end(), tmp.begin(), tmp.end()); } // Execute queries. size_t num_executed = 0; size_t num_failed = 0; for (std::string line : lines) { - bool expected_result = true; - std::string query = line; + bool expected_result = true; + std::string query = line; - // If a line starts with '!' parsing is expected to fail. - if (query.at(0) == '!') { - expected_result = false; - query = query.substr(1); - } + // If a line starts with '!' parsing is expected to fail. + if (query.at(0) == '!') { + expected_result = false; + query = query.substr(1); + } - // Measuring the parsing time. - std::chrono::time_point start, end; - start = std::chrono::system_clock::now(); + // Measuring the parsing time. + std::chrono::time_point start, end; + start = std::chrono::system_clock::now(); - // Parse the query. - hsql::SQLParserResult result; - hsql::SQLParser::parse(query, &result); + // Parse the query. + hsql::SQLParserResult result; + hsql::SQLParser::parse(query, &result); - end = std::chrono::system_clock::now(); - std::chrono::duration elapsed_seconds = end - start; - double us = elapsed_seconds.count() * 1000 * 1000; + end = std::chrono::system_clock::now(); + std::chrono::duration elapsed_seconds = end - start; + double us = elapsed_seconds.count() * 1000 * 1000; - if (expected_result == result.isValid()) { - printf("\033[0;32m{ ok} (%.1fus)\033[0m %s\n", us, line.c_str()); - } else { - printf("\033[0;31m{ failed}\033[0m\n"); - printf("\t\033[0;31m%s (L%d:%d)\n\033[0m", result.errorMsg(), result.errorLine(), result.errorColumn()); - printf("\t%s\n", line.c_str()); - ++num_failed; - } - ++num_executed; + if (expected_result == result.isValid()) { + printf("\033[0;32m{ ok} (%.1fus)\033[0m %s\n", us, line.c_str()); + } else { + printf("\033[0;31m{ failed}\033[0m\n"); + printf("\t\033[0;31m%s (L%d:%d)\n\033[0m", result.errorMsg(), result.errorLine(), result.errorColumn()); + printf("\t%s\n", line.c_str()); + ++num_failed; + } + ++num_executed; } if (num_failed == 0) { - printf("\033[0;32m{ ok} \033[0mAll %lu grammar tests completed successfully!\n", num_executed); + printf("\033[0;32m{ ok} \033[0mAll %lu grammar tests completed successfully!\n", num_executed); } else { - fprintf(stderr, "\033[0;31m{ failed} \033[0mSome grammar tests failed! %lu out of %lu tests failed!\n", num_failed, - num_executed); + fprintf(stderr, "\033[0;31m{ failed} \033[0mSome grammar tests failed! %lu out of %lu tests failed!\n", num_failed, + num_executed); } ASSERT_EQ(num_failed, 0); } @@ -84,14 +84,14 @@ std::vector readlines(std::string path) { std::vector lines; std::string line; while (std::getline(infile, line)) { - std::istringstream iss(line); + std::istringstream iss(line); - // Skip comments. - if (line[0] == '#' || (line[0] == '-' && line[1] == '-')) { - continue; - } + // Skip comments. + if (line[0] == '#' || (line[0] == '-' && line[1] == '-')) { + continue; + } - lines.push_back(line); + lines.push_back(line); } return lines; } diff --git a/Data/SQLParser/test/prepare_tests.cpp b/Data/SQLParser/test/prepare_tests.cpp index f653106a3..011d89fe1 100644 --- a/Data/SQLParser/test/prepare_tests.cpp +++ b/Data/SQLParser/test/prepare_tests.cpp @@ -22,7 +22,7 @@ using hsql::SelectStatement; TEST(PrepareSingleStatementTest) { TEST_PARSE_SINGLE_SQL("PREPARE test FROM 'SELECT * FROM students WHERE grade = ?';", kStmtPrepare, PrepareStatement, - result, prepare); + result, prepare); ASSERT_STREQ(prepare->name, "test"); ASSERT_STREQ(prepare->query, "SELECT * FROM students WHERE grade = ?"); diff --git a/Data/SQLParser/test/select_tests.cpp b/Data/SQLParser/test/select_tests.cpp index 40ad4e515..f20c081e4 100644 --- a/Data/SQLParser/test/select_tests.cpp +++ b/Data/SQLParser/test/select_tests.cpp @@ -16,7 +16,7 @@ TEST(SelectTest) { TEST(SelectExprTest) { TEST_PARSE_SINGLE_SQL("SELECT a, MAX(b), CUSTOM(c, F(un)) FROM students;", kStmtSelect, SelectStatement, result, - stmt); + stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NULL(stmt->groupBy); @@ -49,8 +49,8 @@ TEST(SelectExprTest) { TEST(SelectUnaryMinusTest) { TEST_PARSE_SINGLE_SQL( - "SELECT 10 - 20, 10 + -20, 10 +-20, 10+-20, 9223372036854775807, -9223372036854775808, 10-5.2, 10+-5.2", - kStmtSelect, SelectStatement, result, stmt); + "SELECT 10 - 20, 10 + -20, 10 +-20, 10+-20, 9223372036854775807, -9223372036854775808, 10-5.2, 10+-5.2", + kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->selectList->size(), 8); @@ -133,7 +133,7 @@ TEST(SelectSubstrTest) { TEST(SelectHavingTest) { TEST_PARSE_SINGLE_SQL("SELECT city, AVG(grade) AS avg_grade FROM students GROUP BY city HAVING AVG(grade) < -2.0", - kStmtSelect, SelectStatement, result, stmt); + kStmtSelect, SelectStatement, result, stmt); ASSERT_FALSE(stmt->selectDistinct); @@ -163,7 +163,7 @@ TEST(SelectSchemaTest) { TEST(SelectGroupDistinctTest) { TEST_PARSE_SINGLE_SQL("SELECT city, COUNT(name), COUNT(DISTINCT grade) FROM students GROUP BY city;", kStmtSelect, - SelectStatement, result, stmt); + SelectStatement, result, stmt); ASSERT_FALSE(stmt->selectDistinct); ASSERT_EQ(stmt->selectList->size(), 3); @@ -173,7 +173,7 @@ TEST(SelectGroupDistinctTest) { TEST(OrderByTest) { TEST_PARSE_SINGLE_SQL("SELECT grade, city FROM students ORDER BY grade, city DESC;", kStmtSelect, SelectStatement, - result, stmt); + result, stmt); ASSERT_NULL(stmt->whereClause); ASSERT_NOTNULL(stmt->order); @@ -188,7 +188,7 @@ TEST(OrderByTest) { TEST(SelectBetweenTest) { TEST_PARSE_SINGLE_SQL("SELECT grade, city FROM students WHERE grade BETWEEN 1 and c;", kStmtSelect, SelectStatement, - result, stmt); + result, stmt); Expr* where = stmt->whereClause; ASSERT_NOTNULL(where); @@ -207,8 +207,8 @@ TEST(SelectBetweenTest) { TEST(SelectConditionalSelectTest) { TEST_PARSE_SINGLE_SQL( - "SELECT * FROM t WHERE a = (SELECT MIN(v) FROM tt) AND EXISTS (SELECT * FROM test WHERE x < a);", kStmtSelect, - SelectStatement, result, stmt); + "SELECT * FROM t WHERE a = (SELECT MIN(v) FROM tt) AND EXISTS (SELECT * FROM test WHERE x < a);", kStmtSelect, + SelectStatement, result, stmt); Expr* where = stmt->whereClause; ASSERT_NOTNULL(where); @@ -241,7 +241,7 @@ TEST(SelectConditionalSelectTest) { TEST(SelectCaseWhen) { TEST_PARSE_SINGLE_SQL("SELECT MAX(CASE WHEN a = 'foo' THEN x ELSE 0 END) FROM test;", kStmtSelect, SelectStatement, - result, stmt); + result, stmt); ASSERT_EQ(stmt->selectList->size(), 1); Expr* func = stmt->selectList->at(0); @@ -269,7 +269,7 @@ TEST(SelectCaseWhen) { TEST(SelectCaseWhenWhen) { TEST_PARSE_SINGLE_SQL("SELECT CASE WHEN x = 1 THEN 1 WHEN 1.25 < x THEN 2 END FROM test;", kStmtSelect, - SelectStatement, result, stmt); + SelectStatement, result, stmt); ASSERT_EQ(stmt->selectList->size(), 1); Expr* caseExpr = stmt->selectList->at(0); @@ -298,7 +298,7 @@ TEST(SelectCaseWhenWhen) { TEST(SelectCaseValueWhenWhenElse) { TEST_PARSE_SINGLE_SQL("SELECT CASE x WHEN 1 THEN 0 WHEN 2 THEN 3 WHEN 8 THEN 7 ELSE 4 END FROM test;", kStmtSelect, - SelectStatement, result, stmt); + SelectStatement, result, stmt); ASSERT_EQ(stmt->selectList->size(), 1); Expr* caseExpr = stmt->selectList->at(0); @@ -318,11 +318,11 @@ TEST(SelectCaseValueWhenWhenElse) { TEST(SelectJoin) { TEST_PARSE_SINGLE_SQL( - "SELECT City.name, Product.category, SUM(price) FROM fact\ - INNER JOIN City ON fact.city_id = City.id\ - OUTER JOIN Product ON fact.product_id = Product.id\ - GROUP BY City.name, Product.category;", - kStmtSelect, SelectStatement, result, stmt); + "SELECT City.name, Product.category, SUM(price) FROM fact\ + INNER JOIN City ON fact.city_id = City.id\ + OUTER JOIN Product ON fact.product_id = Product.id\ + GROUP BY City.name, Product.category;", + kStmtSelect, SelectStatement, result, stmt); const TableRef* table = stmt->fromTable; const JoinDefinition* outer_join = table->join; @@ -357,12 +357,12 @@ TEST(SelectJoin) { TEST(SelectColumnOrder) { TEST_PARSE_SINGLE_SQL( - "SELECT *\ - FROM a,\ - (SELECT a AS b FROM a) b,\ - (SELECT a AS c FROM a) c,\ - (SELECT a AS d FROM a) d;", - kStmtSelect, SelectStatement, result, stmt); + "SELECT *\ + FROM a,\ + (SELECT a AS b FROM a) b,\ + (SELECT a AS c FROM a) c,\ + (SELECT a AS d FROM a) d;", + kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->fromTable->list->size(), 4); @@ -419,17 +419,17 @@ TEST(Operators) { SQLParserResult result; SQLParser::parse( - "SELECT * FROM foo where a = 1; \ - SELECT * FROM foo where a == 2; \ - SELECT * FROM foo where a != 1; \ - SELECT * FROM foo where a <> 1; \ - SELECT * FROM foo where a > 1; \ - SELECT * FROM foo where a < 1; \ - SELECT * FROM foo where a >= 1; \ - SELECT * FROM foo where a <= 1; \ - SELECT * FROM foo where a = TRUE; \ - SELECT * FROM foo where a = false;", - &result); + "SELECT * FROM foo where a = 1; \ + SELECT * FROM foo where a == 2; \ + SELECT * FROM foo where a != 1; \ + SELECT * FROM foo where a <> 1; \ + SELECT * FROM foo where a > 1; \ + SELECT * FROM foo where a < 1; \ + SELECT * FROM foo where a >= 1; \ + SELECT * FROM foo where a <= 1; \ + SELECT * FROM foo where a = TRUE; \ + SELECT * FROM foo where a = false;", + &result); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->whereClause->opType, kOpEquals); @@ -474,19 +474,19 @@ TEST(JoinTypes) { SQLParserResult result; SQLParser::parse( - "SELECT * FROM x join y on a=b; \ - SELECT * FROM x inner join y on a=b; \ - SELECT * FROM x left join y on a=b; \ - SELECT * FROM x left outer join y on a=b; \ - SELECT * FROM x right join y on a=b; \ - SELECT * FROM x right outer join y on a=b; \ - SELECT * FROM x full join y on a=b; \ - SELECT * FROM x outer join y on a=b; \ - SELECT * FROM x full outer join y on a=b; \ - SELECT * FROM x natural join y; \ - SELECT * FROM x cross join y on a=b; \ - SELECT * FROM x, y where a = b;", - &result); + "SELECT * FROM x join y on a=b; \ + SELECT * FROM x inner join y on a=b; \ + SELECT * FROM x left join y on a=b; \ + SELECT * FROM x left outer join y on a=b; \ + SELECT * FROM x right join y on a=b; \ + SELECT * FROM x right outer join y on a=b; \ + SELECT * FROM x full join y on a=b; \ + SELECT * FROM x outer join y on a=b; \ + SELECT * FROM x full outer join y on a=b; \ + SELECT * FROM x natural join y; \ + SELECT * FROM x cross join y on a=b; \ + SELECT * FROM x, y where a = b;", + &result); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->fromTable->join->type, kJoinInner); @@ -529,21 +529,21 @@ TEST(SetLimitOffset) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "select a from t1 limit 1; \ - select a from t1 limit 1 + 2; \ - select a from t1 offset 1; \ - select a from t1 offset 1 + 2; \ - select a from t1 limit 1 offset 1; \ - select a from t1 limit 1 + 2 offset 1 + 2; \ - select a from t1 limit 1 offset NULL; \ - select a from t1 limit ALL; \ - select a from t1 limit NULL; \ - select a from t1 limit ALL offset 1; \ - select a from t1 limit NULL offset 1; \ - select top 10 a from t1; \ - select top 20 a from t1 limit 10; \ - select a from t1 limit (SELECT MAX(b) FROM t1) offset (SELECT MIN(b) FROM t1);", - result, 14); + "select a from t1 limit 1; \ + select a from t1 limit 1 + 2; \ + select a from t1 offset 1; \ + select a from t1 offset 1 + 2; \ + select a from t1 limit 1 offset 1; \ + select a from t1 limit 1 + 2 offset 1 + 2; \ + select a from t1 limit 1 offset NULL; \ + select a from t1 limit ALL; \ + select a from t1 limit NULL; \ + select a from t1 limit ALL offset 1; \ + select a from t1 limit NULL offset 1; \ + select top 10 a from t1; \ + select top 20 a from t1 limit 10; \ + select a from t1 limit (SELECT MAX(b) FROM t1) offset (SELECT MIN(b) FROM t1);", + result, 14); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->limit->limit->type, kExprLiteralInt); @@ -627,10 +627,10 @@ TEST(Extract) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "select extract(year from dc) FROM t;" - "select x, extract(month from dc) AS t FROM t;" - "select x FROM t WHERE extract(minute from dc) > 2011;", - result, 3); + "select extract(year from dc) FROM t;" + "select x, extract(month from dc) AS t FROM t;" + "select x FROM t WHERE extract(minute from dc) > 2011;", + result, 3); stmt = (SelectStatement*)result.getStatement(0); ASSERT_TRUE(stmt->selectList); @@ -687,10 +687,10 @@ TEST(NoFromClause) { TEST(WithClauseSingle) { TEST_PARSE_SINGLE_SQL( - "WITH " - "a AS (SELECT name FROM peopleA)" - "SELECT name FROM a;", - kStmtSelect, SelectStatement, result, stmt) + "WITH " + "a AS (SELECT name FROM peopleA)" + "SELECT name FROM a;", + kStmtSelect, SelectStatement, result, stmt) // with_description_list – count ASSERT_EQ(stmt->withDescriptions->size(), 1); @@ -711,11 +711,11 @@ TEST(WithClauseSingle) { TEST(WithClauseDouble) { TEST_PARSE_SINGLE_SQL( - "WITH " - "a AS (SELECT nameA FROM peopleA), " - "b AS (SELECT nameB, cityB FROM peopleB) " - "SELECT nameA FROM a;", - kStmtSelect, SelectStatement, result, stmt) + "WITH " + "a AS (SELECT nameA FROM peopleA), " + "b AS (SELECT nameB, cityB FROM peopleB) " + "SELECT nameA FROM a;", + kStmtSelect, SelectStatement, result, stmt) // with_description_list – count ASSERT_EQ(stmt->withDescriptions->size(), 2); @@ -757,9 +757,9 @@ TEST(IntervalLiteral) { SelectStatement* stmt; Expr* interval_literal; TEST_PARSE_SQL_QUERY( - "SELECT a + 1 year FROM t;" - "SELECT * FROM t where a = cast ('2000-01-01' AS DATE) - 30 days;", - result, 2); + "SELECT a + 1 year FROM t;" + "SELECT * FROM t where a = cast ('2000-01-01' AS DATE) - 30 days;", + result, 2); stmt = (SelectStatement*)result.getStatement(0); ASSERT_TRUE(stmt->selectList); @@ -786,44 +786,44 @@ TEST(IntervalLiteral) { ASSERT_EQ(interval_literal->type, kExprLiteralInterval); const auto interval_units = std::map{ - {kDatetimeSecond, "second"}, {kDatetimeMinute, "minute"}, {kDatetimeHour, "hour"}, - {kDatetimeDay, "day"}, {kDatetimeMonth, "month"}, {kDatetimeYear, "year"}}; + {kDatetimeSecond, "second"}, {kDatetimeMinute, "minute"}, {kDatetimeHour, "hour"}, + {kDatetimeDay, "day"}, {kDatetimeMonth, "month"}, {kDatetimeYear, "year"}}; for (const auto& it : interval_units) { - const auto& unit_string = it.second; - const auto unit_string_plural = unit_string + "s"; - TEST_PARSE_SQL_QUERY("SELECT * FROM t WHERE a = 1 + 5 " + unit_string + - ";" - "SELECT * FROM t WHERE a = 1 + 5 " + - unit_string_plural + - ";" - "SELECT * FROM t WHERE a = 1 + INTERVAL '5'" + - unit_string + - ";" - "SELECT * FROM t WHERE a = 1 + INTERVAL '5 " + - unit_string + - "';" - "SELECT * FROM t WHERE a = 1 + INTERVAL '5 " + - unit_string_plural + "';", - result, 5); + const auto& unit_string = it.second; + const auto unit_string_plural = unit_string + "s"; + TEST_PARSE_SQL_QUERY("SELECT * FROM t WHERE a = 1 + 5 " + unit_string + + ";" + "SELECT * FROM t WHERE a = 1 + 5 " + + unit_string_plural + + ";" + "SELECT * FROM t WHERE a = 1 + INTERVAL '5'" + + unit_string + + ";" + "SELECT * FROM t WHERE a = 1 + INTERVAL '5 " + + unit_string + + "';" + "SELECT * FROM t WHERE a = 1 + INTERVAL '5 " + + unit_string_plural + "';", + result, 5); - for (const auto& statement : result.getStatements()) { - stmt = (SelectStatement*)statement; - interval_literal = stmt->whereClause->expr2->expr2; - ASSERT_EQ(interval_literal->datetimeField, it.first); - ASSERT_EQ(interval_literal->ival, 5); - ASSERT_EQ(interval_literal->type, kExprLiteralInterval); - } + for (const auto& statement : result.getStatements()) { + stmt = (SelectStatement*)statement; + interval_literal = stmt->whereClause->expr2->expr2; + ASSERT_EQ(interval_literal->datetimeField, it.first); + ASSERT_EQ(interval_literal->ival, 5); + ASSERT_EQ(interval_literal->type, kExprLiteralInterval); + } } } TEST(LockingClauseWithoutWaitPolicy) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "SELECT * FROM t WHERE a = 10 FOR UPDATE;" - "SELECT * FROM t WHERE a = 10 FOR SHARE;" - "SELECT * FROM t WHERE a = 10 FOR NO KEY UPDATE FOR KEY SHARE;", - result, 3); + "SELECT * FROM t WHERE a = 10 FOR UPDATE;" + "SELECT * FROM t WHERE a = 10 FOR SHARE;" + "SELECT * FROM t WHERE a = 10 FOR NO KEY UPDATE FOR KEY SHARE;", + result, 3); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->lockings->size(), 1); @@ -850,15 +850,15 @@ TEST(LockingClauseWithoutWaitPolicy) { TEST(LockingClauseWithWaitPolicy) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "SELECT * FROM t WHERE a = 10 FOR UPDATE NOWAIT;" - "SELECT * FROM t WHERE a = 10 FOR SHARE NOWAIT;" - "SELECT * FROM t WHERE a = 10 FOR NO KEY UPDATE NOWAIT;" - "SELECT * FROM t WHERE a = 10 FOR KEY SHARE NOWAIT;" - "SELECT * FROM t WHERE a = 10 FOR UPDATE SKIP LOCKED;" - "SELECT * FROM t WHERE a = 10 FOR SHARE SKIP LOCKED;" - "SELECT * FROM t WHERE a = 10 FOR NO KEY UPDATE SKIP LOCKED;" - "SELECT * FROM t WHERE a = 10 FOR KEY SHARE SKIP LOCKED;", - result, 8); + "SELECT * FROM t WHERE a = 10 FOR UPDATE NOWAIT;" + "SELECT * FROM t WHERE a = 10 FOR SHARE NOWAIT;" + "SELECT * FROM t WHERE a = 10 FOR NO KEY UPDATE NOWAIT;" + "SELECT * FROM t WHERE a = 10 FOR KEY SHARE NOWAIT;" + "SELECT * FROM t WHERE a = 10 FOR UPDATE SKIP LOCKED;" + "SELECT * FROM t WHERE a = 10 FOR SHARE SKIP LOCKED;" + "SELECT * FROM t WHERE a = 10 FOR NO KEY UPDATE SKIP LOCKED;" + "SELECT * FROM t WHERE a = 10 FOR KEY SHARE SKIP LOCKED;", + result, 8); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->lockings->size(), 1); @@ -912,10 +912,10 @@ TEST(LockingClauseWithWaitPolicy) { TEST(LockingClauseWithTableReference) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "SELECT * FROM t WHERE a = 10 FOR UPDATE OF t;" - "SELECT * FROM t, c WHERE t.a = 10 FOR SHARE OF t,c;" - "SELECT * FROM t, c WHERE t.a = 10 FOR NO KEY UPDATE OF t,c NOWAIT;", - result, 3); + "SELECT * FROM t WHERE a = 10 FOR UPDATE OF t;" + "SELECT * FROM t, c WHERE t.a = 10 FOR SHARE OF t,c;" + "SELECT * FROM t, c WHERE t.a = 10 FOR NO KEY UPDATE OF t,c NOWAIT;", + result, 3); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->lockings->size(), 1); @@ -944,10 +944,10 @@ TEST(LockingClauseWithTableReference) { TEST(MultipleLockingClause) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "SELECT * FROM t, c WHERE t.a = 10 FOR NO KEY UPDATE OF t FOR KEY SHARE OF c;" - "SELECT * FROM t, c WHERE t.a = 10 FOR SHARE OF t SKIP LOCKED FOR UPDATE OF c NOWAIT;" - "SELECT * FROM t, c, s WHERE t.a = 10 FOR NO KEY UPDATE FOR SHARE OF t SKIP LOCKED FOR UPDATE OF c, s NOWAIT;", - result, 3); + "SELECT * FROM t, c WHERE t.a = 10 FOR NO KEY UPDATE OF t FOR KEY SHARE OF c;" + "SELECT * FROM t, c WHERE t.a = 10 FOR SHARE OF t SKIP LOCKED FOR UPDATE OF c NOWAIT;" + "SELECT * FROM t, c, s WHERE t.a = 10 FOR NO KEY UPDATE FOR SHARE OF t SKIP LOCKED FOR UPDATE OF c, s NOWAIT;", + result, 3); stmt = (SelectStatement*)result.getStatement(0); ASSERT_EQ(stmt->lockings->size(), 2); @@ -992,13 +992,13 @@ TEST(MultipleLockingClause) { TEST(WindowFunctions) { SelectStatement* stmt; TEST_PARSE_SQL_QUERY( - "SELECT t2, 1 / avg(t1) OVER(), rank() OVER(ORDER BY t1 DESC) rnk FROM t;" - "SELECT avg(t1) OVER(PARTITION BY t2, t3 ORDER BY t4, t5 ROWS UNBOUNDED PRECEDING) FROM t;" - "SELECT rank() OVER(PARTITION BY t1 ORDER BY t2 ROWS BETWEEN 25 PRECEDING AND 2 FOLLOWING) FROM t;" - "SELECT rank() OVER(PARTITION BY t1 ORDER BY t2 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM " - "t;" - "SELECT rank() OVER(PARTITION BY t1 ORDER BY t2 GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t;", - result, 5); + "SELECT t2, 1 / avg(t1) OVER(), rank() OVER(ORDER BY t1 DESC) rnk FROM t;" + "SELECT avg(t1) OVER(PARTITION BY t2, t3 ORDER BY t4, t5 ROWS UNBOUNDED PRECEDING) FROM t;" + "SELECT rank() OVER(PARTITION BY t1 ORDER BY t2 ROWS BETWEEN 25 PRECEDING AND 2 FOLLOWING) FROM t;" + "SELECT rank() OVER(PARTITION BY t1 ORDER BY t2 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM " + "t;" + "SELECT rank() OVER(PARTITION BY t1 ORDER BY t2 GROUPS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t;", + result, 5); stmt = (SelectStatement*)result.getStatement(0); ASSERT_TRUE(stmt->selectList); @@ -1094,45 +1094,45 @@ TEST(WindowFunctions) { ASSERT_FALSE(stmt->selectList->at(0)->windowDescription->frameDescription->end->unbounded); const auto frame_starts = - std::vector{{25, kPreceding, false}, {0, kPreceding, true}, {0, kPreceding, true}}; + std::vector{{25, kPreceding, false}, {0, kPreceding, true}, {0, kPreceding, true}}; const auto frame_ends = - std::vector{{2, kFollowing, false}, {0, kFollowing, true}, {0, kCurrentRow, false}}; + std::vector{{2, kFollowing, false}, {0, kFollowing, true}, {0, kCurrentRow, false}}; for (auto bound_index = size_t{0}; bound_index < frame_starts.size(); ++bound_index) { - stmt = (SelectStatement*)result.getStatement(2 + bound_index); - const auto& expected_start = frame_starts[bound_index]; - const auto& expected_end = frame_ends[bound_index]; + stmt = (SelectStatement*)result.getStatement(2 + bound_index); + const auto& expected_start = frame_starts[bound_index]; + const auto& expected_end = frame_ends[bound_index]; - ASSERT_TRUE(stmt->selectList); - ASSERT_EQ(stmt->selectList->size(), 1); - ASSERT_TRUE(stmt->fromTable); - ASSERT_EQ(stmt->fromTable->type, kTableName); - ASSERT_STREQ(stmt->fromTable->name, "t"); + ASSERT_TRUE(stmt->selectList); + ASSERT_EQ(stmt->selectList->size(), 1); + ASSERT_TRUE(stmt->fromTable); + ASSERT_EQ(stmt->fromTable->type, kTableName); + ASSERT_STREQ(stmt->fromTable->name, "t"); - ASSERT_EQ(stmt->selectList->at(0)->type, kExprFunctionRef); - ASSERT_STREQ(stmt->selectList->at(0)->name, "rank"); - ASSERT_TRUE(stmt->selectList->at(0)->exprList->empty()); + ASSERT_EQ(stmt->selectList->at(0)->type, kExprFunctionRef); + ASSERT_STREQ(stmt->selectList->at(0)->name, "rank"); + ASSERT_TRUE(stmt->selectList->at(0)->exprList->empty()); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->partitionList); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->partitionList->size(), 1); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->partitionList->at(0)->type, kExprColumnRef); - ASSERT_STREQ(stmt->selectList->at(0)->windowDescription->partitionList->at(0)->name, "t1"); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->partitionList); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->partitionList->size(), 1); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->partitionList->at(0)->type, kExprColumnRef); + ASSERT_STREQ(stmt->selectList->at(0)->windowDescription->partitionList->at(0)->name, "t1"); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->orderList); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->orderList->size(), 1); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->orderList->at(0)->type, kOrderAsc); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->orderList->at(0)->expr); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->orderList->at(0)->expr->type, kExprColumnRef); - ASSERT_STREQ(stmt->selectList->at(0)->windowDescription->orderList->at(0)->expr->name, "t2"); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->frameDescription); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->frameDescription->start); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->start->offset, expected_start.offset); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->start->type, expected_start.type); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->start->unbounded, expected_start.unbounded); - ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->frameDescription->end); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->end->offset, expected_end.offset); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->end->type, expected_end.type); - ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->end->unbounded, expected_end.unbounded); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->orderList); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->orderList->size(), 1); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->orderList->at(0)->type, kOrderAsc); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->orderList->at(0)->expr); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->orderList->at(0)->expr->type, kExprColumnRef); + ASSERT_STREQ(stmt->selectList->at(0)->windowDescription->orderList->at(0)->expr->name, "t2"); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->frameDescription); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->frameDescription->start); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->start->offset, expected_start.offset); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->start->type, expected_start.type); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->start->unbounded, expected_start.unbounded); + ASSERT_TRUE(stmt->selectList->at(0)->windowDescription->frameDescription->end); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->end->offset, expected_end.offset); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->end->type, expected_end.type); + ASSERT_EQ(stmt->selectList->at(0)->windowDescription->frameDescription->end->unbounded, expected_end.unbounded); } } diff --git a/Data/SQLParser/test/sql_parser.cpp b/Data/SQLParser/test/sql_parser.cpp index 31b9be1f9..25435e9f3 100644 --- a/Data/SQLParser/test/sql_parser.cpp +++ b/Data/SQLParser/test/sql_parser.cpp @@ -17,14 +17,14 @@ void test_tokens(const std::string& query, const std::vector& expected_ ASSERT_EQ(expected_tokens.size(), tokens.size()); for (unsigned i = 0; i < expected_tokens.size(); ++i) { - ASSERT_EQ(expected_tokens[i], tokens[i]); + ASSERT_EQ(expected_tokens[i], tokens[i]); } } TEST(SQLParserTokenizeTest) { test_tokens("SELECT * FROM test;", {SQL_SELECT, '*', SQL_FROM, SQL_IDENTIFIER, ';'}); test_tokens("SELECT a, 'b' FROM test WITH HINT;", - {SQL_SELECT, SQL_IDENTIFIER, ',', SQL_STRING, SQL_FROM, SQL_IDENTIFIER, SQL_WITH, SQL_HINT, ';'}); + {SQL_SELECT, SQL_IDENTIFIER, ',', SQL_STRING, SQL_FROM, SQL_IDENTIFIER, SQL_WITH, SQL_HINT, ';'}); } TEST(SQLParserTokenizeStringifyTest) { diff --git a/Data/SQLParser/test/sql_tests.cpp b/Data/SQLParser/test/sql_tests.cpp index 70a89583b..4761e9a7e 100644 --- a/Data/SQLParser/test/sql_tests.cpp +++ b/Data/SQLParser/test/sql_tests.cpp @@ -30,31 +30,31 @@ TEST(DeleteStatementTest) { TEST(CreateStatementTest) { SQLParserResult result; SQLParser::parse( - "CREATE TABLE dummy_table (" - " c_bigint BIGINT, " - " c_boolean BOOLEAN, " - " c_char CHAR(42), " - " c_date DATE, " - " c_datetime DATETIME, " - " c_decimal DECIMAL, " - " c_decimal_precision DECIMAL(13), " - " c_decimal_precision_scale DECIMAL(13,37), " - " c_double_not_null DOUBLE NOT NULL, " - " c_float FLOAT, " - " c_int INT, " - " PRIMARY KEY(c_char, c_int), " - " c_integer_null INTEGER NULL, " - " c_long LONG, " - " c_real REAL, " - " c_smallint SMALLINT, " - " c_text TEXT UNIQUE PRIMARY KEY NOT NULL, " - " c_time TIME, " - " c_time_precision TIME(17), " - " c_timestamp TIMESTAMP, " - " c_varchar VARCHAR(50), " - " c_char_varying CHARACTER VARYING(60)" - ")", - &result); + "CREATE TABLE dummy_table (" + " c_bigint BIGINT, " + " c_boolean BOOLEAN, " + " c_char CHAR(42), " + " c_date DATE, " + " c_datetime DATETIME, " + " c_decimal DECIMAL, " + " c_decimal_precision DECIMAL(13), " + " c_decimal_precision_scale DECIMAL(13,37), " + " c_double_not_null DOUBLE NOT NULL, " + " c_float FLOAT, " + " c_int INT, " + " PRIMARY KEY(c_char, c_int), " + " c_integer_null INTEGER NULL, " + " c_long LONG, " + " c_real REAL, " + " c_smallint SMALLINT, " + " c_text TEXT UNIQUE PRIMARY KEY NOT NULL, " + " c_time TIME, " + " c_time_precision TIME(17), " + " c_timestamp TIMESTAMP, " + " c_varchar VARCHAR(50), " + " c_char_varying CHARACTER VARYING(60)" + ")", + &result); ASSERT(result.isValid()); ASSERT_EQ(result.size(), 1); ASSERT_EQ(result.getStatement(0)->type(), kStmtCreate); @@ -225,7 +225,7 @@ TEST(UpdateStatementTest) { TEST(InsertStatementTest) { TEST_PARSE_SINGLE_SQL("INSERT INTO students VALUES ('Max Mustermann', 12345, 'Musterhausen', 2.0)", kStmtInsert, - InsertStatement, result, stmt); + InsertStatement, result, stmt); ASSERT_EQ(stmt->values->size(), 4); // TODO @@ -331,7 +331,7 @@ TEST(ReleaseStatementTest) { ASSERT_EQ(0, result.size()); for (SQLStatement* stmt : statements) { - delete stmt; + delete stmt; } } @@ -360,7 +360,7 @@ TEST(DescribeStatementTest) { TEST(ImportStatementTest) { TEST_PARSE_SINGLE_SQL("IMPORT FROM TBL FILE 'students_file' INTO students;", kStmtImport, ImportStatement, result, - stmt); + stmt); ASSERT_EQ(stmt->type, kImportTbl); ASSERT_NOTNULL(stmt->tableName); @@ -370,7 +370,7 @@ TEST(ImportStatementTest) { TEST(CopyStatementTest) { TEST_PARSE_SINGLE_SQL("COPY students FROM 'students_file' WITH FORMAT BINARY;", kStmtImport, ImportStatement, - import_result, import_stmt); + import_result, import_stmt); ASSERT_EQ(import_stmt->type, kImportBinary); ASSERT_NOTNULL(import_stmt->tableName); @@ -380,7 +380,7 @@ TEST(CopyStatementTest) { ASSERT_NULL(import_stmt->whereClause); TEST_PARSE_SINGLE_SQL("COPY students FROM 'students_file' WHERE lastname = 'Potter';", kStmtImport, ImportStatement, - import_filter_result, import_filter_stmt); + import_filter_result, import_filter_stmt); ASSERT_EQ(import_filter_stmt->type, kImportAuto); ASSERT_NOTNULL(import_filter_stmt->tableName); @@ -395,7 +395,7 @@ TEST(CopyStatementTest) { ASSERT_STREQ(import_filter_stmt->whereClause->expr2->name, "Potter"); TEST_PARSE_SINGLE_SQL("COPY students TO 'students_file' WITH FORMAT CSV;", kStmtExport, ExportStatement, - export_table_result, export_table_stmt); + export_table_result, export_table_stmt); ASSERT_EQ(export_table_stmt->type, kImportCSV); ASSERT_NOTNULL(export_table_stmt->tableName); @@ -405,7 +405,7 @@ TEST(CopyStatementTest) { ASSERT_NULL(export_table_stmt->select); TEST_PARSE_SINGLE_SQL("COPY (SELECT firstname, lastname FROM students) TO 'students_file';", kStmtExport, - ExportStatement, export_select_result, export_select_stmt); + ExportStatement, export_select_result, export_select_stmt); ASSERT_EQ(export_select_stmt->type, kImportAuto); ASSERT_NULL(export_select_stmt->tableName); @@ -455,7 +455,7 @@ TEST(MoveSQLResultTest) { TEST(HintTest) { TEST_PARSE_SINGLE_SQL("SELECT * FROM students WITH HINT(NO_CACHE, SAMPLE_RATE(10));", kStmtSelect, SelectStatement, - result, stmt); + result, stmt); ASSERT_NOTNULL(stmt->hints); ASSERT_EQ(2, stmt->hints->size()); @@ -475,7 +475,7 @@ TEST(StringLengthTest) { TEST(ExceptOperatorTest) { TEST_PARSE_SINGLE_SQL("SELECT * FROM students EXCEPT SELECT * FROM students_2;", kStmtSelect, SelectStatement, result, - stmt); + stmt); ASSERT_STREQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->name, "students_2"); ASSERT_STREQ(stmt->fromTable->name, "students"); @@ -484,7 +484,7 @@ TEST(ExceptOperatorTest) { TEST(IntersectOperatorTest) { TEST_PARSE_SINGLE_SQL("SELECT * FROM students INTERSECT SELECT * FROM students_2;", kStmtSelect, SelectStatement, - result, stmt); + result, stmt); ASSERT_STREQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->name, "students_2"); ASSERT_STREQ(stmt->fromTable->name, "students"); @@ -493,7 +493,7 @@ TEST(IntersectOperatorTest) { TEST(UnionOperatorTest) { TEST_PARSE_SINGLE_SQL("SELECT * FROM students UNION SELECT * FROM students_2;", kStmtSelect, SelectStatement, result, - stmt); + stmt); ASSERT_STREQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->name, "students_2"); ASSERT_STREQ(stmt->fromTable->name, "students"); @@ -503,7 +503,7 @@ TEST(UnionOperatorTest) { TEST(UnionAllOperatorTest) { TEST_PARSE_SINGLE_SQL("SELECT * FROM students UNION ALL SELECT * FROM students_2;", kStmtSelect, SelectStatement, - result, stmt); + result, stmt); ASSERT_STREQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->name, "students_2"); ASSERT_STREQ(stmt->fromTable->name, "students"); @@ -512,11 +512,11 @@ TEST(UnionAllOperatorTest) { TEST(NestedSetOperationTest) { TEST_PARSE_SINGLE_SQL("SELECT * FROM students INTERSECT SELECT grade FROM students_2 UNION SELECT * FROM employees;", - kStmtSelect, SelectStatement, result, stmt); + kStmtSelect, SelectStatement, result, stmt); ASSERT_STREQ( - stmt->setOperations->back()->nestedSelectStatement->setOperations->back()->nestedSelectStatement->fromTable->name, - "employees"); + stmt->setOperations->back()->nestedSelectStatement->setOperations->back()->nestedSelectStatement->fromTable->name, + "employees"); ASSERT_STREQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->name, "students_2"); ASSERT_STREQ(stmt->fromTable->name, "students"); ASSERT_EQ(stmt->setOperations->back()->setType, kSetIntersect); @@ -526,8 +526,8 @@ TEST(NestedSetOperationTest) { TEST(OrderByFullStatementTest) { TEST_PARSE_SINGLE_SQL( - "SELECT * FROM students INTERSECT SELECT grade FROM students_2 UNION SELECT * FROM employees ORDER BY grade ASC;", - kStmtSelect, SelectStatement, result, stmt); + "SELECT * FROM students INTERSECT SELECT grade FROM students_2 UNION SELECT * FROM employees ORDER BY grade ASC;", + kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->setOperations->back()->resultOrder->at(0)->type, kOrderAsc); ASSERT_STREQ(stmt->setOperations->back()->resultOrder->at(0)->expr->name, "grade"); @@ -536,9 +536,9 @@ TEST(OrderByFullStatementTest) { TEST(SetOperationSubQueryOrder) { TEST_PARSE_SINGLE_SQL( - "(SELECT * FROM students ORDER BY name DESC) INTERSECT SELECT grade FROM students_2 UNION SELECT * FROM " - "employees ORDER BY grade ASC;", - kStmtSelect, SelectStatement, result, stmt); + "(SELECT * FROM students ORDER BY name DESC) INTERSECT SELECT grade FROM students_2 UNION SELECT * FROM " + "employees ORDER BY grade ASC;", + kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->order->at(0)->type, kOrderDesc); ASSERT_STREQ(stmt->order->at(0)->expr->name, "name"); @@ -550,20 +550,20 @@ TEST(SetOperationSubQueryOrder) { TEST(SetOperationLastSubQueryOrder) { TEST_PARSE_SINGLE_SQL( - "SELECT * FROM students INTERSECT SELECT grade FROM students_2 UNION (SELECT * FROM employees ORDER BY name " - "DESC) ORDER BY grade ASC;", - kStmtSelect, SelectStatement, result, stmt); + "SELECT * FROM students INTERSECT SELECT grade FROM students_2 UNION (SELECT * FROM employees ORDER BY name " + "DESC) ORDER BY grade ASC;", + kStmtSelect, SelectStatement, result, stmt); ASSERT_EQ(stmt->setOperations->back() - ->nestedSelectStatement->setOperations->back() - ->nestedSelectStatement->order->at(0) - ->type, - kOrderDesc); + ->nestedSelectStatement->setOperations->back() + ->nestedSelectStatement->order->at(0) + ->type, + kOrderDesc); ASSERT_STREQ(stmt->setOperations->back() - ->nestedSelectStatement->setOperations->back() - ->nestedSelectStatement->order->at(0) - ->expr->name, - "name"); + ->nestedSelectStatement->setOperations->back() + ->nestedSelectStatement->order->at(0) + ->expr->name, + "name"); ASSERT_EQ(stmt->setOperations->back()->resultOrder->at(0)->type, kOrderAsc); ASSERT_STREQ(stmt->setOperations->back()->resultOrder->at(0)->expr->name, "grade"); @@ -572,14 +572,14 @@ TEST(SetOperationLastSubQueryOrder) { TEST(NestedDifferentSetOperationsWithWithClause) { TEST_PARSE_SINGLE_SQL( - "WITH UNION_FIRST AS (SELECT * FROM A UNION SELECT * FROM B) SELECT * FROM UNION_FIRST EXCEPT SELECT * FROM C", - kStmtSelect, SelectStatement, result, stmt); + "WITH UNION_FIRST AS (SELECT * FROM A UNION SELECT * FROM B) SELECT * FROM UNION_FIRST EXCEPT SELECT * FROM C", + kStmtSelect, SelectStatement, result, stmt); ASSERT_STREQ(stmt->withDescriptions->back()->alias, "UNION_FIRST"); ASSERT_EQ(stmt->withDescriptions->back()->select->setOperations->back()->setType, kSetUnion); ASSERT_STREQ(stmt->withDescriptions->back()->select->fromTable->name, "A"); ASSERT_STREQ(stmt->withDescriptions->back()->select->setOperations->back()->nestedSelectStatement->fromTable->name, - "B"); + "B"); ASSERT_EQ(stmt->setOperations->back()->setType, kSetExcept); ASSERT_STREQ(stmt->fromTable->name, "UNION_FIRST"); @@ -588,32 +588,32 @@ TEST(NestedDifferentSetOperationsWithWithClause) { TEST(NestedAllSetOperationsWithWithClause) { TEST_PARSE_SINGLE_SQL( - "WITH UNION_FIRST AS (SELECT * FROM A UNION SELECT * FROM B) SELECT * FROM UNION_FIRST EXCEPT SELECT * FROM " - "(SELECT * FROM C INTERSECT SELECT * FROM D)", - kStmtSelect, SelectStatement, result, stmt); + "WITH UNION_FIRST AS (SELECT * FROM A UNION SELECT * FROM B) SELECT * FROM UNION_FIRST EXCEPT SELECT * FROM " + "(SELECT * FROM C INTERSECT SELECT * FROM D)", + kStmtSelect, SelectStatement, result, stmt); ASSERT_STREQ(stmt->withDescriptions->back()->alias, "UNION_FIRST"); ASSERT_EQ(stmt->withDescriptions->back()->select->setOperations->back()->setType, kSetUnion); ASSERT_STREQ(stmt->withDescriptions->back()->select->fromTable->name, "A"); ASSERT_STREQ(stmt->withDescriptions->back()->select->setOperations->back()->nestedSelectStatement->fromTable->name, - "B"); + "B"); ASSERT_EQ(stmt->setOperations->back()->setType, kSetExcept); ASSERT_STREQ(stmt->fromTable->name, "UNION_FIRST"); ASSERT_EQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->select->setOperations->back()->setType, - kSetIntersect); + kSetIntersect); ASSERT_STREQ(stmt->setOperations->back()->nestedSelectStatement->fromTable->select->fromTable->name, "C"); ASSERT_STREQ(stmt->setOperations->back() - ->nestedSelectStatement->fromTable->select->setOperations->back() - ->nestedSelectStatement->fromTable->name, - "D"); + ->nestedSelectStatement->fromTable->select->setOperations->back() + ->nestedSelectStatement->fromTable->name, + "D"); } TEST(NestedSetOperationsWithMultipleWithClauses) { TEST_PARSE_SINGLE_SQL( - "WITH UNION_FIRST AS (SELECT * FROM A UNION SELECT * FROM B),INTERSECT_SECOND AS (SELECT * FROM UNION_FIRST " - "INTERSECT SELECT * FROM C) SELECT * FROM UNION_FIRST EXCEPT SELECT * FROM INTERSECT_SECOND", - kStmtSelect, SelectStatement, result, stmt); + "WITH UNION_FIRST AS (SELECT * FROM A UNION SELECT * FROM B),INTERSECT_SECOND AS (SELECT * FROM UNION_FIRST " + "INTERSECT SELECT * FROM C) SELECT * FROM UNION_FIRST EXCEPT SELECT * FROM INTERSECT_SECOND", + kStmtSelect, SelectStatement, result, stmt); ASSERT_STREQ(stmt->withDescriptions->at(0)->alias, "UNION_FIRST"); ASSERT_STREQ(stmt->withDescriptions->back()->alias, "INTERSECT_SECOND"); @@ -621,12 +621,12 @@ TEST(NestedSetOperationsWithMultipleWithClauses) { ASSERT_EQ(stmt->withDescriptions->at(0)->select->setOperations->back()->setType, kSetUnion); ASSERT_STREQ(stmt->withDescriptions->at(0)->select->fromTable->name, "A"); ASSERT_STREQ(stmt->withDescriptions->at(0)->select->setOperations->back()->nestedSelectStatement->fromTable->name, - "B"); + "B"); ASSERT_EQ(stmt->withDescriptions->back()->select->setOperations->back()->setType, kSetIntersect); ASSERT_STREQ(stmt->withDescriptions->back()->select->fromTable->name, "UNION_FIRST"); ASSERT_STREQ(stmt->withDescriptions->back()->select->setOperations->back()->nestedSelectStatement->fromTable->name, - "C"); + "C"); ASSERT_EQ(stmt->setOperations->back()->setType, kSetExcept); ASSERT_STREQ(stmt->fromTable->name, "UNION_FIRST"); @@ -640,29 +640,29 @@ TEST(WrongOrderByStatementTest) { TEST(BeginTransactionTest) { { - TEST_PARSE_SINGLE_SQL("BEGIN TRANSACTION;", kStmtTransaction, TransactionStatement, transaction_result, - transaction_stmt); + TEST_PARSE_SINGLE_SQL("BEGIN TRANSACTION;", kStmtTransaction, TransactionStatement, transaction_result, + transaction_stmt); - ASSERT_EQ(transaction_stmt->command, kBeginTransaction); + ASSERT_EQ(transaction_stmt->command, kBeginTransaction); } { - TEST_PARSE_SINGLE_SQL("BEGIN;", kStmtTransaction, TransactionStatement, transaction_result, transaction_stmt); + TEST_PARSE_SINGLE_SQL("BEGIN;", kStmtTransaction, TransactionStatement, transaction_result, transaction_stmt); - ASSERT_EQ(transaction_stmt->command, kBeginTransaction); + ASSERT_EQ(transaction_stmt->command, kBeginTransaction); } } TEST(RollbackTransactionTest) { TEST_PARSE_SINGLE_SQL("ROLLBACK TRANSACTION;", kStmtTransaction, TransactionStatement, transaction_result, - transaction_stmt); + transaction_stmt); ASSERT_EQ(transaction_stmt->command, kRollbackTransaction); } TEST(CommitTransactionTest) { TEST_PARSE_SINGLE_SQL("COMMIT TRANSACTION;", kStmtTransaction, TransactionStatement, transaction_result, - transaction_stmt); + transaction_stmt); ASSERT_EQ(transaction_stmt->command, kCommitTransaction); } diff --git a/Data/SQLParser/test/thirdparty/microtest/microtest.h b/Data/SQLParser/test/thirdparty/microtest/microtest.h index 15295fef4..452d28e41 100644 --- a/Data/SQLParser/test/thirdparty/microtest/microtest.h +++ b/Data/SQLParser/test/thirdparty/microtest/microtest.h @@ -35,29 +35,29 @@ #define ASSERT_STREQ(a, b) \ if (std::string(a).compare(std::string(b)) != 0) { \ - printf("%s{ info} %s", mt::yellow(), mt::def()); \ - std::cout << "Actual values: " << a << " != " << b << std::endl; \ - throw mt::AssertFailedException(#a " == " #b, __FILE__, __LINE__); \ + printf("%s{ info} %s", mt::yellow(), mt::def()); \ + std::cout << "Actual values: " << a << " != " << b << std::endl; \ + throw mt::AssertFailedException(#a " == " #b, __FILE__, __LINE__); \ } #define ASSERT_STRNEQ(a, b) \ if (std::string(a).compare(std::string(b)) != = 0) { \ - printf("%s{ info} %s", mt::yellow(), mt::def()); \ - std::cout << "Actual values: " << a << " == " << b << std::endl; \ - throw mt::AssertFailedException(#a " != " #b, __FILE__, __LINE__); \ + printf("%s{ info} %s", mt::yellow(), mt::def()); \ + std::cout << "Actual values: " << a << " == " << b << std::endl; \ + throw mt::AssertFailedException(#a " != " #b, __FILE__, __LINE__); \ } #define ASSERT_EQ(a, b) \ if (a != b) { \ - printf("%s{ info} %s", mt::yellow(), mt::def()); \ - std::cout << "Actual values: " << a << " != " << b << std::endl; \ + printf("%s{ info} %s", mt::yellow(), mt::def()); \ + std::cout << "Actual values: " << a << " != " << b << std::endl; \ } \ ASSERT(a == b); #define ASSERT_NEQ(a, b) \ if (a == b) { \ - printf("%s{ info} %s", mt::yellow(), mt::def()); \ - std::cout << "Actual values: " << a << " == " << b << std::endl; \ + printf("%s{ info} %s", mt::yellow(), mt::def()); \ + std::cout << "Actual values: " << a << " == " << b << std::endl; \ } \ ASSERT(a != b); @@ -102,7 +102,7 @@ inline void printFailed(const char* message, FILE* file = stdout) { class AssertFailedException : public std::exception { public: AssertFailedException(std::string description, std::string filepath, int line) - : std::exception(), description_(description), filepath_(filepath), line_(line){}; + : std::exception(), description_(description), filepath_(filepath), line_(line){}; virtual const char* what() const throw() { return description_.c_str(); } @@ -122,47 +122,47 @@ class TestsManager { // http://www.parashift.com/c++-faq-lite/static-init-order-on-first-use.html public: struct Test { - const char* name; - void (*fn)(void); + const char* name; + void (*fn)(void); }; static std::vector& tests() { - static std::vector tests_; - return tests_; + static std::vector tests_; + return tests_; } // Adds a new test to the current set of tests. // Returns false if a test with the same name already exists. inline static bool AddTest(void (*fn)(void), const char* name) { - tests().push_back({name, fn}); - return true; + tests().push_back({name, fn}); + return true; } // Run all tests that are registered. // Returns the number of tests that failed. inline static size_t RunAllTests(FILE* file = stdout) { - size_t num_failed = 0; + size_t num_failed = 0; - for (const Test& test : tests()) { - // Run the test. - // If an AsserFailedException is thrown, the test has failed. - try { - printRunning(test.name, file); + for (const Test& test : tests()) { + // Run the test. + // If an AsserFailedException is thrown, the test has failed. + try { + printRunning(test.name, file); - (*test.fn)(); + (*test.fn)(); - printOk(test.name, file); + printOk(test.name, file); - } catch (AssertFailedException& e) { - printFailed(test.name, file); - fprintf(file, " %sAssertion failed: %s%s\n", red(), e.what(), def()); - fprintf(file, " %s%s:%d%s\n", red(), e.getFilepath(), e.getLine(), def()); - ++num_failed; - } - } + } catch (AssertFailedException& e) { + printFailed(test.name, file); + fprintf(file, " %sAssertion failed: %s%s\n", red(), e.what(), def()); + fprintf(file, " %s%s:%d%s\n", red(), e.getFilepath(), e.getLine(), def()); + ++num_failed; + } + } - int return_code = (num_failed > 0) ? 1 : 0; - return return_code; + int return_code = (num_failed > 0) ? 1 : 0; + return return_code; } }; @@ -170,30 +170,30 @@ class TestsManager { class Runtime { public: static const std::vector& args(int argc = -1, char** argv = NULL) { - static std::vector args_; - if (argc >= 0) { - for (int i = 0; i < argc; ++i) { - args_.push_back(argv[i]); - } - } - return args_; + static std::vector args_; + if (argc >= 0) { + for (int i = 0; i < argc; ++i) { + args_.push_back(argv[i]); + } + } + return args_; } }; } // namespace mt #define TEST_MAIN() \ int main(int argc, char* argv[]) { \ - mt::Runtime::args(argc, argv); \ - \ - size_t num_failed = mt::TestsManager::RunAllTests(stdout); \ - if (num_failed == 0) { \ - fprintf(stdout, "%s{ summary} All tests succeeded!%s\n", mt::green(), mt::def()); \ - return 0; \ - } else { \ - double percentage = 100.0 * num_failed / mt::TestsManager::tests().size(); \ - fprintf(stderr, "%s{ summary} %lu tests failed (%.2f%%)%s\n", mt::red(), num_failed, percentage, mt::def()); \ - return -1; \ - } \ + mt::Runtime::args(argc, argv); \ + \ + size_t num_failed = mt::TestsManager::RunAllTests(stdout); \ + if (num_failed == 0) { \ + fprintf(stdout, "%s{ summary} All tests succeeded!%s\n", mt::green(), mt::def()); \ + return 0; \ + } else { \ + double percentage = 100.0 * num_failed / mt::TestsManager::tests().size(); \ + fprintf(stderr, "%s{ summary} %lu tests failed (%.2f%%)%s\n", mt::red(), num_failed, percentage, mt::def()); \ + return -1; \ + } \ } #endif // __MICROTEST_H__ \ No newline at end of file diff --git a/Data/SQLParser/test/tpc_h_tests.cpp b/Data/SQLParser/test/tpc_h_tests.cpp index 48b2daaa5..58b4b6e60 100644 --- a/Data/SQLParser/test/tpc_h_tests.cpp +++ b/Data/SQLParser/test/tpc_h_tests.cpp @@ -20,45 +20,45 @@ std::string readFileContents(std::string file_path) { TEST(TPCHQueryGrammarTests) { std::vector files = { - "test/queries/tpc-h-01.sql", "test/queries/tpc-h-02.sql", "test/queries/tpc-h-03.sql", - "test/queries/tpc-h-04.sql", "test/queries/tpc-h-05.sql", "test/queries/tpc-h-06.sql", - "test/queries/tpc-h-07.sql", "test/queries/tpc-h-08.sql", "test/queries/tpc-h-09.sql", - "test/queries/tpc-h-10.sql", "test/queries/tpc-h-11.sql", "test/queries/tpc-h-12.sql", - "test/queries/tpc-h-13.sql", "test/queries/tpc-h-14.sql", "test/queries/tpc-h-15.sql", - "test/queries/tpc-h-16.sql", "test/queries/tpc-h-17.sql", "test/queries/tpc-h-18.sql", - "test/queries/tpc-h-19.sql", "test/queries/tpc-h-20.sql", "test/queries/tpc-h-21.sql", - "test/queries/tpc-h-22.sql", + "test/queries/tpc-h-01.sql", "test/queries/tpc-h-02.sql", "test/queries/tpc-h-03.sql", + "test/queries/tpc-h-04.sql", "test/queries/tpc-h-05.sql", "test/queries/tpc-h-06.sql", + "test/queries/tpc-h-07.sql", "test/queries/tpc-h-08.sql", "test/queries/tpc-h-09.sql", + "test/queries/tpc-h-10.sql", "test/queries/tpc-h-11.sql", "test/queries/tpc-h-12.sql", + "test/queries/tpc-h-13.sql", "test/queries/tpc-h-14.sql", "test/queries/tpc-h-15.sql", + "test/queries/tpc-h-16.sql", "test/queries/tpc-h-17.sql", "test/queries/tpc-h-18.sql", + "test/queries/tpc-h-19.sql", "test/queries/tpc-h-20.sql", "test/queries/tpc-h-21.sql", + "test/queries/tpc-h-22.sql", }; int testsFailed = 0; std::string concatenated = ""; for (const std::string& file_path : files) { - std::string query = readFileContents(file_path); + std::string query = readFileContents(file_path); - concatenated += query; - if (concatenated.back() != ';') concatenated += ';'; + concatenated += query; + if (concatenated.back() != ';') concatenated += ';'; - SQLParserResult result; - SQLParser::parse(query.c_str(), &result); - if (!result.isValid()) { - mt::printFailed(file_path.c_str()); - printf("%s %s (L%d:%d)%s\n", mt::red(), result.errorMsg(), result.errorLine(), result.errorColumn(), - mt::def()); - ++testsFailed; - } else { - mt::printOk(file_path.c_str()); - } + SQLParserResult result; + SQLParser::parse(query.c_str(), &result); + if (!result.isValid()) { + mt::printFailed(file_path.c_str()); + printf("%s %s (L%d:%d)%s\n", mt::red(), result.errorMsg(), result.errorLine(), result.errorColumn(), + mt::def()); + ++testsFailed; + } else { + mt::printOk(file_path.c_str()); + } } SQLParserResult result; SQLParser::parse(concatenated.c_str(), &result); if (!result.isValid()) { - mt::printFailed("TPCHAllConcatenated"); - printf("%s %s (L%d:%d)%s\n", mt::red(), result.errorMsg(), result.errorLine(), result.errorColumn(), - mt::def()); - ++testsFailed; + mt::printFailed("TPCHAllConcatenated"); + printf("%s %s (L%d:%d)%s\n", mt::red(), result.errorMsg(), result.errorLine(), result.errorColumn(), + mt::def()); + ++testsFailed; } else { - mt::printOk("TPCHAllConcatenated"); + mt::printOk("TPCHAllConcatenated"); } ASSERT_EQ(testsFailed, 0); diff --git a/Data/SQLite/include/Poco/Data/SQLite/Utility.h b/Data/SQLite/include/Poco/Data/SQLite/Utility.h index c4d6e050b..fc45ffa59 100644 --- a/Data/SQLite/include/Poco/Data/SQLite/Utility.h +++ b/Data/SQLite/include/Poco/Data/SQLite/Utility.h @@ -148,7 +148,7 @@ public: static CBMap retMap; T* pRet = reinterpret_cast(eventHookRegister(pDB, callbackFn, pParam)); - if (pRet == 0) + if (pRet == nullptr) { if (retMap.find(pDB) == retMap.end()) { @@ -161,8 +161,8 @@ public: CBMapItPair retMapRange = retMap.equal_range(pDB); for (CBMapIt it = retMapRange.first; it != retMapRange.second; ++it) { - poco_assert (it->second.first != 0); - if ((callbackFn == 0) && (*pRet == *it->second.second)) + poco_assert (it->second.first != nullptr); + if ((callbackFn == nullptr) && (*pRet == *it->second.second)) { retMap.erase(it); return true; diff --git a/Data/SQLite/src/Notifier.cpp b/Data/SQLite/src/Notifier.cpp index 163cfc4a2..9d27e988c 100644 --- a/Data/SQLite/src/Notifier.cpp +++ b/Data/SQLite/src/Notifier.cpp @@ -69,7 +69,7 @@ bool Notifier::disableUpdate() { Poco::Mutex::ScopedLock l(_mutex); - if (Utility::registerUpdateHandler(Utility::dbHandle(_session), (Utility::UpdateCallbackType) 0, this)) + if (Utility::registerUpdateHandler(Utility::dbHandle(_session), (Utility::UpdateCallbackType) nullptr, this)) _enabledEvents &= ~SQLITE_NOTIFY_UPDATE; return !updateEnabled(); @@ -97,7 +97,7 @@ bool Notifier::disableCommit() { Poco::Mutex::ScopedLock l(_mutex); - if (Utility::registerUpdateHandler(Utility::dbHandle(_session), (Utility::CommitCallbackType) 0, this)) + if (Utility::registerUpdateHandler(Utility::dbHandle(_session), (Utility::CommitCallbackType) nullptr, this)) _enabledEvents &= ~SQLITE_NOTIFY_COMMIT; return !commitEnabled(); @@ -125,7 +125,7 @@ bool Notifier::disableRollback() { Poco::Mutex::ScopedLock l(_mutex); - if (Utility::registerUpdateHandler(Utility::dbHandle(_session), (Utility::RollbackCallbackType) 0, this)) + if (Utility::registerUpdateHandler(Utility::dbHandle(_session), (Utility::RollbackCallbackType) nullptr, this)) _enabledEvents &= ~SQLITE_NOTIFY_ROLLBACK; return !rollbackEnabled(); diff --git a/Data/SQLite/src/SQLiteStatementImpl.cpp b/Data/SQLite/src/SQLiteStatementImpl.cpp index 0cf1dbfec..7244d70f1 100644 --- a/Data/SQLite/src/SQLiteStatementImpl.cpp +++ b/Data/SQLite/src/SQLiteStatementImpl.cpp @@ -32,7 +32,7 @@ const int SQLiteStatementImpl::POCO_SQLITE_INV_ROW_CNT = -1; SQLiteStatementImpl::SQLiteStatementImpl(Poco::Data::SessionImpl& rSession, sqlite3* pDB): StatementImpl(rSession), _pDB(pDB), - _pStmt(0), + _pStmt(nullptr), _stepCalled(false), _nextResponse(0), _affectedRowCount(POCO_SQLITE_INV_ROW_CNT), @@ -66,14 +66,14 @@ void SQLiteStatementImpl::compileImpl() std::string statement(toString()); - sqlite3_stmt* pStmt = 0; + sqlite3_stmt* pStmt = nullptr; const char* pSql = _pLeftover ? _pLeftover->c_str() : statement.c_str(); if (0 == std::strlen(pSql)) throw InvalidSQLStatementException("Empty statements are illegal"); int rc = SQLITE_OK; - const char* pLeftover = 0; + const char* pLeftover = nullptr; bool queryFound = false; do @@ -82,7 +82,7 @@ void SQLiteStatementImpl::compileImpl() if (rc != SQLITE_OK) { if (pStmt) sqlite3_finalize(pStmt); - pStmt = 0; + pStmt = nullptr; std::string errMsg = sqlite3_errmsg(_pDB); Utility::throwException(_pDB, rc, errMsg); } @@ -149,7 +149,7 @@ void SQLiteStatementImpl::bindImpl() { _stepCalled = false; _nextResponse = 0; - if (_pStmt == 0) return; + if (_pStmt == nullptr) return; sqlite3_reset(_pStmt); @@ -217,9 +217,9 @@ void SQLiteStatementImpl::clear() if (_pStmt) { sqlite3_finalize(_pStmt); - _pStmt=0; + _pStmt=nullptr; } - _pLeftover = 0; + _pLeftover = nullptr; } @@ -229,7 +229,7 @@ bool SQLiteStatementImpl::hasNext() return (_nextResponse == SQLITE_ROW); // _pStmt is allowed to be null for conditional SQL statements - if (_pStmt == 0) + if (_pStmt == nullptr) { _stepCalled = true; _nextResponse = SQLITE_DONE; @@ -305,7 +305,7 @@ const MetaColumn& SQLiteStatementImpl::metaColumn(std::size_t pos) const int SQLiteStatementImpl::affectedRowCount() const { if (_affectedRowCount != POCO_SQLITE_INV_ROW_CNT) return _affectedRowCount; - return _pStmt == 0 || sqlite3_stmt_readonly(_pStmt) ? 0 : sqlite3_changes(_pDB); + return _pStmt == nullptr || sqlite3_stmt_readonly(_pStmt) ? 0 : sqlite3_changes(_pDB); } diff --git a/Data/SQLite/src/Utility.cpp b/Data/SQLite/src/Utility.cpp index accb2f784..57a7e0839 100644 --- a/Data/SQLite/src/Utility.cpp +++ b/Data/SQLite/src/Utility.cpp @@ -62,7 +62,7 @@ Utility::TypeMap Utility::_types; Poco::Mutex Utility::_mutex; -Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex((pDB) ? sqlite3_db_mutex(pDB) : 0) +Utility::SQLiteMutex::SQLiteMutex(sqlite3* pDB): _pMutex((pDB) ? sqlite3_db_mutex(pDB) : nullptr) { if (_pMutex) sqlite3_mutex_enter(_pMutex); @@ -256,7 +256,7 @@ bool Utility::fileToMemory(sqlite3* pInMemory, const std::string& fileName) // Note: SQLITE_OPEN_READWRITE is required to correctly handle an existing hot journal. // See #3135 - rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_URI, NULL); + rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_URI, nullptr); if(rc == SQLITE_OK ) { pBackup = sqlite3_backup_init(pInMemory, "main", pFile, "main"); @@ -279,7 +279,7 @@ bool Utility::memoryToFile(const std::string& fileName, sqlite3* pInMemory) sqlite3* pFile; sqlite3_backup* pBackup; - rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI, NULL); + rc = sqlite3_open_v2(fileName.c_str(), &pFile, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_URI, nullptr); if(rc == SQLITE_OK ) { pBackup = sqlite3_backup_init(pFile, "main", pInMemory, "main"); diff --git a/Data/SQLite/testsuite/src/SQLiteTest.cpp b/Data/SQLite/testsuite/src/SQLiteTest.cpp index d71ecdef2..a4bbce248 100644 --- a/Data/SQLite/testsuite/src/SQLiteTest.cpp +++ b/Data/SQLite/testsuite/src/SQLiteTest.cpp @@ -476,7 +476,7 @@ void SQLiteTest::testNullCharPointer() try { - const char* pc = 0; + const char* pc = nullptr; tmp << "INSERT INTO PERSON VALUES(:ln, :fn, :ad, :age)", bind("lastname"), bind("firstname"), @@ -506,7 +506,7 @@ void SQLiteTest::testInsertCharPointer() tmp << "DROP TABLE IF EXISTS Person", now; tmp << "CREATE TABLE IF NOT EXISTS Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))", now; - const char* pc = 0; + const char* pc = nullptr; try { tmp << "INSERT INTO PERSON VALUES(:ln, :fn, :ad, :age)", bind(pc), now; @@ -522,7 +522,7 @@ void SQLiteTest::testInsertCharPointer() bind("Address"), bind(133132)); - std::free((void*) pc); pc = 0; + std::free((void*) pc); pc = nullptr; assertTrue (1 == stmt.execute()); tmp << "SELECT COUNT(*) FROM PERSON", into(count), now; @@ -2916,9 +2916,9 @@ void SQLiteTest::testThreadModes() } sw.stop(); std::cout << "Mode: " << ((*it == Utility::THREAD_MODE_SINGLE) ? "single," - :(*it == Utility::THREAD_MODE_MULTI) ? "multi," - :(*it == Utility::THREAD_MODE_SERIAL) ? "serial," - : "unknown,") << " Time: " << sw.elapsed() / 1000.0 << " [ms]" << std::endl; + :(*it == Utility::THREAD_MODE_MULTI) ? "multi," + :(*it == Utility::THREAD_MODE_SERIAL) ? "serial," + : "unknown,") << " Time: " << sw.elapsed() / 1000.0 << " [ms]" << std::endl; } assertTrue (Utility::setThreadMode(Utility::THREAD_MODE_SERIAL)); @@ -3005,7 +3005,7 @@ void SQLiteTest::testUpdateCallback() assertTrue (_deleteCounter == 1); // disarm callback and do the same drill - assertTrue (Utility::registerUpdateHandler(tmp, (Utility::UpdateCallbackType) 0, &val)); + assertTrue (Utility::registerUpdateHandler(tmp, (Utility::UpdateCallbackType) nullptr, &val)); tmp << "DROP TABLE IF EXISTS Person", now; tmp << "CREATE TABLE IF NOT EXISTS Person (LastName VARCHAR(30), FirstName VARCHAR, Address VARCHAR, Age INTEGER(3))", now; @@ -3074,7 +3074,7 @@ void SQLiteTest::testCommitCallback() tmp.commit(); assertTrue (val == 2); - assertTrue (Utility::registerUpdateHandler(tmp, (Utility::CommitCallbackType) 0, &val)); + assertTrue (Utility::registerUpdateHandler(tmp, (Utility::CommitCallbackType) nullptr, &val)); val = 0; tmp.begin(); tmp << "DROP TABLE IF EXISTS Person", now; @@ -3115,7 +3115,7 @@ void SQLiteTest::testRollbackCallback() tmp.rollback(); assertTrue (val == 2); - assertTrue (Utility::registerUpdateHandler(tmp, (Utility::RollbackCallbackType) 0, &val)); + assertTrue (Utility::registerUpdateHandler(tmp, (Utility::RollbackCallbackType) nullptr, &val)); val = 0; tmp.begin(); tmp << "DROP TABLE IF EXISTS Person", now; diff --git a/Data/include/Poco/Data/LOB.h b/Data/include/Poco/Data/LOB.h index 9e3a3f023..7522fb7b1 100644 --- a/Data/include/Poco/Data/LOB.h +++ b/Data/include/Poco/Data/LOB.h @@ -136,7 +136,7 @@ public: /// If the LOB is empty, returns NULL. { if (_pContent->empty()) - return 0; + return nullptr; else return _pContent->data(); } @@ -147,7 +147,7 @@ public: /// If the LOB is empty, returns NULL. { if (_pContent->empty()) - return 0; + return nullptr; else return _pContent->data(); } @@ -294,7 +294,7 @@ public: val.assign(_val.begin(), _val.end()); } - VarHolder* clone(Placeholder* pVarHolder = 0) const + VarHolder* clone(Placeholder* pVarHolder = nullptr) const { return cloneHolder(pVarHolder, _val); } @@ -332,7 +332,7 @@ public: val.assign(_val.begin(), _val.end()); } - VarHolder* clone(Placeholder* pVarHolder = 0) const + VarHolder* clone(Placeholder* pVarHolder = nullptr) const { return cloneHolder(pVarHolder, _val); } diff --git a/Data/include/Poco/Data/RecordSet.h b/Data/include/Poco/Data/RecordSet.h index 5589c42d4..6fee66749 100644 --- a/Data/include/Poco/Data/RecordSet.h +++ b/Data/include/Poco/Data/RecordSet.h @@ -78,12 +78,12 @@ public: static const std::size_t UNKNOWN_TOTAL_ROW_COUNT; explicit RecordSet(const Statement& rStatement, - RowFormatter::Ptr pRowFormatter = 0); + RowFormatter::Ptr pRowFormatter = nullptr); /// Creates the RecordSet. RecordSet(Session& rSession, const std::string& query, - RowFormatter::Ptr pRowFormatter = 0); + RowFormatter::Ptr pRowFormatter = nullptr); /// Creates the RecordSet. RecordSet(Session& rSession, diff --git a/Data/include/Poco/Data/Row.h b/Data/include/Poco/Data/Row.h index 089d9ae87..5c4b4f3b9 100644 --- a/Data/include/Poco/Data/Row.h +++ b/Data/include/Poco/Data/Row.h @@ -82,12 +82,12 @@ public: /// Creates the Row. Row(NameVecPtr pNames, - const RowFormatter::Ptr& pFormatter = 0); + const RowFormatter::Ptr& pFormatter = nullptr); /// Creates the Row. Row(NameVecPtr pNames, const SortMapPtr& pSortMap, - const RowFormatter::Ptr& pFormatter = 0); + const RowFormatter::Ptr& pFormatter = nullptr); /// Creates the Row. ~Row(); @@ -200,14 +200,14 @@ public: const ValueVec& values() const; /// Returns the const reference to values vector. - void setFormatter(const RowFormatter::Ptr& pFormatter = 0); + void setFormatter(const RowFormatter::Ptr& pFormatter = nullptr); /// Sets the formatter for this row and takes the /// shared ownership of it. const RowFormatter& getFormatter() const; /// Returns the reference to the formatter. - void setSortMap(const SortMapPtr& pSortMap = 0); + void setSortMap(const SortMapPtr& pSortMap = nullptr); /// Adds the sorting fields entry and takes the /// shared ownership of it. diff --git a/Data/include/Poco/Data/Transaction.h b/Data/include/Poco/Data/Transaction.h index a00142cbb..f1d1979c1 100644 --- a/Data/include/Poco/Data/Transaction.h +++ b/Data/include/Poco/Data/Transaction.h @@ -37,7 +37,7 @@ class Data_API Transaction /// See Transaction for more details and purpose of this template. { public: - Transaction(Poco::Data::Session& session, Poco::Logger* pLogger = 0); + Transaction(Poco::Data::Session& session, Poco::Logger* pLogger = nullptr); /// Creates the Transaction and starts it, using the given database session and logger. Transaction(Poco::Data::Session& session, bool start); @@ -46,7 +46,7 @@ public: /// to start the transaction. template - Transaction(Poco::Data::Session& rSession, T& t, Poco::Logger* pLogger = 0): + Transaction(Poco::Data::Session& rSession, T& t, Poco::Logger* pLogger = nullptr): _rSession(rSession), _pLogger(pLogger) /// Creates the Transaction, using the given database session, transactor and logger. diff --git a/Data/include/Poco/Data/TypeHandler.h b/Data/include/Poco/Data/TypeHandler.h index 330e0159c..f1992d62f 100644 --- a/Data/include/Poco/Data/TypeHandler.h +++ b/Data/include/Poco/Data/TypeHandler.h @@ -376,7 +376,7 @@ template + class T39> class TypeHandler> { public: @@ -605,7 +605,7 @@ template + class T38> class TypeHandler> { public: @@ -829,7 +829,7 @@ template + class T37> class TypeHandler> { public: @@ -1049,7 +1049,7 @@ template + class T36> class TypeHandler> { public: @@ -1264,7 +1264,7 @@ template + class T35> class TypeHandler> { public: @@ -1390,7 +1390,7 @@ class TypeHandler::size() + TypeHandler::size() + TypeHandler::size() + - TypeHandler::size(); + TypeHandler::size(); } static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor::Ptr pExt) @@ -1474,7 +1474,7 @@ template + class T34> class TypeHandler> { public: @@ -1597,7 +1597,7 @@ class TypeHandler::size() + TypeHandler::size() + TypeHandler::size() + - TypeHandler::size(); + TypeHandler::size(); } static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor::Ptr pExt) @@ -1679,7 +1679,7 @@ template + class T33> class TypeHandler> { public: @@ -1879,7 +1879,7 @@ template + class T32> class TypeHandler> { public: @@ -2073,7 +2073,7 @@ template + class T31> class TypeHandler> { public: @@ -2187,7 +2187,7 @@ class TypeHandler::size() + TypeHandler::size() + TypeHandler::size() + - TypeHandler::size(); + TypeHandler::size(); } static void extract(std::size_t pos, TupleRef tuple, TupleConstRef defVal, AbstractExtractor::Ptr pExt) @@ -2263,7 +2263,7 @@ template + class T30> class TypeHandler> { public: @@ -3599,7 +3599,7 @@ template + class T22> class TypeHandler> { public: @@ -3685,7 +3685,7 @@ class TypeHandler::size() + TypeHandler::size() + TypeHandler::size() + - TypeHandler::size() + + TypeHandler::size() + TypeHandler::size(); } @@ -3745,7 +3745,7 @@ template + class T21> class TypeHandler> { public: diff --git a/Data/samples/DBLogger/src/SQLLogInserter.h b/Data/samples/DBLogger/src/SQLLogInserter.h index 2308169f4..e03495d4f 100644 --- a/Data/samples/DBLogger/src/SQLLogInserter.h +++ b/Data/samples/DBLogger/src/SQLLogInserter.h @@ -52,8 +52,8 @@ private: std::size_t insertEntries(std::vector& entries); std::string popEntry(); - void removeEntry(const std::string &entry); - void processFile(const std::string& entry); + void removeEntry(const std::string &entry); + void processFile(const std::string& entry); std::size_t scanDirectory(); void runDirectoryScan(); diff --git a/Data/samples/WebNotifier/src/WebNotifier.cpp b/Data/samples/WebNotifier/src/WebNotifier.cpp index 5a563e020..b8ecb48d2 100644 --- a/Data/samples/WebNotifier/src/WebNotifier.cpp +++ b/Data/samples/WebNotifier/src/WebNotifier.cpp @@ -88,7 +88,7 @@ class WebSocketRequestHandler: public HTTPRequestHandler /// Handler for the WebSocket connection. { public: - WebSocketRequestHandler() : _pWS(0), _flags(0) + WebSocketRequestHandler() : _pWS(nullptr), _flags(0) { } @@ -165,7 +165,7 @@ class RequestHandlerFactory: public HTTPRequestHandlerFactory /// Web request handler factory. { public: - RequestHandlerFactory() : _pHandler(0) + RequestHandlerFactory() : _pHandler(nullptr) { } @@ -185,7 +185,7 @@ public: if (uri != "/favicon.ico") std::cout << "Unknown URI: " << uri << std::endl; - return 0; + return nullptr; } WebSocketRequestHandler& handler() diff --git a/Data/src/AbstractBinding.cpp b/Data/src/AbstractBinding.cpp index be6fd363d..40e323499 100644 --- a/Data/src/AbstractBinding.cpp +++ b/Data/src/AbstractBinding.cpp @@ -22,7 +22,7 @@ namespace Data { AbstractBinding::AbstractBinding(const std::string& name, Direction direction, Poco::UInt32 bulkSize): - _pBinder(0), + _pBinder(nullptr), _name(name), _direction(direction), _bulkSize(bulkSize) diff --git a/Data/src/AbstractExtraction.cpp b/Data/src/AbstractExtraction.cpp index 94b394bdc..d612fb495 100644 --- a/Data/src/AbstractExtraction.cpp +++ b/Data/src/AbstractExtraction.cpp @@ -22,7 +22,7 @@ namespace Data { AbstractExtraction::AbstractExtraction(Poco::UInt32 limit, Poco::UInt32 position, bool bulk): - _pExtractor(0), + _pExtractor(nullptr), _limit(limit), _position(position), _bulk(bulk), diff --git a/Data/src/RecordSet.cpp b/Data/src/RecordSet.cpp index df30eac82..0c0587960 100644 --- a/Data/src/RecordSet.cpp +++ b/Data/src/RecordSet.cpp @@ -130,9 +130,9 @@ RecordSet& RecordSet::operator = (RecordSet&& other) noexcept void RecordSet::reset(const Statement& stmt) { delete _pBegin; - _pBegin = 0; + _pBegin = nullptr; delete _pEnd; - _pEnd = 0; + _pEnd = nullptr; _currentRow = 0; _totalRowCount = UNKNOWN_TOTAL_ROW_COUNT; @@ -473,7 +473,7 @@ Row& RecordSet::row(std::size_t pos) throw RangeException("Invalid recordset row requested."); RowMap::const_iterator it = _rowMap.find(pos); - Row* pRow = 0; + Row* pRow = nullptr; std::size_t columns = columnCount(); if (it == _rowMap.end()) { diff --git a/Data/src/Row.cpp b/Data/src/Row.cpp index 9cc6b0daf..3838fa365 100644 --- a/Data/src/Row.cpp +++ b/Data/src/Row.cpp @@ -30,7 +30,7 @@ std::ostream& operator << (std::ostream &os, const Row& row) Row::Row(): - _pNames(0), + _pNames(nullptr), _pSortMap(new SortMap), _pFormatter(new SimpleRowFormatter) { @@ -41,7 +41,7 @@ Row::Row(NameVecPtr pNames, const RowFormatter::Ptr& pFormatter): _pNames(pNames) { if (!_pNames) throw NullPointerException(); - init(0, pFormatter); + init(nullptr, pFormatter); } diff --git a/Data/src/RowFilter.cpp b/Data/src/RowFilter.cpp index c66c6b5ea..5182c2294 100644 --- a/Data/src/RowFilter.cpp +++ b/Data/src/RowFilter.cpp @@ -32,7 +32,7 @@ RowFilter::RowFilter(RecordSet* pRecordSet): _pRecordSet(pRecordSet), _not(false } -RowFilter::RowFilter(Ptr pParent, LogicOperator op): _pRecordSet(0), +RowFilter::RowFilter(Ptr pParent, LogicOperator op): _pRecordSet(nullptr), _pParent(pParent), _not(false) { @@ -61,7 +61,7 @@ RowFilter::~RowFilter() { try { - if (_pRecordSet) _pRecordSet->filter(0); + if (_pRecordSet) _pRecordSet->filter(nullptr); if (_pParent && _pParent->has(this)) _pParent->removeFilter(this); release(); @@ -89,7 +89,7 @@ bool RowFilter::isAllowed(std::size_t row) const if (_comparisonMap.find(name) == _comparisonMap.end()) continue; Poco::Dynamic::Var ret; - CompT compOp = 0; + CompT compOp = nullptr; Poco::Dynamic::Var val = rs.value(col, row, false); switch (it->second.get<1>()) @@ -180,8 +180,8 @@ void RowFilter::removeFilter(Ptr pFilter) _pRecordSet->moveFirst(); _filterMap.erase(pFilter); - pFilter->_pRecordSet = 0; - pFilter->_pParent = 0; + pFilter->_pRecordSet = nullptr; + pFilter->_pParent = nullptr; } diff --git a/Data/src/Transaction.cpp b/Data/src/Transaction.cpp index 6184c8d3e..81157a3c9 100644 --- a/Data/src/Transaction.cpp +++ b/Data/src/Transaction.cpp @@ -30,7 +30,7 @@ Transaction::Transaction(Poco::Data::Session& rSession, Poco::Logger* pLogger): Transaction::Transaction(Poco::Data::Session& rSession, bool start): _rSession(rSession), - _pLogger(0) + _pLogger(nullptr) { if (start) begin(); } diff --git a/Data/testsuite/src/SessionImpl.cpp b/Data/testsuite/src/SessionImpl.cpp index 36bd98235..e0f11554e 100644 --- a/Data/testsuite/src/SessionImpl.cpp +++ b/Data/testsuite/src/SessionImpl.cpp @@ -24,12 +24,12 @@ SessionImpl::SessionImpl(const std::string& init, std::size_t timeout): _connected(true) { addFeature("f1", &SessionImpl::setF, &SessionImpl::getF); - addFeature("f2", 0, &SessionImpl::getF); - addFeature("f3", &SessionImpl::setF, 0); + addFeature("f2", nullptr, &SessionImpl::getF); + addFeature("f3", &SessionImpl::setF, nullptr); addFeature("throwOnHasNext", &SessionImpl::setThrowOnHasNext, &SessionImpl::getThrowOnHasNext); addFeature("connected", &SessionImpl::setConnected, &SessionImpl::getConnected); addProperty("p1", &SessionImpl::setP, &SessionImpl::getP); - addProperty("p2", 0, &SessionImpl::getP); + addProperty("p2", nullptr, &SessionImpl::getP); addProperty("p3", &SessionImpl::setP, &SessionImpl::getP); setDBMSName("Test"); } diff --git a/Encodings/Compiler/src/TextEncodingCompiler.cpp b/Encodings/Compiler/src/TextEncodingCompiler.cpp index 3286324c5..25b7b428e 100644 --- a/Encodings/Compiler/src/TextEncodingCompiler.cpp +++ b/Encodings/Compiler/src/TextEncodingCompiler.cpp @@ -21,7 +21,6 @@ #include "Poco/Exception.h" #include "Poco/DateTime.h" #include "Poco/AutoPtr.h" -#include "Poco/Path.h" #include "Poco/Net/HTTPStreamFactory.h" #include "Poco/Net/FTPStreamFactory.h" #include @@ -367,7 +366,7 @@ const std::string TextEncodingCompiler::IMPL_TEMPLATE( "const char* ${CLASS}::_names[] =\n" "{\n" "${ENCODING_NAMES}" - " NULL\n" + " nullptr\n" "};\n" "\n" "\n" diff --git a/Encodings/include/Poco/DoubleByteEncoding.h b/Encodings/include/Poco/DoubleByteEncoding.h index 469458e6c..aee0a17be 100644 --- a/Encodings/include/Poco/DoubleByteEncoding.h +++ b/Encodings/include/Poco/DoubleByteEncoding.h @@ -65,7 +65,7 @@ protected: /// { /// "myencoding", /// "MyEncoding", - /// NULL + /// nullptr /// }; /// /// The first entry in names must be the canonical name. diff --git a/Encodings/src/ISO8859_10Encoding.cpp b/Encodings/src/ISO8859_10Encoding.cpp index 4312268c5..6dc553d6e 100644 --- a/Encodings/src/ISO8859_10Encoding.cpp +++ b/Encodings/src/ISO8859_10Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_10Encoding::_names[] = "ISO-8859-10", "Latin6", "Latin-6", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_11Encoding.cpp b/Encodings/src/ISO8859_11Encoding.cpp index c3fe7bfb2..83ae6c155 100644 --- a/Encodings/src/ISO8859_11Encoding.cpp +++ b/Encodings/src/ISO8859_11Encoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* ISO8859_11Encoding::_names[] = { "ISO-8859-11", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_13Encoding.cpp b/Encodings/src/ISO8859_13Encoding.cpp index 29be260c8..454925c92 100644 --- a/Encodings/src/ISO8859_13Encoding.cpp +++ b/Encodings/src/ISO8859_13Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_13Encoding::_names[] = "ISO-8859-13", "Latin7", "Latin-7", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_14Encoding.cpp b/Encodings/src/ISO8859_14Encoding.cpp index 891ad9051..138a61134 100644 --- a/Encodings/src/ISO8859_14Encoding.cpp +++ b/Encodings/src/ISO8859_14Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_14Encoding::_names[] = "ISO-8859-14", "Latin8", "Latin-8", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_16Encoding.cpp b/Encodings/src/ISO8859_16Encoding.cpp index 3f548d376..e96d35743 100644 --- a/Encodings/src/ISO8859_16Encoding.cpp +++ b/Encodings/src/ISO8859_16Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_16Encoding::_names[] = "ISO-8859-16", "Latin10", "Latin-10", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_3Encoding.cpp b/Encodings/src/ISO8859_3Encoding.cpp index 276ee1687..fcdb154cb 100644 --- a/Encodings/src/ISO8859_3Encoding.cpp +++ b/Encodings/src/ISO8859_3Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_3Encoding::_names[] = "ISO-8859-3", "Latin3", "Latin-3", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_4Encoding.cpp b/Encodings/src/ISO8859_4Encoding.cpp index 7baa8a0a0..d537a332e 100644 --- a/Encodings/src/ISO8859_4Encoding.cpp +++ b/Encodings/src/ISO8859_4Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_4Encoding::_names[] = "ISO-8859-4", "Latin4", "Latin-4", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_5Encoding.cpp b/Encodings/src/ISO8859_5Encoding.cpp index a700ef1a0..78631cfb2 100644 --- a/Encodings/src/ISO8859_5Encoding.cpp +++ b/Encodings/src/ISO8859_5Encoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* ISO8859_5Encoding::_names[] = { "ISO-8859-5", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_6Encoding.cpp b/Encodings/src/ISO8859_6Encoding.cpp index 0aff953e0..78ee440fe 100644 --- a/Encodings/src/ISO8859_6Encoding.cpp +++ b/Encodings/src/ISO8859_6Encoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* ISO8859_6Encoding::_names[] = { "ISO-8859-6", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_7Encoding.cpp b/Encodings/src/ISO8859_7Encoding.cpp index edc4465b9..d883da847 100644 --- a/Encodings/src/ISO8859_7Encoding.cpp +++ b/Encodings/src/ISO8859_7Encoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* ISO8859_7Encoding::_names[] = { "ISO-8859-7", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_8Encoding.cpp b/Encodings/src/ISO8859_8Encoding.cpp index 117cfb564..b25e53f58 100644 --- a/Encodings/src/ISO8859_8Encoding.cpp +++ b/Encodings/src/ISO8859_8Encoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* ISO8859_8Encoding::_names[] = { "ISO-8859-8", - NULL + nullptr }; diff --git a/Encodings/src/ISO8859_9Encoding.cpp b/Encodings/src/ISO8859_9Encoding.cpp index fe3464aa2..d2d09fc7f 100644 --- a/Encodings/src/ISO8859_9Encoding.cpp +++ b/Encodings/src/ISO8859_9Encoding.cpp @@ -23,7 +23,7 @@ const char* ISO8859_9Encoding::_names[] = "ISO-8859-9", "Latin5", "Latin-5", - NULL + nullptr }; diff --git a/Encodings/src/MacCentralEurRomanEncoding.cpp b/Encodings/src/MacCentralEurRomanEncoding.cpp index 6d1735537..2aca2cb48 100644 --- a/Encodings/src/MacCentralEurRomanEncoding.cpp +++ b/Encodings/src/MacCentralEurRomanEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacCentralEurRomanEncoding::_names[] = { "MacCentralEurRoman", - NULL + nullptr }; diff --git a/Encodings/src/MacChineseSimpEncoding.cpp b/Encodings/src/MacChineseSimpEncoding.cpp index 70401094e..1e252d0c1 100644 --- a/Encodings/src/MacChineseSimpEncoding.cpp +++ b/Encodings/src/MacChineseSimpEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacChineseSimpEncoding::_names[] = { "MacChineseSimp", - NULL + nullptr }; diff --git a/Encodings/src/MacChineseTradEncoding.cpp b/Encodings/src/MacChineseTradEncoding.cpp index 4ddc78152..0731393b2 100644 --- a/Encodings/src/MacChineseTradEncoding.cpp +++ b/Encodings/src/MacChineseTradEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacChineseTradEncoding::_names[] = { "MacChineseTrad", - NULL + nullptr }; diff --git a/Encodings/src/MacCyrillicEncoding.cpp b/Encodings/src/MacCyrillicEncoding.cpp index b555ea80b..c2b84fade 100644 --- a/Encodings/src/MacCyrillicEncoding.cpp +++ b/Encodings/src/MacCyrillicEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacCyrillicEncoding::_names[] = { "MacCyrillic", - NULL + nullptr }; diff --git a/Encodings/src/MacJapaneseEncoding.cpp b/Encodings/src/MacJapaneseEncoding.cpp index 939417d97..08a202fc1 100644 --- a/Encodings/src/MacJapaneseEncoding.cpp +++ b/Encodings/src/MacJapaneseEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacJapaneseEncoding::_names[] = { "MacJapanese", - NULL + nullptr }; diff --git a/Encodings/src/MacKoreanEncoding.cpp b/Encodings/src/MacKoreanEncoding.cpp index dee366d39..c685f2562 100644 --- a/Encodings/src/MacKoreanEncoding.cpp +++ b/Encodings/src/MacKoreanEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacKoreanEncoding::_names[] = { "MacKorean", - NULL + nullptr }; diff --git a/Encodings/src/MacRomanEncoding.cpp b/Encodings/src/MacRomanEncoding.cpp index 5484833a1..349364e6c 100644 --- a/Encodings/src/MacRomanEncoding.cpp +++ b/Encodings/src/MacRomanEncoding.cpp @@ -21,7 +21,7 @@ namespace Poco { const char* MacRomanEncoding::_names[] = { "MacRoman", - NULL + nullptr }; diff --git a/Encodings/src/Windows1253Encoding.cpp b/Encodings/src/Windows1253Encoding.cpp index faef3459b..c9b7f9da4 100644 --- a/Encodings/src/Windows1253Encoding.cpp +++ b/Encodings/src/Windows1253Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows1253Encoding::_names[] = "Windows-1253", "cp1253", "CP1253", - NULL + nullptr }; diff --git a/Encodings/src/Windows1254Encoding.cpp b/Encodings/src/Windows1254Encoding.cpp index dd03c11ff..dd3e8c968 100644 --- a/Encodings/src/Windows1254Encoding.cpp +++ b/Encodings/src/Windows1254Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows1254Encoding::_names[] = "Windows-1254", "cp1254", "CP1254", - NULL + nullptr }; diff --git a/Encodings/src/Windows1255Encoding.cpp b/Encodings/src/Windows1255Encoding.cpp index b2ec9f85f..21502a6e9 100644 --- a/Encodings/src/Windows1255Encoding.cpp +++ b/Encodings/src/Windows1255Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows1255Encoding::_names[] = "Windows-1255", "cp1255", "CP1255", - NULL + nullptr }; diff --git a/Encodings/src/Windows1256Encoding.cpp b/Encodings/src/Windows1256Encoding.cpp index 29b6e9064..e68de15b0 100644 --- a/Encodings/src/Windows1256Encoding.cpp +++ b/Encodings/src/Windows1256Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows1256Encoding::_names[] = "Windows-1256", "cp1256", "CP1256", - NULL + nullptr }; diff --git a/Encodings/src/Windows1257Encoding.cpp b/Encodings/src/Windows1257Encoding.cpp index ab2650bc9..a16add185 100644 --- a/Encodings/src/Windows1257Encoding.cpp +++ b/Encodings/src/Windows1257Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows1257Encoding::_names[] = "Windows-1257", "cp1257", "CP1257", - NULL + nullptr }; diff --git a/Encodings/src/Windows1258Encoding.cpp b/Encodings/src/Windows1258Encoding.cpp index 765351f9f..42bb26b81 100644 --- a/Encodings/src/Windows1258Encoding.cpp +++ b/Encodings/src/Windows1258Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows1258Encoding::_names[] = "Windows-1258", "cp1258", "CP1258", - NULL + nullptr }; diff --git a/Encodings/src/Windows874Encoding.cpp b/Encodings/src/Windows874Encoding.cpp index 6dcd27c26..380f46b26 100644 --- a/Encodings/src/Windows874Encoding.cpp +++ b/Encodings/src/Windows874Encoding.cpp @@ -24,7 +24,7 @@ const char* Windows874Encoding::_names[] = "Windows-874", "cp874", "CP874", - NULL + nullptr }; diff --git a/Encodings/src/Windows932Encoding.cpp b/Encodings/src/Windows932Encoding.cpp index 993f0b65d..d8bdb599a 100644 --- a/Encodings/src/Windows932Encoding.cpp +++ b/Encodings/src/Windows932Encoding.cpp @@ -25,7 +25,7 @@ const char* Windows932Encoding::_names[] = "cp932", "CP932", "shift_jis", - NULL + nullptr }; diff --git a/Encodings/src/Windows936Encoding.cpp b/Encodings/src/Windows936Encoding.cpp index a11cce5ef..20e77c5c3 100644 --- a/Encodings/src/Windows936Encoding.cpp +++ b/Encodings/src/Windows936Encoding.cpp @@ -25,7 +25,7 @@ const char* Windows936Encoding::_names[] = "cp936", "CP936", "gb2312", - NULL + nullptr }; diff --git a/Encodings/src/Windows949Encoding.cpp b/Encodings/src/Windows949Encoding.cpp index c52935e82..1dec28dcd 100644 --- a/Encodings/src/Windows949Encoding.cpp +++ b/Encodings/src/Windows949Encoding.cpp @@ -25,7 +25,7 @@ const char* Windows949Encoding::_names[] = "cp949", "CP949", "ks_c_5601-1987", - NULL + nullptr }; diff --git a/Encodings/src/Windows950Encoding.cpp b/Encodings/src/Windows950Encoding.cpp index ee4964b3e..42e03ae5d 100644 --- a/Encodings/src/Windows950Encoding.cpp +++ b/Encodings/src/Windows950Encoding.cpp @@ -25,7 +25,7 @@ const char* Windows950Encoding::_names[] = "cp950", "CP950", "big5", - NULL + nullptr }; diff --git a/Foundation/include/Poco/AbstractCache.h b/Foundation/include/Poco/AbstractCache.h index 735ed9469..010c01f15 100644 --- a/Foundation/include/Poco/AbstractCache.h +++ b/Foundation/include/Poco/AbstractCache.h @@ -83,7 +83,7 @@ public: } void update(const TKey& key, const TValue& val) - /// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail! + /// Adds the key value pair to the cache. Note that adding a nullptr SharedPtr will fail! /// If for the key already an entry exists, it will be overwritten. /// The difference to add is that no remove or add events are thrown in this case, /// just a simply silent update is performed @@ -94,7 +94,7 @@ public: } void add(const TKey& key, SharedPtr val) - /// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail! + /// Adds the key value pair to the cache. Note that adding a nullptr SharedPtr will fail! /// If for the key already an entry exists, it will be overwritten, ie. first a remove event /// is thrown, then a add event { @@ -103,7 +103,7 @@ public: } void update(const TKey& key, SharedPtr val) - /// Adds the key value pair to the cache. Note that adding a NULL SharedPtr will fail! + /// Adds the key value pair to the cache. Note that adding a nullptr SharedPtr will fail! /// If for the key already an entry exists, it will be overwritten. /// The difference to add is that no remove or add events are thrown in this case, /// just an Update is thrown diff --git a/Foundation/include/Poco/AbstractEvent.h b/Foundation/include/Poco/AbstractEvent.h index 0a755a0f6..b3be3a7e7 100644 --- a/Foundation/include/Poco/AbstractEvent.h +++ b/Foundation/include/Poco/AbstractEvent.h @@ -346,7 +346,7 @@ protected: TStrategy _strategy; /// The strategy used to notify observers. bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect - /// but it is possible to change the observers. + /// but it is possible to change the observers. mutable TMutex _mutex; }; @@ -543,7 +543,7 @@ protected: TStrategy _strategy; /// The strategy used to notify observers. bool _enabled; /// Stores if an event is enabled. Notifies on disabled events have no effect - /// but it is possible to change the observers. + /// but it is possible to change the observers. mutable TMutex _mutex; }; diff --git a/Foundation/include/Poco/ActiveResult.h b/Foundation/include/Poco/ActiveResult.h index 15ee6612d..d296e9fda 100644 --- a/Foundation/include/Poco/ActiveResult.h +++ b/Foundation/include/Poco/ActiveResult.h @@ -39,7 +39,7 @@ class ActiveResultHolder: public RefCountedObject { public: ActiveResultHolder(): - _pData(0), + _pData(nullptr), _pExc(nullptr), _event(Event::EVENT_MANUALRESET) /// Creates an ActiveResultHolder. diff --git a/Foundation/include/Poco/AutoPtr.h b/Foundation/include/Poco/AutoPtr.h index 27f68a6b6..a48121a3e 100644 --- a/Foundation/include/Poco/AutoPtr.h +++ b/Foundation/include/Poco/AutoPtr.h @@ -191,7 +191,7 @@ public: template AutoPtr cast() const /// Casts the AutoPtr via a dynamic cast to the given type. - /// Returns an AutoPtr containing NULL if the cast fails. + /// Returns an AutoPtr containing nullptr if the cast fails. /// Example: (assume class Sub: public Super) /// AutoPtr super(new Sub()); /// AutoPtr sub = super.cast(); @@ -396,7 +396,7 @@ inline void swap(AutoPtr& p1, AutoPtr& p2) noexcept template AutoPtr makeAuto(Args&&... args) { - return AutoPtr(new T(std::forward(args)...)); + return AutoPtr(new T(std::forward(args)...)); } diff --git a/Foundation/include/Poco/Buffer.h b/Foundation/include/Poco/Buffer.h index 409d6754c..5e0cfbfde 100644 --- a/Foundation/include/Poco/Buffer.h +++ b/Foundation/include/Poco/Buffer.h @@ -54,7 +54,7 @@ public: Buffer(std::size_t length): _capacity(length), _used(length), - _ptr(0), + _ptr(nullptr), _ownMem(true) /// Creates and allocates the Buffer. { @@ -81,7 +81,7 @@ public: Buffer(const T* pMem, std::size_t length): _capacity(length), _used(length), - _ptr(0), + _ptr(nullptr), _ownMem(true) /// Creates and allocates the Buffer; copies the contents of /// the supplied memory into the buffer. Length argument specifies @@ -99,7 +99,7 @@ public: /// Copy constructor. _capacity(other._used), _used(other._used), - _ptr(0), + _ptr(nullptr), _ownMem(true) { if (_used) @@ -204,7 +204,7 @@ public: if (newCapacity != _capacity) { - T* ptr = 0; + T* ptr = nullptr; if (newCapacity > 0) { ptr = new T[newCapacity]; diff --git a/Foundation/include/Poco/Bugcheck.h b/Foundation/include/Poco/Bugcheck.h index 97e7703af..86cf78671 100644 --- a/Foundation/include/Poco/Bugcheck.h +++ b/Foundation/include/Poco/Bugcheck.h @@ -104,10 +104,10 @@ protected: #if defined(_DEBUG) #define poco_assert_dbg(cond) \ - if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0 + if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) nullptr #define poco_assert_msg_dbg(cond, text) \ - if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) 0 + if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) nullptr #else #define poco_assert_msg_dbg(cond, text) #define poco_assert_dbg(cond) @@ -115,15 +115,15 @@ protected: #define poco_assert(cond) \ - if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) 0 + if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__); else (void) nullptr #define poco_assert_msg(cond, text) \ - if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) 0 + if (!(cond)) Poco::Bugcheck::assertion(#cond, __FILE__, __LINE__, text); else (void) nullptr #define poco_check_ptr(ptr) \ - if (!(ptr)) Poco::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) 0 + if (!(ptr)) Poco::Bugcheck::nullPointer(#ptr, __FILE__, __LINE__); else (void) nullptr #define poco_bugcheck() \ diff --git a/Foundation/include/Poco/ByteOrder.h b/Foundation/include/Poco/ByteOrder.h index 93203d690..f02275bf0 100644 --- a/Foundation/include/Poco/ByteOrder.h +++ b/Foundation/include/Poco/ByteOrder.h @@ -182,7 +182,7 @@ inline UInt32 ByteOrder::flipBytes(UInt32 value) return __builtin_bswap32(value); #else return ((value >> 24) & 0x000000FF) | ((value >> 8) & 0x0000FF00) - | ((value << 8) & 0x00FF0000) | ((value << 24) & 0xFF000000); + | ((value << 8) & 0x00FF0000) | ((value << 24) & 0xFF000000); #endif } diff --git a/Foundation/include/Poco/ClassLoader.h b/Foundation/include/Poco/ClassLoader.h index 9188b8a9d..e2d26a7ec 100644 --- a/Foundation/include/Poco/ClassLoader.h +++ b/Foundation/include/Poco/ClassLoader.h @@ -152,8 +152,8 @@ public: if (it == _map.end()) { LibraryInfo li; - li.pLibrary = 0; - li.pManifest = 0; + li.pLibrary = nullptr; + li.pManifest = nullptr; li.refCount = 1; try { @@ -314,7 +314,7 @@ public: if (it != _map.end()) return it->second.pManifest; else - return 0; + return nullptr; } const Manif& manifestFor(const std::string& path) const @@ -332,7 +332,7 @@ public: /// Returns true if the library with the given name /// has already been loaded. { - return findManifest(path) != 0; + return findManifest(path) != nullptr; } Iterator begin() const diff --git a/Foundation/include/Poco/Delegate.h b/Foundation/include/Poco/Delegate.h index d489bd61c..507e6149c 100644 --- a/Foundation/include/Poco/Delegate.h +++ b/Foundation/include/Poco/Delegate.h @@ -86,7 +86,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _receiverObject = 0; + _receiverObject = nullptr; } protected: @@ -154,7 +154,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _receiverObject = 0; + _receiverObject = nullptr; } protected: @@ -292,7 +292,7 @@ public: void disable() override { Mutex::ScopedLock lock(_mutex); - _receiverObject = 0; + _receiverObject = nullptr; } protected: diff --git a/Foundation/include/Poco/Dynamic/VarHolder.h b/Foundation/include/Poco/Dynamic/VarHolder.h index a3684338c..44e7eccff 100644 --- a/Foundation/include/Poco/Dynamic/VarHolder.h +++ b/Foundation/include/Poco/Dynamic/VarHolder.h @@ -3468,7 +3468,7 @@ public: val = NumberFormatter::format(_val); } - VarHolder* clone(Placeholder* pVarHolder = 0) const override + VarHolder* clone(Placeholder* pVarHolder = nullptr) const override { return cloneHolder(pVarHolder, _val); } @@ -3604,7 +3604,7 @@ public: val = NumberFormatter::format(_val); } - VarHolder* clone(Placeholder* pVarHolder = 0) const override + VarHolder* clone(Placeholder* pVarHolder = nullptr) const override { return cloneHolder(pVarHolder, _val); } diff --git a/Foundation/include/Poco/FileStreamFactory.h b/Foundation/include/Poco/FileStreamFactory.h index d9fa91c33..0db90e8e6 100644 --- a/Foundation/include/Poco/FileStreamFactory.h +++ b/Foundation/include/Poco/FileStreamFactory.h @@ -39,13 +39,13 @@ public: ~FileStreamFactory() override; /// Destroys the FileStreamFactory. - std::istream *open(const URI &uri) override; - /// Creates and opens a file stream in binary mode for the given URI. - /// The URI must be either a file URI or a relative URI reference - /// containing a path to a local file. - /// - /// Throws an FileNotFound exception if the file cannot - /// be opened. + std::istream *open(const URI &uri) override; + /// Creates and opens a file stream in binary mode for the given URI. + /// The URI must be either a file URI or a relative URI reference + /// containing a path to a local file. + /// + /// Throws an FileNotFound exception if the file cannot + /// be opened. std::istream* open(const Path& path); /// Creates and opens a file stream in binary mode for the given path. diff --git a/Foundation/include/Poco/FunctionDelegate.h b/Foundation/include/Poco/FunctionDelegate.h index b54ad27dc..ba0bde70d 100644 --- a/Foundation/include/Poco/FunctionDelegate.h +++ b/Foundation/include/Poco/FunctionDelegate.h @@ -83,7 +83,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: @@ -147,7 +147,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: @@ -211,7 +211,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: diff --git a/Foundation/include/Poco/FunctionPriorityDelegate.h b/Foundation/include/Poco/FunctionPriorityDelegate.h index e801deb06..f03377f01 100644 --- a/Foundation/include/Poco/FunctionPriorityDelegate.h +++ b/Foundation/include/Poco/FunctionPriorityDelegate.h @@ -85,7 +85,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: @@ -151,7 +151,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: @@ -217,7 +217,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _function = 0; + _function = nullptr; } protected: diff --git a/Foundation/include/Poco/Hash.h b/Foundation/include/Poco/Hash.h index 99a9352dc..78cc3f672 100644 --- a/Foundation/include/Poco/Hash.h +++ b/Foundation/include/Poco/Hash.h @@ -116,22 +116,22 @@ namespace Impl { template inline void hashCombine(SizeT& seed, SizeT value) { - seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2); + seed ^= value + 0x9e3779b9 + (seed<<6) + (seed>>2); } inline void hashCombine(Poco::UInt32& h1, Poco::UInt32 k1) { - const uint32_t c1 = 0xcc9e2d51; - const uint32_t c2 = 0x1b873593; + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; - k1 *= c1; - k1 = POCO_HASH_ROTL32(k1,15); - k1 *= c2; + k1 *= c1; + k1 = POCO_HASH_ROTL32(k1,15); + k1 *= c2; - h1 ^= k1; - h1 = POCO_HASH_ROTL32(h1,13); - h1 = h1*5+0xe6546b64; + h1 ^= k1; + h1 = POCO_HASH_ROTL32(h1,13); + h1 = h1*5+0xe6546b64; } @@ -140,19 +140,19 @@ inline void hashCombine(Poco::UInt32& h1, Poco::UInt32 k1) inline void hashCombine(Poco::UInt64& h, Poco::UInt64 k) { - const Poco::UInt64 m = UINT64_C(0xc6a4a7935bd1e995); - const int r = 47; + const Poco::UInt64 m = UINT64_C(0xc6a4a7935bd1e995); + const int r = 47; - k *= m; - k ^= k >> r; - k *= m; + k *= m; + k ^= k >> r; + k *= m; - h ^= k; - h *= m; + h ^= k; + h *= m; - // Completely arbitrary number, to - // prevent zeros from hashing to 0. - h += 0xe6546b64; + // Completely arbitrary number, to + // prevent zeros from hashing to 0. + h += 0xe6546b64; } @@ -165,32 +165,32 @@ inline void hashCombine(Poco::UInt64& h, Poco::UInt64 k) template inline void hashCombine(std::size_t& seed, T const& v) { - Hash hasher; - Impl::hashCombine(seed, hasher(v)); + Hash hasher; + Impl::hashCombine(seed, hasher(v)); } template inline std::size_t hashRange(It first, It last) { - std::size_t seed = 0; + std::size_t seed = 0; - for(; first != last; ++first) - { - hashCombine::value_type>(seed, *first); - } + for(; first != last; ++first) + { + hashCombine::value_type>(seed, *first); + } - return seed; + return seed; } template inline void hashRange(std::size_t& seed, It first, It last) { - for(; first != last; ++first) - { - hashCombine::value_type>(seed, *first); - } + for(; first != last; ++first) + { + hashCombine::value_type>(seed, *first); + } } diff --git a/Foundation/include/Poco/MemoryPool.h b/Foundation/include/Poco/MemoryPool.h index 79cb4ff89..607f50105 100644 --- a/Foundation/include/Poco/MemoryPool.h +++ b/Foundation/include/Poco/MemoryPool.h @@ -302,7 +302,7 @@ public: Block* ret; { ScopedLock l(_mutex); - if(_firstBlock == 0) resize(); + if(_firstBlock == nullptr) resize(); ret = _firstBlock; _firstBlock = _firstBlock->_memory.next; } @@ -359,7 +359,7 @@ private: _buckets.push_back(new Block[_blocksPerBucket]); _firstBlock = _buckets.back(); // terminate last block - _firstBlock[_blocksPerBucket-1]._memory.next = 0; + _firstBlock[_blocksPerBucket-1]._memory.next = nullptr; _available = _available.value() + static_cast(_blocksPerBucket); } diff --git a/Foundation/include/Poco/MemoryStream.h b/Foundation/include/Poco/MemoryStream.h index 26eb11647..3d67aec37 100644 --- a/Foundation/include/Poco/MemoryStream.h +++ b/Foundation/include/Poco/MemoryStream.h @@ -82,7 +82,7 @@ public: if ((which & std::ios_base::in) != 0) { - if (this->gptr() == 0) + if (this->gptr() == nullptr) return fail; if (way == std::ios_base::beg) @@ -112,7 +112,7 @@ public: if ((which & std::ios_base::out) != 0) { - if (this->pptr() == 0) + if (this->pptr() == nullptr) return fail; if (way == std::ios_base::beg) diff --git a/Foundation/include/Poco/NumberFormatter.h b/Foundation/include/Poco/NumberFormatter.h index 1ce6a5126..79549f409 100644 --- a/Foundation/include/Poco/NumberFormatter.h +++ b/Foundation/include/Poco/NumberFormatter.h @@ -654,36 +654,36 @@ private: inline NumberFormatter::Options operator | (NumberFormatter::Options lhs, NumberFormatter::Options rhs) { - using T = std::underlying_type_t; - return static_cast(static_cast(lhs) | static_cast(rhs)); + using T = std::underlying_type_t; + return static_cast(static_cast(lhs) | static_cast(rhs)); } inline NumberFormatter::Options& operator |= (NumberFormatter::Options& lhs, NumberFormatter::Options rhs) { - lhs = lhs | rhs; - return lhs; + lhs = lhs | rhs; + return lhs; } inline NumberFormatter::Options operator & (NumberFormatter::Options lhs, NumberFormatter::Options rhs) { - using T = std::underlying_type_t; - return static_cast(static_cast(lhs) & static_cast(rhs)); + using T = std::underlying_type_t; + return static_cast(static_cast(lhs) & static_cast(rhs)); } inline NumberFormatter::Options& operator &= (NumberFormatter::Options& lhs, NumberFormatter::Options rhs) { - lhs = lhs & rhs; - return lhs; + lhs = lhs & rhs; + return lhs; } inline bool NumberFormatter::isEnabled(Options options, Options opt) { using T = std::underlying_type_t; - return static_cast(options & opt) != 0; + return static_cast(options & opt) != 0; } diff --git a/Foundation/include/Poco/NumericString.h b/Foundation/include/Poco/NumericString.h index 4b6643ed0..5c9a0f63b 100644 --- a/Foundation/include/Poco/NumericString.h +++ b/Foundation/include/Poco/NumericString.h @@ -624,7 +624,7 @@ Foundation_API void floatToFixedStr(char* buffer, int precision); /// Converts a float value to string. Converted string must be shorter than bufferSize. /// Computes a decimal representation with a fixed number of digits after the - /// decimal point. + /// decimal point. Foundation_API std::string& floatToStr(std::string& str, @@ -667,7 +667,7 @@ Foundation_API void doubleToFixedStr(char* buffer, int precision); /// Converts a double value to string. Converted string must be shorter than bufferSize. /// Computes a decimal representation with a fixed number of digits after the - /// decimal point. + /// decimal point. Foundation_API std::string& doubleToStr(std::string& str, diff --git a/Foundation/include/Poco/ObjectPool.h b/Foundation/include/Poco/ObjectPool.h index 06f9db081..cc10401a8 100644 --- a/Foundation/include/Poco/ObjectPool.h +++ b/Foundation/include/Poco/ObjectPool.h @@ -225,14 +225,14 @@ public: { if (timeoutMilliseconds == 0) { - return 0; + return nullptr; } while (_size >= _peakCapacity && _pool.empty()) { if (!_availableCondition.tryWait(_mutex, timeoutMilliseconds)) { // timeout - return 0; + return nullptr; } } } diff --git a/Foundation/include/Poco/Platform.h b/Foundation/include/Poco/Platform.h index 46fe214d0..9f1176f0d 100644 --- a/Foundation/include/Poco/Platform.h +++ b/Foundation/include/Poco/Platform.h @@ -170,7 +170,7 @@ #define POCO_ARCH POCO_ARCH_HPPA #define POCO_ARCH_BIG_ENDIAN 1 #elif defined(__PPC) || defined(__POWERPC__) || defined(__powerpc) || defined(__PPC__) || \ - defined(__powerpc__) || defined(__ppc__) || defined(__ppc) || defined(_ARCH_PPC) || defined(_M_PPC) + defined(__powerpc__) || defined(__ppc__) || defined(__ppc) || defined(_ARCH_PPC) || defined(_M_PPC) #define POCO_ARCH POCO_ARCH_PPC #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) #define POCO_ARCH_LITTLE_ENDIAN 1 @@ -178,7 +178,7 @@ #define POCO_ARCH_BIG_ENDIAN 1 #endif #elif defined(_POWER) || defined(_ARCH_PWR) || defined(_ARCH_PWR2) || defined(_ARCH_PWR3) || \ - defined(_ARCH_PWR4) || defined(__THW_RS6000) + defined(_ARCH_PWR4) || defined(__THW_RS6000) #define POCO_ARCH POCO_ARCH_POWER #define POCO_ARCH_BIG_ENDIAN 1 #elif defined(__sparc__) || defined(__sparc) || defined(sparc) diff --git a/Foundation/include/Poco/PriorityDelegate.h b/Foundation/include/Poco/PriorityDelegate.h index 8b6ba9abb..522894837 100644 --- a/Foundation/include/Poco/PriorityDelegate.h +++ b/Foundation/include/Poco/PriorityDelegate.h @@ -88,7 +88,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _receiverObject = 0; + _receiverObject = nullptr; } protected: @@ -158,7 +158,7 @@ public: void disable() { Mutex::ScopedLock lock(_mutex); - _receiverObject = 0; + _receiverObject = nullptr; } protected: @@ -228,7 +228,7 @@ public: void disable() override { Mutex::ScopedLock lock(_mutex); - _receiverObject = 0; + _receiverObject = nullptr; } protected: diff --git a/Foundation/include/Poco/Process.h b/Foundation/include/Poco/Process.h index 5118b2744..216357350 100644 --- a/Foundation/include/Poco/Process.h +++ b/Foundation/include/Poco/Process.h @@ -63,9 +63,9 @@ public: /// and returns the exit code of the process. int tryWait() const; - /// Checks that process is terminated - /// and returns the exit code of the process. - /// If the process is still running, returns -1. + /// Checks that process is terminated + /// and returns the exit code of the process. + /// If the process is still running, returns -1. protected: ProcessHandle(ProcessHandleImpl* pImpl); @@ -222,8 +222,8 @@ public: /// and returns the exit code of the process. static int tryWait(const ProcessHandle& handle); - /// Checks that process is finished and returns the exit code of the - /// process. If the process is still running, returns -1. + /// Checks that process is finished and returns the exit code of the + /// process. If the process is still running, returns -1. static bool isRunning(const ProcessHandle& handle); /// check if the process specified by handle is running or not diff --git a/Foundation/include/Poco/RecursiveDirectoryIterator.h b/Foundation/include/Poco/RecursiveDirectoryIterator.h index 5adb62700..2ec144688 100644 --- a/Foundation/include/Poco/RecursiveDirectoryIterator.h +++ b/Foundation/include/Poco/RecursiveDirectoryIterator.h @@ -69,7 +69,7 @@ public: RecursiveDirectoryIterator() /// Creates the end iterator. - : _pImpl(0) + : _pImpl(nullptr) { } diff --git a/Foundation/include/Poco/RegularExpression.h b/Foundation/include/Poco/RegularExpression.h index 6597a249f..81e410ef2 100644 --- a/Foundation/include/Poco/RegularExpression.h +++ b/Foundation/include/Poco/RegularExpression.h @@ -62,8 +62,8 @@ public: RE_NO_AUTO_CAPTURE = 0x00001000, /// disable numbered capturing parentheses [ctor, match] RE_NO_UTF8_CHECK = 0x00002000, /// do not check validity of UTF-8 code sequences [match] RE_FIRSTLINE = 0x00040000, /// an unanchored pattern is required to match - /// before or at the first newline in the subject string, - /// though the matched text may continue over the newline [ctor] + /// before or at the first newline in the subject string, + /// though the matched text may continue over the newline [ctor] RE_DUPNAMES = 0x00080000, /// names used to identify capturing subpatterns need not be unique [ctor] RE_NEWLINE_CR = 0x00100000, /// assume newline is CR ('\r'), the default [ctor] RE_NEWLINE_LF = 0x00200000, /// assume newline is LF ('\n') [ctor] diff --git a/Foundation/include/Poco/Semaphore_WIN32.h b/Foundation/include/Poco/Semaphore_WIN32.h index 97515c5b8..778b03d29 100644 --- a/Foundation/include/Poco/Semaphore_WIN32.h +++ b/Foundation/include/Poco/Semaphore_WIN32.h @@ -45,7 +45,7 @@ private: // inline void SemaphoreImpl::setImpl() { - if (!ReleaseSemaphore(_sema, 1, NULL)) + if (!ReleaseSemaphore(_sema, 1, nullptr)) { throw SystemException("cannot signal semaphore"); } diff --git a/Foundation/include/Poco/SharedMemory.h b/Foundation/include/Poco/SharedMemory.h index 051fe89aa..5068e10c1 100644 --- a/Foundation/include/Poco/SharedMemory.h +++ b/Foundation/include/Poco/SharedMemory.h @@ -86,11 +86,11 @@ public: char* begin() const; /// Returns the start address of the shared memory segment. - /// Will be NULL for illegal segments. + /// Will be nullptr for illegal segments. char* end() const; /// Returns the one-past-end end address of the shared memory segment. - /// Will be NULL for illegal segments. + /// Will be nullptr for illegal segments. private: SharedMemoryImpl* _pImpl; diff --git a/Foundation/include/Poco/SharedPtr.h b/Foundation/include/Poco/SharedPtr.h index a2240656f..c4337d030 100644 --- a/Foundation/include/Poco/SharedPtr.h +++ b/Foundation/include/Poco/SharedPtr.h @@ -248,7 +248,7 @@ public: template SharedPtr cast() const /// Casts the SharedPtr via a dynamic cast to the given type. - /// Returns an SharedPtr containing NULL if the cast fails. + /// Returns an SharedPtr containing nullptr if the cast fails. /// Example: (assume class Sub: public Super) /// SharedPtr super(new Sub()); /// SharedPtr sub = super.cast(); diff --git a/Foundation/include/Poco/SingletonHolder.h b/Foundation/include/Poco/SingletonHolder.h index 3f0b997b5..d7211bbea 100644 --- a/Foundation/include/Poco/SingletonHolder.h +++ b/Foundation/include/Poco/SingletonHolder.h @@ -35,7 +35,7 @@ class SingletonHolder { public: SingletonHolder(): - _pS(0) + _pS(nullptr) /// Creates the SingletonHolder. { } diff --git a/Foundation/include/Poco/StreamTokenizer.h b/Foundation/include/Poco/StreamTokenizer.h index 36afb1625..63567fa7d 100644 --- a/Foundation/include/Poco/StreamTokenizer.h +++ b/Foundation/include/Poco/StreamTokenizer.h @@ -72,7 +72,7 @@ public: /// If a token is marked as ignorable, it will not /// be returned, and the next token will be /// examined. - /// Never returns a NULL pointer. + /// Never returns a nullptr pointer. /// You must not delete the token returned by next(). private: diff --git a/Foundation/include/Poco/StreamUtil.h b/Foundation/include/Poco/StreamUtil.h index a77b0e630..80c6a681f 100644 --- a/Foundation/include/Poco/StreamUtil.h +++ b/Foundation/include/Poco/StreamUtil.h @@ -75,7 +75,7 @@ // Microsoft Visual Studio with Dinkumware STL (but not STLport) # if defined(_MSC_VER) && (!defined(_STLP_MSVC) || defined(_STLP_NO_OWN_IOSTREAMS)) # define POCO_IOS_INIT_HACK 1 - // QNX with Dinkumware but not GNU C++ Library + // QNX with Dinkumware but not GNU C++ Library # elif defined(__QNX__) && !defined(__GLIBCPP__) # define POCO_IOS_INIT_HACK 1 // Linux with Clang libc++ diff --git a/Foundation/include/Poco/Task.h b/Foundation/include/Poco/Task.h index 600736e95..7f87344ab 100644 --- a/Foundation/include/Poco/Task.h +++ b/Foundation/include/Poco/Task.h @@ -139,7 +139,7 @@ protected: /// Sets the (optional) owner of the task. TaskManager* getOwner() const; - /// Returns the owner of the task, which may be NULL. + /// Returns the owner of the task, which may be nullptr. TaskState setState(TaskState state); /// Sets the task's state. diff --git a/Foundation/include/Poco/TextEncoding.h b/Foundation/include/Poco/TextEncoding.h index 203187afd..b3236a40a 100644 --- a/Foundation/include/Poco/TextEncoding.h +++ b/Foundation/include/Poco/TextEncoding.h @@ -141,7 +141,7 @@ public: static TextEncoding::Ptr find(const std::string& encodingName); /// Returns a pointer to the TextEncoding object for the given encodingName, - /// or NULL if no such TextEncoding object exists. + /// or nullptr if no such TextEncoding object exists. static void add(TextEncoding::Ptr encoding); /// Adds the given TextEncoding to the table of text encodings, diff --git a/Foundation/include/Poco/Token.h b/Foundation/include/Poco/Token.h index b3488c9e5..08d6893e6 100644 --- a/Foundation/include/Poco/Token.h +++ b/Foundation/include/Poco/Token.h @@ -85,10 +85,10 @@ public: #if defined(POCO_HAVE_INT64) virtual Int64 asInteger64() const; - /// Returns a 64-bit integer representation of the token. + /// Returns a 64-bit integer representation of the token. virtual UInt64 asUnsignedInteger64() const; - /// Returns an unsigned 64-bit integer representation of the token. + /// Returns an unsigned 64-bit integer representation of the token. #endif virtual int asInteger() const; diff --git a/Foundation/include/Poco/UnbufferedStreamBuf.h b/Foundation/include/Poco/UnbufferedStreamBuf.h index e94eb5b70..c9686c917 100644 --- a/Foundation/include/Poco/UnbufferedStreamBuf.h +++ b/Foundation/include/Poco/UnbufferedStreamBuf.h @@ -51,8 +51,8 @@ public: _pb(char_traits::eof()), _ispb(false) { - this->setg(0, 0, 0); - this->setp(0, 0); + this->setg(nullptr, nullptr, nullptr); + this->setp(nullptr, nullptr); } ~BasicUnbufferedStreamBuf() override = default; diff --git a/Foundation/include/Poco/UnicodeConverter.h b/Foundation/include/Poco/UnicodeConverter.h index 54cda407d..ea3ecb1fd 100644 --- a/Foundation/include/Poco/UnicodeConverter.h +++ b/Foundation/include/Poco/UnicodeConverter.h @@ -127,7 +127,7 @@ public: static std::size_t UTFStrlen(const T* ptr) /// Returns the length (in characters) of a zero-terminated UTF string. { - if (ptr == 0) return 0; + if (ptr == nullptr) return 0; const T* p; for (p = ptr; *p; ++p); return p - ptr; diff --git a/Foundation/include/Poco/ordered_hash.h b/Foundation/include/Poco/ordered_hash.h index 560de7991..54bc305bd 100644 --- a/Foundation/include/Poco/ordered_hash.h +++ b/Foundation/include/Poco/ordered_hash.h @@ -46,15 +46,15 @@ * Macros for compatibility with GCC 4.8 */ #ifndef TSL_NO_CONTAINER_ERASE_CONST_ITERATOR - #if (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 9)) - #define TSL_NO_CONTAINER_ERASE_CONST_ITERATOR - #endif + #if (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 9)) + #define TSL_NO_CONTAINER_ERASE_CONST_ITERATOR + #endif #endif #ifndef TSL_NO_CONTAINER_EMPLACE_CONST_ITERATOR - #if (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 9)) - #define TSL_NO_CONTAINER_EMPLACE_CONST_ITERATOR - #endif + #if (defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ < 9)) + #define TSL_NO_CONTAINER_EMPLACE_CONST_ITERATOR + #endif #endif @@ -64,11 +64,11 @@ * (people usually compile with "-O3" and not "-O3 -DNDEBUG"). */ #ifndef tsl_assert - #ifdef TSL_DEBUG - #define tsl_assert(expr) assert(expr) - #else - #define tsl_assert(expr) (static_cast(0)) - #endif + #ifdef TSL_DEBUG + #define tsl_assert(expr) assert(expr) + #else + #define tsl_assert(expr) (static_cast(0)) + #endif #endif @@ -78,7 +78,7 @@ namespace detail_ordered_hash { template struct make_void { - using type = void; + using type = void; }; template @@ -96,8 +96,8 @@ struct is_vector: std::false_type { template struct is_vector>::value - >::type>: std::true_type { + std::is_same>::value + >::type>: std::true_type { }; @@ -110,67 +110,67 @@ struct is_vector::max() - NB_RESERVED_INDEXES; - } + static std::size_t max_size() noexcept { + return std::numeric_limits::max() - NB_RESERVED_INDEXES; + } private: - static const index_type EMPTY_MARKER_INDEX = std::numeric_limits::max(); - static const std::size_t NB_RESERVED_INDEXES = 1; + static const index_type EMPTY_MARKER_INDEX = std::numeric_limits::max(); + static const std::size_t NB_RESERVED_INDEXES = 1; - index_type m_index; - truncated_hash_type m_hash; + index_type m_index; + truncated_hash_type m_hash; }; @@ -201,1081 +201,1081 @@ private: * backward shift deletion. */ template + class KeySelect, + class ValueSelect, + class Hash, + class KeyEqual, + class Allocator, + class ValueTypeContainer> class ordered_hash: private Hash, private KeyEqual { private: - template - using has_mapped_type = typename std::integral_constant::value>; + template + using has_mapped_type = typename std::integral_constant::value>; - static_assert(std::is_same::value, - "ValueTypeContainer::value_type != ValueType."); - static_assert(std::is_same::value, - "ValueTypeContainer::allocator_type != Allocator."); + static_assert(std::is_same::value, + "ValueTypeContainer::value_type != ValueType."); + static_assert(std::is_same::value, + "ValueTypeContainer::allocator_type != Allocator."); public: - template - class ordered_iterator; + template + class ordered_iterator; - using key_type = typename KeySelect::key_type; - using value_type = ValueType; - using size_type = std::size_t; - using difference_type = std::ptrdiff_t; - using hasher = Hash; - using key_equal = KeyEqual; - using allocator_type = Allocator; - using reference = value_type&; - using const_reference = const value_type&; - using pointer = value_type*; - using const_pointer = const value_type*; - using iterator = ordered_iterator; - using const_iterator = ordered_iterator; - using reverse_iterator = std::reverse_iterator; - using const_reverse_iterator = std::reverse_iterator; + using key_type = typename KeySelect::key_type; + using value_type = ValueType; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using hasher = Hash; + using key_equal = KeyEqual; + using allocator_type = Allocator; + using reference = value_type&; + using const_reference = const value_type&; + using pointer = value_type*; + using const_pointer = const value_type*; + using iterator = ordered_iterator; + using const_iterator = ordered_iterator; + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; - using values_container_type = ValueTypeContainer; + using values_container_type = ValueTypeContainer; public: - template - class ordered_iterator { - friend class ordered_hash; + template + class ordered_iterator { + friend class ordered_hash; - private: - using iterator = typename std::conditional::type; + private: + using iterator = typename std::conditional::type; - ordered_iterator(iterator it) noexcept: m_iterator(it) { - } + ordered_iterator(iterator it) noexcept: m_iterator(it) { + } - public: - using iterator_category = std::random_access_iterator_tag; - using value_type = const typename ordered_hash::value_type; - using difference_type = typename iterator::difference_type; - using reference = value_type&; - using pointer = value_type*; + public: + using iterator_category = std::random_access_iterator_tag; + using value_type = const typename ordered_hash::value_type; + using difference_type = typename iterator::difference_type; + using reference = value_type&; + using pointer = value_type*; - ordered_iterator() noexcept { - } + ordered_iterator() noexcept { + } - ordered_iterator(const ordered_iterator& other) noexcept: m_iterator(other.m_iterator) { - } + ordered_iterator(const ordered_iterator& other) noexcept: m_iterator(other.m_iterator) { + } - const typename ordered_hash::key_type& key() const { - return KeySelect()(*m_iterator); - } + const typename ordered_hash::key_type& key() const { + return KeySelect()(*m_iterator); + } - template::value && IsConst>::type* = nullptr> - const typename U::value_type& value() const { - return U()(*m_iterator); - } + template::value && IsConst>::type* = nullptr> + const typename U::value_type& value() const { + return U()(*m_iterator); + } - template::value && !IsConst>::type* = nullptr> - typename U::value_type& value() { - return U()(*m_iterator); - } + template::value && !IsConst>::type* = nullptr> + typename U::value_type& value() { + return U()(*m_iterator); + } - reference operator*() const { return *m_iterator; } - pointer operator->() const { return m_iterator.operator->(); } + reference operator*() const { return *m_iterator; } + pointer operator->() const { return m_iterator.operator->(); } - ordered_iterator& operator++() { ++m_iterator; return *this; } - ordered_iterator& operator--() { --m_iterator; return *this; } + ordered_iterator& operator++() { ++m_iterator; return *this; } + ordered_iterator& operator--() { --m_iterator; return *this; } - ordered_iterator operator++(int) { ordered_iterator tmp(*this); ++(*this); return tmp; } - ordered_iterator operator--(int) { ordered_iterator tmp(*this); --(*this); return tmp; } + ordered_iterator operator++(int) { ordered_iterator tmp(*this); ++(*this); return tmp; } + ordered_iterator operator--(int) { ordered_iterator tmp(*this); --(*this); return tmp; } - reference operator[](difference_type n) const { return m_iterator[n]; } + reference operator[](difference_type n) const { return m_iterator[n]; } - ordered_iterator& operator+=(difference_type n) { m_iterator += n; return *this; } - ordered_iterator& operator-=(difference_type n) { m_iterator -= n; return *this; } + ordered_iterator& operator+=(difference_type n) { m_iterator += n; return *this; } + ordered_iterator& operator-=(difference_type n) { m_iterator -= n; return *this; } - ordered_iterator operator+(difference_type n) { ordered_iterator tmp(*this); tmp += n; return tmp; } - ordered_iterator operator-(difference_type n) { ordered_iterator tmp(*this); tmp -= n; return tmp; } + ordered_iterator operator+(difference_type n) { ordered_iterator tmp(*this); tmp += n; return tmp; } + ordered_iterator operator-(difference_type n) { ordered_iterator tmp(*this); tmp -= n; return tmp; } - friend bool operator==(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator == rhs.m_iterator; - } + friend bool operator==(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator == rhs.m_iterator; + } - friend bool operator!=(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator != rhs.m_iterator; - } + friend bool operator!=(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator != rhs.m_iterator; + } - friend bool operator<(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator < rhs.m_iterator; - } + friend bool operator<(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator < rhs.m_iterator; + } - friend bool operator>(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator > rhs.m_iterator; - } + friend bool operator>(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator > rhs.m_iterator; + } - friend bool operator<=(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator <= rhs.m_iterator; - } + friend bool operator<=(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator <= rhs.m_iterator; + } - friend bool operator>=(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator >= rhs.m_iterator; - } + friend bool operator>=(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator >= rhs.m_iterator; + } - friend ordered_iterator operator+(difference_type n, const ordered_iterator& it) { - return n + it.m_iterator; - } + friend ordered_iterator operator+(difference_type n, const ordered_iterator& it) { + return n + it.m_iterator; + } - friend difference_type operator-(const ordered_iterator& lhs, const ordered_iterator& rhs) { - return lhs.m_iterator - rhs.m_iterator; - } + friend difference_type operator-(const ordered_iterator& lhs, const ordered_iterator& rhs) { + return lhs.m_iterator - rhs.m_iterator; + } - private: - iterator m_iterator; - }; + private: + iterator m_iterator; + }; private: - using buckets_container_allocator = typename - std::allocator_traits::template rebind_alloc; + using buckets_container_allocator = typename + std::allocator_traits::template rebind_alloc; - using buckets_container_type = std::vector; + using buckets_container_type = std::vector; - using truncated_hash_type = typename bucket_entry::truncated_hash_type; - using index_type = typename bucket_entry::index_type; + using truncated_hash_type = typename bucket_entry::truncated_hash_type; + using index_type = typename bucket_entry::index_type; public: - ordered_hash(size_type bucket_count, - const Hash& hash, - const KeyEqual& equal, - const Allocator& alloc, - float max_load_factor): Hash(hash), KeyEqual(equal), m_buckets(alloc), - m_values(alloc), m_grow_on_next_insert(false) - { - bucket_count = round_up_to_power_of_two(bucket_count); - if(bucket_count > max_bucket_count()) { - throw std::length_error("The map exceeds its maxmimum size."); - } - tsl_assert(bucket_count > 0); + ordered_hash(size_type bucket_count, + const Hash& hash, + const KeyEqual& equal, + const Allocator& alloc, + float max_load_factor): Hash(hash), KeyEqual(equal), m_buckets(alloc), + m_values(alloc), m_grow_on_next_insert(false) + { + bucket_count = round_up_to_power_of_two(bucket_count); + if(bucket_count > max_bucket_count()) { + throw std::length_error("The map exceeds its maxmimum size."); + } + tsl_assert(bucket_count > 0); - m_buckets.resize(bucket_count); - m_mask = bucket_count - 1; + m_buckets.resize(bucket_count); + m_mask = bucket_count - 1; - this->max_load_factor(max_load_factor); - } + this->max_load_factor(max_load_factor); + } - allocator_type get_allocator() const { - return m_values.get_allocator(); - } + allocator_type get_allocator() const { + return m_values.get_allocator(); + } - /* - * Iterators - */ - iterator begin() noexcept { - return iterator(m_values.begin()); - } + /* + * Iterators + */ + iterator begin() noexcept { + return iterator(m_values.begin()); + } - const_iterator begin() const noexcept { - return cbegin(); - } + const_iterator begin() const noexcept { + return cbegin(); + } - const_iterator cbegin() const noexcept { - return const_iterator(m_values.cbegin()); - } + const_iterator cbegin() const noexcept { + return const_iterator(m_values.cbegin()); + } - iterator end() noexcept { - return iterator(m_values.end()); - } + iterator end() noexcept { + return iterator(m_values.end()); + } - const_iterator end() const noexcept { - return cend(); - } + const_iterator end() const noexcept { + return cend(); + } - const_iterator cend() const noexcept { - return const_iterator(m_values.cend()); - } + const_iterator cend() const noexcept { + return const_iterator(m_values.cend()); + } - reverse_iterator rbegin() noexcept { - return reverse_iterator(m_values.end()); - } + reverse_iterator rbegin() noexcept { + return reverse_iterator(m_values.end()); + } - const_reverse_iterator rbegin() const noexcept { - return rcbegin(); - } + const_reverse_iterator rbegin() const noexcept { + return rcbegin(); + } - const_reverse_iterator rcbegin() const noexcept { - return const_reverse_iterator(m_values.cend()); - } + const_reverse_iterator rcbegin() const noexcept { + return const_reverse_iterator(m_values.cend()); + } - reverse_iterator rend() noexcept { - return reverse_iterator(m_values.begin()); - } + reverse_iterator rend() noexcept { + return reverse_iterator(m_values.begin()); + } - const_reverse_iterator rend() const noexcept { - return rcend(); - } + const_reverse_iterator rend() const noexcept { + return rcend(); + } - const_reverse_iterator rcend() const noexcept { - return const_reverse_iterator(m_values.cbegin()); - } + const_reverse_iterator rcend() const noexcept { + return const_reverse_iterator(m_values.cbegin()); + } - /* - * Capacity - */ - bool empty() const noexcept { - return m_values.empty(); - } + /* + * Capacity + */ + bool empty() const noexcept { + return m_values.empty(); + } - size_type size() const noexcept { - return m_values.size(); - } + size_type size() const noexcept { + return m_values.size(); + } - size_type max_size() const noexcept { - return std::min(bucket_entry::max_size(), m_values.max_size()); - } + size_type max_size() const noexcept { + return std::min(bucket_entry::max_size(), m_values.max_size()); + } - /* - * Modifiers - */ - void clear() noexcept { - for(auto& bucket: m_buckets) { - bucket.clear(); - } + /* + * Modifiers + */ + void clear() noexcept { + for(auto& bucket: m_buckets) { + bucket.clear(); + } - m_values.clear(); - m_grow_on_next_insert = false; - } + m_values.clear(); + m_grow_on_next_insert = false; + } - template - std::pair insert(P&& value) { - return insert_impl(KeySelect()(value), std::forward

(value)); - } + template + std::pair insert(P&& value) { + return insert_impl(KeySelect()(value), std::forward

(value)); + } - template - iterator insert(const_iterator hint, P&& value) { - if(hint != cend() && compare_keys(KeySelect()(*hint), KeySelect()(value))) { - return mutable_iterator(hint); - } + template + iterator insert(const_iterator hint, P&& value) { + if(hint != cend() && compare_keys(KeySelect()(*hint), KeySelect()(value))) { + return mutable_iterator(hint); + } - return insert(std::forward

(value)).first; - } + return insert(std::forward

(value)).first; + } - template - void insert(InputIt first, InputIt last) { - if(std::is_base_of::iterator_category>::value) - { - const auto nb_elements_insert = std::distance(first, last); - const size_type nb_free_buckets = m_load_threshold - size(); - tsl_assert(m_load_threshold >= size()); + template + void insert(InputIt first, InputIt last) { + if(std::is_base_of::iterator_category>::value) + { + const auto nb_elements_insert = std::distance(first, last); + const size_type nb_free_buckets = m_load_threshold - size(); + tsl_assert(m_load_threshold >= size()); - if(nb_elements_insert > 0 && nb_free_buckets < size_type(nb_elements_insert)) { - reserve(size() + size_type(nb_elements_insert)); - } - } + if(nb_elements_insert > 0 && nb_free_buckets < size_type(nb_elements_insert)) { + reserve(size() + size_type(nb_elements_insert)); + } + } - for(; first != last; ++first) { - insert(*first); - } - } + for(; first != last; ++first) { + insert(*first); + } + } - template - std::pair insert_or_assign(K&& key, M&& value) { - auto it = try_emplace(std::forward(key), std::forward(value)); - if(!it.second) { - it.first.value() = std::forward(value); - } + template + std::pair insert_or_assign(K&& key, M&& value) { + auto it = try_emplace(std::forward(key), std::forward(value)); + if(!it.second) { + it.first.value() = std::forward(value); + } - return it; - } + return it; + } - template - iterator insert_or_assign(const_iterator hint, K&& key, M&& obj) { - if(hint != cend() && compare_keys(KeySelect()(*hint), key)) { - auto it = mutable_iterator(hint); - it.value() = std::forward(obj); + template + iterator insert_or_assign(const_iterator hint, K&& key, M&& obj) { + if(hint != cend() && compare_keys(KeySelect()(*hint), key)) { + auto it = mutable_iterator(hint); + it.value() = std::forward(obj); - return it; - } + return it; + } - return insert_or_assign(std::forward(key), std::forward(obj)).first; - } + return insert_or_assign(std::forward(key), std::forward(obj)).first; + } - template - std::pair emplace(Args&&... args) { - return insert(value_type(std::forward(args)...)); - } + template + std::pair emplace(Args&&... args) { + return insert(value_type(std::forward(args)...)); + } - template - iterator emplace_hint(const_iterator hint, Args&&... args) { - return insert(hint, value_type(std::forward(args)...)); - } + template + iterator emplace_hint(const_iterator hint, Args&&... args) { + return insert(hint, value_type(std::forward(args)...)); + } - template - std::pair try_emplace(K&& key, Args&&... value_args) { - return insert_impl(key, std::piecewise_construct, - std::forward_as_tuple(std::forward(key)), - std::forward_as_tuple(std::forward(value_args)...)); - } + template + std::pair try_emplace(K&& key, Args&&... value_args) { + return insert_impl(key, std::piecewise_construct, + std::forward_as_tuple(std::forward(key)), + std::forward_as_tuple(std::forward(value_args)...)); + } - template - iterator try_emplace(const_iterator hint, K&& key, Args&&... args) { - if(hint != cend() && compare_keys(KeySelect()(*hint), key)) { - return mutable_iterator(hint); - } + template + iterator try_emplace(const_iterator hint, K&& key, Args&&... args) { + if(hint != cend() && compare_keys(KeySelect()(*hint), key)) { + return mutable_iterator(hint); + } - return try_emplace(std::forward(key), std::forward(args)...).first; - } + return try_emplace(std::forward(key), std::forward(args)...).first; + } - /** - * Here to avoid `template size_type erase(const K& key)` being used when - * we use a iterator instead of a const_iterator. - */ - iterator erase(iterator pos) { - return erase(const_iterator(pos)); - } + /** + * Here to avoid `template size_type erase(const K& key)` being used when + * we use a iterator instead of a const_iterator. + */ + iterator erase(iterator pos) { + return erase(const_iterator(pos)); + } - iterator erase(const_iterator pos) { - tsl_assert(pos != cend()); + iterator erase(const_iterator pos) { + tsl_assert(pos != cend()); - const std::size_t index_erase = iterator_to_index(pos); + const std::size_t index_erase = iterator_to_index(pos); - auto it_bucket = find_key(pos.key(), hash_key(pos.key())); - tsl_assert(it_bucket != m_buckets.end()); + auto it_bucket = find_key(pos.key(), hash_key(pos.key())); + tsl_assert(it_bucket != m_buckets.end()); - erase_value_from_bucket(it_bucket); + erase_value_from_bucket(it_bucket); - /* - * One element was removed from m_values, due to the left shift the next element - * is now at the position of the previous element (or end if none). - */ - return begin() + index_erase; - } + /* + * One element was removed from m_values, due to the left shift the next element + * is now at the position of the previous element (or end if none). + */ + return begin() + index_erase; + } - iterator erase(const_iterator first, const_iterator last) { - if(first == last) { - return mutable_iterator(first); - } + iterator erase(const_iterator first, const_iterator last) { + if(first == last) { + return mutable_iterator(first); + } - tsl_assert(std::distance(first, last) > 0); - const std::size_t start_index = iterator_to_index(first); - const std::size_t nb_values = std::size_t(std::distance(first, last)); - const std::size_t end_index = start_index + nb_values; + tsl_assert(std::distance(first, last) > 0); + const std::size_t start_index = iterator_to_index(first); + const std::size_t nb_values = std::size_t(std::distance(first, last)); + const std::size_t end_index = start_index + nb_values; - // Delete all values + // Delete all values #ifdef TSL_NO_CONTAINER_ERASE_CONST_ITERATOR - auto next_it = m_values.erase(mutable_iterator(first).m_iterator, mutable_iterator(last).m_iterator); + auto next_it = m_values.erase(mutable_iterator(first).m_iterator, mutable_iterator(last).m_iterator); #else - auto next_it = m_values.erase(first.m_iterator, last.m_iterator); + auto next_it = m_values.erase(first.m_iterator, last.m_iterator); #endif - /* - * Mark the buckets corresponding to the values as empty and do a backward shift. - * - * Also, the erase operation on m_values has shifted all the values on the right of last.m_iterator. - * Adapt the indexes for these values. - */ - std::size_t ibucket = 0; - while(ibucket < m_buckets.size()) { - if(m_buckets[ibucket].empty()) { - ibucket++; - } - else if(m_buckets[ibucket].index() >= start_index && m_buckets[ibucket].index() < end_index) { - m_buckets[ibucket].clear(); - backward_shift(ibucket); - // Don't increment ibucket, backward_shift may have replaced current bucket. - } - else if(m_buckets[ibucket].index() >= end_index) { - m_buckets[ibucket].set_index(index_type(m_buckets[ibucket].index() - nb_values)); - ibucket++; - } - else { - ibucket++; - } - } - - return iterator(next_it); - } - - - template - size_type erase(const K& key) { - return erase(key, hash_key(key)); - } - - template - size_type erase(const K& key, std::size_t hash) { - return erase_impl(key, hash); - } - - void swap(ordered_hash& other) noexcept { - using std::swap; - - swap(static_cast(*this), static_cast(other)); - swap(static_cast(*this), static_cast(other)); - swap(m_buckets, other.m_buckets); - swap(m_mask, other.m_mask); - swap(m_values, other.m_values); - swap(m_grow_on_next_insert, other.m_grow_on_next_insert); - swap(m_max_load_factor, other.m_max_load_factor); - swap(m_load_threshold, other.m_load_threshold); - } - - - - - /* - * Lookup - */ - template::value>::type* = nullptr> - typename U::value_type& at(const K& key) { - return at(key, hash_key(key)); - } - - template::value>::type* = nullptr> - typename U::value_type& at(const K& key, std::size_t hash) { - return const_cast(static_cast(this)->at(key, hash)); - } - - template::value>::type* = nullptr> - const typename U::value_type& at(const K& key) const { - return at(key, hash_key(key)); - } - - template::value>::type* = nullptr> - const typename U::value_type& at(const K& key, std::size_t hash) const { - auto it = find(key, hash); - if(it != end()) { - return it.value(); - } - else { - throw std::out_of_range("Couldn't find the key."); - } - } - - - template::value>::type* = nullptr> - typename U::value_type& operator[](K&& key) { - return try_emplace(std::forward(key)).first.value(); - } - - - template - size_type count(const K& key) const { - return count(key, hash_key(key)); - } - - template - size_type count(const K& key, std::size_t hash) const { - if(find(key, hash) == cend()) { - return 0; - } - else { - return 1; - } - } - - template - iterator find(const K& key) { - return find(key, hash_key(key)); - } - - template - iterator find(const K& key, std::size_t hash) { - auto it_bucket = find_key(key, hash); - return (it_bucket != m_buckets.end())?iterator(m_values.begin() + it_bucket->index()):end(); - } - - template - const_iterator find(const K& key) const { - return find(key, hash_key(key)); - } - - template - const_iterator find(const K& key, std::size_t hash) const { - auto it_bucket = find_key(key, hash); - return (it_bucket != m_buckets.cend())?const_iterator(m_values.begin() + it_bucket->index()):end(); - } - - - template - std::pair equal_range(const K& key) { - return equal_range(key, hash_key(key)); - } - - template - std::pair equal_range(const K& key, std::size_t hash) { - iterator it = find(key, hash); - return std::make_pair(it, (it == end())?it:std::next(it)); - } - - template - std::pair equal_range(const K& key) const { - return equal_range(key, hash_key(key)); - } - - template - std::pair equal_range(const K& key, std::size_t hash) const { - const_iterator it = find(key, hash); - return std::make_pair(it, (it == cend())?it:std::next(it)); - } - - - /* - * Bucket interface - */ - size_type bucket_count() const { - return m_buckets.size(); - } - - size_type max_bucket_count() const { - return m_buckets.max_size(); - } - - /* - * Hash policy - */ - float load_factor() const { - return float(size())/float(bucket_count()); - } - - float max_load_factor() const { - return m_max_load_factor; - } - - void max_load_factor(float ml) { - m_max_load_factor = std::max(0.1f, std::min(ml, 0.95f)); - m_load_threshold = size_type(float(bucket_count())*m_max_load_factor); - } - - void rehash(size_type count) { - count = std::max(count, size_type(std::ceil(float(size())/max_load_factor()))); - rehash_impl(count); - } - - void reserve(size_type count) { - reserve_space_for_values(count); - - count = size_type(std::ceil(float(count)/max_load_factor())); - rehash(count); - } - - - /* - * Observers - */ - hasher hash_function() const { - return static_cast(*this); - } - - key_equal key_eq() const { - return static_cast(*this); - } - - - /* - * Other - */ - iterator mutable_iterator(const_iterator pos) { - return iterator(m_values.begin() + iterator_to_index(pos)); - } - - iterator nth(size_type index) { - return iterator(m_values.begin() + index); - } - - const_iterator nth(size_type index) const { - return const_iterator(m_values.cbegin() + index); - } - - const_reference front() const { - return m_values.front(); - } - - const_reference back() const { - return m_values.back(); - } - - const values_container_type& values_container() const noexcept { - return m_values; - } - - template::value>::type* = nullptr> - const typename values_container_type::value_type* data() const noexcept { - return m_values.data(); - } - - template::value>::type* = nullptr> - size_type capacity() const noexcept { - return m_values.capacity(); - } - - void shrink_to_fit() { - m_values.shrink_to_fit(); - } - - - template - std::pair insert_at_position(const_iterator pos, P&& value) { - return insert_at_position_impl(pos.m_iterator, KeySelect()(value), std::forward

(value)); - } - - template - std::pair emplace_at_position(const_iterator pos, Args&&... args) { - return insert_at_position(pos, value_type(std::forward(args)...)); - } - - template - std::pair try_emplace_at_position(const_iterator pos, K&& key, Args&&... value_args) { - return insert_at_position_impl(pos.m_iterator, key, - std::piecewise_construct, - std::forward_as_tuple(std::forward(key)), - std::forward_as_tuple(std::forward(value_args)...)); - } - - - void pop_back() { - tsl_assert(!empty()); - erase(std::prev(end())); - } - - - /** - * Here to avoid `template size_type unordered_erase(const K& key)` being used when - * we use a iterator instead of a const_iterator. - */ - iterator unordered_erase(iterator pos) { - return unordered_erase(const_iterator(pos)); - } - - iterator unordered_erase(const_iterator pos) { - const std::size_t index_erase = iterator_to_index(pos); - unordered_erase(pos.key()); - - /* - * One element was deleted, index_erase now points to the next element as the elements after - * the deleted value were shifted to the left in m_values (will be end() if we deleted the last element). - */ - return begin() + index_erase; - } - - template - size_type unordered_erase(const K& key) { - return unordered_erase(key, hash_key(key)); - } - - template - size_type unordered_erase(const K& key, std::size_t hash) { - auto it_bucket_key = find_key(key, hash); - if(it_bucket_key == m_buckets.end()) { - return 0; - } - - /** - * If we are not erasing the last element in m_values, we swap - * the element we are erasing with the last element. We then would - * just have to do a pop_back() in m_values. - */ - if(!compare_keys(key, KeySelect()(back()))) { - auto it_bucket_last_elem = find_key(KeySelect()(back()), hash_key(KeySelect()(back()))); - tsl_assert(it_bucket_last_elem != m_buckets.end()); - tsl_assert(it_bucket_last_elem->index() == m_values.size() - 1); - - using std::swap; - swap(m_values[it_bucket_key->index()], m_values[it_bucket_last_elem->index()]); - swap(it_bucket_key->index_ref(), it_bucket_last_elem->index_ref()); - } - - erase_value_from_bucket(it_bucket_key); - - return 1; - } - - friend bool operator==(const ordered_hash& lhs, const ordered_hash& rhs) { - return lhs.m_values == rhs.m_values; - } - - friend bool operator!=(const ordered_hash& lhs, const ordered_hash& rhs) { - return lhs.m_values != rhs.m_values; - } - - friend bool operator<(const ordered_hash& lhs, const ordered_hash& rhs) { - return lhs.m_values < rhs.m_values; - } - - friend bool operator<=(const ordered_hash& lhs, const ordered_hash& rhs) { - return lhs.m_values <= rhs.m_values; - } - - friend bool operator>(const ordered_hash& lhs, const ordered_hash& rhs) { - return lhs.m_values > rhs.m_values; - } - - friend bool operator>=(const ordered_hash& lhs, const ordered_hash& rhs) { - return lhs.m_values >= rhs.m_values; - } + /* + * Mark the buckets corresponding to the values as empty and do a backward shift. + * + * Also, the erase operation on m_values has shifted all the values on the right of last.m_iterator. + * Adapt the indexes for these values. + */ + std::size_t ibucket = 0; + while(ibucket < m_buckets.size()) { + if(m_buckets[ibucket].empty()) { + ibucket++; + } + else if(m_buckets[ibucket].index() >= start_index && m_buckets[ibucket].index() < end_index) { + m_buckets[ibucket].clear(); + backward_shift(ibucket); + // Don't increment ibucket, backward_shift may have replaced current bucket. + } + else if(m_buckets[ibucket].index() >= end_index) { + m_buckets[ibucket].set_index(index_type(m_buckets[ibucket].index() - nb_values)); + ibucket++; + } + else { + ibucket++; + } + } + + return iterator(next_it); + } + + + template + size_type erase(const K& key) { + return erase(key, hash_key(key)); + } + + template + size_type erase(const K& key, std::size_t hash) { + return erase_impl(key, hash); + } + + void swap(ordered_hash& other) noexcept { + using std::swap; + + swap(static_cast(*this), static_cast(other)); + swap(static_cast(*this), static_cast(other)); + swap(m_buckets, other.m_buckets); + swap(m_mask, other.m_mask); + swap(m_values, other.m_values); + swap(m_grow_on_next_insert, other.m_grow_on_next_insert); + swap(m_max_load_factor, other.m_max_load_factor); + swap(m_load_threshold, other.m_load_threshold); + } + + + + + /* + * Lookup + */ + template::value>::type* = nullptr> + typename U::value_type& at(const K& key) { + return at(key, hash_key(key)); + } + + template::value>::type* = nullptr> + typename U::value_type& at(const K& key, std::size_t hash) { + return const_cast(static_cast(this)->at(key, hash)); + } + + template::value>::type* = nullptr> + const typename U::value_type& at(const K& key) const { + return at(key, hash_key(key)); + } + + template::value>::type* = nullptr> + const typename U::value_type& at(const K& key, std::size_t hash) const { + auto it = find(key, hash); + if(it != end()) { + return it.value(); + } + else { + throw std::out_of_range("Couldn't find the key."); + } + } + + + template::value>::type* = nullptr> + typename U::value_type& operator[](K&& key) { + return try_emplace(std::forward(key)).first.value(); + } + + + template + size_type count(const K& key) const { + return count(key, hash_key(key)); + } + + template + size_type count(const K& key, std::size_t hash) const { + if(find(key, hash) == cend()) { + return 0; + } + else { + return 1; + } + } + + template + iterator find(const K& key) { + return find(key, hash_key(key)); + } + + template + iterator find(const K& key, std::size_t hash) { + auto it_bucket = find_key(key, hash); + return (it_bucket != m_buckets.end())?iterator(m_values.begin() + it_bucket->index()):end(); + } + + template + const_iterator find(const K& key) const { + return find(key, hash_key(key)); + } + + template + const_iterator find(const K& key, std::size_t hash) const { + auto it_bucket = find_key(key, hash); + return (it_bucket != m_buckets.cend())?const_iterator(m_values.begin() + it_bucket->index()):end(); + } + + + template + std::pair equal_range(const K& key) { + return equal_range(key, hash_key(key)); + } + + template + std::pair equal_range(const K& key, std::size_t hash) { + iterator it = find(key, hash); + return std::make_pair(it, (it == end())?it:std::next(it)); + } + + template + std::pair equal_range(const K& key) const { + return equal_range(key, hash_key(key)); + } + + template + std::pair equal_range(const K& key, std::size_t hash) const { + const_iterator it = find(key, hash); + return std::make_pair(it, (it == cend())?it:std::next(it)); + } + + + /* + * Bucket interface + */ + size_type bucket_count() const { + return m_buckets.size(); + } + + size_type max_bucket_count() const { + return m_buckets.max_size(); + } + + /* + * Hash policy + */ + float load_factor() const { + return float(size())/float(bucket_count()); + } + + float max_load_factor() const { + return m_max_load_factor; + } + + void max_load_factor(float ml) { + m_max_load_factor = std::max(0.1f, std::min(ml, 0.95f)); + m_load_threshold = size_type(float(bucket_count())*m_max_load_factor); + } + + void rehash(size_type count) { + count = std::max(count, size_type(std::ceil(float(size())/max_load_factor()))); + rehash_impl(count); + } + + void reserve(size_type count) { + reserve_space_for_values(count); + + count = size_type(std::ceil(float(count)/max_load_factor())); + rehash(count); + } + + + /* + * Observers + */ + hasher hash_function() const { + return static_cast(*this); + } + + key_equal key_eq() const { + return static_cast(*this); + } + + + /* + * Other + */ + iterator mutable_iterator(const_iterator pos) { + return iterator(m_values.begin() + iterator_to_index(pos)); + } + + iterator nth(size_type index) { + return iterator(m_values.begin() + index); + } + + const_iterator nth(size_type index) const { + return const_iterator(m_values.cbegin() + index); + } + + const_reference front() const { + return m_values.front(); + } + + const_reference back() const { + return m_values.back(); + } + + const values_container_type& values_container() const noexcept { + return m_values; + } + + template::value>::type* = nullptr> + const typename values_container_type::value_type* data() const noexcept { + return m_values.data(); + } + + template::value>::type* = nullptr> + size_type capacity() const noexcept { + return m_values.capacity(); + } + + void shrink_to_fit() { + m_values.shrink_to_fit(); + } + + + template + std::pair insert_at_position(const_iterator pos, P&& value) { + return insert_at_position_impl(pos.m_iterator, KeySelect()(value), std::forward

(value)); + } + + template + std::pair emplace_at_position(const_iterator pos, Args&&... args) { + return insert_at_position(pos, value_type(std::forward(args)...)); + } + + template + std::pair try_emplace_at_position(const_iterator pos, K&& key, Args&&... value_args) { + return insert_at_position_impl(pos.m_iterator, key, + std::piecewise_construct, + std::forward_as_tuple(std::forward(key)), + std::forward_as_tuple(std::forward(value_args)...)); + } + + + void pop_back() { + tsl_assert(!empty()); + erase(std::prev(end())); + } + + + /** + * Here to avoid `template size_type unordered_erase(const K& key)` being used when + * we use a iterator instead of a const_iterator. + */ + iterator unordered_erase(iterator pos) { + return unordered_erase(const_iterator(pos)); + } + + iterator unordered_erase(const_iterator pos) { + const std::size_t index_erase = iterator_to_index(pos); + unordered_erase(pos.key()); + + /* + * One element was deleted, index_erase now points to the next element as the elements after + * the deleted value were shifted to the left in m_values (will be end() if we deleted the last element). + */ + return begin() + index_erase; + } + + template + size_type unordered_erase(const K& key) { + return unordered_erase(key, hash_key(key)); + } + + template + size_type unordered_erase(const K& key, std::size_t hash) { + auto it_bucket_key = find_key(key, hash); + if(it_bucket_key == m_buckets.end()) { + return 0; + } + + /** + * If we are not erasing the last element in m_values, we swap + * the element we are erasing with the last element. We then would + * just have to do a pop_back() in m_values. + */ + if(!compare_keys(key, KeySelect()(back()))) { + auto it_bucket_last_elem = find_key(KeySelect()(back()), hash_key(KeySelect()(back()))); + tsl_assert(it_bucket_last_elem != m_buckets.end()); + tsl_assert(it_bucket_last_elem->index() == m_values.size() - 1); + + using std::swap; + swap(m_values[it_bucket_key->index()], m_values[it_bucket_last_elem->index()]); + swap(it_bucket_key->index_ref(), it_bucket_last_elem->index_ref()); + } + + erase_value_from_bucket(it_bucket_key); + + return 1; + } + + friend bool operator==(const ordered_hash& lhs, const ordered_hash& rhs) { + return lhs.m_values == rhs.m_values; + } + + friend bool operator!=(const ordered_hash& lhs, const ordered_hash& rhs) { + return lhs.m_values != rhs.m_values; + } + + friend bool operator<(const ordered_hash& lhs, const ordered_hash& rhs) { + return lhs.m_values < rhs.m_values; + } + + friend bool operator<=(const ordered_hash& lhs, const ordered_hash& rhs) { + return lhs.m_values <= rhs.m_values; + } + + friend bool operator>(const ordered_hash& lhs, const ordered_hash& rhs) { + return lhs.m_values > rhs.m_values; + } + + friend bool operator>=(const ordered_hash& lhs, const ordered_hash& rhs) { + return lhs.m_values >= rhs.m_values; + } private: - template - std::size_t hash_key(const K& key) const { - return Hash::operator()(key); - } + template + std::size_t hash_key(const K& key) const { + return Hash::operator()(key); + } - template - bool compare_keys(const K1& key1, const K2& key2) const { - return KeyEqual::operator()(key1, key2); - } + template + bool compare_keys(const K1& key1, const K2& key2) const { + return KeyEqual::operator()(key1, key2); + } - template - typename buckets_container_type::iterator find_key(const K& key, std::size_t hash) { - auto it = static_cast(this)->find_key(key, hash); - return m_buckets.begin() + std::distance(m_buckets.cbegin(), it); - } + template + typename buckets_container_type::iterator find_key(const K& key, std::size_t hash) { + auto it = static_cast(this)->find_key(key, hash); + return m_buckets.begin() + std::distance(m_buckets.cbegin(), it); + } - /** - * Return bucket which has the key 'key' or m_buckets.end() if none. - * - * From the bucket_for_hash, search for the value until we either find an empty bucket - * or a bucket which has a value with a distance from its ideal bucket longer - * than the probe length for the value we are looking for. - */ - template - typename buckets_container_type::const_iterator find_key(const K& key, std::size_t hash) const { - for(std::size_t ibucket = bucket_for_hash(hash), dist_from_ideal_bucket = 0; ; - ibucket = next_bucket(ibucket), dist_from_ideal_bucket++) - { - if(m_buckets[ibucket].empty()) { - return m_buckets.end(); - } - else if(m_buckets[ibucket].truncated_hash() == bucket_entry::truncate_hash(hash) && - compare_keys(key, KeySelect()(m_values[m_buckets[ibucket].index()]))) - { - return m_buckets.begin() + ibucket; - } - else if(dist_from_ideal_bucket > distance_from_ideal_bucket(ibucket)) { - return m_buckets.end(); - } - } - } + /** + * Return bucket which has the key 'key' or m_buckets.end() if none. + * + * From the bucket_for_hash, search for the value until we either find an empty bucket + * or a bucket which has a value with a distance from its ideal bucket longer + * than the probe length for the value we are looking for. + */ + template + typename buckets_container_type::const_iterator find_key(const K& key, std::size_t hash) const { + for(std::size_t ibucket = bucket_for_hash(hash), dist_from_ideal_bucket = 0; ; + ibucket = next_bucket(ibucket), dist_from_ideal_bucket++) + { + if(m_buckets[ibucket].empty()) { + return m_buckets.end(); + } + else if(m_buckets[ibucket].truncated_hash() == bucket_entry::truncate_hash(hash) && + compare_keys(key, KeySelect()(m_values[m_buckets[ibucket].index()]))) + { + return m_buckets.begin() + ibucket; + } + else if(dist_from_ideal_bucket > distance_from_ideal_bucket(ibucket)) { + return m_buckets.end(); + } + } + } - void rehash_impl(size_type bucket_count) { - bucket_count = round_up_to_power_of_two(bucket_count); - tsl_assert(bucket_count > 0); + void rehash_impl(size_type bucket_count) { + bucket_count = round_up_to_power_of_two(bucket_count); + tsl_assert(bucket_count > 0); - if(bucket_count == this->bucket_count()) { - return; - } + if(bucket_count == this->bucket_count()) { + return; + } - if(bucket_count > max_bucket_count()) { - throw std::length_error("The map exceeds its maxmimum size."); - } + if(bucket_count > max_bucket_count()) { + throw std::length_error("The map exceeds its maxmimum size."); + } - buckets_container_type old_buckets(bucket_count); - m_buckets.swap(old_buckets); - // Everything should be noexcept from here. + buckets_container_type old_buckets(bucket_count); + m_buckets.swap(old_buckets); + // Everything should be noexcept from here. - m_mask = bucket_count - 1; - this->max_load_factor(m_max_load_factor); - m_grow_on_next_insert = false; + m_mask = bucket_count - 1; + this->max_load_factor(m_max_load_factor); + m_grow_on_next_insert = false; - for(const bucket_entry& old_bucket: old_buckets) { - if(old_bucket.empty()) { - continue; - } + for(const bucket_entry& old_bucket: old_buckets) { + if(old_bucket.empty()) { + continue; + } - truncated_hash_type insert_hash = old_bucket.truncated_hash(); - index_type insert_index = old_bucket.index(); + truncated_hash_type insert_hash = old_bucket.truncated_hash(); + index_type insert_index = old_bucket.index(); - for(std::size_t ibucket = bucket_for_hash(insert_hash), dist_from_ideal_bucket = 0; ; - ibucket = next_bucket(ibucket), dist_from_ideal_bucket++) - { - if(m_buckets[ibucket].empty()) { - m_buckets[ibucket].set_index(insert_index); - m_buckets[ibucket].set_hash(insert_hash); - break; - } + for(std::size_t ibucket = bucket_for_hash(insert_hash), dist_from_ideal_bucket = 0; ; + ibucket = next_bucket(ibucket), dist_from_ideal_bucket++) + { + if(m_buckets[ibucket].empty()) { + m_buckets[ibucket].set_index(insert_index); + m_buckets[ibucket].set_hash(insert_hash); + break; + } - const std::size_t distance = distance_from_ideal_bucket(ibucket); - if(dist_from_ideal_bucket > distance) { - std::swap(insert_index, m_buckets[ibucket].index_ref()); - std::swap(insert_hash, m_buckets[ibucket].truncated_hash_ref()); - dist_from_ideal_bucket = distance; - } - } - } - } + const std::size_t distance = distance_from_ideal_bucket(ibucket); + if(dist_from_ideal_bucket > distance) { + std::swap(insert_index, m_buckets[ibucket].index_ref()); + std::swap(insert_hash, m_buckets[ibucket].truncated_hash_ref()); + dist_from_ideal_bucket = distance; + } + } + } + } - template::value>::type* = nullptr> - void reserve_space_for_values(size_type count) { - m_values.reserve(count); - } + template::value>::type* = nullptr> + void reserve_space_for_values(size_type count) { + m_values.reserve(count); + } - template::value>::type* = nullptr> - void reserve_space_for_values(size_type /*count*/) { - } + template::value>::type* = nullptr> + void reserve_space_for_values(size_type /*count*/) { + } - /** - * Swap the empty bucket with the values on its right until we cross another empty bucket - * or if the other bucket has a distance_from_ideal_bucket == 0. - */ - void backward_shift(std::size_t empty_ibucket) noexcept { - tsl_assert(m_buckets[empty_ibucket].empty()); + /** + * Swap the empty bucket with the values on its right until we cross another empty bucket + * or if the other bucket has a distance_from_ideal_bucket == 0. + */ + void backward_shift(std::size_t empty_ibucket) noexcept { + tsl_assert(m_buckets[empty_ibucket].empty()); - std::size_t previous_ibucket = empty_ibucket; - for(std::size_t current_ibucket = next_bucket(previous_ibucket); - !m_buckets[current_ibucket].empty() && distance_from_ideal_bucket(current_ibucket) > 0; - previous_ibucket = current_ibucket, current_ibucket = next_bucket(current_ibucket)) - { - std::swap(m_buckets[current_ibucket], m_buckets[previous_ibucket]); - } - } + std::size_t previous_ibucket = empty_ibucket; + for(std::size_t current_ibucket = next_bucket(previous_ibucket); + !m_buckets[current_ibucket].empty() && distance_from_ideal_bucket(current_ibucket) > 0; + previous_ibucket = current_ibucket, current_ibucket = next_bucket(current_ibucket)) + { + std::swap(m_buckets[current_ibucket], m_buckets[previous_ibucket]); + } + } - void erase_value_from_bucket(typename buckets_container_type::iterator it_bucket) { - tsl_assert(it_bucket != m_buckets.end() && !it_bucket->empty()); + void erase_value_from_bucket(typename buckets_container_type::iterator it_bucket) { + tsl_assert(it_bucket != m_buckets.end() && !it_bucket->empty()); - m_values.erase(m_values.begin() + it_bucket->index()); + m_values.erase(m_values.begin() + it_bucket->index()); - /* - * m_values.erase shifted all the values on the right of the erased value, - * shift the indexes by 1 in the buckets array for these values. - */ - if(it_bucket->index() != m_values.size()) { - shift_indexes_in_buckets(it_bucket->index(), short(1)); - } + /* + * m_values.erase shifted all the values on the right of the erased value, + * shift the indexes by 1 in the buckets array for these values. + */ + if(it_bucket->index() != m_values.size()) { + shift_indexes_in_buckets(it_bucket->index(), short(1)); + } - // Mark the bucket as empty and do a backward shift of the values on the right - it_bucket->clear(); - backward_shift(std::size_t(std::distance(m_buckets.begin(), it_bucket))); - } + // Mark the bucket as empty and do a backward shift of the values on the right + it_bucket->clear(); + backward_shift(std::size_t(std::distance(m_buckets.begin(), it_bucket))); + } - /** - * Go through each value from [from_ivalue, m_values.size()) in m_values and for each - * bucket corresponding to the value, shift the indexes to the left by delta. - */ - void shift_indexes_in_buckets(index_type from_ivalue, short delta) noexcept { - static_assert(std::is_unsigned::value && sizeof(index_type) >= sizeof(short), - "index_type should be unsigned and sizeof(index_type) >= sizeof(short)"); + /** + * Go through each value from [from_ivalue, m_values.size()) in m_values and for each + * bucket corresponding to the value, shift the indexes to the left by delta. + */ + void shift_indexes_in_buckets(index_type from_ivalue, short delta) noexcept { + static_assert(std::is_unsigned::value && sizeof(index_type) >= sizeof(short), + "index_type should be unsigned and sizeof(index_type) >= sizeof(short)"); - for(std::size_t ivalue = from_ivalue; ivalue < m_values.size(); ivalue++) { - std::size_t ibucket = bucket_for_hash(hash_key(KeySelect()(m_values[ivalue]))); + for(std::size_t ivalue = from_ivalue; ivalue < m_values.size(); ivalue++) { + std::size_t ibucket = bucket_for_hash(hash_key(KeySelect()(m_values[ivalue]))); - // Modulo arithmetic, we should be alright for index_type(ivalue + delta). TODO further checks - while(m_buckets[ibucket].index() != index_type(ivalue + delta)) { - ibucket = next_bucket(ibucket); - } + // Modulo arithmetic, we should be alright for index_type(ivalue + delta). TODO further checks + while(m_buckets[ibucket].index() != index_type(ivalue + delta)) { + ibucket = next_bucket(ibucket); + } - m_buckets[ibucket].set_index(index_type(m_buckets[ibucket].index() - delta)); - } - } + m_buckets[ibucket].set_index(index_type(m_buckets[ibucket].index() - delta)); + } + } - template - size_type erase_impl(const K& key, std::size_t hash) { - auto it_bucket = find_key(key, hash); - if(it_bucket != m_buckets.end()) { - erase_value_from_bucket(it_bucket); + template + size_type erase_impl(const K& key, std::size_t hash) { + auto it_bucket = find_key(key, hash); + if(it_bucket != m_buckets.end()) { + erase_value_from_bucket(it_bucket); - return 1; - } - else { - return 0; - } - } + return 1; + } + else { + return 0; + } + } - template - std::pair insert_impl(const K& key, Args&&... value_type_args) { - return insert_at_position_impl(m_values.cend(), key, std::forward(value_type_args)...); - } + template + std::pair insert_impl(const K& key, Args&&... value_type_args) { + return insert_at_position_impl(m_values.cend(), key, std::forward(value_type_args)...); + } - /** - * Insert the element before insert_position. - */ - template - std::pair insert_at_position_impl(typename values_container_type::const_iterator insert_position, - const K& key, Args&&... value_type_args) - { - const std::size_t hash = hash_key(key); + /** + * Insert the element before insert_position. + */ + template + std::pair insert_at_position_impl(typename values_container_type::const_iterator insert_position, + const K& key, Args&&... value_type_args) + { + const std::size_t hash = hash_key(key); - std::size_t ibucket = bucket_for_hash(hash); - std::size_t dist_from_ideal_bucket = 0; + std::size_t ibucket = bucket_for_hash(hash); + std::size_t dist_from_ideal_bucket = 0; - while(!m_buckets[ibucket].empty() && dist_from_ideal_bucket <= distance_from_ideal_bucket(ibucket)) { - if(m_buckets[ibucket].truncated_hash() == bucket_entry::truncate_hash(hash) && - compare_keys(key, KeySelect()(m_values[m_buckets[ibucket].index()]))) - { - return std::make_pair(begin() + m_buckets[ibucket].index(), false); - } + while(!m_buckets[ibucket].empty() && dist_from_ideal_bucket <= distance_from_ideal_bucket(ibucket)) { + if(m_buckets[ibucket].truncated_hash() == bucket_entry::truncate_hash(hash) && + compare_keys(key, KeySelect()(m_values[m_buckets[ibucket].index()]))) + { + return std::make_pair(begin() + m_buckets[ibucket].index(), false); + } - ibucket = next_bucket(ibucket); - dist_from_ideal_bucket++; - } + ibucket = next_bucket(ibucket); + dist_from_ideal_bucket++; + } - if(size() >= max_size()) { - throw std::length_error("We reached the maximum size for the hash table."); - } + if(size() >= max_size()) { + throw std::length_error("We reached the maximum size for the hash table."); + } - if(grow_on_high_load()) { - ibucket = bucket_for_hash(hash); - dist_from_ideal_bucket = 0; - } + if(grow_on_high_load()) { + ibucket = bucket_for_hash(hash); + dist_from_ideal_bucket = 0; + } - const index_type index_insert_position = index_type(std::distance(m_values.cbegin(), insert_position)); + const index_type index_insert_position = index_type(std::distance(m_values.cbegin(), insert_position)); #ifdef TSL_NO_CONTAINER_EMPLACE_CONST_ITERATOR - m_values.emplace(m_values.begin() + std::distance(m_values.cbegin(), insert_position), std::forward(value_type_args)...); + m_values.emplace(m_values.begin() + std::distance(m_values.cbegin(), insert_position), std::forward(value_type_args)...); #else - m_values.emplace(insert_position, std::forward(value_type_args)...); + m_values.emplace(insert_position, std::forward(value_type_args)...); #endif - insert_index(ibucket, dist_from_ideal_bucket, - index_insert_position, bucket_entry::truncate_hash(hash)); + insert_index(ibucket, dist_from_ideal_bucket, + index_insert_position, bucket_entry::truncate_hash(hash)); - /* - * The insertion didn't happend at the end of the m_values container, - * we need to shift the indexes in m_buckets. - */ - if(index_insert_position != m_values.size() - 1) { - shift_indexes_in_buckets(index_insert_position + 1, short(-1)); - } + /* + * The insertion didn't happend at the end of the m_values container, + * we need to shift the indexes in m_buckets. + */ + if(index_insert_position != m_values.size() - 1) { + shift_indexes_in_buckets(index_insert_position + 1, short(-1)); + } - return std::make_pair(iterator(m_values.begin() + index_insert_position), true); - } + return std::make_pair(iterator(m_values.begin() + index_insert_position), true); + } - void insert_index(std::size_t ibucket, std::size_t dist_from_ideal_bucket, - index_type index_insert, truncated_hash_type hash_insert) noexcept - { - while(!m_buckets[ibucket].empty()) { - const std::size_t distance = distance_from_ideal_bucket(ibucket); - if(dist_from_ideal_bucket > distance) { - std::swap(index_insert, m_buckets[ibucket].index_ref()); - std::swap(hash_insert, m_buckets[ibucket].truncated_hash_ref()); + void insert_index(std::size_t ibucket, std::size_t dist_from_ideal_bucket, + index_type index_insert, truncated_hash_type hash_insert) noexcept + { + while(!m_buckets[ibucket].empty()) { + const std::size_t distance = distance_from_ideal_bucket(ibucket); + if(dist_from_ideal_bucket > distance) { + std::swap(index_insert, m_buckets[ibucket].index_ref()); + std::swap(hash_insert, m_buckets[ibucket].truncated_hash_ref()); - dist_from_ideal_bucket = distance; - } + dist_from_ideal_bucket = distance; + } - ibucket = next_bucket(ibucket); - dist_from_ideal_bucket++; + ibucket = next_bucket(ibucket); + dist_from_ideal_bucket++; - if(dist_from_ideal_bucket > REHASH_ON_HIGH_NB_PROBES__NPROBES && !m_grow_on_next_insert && - load_factor() >= REHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR) - { - // We don't want to grow the map now as we need this method to be noexcept. - // Do it on next insert. - m_grow_on_next_insert = true; - } - } + if(dist_from_ideal_bucket > REHASH_ON_HIGH_NB_PROBES__NPROBES && !m_grow_on_next_insert && + load_factor() >= REHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR) + { + // We don't want to grow the map now as we need this method to be noexcept. + // Do it on next insert. + m_grow_on_next_insert = true; + } + } - m_buckets[ibucket].set_index(index_insert); - m_buckets[ibucket].set_hash(hash_insert); - } + m_buckets[ibucket].set_index(index_insert); + m_buckets[ibucket].set_hash(hash_insert); + } - std::size_t distance_from_ideal_bucket(std::size_t ibucket) const noexcept { - const std::size_t ideal_bucket = bucket_for_hash(m_buckets[ibucket].truncated_hash()); + std::size_t distance_from_ideal_bucket(std::size_t ibucket) const noexcept { + const std::size_t ideal_bucket = bucket_for_hash(m_buckets[ibucket].truncated_hash()); - if(ibucket >= ideal_bucket) { - return ibucket - ideal_bucket; - } - // If the bucket is smaller than the ideal bucket for the value, there was a wrapping at the end of the - // bucket array due to the modulo. - else { - return (bucket_count() + ibucket) - ideal_bucket; - } - } + if(ibucket >= ideal_bucket) { + return ibucket - ideal_bucket; + } + // If the bucket is smaller than the ideal bucket for the value, there was a wrapping at the end of the + // bucket array due to the modulo. + else { + return (bucket_count() + ibucket) - ideal_bucket; + } + } - std::size_t next_bucket(std::size_t index) const noexcept { - tsl_assert(index < m_buckets.size()); + std::size_t next_bucket(std::size_t index) const noexcept { + tsl_assert(index < m_buckets.size()); - index++; - return (index < m_buckets.size())?index:0; - } + index++; + return (index < m_buckets.size())?index:0; + } - std::size_t bucket_for_hash(std::size_t hash) const noexcept { - return hash & m_mask; - } + std::size_t bucket_for_hash(std::size_t hash) const noexcept { + return hash & m_mask; + } - std::size_t iterator_to_index(const_iterator it) const noexcept { - const auto dist = std::distance(cbegin(), it); - tsl_assert(dist >= 0); + std::size_t iterator_to_index(const_iterator it) const noexcept { + const auto dist = std::distance(cbegin(), it); + tsl_assert(dist >= 0); - return std::size_t(dist); - } + return std::size_t(dist); + } - /** - * Return true if the map has been rehashed. - */ - bool grow_on_high_load() { - if(m_grow_on_next_insert || size() >= m_load_threshold) { - rehash_impl(bucket_count() * 2); - m_grow_on_next_insert = false; + /** + * Return true if the map has been rehashed. + */ + bool grow_on_high_load() { + if(m_grow_on_next_insert || size() >= m_load_threshold) { + rehash_impl(bucket_count() * 2); + m_grow_on_next_insert = false; - return true; - } - else { - return false; - } - } + return true; + } + else { + return false; + } + } - static std::size_t round_up_to_power_of_two(std::size_t value) { - if(is_power_of_two(value)) { - return value; - } + static std::size_t round_up_to_power_of_two(std::size_t value) { + if(is_power_of_two(value)) { + return value; + } - if(value == 0) { - return 1; - } + if(value == 0) { + return 1; + } - --value; - for(std::size_t i = 1; i < sizeof(std::size_t) * CHAR_BIT; i *= 2) { - value |= value >> i; - } + --value; + for(std::size_t i = 1; i < sizeof(std::size_t) * CHAR_BIT; i *= 2) { + value |= value >> i; + } - return value + 1; - } + return value + 1; + } - static constexpr bool is_power_of_two(std::size_t value) { - return value != 0 && (value & (value - 1)) == 0; - } + static constexpr bool is_power_of_two(std::size_t value) { + return value != 0 && (value & (value - 1)) == 0; + } public: - static const size_type DEFAULT_INIT_BUCKETS_SIZE = 16; - static constexpr float DEFAULT_MAX_LOAD_FACTOR = 0.75f; + static const size_type DEFAULT_INIT_BUCKETS_SIZE = 16; + static constexpr float DEFAULT_MAX_LOAD_FACTOR = 0.75f; private: - static const size_type REHASH_ON_HIGH_NB_PROBES__NPROBES = 128; - static constexpr float REHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR = 0.15f; + static const size_type REHASH_ON_HIGH_NB_PROBES__NPROBES = 128; + static constexpr float REHASH_ON_HIGH_NB_PROBES__MIN_LOAD_FACTOR = 0.15f; private: - buckets_container_type m_buckets; - size_type m_mask; + buckets_container_type m_buckets; + size_type m_mask; - values_container_type m_values; + values_container_type m_values; - bool m_grow_on_next_insert; - float m_max_load_factor; - size_type m_load_threshold; + bool m_grow_on_next_insert; + float m_max_load_factor; + size_type m_load_threshold; }; diff --git a/Foundation/include/Poco/ordered_map.h b/Foundation/include/Poco/ordered_map.h index 870a13975..c63434a8f 100644 --- a/Foundation/include/Poco/ordered_map.h +++ b/Foundation/include/Poco/ordered_map.h @@ -63,722 +63,722 @@ namespace tsl { * Otherwise all the iterators are invalidated if an erase occurs. */ template, - class KeyEqual = std::equal_to, - class Allocator = std::allocator>, - class ValueTypeContainer = std::deque, Allocator>> + class T, + class Hash = std::hash, + class KeyEqual = std::equal_to, + class Allocator = std::allocator>, + class ValueTypeContainer = std::deque, Allocator>> class ordered_map { private: - template - using has_is_transparent = tsl::detail_ordered_hash::has_is_transparent; + template + using has_is_transparent = tsl::detail_ordered_hash::has_is_transparent; - class KeySelect { - public: - using key_type = Key; + class KeySelect { + public: + using key_type = Key; - const key_type& operator()(const std::pair& key_value) const noexcept { - return key_value.first; - } + const key_type& operator()(const std::pair& key_value) const noexcept { + return key_value.first; + } - key_type& operator()(std::pair& key_value) noexcept { - return key_value.first; - } - }; + key_type& operator()(std::pair& key_value) noexcept { + return key_value.first; + } + }; - class ValueSelect { - public: - using value_type = T; + class ValueSelect { + public: + using value_type = T; - const value_type& operator()(const std::pair& key_value) const noexcept { - return key_value.second; - } + const value_type& operator()(const std::pair& key_value) const noexcept { + return key_value.second; + } - value_type& operator()(std::pair& key_value) noexcept { - return key_value.second; - } - }; + value_type& operator()(std::pair& key_value) noexcept { + return key_value.second; + } + }; - using ht = detail_ordered_hash::ordered_hash, KeySelect, ValueSelect, - Hash, KeyEqual, Allocator, ValueTypeContainer>; + using ht = detail_ordered_hash::ordered_hash, KeySelect, ValueSelect, + Hash, KeyEqual, Allocator, ValueTypeContainer>; public: - using key_type = typename ht::key_type; - using mapped_type = T; - using value_type = typename ht::value_type; - using size_type = typename ht::size_type; - using difference_type = typename ht::difference_type; - using hasher = typename ht::hasher; - using key_equal = typename ht::key_equal; - using allocator_type = typename ht::allocator_type; - using reference = typename ht::reference; - using const_reference = typename ht::const_reference; - using pointer = typename ht::pointer; - using const_pointer = typename ht::const_pointer; - using iterator = typename ht::iterator; - using const_iterator = typename ht::const_iterator; - using reverse_iterator = typename ht::reverse_iterator; - using const_reverse_iterator = typename ht::const_reverse_iterator; - - using values_container_type = typename ht::values_container_type; - - - /* - * Constructors - */ - ordered_map(): ordered_map(ht::DEFAULT_INIT_BUCKETS_SIZE) { - } - - explicit ordered_map(size_type bucket_count, - const Hash& hash = Hash(), - const KeyEqual& equal = KeyEqual(), - const Allocator& alloc = Allocator()): - m_ht(bucket_count, hash, equal, alloc, ht::DEFAULT_MAX_LOAD_FACTOR) - { - } - - ordered_map(size_type bucket_count, - const Allocator& alloc): ordered_map(bucket_count, Hash(), KeyEqual(), alloc) - { - } - - ordered_map(size_type bucket_count, - const Hash& hash, - const Allocator& alloc): ordered_map(bucket_count, hash, KeyEqual(), alloc) - { - } - - explicit ordered_map(const Allocator& alloc): ordered_map(ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) { - } - - template - ordered_map(InputIt first, InputIt last, - size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, - const Hash& hash = Hash(), - const KeyEqual& equal = KeyEqual(), - const Allocator& alloc = Allocator()): ordered_map(bucket_count, hash, equal, alloc) - { - insert(first, last); - } - - template - ordered_map(InputIt first, InputIt last, - size_type bucket_count, - const Allocator& alloc): ordered_map(first, last, bucket_count, Hash(), KeyEqual(), alloc) - { - } - - template - ordered_map(InputIt first, InputIt last, - size_type bucket_count, - const Hash& hash, - const Allocator& alloc): ordered_map(first, last, bucket_count, hash, KeyEqual(), alloc) - { - } - - ordered_map(std::initializer_list init, - size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, - const Hash& hash = Hash(), - const KeyEqual& equal = KeyEqual(), - const Allocator& alloc = Allocator()): - ordered_map(init.begin(), init.end(), bucket_count, hash, equal, alloc) - { - } - - ordered_map(std::initializer_list init, - size_type bucket_count, - const Allocator& alloc): - ordered_map(init.begin(), init.end(), bucket_count, Hash(), KeyEqual(), alloc) - { - } - - ordered_map(std::initializer_list init, - size_type bucket_count, - const Hash& hash, - const Allocator& alloc): - ordered_map(init.begin(), init.end(), bucket_count, hash, KeyEqual(), alloc) - { - } - - - ordered_map& operator=(std::initializer_list ilist) { - m_ht.clear(); - - m_ht.reserve(ilist.size()); - m_ht.insert(ilist.begin(), ilist.end()); - - return *this; - } - - allocator_type get_allocator() const { return m_ht.get_allocator(); } - - - - /* - * Iterators - */ - iterator begin() noexcept { return m_ht.begin(); } - const_iterator begin() const noexcept { return m_ht.begin(); } - const_iterator cbegin() const noexcept { return m_ht.cbegin(); } + using key_type = typename ht::key_type; + using mapped_type = T; + using value_type = typename ht::value_type; + using size_type = typename ht::size_type; + using difference_type = typename ht::difference_type; + using hasher = typename ht::hasher; + using key_equal = typename ht::key_equal; + using allocator_type = typename ht::allocator_type; + using reference = typename ht::reference; + using const_reference = typename ht::const_reference; + using pointer = typename ht::pointer; + using const_pointer = typename ht::const_pointer; + using iterator = typename ht::iterator; + using const_iterator = typename ht::const_iterator; + using reverse_iterator = typename ht::reverse_iterator; + using const_reverse_iterator = typename ht::const_reverse_iterator; + + using values_container_type = typename ht::values_container_type; + + + /* + * Constructors + */ + ordered_map(): ordered_map(ht::DEFAULT_INIT_BUCKETS_SIZE) { + } + + explicit ordered_map(size_type bucket_count, + const Hash& hash = Hash(), + const KeyEqual& equal = KeyEqual(), + const Allocator& alloc = Allocator()): + m_ht(bucket_count, hash, equal, alloc, ht::DEFAULT_MAX_LOAD_FACTOR) + { + } + + ordered_map(size_type bucket_count, + const Allocator& alloc): ordered_map(bucket_count, Hash(), KeyEqual(), alloc) + { + } + + ordered_map(size_type bucket_count, + const Hash& hash, + const Allocator& alloc): ordered_map(bucket_count, hash, KeyEqual(), alloc) + { + } + + explicit ordered_map(const Allocator& alloc): ordered_map(ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) { + } + + template + ordered_map(InputIt first, InputIt last, + size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, + const Hash& hash = Hash(), + const KeyEqual& equal = KeyEqual(), + const Allocator& alloc = Allocator()): ordered_map(bucket_count, hash, equal, alloc) + { + insert(first, last); + } + + template + ordered_map(InputIt first, InputIt last, + size_type bucket_count, + const Allocator& alloc): ordered_map(first, last, bucket_count, Hash(), KeyEqual(), alloc) + { + } + + template + ordered_map(InputIt first, InputIt last, + size_type bucket_count, + const Hash& hash, + const Allocator& alloc): ordered_map(first, last, bucket_count, hash, KeyEqual(), alloc) + { + } + + ordered_map(std::initializer_list init, + size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, + const Hash& hash = Hash(), + const KeyEqual& equal = KeyEqual(), + const Allocator& alloc = Allocator()): + ordered_map(init.begin(), init.end(), bucket_count, hash, equal, alloc) + { + } + + ordered_map(std::initializer_list init, + size_type bucket_count, + const Allocator& alloc): + ordered_map(init.begin(), init.end(), bucket_count, Hash(), KeyEqual(), alloc) + { + } + + ordered_map(std::initializer_list init, + size_type bucket_count, + const Hash& hash, + const Allocator& alloc): + ordered_map(init.begin(), init.end(), bucket_count, hash, KeyEqual(), alloc) + { + } + + + ordered_map& operator=(std::initializer_list ilist) { + m_ht.clear(); + + m_ht.reserve(ilist.size()); + m_ht.insert(ilist.begin(), ilist.end()); + + return *this; + } + + allocator_type get_allocator() const { return m_ht.get_allocator(); } + + + + /* + * Iterators + */ + iterator begin() noexcept { return m_ht.begin(); } + const_iterator begin() const noexcept { return m_ht.begin(); } + const_iterator cbegin() const noexcept { return m_ht.cbegin(); } - iterator end() noexcept { return m_ht.end(); } - const_iterator end() const noexcept { return m_ht.end(); } - const_iterator cend() const noexcept { return m_ht.cend(); } - - reverse_iterator rbegin() noexcept { return m_ht.rbegin(); } - const_reverse_iterator rbegin() const noexcept { return m_ht.rbegin(); } - const_reverse_iterator rcbegin() const noexcept { return m_ht.rcbegin(); } + iterator end() noexcept { return m_ht.end(); } + const_iterator end() const noexcept { return m_ht.end(); } + const_iterator cend() const noexcept { return m_ht.cend(); } + + reverse_iterator rbegin() noexcept { return m_ht.rbegin(); } + const_reverse_iterator rbegin() const noexcept { return m_ht.rbegin(); } + const_reverse_iterator rcbegin() const noexcept { return m_ht.rcbegin(); } - reverse_iterator rend() noexcept { return m_ht.rend(); } - const_reverse_iterator rend() const noexcept { return m_ht.rend(); } - const_reverse_iterator rcend() const noexcept { return m_ht.rcend(); } + reverse_iterator rend() noexcept { return m_ht.rend(); } + const_reverse_iterator rend() const noexcept { return m_ht.rend(); } + const_reverse_iterator rcend() const noexcept { return m_ht.rcend(); } - /* - * Capacity - */ - bool empty() const noexcept { return m_ht.empty(); } - size_type size() const noexcept { return m_ht.size(); } - size_type max_size() const noexcept { return m_ht.max_size(); } + /* + * Capacity + */ + bool empty() const noexcept { return m_ht.empty(); } + size_type size() const noexcept { return m_ht.size(); } + size_type max_size() const noexcept { return m_ht.max_size(); } - /* - * Modifiers - */ - void clear() noexcept { m_ht.clear(); } + /* + * Modifiers + */ + void clear() noexcept { m_ht.clear(); } - std::pair insert(const value_type& value) { return m_ht.insert(value); } + std::pair insert(const value_type& value) { return m_ht.insert(value); } - template::value>::type* = nullptr> - std::pair insert(P&& value) { return m_ht.emplace(std::forward

(value)); } + template::value>::type* = nullptr> + std::pair insert(P&& value) { return m_ht.emplace(std::forward

(value)); } - std::pair insert(value_type&& value) { return m_ht.insert(std::move(value)); } + std::pair insert(value_type&& value) { return m_ht.insert(std::move(value)); } - iterator insert(const_iterator hint, const value_type& value) { - return m_ht.insert(hint, value); - } + iterator insert(const_iterator hint, const value_type& value) { + return m_ht.insert(hint, value); + } - template::value>::type* = nullptr> - iterator insert(const_iterator hint, P&& value) { - return m_ht.emplace_hint(hint, std::forward

(value)); - } + template::value>::type* = nullptr> + iterator insert(const_iterator hint, P&& value) { + return m_ht.emplace_hint(hint, std::forward

(value)); + } - iterator insert(const_iterator hint, value_type&& value) { - return m_ht.insert(hint, std::move(value)); - } + iterator insert(const_iterator hint, value_type&& value) { + return m_ht.insert(hint, std::move(value)); + } - template - void insert(InputIt first, InputIt last) { m_ht.insert(first, last); } - void insert(std::initializer_list ilist) { m_ht.insert(ilist.begin(), ilist.end()); } + template + void insert(InputIt first, InputIt last) { m_ht.insert(first, last); } + void insert(std::initializer_list ilist) { m_ht.insert(ilist.begin(), ilist.end()); } - template - std::pair insert_or_assign(const key_type& k, M&& obj) { - return m_ht.insert_or_assign(k, std::forward(obj)); - } + template + std::pair insert_or_assign(const key_type& k, M&& obj) { + return m_ht.insert_or_assign(k, std::forward(obj)); + } - template - std::pair insert_or_assign(key_type&& k, M&& obj) { - return m_ht.insert_or_assign(std::move(k), std::forward(obj)); - } + template + std::pair insert_or_assign(key_type&& k, M&& obj) { + return m_ht.insert_or_assign(std::move(k), std::forward(obj)); + } - template - iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj) { - return m_ht.insert_or_assign(hint, k, std::forward(obj)); - } + template + iterator insert_or_assign(const_iterator hint, const key_type& k, M&& obj) { + return m_ht.insert_or_assign(hint, k, std::forward(obj)); + } - template - iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj) { - return m_ht.insert_or_assign(hint, std::move(k), std::forward(obj)); - } + template + iterator insert_or_assign(const_iterator hint, key_type&& k, M&& obj) { + return m_ht.insert_or_assign(hint, std::move(k), std::forward(obj)); + } - /** - * Due to the way elements are stored, emplace will need to move or copy the key-value once. - * The method is equivalent to insert(value_type(std::forward(args)...)); - * - * Mainly here for compatibility with the std::unordered_map interface. - */ - template - std::pair emplace(Args&&... args) { return m_ht.emplace(std::forward(args)...); } + /** + * Due to the way elements are stored, emplace will need to move or copy the key-value once. + * The method is equivalent to insert(value_type(std::forward(args)...)); + * + * Mainly here for compatibility with the std::unordered_map interface. + */ + template + std::pair emplace(Args&&... args) { return m_ht.emplace(std::forward(args)...); } - /** - * Due to the way elements are stored, emplace_hint will need to move or copy the key-value once. - * The method is equivalent to insert(hint, value_type(std::forward(args)...)); - * - * Mainly here for compatibility with the std::unordered_map interface. - */ - template - iterator emplace_hint(const_iterator hint, Args&&... args) { - return m_ht.emplace_hint(hint, std::forward(args)...); - } + /** + * Due to the way elements are stored, emplace_hint will need to move or copy the key-value once. + * The method is equivalent to insert(hint, value_type(std::forward(args)...)); + * + * Mainly here for compatibility with the std::unordered_map interface. + */ + template + iterator emplace_hint(const_iterator hint, Args&&... args) { + return m_ht.emplace_hint(hint, std::forward(args)...); + } - template - std::pair try_emplace(const key_type& k, Args&&... args) { - return m_ht.try_emplace(k, std::forward(args)...); - } + template + std::pair try_emplace(const key_type& k, Args&&... args) { + return m_ht.try_emplace(k, std::forward(args)...); + } - template - std::pair try_emplace(key_type&& k, Args&&... args) { - return m_ht.try_emplace(std::move(k), std::forward(args)...); - } - - template - iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args) { - return m_ht.try_emplace(hint, k, std::forward(args)...); - } - - template - iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args) { - return m_ht.try_emplace(hint, std::move(k), std::forward(args)...); - } + template + std::pair try_emplace(key_type&& k, Args&&... args) { + return m_ht.try_emplace(std::move(k), std::forward(args)...); + } + + template + iterator try_emplace(const_iterator hint, const key_type& k, Args&&... args) { + return m_ht.try_emplace(hint, k, std::forward(args)...); + } + + template + iterator try_emplace(const_iterator hint, key_type&& k, Args&&... args) { + return m_ht.try_emplace(hint, std::move(k), std::forward(args)...); + } - /** - * When erasing an element, the insert order will be preserved and no holes will be present in the container - * returned by 'values_container()'. - * - * The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) - * average complexity. - */ - iterator erase(iterator pos) { return m_ht.erase(pos); } - - /** - * @copydoc erase(iterator pos) - */ - iterator erase(const_iterator pos) { return m_ht.erase(pos); } + /** + * When erasing an element, the insert order will be preserved and no holes will be present in the container + * returned by 'values_container()'. + * + * The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) + * average complexity. + */ + iterator erase(iterator pos) { return m_ht.erase(pos); } + + /** + * @copydoc erase(iterator pos) + */ + iterator erase(const_iterator pos) { return m_ht.erase(pos); } - /** - * @copydoc erase(iterator pos) - */ - iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); } - - /** - * @copydoc erase(iterator pos) - */ - size_type erase(const key_type& key) { return m_ht.erase(key); } - - /** - * @copydoc erase(iterator pos) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup to the value if you already have the hash. - */ - size_type erase(const key_type& key, std::size_t precalculated_hash) { - return m_ht.erase(key, precalculated_hash); - } - - /** - * @copydoc erase(iterator pos) - * - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type erase(const K& key) { return m_ht.erase(key); } - - /** - * @copydoc erase(const key_type& key, std::size_t precalculated_hash) - * - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type erase(const K& key, std::size_t precalculated_hash) { - return m_ht.erase(key, precalculated_hash); - } - - - void swap(ordered_map& other) noexcept { other.m_ht.swap(m_ht); } - - /* - * Lookup - */ - T& at(const Key& key) { return m_ht.at(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - T& at(const Key& key, std::size_t precalculated_hash) { return m_ht.at(key, precalculated_hash); } - - - const T& at(const Key& key) const { return m_ht.at(key); } - - /** - * @copydoc at(const Key& key, std::size_t precalculated_hash) - */ - const T& at(const Key& key, std::size_t precalculated_hash) const { return m_ht.at(key, precalculated_hash); } - - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - T& at(const K& key) { return m_ht.at(key); } - - /** - * @copydoc at(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - T& at(const K& key, std::size_t precalculated_hash) { return m_ht.at(key, precalculated_hash); } - - /** - * @copydoc at(const K& key) - */ - template::value>::type* = nullptr> - const T& at(const K& key) const { return m_ht.at(key); } - - /** - * @copydoc at(const K& key, std::size_t precalculated_hash) - */ - template::value>::type* = nullptr> - const T& at(const K& key, std::size_t precalculated_hash) const { return m_ht.at(key, precalculated_hash); } - - - - T& operator[](const Key& key) { return m_ht[key]; } - T& operator[](Key&& key) { return m_ht[std::move(key)]; } - - - - size_type count(const Key& key) const { return m_ht.count(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - size_type count(const Key& key, std::size_t precalculated_hash) const { - return m_ht.count(key, precalculated_hash); - } - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type count(const K& key) const { return m_ht.count(key); } - - /** - * @copydoc count(const K& key) const - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - size_type count(const K& key, std::size_t precalculated_hash) const { - return m_ht.count(key, precalculated_hash); - } - - - - iterator find(const Key& key) { return m_ht.find(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - iterator find(const Key& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } - - const_iterator find(const Key& key) const { return m_ht.find(key); } - - /** - * @copydoc find(const Key& key, std::size_t precalculated_hash) - */ - const_iterator find(const Key& key, std::size_t precalculated_hash) const { - return m_ht.find(key, precalculated_hash); - } - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - iterator find(const K& key) { return m_ht.find(key); } - - /** - * @copydoc find(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - iterator find(const K& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } - - /** - * @copydoc find(const K& key) - */ - template::value>::type* = nullptr> - const_iterator find(const K& key) const { return m_ht.find(key); } - - /** - * @copydoc find(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - const_iterator find(const K& key, std::size_t precalculated_hash) const { - return m_ht.find(key, precalculated_hash); - } - - - - std::pair equal_range(const Key& key) { return m_ht.equal_range(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - std::pair equal_range(const Key& key, std::size_t precalculated_hash) { - return m_ht.equal_range(key, precalculated_hash); - } - - std::pair equal_range(const Key& key) const { return m_ht.equal_range(key); } - - /** - * @copydoc equal_range(const Key& key, std::size_t precalculated_hash) - */ - std::pair equal_range(const Key& key, std::size_t precalculated_hash) const { - return m_ht.equal_range(key, precalculated_hash); - } - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key) { return m_ht.equal_range(key); } - - /** - * @copydoc equal_range(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key, std::size_t precalculated_hash) { - return m_ht.equal_range(key, precalculated_hash); - } - - /** - * @copydoc equal_range(const K& key) - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key) const { return m_ht.equal_range(key); } - - /** - * @copydoc equal_range(const K& key, std::size_t precalculated_hash) - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key, std::size_t precalculated_hash) const { - return m_ht.equal_range(key, precalculated_hash); - } - - - - /* - * Bucket interface - */ - size_type bucket_count() const { return m_ht.bucket_count(); } - size_type max_bucket_count() const { return m_ht.max_bucket_count(); } - - - /* - * Hash policy - */ - float load_factor() const { return m_ht.load_factor(); } - float max_load_factor() const { return m_ht.max_load_factor(); } - void max_load_factor(float ml) { m_ht.max_load_factor(ml); } - - void rehash(size_type count) { m_ht.rehash(count); } - void reserve(size_type count) { m_ht.reserve(count); } - - - /* - * Observers - */ - hasher hash_function() const { return m_ht.hash_function(); } - key_equal key_eq() const { return m_ht.key_eq(); } - - - - /* - * Other - */ - - /** - * Convert a const_iterator to an iterator. - */ - iterator mutable_iterator(const_iterator pos) { - return m_ht.mutable_iterator(pos); - } - - /** - * Requires index <= size(). - * - * Return an iterator to the element at index. Return end() if index == size(). - */ - iterator nth(size_type index) { return m_ht.nth(index); } - - /** - * @copydoc nth(size_type index) - */ - const_iterator nth(size_type index) const { return m_ht.nth(index); } - - - /** - * Return const_reference to the first element. Requires the container to not be empty. - */ - const_reference front() const { return m_ht.front(); } - - /** - * Return const_reference to the last element. Requires the container to not be empty. - */ - const_reference back() const { return m_ht.back(); } - - - /** - * Only available if ValueTypeContainer is a std::vector. Same as calling 'values_container().data()'. - */ - template::value>::type* = nullptr> - const typename values_container_type::value_type* data() const noexcept { return m_ht.data(); } - - /** - * Return the container in which the values are stored. The values are in the same order as the insertion order - * and are contiguous in the structure, no holes (size() == values_container().size()). - */ - const values_container_type& values_container() const noexcept { return m_ht.values_container(); } - - template::value>::type* = nullptr> - size_type capacity() const noexcept { return m_ht.capacity(); } - - void shrink_to_fit() { m_ht.shrink_to_fit(); } - - - - /** - * Insert the value before pos shifting all the elements on the right of pos (including pos) one position - * to the right. - * - * Amortized linear time-complexity in the distance between pos and end(). - */ - std::pair insert_at_position(const_iterator pos, const value_type& value) { - return m_ht.insert_at_position(pos, value); - } - - /** - * @copydoc insert_at_position(const_iterator pos, const value_type& value) - */ - std::pair insert_at_position(const_iterator pos, value_type&& value) { - return m_ht.insert_at_position(pos, std::move(value)); - } - - /** - * @copydoc insert_at_position(const_iterator pos, const value_type& value) - * - * Same as insert_at_position(pos, value_type(std::forward(args)...), mainly - * here for coherence. - */ - template - std::pair emplace_at_position(const_iterator pos, Args&&... args) { - return m_ht.emplace_at_position(pos, std::forward(args)...); - } - - /** - * @copydoc insert_at_position(const_iterator pos, const value_type& value) - */ - template - std::pair try_emplace_at_position(const_iterator pos, const key_type& k, Args&&... args) { - return m_ht.try_emplace_at_position(pos, k, std::forward(args)...); - } - - /** - * @copydoc insert_at_position(const_iterator pos, const value_type& value) - */ - template - std::pair try_emplace_at_position(const_iterator pos, key_type&& k, Args&&... args) { - return m_ht.try_emplace_at_position(pos, std::move(k), std::forward(args)...); - } - - - - void pop_back() { m_ht.pop_back(); } - - /** - * Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order. - * - * If an erasure occurs, the last element of the map will take the place of the erased element. - */ - iterator unordered_erase(iterator pos) { return m_ht.unordered_erase(pos); } - - /** - * @copydoc unordered_erase(iterator pos) - */ - iterator unordered_erase(const_iterator pos) { return m_ht.unordered_erase(pos); } - - /** - * @copydoc unordered_erase(iterator pos) - */ - size_type unordered_erase(const key_type& key) { return m_ht.unordered_erase(key); } - - /** - * @copydoc unordered_erase(iterator pos) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - size_type unordered_erase(const key_type& key, std::size_t precalculated_hash) { - return m_ht.unordered_erase(key, precalculated_hash); - } - - /** - * @copydoc unordered_erase(iterator pos) - * - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type unordered_erase(const K& key) { return m_ht.unordered_erase(key); } - - /** - * @copydoc unordered_erase(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - size_type unordered_erase(const K& key, std::size_t precalculated_hash) { - return m_ht.unordered_erase(key, precalculated_hash); - } - - - - friend bool operator==(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht == rhs.m_ht; } - friend bool operator!=(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht != rhs.m_ht; } - friend bool operator<(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht < rhs.m_ht; } - friend bool operator<=(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht <= rhs.m_ht; } - friend bool operator>(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht > rhs.m_ht; } - friend bool operator>=(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht >= rhs.m_ht; } - - friend void swap(ordered_map& lhs, ordered_map& rhs) { lhs.swap(rhs); } + /** + * @copydoc erase(iterator pos) + */ + iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); } + + /** + * @copydoc erase(iterator pos) + */ + size_type erase(const key_type& key) { return m_ht.erase(key); } + + /** + * @copydoc erase(iterator pos) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup to the value if you already have the hash. + */ + size_type erase(const key_type& key, std::size_t precalculated_hash) { + return m_ht.erase(key, precalculated_hash); + } + + /** + * @copydoc erase(iterator pos) + * + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type erase(const K& key) { return m_ht.erase(key); } + + /** + * @copydoc erase(const key_type& key, std::size_t precalculated_hash) + * + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type erase(const K& key, std::size_t precalculated_hash) { + return m_ht.erase(key, precalculated_hash); + } + + + void swap(ordered_map& other) noexcept { other.m_ht.swap(m_ht); } + + /* + * Lookup + */ + T& at(const Key& key) { return m_ht.at(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + T& at(const Key& key, std::size_t precalculated_hash) { return m_ht.at(key, precalculated_hash); } + + + const T& at(const Key& key) const { return m_ht.at(key); } + + /** + * @copydoc at(const Key& key, std::size_t precalculated_hash) + */ + const T& at(const Key& key, std::size_t precalculated_hash) const { return m_ht.at(key, precalculated_hash); } + + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + T& at(const K& key) { return m_ht.at(key); } + + /** + * @copydoc at(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + T& at(const K& key, std::size_t precalculated_hash) { return m_ht.at(key, precalculated_hash); } + + /** + * @copydoc at(const K& key) + */ + template::value>::type* = nullptr> + const T& at(const K& key) const { return m_ht.at(key); } + + /** + * @copydoc at(const K& key, std::size_t precalculated_hash) + */ + template::value>::type* = nullptr> + const T& at(const K& key, std::size_t precalculated_hash) const { return m_ht.at(key, precalculated_hash); } + + + + T& operator[](const Key& key) { return m_ht[key]; } + T& operator[](Key&& key) { return m_ht[std::move(key)]; } + + + + size_type count(const Key& key) const { return m_ht.count(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + size_type count(const Key& key, std::size_t precalculated_hash) const { + return m_ht.count(key, precalculated_hash); + } + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type count(const K& key) const { return m_ht.count(key); } + + /** + * @copydoc count(const K& key) const + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + size_type count(const K& key, std::size_t precalculated_hash) const { + return m_ht.count(key, precalculated_hash); + } + + + + iterator find(const Key& key) { return m_ht.find(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + iterator find(const Key& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } + + const_iterator find(const Key& key) const { return m_ht.find(key); } + + /** + * @copydoc find(const Key& key, std::size_t precalculated_hash) + */ + const_iterator find(const Key& key, std::size_t precalculated_hash) const { + return m_ht.find(key, precalculated_hash); + } + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + iterator find(const K& key) { return m_ht.find(key); } + + /** + * @copydoc find(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + iterator find(const K& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } + + /** + * @copydoc find(const K& key) + */ + template::value>::type* = nullptr> + const_iterator find(const K& key) const { return m_ht.find(key); } + + /** + * @copydoc find(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + const_iterator find(const K& key, std::size_t precalculated_hash) const { + return m_ht.find(key, precalculated_hash); + } + + + + std::pair equal_range(const Key& key) { return m_ht.equal_range(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + std::pair equal_range(const Key& key, std::size_t precalculated_hash) { + return m_ht.equal_range(key, precalculated_hash); + } + + std::pair equal_range(const Key& key) const { return m_ht.equal_range(key); } + + /** + * @copydoc equal_range(const Key& key, std::size_t precalculated_hash) + */ + std::pair equal_range(const Key& key, std::size_t precalculated_hash) const { + return m_ht.equal_range(key, precalculated_hash); + } + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key) { return m_ht.equal_range(key); } + + /** + * @copydoc equal_range(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key, std::size_t precalculated_hash) { + return m_ht.equal_range(key, precalculated_hash); + } + + /** + * @copydoc equal_range(const K& key) + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key) const { return m_ht.equal_range(key); } + + /** + * @copydoc equal_range(const K& key, std::size_t precalculated_hash) + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key, std::size_t precalculated_hash) const { + return m_ht.equal_range(key, precalculated_hash); + } + + + + /* + * Bucket interface + */ + size_type bucket_count() const { return m_ht.bucket_count(); } + size_type max_bucket_count() const { return m_ht.max_bucket_count(); } + + + /* + * Hash policy + */ + float load_factor() const { return m_ht.load_factor(); } + float max_load_factor() const { return m_ht.max_load_factor(); } + void max_load_factor(float ml) { m_ht.max_load_factor(ml); } + + void rehash(size_type count) { m_ht.rehash(count); } + void reserve(size_type count) { m_ht.reserve(count); } + + + /* + * Observers + */ + hasher hash_function() const { return m_ht.hash_function(); } + key_equal key_eq() const { return m_ht.key_eq(); } + + + + /* + * Other + */ + + /** + * Convert a const_iterator to an iterator. + */ + iterator mutable_iterator(const_iterator pos) { + return m_ht.mutable_iterator(pos); + } + + /** + * Requires index <= size(). + * + * Return an iterator to the element at index. Return end() if index == size(). + */ + iterator nth(size_type index) { return m_ht.nth(index); } + + /** + * @copydoc nth(size_type index) + */ + const_iterator nth(size_type index) const { return m_ht.nth(index); } + + + /** + * Return const_reference to the first element. Requires the container to not be empty. + */ + const_reference front() const { return m_ht.front(); } + + /** + * Return const_reference to the last element. Requires the container to not be empty. + */ + const_reference back() const { return m_ht.back(); } + + + /** + * Only available if ValueTypeContainer is a std::vector. Same as calling 'values_container().data()'. + */ + template::value>::type* = nullptr> + const typename values_container_type::value_type* data() const noexcept { return m_ht.data(); } + + /** + * Return the container in which the values are stored. The values are in the same order as the insertion order + * and are contiguous in the structure, no holes (size() == values_container().size()). + */ + const values_container_type& values_container() const noexcept { return m_ht.values_container(); } + + template::value>::type* = nullptr> + size_type capacity() const noexcept { return m_ht.capacity(); } + + void shrink_to_fit() { m_ht.shrink_to_fit(); } + + + + /** + * Insert the value before pos shifting all the elements on the right of pos (including pos) one position + * to the right. + * + * Amortized linear time-complexity in the distance between pos and end(). + */ + std::pair insert_at_position(const_iterator pos, const value_type& value) { + return m_ht.insert_at_position(pos, value); + } + + /** + * @copydoc insert_at_position(const_iterator pos, const value_type& value) + */ + std::pair insert_at_position(const_iterator pos, value_type&& value) { + return m_ht.insert_at_position(pos, std::move(value)); + } + + /** + * @copydoc insert_at_position(const_iterator pos, const value_type& value) + * + * Same as insert_at_position(pos, value_type(std::forward(args)...), mainly + * here for coherence. + */ + template + std::pair emplace_at_position(const_iterator pos, Args&&... args) { + return m_ht.emplace_at_position(pos, std::forward(args)...); + } + + /** + * @copydoc insert_at_position(const_iterator pos, const value_type& value) + */ + template + std::pair try_emplace_at_position(const_iterator pos, const key_type& k, Args&&... args) { + return m_ht.try_emplace_at_position(pos, k, std::forward(args)...); + } + + /** + * @copydoc insert_at_position(const_iterator pos, const value_type& value) + */ + template + std::pair try_emplace_at_position(const_iterator pos, key_type&& k, Args&&... args) { + return m_ht.try_emplace_at_position(pos, std::move(k), std::forward(args)...); + } + + + + void pop_back() { m_ht.pop_back(); } + + /** + * Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order. + * + * If an erasure occurs, the last element of the map will take the place of the erased element. + */ + iterator unordered_erase(iterator pos) { return m_ht.unordered_erase(pos); } + + /** + * @copydoc unordered_erase(iterator pos) + */ + iterator unordered_erase(const_iterator pos) { return m_ht.unordered_erase(pos); } + + /** + * @copydoc unordered_erase(iterator pos) + */ + size_type unordered_erase(const key_type& key) { return m_ht.unordered_erase(key); } + + /** + * @copydoc unordered_erase(iterator pos) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + size_type unordered_erase(const key_type& key, std::size_t precalculated_hash) { + return m_ht.unordered_erase(key, precalculated_hash); + } + + /** + * @copydoc unordered_erase(iterator pos) + * + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type unordered_erase(const K& key) { return m_ht.unordered_erase(key); } + + /** + * @copydoc unordered_erase(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + size_type unordered_erase(const K& key, std::size_t precalculated_hash) { + return m_ht.unordered_erase(key, precalculated_hash); + } + + + + friend bool operator==(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht == rhs.m_ht; } + friend bool operator!=(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht != rhs.m_ht; } + friend bool operator<(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht < rhs.m_ht; } + friend bool operator<=(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht <= rhs.m_ht; } + friend bool operator>(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht > rhs.m_ht; } + friend bool operator>=(const ordered_map& lhs, const ordered_map& rhs) { return lhs.m_ht >= rhs.m_ht; } + + friend void swap(ordered_map& lhs, ordered_map& rhs) { lhs.swap(rhs); } private: - ht m_ht; + ht m_ht; }; } // end namespace tsl diff --git a/Foundation/include/Poco/ordered_set.h b/Foundation/include/Poco/ordered_set.h index db7075299..e8a19cf60 100644 --- a/Foundation/include/Poco/ordered_set.h +++ b/Foundation/include/Poco/ordered_set.h @@ -62,579 +62,579 @@ namespace tsl { * Otherwise all the iterators are invalidated if an erase occurs. */ template, - class KeyEqual = std::equal_to, - class Allocator = std::allocator, - class ValueTypeContainer = std::deque> + class Hash = std::hash, + class KeyEqual = std::equal_to, + class Allocator = std::allocator, + class ValueTypeContainer = std::deque> class ordered_set { private: - template - using has_is_transparent = tsl::detail_ordered_hash::has_is_transparent; + template + using has_is_transparent = tsl::detail_ordered_hash::has_is_transparent; - class KeySelect { - public: - using key_type = Key; + class KeySelect { + public: + using key_type = Key; - const key_type& operator()(const Key& key) const noexcept { - return key; - } + const key_type& operator()(const Key& key) const noexcept { + return key; + } - key_type& operator()(Key& key) noexcept { - return key; - } - }; + key_type& operator()(Key& key) noexcept { + return key; + } + }; - using ht = detail_ordered_hash::ordered_hash; + using ht = detail_ordered_hash::ordered_hash; public: - using key_type = typename ht::key_type; - using value_type = typename ht::value_type; - using size_type = typename ht::size_type; - using difference_type = typename ht::difference_type; - using hasher = typename ht::hasher; - using key_equal = typename ht::key_equal; - using allocator_type = typename ht::allocator_type; - using reference = typename ht::reference; - using const_reference = typename ht::const_reference; - using pointer = typename ht::pointer; - using const_pointer = typename ht::const_pointer; - using iterator = typename ht::iterator; - using const_iterator = typename ht::const_iterator; - using reverse_iterator = typename ht::reverse_iterator; - using const_reverse_iterator = typename ht::const_reverse_iterator; - - using values_container_type = typename ht::values_container_type; - - - /* - * Constructors - */ - ordered_set(): ordered_set(ht::DEFAULT_INIT_BUCKETS_SIZE) { - } - - explicit ordered_set(size_type bucket_count, - const Hash& hash = Hash(), - const KeyEqual& equal = KeyEqual(), - const Allocator& alloc = Allocator()): - m_ht(bucket_count, hash, equal, alloc, ht::DEFAULT_MAX_LOAD_FACTOR) - { - } - - ordered_set(size_type bucket_count, - const Allocator& alloc): ordered_set(bucket_count, Hash(), KeyEqual(), alloc) - { - } - - ordered_set(size_type bucket_count, - const Hash& hash, - const Allocator& alloc): ordered_set(bucket_count, hash, KeyEqual(), alloc) - { - } - - explicit ordered_set(const Allocator& alloc): ordered_set(ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) { - } - - template - ordered_set(InputIt first, InputIt last, - size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, - const Hash& hash = Hash(), - const KeyEqual& equal = KeyEqual(), - const Allocator& alloc = Allocator()): ordered_set(bucket_count, hash, equal, alloc) - { - insert(first, last); - } - - template - ordered_set(InputIt first, InputIt last, - size_type bucket_count, - const Allocator& alloc): ordered_set(first, last, bucket_count, Hash(), KeyEqual(), alloc) - { - } - - template - ordered_set(InputIt first, InputIt last, - size_type bucket_count, - const Hash& hash, - const Allocator& alloc): ordered_set(first, last, bucket_count, hash, KeyEqual(), alloc) - { - } - - ordered_set(std::initializer_list init, - size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, - const Hash& hash = Hash(), - const KeyEqual& equal = KeyEqual(), - const Allocator& alloc = Allocator()): - ordered_set(init.begin(), init.end(), bucket_count, hash, equal, alloc) - { - } - - ordered_set(std::initializer_list init, - size_type bucket_count, - const Allocator& alloc): - ordered_set(init.begin(), init.end(), bucket_count, Hash(), KeyEqual(), alloc) - { - } - - ordered_set(std::initializer_list init, - size_type bucket_count, - const Hash& hash, - const Allocator& alloc): - ordered_set(init.begin(), init.end(), bucket_count, hash, KeyEqual(), alloc) - { - } - - - ordered_set& operator=(std::initializer_list ilist) { - m_ht.clear(); - - m_ht.reserve(ilist.size()); - m_ht.insert(ilist.begin(), ilist.end()); - - return *this; - } - - allocator_type get_allocator() const { return m_ht.get_allocator(); } - - - /* - * Iterators - */ - iterator begin() noexcept { return m_ht.begin(); } - const_iterator begin() const noexcept { return m_ht.begin(); } - const_iterator cbegin() const noexcept { return m_ht.cbegin(); } - - iterator end() noexcept { return m_ht.end(); } - const_iterator end() const noexcept { return m_ht.end(); } - const_iterator cend() const noexcept { return m_ht.cend(); } - - reverse_iterator rbegin() noexcept { return m_ht.rbegin(); } - const_reverse_iterator rbegin() const noexcept { return m_ht.rbegin(); } - const_reverse_iterator rcbegin() const noexcept { return m_ht.rcbegin(); } - - reverse_iterator rend() noexcept { return m_ht.rend(); } - const_reverse_iterator rend() const noexcept { return m_ht.rend(); } - const_reverse_iterator rcend() const noexcept { return m_ht.rcend(); } - - - /* - * Capacity - */ - bool empty() const noexcept { return m_ht.empty(); } - size_type size() const noexcept { return m_ht.size(); } - size_type max_size() const noexcept { return m_ht.max_size(); } - - /* - * Modifiers - */ - void clear() noexcept { m_ht.clear(); } - - - - std::pair insert(const value_type& value) { return m_ht.insert(value); } - std::pair insert(value_type&& value) { return m_ht.insert(std::move(value)); } - - iterator insert(const_iterator hint, const value_type& value) { - return m_ht.insert(hint, value); - } - - iterator insert(const_iterator hint, value_type&& value) { - return m_ht.insert(hint, std::move(value)); - } - - template - void insert(InputIt first, InputIt last) { m_ht.insert(first, last); } - void insert(std::initializer_list ilist) { m_ht.insert(ilist.begin(), ilist.end()); } - - - - /** - * Due to the way elements are stored, emplace will need to move or copy the key-value once. - * The method is equivalent to insert(value_type(std::forward(args)...)); - * - * Mainly here for compatibility with the std::unordered_map interface. - */ - template - std::pair emplace(Args&&... args) { return m_ht.emplace(std::forward(args)...); } - - /** - * Due to the way elements are stored, emplace_hint will need to move or copy the key-value once. - * The method is equivalent to insert(hint, value_type(std::forward(args)...)); - * - * Mainly here for compatibility with the std::unordered_map interface. - */ - template - iterator emplace_hint(const_iterator hint, Args&&... args) { - return m_ht.emplace_hint(hint, std::forward(args)...); - } - - /** - * When erasing an element, the insert order will be preserved and no holes will be present in the container - * returned by 'values_container()'. - * - * The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) - * average complexity. - */ - iterator erase(iterator pos) { return m_ht.erase(pos); } - - /** - * @copydoc erase(iterator pos) - */ - iterator erase(const_iterator pos) { return m_ht.erase(pos); } - - /** - * @copydoc erase(iterator pos) - */ - iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); } - - /** - * @copydoc erase(iterator pos) - */ - size_type erase(const key_type& key) { return m_ht.erase(key); } - - /** - * @copydoc erase(iterator pos) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup to the value if you already have the hash. - */ - size_type erase(const key_type& key, std::size_t precalculated_hash) { - return m_ht.erase(key, precalculated_hash); - } - - /** - * @copydoc erase(iterator pos) - * - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type erase(const K& key) { return m_ht.erase(key); } - - /** - * @copydoc erase(const key_type& key, std::size_t precalculated_hash) - * - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type erase(const K& key, std::size_t precalculated_hash) { - return m_ht.erase(key, precalculated_hash); - } - - - - void swap(ordered_set& other) noexcept { other.m_ht.swap(m_ht); } - - /* - * Lookup - */ - size_type count(const Key& key) const { return m_ht.count(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - size_type count(const Key& key, std::size_t precalculated_hash) const { - return m_ht.count(key, precalculated_hash); - } - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type count(const K& key) const { return m_ht.count(key); } - - /** - * @copydoc count(const K& key) const - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - size_type count(const K& key, std::size_t precalculated_hash) const { - return m_ht.count(key, precalculated_hash); - } - - - - - iterator find(const Key& key) { return m_ht.find(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - iterator find(const Key& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } - - const_iterator find(const Key& key) const { return m_ht.find(key); } - - /** - * @copydoc find(const Key& key, std::size_t precalculated_hash) - */ - const_iterator find(const Key& key, std::size_t precalculated_hash) const { - return m_ht.find(key, precalculated_hash); - } - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - iterator find(const K& key) { return m_ht.find(key); } - - /** - * @copydoc find(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - iterator find(const K& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } - - /** - * @copydoc find(const K& key) - */ - template::value>::type* = nullptr> - const_iterator find(const K& key) const { return m_ht.find(key); } - - /** - * @copydoc find(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - const_iterator find(const K& key, std::size_t precalculated_hash) const { - return m_ht.find(key, precalculated_hash); - } - - - - std::pair equal_range(const Key& key) { return m_ht.equal_range(key); } - - /** - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - std::pair equal_range(const Key& key, std::size_t precalculated_hash) { - return m_ht.equal_range(key, precalculated_hash); - } - - std::pair equal_range(const Key& key) const { return m_ht.equal_range(key); } - - /** - * @copydoc equal_range(const Key& key, std::size_t precalculated_hash) - */ - std::pair equal_range(const Key& key, std::size_t precalculated_hash) const { - return m_ht.equal_range(key, precalculated_hash); - } - - /** - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key) { return m_ht.equal_range(key); } - - /** - * @copydoc equal_range(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key, std::size_t precalculated_hash) { - return m_ht.equal_range(key, precalculated_hash); - } - - /** - * @copydoc equal_range(const K& key) - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key) const { return m_ht.equal_range(key); } - - /** - * @copydoc equal_range(const K& key, std::size_t precalculated_hash) - */ - template::value>::type* = nullptr> - std::pair equal_range(const K& key, std::size_t precalculated_hash) const { - return m_ht.equal_range(key, precalculated_hash); - } - - - /* - * Bucket interface - */ - size_type bucket_count() const { return m_ht.bucket_count(); } - size_type max_bucket_count() const { return m_ht.max_bucket_count(); } - - - /* - * Hash policy - */ - float load_factor() const { return m_ht.load_factor(); } - float max_load_factor() const { return m_ht.max_load_factor(); } - void max_load_factor(float ml) { m_ht.max_load_factor(ml); } - - void rehash(size_type count) { m_ht.rehash(count); } - void reserve(size_type count) { m_ht.reserve(count); } - - - /* - * Observers - */ - hasher hash_function() const { return m_ht.hash_function(); } - key_equal key_eq() const { return m_ht.key_eq(); } - - - /* - * Other - */ - - /** - * Convert a const_iterator to an iterator. - */ - iterator mutable_iterator(const_iterator pos) { - return m_ht.mutable_iterator(pos); - } - - /** - * Requires index <= size(). - * - * Return an iterator to the element at index. Return end() if index == size(). - */ - iterator nth(size_type index) { return m_ht.nth(index); } - - /** - * @copydoc nth(size_type index) - */ - const_iterator nth(size_type index) const { return m_ht.nth(index); } - - - /** - * Return const_reference to the first element. Requires the container to not be empty. - */ - const_reference front() const { return m_ht.front(); } - - /** - * Return const_reference to the last element. Requires the container to not be empty. - */ - const_reference back() const { return m_ht.back(); } - - - /** - * Only available if ValueTypeContainer is a std::vector. Same as calling 'values_container().data()'. - */ - template::value>::type* = nullptr> - const typename values_container_type::value_type* data() const noexcept { return m_ht.data(); } - - /** - * Return the container in which the values are stored. The values are in the same order as the insertion order - * and are contiguous in the structure, no holes (size() == values_container().size()). - */ - const values_container_type& values_container() const noexcept { return m_ht.values_container(); } - - template::value>::type* = nullptr> - size_type capacity() const noexcept { return m_ht.capacity(); } - - void shrink_to_fit() { m_ht.shrink_to_fit(); } - - - - /** - * Insert the value before pos shifting all the elements on the right of pos (including pos) one position - * to the right. - * - * Amortized linear time-complexity in the distance between pos and end(). - */ - std::pair insert_at_position(const_iterator pos, const value_type& value) { - return m_ht.insert_at_position(pos, value); - } - - /** - * @copydoc insert_at_position(const_iterator pos, const value_type& value) - */ - std::pair insert_at_position(const_iterator pos, value_type&& value) { - return m_ht.insert_at_position(pos, std::move(value)); - } - - /** - * @copydoc insert_at_position(const_iterator pos, const value_type& value) - * - * Same as insert_at_position(pos, value_type(std::forward(args)...), mainly - * here for coherence. - */ - template - std::pair emplace_at_position(const_iterator pos, Args&&... args) { - return m_ht.emplace_at_position(pos, std::forward(args)...); - } - - - - void pop_back() { m_ht.pop_back(); } - - /** - * Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order. - * - * If an erasure occurs, the last element of the map will take the place of the erased element. - */ - iterator unordered_erase(iterator pos) { return m_ht.unordered_erase(pos); } - - /** - * @copydoc unordered_erase(iterator pos) - */ - iterator unordered_erase(const_iterator pos) { return m_ht.unordered_erase(pos); } - - /** - * @copydoc unordered_erase(iterator pos) - */ - size_type unordered_erase(const key_type& key) { return m_ht.unordered_erase(key); } - - /** - * @copydoc unordered_erase(iterator pos) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - size_type unordered_erase(const key_type& key, std::size_t precalculated_hash) { - return m_ht.unordered_erase(key, precalculated_hash); - } - - /** - * @copydoc unordered_erase(iterator pos) - * - * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. - * If so, K must be hashable and comparable to Key. - */ - template::value>::type* = nullptr> - size_type unordered_erase(const K& key) { return m_ht.unordered_erase(key); } - - /** - * @copydoc unordered_erase(const K& key) - * - * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same - * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. - */ - template::value>::type* = nullptr> - size_type unordered_erase(const K& key, std::size_t precalculated_hash) { - return m_ht.unordered_erase(key, precalculated_hash); - } - - - - friend bool operator==(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht == rhs.m_ht; } - friend bool operator!=(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht != rhs.m_ht; } - friend bool operator<(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht < rhs.m_ht; } - friend bool operator<=(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht <= rhs.m_ht; } - friend bool operator>(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht > rhs.m_ht; } - friend bool operator>=(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht >= rhs.m_ht; } - - friend void swap(ordered_set& lhs, ordered_set& rhs) { lhs.swap(rhs); } + using key_type = typename ht::key_type; + using value_type = typename ht::value_type; + using size_type = typename ht::size_type; + using difference_type = typename ht::difference_type; + using hasher = typename ht::hasher; + using key_equal = typename ht::key_equal; + using allocator_type = typename ht::allocator_type; + using reference = typename ht::reference; + using const_reference = typename ht::const_reference; + using pointer = typename ht::pointer; + using const_pointer = typename ht::const_pointer; + using iterator = typename ht::iterator; + using const_iterator = typename ht::const_iterator; + using reverse_iterator = typename ht::reverse_iterator; + using const_reverse_iterator = typename ht::const_reverse_iterator; + + using values_container_type = typename ht::values_container_type; + + + /* + * Constructors + */ + ordered_set(): ordered_set(ht::DEFAULT_INIT_BUCKETS_SIZE) { + } + + explicit ordered_set(size_type bucket_count, + const Hash& hash = Hash(), + const KeyEqual& equal = KeyEqual(), + const Allocator& alloc = Allocator()): + m_ht(bucket_count, hash, equal, alloc, ht::DEFAULT_MAX_LOAD_FACTOR) + { + } + + ordered_set(size_type bucket_count, + const Allocator& alloc): ordered_set(bucket_count, Hash(), KeyEqual(), alloc) + { + } + + ordered_set(size_type bucket_count, + const Hash& hash, + const Allocator& alloc): ordered_set(bucket_count, hash, KeyEqual(), alloc) + { + } + + explicit ordered_set(const Allocator& alloc): ordered_set(ht::DEFAULT_INIT_BUCKETS_SIZE, alloc) { + } + + template + ordered_set(InputIt first, InputIt last, + size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, + const Hash& hash = Hash(), + const KeyEqual& equal = KeyEqual(), + const Allocator& alloc = Allocator()): ordered_set(bucket_count, hash, equal, alloc) + { + insert(first, last); + } + + template + ordered_set(InputIt first, InputIt last, + size_type bucket_count, + const Allocator& alloc): ordered_set(first, last, bucket_count, Hash(), KeyEqual(), alloc) + { + } + + template + ordered_set(InputIt first, InputIt last, + size_type bucket_count, + const Hash& hash, + const Allocator& alloc): ordered_set(first, last, bucket_count, hash, KeyEqual(), alloc) + { + } + + ordered_set(std::initializer_list init, + size_type bucket_count = ht::DEFAULT_INIT_BUCKETS_SIZE, + const Hash& hash = Hash(), + const KeyEqual& equal = KeyEqual(), + const Allocator& alloc = Allocator()): + ordered_set(init.begin(), init.end(), bucket_count, hash, equal, alloc) + { + } + + ordered_set(std::initializer_list init, + size_type bucket_count, + const Allocator& alloc): + ordered_set(init.begin(), init.end(), bucket_count, Hash(), KeyEqual(), alloc) + { + } + + ordered_set(std::initializer_list init, + size_type bucket_count, + const Hash& hash, + const Allocator& alloc): + ordered_set(init.begin(), init.end(), bucket_count, hash, KeyEqual(), alloc) + { + } + + + ordered_set& operator=(std::initializer_list ilist) { + m_ht.clear(); + + m_ht.reserve(ilist.size()); + m_ht.insert(ilist.begin(), ilist.end()); + + return *this; + } + + allocator_type get_allocator() const { return m_ht.get_allocator(); } + + + /* + * Iterators + */ + iterator begin() noexcept { return m_ht.begin(); } + const_iterator begin() const noexcept { return m_ht.begin(); } + const_iterator cbegin() const noexcept { return m_ht.cbegin(); } + + iterator end() noexcept { return m_ht.end(); } + const_iterator end() const noexcept { return m_ht.end(); } + const_iterator cend() const noexcept { return m_ht.cend(); } + + reverse_iterator rbegin() noexcept { return m_ht.rbegin(); } + const_reverse_iterator rbegin() const noexcept { return m_ht.rbegin(); } + const_reverse_iterator rcbegin() const noexcept { return m_ht.rcbegin(); } + + reverse_iterator rend() noexcept { return m_ht.rend(); } + const_reverse_iterator rend() const noexcept { return m_ht.rend(); } + const_reverse_iterator rcend() const noexcept { return m_ht.rcend(); } + + + /* + * Capacity + */ + bool empty() const noexcept { return m_ht.empty(); } + size_type size() const noexcept { return m_ht.size(); } + size_type max_size() const noexcept { return m_ht.max_size(); } + + /* + * Modifiers + */ + void clear() noexcept { m_ht.clear(); } + + + + std::pair insert(const value_type& value) { return m_ht.insert(value); } + std::pair insert(value_type&& value) { return m_ht.insert(std::move(value)); } + + iterator insert(const_iterator hint, const value_type& value) { + return m_ht.insert(hint, value); + } + + iterator insert(const_iterator hint, value_type&& value) { + return m_ht.insert(hint, std::move(value)); + } + + template + void insert(InputIt first, InputIt last) { m_ht.insert(first, last); } + void insert(std::initializer_list ilist) { m_ht.insert(ilist.begin(), ilist.end()); } + + + + /** + * Due to the way elements are stored, emplace will need to move or copy the key-value once. + * The method is equivalent to insert(value_type(std::forward(args)...)); + * + * Mainly here for compatibility with the std::unordered_map interface. + */ + template + std::pair emplace(Args&&... args) { return m_ht.emplace(std::forward(args)...); } + + /** + * Due to the way elements are stored, emplace_hint will need to move or copy the key-value once. + * The method is equivalent to insert(hint, value_type(std::forward(args)...)); + * + * Mainly here for compatibility with the std::unordered_map interface. + */ + template + iterator emplace_hint(const_iterator hint, Args&&... args) { + return m_ht.emplace_hint(hint, std::forward(args)...); + } + + /** + * When erasing an element, the insert order will be preserved and no holes will be present in the container + * returned by 'values_container()'. + * + * The method is in O(n), if the order is not important 'unordered_erase(...)' method is faster with an O(1) + * average complexity. + */ + iterator erase(iterator pos) { return m_ht.erase(pos); } + + /** + * @copydoc erase(iterator pos) + */ + iterator erase(const_iterator pos) { return m_ht.erase(pos); } + + /** + * @copydoc erase(iterator pos) + */ + iterator erase(const_iterator first, const_iterator last) { return m_ht.erase(first, last); } + + /** + * @copydoc erase(iterator pos) + */ + size_type erase(const key_type& key) { return m_ht.erase(key); } + + /** + * @copydoc erase(iterator pos) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup to the value if you already have the hash. + */ + size_type erase(const key_type& key, std::size_t precalculated_hash) { + return m_ht.erase(key, precalculated_hash); + } + + /** + * @copydoc erase(iterator pos) + * + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type erase(const K& key) { return m_ht.erase(key); } + + /** + * @copydoc erase(const key_type& key, std::size_t precalculated_hash) + * + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type erase(const K& key, std::size_t precalculated_hash) { + return m_ht.erase(key, precalculated_hash); + } + + + + void swap(ordered_set& other) noexcept { other.m_ht.swap(m_ht); } + + /* + * Lookup + */ + size_type count(const Key& key) const { return m_ht.count(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + size_type count(const Key& key, std::size_t precalculated_hash) const { + return m_ht.count(key, precalculated_hash); + } + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type count(const K& key) const { return m_ht.count(key); } + + /** + * @copydoc count(const K& key) const + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + size_type count(const K& key, std::size_t precalculated_hash) const { + return m_ht.count(key, precalculated_hash); + } + + + + + iterator find(const Key& key) { return m_ht.find(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + iterator find(const Key& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } + + const_iterator find(const Key& key) const { return m_ht.find(key); } + + /** + * @copydoc find(const Key& key, std::size_t precalculated_hash) + */ + const_iterator find(const Key& key, std::size_t precalculated_hash) const { + return m_ht.find(key, precalculated_hash); + } + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + iterator find(const K& key) { return m_ht.find(key); } + + /** + * @copydoc find(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + iterator find(const K& key, std::size_t precalculated_hash) { return m_ht.find(key, precalculated_hash); } + + /** + * @copydoc find(const K& key) + */ + template::value>::type* = nullptr> + const_iterator find(const K& key) const { return m_ht.find(key); } + + /** + * @copydoc find(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + const_iterator find(const K& key, std::size_t precalculated_hash) const { + return m_ht.find(key, precalculated_hash); + } + + + + std::pair equal_range(const Key& key) { return m_ht.equal_range(key); } + + /** + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + std::pair equal_range(const Key& key, std::size_t precalculated_hash) { + return m_ht.equal_range(key, precalculated_hash); + } + + std::pair equal_range(const Key& key) const { return m_ht.equal_range(key); } + + /** + * @copydoc equal_range(const Key& key, std::size_t precalculated_hash) + */ + std::pair equal_range(const Key& key, std::size_t precalculated_hash) const { + return m_ht.equal_range(key, precalculated_hash); + } + + /** + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key) { return m_ht.equal_range(key); } + + /** + * @copydoc equal_range(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key, std::size_t precalculated_hash) { + return m_ht.equal_range(key, precalculated_hash); + } + + /** + * @copydoc equal_range(const K& key) + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key) const { return m_ht.equal_range(key); } + + /** + * @copydoc equal_range(const K& key, std::size_t precalculated_hash) + */ + template::value>::type* = nullptr> + std::pair equal_range(const K& key, std::size_t precalculated_hash) const { + return m_ht.equal_range(key, precalculated_hash); + } + + + /* + * Bucket interface + */ + size_type bucket_count() const { return m_ht.bucket_count(); } + size_type max_bucket_count() const { return m_ht.max_bucket_count(); } + + + /* + * Hash policy + */ + float load_factor() const { return m_ht.load_factor(); } + float max_load_factor() const { return m_ht.max_load_factor(); } + void max_load_factor(float ml) { m_ht.max_load_factor(ml); } + + void rehash(size_type count) { m_ht.rehash(count); } + void reserve(size_type count) { m_ht.reserve(count); } + + + /* + * Observers + */ + hasher hash_function() const { return m_ht.hash_function(); } + key_equal key_eq() const { return m_ht.key_eq(); } + + + /* + * Other + */ + + /** + * Convert a const_iterator to an iterator. + */ + iterator mutable_iterator(const_iterator pos) { + return m_ht.mutable_iterator(pos); + } + + /** + * Requires index <= size(). + * + * Return an iterator to the element at index. Return end() if index == size(). + */ + iterator nth(size_type index) { return m_ht.nth(index); } + + /** + * @copydoc nth(size_type index) + */ + const_iterator nth(size_type index) const { return m_ht.nth(index); } + + + /** + * Return const_reference to the first element. Requires the container to not be empty. + */ + const_reference front() const { return m_ht.front(); } + + /** + * Return const_reference to the last element. Requires the container to not be empty. + */ + const_reference back() const { return m_ht.back(); } + + + /** + * Only available if ValueTypeContainer is a std::vector. Same as calling 'values_container().data()'. + */ + template::value>::type* = nullptr> + const typename values_container_type::value_type* data() const noexcept { return m_ht.data(); } + + /** + * Return the container in which the values are stored. The values are in the same order as the insertion order + * and are contiguous in the structure, no holes (size() == values_container().size()). + */ + const values_container_type& values_container() const noexcept { return m_ht.values_container(); } + + template::value>::type* = nullptr> + size_type capacity() const noexcept { return m_ht.capacity(); } + + void shrink_to_fit() { m_ht.shrink_to_fit(); } + + + + /** + * Insert the value before pos shifting all the elements on the right of pos (including pos) one position + * to the right. + * + * Amortized linear time-complexity in the distance between pos and end(). + */ + std::pair insert_at_position(const_iterator pos, const value_type& value) { + return m_ht.insert_at_position(pos, value); + } + + /** + * @copydoc insert_at_position(const_iterator pos, const value_type& value) + */ + std::pair insert_at_position(const_iterator pos, value_type&& value) { + return m_ht.insert_at_position(pos, std::move(value)); + } + + /** + * @copydoc insert_at_position(const_iterator pos, const value_type& value) + * + * Same as insert_at_position(pos, value_type(std::forward(args)...), mainly + * here for coherence. + */ + template + std::pair emplace_at_position(const_iterator pos, Args&&... args) { + return m_ht.emplace_at_position(pos, std::forward(args)...); + } + + + + void pop_back() { m_ht.pop_back(); } + + /** + * Faster erase operation with an O(1) average complexity but it doesn't preserve the insertion order. + * + * If an erasure occurs, the last element of the map will take the place of the erased element. + */ + iterator unordered_erase(iterator pos) { return m_ht.unordered_erase(pos); } + + /** + * @copydoc unordered_erase(iterator pos) + */ + iterator unordered_erase(const_iterator pos) { return m_ht.unordered_erase(pos); } + + /** + * @copydoc unordered_erase(iterator pos) + */ + size_type unordered_erase(const key_type& key) { return m_ht.unordered_erase(key); } + + /** + * @copydoc unordered_erase(iterator pos) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + size_type unordered_erase(const key_type& key, std::size_t precalculated_hash) { + return m_ht.unordered_erase(key, precalculated_hash); + } + + /** + * @copydoc unordered_erase(iterator pos) + * + * This overload only participates in the overload resolution if the typedef KeyEqual::is_transparent exists. + * If so, K must be hashable and comparable to Key. + */ + template::value>::type* = nullptr> + size_type unordered_erase(const K& key) { return m_ht.unordered_erase(key); } + + /** + * @copydoc unordered_erase(const K& key) + * + * Use the hash value 'precalculated_hash' instead of hashing the key. The hash value should be the same + * as hash_function()(key). Usefull to speed-up the lookup if you already have the hash. + */ + template::value>::type* = nullptr> + size_type unordered_erase(const K& key, std::size_t precalculated_hash) { + return m_ht.unordered_erase(key, precalculated_hash); + } + + + + friend bool operator==(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht == rhs.m_ht; } + friend bool operator!=(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht != rhs.m_ht; } + friend bool operator<(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht < rhs.m_ht; } + friend bool operator<=(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht <= rhs.m_ht; } + friend bool operator>(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht > rhs.m_ht; } + friend bool operator>=(const ordered_set& lhs, const ordered_set& rhs) { return lhs.m_ht >= rhs.m_ht; } + + friend void swap(ordered_set& lhs, ordered_set& rhs) { lhs.swap(rhs); } private: - ht m_ht; + ht m_ht; }; } // end namespace tsl diff --git a/Foundation/samples/BinaryReaderWriter/src/BinaryReaderWriter.cpp b/Foundation/samples/BinaryReaderWriter/src/BinaryReaderWriter.cpp index c32dc507a..e82e8dddc 100644 --- a/Foundation/samples/BinaryReaderWriter/src/BinaryReaderWriter.cpp +++ b/Foundation/samples/BinaryReaderWriter/src/BinaryReaderWriter.cpp @@ -26,10 +26,10 @@ int main(int argc, char** argv) BinaryWriter writer(str); writer << true - << 'x' - << 42 - << 3.14159265 - << "foo bar"; + << 'x' + << 42 + << 3.14159265 + << "foo bar"; bool b; char c; @@ -39,16 +39,16 @@ int main(int argc, char** argv) BinaryReader reader(str); reader >> b - >> c - >> i - >> d - >> s; + >> c + >> i + >> d + >> s; std::cout << b << std::endl - << c << std::endl - << i << std::endl - << d << std::endl - << s << std::endl; + << c << std::endl + << i << std::endl + << d << std::endl + << s << std::endl; return 0; } diff --git a/Foundation/samples/URI/src/URI.cpp b/Foundation/samples/URI/src/URI.cpp index 8fecd047a..005eb6df8 100644 --- a/Foundation/samples/URI/src/URI.cpp +++ b/Foundation/samples/URI/src/URI.cpp @@ -22,10 +22,10 @@ int main(int argc, char** argv) URI uri1("http://www.appinf.com:81/sample?example-query#somewhere"); std::cout << "Scheme: " << uri1.getScheme() << std::endl - << "Authority: " << uri1.getAuthority() << std::endl - << "Path: " << uri1.getPath() << std::endl - << "Query: " << uri1.getQuery() << std::endl - << "Fragment: " << uri1.getFragment() << std::endl; + << "Authority: " << uri1.getAuthority() << std::endl + << "Path: " << uri1.getPath() << std::endl + << "Query: " << uri1.getQuery() << std::endl + << "Fragment: " << uri1.getFragment() << std::endl; URI uri2; uri2.setScheme("https"); diff --git a/Foundation/samples/base64decode/src/base64decode.cpp b/Foundation/samples/base64decode/src/base64decode.cpp index 1cc15bf4e..a7c00c02e 100644 --- a/Foundation/samples/base64decode/src/base64decode.cpp +++ b/Foundation/samples/base64decode/src/base64decode.cpp @@ -25,7 +25,7 @@ int main(int argc, char** argv) if (argc != 3) { std::cout << "usage: " << argv[0] << ": " << std::endl - << " read base64-encoded , decode it and write the result to " << std::endl; + << " read base64-encoded , decode it and write the result to " << std::endl; return 1; } diff --git a/Foundation/samples/base64encode/src/base64encode.cpp b/Foundation/samples/base64encode/src/base64encode.cpp index d20c9601e..71ae7414f 100644 --- a/Foundation/samples/base64encode/src/base64encode.cpp +++ b/Foundation/samples/base64encode/src/base64encode.cpp @@ -25,7 +25,7 @@ int main(int argc, char** argv) if (argc != 3) { std::cout << "usage: " << argv[0] << ": " << std::endl - << " read , base64-encode it and write the result to " << std::endl; + << " read , base64-encode it and write the result to " << std::endl; return 1; } diff --git a/Foundation/samples/deflate/src/deflate.cpp b/Foundation/samples/deflate/src/deflate.cpp index 46b28b4e5..18e315d6b 100644 --- a/Foundation/samples/deflate/src/deflate.cpp +++ b/Foundation/samples/deflate/src/deflate.cpp @@ -25,7 +25,7 @@ int main(int argc, char** argv) if (argc != 3) { std::cout << "usage: " << argv[0] << ": " << std::endl - << " read , deflate (compress) it and write the result to " << std::endl; + << " read , deflate (compress) it and write the result to " << std::endl; return 1; } diff --git a/Foundation/samples/hmacmd5/src/hmacmd5.cpp b/Foundation/samples/hmacmd5/src/hmacmd5.cpp index 4606a9ce4..0a39f200c 100644 --- a/Foundation/samples/hmacmd5/src/hmacmd5.cpp +++ b/Foundation/samples/hmacmd5/src/hmacmd5.cpp @@ -30,7 +30,7 @@ int main(int argc, char** argv) if (argc != 3) { std::cout << "usage: " << argv[0] << ": " << std::endl - << " create the HMAC-MD5 for , using " << std::endl; + << " create the HMAC-MD5 for , using " << std::endl; return 1; } diff --git a/Foundation/samples/inflate/src/inflate.cpp b/Foundation/samples/inflate/src/inflate.cpp index fbd48ec17..2f7acb002 100644 --- a/Foundation/samples/inflate/src/inflate.cpp +++ b/Foundation/samples/inflate/src/inflate.cpp @@ -25,7 +25,7 @@ int main(int argc, char** argv) if (argc != 3) { std::cout << "usage: " << argv[0] << ": " << std::endl - << " read deflated (compressed) , inflate it and write the result to " << std::endl; + << " read deflated (compressed) , inflate it and write the result to " << std::endl; return 1; } diff --git a/Foundation/samples/md5/src/md5.cpp b/Foundation/samples/md5/src/md5.cpp index 84a50cf13..f3502fd35 100644 --- a/Foundation/samples/md5/src/md5.cpp +++ b/Foundation/samples/md5/src/md5.cpp @@ -29,7 +29,7 @@ int main(int argc, char** argv) if (argc != 2) { std::cout << "usage: " << argv[0] << ": " << std::endl - << " create the MD5 digest for " << std::endl; + << " create the MD5 digest for " << std::endl; return 1; } diff --git a/Foundation/src/ASCIIEncoding.cpp b/Foundation/src/ASCIIEncoding.cpp index 862a0f5e7..280f3d2cd 100644 --- a/Foundation/src/ASCIIEncoding.cpp +++ b/Foundation/src/ASCIIEncoding.cpp @@ -23,7 +23,7 @@ const char* ASCIIEncoding::_names[] = { "US-ASCII", "ASCII", - NULL + nullptr }; diff --git a/Foundation/src/ActiveDispatcher.cpp b/Foundation/src/ActiveDispatcher.cpp index a39e5f7cf..4b2e24fd6 100644 --- a/Foundation/src/ActiveDispatcher.cpp +++ b/Foundation/src/ActiveDispatcher.cpp @@ -94,8 +94,8 @@ void ActiveDispatcher::run() ActiveRunnableBase::Ptr pRunnable = pMethodNf->runnable(); pRunnable->duplicate(); // run will release pRunnable->run(); - pRunnable = 0; - pNf = 0; + pRunnable = nullptr; + pNf = nullptr; pNf = _queue.waitDequeueNotification(); } } diff --git a/Foundation/src/BinaryReader.cpp b/Foundation/src/BinaryReader.cpp index aff078c1c..ebc1fed74 100644 --- a/Foundation/src/BinaryReader.cpp +++ b/Foundation/src/BinaryReader.cpp @@ -24,7 +24,7 @@ namespace Poco { BinaryReader::BinaryReader(std::istream& istr, StreamByteOrder byteOrder): _istr(istr), - _pTextConverter(0) + _pTextConverter(nullptr) { #if defined(POCO_ARCH_BIG_ENDIAN) _flipBytes = (byteOrder == LITTLE_ENDIAN_BYTE_ORDER); diff --git a/Foundation/src/BinaryWriter.cpp b/Foundation/src/BinaryWriter.cpp index ea389ac11..2d5a55670 100644 --- a/Foundation/src/BinaryWriter.cpp +++ b/Foundation/src/BinaryWriter.cpp @@ -24,7 +24,7 @@ namespace Poco { BinaryWriter::BinaryWriter(std::ostream& ostr, StreamByteOrder byteOrder): _ostr(ostr), - _pTextConverter(0) + _pTextConverter(nullptr) { #if defined(POCO_ARCH_BIG_ENDIAN) _flipBytes = (byteOrder == LITTLE_ENDIAN_BYTE_ORDER); diff --git a/Foundation/src/Bugcheck.cpp b/Foundation/src/Bugcheck.cpp index ec8046486..978a0fab8 100644 --- a/Foundation/src/Bugcheck.cpp +++ b/Foundation/src/Bugcheck.cpp @@ -38,7 +38,7 @@ void Bugcheck::assertion(const char* cond, const char* file, LineNumber line, co void Bugcheck::nullPointer(const char* ptr, const char* file, LineNumber line) { - Debugger::enter(std::string("NULL pointer: ") + ptr, file, line); + Debugger::enter(std::string("nullptr pointer: ") + ptr, file, line); throw NullPointerException(what(ptr, file, line)); } @@ -46,7 +46,7 @@ void Bugcheck::nullPointer(const char* ptr, const char* file, LineNumber line) void Bugcheck::bugcheck(const char* file, LineNumber line) { Debugger::enter("Bugcheck", file, line); - throw BugcheckException(what(0, file, line)); + throw BugcheckException(what(nullptr, file, line)); } @@ -110,7 +110,7 @@ std::string Bugcheck::what(const char* msg, const char* file, LineNumber line, c { std::ostringstream str; if (msg) str << msg << " "; - if (text != NULL) str << "(" << text << ") "; + if (text != nullptr) str << "(" << text << ") "; str << "in file \"" << file << "\", line " << line; return str.str(); } diff --git a/Foundation/src/CountingStream.cpp b/Foundation/src/CountingStream.cpp index 7b4b7ccf5..51acaca1c 100644 --- a/Foundation/src/CountingStream.cpp +++ b/Foundation/src/CountingStream.cpp @@ -19,8 +19,8 @@ namespace Poco { CountingStreamBuf::CountingStreamBuf(): - _pIstr(0), - _pOstr(0), + _pIstr(nullptr), + _pOstr(nullptr), _chars(0), _lines(0), _pos(0) @@ -30,7 +30,7 @@ CountingStreamBuf::CountingStreamBuf(): CountingStreamBuf::CountingStreamBuf(std::istream& istr): _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _chars(0), _lines(0), _pos(0) @@ -39,7 +39,7 @@ CountingStreamBuf::CountingStreamBuf(std::istream& istr): CountingStreamBuf::CountingStreamBuf(std::ostream& ostr): - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _chars(0), _lines(0), diff --git a/Foundation/src/DateTimeFormat.cpp b/Foundation/src/DateTimeFormat.cpp index 0e296323f..94974f9d3 100644 --- a/Foundation/src/DateTimeFormat.cpp +++ b/Foundation/src/DateTimeFormat.cpp @@ -137,22 +137,22 @@ bool DateTimeFormat::hasFormat(const std::string& fmt) bool DateTimeFormat::isValid(const std::string& dateTime) { - static const RegularExpression regexList[] = { - RegularExpression(DateTimeFormat::ISO8601_REGEX), - RegularExpression(DateTimeFormat::RFC822_REGEX), - RegularExpression(DateTimeFormat::RFC1123_REGEX), - RegularExpression(DateTimeFormat::HTTP_REGEX), - RegularExpression(DateTimeFormat::RFC850_REGEX), - RegularExpression(DateTimeFormat::RFC1036_REGEX), - RegularExpression(DateTimeFormat::ASCTIME_REGEX), - RegularExpression(DateTimeFormat::SORTABLE_REGEX) - }; + static const RegularExpression regexList[] = { + RegularExpression(DateTimeFormat::ISO8601_REGEX), + RegularExpression(DateTimeFormat::RFC822_REGEX), + RegularExpression(DateTimeFormat::RFC1123_REGEX), + RegularExpression(DateTimeFormat::HTTP_REGEX), + RegularExpression(DateTimeFormat::RFC850_REGEX), + RegularExpression(DateTimeFormat::RFC1036_REGEX), + RegularExpression(DateTimeFormat::ASCTIME_REGEX), + RegularExpression(DateTimeFormat::SORTABLE_REGEX) + }; - for (const auto& f : regexList) - { - if (f.match(dateTime)) return true; - } - return false; + for (const auto& f : regexList) + { + if (f.match(dateTime)) return true; + } + return false; } diff --git a/Foundation/src/DateTimeFormatter.cpp b/Foundation/src/DateTimeFormatter.cpp index 7eb2969a6..aa4b1eecb 100644 --- a/Foundation/src/DateTimeFormatter.cpp +++ b/Foundation/src/DateTimeFormatter.cpp @@ -58,9 +58,9 @@ void DateTimeFormatter::append(std::string& str, const DateTime& dateTime, const case 'M': NumberFormatter::append0(str, dateTime.minute(), 2); break; case 'S': NumberFormatter::append0(str, dateTime.second(), 2); break; case 's': NumberFormatter::append0(str, dateTime.second(), 2); - str += '.'; - NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); - break; + str += '.'; + NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); + break; case 'i': NumberFormatter::append0(str, dateTime.millisecond(), 3); break; case 'c': NumberFormatter::append(str, dateTime.millisecond()/100); break; case 'F': NumberFormatter::append0(str, dateTime.millisecond()*1000 + dateTime.microsecond(), 6); break; diff --git a/Foundation/src/DeflatingStream.cpp b/Foundation/src/DeflatingStream.cpp index 31b93a09e..875728468 100644 --- a/Foundation/src/DeflatingStream.cpp +++ b/Foundation/src/DeflatingStream.cpp @@ -24,7 +24,7 @@ namespace Poco { DeflatingStreamBuf::DeflatingStreamBuf(std::istream& istr, StreamType type, int level): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in), _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _eof(false) { std::unique_ptr buffer(new char[DEFLATE_BUFFER_SIZE]); @@ -44,7 +44,7 @@ DeflatingStreamBuf::DeflatingStreamBuf(std::istream& istr, StreamType type, int DeflatingStreamBuf::DeflatingStreamBuf(std::istream& istr, int windowBits, int level): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in), _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _eof(false) { std::unique_ptr buffer(new char[DEFLATE_BUFFER_SIZE]); @@ -63,7 +63,7 @@ DeflatingStreamBuf::DeflatingStreamBuf(std::istream& istr, int windowBits, int l DeflatingStreamBuf::DeflatingStreamBuf(std::ostream& ostr, StreamType type, int level): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _eof(false) { @@ -83,7 +83,7 @@ DeflatingStreamBuf::DeflatingStreamBuf(std::ostream& ostr, StreamType type, int DeflatingStreamBuf::DeflatingStreamBuf(std::ostream& ostr, int windowBits, int level): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _eof(false) { @@ -119,7 +119,7 @@ DeflatingStreamBuf::~DeflatingStreamBuf() int DeflatingStreamBuf::close() { BufferedStreamBuf::sync(); - _pIstr = 0; + _pIstr = nullptr; if (_pOstr) { if (_pZstr->next_out) @@ -141,7 +141,7 @@ int DeflatingStreamBuf::close() } } _pOstr->flush(); - _pOstr = 0; + _pOstr = nullptr; } return 0; } @@ -198,7 +198,7 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length) } else { - _pZstr->next_in = 0; + _pZstr->next_in = nullptr; _pZstr->avail_in = 0; _eof = true; } @@ -210,7 +210,7 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length) int rc = deflate(_pZstr, _eof ? Z_FINISH : Z_NO_FLUSH); if (_eof && rc == Z_STREAM_END) { - _pIstr = 0; + _pIstr = nullptr; return static_cast(length) - _pZstr->avail_out; } if (rc != Z_OK) throw IOException(zError(rc)); @@ -233,7 +233,7 @@ int DeflatingStreamBuf::readFromDevice(char* buffer, std::streamsize length) } else { - _pZstr->next_in = 0; + _pZstr->next_in = nullptr; _pZstr->avail_in = 0; _eof = true; } diff --git a/Foundation/src/DigestStream.cpp b/Foundation/src/DigestStream.cpp index 27394d1cc..0ceed3403 100644 --- a/Foundation/src/DigestStream.cpp +++ b/Foundation/src/DigestStream.cpp @@ -24,8 +24,8 @@ const int DigestBuf::BUFFER_SIZE = 256; DigestBuf::DigestBuf(DigestEngine& eng): BufferedStreamBuf(BUFFER_SIZE, std::ios::out), _eng(eng), - _pIstr(0), - _pOstr(0) + _pIstr(nullptr), + _pOstr(nullptr) { } @@ -34,7 +34,7 @@ DigestBuf::DigestBuf(DigestEngine& eng, std::istream& istr): BufferedStreamBuf(BUFFER_SIZE, std::ios::in), _eng(eng), _pIstr(&istr), - _pOstr(0) + _pOstr(nullptr) { } @@ -42,7 +42,7 @@ DigestBuf::DigestBuf(DigestEngine& eng, std::istream& istr): DigestBuf::DigestBuf(DigestEngine& eng, std::ostream& ostr): BufferedStreamBuf(BUFFER_SIZE, std::ios::out), _eng(eng), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr) { } diff --git a/Foundation/src/DirectoryIterator.cpp b/Foundation/src/DirectoryIterator.cpp index 432c593f9..ca6b6bb50 100644 --- a/Foundation/src/DirectoryIterator.cpp +++ b/Foundation/src/DirectoryIterator.cpp @@ -25,7 +25,7 @@ namespace Poco { -DirectoryIterator::DirectoryIterator(): _pImpl(0) +DirectoryIterator::DirectoryIterator(): _pImpl(nullptr) { } diff --git a/Foundation/src/DirectoryIteratorStrategy.cpp b/Foundation/src/DirectoryIteratorStrategy.cpp index 4737903a7..083ae3071 100644 --- a/Foundation/src/DirectoryIteratorStrategy.cpp +++ b/Foundation/src/DirectoryIteratorStrategy.cpp @@ -57,7 +57,7 @@ ChildrenFirstTraverse::ChildrenFirstTraverse(DepthFun depthDeterminer, UInt16 ma const std::string ChildrenFirstTraverse::next(Stack* itStack, bool* isFinished) { - // pointer mustn't point to NULL and iteration mustn't be finished + // pointer mustn't point to nullptr and iteration mustn't be finished poco_check_ptr(isFinished); poco_assert(!(*isFinished)); @@ -111,7 +111,7 @@ SiblingsFirstTraverse::SiblingsFirstTraverse(DepthFun depthDeterminer, UInt16 ma const std::string SiblingsFirstTraverse::next(Stack* itStack, bool* isFinished) { - // pointer mustn't point to NULL and iteration mustn't be finished + // pointer mustn't point to nullptr and iteration mustn't be finished poco_check_ptr(isFinished); poco_assert(!(*isFinished)); diff --git a/Foundation/src/DirectoryIterator_UNIX.cpp b/Foundation/src/DirectoryIterator_UNIX.cpp index 16be5051e..e128ddb73 100644 --- a/Foundation/src/DirectoryIterator_UNIX.cpp +++ b/Foundation/src/DirectoryIterator_UNIX.cpp @@ -24,7 +24,7 @@ namespace Poco { -DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _pDir(0), _rc(1) +DirectoryIteratorImpl::DirectoryIteratorImpl(const std::string& path): _pDir(nullptr), _rc(1) { Path p(path); p.makeFile(); diff --git a/Foundation/src/DirectoryWatcher.cpp b/Foundation/src/DirectoryWatcher.cpp index f8b574822..fd7b63d01 100644 --- a/Foundation/src/DirectoryWatcher.cpp +++ b/Foundation/src/DirectoryWatcher.cpp @@ -157,7 +157,7 @@ public: WindowsDirectoryWatcherStrategy(DirectoryWatcher& owner): DirectoryWatcherStrategy(owner) { - _hStopped = CreateEventW(NULL, FALSE, FALSE, NULL); + _hStopped = CreateEventW(nullptr, FALSE, FALSE, nullptr); if (!_hStopped) throw SystemException("cannot create event"); } @@ -303,7 +303,7 @@ public: tv.tv_sec = 0; tv.tv_usec = 200000; - if (select(_fd + 1, &fds, NULL, NULL, &tv) == 1) + if (select(_fd + 1, &fds, nullptr, nullptr, &tv) == 1) { int n = read(_fd, buffer.begin(), buffer.size()); int i = 0; diff --git a/Foundation/src/Environment_UNIX.cpp b/Foundation/src/Environment_UNIX.cpp index 46990dd36..9715809d1 100644 --- a/Foundation/src/Environment_UNIX.cpp +++ b/Foundation/src/Environment_UNIX.cpp @@ -50,7 +50,7 @@ bool EnvironmentImpl::hasImpl(const std::string& name) { FastMutex::ScopedLock lock(_mutex); - return getenv(name.c_str()) != 0; + return getenv(name.c_str()) != nullptr; } @@ -232,7 +232,7 @@ void EnvironmentImpl::nodeIdImpl(NodeId& id) int lastlen = 0; int len = 100*sizeof(struct ifreq); struct ifconf ifc; - char* buf = 0; + char* buf = nullptr; for (;;) { buf = new char[len]; diff --git a/Foundation/src/Error.cpp b/Foundation/src/Error.cpp index 78573ce2c..1355ea064 100644 --- a/Foundation/src/Error.cpp +++ b/Foundation/src/Error.cpp @@ -36,8 +36,8 @@ namespace Poco { { std::string errMsg; DWORD dwFlg = FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; - LPWSTR lpMsgBuf = 0; - if (FormatMessageW(dwFlg, 0, errorCode, 0, (LPWSTR) & lpMsgBuf, 0, NULL)) + LPWSTR lpMsgBuf = nullptr; + if (FormatMessageW(dwFlg, nullptr, errorCode, 0, (LPWSTR) & lpMsgBuf, 0, nullptr)) UnicodeConverter::toUTF8(lpMsgBuf, errMsg); LocalFree(lpMsgBuf); return errMsg; diff --git a/Foundation/src/EventLogChannel.cpp b/Foundation/src/EventLogChannel.cpp index 1f005fd4b..e9ee904a3 100644 --- a/Foundation/src/EventLogChannel.cpp +++ b/Foundation/src/EventLogChannel.cpp @@ -30,11 +30,11 @@ const std::string EventLogChannel::PROP_LOGFILE = "logfile"; EventLogChannel::EventLogChannel(): _logFile("Application"), - _h(0) + _h(nullptr) { const DWORD maxPathLen = MAX_PATH + 1; wchar_t name[maxPathLen]; - int n = GetModuleFileNameW(NULL, name, maxPathLen); + int n = GetModuleFileNameW(nullptr, name, maxPathLen); if (n > 0) { wchar_t* end = name + n - 1; @@ -49,7 +49,7 @@ EventLogChannel::EventLogChannel(): EventLogChannel::EventLogChannel(const std::string& name): _name(name), _logFile("Application"), - _h(0) + _h(nullptr) { } @@ -58,7 +58,7 @@ EventLogChannel::EventLogChannel(const std::string& name, const std::string& hos _name(name), _host(host), _logFile("Application"), - _h(0) + _h(nullptr) { } @@ -83,7 +83,7 @@ void EventLogChannel::open() UnicodeConverter::toUTF16(_host, uhost); std::wstring uname; UnicodeConverter::toUTF16(_name, uname); - _h = RegisterEventSourceW(uhost.empty() ? NULL : uhost.c_str(), uname.c_str()); + _h = RegisterEventSourceW(uhost.empty() ? nullptr : uhost.c_str(), uname.c_str()); if (!_h) throw SystemException("cannot register event source"); } @@ -91,7 +91,7 @@ void EventLogChannel::open() void EventLogChannel::close() { if (_h) DeregisterEventSource(_h); - _h = 0; + _h = nullptr; } @@ -101,7 +101,7 @@ void EventLogChannel::log(const Message& msg) std::wstring utext; UnicodeConverter::toUTF16(msg.getText(), utext); const wchar_t* pMsg = utext.c_str(); - ReportEventW(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, NULL, 1, 0, &pMsg, NULL); + ReportEventW(_h, getType(msg), getCategory(msg), POCO_MSG_LOG, nullptr, 1, 0, &pMsg, nullptr); } @@ -188,7 +188,7 @@ void EventLogChannel::setUpRegistry() const DWORD disp; std::wstring ukey; UnicodeConverter::toUTF16(key, ukey); - DWORD rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ukey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp); + DWORD rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ukey.c_str(), 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &hKey, &disp); if (rc != ERROR_SUCCESS) return; if (disp == REG_CREATED_NEW_KEY) diff --git a/Foundation/src/Event_POSIX.cpp b/Foundation/src/Event_POSIX.cpp index 833dddff5..7d5d377d6 100644 --- a/Foundation/src/Event_POSIX.cpp +++ b/Foundation/src/Event_POSIX.cpp @@ -57,7 +57,7 @@ EventImpl::EventImpl(bool autoReset): _auto(autoReset), _state(false) std::memset(&_mutex, 0, sizeof(_mutex)); #endif - if (pthread_mutex_init(&_mutex, NULL)) + if (pthread_mutex_init(&_mutex, nullptr)) throw SystemException("cannot create event (mutex)"); #if defined(POCO_HAVE_MONOTONIC_PTHREAD_COND_TIMEDWAIT) @@ -68,11 +68,11 @@ EventImpl::EventImpl(bool autoReset): _auto(autoReset), _state(false) throw SystemException("cannot create event (condition attribute)"); } if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) - { + { pthread_condattr_destroy(&attr); pthread_mutex_destroy(&_mutex); throw SystemException("cannot create event (condition attribute clock)"); - } + } if (pthread_cond_init(&_cond, &attr)) { pthread_condattr_destroy(&attr); @@ -81,7 +81,7 @@ EventImpl::EventImpl(bool autoReset): _auto(autoReset), _state(false) } pthread_condattr_destroy(&attr); #else - if (pthread_cond_init(&_cond, NULL)) + if (pthread_cond_init(&_cond, nullptr)) { pthread_mutex_destroy(&_mutex); throw SystemException("cannot create event (condition)"); @@ -143,7 +143,7 @@ bool EventImpl::waitImpl(long milliseconds) } #else struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); abstime.tv_sec = tv.tv_sec + milliseconds / 1000; abstime.tv_nsec = tv.tv_usec*1000 + (milliseconds % 1000)*1000000; if (abstime.tv_nsec >= 1000000000) diff --git a/Foundation/src/Event_WIN32.cpp b/Foundation/src/Event_WIN32.cpp index c6c399411..7d575c7ca 100644 --- a/Foundation/src/Event_WIN32.cpp +++ b/Foundation/src/Event_WIN32.cpp @@ -20,7 +20,7 @@ namespace Poco { EventImpl::EventImpl(bool autoReset) { - _event = CreateEventW(NULL, autoReset ? FALSE : TRUE, FALSE, NULL); + _event = CreateEventW(nullptr, autoReset ? FALSE : TRUE, FALSE, nullptr); if (!_event) throw SystemException("cannot create event"); } diff --git a/Foundation/src/Exception.cpp b/Foundation/src/Exception.cpp index c5acd4a5f..096f3d286 100644 --- a/Foundation/src/Exception.cpp +++ b/Foundation/src/Exception.cpp @@ -24,7 +24,7 @@ namespace Poco { -Exception::Exception(int code): _pNested(0), _code(code) +Exception::Exception(int code): _pNested(nullptr), _code(code) { #ifdef POCO_ENABLE_TRACE std::ostringstream ostr; @@ -35,7 +35,7 @@ Exception::Exception(int code): _pNested(0), _code(code) } -Exception::Exception(const std::string& msg, int code): _msg(msg), _pNested(0), _code(code) +Exception::Exception(const std::string& msg, int code): _msg(msg), _pNested(nullptr), _code(code) { #ifdef POCO_ENABLE_TRACE std::ostringstream ostr; @@ -46,7 +46,7 @@ Exception::Exception(const std::string& msg, int code): _msg(msg), _pNested(0), } -Exception::Exception(const std::string& msg, const std::string& arg, int code): _msg(msg), _pNested(0), _code(code) +Exception::Exception(const std::string& msg, const std::string& arg, int code): _msg(msg), _pNested(nullptr), _code(code) { if (!arg.empty()) { @@ -78,7 +78,7 @@ Exception::Exception(const Exception& exc): _msg(exc._msg), _code(exc._code) { - _pNested = exc._pNested ? exc._pNested->clone() : 0; + _pNested = exc._pNested ? exc._pNested->clone() : nullptr; } @@ -92,7 +92,7 @@ Exception& Exception::operator = (const Exception& exc) { if (&exc != this) { - Exception* newPNested = exc._pNested ? exc._pNested->clone() : 0; + Exception* newPNested = exc._pNested ? exc._pNested->clone() : nullptr; delete _pNested; _msg = exc._msg; _pNested = newPNested; diff --git a/Foundation/src/FIFOBufferStream.cpp b/Foundation/src/FIFOBufferStream.cpp index 232bc4811..90902868a 100644 --- a/Foundation/src/FIFOBufferStream.cpp +++ b/Foundation/src/FIFOBufferStream.cpp @@ -33,7 +33,7 @@ FIFOBufferStreamBuf::FIFOBufferStreamBuf(): FIFOBufferStreamBuf::FIFOBufferStreamBuf(FIFOBuffer& fifoBuffer): BufferedBidirectionalStreamBuf(fifoBuffer.size() + 4, std::ios::in | std::ios::out), - _pFIFOBuffer(0), + _pFIFOBuffer(nullptr), _fifoBuffer(fifoBuffer) { fifoBuffer.setNotify(true); @@ -144,7 +144,7 @@ void FIFOIOS::close() FIFOBufferStream::FIFOBufferStream(FIFOBuffer& fifoBuffer): FIFOIOS(fifoBuffer), - std::iostream(&_buf), + std::iostream(&_buf), readable(_buf.fifoBuffer().readable), writable(_buf.fifoBuffer().writable) { @@ -153,7 +153,7 @@ FIFOBufferStream::FIFOBufferStream(FIFOBuffer& fifoBuffer): FIFOBufferStream::FIFOBufferStream(char* pBuffer, std::size_t length): FIFOIOS(pBuffer, length), - std::iostream(&_buf), + std::iostream(&_buf), readable(_buf.fifoBuffer().readable), writable(_buf.fifoBuffer().writable) { @@ -162,7 +162,7 @@ FIFOBufferStream::FIFOBufferStream(char* pBuffer, std::size_t length): FIFOBufferStream::FIFOBufferStream(const char* pBuffer, std::size_t length): FIFOIOS(pBuffer, length), - std::iostream(&_buf), + std::iostream(&_buf), readable(_buf.fifoBuffer().readable), writable(_buf.fifoBuffer().writable) { @@ -171,7 +171,7 @@ FIFOBufferStream::FIFOBufferStream(const char* pBuffer, std::size_t length): FIFOBufferStream::FIFOBufferStream(std::size_t length): FIFOIOS(length), - std::iostream(&_buf), + std::iostream(&_buf), readable(_buf.fifoBuffer().readable), writable(_buf.fifoBuffer().writable) { diff --git a/Foundation/src/FileChannel.cpp b/Foundation/src/FileChannel.cpp index 81ae42471..d03371d3a 100644 --- a/Foundation/src/FileChannel.cpp +++ b/Foundation/src/FileChannel.cpp @@ -240,7 +240,7 @@ RotateStrategy* FileChannel::createRotationStrategy(const std::string& rotation, std::string unit; while (it != end && Ascii::isAlpha(*it)) unit += *it++; - RotateStrategy* pStrategy = 0; + RotateStrategy* pStrategy = nullptr; if ((rotation.find(',') != std::string::npos) || (rotation.find(':') != std::string::npos)) { if (times == "utc") diff --git a/Foundation/src/FileStream_WIN32.cpp b/Foundation/src/FileStream_WIN32.cpp index e24c9b18b..f8a1a9c5b 100644 --- a/Foundation/src/FileStream_WIN32.cpp +++ b/Foundation/src/FileStream_WIN32.cpp @@ -63,7 +63,7 @@ void FileStreamBuf::open(const std::string& path, std::ios::openmode mode) std::wstring utf16Path; FileImpl::convertPath(path, utf16Path); - _handle = ::CreateFileW(utf16Path.c_str(), access, shareMode, NULL, creationDisp, flags, NULL); + _handle = ::CreateFileW(utf16Path.c_str(), access, shareMode, nullptr, creationDisp, flags, nullptr); if (_handle == INVALID_HANDLE_VALUE) File::handleLastError(_path); @@ -98,7 +98,7 @@ int FileStreamBuf::readFromDevice(char* buffer, std::streamsize length) sync(); DWORD bytesRead(0); - BOOL rc = ::ReadFile(_handle, buffer, static_cast(length), &bytesRead, NULL); + BOOL rc = ::ReadFile(_handle, buffer, static_cast(length), &bytesRead, nullptr); if (rc == 0) { if (::GetLastError() == ERROR_BROKEN_PIPE) @@ -131,7 +131,7 @@ int FileStreamBuf::writeToDevice(const char* buffer, std::streamsize length) } DWORD bytesWritten(0); - BOOL rc = ::WriteFile(_handle, buffer, static_cast(length), &bytesWritten, NULL); + BOOL rc = ::WriteFile(_handle, buffer, static_cast(length), &bytesWritten, nullptr); if (rc == 0) File::handleLastError(_path); diff --git a/Foundation/src/File_WIN32U.cpp b/Foundation/src/File_WIN32U.cpp index e244110bb..7b223f038 100644 --- a/Foundation/src/File_WIN32U.cpp +++ b/Foundation/src/File_WIN32U.cpp @@ -340,7 +340,7 @@ void FileImpl::linkToImpl(const std::string& path, int type) const if (type == 0) { - if (CreateHardLinkW(upath.c_str(), _upath.c_str(), NULL) == 0) + if (CreateHardLinkW(upath.c_str(), _upath.c_str(), nullptr) == 0) handleLastErrorImpl(_path); } else @@ -417,7 +417,7 @@ FileImpl::FileSizeImpl FileImpl::totalSpaceImpl() const poco_assert(!_path.empty()); ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), NULL, &space, NULL)) + if (!GetDiskFreeSpaceExW(_upath.c_str(), nullptr, &space, nullptr)) handleLastErrorImpl(_path); return space.QuadPart; } @@ -428,7 +428,7 @@ FileImpl::FileSizeImpl FileImpl::usableSpaceImpl() const poco_assert(!_path.empty()); ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), &space, NULL, NULL)) + if (!GetDiskFreeSpaceExW(_upath.c_str(), &space, nullptr, nullptr)) handleLastErrorImpl(_path); return space.QuadPart; } @@ -439,7 +439,7 @@ FileImpl::FileSizeImpl FileImpl::freeSpaceImpl() const poco_assert(!_path.empty()); ULARGE_INTEGER space; - if (!GetDiskFreeSpaceExW(_upath.c_str(), NULL, NULL, &space)) + if (!GetDiskFreeSpaceExW(_upath.c_str(), nullptr, nullptr, &space)) handleLastErrorImpl(_path); return space.QuadPart; } diff --git a/Foundation/src/FormattingChannel.cpp b/Foundation/src/FormattingChannel.cpp index a884fd936..87d1eedf6 100644 --- a/Foundation/src/FormattingChannel.cpp +++ b/Foundation/src/FormattingChannel.cpp @@ -21,15 +21,15 @@ namespace Poco { FormattingChannel::FormattingChannel(): - _pFormatter(0), - _pChannel(0) + _pFormatter(nullptr), + _pChannel(nullptr) { } FormattingChannel::FormattingChannel(Formatter::Ptr pFormatter): _pFormatter(pFormatter), - _pChannel(0) + _pChannel(nullptr) { } diff --git a/Foundation/src/InflatingStream.cpp b/Foundation/src/InflatingStream.cpp index 4f103ceb6..9e5b06c3b 100644 --- a/Foundation/src/InflatingStream.cpp +++ b/Foundation/src/InflatingStream.cpp @@ -25,7 +25,7 @@ namespace Poco { InflatingStreamBuf::InflatingStreamBuf(std::istream& istr, StreamType type): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in), _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _eof(false), _check(type != STREAM_ZIP) { @@ -46,7 +46,7 @@ InflatingStreamBuf::InflatingStreamBuf(std::istream& istr, StreamType type): InflatingStreamBuf::InflatingStreamBuf(std::istream& istr, int windowBits): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in), _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _eof(false), _check(false) { @@ -66,7 +66,7 @@ InflatingStreamBuf::InflatingStreamBuf(std::istream& istr, int windowBits): InflatingStreamBuf::InflatingStreamBuf(std::ostream& ostr, StreamType type): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _eof(false), _check(type != STREAM_ZIP) @@ -87,7 +87,7 @@ InflatingStreamBuf::InflatingStreamBuf(std::ostream& ostr, StreamType type): InflatingStreamBuf::InflatingStreamBuf(std::ostream& ostr, int windowBits): BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _eof(false), _check(false) @@ -124,8 +124,8 @@ InflatingStreamBuf::~InflatingStreamBuf() int InflatingStreamBuf::close() { sync(); - _pIstr = 0; - _pOstr = 0; + _pIstr = nullptr; + _pOstr = nullptr; return 0; } diff --git a/Foundation/src/Latin1Encoding.cpp b/Foundation/src/Latin1Encoding.cpp index abab7a536..529e55c8a 100644 --- a/Foundation/src/Latin1Encoding.cpp +++ b/Foundation/src/Latin1Encoding.cpp @@ -24,7 +24,7 @@ const char* Latin1Encoding::_names[] = "ISO-8859-1", "Latin1", "Latin-1", - NULL + nullptr }; diff --git a/Foundation/src/Latin2Encoding.cpp b/Foundation/src/Latin2Encoding.cpp index 2d8e8ba01..89071339f 100644 --- a/Foundation/src/Latin2Encoding.cpp +++ b/Foundation/src/Latin2Encoding.cpp @@ -24,7 +24,7 @@ const char* Latin2Encoding::_names[] = "ISO-8859-2", "Latin2", "Latin-2", - NULL + nullptr }; diff --git a/Foundation/src/Latin9Encoding.cpp b/Foundation/src/Latin9Encoding.cpp index bb33b48db..d9e522287 100644 --- a/Foundation/src/Latin9Encoding.cpp +++ b/Foundation/src/Latin9Encoding.cpp @@ -24,7 +24,7 @@ const char* Latin9Encoding::_names[] = "ISO-8859-15", "Latin9", "Latin-9", - NULL + nullptr }; diff --git a/Foundation/src/LineEndingConverter.cpp b/Foundation/src/LineEndingConverter.cpp index 2f802fab9..e55482dd9 100644 --- a/Foundation/src/LineEndingConverter.cpp +++ b/Foundation/src/LineEndingConverter.cpp @@ -26,7 +26,7 @@ const std::string LineEnding::NEWLINE_LF("\n"); LineEndingConverterStreamBuf::LineEndingConverterStreamBuf(std::istream& istr): _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _newLine(LineEnding::NEWLINE_DEFAULT), _lastChar(0) { @@ -35,7 +35,7 @@ LineEndingConverterStreamBuf::LineEndingConverterStreamBuf(std::istream& istr): LineEndingConverterStreamBuf::LineEndingConverterStreamBuf(std::ostream& ostr): - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _newLine(LineEnding::NEWLINE_DEFAULT), _lastChar(0) diff --git a/Foundation/src/LocalDateTime.cpp b/Foundation/src/LocalDateTime.cpp index 7449d901f..8fce83cd7 100644 --- a/Foundation/src/LocalDateTime.cpp +++ b/Foundation/src/LocalDateTime.cpp @@ -267,9 +267,9 @@ void LocalDateTime::determineTzd(bool adjust) std::time_t epochTime = _dateTime.timestamp().epochTime(); #if defined(_WIN32) || defined(POCO_NO_POSIX_TSF) std::tm brokenBuf; - std::tm* broken = &brokenBuf; - errno_t err = localtime_s(broken, &epochTime); - if (err) broken = nullptr; + std::tm* broken = &brokenBuf; + errno_t err = localtime_s(broken, &epochTime); + if (err) broken = nullptr; if (!broken) throw Poco::SystemException("cannot get local time"); _tzd = Timezone::utcOffset() + Timezone::dst(_dateTime.timestamp()); diff --git a/Foundation/src/Logger.cpp b/Foundation/src/Logger.cpp index d473d44de..01c00c2a5 100644 --- a/Foundation/src/Logger.cpp +++ b/Foundation/src/Logger.cpp @@ -288,7 +288,7 @@ Logger& Logger::unsafeGet(const std::string& name) { if (name == ROOT) { - pLogger = new Logger(name, 0, Message::PRIO_INFORMATION); + pLogger = new Logger(name, nullptr, Message::PRIO_INFORMATION); } else { @@ -343,7 +343,7 @@ Logger::Ptr Logger::find(const std::string& name) LoggerMap::iterator it = _pLoggerMap->find(name); if (it != _pLoggerMap->end()) return it->second; } - return 0; + return nullptr; } diff --git a/Foundation/src/MD4Engine.cpp b/Foundation/src/MD4Engine.cpp index 918d20724..e37dcea55 100644 --- a/Foundation/src/MD4Engine.cpp +++ b/Foundation/src/MD4Engine.cpp @@ -176,16 +176,16 @@ const DigestEngine::Digest& MD4Engine::digest() /* FF, GG and HH are transformations for rounds 1, 2 and 3 */ /* Rotation is separate from addition to prevent recomputation */ #define FF(a, b, c, d, x, s) { \ - (a) += F ((b), (c), (d)) + (x); \ - (a) = ROTATE_LEFT ((a), (s)); \ + (a) += F ((b), (c), (d)) + (x); \ + (a) = ROTATE_LEFT ((a), (s)); \ } #define GG(a, b, c, d, x, s) { \ - (a) += G ((b), (c), (d)) + (x) + (UInt32)0x5a827999; \ - (a) = ROTATE_LEFT ((a), (s)); \ + (a) += G ((b), (c), (d)) + (x) + (UInt32)0x5a827999; \ + (a) = ROTATE_LEFT ((a), (s)); \ } #define HH(a, b, c, d, x, s) { \ - (a) += H ((b), (c), (d)) + (x) + (UInt32)0x6ed9eba1; \ - (a) = ROTATE_LEFT ((a), (s)); \ + (a) += H ((b), (c), (d)) + (x) + (UInt32)0x6ed9eba1; \ + (a) = ROTATE_LEFT ((a), (s)); \ } @@ -279,7 +279,7 @@ void MD4Engine::decode(UInt32* output, const unsigned char* input, std::size_t l for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UInt32)input[j]) | (((UInt32)input[j+1]) << 8) | - (((UInt32)input[j+2]) << 16) | (((UInt32)input[j+3]) << 24); + (((UInt32)input[j+2]) << 16) | (((UInt32)input[j+3]) << 24); } diff --git a/Foundation/src/MD5Engine.cpp b/Foundation/src/MD5Engine.cpp index 3c817cb88..0fda2d24d 100644 --- a/Foundation/src/MD5Engine.cpp +++ b/Foundation/src/MD5Engine.cpp @@ -310,7 +310,7 @@ void MD5Engine::decode(UInt32* output, const unsigned char* input, std::size_t l for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UInt32)input[j]) | (((UInt32)input[j+1]) << 8) | - (((UInt32)input[j+2]) << 16) | (((UInt32)input[j+3]) << 24); + (((UInt32)input[j+2]) << 16) | (((UInt32)input[j+3]) << 24); } diff --git a/Foundation/src/Message.cpp b/Foundation/src/Message.cpp index 57966f9f5..0374a28e1 100644 --- a/Foundation/src/Message.cpp +++ b/Foundation/src/Message.cpp @@ -29,9 +29,9 @@ Message::Message(): _tid(0), _ostid(0), _pid(0), - _file(0), + _file(nullptr), _line(0), - _pMap(0) + _pMap(nullptr) { init(); } @@ -44,9 +44,9 @@ Message::Message(const std::string& source, const std::string& text, Priority pr _tid(0), _ostid(0), _pid(0), - _file(0), + _file(nullptr), _line(0), - _pMap(0) + _pMap(nullptr) { init(); } @@ -61,7 +61,7 @@ Message::Message(const std::string& source, const std::string& text, Priority pr _pid(0), _file(file), _line(line), - _pMap(0) + _pMap(nullptr) { init(); } @@ -82,7 +82,7 @@ Message::Message(const Message& msg): if (msg._pMap) _pMap = new StringMap(*msg._pMap); else - _pMap = 0; + _pMap = nullptr; } @@ -118,7 +118,7 @@ Message::Message(const Message& msg, const std::string& text): if (msg._pMap) _pMap = new StringMap(*msg._pMap); else - _pMap = 0; + _pMap = nullptr; } @@ -256,7 +256,7 @@ const std::string& Message::get(const std::string& param) const { StringMap::const_iterator it = _pMap->find(param); if (it != _pMap->end()) - return it->second; + return it->second; } throw NotFoundException(); @@ -269,7 +269,7 @@ const std::string& Message::get(const std::string& param, const std::string& def { StringMap::const_iterator it = _pMap->find(param); if (it != _pMap->end()) - return it->second; + return it->second; } return defaultValue; diff --git a/Foundation/src/Mutex_POSIX.cpp b/Foundation/src/Mutex_POSIX.cpp index db344cc0e..feb1ae1c2 100644 --- a/Foundation/src/Mutex_POSIX.cpp +++ b/Foundation/src/Mutex_POSIX.cpp @@ -116,7 +116,7 @@ bool MutexImpl::tryLockImpl(long milliseconds) } #else struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); abstime.tv_sec = tv.tv_sec + milliseconds / 1000; abstime.tv_nsec = tv.tv_usec*1000 + (milliseconds % 1000)*1000000; if (abstime.tv_nsec >= 1000000000) @@ -147,13 +147,13 @@ bool MutexImpl::tryLockImpl(long milliseconds) struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = sleepMillis*1000000; - nanosleep(&ts, NULL); + nanosleep(&ts, nullptr); #else struct timeval tv; tv.tv_sec = 0; tv.tv_usec = sleepMillis * 1000; - select(0, NULL, NULL, NULL, &tv); + select(0, nullptr, nullptr, nullptr, &tv); #endif } while (!now.isElapsed(diff)); diff --git a/Foundation/src/Mutex_STD.cpp b/Foundation/src/Mutex_STD.cpp index 867ef0b9a..d55fed6b9 100644 --- a/Foundation/src/Mutex_STD.cpp +++ b/Foundation/src/Mutex_STD.cpp @@ -60,7 +60,7 @@ namespace Poco { struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = sleepMillis*1000000; - nanosleep(&ts, NULL); + nanosleep(&ts, nullptr); #else struct timeval tv; tv.tv_sec = 0; @@ -105,12 +105,12 @@ namespace Poco { struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = sleepMillis*1000000; - nanosleep(&ts, NULL); + nanosleep(&ts, nullptr); #else struct timeval tv; tv.tv_sec = 0; tv.tv_usec = sleepMillis * 1000; - select(0, NULL, NULL, NULL, &tv); + select(0, nullptr, nullptr, nullptr, &tv); #endif } while (!now.isElapsed(diff)); diff --git a/Foundation/src/NamedEvent_WIN32U.cpp b/Foundation/src/NamedEvent_WIN32U.cpp index a4fec5b7a..791a20278 100644 --- a/Foundation/src/NamedEvent_WIN32U.cpp +++ b/Foundation/src/NamedEvent_WIN32U.cpp @@ -26,7 +26,7 @@ NamedEventImpl::NamedEventImpl(const std::string& name): _name(name) { UnicodeConverter::toUTF16(_name, _uname); - _event = CreateEventW(NULL, FALSE, FALSE, _uname.c_str()); + _event = CreateEventW(nullptr, FALSE, FALSE, _uname.c_str()); if (!_event) { DWORD dwRetVal = GetLastError(); diff --git a/Foundation/src/NamedMutex_UNIX.cpp b/Foundation/src/NamedMutex_UNIX.cpp index 1f52c9798..3171bca51 100644 --- a/Foundation/src/NamedMutex_UNIX.cpp +++ b/Foundation/src/NamedMutex_UNIX.cpp @@ -143,14 +143,14 @@ void NamedMutexImpl::unlockImpl() { #if defined(sun) || defined(__APPLE__) || defined(__osf__) || defined(__QNX__) || defined(_AIX) || defined(__GNU__) if (sem_post(_sem) != 0) - throw SystemException("cannot unlock named mutex", _name); + throw SystemException("cannot unlock named mutex", _name); #else struct sembuf op; op.sem_num = 0; op.sem_op = 1; op.sem_flg = SEM_UNDO; if (semop(_semid, &op, 1) != 0) - throw SystemException("cannot unlock named mutex", _name); + throw SystemException("cannot unlock named mutex", _name); #endif } diff --git a/Foundation/src/NamedMutex_WIN32U.cpp b/Foundation/src/NamedMutex_WIN32U.cpp index 40d99ed39..e569ac43f 100644 --- a/Foundation/src/NamedMutex_WIN32U.cpp +++ b/Foundation/src/NamedMutex_WIN32U.cpp @@ -24,7 +24,7 @@ NamedMutexImpl::NamedMutexImpl(const std::string& name): _name(name) { UnicodeConverter::toUTF16(_name, _uname); - _mutex = CreateMutexW(NULL, FALSE, _uname.c_str()); + _mutex = CreateMutexW(nullptr, FALSE, _uname.c_str()); if (!_mutex) throw SystemException("cannot create named mutex", _name); } diff --git a/Foundation/src/NestedDiagnosticContext.cpp b/Foundation/src/NestedDiagnosticContext.cpp index 6dd98858a..4bf936753 100644 --- a/Foundation/src/NestedDiagnosticContext.cpp +++ b/Foundation/src/NestedDiagnosticContext.cpp @@ -48,7 +48,7 @@ void NestedDiagnosticContext::push(const std::string& info) Context ctx; ctx.info = info; ctx.line = -1; - ctx.file = 0; + ctx.file = nullptr; _stack.push_back(ctx); } diff --git a/Foundation/src/Path.cpp b/Foundation/src/Path.cpp index 1c527be1f..e2a4f6bab 100644 --- a/Foundation/src/Path.cpp +++ b/Foundation/src/Path.cpp @@ -1120,11 +1120,11 @@ std::string Path::transcode(const std::string& path) #if defined(_WIN32) std::wstring uniPath; UnicodeConverter::toUTF16(path, uniPath); - DWORD len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast(uniPath.length()), NULL, 0, NULL, NULL); + DWORD len = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast(uniPath.length()), nullptr, 0, nullptr, nullptr); if (len > 0) { Buffer buffer(len); - DWORD rc = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast(uniPath.length()), buffer.begin(), static_cast(buffer.size()), NULL, NULL); + DWORD rc = WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, uniPath.c_str(), static_cast(uniPath.length()), buffer.begin(), static_cast(buffer.size()), nullptr, nullptr); if (rc) { return std::string(buffer.begin(), buffer.size()); diff --git a/Foundation/src/Path_UNIX.cpp b/Foundation/src/Path_UNIX.cpp index 5b09dedc6..0857dc03d 100644 --- a/Foundation/src/Path_UNIX.cpp +++ b/Foundation/src/Path_UNIX.cpp @@ -65,7 +65,7 @@ std::string PathImpl::selfImpl() mib[2] = KERN_PROC_PATHNAME; mib[3] = -1; std::size_t size = sizeof(buf); - if (sysctl(mib, 4, buf, &size, NULL, 0) == 0) + if (sysctl(mib, 4, buf, &size, nullptr, 0) == 0) path = buf; else throw Poco::SystemException("Cannot get path of the current process."); diff --git a/Foundation/src/Path_WIN32U.cpp b/Foundation/src/Path_WIN32U.cpp index 164386465..8d4ed98b2 100644 --- a/Foundation/src/Path_WIN32U.cpp +++ b/Foundation/src/Path_WIN32U.cpp @@ -25,7 +25,7 @@ std::string PathImpl::selfImpl() { std::string path; Buffer buf(MAX_PATH_LEN); - DWORD n = GetModuleFileNameW(NULL, buf.begin(), MAX_PATH_LEN); + DWORD n = GetModuleFileNameW(nullptr, buf.begin(), MAX_PATH_LEN); if (n > 0 && n < MAX_PATH_LEN) { @@ -39,7 +39,7 @@ std::string PathImpl::selfImpl() std::string PathImpl::currentImpl() { std::string result; - DWORD len = GetCurrentDirectoryW(0, NULL); + DWORD len = GetCurrentDirectoryW(0, nullptr); if (len > 0) { Buffer buffer(len); diff --git a/Foundation/src/PipeImpl_WIN32.cpp b/Foundation/src/PipeImpl_WIN32.cpp index ac3372116..6b38e3f67 100644 --- a/Foundation/src/PipeImpl_WIN32.cpp +++ b/Foundation/src/PipeImpl_WIN32.cpp @@ -23,7 +23,7 @@ PipeImpl::PipeImpl() { SECURITY_ATTRIBUTES attr; attr.nLength = sizeof(attr); - attr.lpSecurityDescriptor = NULL; + attr.lpSecurityDescriptor = nullptr; attr.bInheritHandle = FALSE; if (!CreatePipe(&_readHandle, &_writeHandle, &attr, 0)) @@ -43,7 +43,7 @@ int PipeImpl::writeBytes(const void* buffer, int length) poco_assert (_writeHandle != INVALID_HANDLE_VALUE); DWORD bytesWritten = 0; - if (!WriteFile(_writeHandle, buffer, length, &bytesWritten, NULL)) + if (!WriteFile(_writeHandle, buffer, length, &bytesWritten, nullptr)) throw WriteFileException("anonymous pipe"); return bytesWritten; } @@ -54,7 +54,7 @@ int PipeImpl::readBytes(void* buffer, int length) poco_assert (_readHandle != INVALID_HANDLE_VALUE); DWORD bytesRead = 0; - BOOL ok = ReadFile(_readHandle, buffer, length, &bytesRead, NULL); + BOOL ok = ReadFile(_readHandle, buffer, length, &bytesRead, nullptr); if (ok || GetLastError() == ERROR_BROKEN_PIPE) return bytesRead; else diff --git a/Foundation/src/Process.cpp b/Foundation/src/Process.cpp index 506890857..8d1b15b57 100644 --- a/Foundation/src/Process.cpp +++ b/Foundation/src/Process.cpp @@ -119,20 +119,20 @@ ProcessHandle Process::launch(const std::string& command, const Args& args, int { std::string initialDirectory; Env env; - return ProcessHandle(launchImpl(command, args, initialDirectory, 0, 0, 0, env, options)); + return ProcessHandle(launchImpl(command, args, initialDirectory, nullptr, nullptr, nullptr, env, options)); } ProcessHandle Process::launch(const std::string& command, const Args& args, const std::string& initialDirectory, int options) { Env env; - return ProcessHandle(launchImpl(command, args, initialDirectory, 0, 0, 0, env, options)); + return ProcessHandle(launchImpl(command, args, initialDirectory, nullptr, nullptr, nullptr, env, options)); } ProcessHandle Process::launch(const std::string& command, const Args& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, int options) { - poco_assert (inPipe == 0 || (inPipe != outPipe && inPipe != errPipe)); + poco_assert (inPipe == nullptr || (inPipe != outPipe && inPipe != errPipe)); std::string initialDirectory; Env env; return ProcessHandle(launchImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env, options)); @@ -141,7 +141,7 @@ ProcessHandle Process::launch(const std::string& command, const Args& args, Pipe ProcessHandle Process::launch(const std::string& command, const Args& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, int options) { - poco_assert (inPipe == 0 || (inPipe != outPipe && inPipe != errPipe)); + poco_assert (inPipe == nullptr || (inPipe != outPipe && inPipe != errPipe)); Env env; return ProcessHandle(launchImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env, options)); } @@ -149,7 +149,7 @@ ProcessHandle Process::launch(const std::string& command, const Args& args, cons ProcessHandle Process::launch(const std::string& command, const Args& args, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const Env& env, int options) { - poco_assert (inPipe == 0 || (inPipe != outPipe && inPipe != errPipe)); + poco_assert (inPipe == nullptr || (inPipe != outPipe && inPipe != errPipe)); std::string initialDirectory; return ProcessHandle(launchImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env, options)); } @@ -157,7 +157,7 @@ ProcessHandle Process::launch(const std::string& command, const Args& args, Pipe ProcessHandle Process::launch(const std::string& command, const Args& args, const std::string& initialDirectory, Pipe* inPipe, Pipe* outPipe, Pipe* errPipe, const Env& env, int options) { - poco_assert (inPipe == 0 || (inPipe != outPipe && inPipe != errPipe)); + poco_assert (inPipe == nullptr || (inPipe != outPipe && inPipe != errPipe)); return ProcessHandle(launchImpl(command, args, initialDirectory, inPipe, outPipe, errPipe, env, options)); } diff --git a/Foundation/src/Process_UNIX.cpp b/Foundation/src/Process_UNIX.cpp index 68c491e7c..709ee99b8 100644 --- a/Foundation/src/Process_UNIX.cpp +++ b/Foundation/src/Process_UNIX.cpp @@ -133,7 +133,7 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg argv[i++] = const_cast(command.c_str()); for (const auto& a: args) argv[i++] = const_cast(a.c_str()); - argv[i] = NULL; + argv[i] = nullptr; struct inheritance inherit; std::memset(&inherit, 0, sizeof(inherit)); inherit.flags = SPAWN_ALIGN_DEFAULT | SPAWN_CHECK_SCRIPT | SPAWN_SEARCH_PATH; @@ -204,9 +204,9 @@ ProcessHandleImpl* ProcessImpl::launchByForkExecImpl(const std::string& command, { argv[i++] = const_cast(a.c_str()); } - argv[i] = NULL; + argv[i] = nullptr; - const char* pInitialDirectory = initialDirectory.empty() ? 0 : initialDirectory.c_str(); + const char* pInitialDirectory = initialDirectory.empty() ? nullptr : initialDirectory.c_str(); int pid = fork(); if (pid < 0) diff --git a/Foundation/src/Process_WIN32U.cpp b/Foundation/src/Process_WIN32U.cpp index 269fe1b3b..bcbdf0867 100644 --- a/Foundation/src/Process_WIN32U.cpp +++ b/Foundation/src/Process_WIN32U.cpp @@ -85,7 +85,7 @@ void ProcessHandleImpl::closeHandle() if (_hProcess) { CloseHandle(_hProcess); - _hProcess = NULL; + _hProcess = nullptr; } } @@ -280,12 +280,12 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg STARTUPINFOW startupInfo; GetStartupInfoW(&startupInfo); // take defaults from current process startupInfo.cb = sizeof(STARTUPINFOW); - startupInfo.lpReserved = NULL; - startupInfo.lpDesktop = NULL; - startupInfo.lpTitle = NULL; + startupInfo.lpReserved = nullptr; + startupInfo.lpDesktop = nullptr; + startupInfo.lpTitle = nullptr; startupInfo.dwFlags = STARTF_FORCEOFFFEEDBACK; startupInfo.cbReserved2 = 0; - startupInfo.lpReserved2 = NULL; + startupInfo.lpReserved2 = nullptr; HANDLE hProc = GetCurrentProcess(); bool mustInheritHandles = false; @@ -375,8 +375,8 @@ ProcessHandleImpl* ProcessImpl::launchImpl(const std::string& command, const Arg BOOL rc = CreateProcessW( applicationName, const_cast(ucommandLine.c_str()), - NULL, // processAttributes - NULL, // threadAttributes + nullptr, // processAttributes + nullptr, // threadAttributes mustInheritHandles, creationFlags, (LPVOID)pEnv, diff --git a/Foundation/src/RWLock_POSIX.cpp b/Foundation/src/RWLock_POSIX.cpp index 9b729e796..f41988324 100644 --- a/Foundation/src/RWLock_POSIX.cpp +++ b/Foundation/src/RWLock_POSIX.cpp @@ -20,7 +20,7 @@ namespace Poco { RWLockImpl::RWLockImpl() { - if (pthread_rwlock_init(&_rwl, NULL)) + if (pthread_rwlock_init(&_rwl, nullptr)) throw SystemException("cannot create reader/writer lock"); } diff --git a/Foundation/src/RWLock_WIN32.cpp b/Foundation/src/RWLock_WIN32.cpp index e4f922225..f71423392 100644 --- a/Foundation/src/RWLock_WIN32.cpp +++ b/Foundation/src/RWLock_WIN32.cpp @@ -20,16 +20,16 @@ namespace Poco { RWLockImpl::RWLockImpl(): _readers(0), _writersWaiting(0), _writers(0) { - _mutex = CreateMutexW(NULL, FALSE, NULL); - if (_mutex == NULL) + _mutex = CreateMutexW(nullptr, FALSE, nullptr); + if (_mutex == nullptr) throw SystemException("cannot create reader/writer lock"); - _readEvent = CreateEventW(NULL, TRUE, TRUE, NULL); - if (_readEvent == NULL) + _readEvent = CreateEventW(nullptr, TRUE, TRUE, nullptr); + if (_readEvent == nullptr) throw SystemException("cannot create reader/writer lock"); - _writeEvent = CreateEventW(NULL, TRUE, TRUE, NULL); - if (_writeEvent == NULL) + _writeEvent = CreateEventW(nullptr, TRUE, TRUE, nullptr); + if (_writeEvent == nullptr) throw SystemException("cannot create reader/writer lock"); } diff --git a/Foundation/src/Random.cpp b/Foundation/src/Random.cpp index 51d027c96..6494af214 100644 --- a/Foundation/src/Random.cpp +++ b/Foundation/src/Random.cpp @@ -151,7 +151,7 @@ Random::Random(int stateSize) _pBuffer = new char[stateSize]; - initState((UInt32) std::time(NULL), _pBuffer, stateSize); + initState((UInt32) std::time(nullptr), _pBuffer, stateSize); } diff --git a/Foundation/src/RandomStream.cpp b/Foundation/src/RandomStream.cpp index 21ce6a378..22f5f18dc 100644 --- a/Foundation/src/RandomStream.cpp +++ b/Foundation/src/RandomStream.cpp @@ -44,7 +44,7 @@ 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); + CryptAcquireContext(&hProvider, nullptr, nullptr, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); CryptGenRandom(hProvider, (DWORD) length, (BYTE*) buffer); CryptReleaseContext(hProvider, 0); n = static_cast(length); @@ -68,7 +68,7 @@ int RandomBuf::readFromDevice(char* buffer, std::streamsize length) n = 0; SHA1Engine engine; - UInt32 t = (UInt32) std::time(NULL); + UInt32 t = (UInt32) std::time(nullptr); engine.update(&t, sizeof(t)); void* p = this; engine.update(&p, sizeof(p)); diff --git a/Foundation/src/SHA1Engine.cpp b/Foundation/src/SHA1Engine.cpp index 55d10b079..e0b5e572b 100644 --- a/Foundation/src/SHA1Engine.cpp +++ b/Foundation/src/SHA1Engine.cpp @@ -185,42 +185,42 @@ typedef UInt32 UL; /* to save space */ /* The four SHA sub-rounds */ #define subRound1(count) \ { \ - temp = S( 5, A ) + f1( B, C, D ) + E + W[ count ] + K1; \ - E = D; \ - D = C; \ - C = S( 30, B ); \ - B = A; \ - A = temp; \ + temp = S( 5, A ) + f1( B, C, D ) + E + W[ count ] + K1; \ + E = D; \ + D = C; \ + C = S( 30, B ); \ + B = A; \ + A = temp; \ } #define subRound2(count) \ { \ - temp = S( 5, A ) + f2( B, C, D ) + E + W[ count ] + K2; \ - E = D; \ - D = C; \ - C = S( 30, B ); \ - B = A; \ - A = temp; \ + temp = S( 5, A ) + f2( B, C, D ) + E + W[ count ] + K2; \ + E = D; \ + D = C; \ + C = S( 30, B ); \ + B = A; \ + A = temp; \ } #define subRound3(count) \ { \ - temp = S( 5, A ) + f3( B, C, D ) + E + W[ count ] + K3; \ - E = D; \ - D = C; \ - C = S( 30, B ); \ - B = A; \ - A = temp; \ + temp = S( 5, A ) + f3( B, C, D ) + E + W[ count ] + K3; \ + E = D; \ + D = C; \ + C = S( 30, B ); \ + B = A; \ + A = temp; \ } #define subRound4(count) \ { \ - temp = S( 5, A ) + f4( B, C, D ) + E + W[ count ] + K4; \ - E = D; \ - D = C; \ - C = S( 30, B ); \ - B = A; \ - A = temp; \ + temp = S( 5, A ) + f4( B, C, D ) + E + W[ count ] + K4; \ + E = D; \ + D = C; \ + C = S( 30, B ); \ + B = A; \ + A = temp; \ } diff --git a/Foundation/src/SHA2Engine.cpp b/Foundation/src/SHA2Engine.cpp index 84fd285f5..af62f93f7 100644 --- a/Foundation/src/SHA2Engine.cpp +++ b/Foundation/src/SHA2Engine.cpp @@ -197,7 +197,7 @@ do { \ SHA2Engine::SHA2Engine(ALGORITHM algorithm): - _context(NULL), + _context(nullptr), _algorithm(algorithm) { _digest.reserve(digestLength()); @@ -269,7 +269,7 @@ void _sha512_process(HASHCONTEXT* pContext, const unsigned char data[128]) void SHA2Engine::updateImpl(const void* buffer_, std::size_t count) { - if (_context == NULL || buffer_ == NULL || count == 0) return; + if (_context == nullptr || buffer_ == nullptr || count == 0) return; Poco::UInt32 left = 0; HASHCONTEXT* pContext = (HASHCONTEXT*)_context; unsigned char* data = (unsigned char*)buffer_; @@ -352,7 +352,7 @@ std::size_t SHA2Engine::digestLength() const void SHA2Engine::reset() { - if (_context != NULL) free(_context); + free(_context); _context = calloc(1, sizeof(HASHCONTEXT)); HASHCONTEXT* pContext = (HASHCONTEXT*)_context; if (_algorithm == SHA_224) @@ -426,7 +426,7 @@ void SHA2Engine::reset() const DigestEngine::Digest& SHA2Engine::digest() { _digest.clear(); - if (_context == NULL) return _digest; + if (_context == nullptr) return _digest; HASHCONTEXT* pContext = (HASHCONTEXT*)_context; size_t last, padn; unsigned char hash[64]; diff --git a/Foundation/src/Semaphore_POSIX.cpp b/Foundation/src/Semaphore_POSIX.cpp index f4818af20..6cd86d417 100644 --- a/Foundation/src/Semaphore_POSIX.cpp +++ b/Foundation/src/Semaphore_POSIX.cpp @@ -58,7 +58,7 @@ SemaphoreImpl::SemaphoreImpl(int n, int max): _n(n), _max(max) // if the mutex has never been used. std::memset(&_mutex, 0, sizeof(_mutex)); #endif - if (pthread_mutex_init(&_mutex, NULL)) + if (pthread_mutex_init(&_mutex, nullptr)) throw SystemException("cannot create semaphore (mutex)"); #if defined(POCO_HAVE_MONOTONIC_PTHREAD_COND_TIMEDWAIT) @@ -69,11 +69,11 @@ SemaphoreImpl::SemaphoreImpl(int n, int max): _n(n), _max(max) throw SystemException("cannot create semaphore (condition attribute)"); } if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)) - { + { pthread_condattr_destroy(&attr); pthread_mutex_destroy(&_mutex); throw SystemException("cannot create semaphore (condition attribute clock)"); - } + } if (pthread_cond_init(&_cond, &attr)) { pthread_condattr_destroy(&attr); @@ -82,7 +82,7 @@ SemaphoreImpl::SemaphoreImpl(int n, int max): _n(n), _max(max) } pthread_condattr_destroy(&attr); #else - if (pthread_cond_init(&_cond, NULL)) + if (pthread_cond_init(&_cond, nullptr)) { pthread_mutex_destroy(&_mutex); throw SystemException("cannot create semaphore (condition)"); @@ -140,7 +140,7 @@ bool SemaphoreImpl::waitImpl(long milliseconds) } #else struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); abstime.tv_sec = tv.tv_sec + milliseconds / 1000; abstime.tv_nsec = tv.tv_usec*1000 + (milliseconds % 1000)*1000000; if (abstime.tv_nsec >= 1000000000) diff --git a/Foundation/src/Semaphore_WIN32.cpp b/Foundation/src/Semaphore_WIN32.cpp index 99b15a69d..ccf50efe8 100644 --- a/Foundation/src/Semaphore_WIN32.cpp +++ b/Foundation/src/Semaphore_WIN32.cpp @@ -22,7 +22,7 @@ SemaphoreImpl::SemaphoreImpl(int n, int max) { poco_assert (n >= 0 && max > 0 && n <= max); - _sema = CreateSemaphoreW(NULL, n, max, NULL); + _sema = CreateSemaphoreW(nullptr, n, max, nullptr); if (!_sema) { throw SystemException("cannot create semaphore"); diff --git a/Foundation/src/SharedLibrary.cpp b/Foundation/src/SharedLibrary.cpp index a2bdce57a..64b9e28e5 100644 --- a/Foundation/src/SharedLibrary.cpp +++ b/Foundation/src/SharedLibrary.cpp @@ -78,7 +78,7 @@ bool SharedLibrary::isLoaded() const bool SharedLibrary::hasSymbol(const std::string& name) { - return findSymbolImpl(name) != 0; + return findSymbolImpl(name) != nullptr; } diff --git a/Foundation/src/SharedLibrary_UNIX.cpp b/Foundation/src/SharedLibrary_UNIX.cpp index 6695b5a14..869f3c47b 100644 --- a/Foundation/src/SharedLibrary_UNIX.cpp +++ b/Foundation/src/SharedLibrary_UNIX.cpp @@ -31,7 +31,7 @@ FastMutex SharedLibraryImpl::_mutex; SharedLibraryImpl::SharedLibraryImpl() { - _handle = 0; + _handle = nullptr; } @@ -67,7 +67,7 @@ void SharedLibraryImpl::unloadImpl() if (_handle) { dlclose(_handle); - _handle = 0; + _handle = nullptr; } } @@ -75,7 +75,7 @@ void SharedLibraryImpl::unloadImpl() bool SharedLibraryImpl::isLoadedImpl() const { FastMutex::ScopedLock lock(_mutex); - return _handle != 0; + return _handle != nullptr; } @@ -83,7 +83,7 @@ void* SharedLibraryImpl::findSymbolImpl(const std::string& name) { FastMutex::ScopedLock lock(_mutex); - void* result = 0; + void* result = nullptr; if (_handle) { result = dlsym(_handle, name.c_str()); diff --git a/Foundation/src/SharedMemory.cpp b/Foundation/src/SharedMemory.cpp index da43a421c..a440d288f 100644 --- a/Foundation/src/SharedMemory.cpp +++ b/Foundation/src/SharedMemory.cpp @@ -29,7 +29,7 @@ namespace Poco { SharedMemory::SharedMemory(): - _pImpl(0) + _pImpl(nullptr) { } @@ -74,7 +74,7 @@ char* SharedMemory::begin() const if (_pImpl) return _pImpl->begin(); else - return 0; + return nullptr; } @@ -83,7 +83,7 @@ char* SharedMemory::end() const if (_pImpl) return _pImpl->end(); else - return 0; + return nullptr; } diff --git a/Foundation/src/SharedMemory_POSIX.cpp b/Foundation/src/SharedMemory_POSIX.cpp index edeb4f536..c8fa557c6 100644 --- a/Foundation/src/SharedMemory_POSIX.cpp +++ b/Foundation/src/SharedMemory_POSIX.cpp @@ -28,7 +28,7 @@ namespace Poco { SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, SharedMemory::AccessMode mode, const void* addrHint, bool server): _size(size), _fd(-1), - _address(0), + _address(nullptr), _access(mode), _name("/"), _fileMapped(false), @@ -66,7 +66,7 @@ SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, Sh SharedMemoryImpl::SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessMode mode, const void* addrHint): _size(0), _fd(-1), - _address(0), + _address(nullptr), _access(mode), _name(file.path()), _fileMapped(true), diff --git a/Foundation/src/SharedMemory_WIN32.cpp b/Foundation/src/SharedMemory_WIN32.cpp index f653eddf0..0cd928d15 100644 --- a/Foundation/src/SharedMemory_WIN32.cpp +++ b/Foundation/src/SharedMemory_WIN32.cpp @@ -49,7 +49,7 @@ SharedMemoryImpl::SharedMemoryImpl(const std::string& name, std::size_t size, Sh const DWORD dwMaxSizeLow = static_cast(_size); const DWORD dwMaxSizeHigh = 0UL; #endif - _memHandle = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, _mode, dwMaxSizeHigh, dwMaxSizeLow, utf16name.c_str()); + _memHandle = CreateFileMappingW(INVALID_HANDLE_VALUE, nullptr, _mode, dwMaxSizeHigh, dwMaxSizeLow, utf16name.c_str()); if (!_memHandle) { @@ -98,12 +98,12 @@ SharedMemoryImpl::SharedMemoryImpl(const Poco::File& file, SharedMemory::AccessM std::wstring utf16name; UnicodeConverter::toUTF16(_name, utf16name); - _fileHandle = CreateFileW(utf16name.c_str(), fileMode, shareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + _fileHandle = CreateFileW(utf16name.c_str(), fileMode, shareMode, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); if (_fileHandle == INVALID_HANDLE_VALUE) throw OpenFileException("Cannot open memory mapped file", _name); - _memHandle = CreateFileMapping(_fileHandle, NULL, _mode, 0, 0, NULL); + _memHandle = CreateFileMapping(_fileHandle, nullptr, _mode, 0, 0, nullptr); if (!_memHandle) { DWORD dwRetVal = GetLastError(); diff --git a/Foundation/src/SignalHandler.cpp b/Foundation/src/SignalHandler.cpp index 6bbc0fb64..c57bc4a65 100644 --- a/Foundation/src/SignalHandler.cpp +++ b/Foundation/src/SignalHandler.cpp @@ -76,10 +76,10 @@ void SignalHandler::install() sa.sa_handler = handleSignal; sa.sa_flags = 0; sigemptyset(&sa.sa_mask); - sigaction(SIGILL, &sa, 0); - sigaction(SIGBUS, &sa, 0); - sigaction(SIGSEGV, &sa, 0); - sigaction(SIGSYS, &sa, 0); + sigaction(SIGILL, &sa, nullptr); + sigaction(SIGBUS, &sa, nullptr); + sigaction(SIGSEGV, &sa, nullptr); + sigaction(SIGSYS, &sa, nullptr); #endif } diff --git a/Foundation/src/StreamConverter.cpp b/Foundation/src/StreamConverter.cpp index 2433c9b9e..769b51c24 100644 --- a/Foundation/src/StreamConverter.cpp +++ b/Foundation/src/StreamConverter.cpp @@ -21,7 +21,7 @@ namespace Poco { StreamConverterBuf::StreamConverterBuf(std::istream& istr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar): _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _inEncoding(inEncoding), _outEncoding(outEncoding), _defaultChar(defaultChar), @@ -33,7 +33,7 @@ StreamConverterBuf::StreamConverterBuf(std::istream& istr, const TextEncoding& i StreamConverterBuf::StreamConverterBuf(std::ostream& ostr, const TextEncoding& inEncoding, const TextEncoding& outEncoding, int defaultChar): - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _inEncoding(inEncoding), _outEncoding(outEncoding), diff --git a/Foundation/src/StreamTokenizer.cpp b/Foundation/src/StreamTokenizer.cpp index bb57d4702..5e8e3653a 100644 --- a/Foundation/src/StreamTokenizer.cpp +++ b/Foundation/src/StreamTokenizer.cpp @@ -19,7 +19,7 @@ namespace Poco { StreamTokenizer::StreamTokenizer(): - _pIstr(0) + _pIstr(nullptr) { } diff --git a/Foundation/src/Task.cpp b/Foundation/src/Task.cpp index 3a06c9e4b..c968f2736 100644 --- a/Foundation/src/Task.cpp +++ b/Foundation/src/Task.cpp @@ -23,7 +23,7 @@ namespace Poco { Task::Task(const std::string& name): _name(name), - _pOwner(0), + _pOwner(nullptr), _progress(0), _state(TASK_IDLE), _cancelEvent(Event::EVENT_MANUALRESET) diff --git a/Foundation/src/TeeStream.cpp b/Foundation/src/TeeStream.cpp index da789b025..6a4a48079 100644 --- a/Foundation/src/TeeStream.cpp +++ b/Foundation/src/TeeStream.cpp @@ -19,7 +19,7 @@ namespace Poco { TeeStreamBuf::TeeStreamBuf(): - _pIstr(0) + _pIstr(nullptr) { } @@ -31,7 +31,7 @@ TeeStreamBuf::TeeStreamBuf(std::istream& istr): TeeStreamBuf::TeeStreamBuf(std::ostream& ostr): - _pIstr(0) + _pIstr(nullptr) { _streams.push_back(&ostr); } diff --git a/Foundation/src/TextBufferIterator.cpp b/Foundation/src/TextBufferIterator.cpp index cc2e9819b..80c92cdfb 100644 --- a/Foundation/src/TextBufferIterator.cpp +++ b/Foundation/src/TextBufferIterator.cpp @@ -22,9 +22,9 @@ namespace Poco { TextBufferIterator::TextBufferIterator(): - _pEncoding(0), - _it(0), - _end(0) + _pEncoding(nullptr), + _it(nullptr), + _end(nullptr) { } @@ -54,7 +54,7 @@ TextBufferIterator::TextBufferIterator(const char* begin, const char* end, const TextBufferIterator::TextBufferIterator(const char* end): - _pEncoding(0), + _pEncoding(nullptr), _it(end), _end(end) { diff --git a/Foundation/src/TextIterator.cpp b/Foundation/src/TextIterator.cpp index 14beeb90d..7fc4bf944 100644 --- a/Foundation/src/TextIterator.cpp +++ b/Foundation/src/TextIterator.cpp @@ -21,7 +21,7 @@ namespace Poco { TextIterator::TextIterator(): - _pEncoding(0) + _pEncoding(nullptr) { } @@ -43,7 +43,7 @@ TextIterator::TextIterator(const std::string::const_iterator& begin, const std:: TextIterator::TextIterator(const std::string& str): - _pEncoding(0), + _pEncoding(nullptr), _it(str.end()), _end(str.end()) { @@ -51,7 +51,7 @@ TextIterator::TextIterator(const std::string& str): TextIterator::TextIterator(const std::string::const_iterator& end): - _pEncoding(0), + _pEncoding(nullptr), _it(end), _end(end) { diff --git a/Foundation/src/ThreadPool.cpp b/Foundation/src/ThreadPool.cpp index 757e71acc..b722c14a4 100644 --- a/Foundation/src/ThreadPool.cpp +++ b/Foundation/src/ThreadPool.cpp @@ -179,7 +179,7 @@ void PooledThread::run() { _targetReady.wait(); _mutex.lock(); - if (_pTarget) // a NULL target means kill yourself + if (_pTarget) // a nullptr target means kill yourself { Runnable* pTarget = _pTarget; _mutex.unlock(); diff --git a/Foundation/src/Thread_POSIX.cpp b/Foundation/src/Thread_POSIX.cpp index 2d28e76e9..acf2a459b 100644 --- a/Foundation/src/Thread_POSIX.cpp +++ b/Foundation/src/Thread_POSIX.cpp @@ -72,7 +72,7 @@ namespace sigset_t sset; sigemptyset(&sset); sigaddset(&sset, SIGPIPE); - pthread_sigmask(SIG_BLOCK, &sset, 0); + pthread_sigmask(SIG_BLOCK, &sset, nullptr); } ~SignalBlocker() { @@ -278,10 +278,10 @@ void ThreadImpl::setStackSizeImpl(int size) const int STACK_PAGE_SIZE = 4096; size = ((size + STACK_PAGE_SIZE - 1)/STACK_PAGE_SIZE)*STACK_PAGE_SIZE; #endif - if (size < PTHREAD_STACK_MIN) - size = PTHREAD_STACK_MIN; + if (size < PTHREAD_STACK_MIN) + size = PTHREAD_STACK_MIN; } - _pData->stackSize = size; + _pData->stackSize = size; #endif } @@ -297,7 +297,7 @@ void ThreadImpl::setSignalMaskImpl(uint32_t sigMask) sigaddset(&sset, sig); } - pthread_sigmask(SIG_BLOCK, &sset, 0); + pthread_sigmask(SIG_BLOCK, &sset, nullptr); } @@ -330,7 +330,7 @@ void ThreadImpl::startImpl(SharedPtr pTarget) int errorCode; if ((errorCode = pthread_create(&_pData->thread, &attributes, runnableEntry, this))) { - _pData->pRunnableTarget = 0; + _pData->pRunnableTarget = nullptr; pthread_attr_destroy(&attributes); throw SystemException(Poco::format("cannot start thread (%s)", Error::getMessage(errorCode))); @@ -433,7 +433,7 @@ void* ThreadImpl::runnableEntry(void* pThread) sigaddset(&sset, SIGQUIT); sigaddset(&sset, SIGTERM); sigaddset(&sset, SIGPIPE); - pthread_sigmask(SIG_BLOCK, &sset, 0); + pthread_sigmask(SIG_BLOCK, &sset, nullptr); #endif ThreadImpl* pThreadImpl = reinterpret_cast(pThread); @@ -467,9 +467,9 @@ void* ThreadImpl::runnableEntry(void* pThread) } FastMutex::ScopedLock l(pData->mutex); - pData->pRunnableTarget = 0; + pData->pRunnableTarget = nullptr; pData->done.set(); - return 0; + return nullptr; } diff --git a/Foundation/src/Thread_VX.cpp b/Foundation/src/Thread_VX.cpp index 4b06c4de9..cc3250c77 100644 --- a/Foundation/src/Thread_VX.cpp +++ b/Foundation/src/Thread_VX.cpp @@ -126,7 +126,7 @@ void ThreadImpl::startImpl(Runnable& target) _pData->done.reset(); int stackSize = _pData->stackSize == 0 ? DEFAULT_THREAD_STACK_SIZE : _pData->stackSize; - int id = taskSpawn(NULL, _pData->osPrio, VX_FP_TASK, stackSize, reinterpret_cast(runnableEntry), reinterpret_cast(this), 0, 0, 0, 0, 0, 0, 0, 0, 0); + int id = taskSpawn(nullptr, _pData->osPrio, VX_FP_TASK, stackSize, reinterpret_cast(runnableEntry), reinterpret_cast(this), 0, 0, 0, 0, 0, 0, 0, 0, 0); if (id == ERROR) throw SystemException("cannot spawn task"); @@ -147,7 +147,7 @@ void ThreadImpl::startImpl(Callable target, void* pData) _pData->done.reset(); int stackSize = _pData->stackSize == 0 ? DEFAULT_THREAD_STACK_SIZE : _pData->stackSize; - int id = taskSpawn(NULL, _pData->osPrio, VX_FP_TASK, stackSize, reinterpret_cast(callableEntry), reinterpret_cast(this), 0, 0, 0, 0, 0, 0, 0, 0, 0); + int id = taskSpawn(nullptr, _pData->osPrio, VX_FP_TASK, stackSize, reinterpret_cast(callableEntry), reinterpret_cast(this), 0, 0, 0, 0, 0, 0, 0, 0, 0); if (id == ERROR) throw SystemException("cannot spawn task"); diff --git a/Foundation/src/Thread_WIN32.cpp b/Foundation/src/Thread_WIN32.cpp index dad6246f4..20a23f5bd 100644 --- a/Foundation/src/Thread_WIN32.cpp +++ b/Foundation/src/Thread_WIN32.cpp @@ -54,7 +54,7 @@ namespace { } #endif - } + } } @@ -143,10 +143,10 @@ void ThreadImpl::startImpl(SharedPtr pTarget) void ThreadImpl::createImpl(Entry ent, void* pData) { #if defined(_DLL) - _thread = CreateThread(NULL, _stackSize, ent, pData, 0, &_threadId); + _thread = CreateThread(nullptr, _stackSize, ent, pData, 0, &_threadId); #else unsigned threadId; - _thread = (HANDLE) _beginthreadex(NULL, _stackSize, ent, this, 0, &threadId); + _thread = (HANDLE) _beginthreadex(nullptr, _stackSize, ent, this, 0, &threadId); _threadId = static_cast(threadId); #endif if (!_thread) diff --git a/Foundation/src/Timer.cpp b/Foundation/src/Timer.cpp index 833645278..bdfbffbd6 100644 --- a/Foundation/src/Timer.cpp +++ b/Foundation/src/Timer.cpp @@ -25,7 +25,7 @@ Timer::Timer(long startInterval, long periodicInterval): _startInterval(startInterval), _periodicInterval(periodicInterval), _skipped(0), - _pCallback(0) + _pCallback(nullptr) { poco_assert (startInterval >= 0 && periodicInterval >= 0); } @@ -84,7 +84,7 @@ void Timer::start(const AbstractTimerCallback& method, Thread::Priority priority catch (...) { delete _pCallback; - _pCallback = 0; + _pCallback = nullptr; throw; } } @@ -101,7 +101,7 @@ void Timer::stop() _done.wait(); // warning: deadlock if called from timer callback _mutex.lock(); delete _pCallback; - _pCallback = 0; + _pCallback = nullptr; } } diff --git a/Foundation/src/Timezone_UNIX.cpp b/Foundation/src/Timezone_UNIX.cpp index bf3c47483..1f17014a4 100644 --- a/Foundation/src/Timezone_UNIX.cpp +++ b/Foundation/src/Timezone_UNIX.cpp @@ -34,7 +34,7 @@ public: std::lock_guard lock(_mutex); #if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || POCO_OS == POCO_OS_ANDROID // no timezone global var - std::time_t now = std::time(NULL); + std::time_t now = std::time(nullptr); struct std::tm t; gmtime_r(&now, &t); std::time_t utc = std::mktime(&t); diff --git a/Foundation/src/Timezone_VX.cpp b/Foundation/src/Timezone_VX.cpp index 4601dd21c..e16fd7de1 100644 --- a/Foundation/src/Timezone_VX.cpp +++ b/Foundation/src/Timezone_VX.cpp @@ -23,7 +23,7 @@ namespace Poco { int Timezone::utcOffset() { - std::time_t now = std::time(NULL); + std::time_t now = std::time(nullptr); struct std::tm t; gmtime_r(&now, &t); std::time_t utc = std::mktime(&t); @@ -33,7 +33,7 @@ int Timezone::utcOffset() int Timezone::dst() { - std::time_t now = std::time(NULL); + std::time_t now = std::time(nullptr); struct std::tm t; #if defined(_VXWORKS_COMPATIBILITY_MODE) || (defined(_WRS_VXWORKS_MAJOR) && ((_WRS_VXWORKS_MAJOR < 6) || ((_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR < 9)))) if (localtime_r(&now, &t) != OK) diff --git a/Foundation/src/URI.cpp b/Foundation/src/URI.cpp index bc7582b48..6ae820ec9 100644 --- a/Foundation/src/URI.cpp +++ b/Foundation/src/URI.cpp @@ -580,12 +580,12 @@ bool URI::operator != (const std::string& uri) const bool URI::equals(const URI& uri) const { return _scheme == uri._scheme - && _userInfo == uri._userInfo - && _host == uri._host - && getPort() == uri.getPort() - && _path == uri._path - && _query == uri._query - && _fragment == uri._fragment; + && _userInfo == uri._userInfo + && _host == uri._host + && getPort() == uri.getPort() + && _path == uri._path + && _query == uri._query + && _fragment == uri._fragment; } @@ -663,10 +663,10 @@ void URI::encode(const std::string& str, const std::string& reserved, std::strin for (auto c: str) { if ((c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - (c >= '0' && c <= '9') || - c == '-' || c == '_' || - c == '.' || c == '~') + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + c == '-' || c == '_' || + c == '.' || c == '~') { encodedStr += c; } diff --git a/Foundation/src/UTF16Encoding.cpp b/Foundation/src/UTF16Encoding.cpp index ae7ac8873..135680cd1 100644 --- a/Foundation/src/UTF16Encoding.cpp +++ b/Foundation/src/UTF16Encoding.cpp @@ -24,7 +24,7 @@ const char* UTF16Encoding::_names[] = { "UTF-16", "UTF16", - NULL + nullptr }; diff --git a/Foundation/src/UTF32Encoding.cpp b/Foundation/src/UTF32Encoding.cpp index 5b8606605..92e79baff 100644 --- a/Foundation/src/UTF32Encoding.cpp +++ b/Foundation/src/UTF32Encoding.cpp @@ -24,7 +24,7 @@ const char* UTF32Encoding::_names[] = { "UTF-32", "UTF32", - NULL + nullptr }; diff --git a/Foundation/src/UTF8Encoding.cpp b/Foundation/src/UTF8Encoding.cpp index 78fc6d4a8..6697be1b2 100644 --- a/Foundation/src/UTF8Encoding.cpp +++ b/Foundation/src/UTF8Encoding.cpp @@ -23,7 +23,7 @@ const char* UTF8Encoding::_names[] = { "UTF-8", "UTF8", - NULL + nullptr }; @@ -204,11 +204,11 @@ bool UTF8Encoding::isLegal(const unsigned char *bytes, int length) // from ftp://ftp.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c // Excuse the ugliness... - if (0 == bytes || 0 == length) return false; + if (nullptr == bytes || 0 == length) return false; - unsigned char a; - const unsigned char* srcptr = bytes + length; - switch (length) + unsigned char a; + const unsigned char* srcptr = bytes + length; + switch (length) { default: return false; @@ -238,7 +238,7 @@ bool UTF8Encoding::isLegal(const unsigned char *bytes, int length) } case 1: if (*bytes >= 0x80 && *bytes < 0xC2) return false; - } + } return *bytes <= 0xF4; } diff --git a/Foundation/src/UTF8String.cpp b/Foundation/src/UTF8String.cpp index 12b00e0c3..50e51e32c 100644 --- a/Foundation/src/UTF8String.cpp +++ b/Foundation/src/UTF8String.cpp @@ -59,19 +59,19 @@ int UTF8::icompare(const std::string& str, std::string::size_type pos, std::stri TextIterator uend2(end2); while (uit1 != uend1 && uit2 != uend2) { - int c1 = Unicode::toLower(*uit1); - int c2 = Unicode::toLower(*uit2); - if (c1 < c2) - return -1; - else if (c1 > c2) - return 1; - ++uit1; ++uit2; + int c1 = Unicode::toLower(*uit1); + int c2 = Unicode::toLower(*uit2); + if (c1 < c2) + return -1; + else if (c1 > c2) + return 1; + ++uit1; ++uit2; } - if (uit1 == uend1) + if (uit1 == uend1) return uit2 == uend2 ? 0 : -1; - else - return 1; + else + return 1; } @@ -296,7 +296,7 @@ std::string UTF8::unescape(const std::string::const_iterator& begin, const std:: } if (dno > 0) { - ch = std::strtol(digs, NULL, 16); + ch = std::strtol(digs, nullptr, 16); } break; } @@ -359,7 +359,7 @@ std::string UTF8::unescape(const std::string::const_iterator& begin, const std:: while (it != end && Ascii::isHexDigit(*it) && dno < 4) digs[dno++] = *it++; if (dno > 0) { - ch = std::strtol(digs, NULL, 16); + ch = std::strtol(digs, nullptr, 16); } if( ch >= 0xD800 && ch <= 0xDBFF ) @@ -387,7 +387,7 @@ std::string UTF8::unescape(const std::string::const_iterator& begin, const std:: while (it != end && Ascii::isHexDigit(*it) && dno < 4) digs[dno++] = *it++; if (dno > 0) { - Poco::UInt32 temp = std::strtol(digs, NULL, 16); + Poco::UInt32 temp = std::strtol(digs, nullptr, 16); if( temp >= 0xDC00 && temp <= 0xDFFF ) { ch = ( ( ( ch - 0xD800 ) << 10 ) | ( temp - 0xDC00 ) ) + 0x10000; @@ -418,11 +418,11 @@ namespace { std::string doNormalize(const char* str, std::size_t size, utf8proc_option_t options) { - utf8proc_ssize_t n = utf8proc_decompose_custom(reinterpret_cast(str), size, NULL, 0, options, NULL, NULL); + utf8proc_ssize_t n = utf8proc_decompose_custom(reinterpret_cast(str), size, nullptr, 0, options, nullptr, nullptr); if (n < 0) throw Poco::RuntimeException("Normalization decompose failed"s, utf8proc_errmsg(n)); Poco::Buffer buffer(n + 1); // utf8proc_reencode() needs space for terminating NUL - n = utf8proc_decompose_custom(reinterpret_cast(str), size, buffer.begin(), n, options, NULL, NULL); + n = utf8proc_decompose_custom(reinterpret_cast(str), size, buffer.begin(), n, options, nullptr, nullptr); if (n < 0) throw Poco::RuntimeException("Normalization decompose failed"s, utf8proc_errmsg(n)); n = utf8proc_reencode(buffer.begin(), n, options); diff --git a/Foundation/src/VarIterator.cpp b/Foundation/src/VarIterator.cpp index cd4161aac..de0315567 100644 --- a/Foundation/src/VarIterator.cpp +++ b/Foundation/src/VarIterator.cpp @@ -31,7 +31,7 @@ VarIterator::VarIterator(Var* pVar, bool positionEnd): _pVar(pVar), _position(positionEnd ? POSITION_END : 0) { - if (!_pVar || _pVar->isEmpty()) throw InvalidAccessException("Cannot create iterator on empty Var"); + if (!_pVar || _pVar->isEmpty()) throw InvalidAccessException("Cannot create iterator on empty Var"); } diff --git a/Foundation/src/Windows1250Encoding.cpp b/Foundation/src/Windows1250Encoding.cpp index 03c8d8ed6..b59e79d7a 100644 --- a/Foundation/src/Windows1250Encoding.cpp +++ b/Foundation/src/Windows1250Encoding.cpp @@ -25,7 +25,7 @@ const char* Windows1250Encoding::_names[] = "Windows-1250", "cp1250", "CP1250", - NULL + nullptr }; diff --git a/Foundation/src/Windows1251Encoding.cpp b/Foundation/src/Windows1251Encoding.cpp index f0bfd5260..f39978031 100644 --- a/Foundation/src/Windows1251Encoding.cpp +++ b/Foundation/src/Windows1251Encoding.cpp @@ -25,7 +25,7 @@ const char* Windows1251Encoding::_names[] = "Windows-1251", "cp1251", "CP1251", - NULL + nullptr }; diff --git a/Foundation/src/Windows1252Encoding.cpp b/Foundation/src/Windows1252Encoding.cpp index 206a1836a..1502898f2 100644 --- a/Foundation/src/Windows1252Encoding.cpp +++ b/Foundation/src/Windows1252Encoding.cpp @@ -26,7 +26,7 @@ const char* Windows1252Encoding::_names[] = "Windows-1252", "cp1252", "CP1252", - NULL + nullptr }; diff --git a/Foundation/src/WindowsConsoleChannel.cpp b/Foundation/src/WindowsConsoleChannel.cpp index 3659874b6..7298c23b1 100644 --- a/Foundation/src/WindowsConsoleChannel.cpp +++ b/Foundation/src/WindowsConsoleChannel.cpp @@ -46,14 +46,14 @@ void WindowsConsoleChannel::log(const Message& msg) if (_isFile) { DWORD written; - WriteFile(_hConsole, text.data(), static_cast(text.size()), &written, NULL); + WriteFile(_hConsole, text.data(), static_cast(text.size()), &written, nullptr); } else { std::wstring utext; UnicodeConverter::toUTF16(text, utext); DWORD written; - WriteConsoleW(_hConsole, utext.data(), static_cast(utext.size()), &written, NULL); + WriteConsoleW(_hConsole, utext.data(), static_cast(utext.size()), &written, nullptr); } } @@ -92,14 +92,14 @@ void WindowsColorConsoleChannel::log(const Message& msg) if (_isFile) { DWORD written; - WriteFile(_hConsole, text.data(), static_cast(text.size()), &written, NULL); + WriteFile(_hConsole, text.data(), static_cast(text.size()), &written, nullptr); } else { std::wstring utext; UnicodeConverter::toUTF16(text, utext); DWORD written; - WriteConsoleW(_hConsole, utext.data(), static_cast(utext.size()), &written, NULL); + WriteConsoleW(_hConsole, utext.data(), static_cast(utext.size()), &written, nullptr); } if (_enableColors && !_isFile) diff --git a/Foundation/src/double-to-string.h b/Foundation/src/double-to-string.h new file mode 100644 index 000000000..e69de29bb diff --git a/Foundation/testsuite/src/AnyTest.cpp b/Foundation/testsuite/src/AnyTest.cpp index 4f862bb9d..3322233b9 100644 --- a/Foundation/testsuite/src/AnyTest.cpp +++ b/Foundation/testsuite/src/AnyTest.cpp @@ -57,7 +57,7 @@ void AnyTest::testAnyDefaultCtor() const Any value; assertTrue (value.empty()); - assertTrue (0 == AnyCast(&value)); + assertTrue (nullptr == AnyCast(&value)); assertTrue (value.type() == typeid(void)); } @@ -69,8 +69,8 @@ void AnyTest::testAnyConvertingCtor() assertTrue (!value.empty()); assertTrue (value.type() == typeid(std::string)); - assertTrue (0 == AnyCast(&value)); - assertTrue (0 != AnyCast(&value)); + assertTrue (nullptr == AnyCast(&value)); + assertTrue (nullptr != AnyCast(&value)); assertTrue (AnyCast(value) == text); assertTrue (AnyCast(&value) != &text); } @@ -119,8 +119,8 @@ void AnyTest::testAnyConvertingAssign() assertTrue (!value.empty()); assertTrue (value.type() == typeid(std::string)); - assertTrue (0 == AnyCast(&value)); - assertTrue (0 != AnyCast(&value)); + assertTrue (nullptr == AnyCast(&value)); + assertTrue (nullptr != AnyCast(&value)); assertTrue (AnyCast(value) == text); assertTrue (AnyCast(&value) != &text); assertTrue (assignResult == &value); @@ -218,7 +218,7 @@ void AnyTest::testAnySwap() assertTrue (!swapped.empty()); assertTrue (swapped.type() == typeid(std::string)); assertTrue (text == AnyCast(swapped)); - assertTrue (0 != originalPtr); + assertTrue (nullptr != originalPtr); assertTrue (swapResult == &original); struct BigObject @@ -262,7 +262,7 @@ void AnyTest::testAnySwap() assertTrue (!swappedBig.empty()); assertTrue (swappedBig.type() == typeid(BigObject)); assertTrue (bigObject == AnyCast(swappedBig)); - assertTrue (0 != bigPtr); + assertTrue (nullptr != bigPtr); assertTrue (swapBigResult == &bigOriginal); // assure proper assignment behavior after swapping @@ -326,7 +326,7 @@ void AnyTest::testAnyInt() *cpyI = 20; assertTrue (*cpyI != *i); std::string* s = AnyCast(&a); - assertTrue (s == NULL); + assertTrue (s == nullptr); int POCO_UNUSED tmp = AnyCast(a); const Any c = a; @@ -337,7 +337,7 @@ void AnyTest::testAnyInt() class A { public: - void f() {} + void f() {} int m; }; @@ -359,7 +359,7 @@ void AnyTest::testAnyPointer() *cpyI = 20; assertTrue (*cpyI == *p); std::string* s = AnyCast(&a); - assertTrue (s == NULL); + assertTrue (s == nullptr); assertTrue (AnyCast(&a) == nullptr); int* POCO_UNUSED tmp = AnyCast(a); @@ -368,7 +368,7 @@ void AnyTest::testAnyPointer() Any nullPtr(nullptr); assertFalse (AnyHoldsNullPtr(nullptr)); - assertFalse (AnyHoldsNullPtr(0)); + assertFalse (AnyHoldsNullPtr(nullptr)); assertTrue (AnyHoldsNullPtr(nullPtr)); assertTrue (AnyHoldsNullPtr(&nullPtr)); try diff --git a/Foundation/testsuite/src/ArrayTest.cpp b/Foundation/testsuite/src/ArrayTest.cpp index 38ad5caa6..e1b66cfe6 100644 --- a/Foundation/testsuite/src/ArrayTest.cpp +++ b/Foundation/testsuite/src/ArrayTest.cpp @@ -126,65 +126,65 @@ void ArrayTest::testContainer() void ArrayTest::testIterator() { - // create array of four seasons + // create array of four seasons Poco::Array seasons = { - { "spring", "summer", "autumn", "winter" } - }; + { "spring", "summer", "autumn", "winter" } + }; - // copy and change order + // copy and change order Poco::Array org = seasons; - for (size_t i=seasons.size()-1; i>0; --i) { + for (size_t i=seasons.size()-1; i>0; --i) { swap(seasons.at(i),seasons.at((i+1)%seasons.size())); - } + } - // try swap() - swap(seasons,org); + // try swap() + swap(seasons,org); - // try reverse iterators - for (Poco::Array::reverse_iterator pos - =seasons.rbegin(); pos::reverse_iterator pos + =seasons.rbegin(); pos IArray; IArray a = { { 1, 2, 3, 4, 5 } }; IArray b(a); - // modify elements directly - for (unsigned i=0; i()); // operation - for (unsigned i=0; ilog(message); - } + for (uint32_t j = 0; j < LONG_MAX_FILESIZE; ++j) + { + Poco::Message message("ABC", text, Poco::Message::PRIO_INFORMATION); + fileChannel->log(message); + } } fileChannel->close(); diff --git a/Foundation/testsuite/src/FileStreamRWLockTest.cpp b/Foundation/testsuite/src/FileStreamRWLockTest.cpp index 2752709ee..8918b7ee4 100644 --- a/Foundation/testsuite/src/FileStreamRWLockTest.cpp +++ b/Foundation/testsuite/src/FileStreamRWLockTest.cpp @@ -59,7 +59,7 @@ HANDLE createFileWithRWAccess(const std::string &path) DWORD access = GENERIC_READ | GENERIC_WRITE; DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - HANDLE handle = CreateFileA(path.c_str(), access, shareMode, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE handle = CreateFileA(path.c_str(), access, shareMode, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (handle == INVALID_HANDLE_VALUE) Poco::File::handleLastError(path); diff --git a/Foundation/testsuite/src/FileStreamTest.cpp b/Foundation/testsuite/src/FileStreamTest.cpp index b6b467ed5..bf1b18c44 100644 --- a/Foundation/testsuite/src/FileStreamTest.cpp +++ b/Foundation/testsuite/src/FileStreamTest.cpp @@ -72,8 +72,8 @@ void FileStreamTest::testWriteReadNativeHandle() file.append(".txt"); std::wstring utf16Path; Poco::UnicodeConverter::toUTF16(file, utf16Path); - outHandle = CreateFileW(utf16Path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); - assertTrue(outHandle != INVALID_HANDLE_VALUE); + outHandle = CreateFileW(utf16Path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); + assertTrue(outHandle != INVALID_HANDLE_VALUE); #else std::string file("testfile.txt"); outHandle = ::open(file.c_str(), O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); @@ -81,17 +81,17 @@ void FileStreamTest::testWriteReadNativeHandle() Poco::TemporaryFile::registerForDeletion(file); - fos.openHandle(outHandle, std::ios::binary | std::ios::out | std::ios::trunc); + fos.openHandle(outHandle, std::ios::binary | std::ios::out | std::ios::trunc); fos << "sometestdata"; fos.close(); - Poco::FileIOS::NativeHandle inHandle; + Poco::FileIOS::NativeHandle inHandle; #if defined(POCO_OS_FAMILY_WINDOWS) - inHandle = CreateFileW(utf16Path.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); - assertTrue(inHandle != INVALID_HANDLE_VALUE); + inHandle = CreateFileW(utf16Path.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); + assertTrue(inHandle != INVALID_HANDLE_VALUE); #else - inHandle = ::open(file.c_str(), O_RDONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); + inHandle = ::open(file.c_str(), O_RDONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); #endif fis.openHandle(inHandle, std::ios::in); diff --git a/Foundation/testsuite/src/FileTest.cpp b/Foundation/testsuite/src/FileTest.cpp index 5dea26224..8cdb1cf52 100644 --- a/Foundation/testsuite/src/FileTest.cpp +++ b/Foundation/testsuite/src/FileTest.cpp @@ -235,8 +235,8 @@ void FileTest::testExists() File f3("cmd"); assertTrue (f3.canExecute()); - File f4("cmd-nonexistent"); - assertFalse (f4.canExecute()); + File f4("cmd-nonexistent"); + assertFalse (f4.canExecute()); #endif assertFalse (f.exists()); assertTrue (f.existsAnywhere()); @@ -286,7 +286,7 @@ void FileTest::testFileAttributes3() #if POCO_OS==POCO_OS_CYGWIN File f("/dev/tty"); #else - File f("/dev/null"); + File f("/dev/null"); #endif #elif defined(POCO_OS_FAMILY_WINDOWS) File f("CON"); diff --git a/Foundation/testsuite/src/HMACEngineTest.cpp b/Foundation/testsuite/src/HMACEngineTest.cpp index f5a15a1b0..9fa9f14a5 100644 --- a/Foundation/testsuite/src/HMACEngineTest.cpp +++ b/Foundation/testsuite/src/HMACEngineTest.cpp @@ -265,8 +265,8 @@ void HMACEngineTest::testHMAC_SHA2_384() hmac6.update(data); digest = DigestEngine::digestToHex(hmac6.digest()); assertTrue (digest == "4ece084485813e9088d2c63a041bc5b4" - "4f9ef1012a2b588f3cd11f05033ac4c6" - "0c2ef6ab4030fe8296248df163f44952"); + "4f9ef1012a2b588f3cd11f05033ac4c6" + "0c2ef6ab4030fe8296248df163f44952"); key = std::string(131, std::string::value_type(0xaa)); data = std::string("This is a test using a larger than block-size key " @@ -353,9 +353,9 @@ void HMACEngineTest::testHMAC_SHA2_512() hmac6.update(data); digest = DigestEngine::digestToHex(hmac6.digest()); assertTrue (digest == "80b24263c7c1a3ebb71493c1dd7be8b4" - "9b46d1f41b4aeec1121b013783f8f352" - "6b56d037e05f2598bd0fd2215d6a1e52" - "95e64f73f63f0aec8b915a985d786598"); + "9b46d1f41b4aeec1121b013783f8f352" + "6b56d037e05f2598bd0fd2215d6a1e52" + "95e64f73f63f0aec8b915a985d786598"); key = std::string(131, std::string::value_type(0xaa)); data = std::string("This is a test using a larger than block-size key " diff --git a/Foundation/testsuite/src/ListMapTest.cpp b/Foundation/testsuite/src/ListMapTest.cpp index 0ef00e0e5..edd96f928 100644 --- a/Foundation/testsuite/src/ListMapTest.cpp +++ b/Foundation/testsuite/src/ListMapTest.cpp @@ -91,7 +91,7 @@ void ListMapTest::testInsertOrder() lm.insert(StrToIntMap::ValueType("foo", 44)); - it = lm.begin(); + it = lm.begin(); assertTrue (it != lm.end() && it->first == "foo" && it->second == 42); ++it; diff --git a/Foundation/testsuite/src/LocalDateTimeTest.cpp b/Foundation/testsuite/src/LocalDateTimeTest.cpp index c0f040273..999db00e7 100644 --- a/Foundation/testsuite/src/LocalDateTimeTest.cpp +++ b/Foundation/testsuite/src/LocalDateTimeTest.cpp @@ -366,7 +366,7 @@ void LocalDateTimeTest::testTimezone() std::time_t tINCREMENT = (30 * 24 * 60 * 60); // 30 days Timespan tsINCREMENT(30*Timespan::DAYS); LocalDateTime now; - std::time_t t = std::time(NULL); + std::time_t t = std::time(nullptr); std::tm then; bool foundDST = false; @@ -405,7 +405,7 @@ void LocalDateTimeTest::testTimezone() // to the LocalDateTime value. The comparision operator // verifies the _dateTime and _tzd members. LocalDateTime dt2; - t = std::time(NULL); + t = std::time(nullptr); for (iterations = 0; iterations < 14; ++iterations) { t += tINCREMENT; diff --git a/Foundation/testsuite/src/LoggerTest.cpp b/Foundation/testsuite/src/LoggerTest.cpp index afa33bbe0..6e815042f 100644 --- a/Foundation/testsuite/src/LoggerTest.cpp +++ b/Foundation/testsuite/src/LoggerTest.cpp @@ -285,7 +285,7 @@ void LoggerTest::testDump() root.dump("", buffer3, sizeof(buffer3)); msg = pChannel->list().begin()->getText(); assertTrue (msg == "0000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ................\n" - "0010 20 41 42 1F 7F 7E AB..~"); + "0010 20 41 42 1F 7F 7E AB..~"); pChannel->clear(); } diff --git a/Foundation/testsuite/src/LoggingFactoryTest.cpp b/Foundation/testsuite/src/LoggingFactoryTest.cpp index 7775d8fb2..7bddf5657 100644 --- a/Foundation/testsuite/src/LoggingFactoryTest.cpp +++ b/Foundation/testsuite/src/LoggingFactoryTest.cpp @@ -128,7 +128,7 @@ void LoggingFactoryTest::testCustom() fact->registerFormatterClass("CustomFormatter", new Instantiator); Channel::Ptr pCustomChannel = fact->createChannel("CustomChannel"); - assertTrue (dynamic_cast(pCustomChannel.get()) != 0); + assertTrue (dynamic_cast(pCustomChannel.get()) != nullptr); Formatter::Ptr pCustomFormatter = fact->createFormatter("CustomFormatter"); assertTrue (!pCustomFormatter.isNull()); diff --git a/Foundation/testsuite/src/MemoryPoolTest.cpp b/Foundation/testsuite/src/MemoryPoolTest.cpp index 7687cd93c..03b0a3a41 100644 --- a/Foundation/testsuite/src/MemoryPoolTest.cpp +++ b/Foundation/testsuite/src/MemoryPoolTest.cpp @@ -80,7 +80,7 @@ template bool fastMemPoolTest(int n) { bool ret = true; - std::vector vec(n, (T*)0); + std::vector vec(n, (T*)nullptr); Poco::FastMemoryPool pool(sizeof(T*), vec.size()/2); for (int i = 0; i < vec.size(); ++i) { @@ -104,7 +104,7 @@ template bool fastMemPoolTestCustom(int n, const T& val) { bool ret = true; - std::vector vec(n, (T*)0); + std::vector vec(n, (T*)nullptr); Poco::FastMemoryPool pool(sizeof(T*), vec.size()/2); for (int i = 0; i < vec.size(); ++i) { @@ -177,7 +177,7 @@ void MemoryPoolTest::testFastMemoryPool() Poco::FastMemoryPool fastIntPool(blocks); Poco::FastMemoryPool fastStringPool(blocks); - std::vector intVec(blocks, (int*)0); + std::vector intVec(blocks, (int*)nullptr); std::vector strVec(blocks); for (int i = 0; i < blocks; ++i) @@ -240,7 +240,7 @@ void MemoryPoolTest::memoryPoolBenchmark() Poco::Stopwatch sw; int reps = 1000000; - std::vector iVec(reps, (int*)0); + std::vector iVec(reps, (int*)nullptr); Poco::FastMemoryPool fastPool(reps); sw.restart(); for (int i = 0; i < reps; ++i) diff --git a/Foundation/testsuite/src/NDCTest.cpp b/Foundation/testsuite/src/NDCTest.cpp index 875b79783..ce4431993 100644 --- a/Foundation/testsuite/src/NDCTest.cpp +++ b/Foundation/testsuite/src/NDCTest.cpp @@ -70,7 +70,7 @@ void NDCTest::testNDCScope() auto line3 = __LINE__ - 1; assertTrue (NDC::current().depth() == 3); - std::ostringstream ostr1; + std::ostringstream ostr1; NDC::current().dump(ostr1); assertEqual (ostr1.str(), Poco::format( "\"item1\" (in \"%s\", line %d)\n" diff --git a/Foundation/testsuite/src/OrderedContainersTest.cpp b/Foundation/testsuite/src/OrderedContainersTest.cpp index 7592f4198..f5615f566 100644 --- a/Foundation/testsuite/src/OrderedContainersTest.cpp +++ b/Foundation/testsuite/src/OrderedContainersTest.cpp @@ -68,7 +68,7 @@ namespace { return &x; } - pointer allocate(size_type n, const void* /*hint*/ = 0) + pointer allocate(size_type n, const void* /*hint*/ = nullptr) { nb_custom_allocs++; diff --git a/Foundation/testsuite/src/OrderedContainersTest.h b/Foundation/testsuite/src/OrderedContainersTest.h index 36da98632..5bb7e9acf 100644 --- a/Foundation/testsuite/src/OrderedContainersTest.h +++ b/Foundation/testsuite/src/OrderedContainersTest.h @@ -99,18 +99,18 @@ private: //func>>(); #define testSetFuncFwd(cont, func) { \ - func, \ - std::equal_to, \ - std::allocator, \ - std::deque>>(); \ - func, \ - std::equal_to, \ - std::allocator, \ - std::vector>>(); \ - func>>(); \ - func>(); \ - func>>(); \ - } + func, \ + std::equal_to, \ + std::allocator, \ + std::deque>>(); \ + func, \ + std::equal_to, \ + std::allocator, \ + std::vector>>(); \ + func>>(); \ + func>(); \ + func>>(); \ + } template void testMapInsertImpl() diff --git a/Foundation/testsuite/src/PathTest.cpp b/Foundation/testsuite/src/PathTest.cpp index dabe8f8aa..83815669e 100644 --- a/Foundation/testsuite/src/PathTest.cpp +++ b/Foundation/testsuite/src/PathTest.cpp @@ -1578,7 +1578,7 @@ void PathTest::testExpand() std::string s = Path::expand("~/.bashrc"); assertTrue (s == Path::expand("$HOME/.bashrc")); assertTrue (s == Environment::get("HOME") + "/.bashrc" || - s == Environment::get("HOME") + "//.bashrc"); + s == Environment::get("HOME") + "//.bashrc"); Path p(s); s = Path::expand("$HOME/.bashrc"); assertTrue (s == Path::expand("~/.bashrc")); @@ -1688,12 +1688,12 @@ void PathTest::testSelf() std::cout << self << std::endl; #if POCO_OS == POCO_OS_MAC_OS_X \ - || POCO_OS == POCO_OS_FREE_BSD \ - || POCO_OS == POCO_OS_NET_BSD \ + || POCO_OS == POCO_OS_FREE_BSD \ + || POCO_OS == POCO_OS_NET_BSD \ || POCO_OS == POCO_OS_SOLARIS \ || POCO_OS == POCO_OS_LINUX \ || POCO_OS == POCO_OS_ANDROID \ - || POCO_OS == POCO_OS_WINDOWS_NT + || POCO_OS == POCO_OS_WINDOWS_NT assertTrue(!self.empty()); Path p(self); diff --git a/Foundation/testsuite/src/ProcessTest.cpp b/Foundation/testsuite/src/ProcessTest.cpp index 13691ffdd..b081765db 100644 --- a/Foundation/testsuite/src/ProcessTest.cpp +++ b/Foundation/testsuite/src/ProcessTest.cpp @@ -97,7 +97,7 @@ void ProcessTest::testLaunchRedirectIn() std::vector args; args.push_back("-count"); Pipe inPipe; - ProcessHandle ph = Process::launch(cmd, args, &inPipe, 0, 0); + ProcessHandle ph = Process::launch(cmd, args, &inPipe, nullptr, nullptr); PipeOutputStream ostr(inPipe); ostr << std::string(100, 'x'); ostr.close(); @@ -123,7 +123,7 @@ void ProcessTest::testLaunchRedirectOut() std::vector args; args.push_back("-hello"); Pipe outPipe; - ProcessHandle ph = Process::launch(cmd, args, 0, &outPipe, 0); + ProcessHandle ph = Process::launch(cmd, args, nullptr, &outPipe, nullptr); PipeInputStream istr(outPipe); std::string s; int c = istr.get(); @@ -156,7 +156,7 @@ void ProcessTest::testLaunchEnv() #if defined(_WIN32) env["PATH"] = Poco::Environment::get("PATH"); // required for VS #endif - ProcessHandle ph = Process::launch(cmd, args, 0, &outPipe, 0, env); + ProcessHandle ph = Process::launch(cmd, args, nullptr, &outPipe, nullptr, env); PipeInputStream istr(outPipe); std::string s; int c = istr.get(); @@ -274,7 +274,7 @@ void ProcessTest::testIsRunning() std::vector args; args.push_back("-count"); Pipe inPipe; - ProcessHandle ph = Process::launch(cmd, args, &inPipe, 0, 0); + ProcessHandle ph = Process::launch(cmd, args, &inPipe, nullptr, nullptr); Process::PID id = ph.id(); assertTrue (Process::isRunning(ph)); assertTrue (Process::isRunning(id)); diff --git a/Foundation/testsuite/src/SharedPtrTest.cpp b/Foundation/testsuite/src/SharedPtrTest.cpp index 9d3d931cd..2c3ce3814 100644 --- a/Foundation/testsuite/src/SharedPtrTest.cpp +++ b/Foundation/testsuite/src/SharedPtrTest.cpp @@ -149,10 +149,10 @@ void SharedPtrTest::testSharedPtr() assertTrue (!(ptr4 != ptr2)); assertTrue (TestObject::count() == 2); - ptr1 = 0; - ptr2 = 0; - ptr3 = 0; - ptr4 = 0; + ptr1 = nullptr; + ptr2 = nullptr; + ptr3 = nullptr; + ptr4 = nullptr; assertTrue (TestObject::count() == 0); { @@ -180,7 +180,7 @@ void SharedPtrTest::testImplicitCast() assertTrue (TestObject::count() == 0); SharedPtr ptr1 = new DerivedObject("test", 666); assertTrue (TestObject::count() == 1); - ptr1 = 0; + ptr1 = nullptr; assertTrue (TestObject::count() == 0); } @@ -189,14 +189,14 @@ void SharedPtrTest::testExplicitCast() { SharedPtr ptr1 = new DerivedObject("test", 666); SharedPtr ptr2 = ptr1.cast(); - assertTrue (ptr2.get() != 0); + assertTrue (ptr2.get() != nullptr); // cast the other way round must fail ptr1 = new TestObject("test"); assertTrue (TestObject::count() == 2); ptr2 = ptr1.cast(); assertTrue (TestObject::count() == 1); - assertTrue (ptr2.get() == 0); + assertTrue (ptr2.get() == nullptr); } diff --git a/Foundation/testsuite/src/StringTest.cpp b/Foundation/testsuite/src/StringTest.cpp index b640eeb44..4bd2f05df 100644 --- a/Foundation/testsuite/src/StringTest.cpp +++ b/Foundation/testsuite/src/StringTest.cpp @@ -1444,7 +1444,7 @@ void StringTest::benchmarkStrToInt() std::cout << "parseStream Number: " << res[0] << std::endl; double timeStream = sw.elapsed() / 1000.0; - char* pC = 0; + char* pC = nullptr; sw.restart(); for (int i = 0; i < 1000000; ++i) res[1] = std::strtol(num.c_str(), &pC, 10); sw.stop(); @@ -1499,7 +1499,7 @@ void StringTest::benchmarkStrToFloat() double timeStream = sw.elapsed() / 1000.0; // standard strtod - char* pC = 0; + char* pC = nullptr; sw.restart(); for (int i = 0; i < 1000000; ++i) res[1] = std::strtod(num.c_str(), &pC); sw.stop(); diff --git a/Foundation/testsuite/src/TestApp.cpp b/Foundation/testsuite/src/TestApp.cpp index 8c0d0ac8c..a7c640223 100644 --- a/Foundation/testsuite/src/TestApp.cpp +++ b/Foundation/testsuite/src/TestApp.cpp @@ -113,7 +113,7 @@ public: } sigaddset(&sset, SIGQUIT); sigaddset(&sset, SIGTERM); - sigprocmask(SIG_BLOCK, &sset, NULL); + sigprocmask(SIG_BLOCK, &sset, nullptr); int sig; sigwait(&sset, &sig); } @@ -169,7 +169,7 @@ HANDLE openFileWithRWAccess(const std::string& path) DWORD access = GENERIC_READ | GENERIC_WRITE; DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - HANDLE handle = CreateFileA(path.c_str(), access, shareMode, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE handle = CreateFileA(path.c_str(), access, shareMode, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); if (handle == INVALID_HANDLE_VALUE) Poco::File::handleLastError(path); diff --git a/Foundation/testsuite/src/TimedNotificationQueueTest.cpp b/Foundation/testsuite/src/TimedNotificationQueueTest.cpp index cf68d51fa..25a89ba8f 100644 --- a/Foundation/testsuite/src/TimedNotificationQueueTest.cpp +++ b/Foundation/testsuite/src/TimedNotificationQueueTest.cpp @@ -86,7 +86,7 @@ void TimedNotificationQueueTest::testDequeue() queue.enqueueNotification(new QTestNotification("second"), ts2); assertTrue (!queue.empty()); assertTrue (queue.size() == 4); - QTestNotification* pTNf = 0; + QTestNotification* pTNf = nullptr; while (!pTNf) { pTNf = dynamic_cast(queue.dequeueNotification()); @@ -98,7 +98,7 @@ void TimedNotificationQueueTest::testDequeue() assertTrue (!queue.empty()); assertTrue (queue.size() == 3); - pTNf = 0; + pTNf = nullptr; while (!pTNf) { pTNf = dynamic_cast(queue.dequeueNotification()); @@ -110,7 +110,7 @@ void TimedNotificationQueueTest::testDequeue() assertTrue (!queue.empty()); assertTrue (queue.size() == 2); - pTNf = 0; + pTNf = nullptr; while (!pTNf) { pTNf = dynamic_cast(queue.dequeueNotification()); @@ -122,7 +122,7 @@ void TimedNotificationQueueTest::testDequeue() assertTrue (!queue.empty()); assertTrue (queue.size() == 1); - pTNf = 0; + pTNf = nullptr; while (!pTNf) { pTNf = dynamic_cast(queue.dequeueNotification()); diff --git a/Foundation/testsuite/src/URIStreamOpenerTest.cpp b/Foundation/testsuite/src/URIStreamOpenerTest.cpp index 9a68ea1e2..c0e7ec28e 100644 --- a/Foundation/testsuite/src/URIStreamOpenerTest.cpp +++ b/Foundation/testsuite/src/URIStreamOpenerTest.cpp @@ -70,7 +70,7 @@ void URIStreamOpenerTest::testStreamOpenerFile() URIStreamOpener opener; std::istream* istr = opener.open(uri); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; } @@ -90,7 +90,7 @@ void URIStreamOpenerTest::testStreamOpenerRelative() URIStreamOpener opener; std::istream* istr = opener.open(uri); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; } @@ -112,7 +112,7 @@ void URIStreamOpenerTest::testStreamOpenerURI() URIStreamOpener opener; std::istream* istr = opener.open(uriString); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; } @@ -138,7 +138,7 @@ void URIStreamOpenerTest::testStreamOpenerURIResolve() URIStreamOpener opener; std::istream* istr = opener.open(uriString, p.getFileName()); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; } @@ -155,7 +155,7 @@ void URIStreamOpenerTest::testStreamOpenerPath() URIStreamOpener opener; std::istream* istr = opener.open(path); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; } @@ -176,7 +176,7 @@ void URIStreamOpenerTest::testStreamOpenerPathResolve() URIStreamOpener opener; std::istream* istr = opener.open(base, p.getFileName()); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; } @@ -190,7 +190,7 @@ void URIStreamOpenerTest::testRegisterUnregister() assertTrue (opener.supportsScheme("string")); URI uri("string:foobar"); std::istream* istr = opener.open(uri); - assertTrue (istr != 0); + assertTrue (istr != nullptr); assertTrue (istr->good()); delete istr; opener.unregisterStreamFactory("string"); diff --git a/Foundation/testsuite/src/UUIDGeneratorTest.cpp b/Foundation/testsuite/src/UUIDGeneratorTest.cpp index b22b2f826..4cdf76476 100644 --- a/Foundation/testsuite/src/UUIDGeneratorTest.cpp +++ b/Foundation/testsuite/src/UUIDGeneratorTest.cpp @@ -34,11 +34,11 @@ void UUIDGeneratorTest::testTimeBased() { UUIDGenerator& gen = UUIDGenerator::defaultGenerator(); - std::set uuids; + std::set uuids; for (int i = 0; i < 1000; ++i) { - Poco::UUID uuid = gen.create(); - assertTrue (uuid.version() == Poco::UUID::UUID_TIME_BASED); + Poco::UUID uuid = gen.create(); + assertTrue (uuid.version() == Poco::UUID::UUID_TIME_BASED); assertTrue (uuids.find(uuid) == uuids.end()); uuids.insert(uuid); } @@ -49,11 +49,11 @@ void UUIDGeneratorTest::testRandom() { UUIDGenerator& gen = UUIDGenerator::defaultGenerator(); - std::set uuids; + std::set uuids; for (int i = 0; i < 1000; ++i) { - Poco::UUID uuid = gen.createRandom(); - assertTrue (uuid.version() == Poco::UUID::UUID_RANDOM); + Poco::UUID uuid = gen.createRandom(); + assertTrue (uuid.version() == Poco::UUID::UUID_RANDOM); assertTrue (uuids.find(uuid) == uuids.end()); uuids.insert(uuid); } @@ -64,28 +64,28 @@ void UUIDGeneratorTest::testNameBased() { UUIDGenerator& gen = UUIDGenerator::defaultGenerator(); - Poco::UUID uuid1 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid"); - assertTrue (uuid1.version() == Poco::UUID::UUID_NAME_BASED); + Poco::UUID uuid1 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid"); + assertTrue (uuid1.version() == Poco::UUID::UUID_NAME_BASED); assertTrue (uuid1.variant() == 2); - Poco::UUID uuid2 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid2"); + Poco::UUID uuid2 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid2"); assertTrue (uuid2 != uuid1); - Poco::UUID uuid3 = gen.createFromName(Poco::UUID::dns(), "www.appinf.com"); + Poco::UUID uuid3 = gen.createFromName(Poco::UUID::dns(), "www.appinf.com"); assertTrue (uuid3 != uuid1); - Poco::UUID uuid4 = gen.createFromName(Poco::UUID::oid(), "1.3.6.1.4.1"); + Poco::UUID uuid4 = gen.createFromName(Poco::UUID::oid(), "1.3.6.1.4.1"); assertTrue (uuid4 != uuid1); - Poco::UUID uuid5 = gen.createFromName(Poco::UUID::x500(), "cn=Guenter Obiltschnig, ou=People, o=Applied Informatics, c=at"); + Poco::UUID uuid5 = gen.createFromName(Poco::UUID::x500(), "cn=Guenter Obiltschnig, ou=People, o=Applied Informatics, c=at"); assertTrue (uuid5 != uuid1); - Poco::UUID uuid6 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid"); + Poco::UUID uuid6 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid"); assertTrue (uuid6 == uuid1); Poco::SHA1Engine sha1; - Poco::UUID uuid7 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid", sha1); - assertTrue (uuid7.version() == Poco::UUID::UUID_NAME_BASED_SHA1); + Poco::UUID uuid7 = gen.createFromName(Poco::UUID::uri(), "http://www.appinf.com/uuid", sha1); + assertTrue (uuid7.version() == Poco::UUID::UUID_NAME_BASED_SHA1); assertTrue (uuid7.variant() == 2); assertTrue (uuid7 != uuid1); } diff --git a/Foundation/testsuite/src/UUIDTest.cpp b/Foundation/testsuite/src/UUIDTest.cpp index c3d7b1848..843b3e4f6 100644 --- a/Foundation/testsuite/src/UUIDTest.cpp +++ b/Foundation/testsuite/src/UUIDTest.cpp @@ -26,7 +26,7 @@ UUIDTest::~UUIDTest() void UUIDTest::testParse() { - Poco::UUID uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); + Poco::UUID uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); assertTrue (uuid.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8"); uuid.parse("6BA7B810-9DAD-11D1-80B4-00C04FD430C8"); @@ -38,7 +38,7 @@ void UUIDTest::testParse() try { uuid.parse("6xA7B8109DAD11D180B400C04FD430C8"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -47,7 +47,7 @@ void UUIDTest::testParse() try { uuid.parse("6xa7b810-9dad-11d1-80b4-00c04fd430c8"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -56,7 +56,7 @@ void UUIDTest::testParse() try { uuid.parse("6ba7b810-xdad-11d1-80b4-00c04fd430c8"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -65,7 +65,7 @@ void UUIDTest::testParse() try { uuid.parse("6ba7b810-9dad-x1d1-80b4-00c04fd430c8"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -74,7 +74,7 @@ void UUIDTest::testParse() try { uuid.parse("6ba7b810-9dad-11d1-x0b4-00c04fd430c8"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -83,7 +83,7 @@ void UUIDTest::testParse() try { uuid.parse("6ba7b810-9dad-11d1-80b4-00x04fd430c8"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -92,7 +92,7 @@ void UUIDTest::testParse() try { uuid.parse("495cff3a-a4b3-11ee-9e54-9cb6d0f68b51AA"); - fail("invalid Poco::UUID - must throw"); + fail("invalid Poco::UUID - must throw"); } catch (Poco::SyntaxException&) { @@ -102,10 +102,10 @@ void UUIDTest::testParse() void UUIDTest::testBuffer() { - Poco::UUID uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); + Poco::UUID uuid("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); char buffer[16]; uuid.copyTo(buffer); - Poco::UUID uuid2; + Poco::UUID uuid2; uuid2.copyFrom(buffer); assertTrue (uuid2.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8"); } @@ -113,12 +113,12 @@ void UUIDTest::testBuffer() void UUIDTest::testCompare() { - Poco::UUID null; + Poco::UUID null; assertTrue (null.isNull()); - assertTrue (Poco::UUID::null().isNull()); + assertTrue (Poco::UUID::null().isNull()); - Poco::UUID uuid1 = null; - Poco::UUID uuid2; + Poco::UUID uuid1 = null; + Poco::UUID uuid2; assertTrue (uuid1.isNull()); assertTrue (uuid1 == null); assertTrue (!(uuid1 != null)); @@ -128,7 +128,7 @@ void UUIDTest::testCompare() assertTrue (!(uuid1 < null)); assertTrue (uuid1.toString() == "00000000-0000-0000-0000-000000000000"); - uuid1 = Poco::UUID::dns(); + uuid1 = Poco::UUID::dns(); assertTrue (!uuid1.isNull()); assertTrue (uuid1 != null); assertTrue (!(uuid1 == null)); @@ -157,27 +157,27 @@ void UUIDTest::testCompare() void UUIDTest::testVersion() { - Poco::UUID uuid("db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); - Poco::UUID::Version v = uuid.version(); - assertTrue (v == Poco::UUID::UUID_RANDOM); + Poco::UUID uuid("db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); + Poco::UUID::Version v = uuid.version(); + assertTrue (v == Poco::UUID::UUID_RANDOM); uuid.parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8"); v = uuid.version(); - assertTrue (v == Poco::UUID::UUID_TIME_BASED); + assertTrue (v == Poco::UUID::UUID_TIME_BASED); uuid.parse("d2ee4220-3625-11d9-9669-0800200c9a66"); v = uuid.version(); - assertTrue (v == Poco::UUID::UUID_TIME_BASED); + assertTrue (v == Poco::UUID::UUID_TIME_BASED); uuid.parse("360d3652-4411-4786-bbe6-b9675b548559"); v = uuid.version(); - assertTrue (v == Poco::UUID::UUID_RANDOM); + assertTrue (v == Poco::UUID::UUID_RANDOM); } void UUIDTest::testVariant() { - Poco::UUID uuid("db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); + Poco::UUID uuid("db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); int v = uuid.variant(); assertTrue (v == 2); @@ -197,8 +197,8 @@ void UUIDTest::testVariant() void UUIDTest::testSwap() { - Poco::UUID uuid1("db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); - Poco::UUID uuid2("d2ee4220-3625-11d9-9669-0800200c9a66"); + Poco::UUID uuid1("db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); + Poco::UUID uuid2("d2ee4220-3625-11d9-9669-0800200c9a66"); uuid1.swap(uuid2); assertTrue (uuid1.toString() == "d2ee4220-3625-11d9-9669-0800200c9a66"); assertTrue (uuid2.toString() == "db4fa7e9-9e62-4597-99e0-b1ec0b59800e"); @@ -207,11 +207,11 @@ void UUIDTest::testSwap() void UUIDTest::testTryParse() { - Poco::UUID uuid; + Poco::UUID uuid; assertTrue (uuid.tryParse("6BA7B810-9DAD-11D1-80B4-00C04FD430C8")); assertTrue (uuid.toString() == "6ba7b810-9dad-11d1-80b4-00c04fd430c8"); - Poco::UUID notUuid; + Poco::UUID notUuid; assertTrue (!notUuid.tryParse("not a uuid")); assertTrue (notUuid.isNull()); } diff --git a/JWT/testsuite/src/SignerTest.cpp b/JWT/testsuite/src/SignerTest.cpp index 63d51f442..3757959ea 100644 --- a/JWT/testsuite/src/SignerTest.cpp +++ b/JWT/testsuite/src/SignerTest.cpp @@ -255,7 +255,7 @@ void SignerTest::testSignRS256() token.setIssuedAt(Poco::Timestamp::fromEpochTime(1516239022)); std::istringstream privateKeyStream(RSA_PRIVATE_KEY); - Poco::SharedPtr pKey = new Poco::Crypto::RSAKey(0, &privateKeyStream); + Poco::SharedPtr pKey = new Poco::Crypto::RSAKey(nullptr, &privateKeyStream); Signer signer(pKey); std::string jwt = signer.sign(token, Signer::ALGO_RS256); @@ -273,7 +273,7 @@ void SignerTest::testSignRS384() token.setIssuedAt(Poco::Timestamp::fromEpochTime(1516239022)); std::istringstream privateKeyStream(RSA_PRIVATE_KEY); - Poco::SharedPtr pKey = new Poco::Crypto::RSAKey(0, &privateKeyStream); + Poco::SharedPtr pKey = new Poco::Crypto::RSAKey(nullptr, &privateKeyStream); Signer signer(pKey); std::string jwt = signer.sign(token, Signer::ALGO_RS384); @@ -291,7 +291,7 @@ void SignerTest::testSignRS512() token.setIssuedAt(Poco::Timestamp::fromEpochTime(1516239022)); std::istringstream privateKeyStream(RSA_PRIVATE_KEY); - Poco::SharedPtr pKey = new Poco::Crypto::RSAKey(0, &privateKeyStream); + Poco::SharedPtr pKey = new Poco::Crypto::RSAKey(nullptr, &privateKeyStream); Signer signer(pKey); std::string jwt = signer.sign(token, Signer::ALGO_RS512); @@ -390,7 +390,7 @@ void SignerTest::testSignVerifyES256() token.setIssuedAt(Poco::Timestamp::fromEpochTime(1516239022)); std::istringstream privateKeyStream(ECDSA_PRIVATE_KEY); - Poco::SharedPtr pKey = new Poco::Crypto::ECKey(0, &privateKeyStream); + Poco::SharedPtr pKey = new Poco::Crypto::ECKey(nullptr, &privateKeyStream); Signer signer(pKey); std::string jwt = signer.sign(token, Signer::ALGO_ES256); @@ -454,7 +454,7 @@ void SignerTest::testSignVerifyES384() token.setIssuedAt(Poco::Timestamp::fromEpochTime(1516239022)); std::istringstream privateKeyStream(ECDSA_PRIVATE_KEY); - Poco::SharedPtr pKey = new Poco::Crypto::ECKey(0, &privateKeyStream); + Poco::SharedPtr pKey = new Poco::Crypto::ECKey(nullptr, &privateKeyStream); Signer signer(pKey); std::string jwt = signer.sign(token, Signer::ALGO_ES384); @@ -518,7 +518,7 @@ void SignerTest::testSignVerifyES512() token.setIssuedAt(Poco::Timestamp::fromEpochTime(1516239022)); std::istringstream privateKeyStream(ECDSA_PRIVATE_KEY); - Poco::SharedPtr pKey = new Poco::Crypto::ECKey(0, &privateKeyStream); + Poco::SharedPtr pKey = new Poco::Crypto::ECKey(nullptr, &privateKeyStream); Signer signer(pKey); std::string jwt = signer.sign(token, Signer::ALGO_ES512); diff --git a/MongoDB/include/Poco/MongoDB/Document.h b/MongoDB/include/Poco/MongoDB/Document.h index ad33af5a3..58233e0d2 100644 --- a/MongoDB/include/Poco/MongoDB/Document.h +++ b/MongoDB/include/Poco/MongoDB/Document.h @@ -124,7 +124,7 @@ public: if (ElementTraits::TypeId == element->type()) { auto* concrete = dynamic_cast* >(element.get()); - if (concrete != 0) + if (concrete != nullptr) { return concrete->value(); } @@ -148,7 +148,7 @@ public: if (ElementTraits::TypeId == element->type()) { auto* concrete = dynamic_cast* >(element.get()); - if (concrete != 0) + if (concrete != nullptr) { return concrete->value(); } diff --git a/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h b/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h index 26c485eab..afacc604f 100644 --- a/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h +++ b/MongoDB/include/Poco/MongoDB/PoolableConnectionFactory.h @@ -36,13 +36,13 @@ class PoolableObjectFactory public: PoolableObjectFactory(Net::SocketAddress& address): _address(address), - _pSocketFactory(0) + _pSocketFactory(nullptr) { } PoolableObjectFactory(const std::string& address): _address(address), - _pSocketFactory(0) + _pSocketFactory(nullptr) { } diff --git a/MongoDB/src/ReplicaSet.cpp b/MongoDB/src/ReplicaSet.cpp index fce2f2bda..faaef997d 100644 --- a/MongoDB/src/ReplicaSet.cpp +++ b/MongoDB/src/ReplicaSet.cpp @@ -79,10 +79,10 @@ Connection::Ptr ReplicaSet::isMaster(const Net::SocketAddress& address) } catch (...) { - conn = 0; + conn = nullptr; } - return 0; + return nullptr; } diff --git a/MongoDB/testsuite/src/MongoDBTest.cpp b/MongoDB/testsuite/src/MongoDBTest.cpp index ccec83004..3b2867be5 100644 --- a/MongoDB/testsuite/src/MongoDBTest.cpp +++ b/MongoDB/testsuite/src/MongoDBTest.cpp @@ -512,7 +512,7 @@ CppUnit::Test* MongoDBTest::suite() catch (Poco::Net::ConnectionRefusedException& e) { std::cout << "Couldn't connect to " << e.message() << ". " << std::endl; - return 0; + return nullptr; } CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("MongoDBTest"); diff --git a/Net/include/Poco/Net/FTPClientSession.h b/Net/include/Poco/Net/FTPClientSession.h index c2d79a24d..576fea035 100644 --- a/Net/include/Poco/Net/FTPClientSession.h +++ b/Net/include/Poco/Net/FTPClientSession.h @@ -403,7 +403,7 @@ inline bool FTPClientSession::isPermanentNegative(int status) inline bool FTPClientSession::isOpen() const { - return _pControlSocket != 0; + return _pControlSocket != nullptr; } diff --git a/Net/include/Poco/Net/HTTPServerResponseImpl.h b/Net/include/Poco/Net/HTTPServerResponseImpl.h index bc2c06674..da2cb3e42 100644 --- a/Net/include/Poco/Net/HTTPServerResponseImpl.h +++ b/Net/include/Poco/Net/HTTPServerResponseImpl.h @@ -124,7 +124,7 @@ private: // inline bool HTTPServerResponseImpl::sent() const { - return _pStream != 0; + return _pStream != nullptr; } diff --git a/Net/include/Poco/Net/ICMPPacket.h b/Net/include/Poco/Net/ICMPPacket.h index d98a5330d..0084c28a0 100644 --- a/Net/include/Poco/Net/ICMPPacket.h +++ b/Net/include/Poco/Net/ICMPPacket.h @@ -55,7 +55,7 @@ public: int maxPacketSize() const; /// Returns the total length of packet (header + data); - struct timeval time(Poco::UInt8* buffer = 0, int length = 0) const; + struct timeval time(Poco::UInt8* buffer = nullptr, 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 and /// returns the extracted value. diff --git a/Net/include/Poco/Net/ICMPPacketImpl.h b/Net/include/Poco/Net/ICMPPacketImpl.h index ba8a179f3..3a4b14128 100644 --- a/Net/include/Poco/Net/ICMPPacketImpl.h +++ b/Net/include/Poco/Net/ICMPPacketImpl.h @@ -57,7 +57,7 @@ public: int getDataSize() const; /// Returns data size. - virtual struct timeval time(Poco::UInt8* buffer = 0, int length = 0) const = 0; + virtual struct timeval time(Poco::UInt8* buffer = nullptr, int length = 0) const = 0; /// Returns current epoch time if either argument is equal to zero. /// Otherwise, it extracts the time value from the supplied buffer. /// diff --git a/Net/include/Poco/Net/ICMPv4PacketImpl.h b/Net/include/Poco/Net/ICMPv4PacketImpl.h index 287b10041..1127deb86 100644 --- a/Net/include/Poco/Net/ICMPv4PacketImpl.h +++ b/Net/include/Poco/Net/ICMPv4PacketImpl.h @@ -33,7 +33,7 @@ class Net_API ICMPv4PacketImpl : public ICMPPacketImpl /// Parts are based on the original ICMP code by /// Mike Muuss /// U. S. Army Ballistic Research Laboratory - /// December, 1983 + /// December, 1983 { public: // ICMPv4 header @@ -134,7 +134,7 @@ public: int packetSize() const; /// Returns the total length of packet (header + data); - struct timeval time(Poco::UInt8* buffer = 0, int length = 0) const; + struct timeval time(Poco::UInt8* buffer = nullptr, 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. /// diff --git a/Net/include/Poco/Net/MailMessage.h b/Net/include/Poco/Net/MailMessage.h index 380353b4f..0fd265c27 100644 --- a/Net/include/Poco/Net/MailMessage.h +++ b/Net/include/Poco/Net/MailMessage.h @@ -78,7 +78,7 @@ public: using PartVec = std::vector; - MailMessage(PartStoreFactory* pStoreFactory = 0); + MailMessage(PartStoreFactory* pStoreFactory = nullptr); /// Creates an empty MailMessage. /// /// If pStoreFactory is not null, message attachments will be diff --git a/Net/include/Poco/Net/MessageHeader.h b/Net/include/Poco/Net/MessageHeader.h index c1da4cc0a..4e5d79174 100644 --- a/Net/include/Poco/Net/MessageHeader.h +++ b/Net/include/Poco/Net/MessageHeader.h @@ -184,7 +184,7 @@ public: static void decodeRFC2047(const std::string& ins, std::string& outs, const std::string& charset = "UTF-8"); static std::string decodeWord(const std::string& text, const std::string& charset = "UTF-8"); - /// Decode RFC2047 string. + /// Decode RFC2047 string. private: diff --git a/Net/include/Poco/Net/SMTPClientSession.h b/Net/include/Poco/Net/SMTPClientSession.h index c564e7e81..6a1ad0beb 100644 --- a/Net/include/Poco/Net/SMTPClientSession.h +++ b/Net/include/Poco/Net/SMTPClientSession.h @@ -190,7 +190,7 @@ protected: const std::string& host() const; private: - void sendCommands(const MailMessage& message, const Recipients* pRecipients = 0); + void sendCommands(const MailMessage& message, const Recipients* pRecipients = nullptr); void transportMessage(const MailMessage& message); std::string _host; diff --git a/Net/include/Poco/Net/ServerSocket.h b/Net/include/Poco/Net/ServerSocket.h index b6556cc38..e3ab14594 100644 --- a/Net/include/Poco/Net/ServerSocket.h +++ b/Net/include/Poco/Net/ServerSocket.h @@ -114,7 +114,7 @@ public: /// /// If reuseAddress is true, sets the SO_REUSEADDR /// socket option. - /// + /// /// If reusePort is true, sets the SO_REUSEPORT /// socket option. diff --git a/Net/include/Poco/Net/TCPServer.h b/Net/include/Poco/Net/TCPServer.h index efc8c6f35..f33ba2089 100644 --- a/Net/include/Poco/Net/TCPServer.h +++ b/Net/include/Poco/Net/TCPServer.h @@ -108,7 +108,7 @@ class Net_API TCPServer: public Poco::Runnable /// Already served connections, however, will continue being served. { public: - TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::UInt16 portNumber = 0, TCPServerParams::Ptr pParams = 0); + TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::UInt16 portNumber = 0, TCPServerParams::Ptr pParams = nullptr); /// Creates the TCPServer, with ServerSocket listening on the given port. /// Default port is zero, allowing any available port. The port number /// can be queried through TCPServer::port() member. @@ -122,7 +122,7 @@ public: /// /// New threads are taken from the default thread pool. - TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocket& socket, TCPServerParams::Ptr pParams = 0); + TCPServer(TCPServerConnectionFactory::Ptr pFactory, const ServerSocket& socket, TCPServerParams::Ptr pParams = nullptr); /// Creates the TCPServer, using the given ServerSocket. /// /// The server takes ownership of the TCPServerConnectionFactory @@ -134,7 +134,7 @@ public: /// /// New threads are taken from the default thread pool. - TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams::Ptr pParams = 0); + TCPServer(TCPServerConnectionFactory::Ptr pFactory, Poco::ThreadPool& threadPool, const ServerSocket& socket, TCPServerParams::Ptr pParams = nullptr); /// Creates the TCPServer, using the given ServerSocket. /// /// The server takes ownership of the TCPServerConnectionFactory diff --git a/Net/include/Poco/Net/UDPHandler.h b/Net/include/Poco/Net/UDPHandler.h index 467cf798d..e9777a47b 100644 --- a/Net/include/Poco/Net/UDPHandler.h +++ b/Net/include/Poco/Net/UDPHandler.h @@ -19,6 +19,7 @@ #include "Poco/Net/Net.h" +#include "Poco/Net/SocketAddress.h" #include "Poco/RefCountedObject.h" #include "Poco/AutoPtr.h" #include "Poco/Runnable.h" @@ -31,14 +32,15 @@ #include #include #include +#include namespace Poco { namespace Net { -typedef int UDPMsgSizeT; -#define POCO_UDP_BUF_SIZE 1472 + sizeof(UDPMsgSizeT) + SocketAddress::MAX_ADDRESS_LENGTH +using UDPMsgSizeT = int; +#define POCO_UDP_BUF_SIZE (1472 + sizeof(UDPMsgSizeT) + SocketAddress::MAX_ADDRESS_LENGTH) template @@ -53,17 +55,17 @@ class UDPHandlerImpl: public Runnable, public RefCountedObject /// the inheriting class can call start() in the constructor. { public: - typedef UDPMsgSizeT MsgSizeT; - typedef AutoPtr Ptr; - typedef std::vector List; - typedef typename List::iterator Iterator; - typedef TMutex DFMutex; + using MsgSizeT = UDPMsgSizeT; + using Ptr = AutoPtr; + using List = std::vector; + using Iterator = typename List::iterator; + using DFMutex = TMutex; static const MsgSizeT BUF_STATUS_IDLE = 0; static const MsgSizeT BUF_STATUS_BUSY = -1; static const MsgSizeT BUF_STATUS_ERROR = -2; - UDPHandlerImpl(std::size_t bufListSize = 1000, std::ostream* pErr = 0): + UDPHandlerImpl(std::size_t bufListSize = 1000, std::ostream* pErr = nullptr): _thread("UDPHandlerImpl"), _stop(false), _done(false), @@ -94,7 +96,7 @@ public: /// the pointers to the newly created guard/buffer. /// If mutex lock times out, returns null pointer. { - char* ret = 0; + char* ret = nullptr; if (_mutex.tryLock(10)) { if (_buffers[sock].size() < _bufListSize) // building buffer list @@ -116,8 +118,8 @@ public: } else // last resort, full scan { - BufList::iterator it = _buffers[sock].begin(); - BufList::iterator end = _buffers[sock].end(); + auto it = _buffers[sock].begin(); + const auto end = _buffers[sock].end(); for (; it != end; ++it) { if (*reinterpret_cast(*_bufIt[sock]) == 0) // available @@ -145,7 +147,7 @@ public: _dataReady.set(); } - void run() + void run() override /// Does the work. { while (!_stop) @@ -156,12 +158,12 @@ public: { if (!_stop) { - BufMap::iterator it = _buffers.begin(); - BufMap::iterator end = _buffers.end(); + auto it = _buffers.begin(); + const auto end = _buffers.end(); for (; it != end; ++it) { - BufList::iterator lIt = it->second.begin(); - BufList::iterator lEnd = it->second.end(); + auto lIt = it->second.begin(); + const auto lEnd = it->second.end(); for (; lIt != lEnd; ++lIt) { if (hasData(*lIt)) @@ -268,9 +270,9 @@ public: static SocketAddress address(char* buf) { - poco_socklen_t* len = reinterpret_cast(buf + sizeof(MsgSizeT)); - struct sockaddr* pSA = reinterpret_cast(buf + sizeof(MsgSizeT) + sizeof(poco_socklen_t)); - return SocketAddress(pSA, *len); + auto* len = reinterpret_cast(buf + sizeof(MsgSizeT)); + auto* pSA = reinterpret_cast(buf + sizeof(MsgSizeT) + sizeof(poco_socklen_t)); + return {pSA, *len}; } static char* payload(char* buf) @@ -336,11 +338,11 @@ public: } private: - typedef std::deque BufList; - typedef std::map BufMap; - typedef typename BufList::iterator BLIt; - typedef std::map BufIt; - typedef Poco::FastMemoryPool MemPool; + using BufList = std::deque; + using BufMap = std::map; + using BLIt = typename BufList::iterator; + using BufIt = std::map; + using MemPool = Poco::FastMemoryPool; void setStatusImpl(char*& pBuf, MsgSizeT status) { @@ -378,7 +380,7 @@ private: }; -typedef UDPHandlerImpl UDPHandler; +using UDPHandler = UDPHandlerImpl; } } // namespace Poco::Net diff --git a/Net/include/Poco/Net/UDPSocketReader.h b/Net/include/Poco/Net/UDPSocketReader.h index 95301c75f..b9fb23c78 100644 --- a/Net/include/Poco/Net/UDPSocketReader.h +++ b/Net/include/Poco/Net/UDPSocketReader.h @@ -20,8 +20,10 @@ #include "Poco/Net/Net.h" #include "Poco/Net/DatagramSocket.h" +#include "Poco/Net/UDPHandler.h" #include "Poco/Net/UDPServerParams.h" +#include namespace Poco { namespace Net { @@ -100,10 +102,10 @@ public: /// for replying to sender and data or error backlog threshold is /// exceeded, sender is notified of the current backlog size. { - typedef typename UDPHandlerImpl::MsgSizeT RT; - char* p = 0; - struct sockaddr* pSA = 0; - poco_socklen_t* pAL = 0; + using RT = typename UDPHandlerImpl::MsgSizeT; + char* p = nullptr; + struct sockaddr* pSA = nullptr; + poco_socklen_t* pAL = nullptr; poco_socket_t sockfd = sock.impl()->sockfd(); nextHandler(); try @@ -112,16 +114,16 @@ public: if (p) { Poco::UInt16 off = handler().offset(); - poco_socklen_t* pAL = reinterpret_cast(p + sizeof(RT)); + pAL = reinterpret_cast(p + sizeof(RT)); *pAL = SocketAddress::MAX_ADDRESS_LENGTH; - struct sockaddr* pSA = reinterpret_cast(p + sizeof(RT) + sizeof(poco_socklen_t)); + pSA = reinterpret_cast(p + sizeof(RT) + sizeof(poco_socklen_t)); RT ret = sock.receiveFrom(p + off, S - off - 1, &pSA, &pAL); if (ret < 0) { AtomicCounter::ValueType errors = setError(sock.impl()->sockfd(), p, Error::getMessage(Error::last())); if (_backlogThreshold > 0 && errors > _backlogThreshold && errors != _errorBacklog[sockfd]) { - Poco::Int32 err = static_cast(errors); + auto err = static_cast(errors); sock.sendTo(&err, sizeof(Poco::Int32), SocketAddress(pSA, *pAL)); _errorBacklog[sockfd] = errors; } @@ -131,7 +133,7 @@ public: p[off + ret] = 0; // for ascii convenience, zero-terminate if (_backlogThreshold > 0 && data > _backlogThreshold && data != _dataBacklog[sockfd]) { - Poco::Int32 d = static_cast(data); + auto d = static_cast(data); sock.sendTo(&d, sizeof(Poco::Int32), SocketAddress(pSA, *pAL)); _dataBacklog[sockfd] = data; } @@ -143,7 +145,7 @@ public: AtomicCounter::ValueType errors = setError(sock.impl()->sockfd(), p, exc.displayText()); if (_backlogThreshold > 0 && errors > _backlogThreshold && errors != _errorBacklog[sockfd] && pSA && pAL) { - Poco::Int32 err = static_cast(errors); + auto err = static_cast(errors); sock.sendTo(&err, sizeof(Poco::Int32), SocketAddress(pSA, *pAL)); _errorBacklog[sockfd] = errors; } @@ -179,7 +181,7 @@ public: return done; } - AtomicCounter::ValueType setError(poco_socket_t sock, char* buf = 0, const std::string& err = "") + AtomicCounter::ValueType setError(poco_socket_t sock, char* buf = nullptr, const std::string& err = "") /// Sets error to the provided buffer buf. If the buffer is null, a new buffer is obtained /// from handler. /// If successful, returns the handler's eror backlog size, otherwise returns zero. @@ -205,9 +207,9 @@ private: return **_handler; } - typedef typename UDPHandlerImpl::List HandlerList; - typedef typename UDPHandlerImpl::List::iterator HandlerIterator; - typedef std::map CounterMap; + using HandlerList = typename UDPHandlerImpl::List; + using HandlerIterator = typename UDPHandlerImpl::List::iterator; + using CounterMap = std::map; HandlerList& _handlers; HandlerIterator _handler; diff --git a/Net/include/Poco/Net/WebSocket.h b/Net/include/Poco/Net/WebSocket.h index 056327d67..8034ca248 100644 --- a/Net/include/Poco/Net/WebSocket.h +++ b/Net/include/Poco/Net/WebSocket.h @@ -87,9 +87,9 @@ public: enum SendFlags /// Combined header flags and opcodes for use with sendFrame(). { - FRAME_TEXT = static_cast(FRAME_FLAG_FIN) | static_cast(FRAME_OP_TEXT), + FRAME_TEXT = static_cast(FRAME_FLAG_FIN) | static_cast(FRAME_OP_TEXT), /// Use this for sending a single text (UTF-8) payload frame. - FRAME_BINARY = static_cast(FRAME_FLAG_FIN) | static_cast(FRAME_OP_BINARY) + FRAME_BINARY = static_cast(FRAME_FLAG_FIN) | static_cast(FRAME_OP_BINARY) /// Use this for sending a single binary payload frame. }; diff --git a/Net/samples/HTTPReactorTimeServer/src/HTTPReactorTimeServer.cpp b/Net/samples/HTTPReactorTimeServer/src/HTTPReactorTimeServer.cpp index 1d22fc9a4..c5e121feb 100644 --- a/Net/samples/HTTPReactorTimeServer/src/HTTPReactorTimeServer.cpp +++ b/Net/samples/HTTPReactorTimeServer/src/HTTPReactorTimeServer.cpp @@ -101,7 +101,7 @@ public: if (request.getURI() == "/") return new TimeRequestHandler(_format, _delay); else - return 0; + return nullptr; } private: diff --git a/Net/samples/HTTPTimeServer/src/HTTPTimeServer.cpp b/Net/samples/HTTPTimeServer/src/HTTPTimeServer.cpp index 9f4ee7667..ddda6d73a 100644 --- a/Net/samples/HTTPTimeServer/src/HTTPTimeServer.cpp +++ b/Net/samples/HTTPTimeServer/src/HTTPTimeServer.cpp @@ -95,7 +95,7 @@ public: if (request.getURI() == "/") return new TimeRequestHandler(_format); else - return 0; + return nullptr; } private: diff --git a/Net/src/AbstractHTTPRequestHandler.cpp b/Net/src/AbstractHTTPRequestHandler.cpp index ed39617e2..c89145f92 100644 --- a/Net/src/AbstractHTTPRequestHandler.cpp +++ b/Net/src/AbstractHTTPRequestHandler.cpp @@ -28,9 +28,9 @@ namespace Net { AbstractHTTPRequestHandler::AbstractHTTPRequestHandler(): - _pRequest(0), - _pResponse(0), - _pForm(0) + _pRequest(nullptr), + _pResponse(nullptr), + _pForm(nullptr) { } diff --git a/Net/src/DNS.cpp b/Net/src/DNS.cpp index 92b1a204e..31917ae2f 100644 --- a/Net/src/DNS.cpp +++ b/Net/src/DNS.cpp @@ -76,7 +76,7 @@ HostEntry DNS::hostByName(const std::string& hostname, unsigned struct addrinfo hints; std::memset(&hints, 0, sizeof(hints)); hints.ai_flags = hintFlags; - int rc = getaddrinfo(hostname.c_str(), NULL, &hints, &pAI); + int rc = getaddrinfo(hostname.c_str(), nullptr, &hints, &pAI); if (rc == 0) { HostEntry result(pAI); @@ -118,14 +118,14 @@ HostEntry DNS::hostByAddress(const IPAddress& address, unsigned #if defined(POCO_HAVE_ADDRINFO) SocketAddress sa(address, 0); char fqname[1024]; - int rc = getnameinfo(sa.addr(), sa.length(), fqname, sizeof(fqname), NULL, 0, NI_NAMEREQD); + int rc = getnameinfo(sa.addr(), sa.length(), fqname, sizeof(fqname), nullptr, 0, NI_NAMEREQD); if (rc == 0) { struct addrinfo* pAI; struct addrinfo hints; std::memset(&hints, 0, sizeof(hints)); hints.ai_flags = hintFlags; - rc = getaddrinfo(fqname, NULL, &hints, &pAI); + rc = getaddrinfo(fqname, nullptr, &hints, &pAI); if (rc == 0) { HostEntry result(pAI); @@ -411,15 +411,15 @@ void DNS::aierror(int code, const std::string& arg) B. Disclaimer and license - Regarding this entire document or any portion of it (including - the pseudocode and C code), the author makes no guarantees and - is not responsible for any damage resulting from its use. The - author grants irrevocable permission to anyone to use, modify, - and distribute it in any way that does not diminish the rights - of anyone else to use, modify, and distribute it, provided that - redistributed derivative works do not contain misleading author or - version information. Derivative works need not be licensed under - similar terms. + Regarding this entire document or any portion of it (including + the pseudocode and C code), the author makes no guarantees and + is not responsible for any damage resulting from its use. The + author grants irrevocable permission to anyone to use, modify, + and distribute it in any way that does not diminish the rights + of anyone else to use, modify, and distribute it, provided that + redistributed derivative works do not contain misleading author or + version information. Derivative works need not be licensed under + similar terms. C. Punycode sample implementation diff --git a/Net/src/DialogSocket.cpp b/Net/src/DialogSocket.cpp index 030280c6c..2e20d8ca9 100644 --- a/Net/src/DialogSocket.cpp +++ b/Net/src/DialogSocket.cpp @@ -23,9 +23,9 @@ namespace Net { DialogSocket::DialogSocket(): - _pBuffer(0), - _pNext(0), - _pEnd(0) + _pBuffer(nullptr), + _pNext(nullptr), + _pEnd(nullptr) { allocBuffer(); } @@ -33,9 +33,9 @@ DialogSocket::DialogSocket(): DialogSocket::DialogSocket(const SocketAddress& address): StreamSocket(address), - _pBuffer(0), - _pNext(0), - _pEnd(0) + _pBuffer(nullptr), + _pNext(nullptr), + _pEnd(nullptr) { allocBuffer(); } @@ -43,9 +43,9 @@ DialogSocket::DialogSocket(const SocketAddress& address): DialogSocket::DialogSocket(const Socket& socket): StreamSocket(socket), - _pBuffer(0), - _pNext(0), - _pEnd(0) + _pBuffer(nullptr), + _pNext(nullptr), + _pEnd(nullptr) { allocBuffer(); } @@ -53,9 +53,9 @@ DialogSocket::DialogSocket(const Socket& socket): DialogSocket::DialogSocket(const DialogSocket& socket): StreamSocket(socket), - _pBuffer(0), - _pNext(0), - _pEnd(0) + _pBuffer(nullptr), + _pNext(nullptr), + _pEnd(nullptr) { allocBuffer(); } diff --git a/Net/src/FTPClientSession.cpp b/Net/src/FTPClientSession.cpp index cb22e58d3..910e119eb 100644 --- a/Net/src/FTPClientSession.cpp +++ b/Net/src/FTPClientSession.cpp @@ -29,8 +29,8 @@ namespace Net { FTPClientSession::FTPClientSession(Poco::UInt16 activeDataPort): - _pControlSocket(0), - _pDataStream(0), + _pControlSocket(nullptr), + _pDataStream(nullptr), _port(FTP_PORT), _activeDataPort(activeDataPort), _passiveMode(true), @@ -47,7 +47,7 @@ FTPClientSession::FTPClientSession(const StreamSocket& socket, bool readWelcomeMessage, Poco::UInt16 activeDataPort): _pControlSocket(new DialogSocket(socket)), - _pDataStream(0), + _pDataStream(nullptr), _host(socket.address().host().toString()), _port(socket.address().port()), _activeDataPort(activeDataPort), @@ -76,7 +76,7 @@ FTPClientSession::FTPClientSession(const std::string& host, const std::string& password, Poco::UInt16 activeDataPort): _pControlSocket(new DialogSocket(SocketAddress(host, port))), - _pDataStream(0), + _pDataStream(nullptr), _host(host), _port(port), _activeDataPort(activeDataPort), @@ -232,7 +232,7 @@ void FTPClientSession::close() { _pControlSocket->close(); delete _pControlSocket; - _pControlSocket = 0; + _pControlSocket = nullptr; } } @@ -337,7 +337,7 @@ std::istream& FTPClientSession::beginDownload(const std::string& path) throw FTPException("Connection is closed."); delete _pDataStream; - _pDataStream = 0; + _pDataStream = nullptr; _pDataStream = new SocketStream(establishDataConnection("RETR", path)); return *_pDataStream; } @@ -355,7 +355,7 @@ std::ostream& FTPClientSession::beginUpload(const std::string& path) throw FTPException("Connection is closed."); delete _pDataStream; - _pDataStream = 0; + _pDataStream = nullptr; _pDataStream = new SocketStream(establishDataConnection("STOR", path)); return *_pDataStream; } @@ -373,7 +373,7 @@ std::istream& FTPClientSession::beginList(const std::string& path, bool extended throw FTPException("Connection is closed."); delete _pDataStream; - _pDataStream = 0; + _pDataStream = nullptr; _pDataStream = new SocketStream(establishDataConnection(extended ? "LIST" : "NLST", path)); return *_pDataStream; } @@ -625,7 +625,7 @@ void FTPClientSession::endTransfer() if (_pDataStream) { delete _pDataStream; - _pDataStream = 0; + _pDataStream = nullptr; std::string response; int status = _pControlSocket->receiveStatusMessage(response); if (!isPositiveCompletion(status)) diff --git a/Net/src/FTPStreamFactory.cpp b/Net/src/FTPStreamFactory.cpp index 48dcdd7cb..954b19f67 100644 --- a/Net/src/FTPStreamFactory.cpp +++ b/Net/src/FTPStreamFactory.cpp @@ -110,7 +110,7 @@ FTPPasswordProvider::~FTPPasswordProvider() std::string FTPStreamFactory::_anonymousPassword("poco@localhost"); -FTPPasswordProvider* FTPStreamFactory::_pPasswordProvider(0); +FTPPasswordProvider* FTPStreamFactory::_pPasswordProvider(nullptr); FTPStreamFactory::FTPStreamFactory() diff --git a/Net/src/HTMLForm.cpp b/Net/src/HTMLForm.cpp index 0849f7662..8078b5c68 100644 --- a/Net/src/HTMLForm.cpp +++ b/Net/src/HTMLForm.cpp @@ -234,9 +234,9 @@ void HTMLForm::prepareSubmit(HTTPRequest& request, int options) request.setChunkedTransferEncoding(true); } if (!request.getChunkedTransferEncoding() && !request.hasContentLength()) - { - request.setContentLength(calculateContentLength()); - } + { + request.setContentLength(calculateContentLength()); + } } else { diff --git a/Net/src/HTTPClientSession.cpp b/Net/src/HTTPClientSession.cpp index 2e004e032..1ee4dd103 100644 --- a/Net/src/HTTPClientSession.cpp +++ b/Net/src/HTTPClientSession.cpp @@ -254,8 +254,8 @@ void HTTPClientSession::setKeepAliveTimeout(const Poco::Timespan& timeout) std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request) { - _pRequestStream = 0; - _pResponseStream = 0; + _pRequestStream = nullptr; + _pResponseStream = nullptr; bool keepAlive = getKeepAlive(); if (((connected() && !keepAlive) || mustReconnect()) && !_host.empty()) @@ -299,8 +299,8 @@ std::ostream& HTTPClientSession::sendRequest(HTTPRequest& request) std::ostream& HTTPClientSession::sendRequestImpl(const HTTPRequest& request) { - _pRequestStream = 0; - _pResponseStream = 0; + _pRequestStream = nullptr; + _pResponseStream = nullptr; clearException(); _responseReceived = false; _expectResponseBody = request.getMethod() != HTTPRequest::HTTP_HEAD; @@ -336,7 +336,7 @@ std::ostream& HTTPClientSession::sendRequestImpl(const HTTPRequest& request) void HTTPClientSession::flushRequest() { - _pRequestStream = 0; + _pRequestStream = nullptr; if (networkException()) networkException()->rethrow(); } diff --git a/Net/src/HTTPServerRequestImpl.cpp b/Net/src/HTTPServerRequestImpl.cpp index 4a686c29d..dbe3ed405 100644 --- a/Net/src/HTTPServerRequestImpl.cpp +++ b/Net/src/HTTPServerRequestImpl.cpp @@ -35,7 +35,7 @@ namespace Net { HTTPServerRequestImpl::HTTPServerRequestImpl(HTTPServerResponseImpl& response, HTTPSession& session, HTTPServerParams* pParams): _response(response), _session(session), - _pStream(0), + _pStream(nullptr), _pParams(pParams, true) { response.attachRequest(this); diff --git a/Net/src/HTTPServerResponseImpl.cpp b/Net/src/HTTPServerResponseImpl.cpp index ff033a565..81e3db6af 100644 --- a/Net/src/HTTPServerResponseImpl.cpp +++ b/Net/src/HTTPServerResponseImpl.cpp @@ -50,8 +50,8 @@ namespace Net { HTTPServerResponseImpl::HTTPServerResponseImpl(HTTPSession& session): _session(session), - _pRequest(0), - _pStream(0) + _pRequest(nullptr), + _pStream(nullptr) { } diff --git a/Net/src/HTTPSession.cpp b/Net/src/HTTPSession.cpp index 84e436f6d..98dc20041 100644 --- a/Net/src/HTTPSession.cpp +++ b/Net/src/HTTPSession.cpp @@ -26,42 +26,42 @@ namespace Net { HTTPSession::HTTPSession(): - _pBuffer(0), - _pCurrent(0), - _pEnd(0), + _pBuffer(nullptr), + _pCurrent(nullptr), + _pEnd(nullptr), _keepAlive(false), _connectionTimeout(HTTP_DEFAULT_CONNECTION_TIMEOUT), _receiveTimeout(HTTP_DEFAULT_TIMEOUT), _sendTimeout(HTTP_DEFAULT_TIMEOUT), - _pException(0) + _pException(nullptr) { } HTTPSession::HTTPSession(const StreamSocket& socket): _socket(socket), - _pBuffer(0), - _pCurrent(0), - _pEnd(0), + _pBuffer(nullptr), + _pCurrent(nullptr), + _pEnd(nullptr), _keepAlive(false), _connectionTimeout(HTTP_DEFAULT_CONNECTION_TIMEOUT), _receiveTimeout(HTTP_DEFAULT_TIMEOUT), _sendTimeout(HTTP_DEFAULT_TIMEOUT), - _pException(0) + _pException(nullptr) { } HTTPSession::HTTPSession(const StreamSocket& socket, bool keepAlive): _socket(socket), - _pBuffer(0), - _pCurrent(0), - _pEnd(0), + _pBuffer(nullptr), + _pCurrent(nullptr), + _pEnd(nullptr), _keepAlive(keepAlive), _connectionTimeout(HTTP_DEFAULT_CONNECTION_TIMEOUT), _receiveTimeout(HTTP_DEFAULT_TIMEOUT), _sendTimeout(HTTP_DEFAULT_TIMEOUT), - _pException(0) + _pException(nullptr) { } @@ -234,7 +234,7 @@ void HTTPSession::setException(const Poco::Exception& exc) void HTTPSession::clearException() { delete _pException; - _pException = 0; + _pException = nullptr; } diff --git a/Net/src/HTTPStreamFactory.cpp b/Net/src/HTTPStreamFactory.cpp index 438d4e914..5c2fd64a1 100644 --- a/Net/src/HTTPStreamFactory.cpp +++ b/Net/src/HTTPStreamFactory.cpp @@ -72,7 +72,7 @@ std::istream* HTTPStreamFactory::open(const URI& uri) URI resolvedURI(uri); URI proxyUri; - HTTPClientSession* pSession = 0; + HTTPClientSession* pSession = nullptr; HTTPResponse res; bool retry = false; bool authorize = false; @@ -150,7 +150,7 @@ std::istream* HTTPStreamFactory::open(const URI& uri) // only use for one single request! proxyUri.resolve(res.get("Location"s)); delete pSession; - pSession = 0; + pSession = nullptr; retry = true; // only allow useproxy once } else if (res.getStatus() == HTTPResponse::HTTP_UNAUTHORIZED && !authorize) diff --git a/Net/src/ICMPPacket.cpp b/Net/src/ICMPPacket.cpp index 7645fa9bb..22be7324b 100644 --- a/Net/src/ICMPPacket.cpp +++ b/Net/src/ICMPPacket.cpp @@ -35,7 +35,7 @@ namespace Poco { namespace Net { -ICMPPacket::ICMPPacket(IPAddress::Family family, int dataSize):_pImpl(0) +ICMPPacket::ICMPPacket(IPAddress::Family family, int dataSize):_pImpl(nullptr) { if (family == IPAddress::IPv4) _pImpl = new ICMPv4PacketImpl(dataSize); diff --git a/Net/src/ICMPSocket.cpp b/Net/src/ICMPSocket.cpp index ac06c7ee2..8e7e76b78 100644 --- a/Net/src/ICMPSocket.cpp +++ b/Net/src/ICMPSocket.cpp @@ -64,13 +64,13 @@ ICMPSocket& ICMPSocket::operator = (const Socket& socket) int ICMPSocket::sendTo(const SocketAddress& address, int flags) { - return impl()->sendTo(0, 0, address, flags); + return impl()->sendTo(nullptr, 0, address, flags); } int ICMPSocket::receiveFrom(SocketAddress& address, int flags) { - return impl()->receiveFrom(0, 0, address, flags); + return impl()->receiveFrom(nullptr, 0, address, flags); } diff --git a/Net/src/ICMPv4PacketImpl.cpp b/Net/src/ICMPv4PacketImpl.cpp index 17ef41d6b..d3f19eca1 100644 --- a/Net/src/ICMPv4PacketImpl.cpp +++ b/Net/src/ICMPv4PacketImpl.cpp @@ -148,7 +148,7 @@ struct timeval ICMPv4PacketImpl::time(Poco::UInt8* buffer, int length) const { struct timeval tv; - if (0 == buffer || 0 == length) + if (nullptr == buffer || 0 == length) { Timespan value(Timestamp().epochMicroseconds()); tv.tv_sec = (long) value.totalSeconds(); @@ -169,7 +169,7 @@ ICMPv4PacketImpl::Header* ICMPv4PacketImpl::header(Poco::UInt8* buffer, int leng poco_check_ptr (buffer); int offset = (buffer[0] & 0x0F) * 4; - if ((offset + sizeof(Header)) > length) return 0; + if ((offset + sizeof(Header)) > length) return nullptr; buffer += offset; return reinterpret_cast(buffer); diff --git a/Net/src/IPAddress.cpp b/Net/src/IPAddress.cpp index 32b3185d8..dfc0c8456 100644 --- a/Net/src/IPAddress.cpp +++ b/Net/src/IPAddress.cpp @@ -144,7 +144,7 @@ IPAddress::IPAddress(const std::string& addr, Family family) IPAddress::IPAddress(const void* addr, poco_socklen_t length) - : _pImpl(0) + : _pImpl(nullptr) { if (length == sizeof(struct in_addr)) newIPv4(addr); @@ -192,7 +192,7 @@ IPAddress::IPAddress(unsigned prefix, Family family) #if defined(_WIN32) IPAddress::IPAddress(const SOCKET_ADDRESS& socket_address) - : _pImpl(0) + : _pImpl(nullptr) { ADDRESS_FAMILY family = socket_address.lpSockaddr->sa_family; if (family == AF_INET) @@ -363,20 +363,20 @@ bool IPAddress::operator == (const IPAddress& a) const poco_socklen_t l1 = length(); poco_socklen_t l2 = a.length(); if (l1 == l2) - { + { #if defined(POCO_HAVE_IPv6) - if ( scope() != a.scope() ) - return false; + if ( scope() != a.scope() ) + return false; #endif return std::memcmp(addr(), a.addr(), l1) == 0; - } + } else return false; } bool IPAddress::operator != (const IPAddress& a) const { - return !(*this == a); + return !(*this == a); } @@ -385,32 +385,32 @@ bool IPAddress::operator < (const IPAddress& a) const poco_socklen_t l1 = length(); poco_socklen_t l2 = a.length(); if (l1 == l2) - { + { #if defined(POCO_HAVE_IPv6) - if ( scope() != a.scope() ) - return scope() < a.scope(); + if ( scope() != a.scope() ) + return scope() < a.scope(); #endif return std::memcmp(addr(), a.addr(), l1) < 0; - } + } else return l1 < l2; } bool IPAddress::operator <= (const IPAddress& a) const { - return !(a < *this); + return !(a < *this); } bool IPAddress::operator > (const IPAddress& a) const { - return a < *this; + return a < *this; } bool IPAddress::operator >= (const IPAddress& a) const { - return !(*this < a); + return !(*this < a); } @@ -652,7 +652,7 @@ std::vector IPAddress::toBytes() const { std::size_t sz = 0; std::vector bytes; - const void* ptr = 0; + const void* ptr = nullptr; switch (family()) { case IPv4: diff --git a/Net/src/IPAddressImpl.cpp b/Net/src/IPAddressImpl.cpp index 693f6f43b..c2c9c2616 100644 --- a/Net/src/IPAddressImpl.cpp +++ b/Net/src/IPAddressImpl.cpp @@ -565,7 +565,7 @@ bool IPv6AddressImpl::isBroadcast() const bool IPv6AddressImpl::isLoopback() const { if (isIPv4Mapped()) - return (ByteOrder::fromNetwork(_addr.s6_addr[6]) & 0xFF000000) == 0x7F000000; + return (ByteOrder::fromNetwork(_addr.s6_addr[6]) & 0xFF000000) == 0x7F000000; const UInt16* words = reinterpret_cast(&_addr); return words[0] == 0 && words[1] == 0 && words[2] == 0 && words[3] == 0 && @@ -661,7 +661,7 @@ IPv6AddressImpl IPv6AddressImpl::parse(const std::string& addr) // for the reason why this is not AF_INET6, see // https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/getaddrinfo-fails-error-11001-call-af-inet6-family hints.ai_family = AF_UNSPEC; - int rc = getaddrinfo(addr.c_str(), NULL, &hints, &pAI); + int rc = getaddrinfo(addr.c_str(), nullptr, &hints, &pAI); if (rc == 0) { IPv6AddressImpl result = IPv6AddressImpl( diff --git a/Net/src/MailMessage.cpp b/Net/src/MailMessage.cpp index c8bb0f7aa..a53fc6513 100644 --- a/Net/src/MailMessage.cpp +++ b/Net/src/MailMessage.cpp @@ -499,36 +499,36 @@ void MailMessage::readMultipart(std::istream& istr, PartHandler& handler) void MailMessage::readPart(std::istream& istr, const MessageHeader& header, PartHandler& handler) { - std::string encoding; - if (header.has(HEADER_CONTENT_TRANSFER_ENCODING)) - { - encoding = header.get(HEADER_CONTENT_TRANSFER_ENCODING); - // get rid of a parameter if one is set - std::string::size_type pos = encoding.find(';'); - if (pos != std::string::npos) - encoding.resize(pos); - } - if (icompare(encoding, CTE_QUOTED_PRINTABLE) == 0) - { - QuotedPrintableDecoder decoder(istr); - handlePart(decoder, header, handler); - _encoding = ENCODING_QUOTED_PRINTABLE; - } - else if (icompare(encoding, CTE_BASE64) == 0) - { - Base64Decoder decoder(istr); - handlePart(decoder, header, handler); - _encoding = ENCODING_BASE64; - } - else - { - if (icompare(encoding, CTE_7BIT) == 0) - _encoding = ENCODING_7BIT; - else if (icompare(encoding, CTE_8BIT) == 0) - _encoding = ENCODING_8BIT; + std::string encoding; + if (header.has(HEADER_CONTENT_TRANSFER_ENCODING)) + { + encoding = header.get(HEADER_CONTENT_TRANSFER_ENCODING); + // get rid of a parameter if one is set + std::string::size_type pos = encoding.find(';'); + if (pos != std::string::npos) + encoding.resize(pos); + } + if (icompare(encoding, CTE_QUOTED_PRINTABLE) == 0) + { + QuotedPrintableDecoder decoder(istr); + handlePart(decoder, header, handler); + _encoding = ENCODING_QUOTED_PRINTABLE; + } + else if (icompare(encoding, CTE_BASE64) == 0) + { + Base64Decoder decoder(istr); + handlePart(decoder, header, handler); + _encoding = ENCODING_BASE64; + } + else + { + if (icompare(encoding, CTE_7BIT) == 0) + _encoding = ENCODING_7BIT; + else if (icompare(encoding, CTE_8BIT) == 0) + _encoding = ENCODING_8BIT; - handlePart(istr, header, handler); - } + handlePart(istr, header, handler); + } } diff --git a/Net/src/MailStream.cpp b/Net/src/MailStream.cpp index 6fff64650..89a43080b 100644 --- a/Net/src/MailStream.cpp +++ b/Net/src/MailStream.cpp @@ -21,14 +21,14 @@ namespace Net { MailStreamBuf::MailStreamBuf(std::istream& istr): _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _state(ST_CR_LF) { } MailStreamBuf::MailStreamBuf(std::ostream& ostr): - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _state(ST_CR_LF) { diff --git a/Net/src/MessageHeader.cpp b/Net/src/MessageHeader.cpp index 418e32587..dff171ebf 100644 --- a/Net/src/MessageHeader.cpp +++ b/Net/src/MessageHeader.cpp @@ -373,7 +373,7 @@ void MessageHeader::decodeRFC2047(const std::string& ins, std::string& outs, con hex += c; } hex = toUpper(hex); - tempout += (char)(int)strtol(hex.c_str(), 0, 16); + tempout += (char)(int)::strtol(hex.c_str(), nullptr, 16); continue; } tempout += c; diff --git a/Net/src/NetworkInterface.cpp b/Net/src/NetworkInterface.cpp index bb8940b22..e90dbaadc 100644 --- a/Net/src/NetworkInterface.cpp +++ b/Net/src/NetworkInterface.cpp @@ -50,7 +50,7 @@ using Poco::format; std::ostream& operator << (std::ostream& os, const Poco::Net::NetworkInterface::MACAddress& mac) { - std::ios state(0); + std::ios state(nullptr); state.copyfmt(os); for (unsigned i = 0; i < mac.size(); ++i) { @@ -78,8 +78,8 @@ public: using Type = NetworkInterface::Type; NetworkInterfaceImpl(unsigned index); - NetworkInterfaceImpl(const std::string& name, const std::string& displayName, const std::string& adapterName, const IPAddress& address, unsigned index, NetworkInterface::MACAddress* pMACAddress = 0); - NetworkInterfaceImpl(const std::string& name, const std::string& displayName, const std::string& adapterName, unsigned index = 0, NetworkInterface::MACAddress* pMACAddress = 0); + NetworkInterfaceImpl(const std::string& name, const std::string& displayName, const std::string& adapterName, const IPAddress& address, unsigned index, NetworkInterface::MACAddress* pMACAddress = nullptr); + NetworkInterfaceImpl(const std::string& name, const std::string& displayName, const std::string& adapterName, unsigned index = 0, NetworkInterface::MACAddress* pMACAddress = nullptr); NetworkInterfaceImpl(const std::string& name, const std::string& displayName, const std::string& adapterName, @@ -87,7 +87,7 @@ public: const IPAddress& subnetMask, const IPAddress& broadcastAddress, unsigned index, - NetworkInterface::MACAddress* pMACAddress = 0); + NetworkInterface::MACAddress* pMACAddress = nullptr); unsigned index() const; const std::string& name() const; @@ -948,7 +948,7 @@ namespace Net { namespace { -IPAddress getBroadcastAddress(PIP_ADAPTER_PREFIX pPrefix, const IPAddress& addr, ULONG* pprefix = 0) +IPAddress getBroadcastAddress(PIP_ADAPTER_PREFIX pPrefix, const IPAddress& addr, ULONG* pprefix = nullptr) /// This function relies on (1) subnet prefix being at the position /// immediately preceding and (2) broadcast address being at the position /// immediately succeeding the IPv4 unicast address. @@ -959,7 +959,7 @@ IPAddress getBroadcastAddress(PIP_ADAPTER_PREFIX pPrefix, const IPAddress& addr, /// not contain prefix length; for those platforms, this function /// returns prefix through pprefix argument. { - PIP_ADAPTER_PREFIX pPrev = 0; + PIP_ADAPTER_PREFIX pPrev = nullptr; for (int i = 0; pPrefix; pPrefix = pPrefix->Next, ++i) { ADDRESS_FAMILY family = pPrefix->Address.lpSockaddr->sa_family; @@ -1019,9 +1019,9 @@ IPAddress subnetMaskForInterface(const std::string& name, bool isLoopback) return IPAddress(); wchar_t unetmask[16]; DWORD size = sizeof(unetmask); - if (RegQueryValueExW(hKey, L"DhcpSubnetMask", NULL, NULL, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) + if (RegQueryValueExW(hKey, L"DhcpSubnetMask", nullptr, nullptr, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) { - if (RegQueryValueExW(hKey, L"SubnetMask", NULL, NULL, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) + if (RegQueryValueExW(hKey, L"SubnetMask", nullptr, nullptr, (LPBYTE)&unetmask, &size) != ERROR_SUCCESS) { RegCloseKey(hKey); return IPAddress(); @@ -1059,12 +1059,12 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) #endif DWORD dwRetVal = 0; ULONG iterations = 0; - PIP_ADAPTER_ADDRESSES pAddress = 0; + PIP_ADAPTER_ADDRESSES pAddress = nullptr; do { pAddress = reinterpret_cast(memory.begin()); // leave in the loop, begin may change after resize poco_assert (memory.capacity() >= outBufLen); - if (ERROR_BUFFER_OVERFLOW == (dwRetVal = GetAdaptersAddresses(family, flags, 0, pAddress, &outBufLen))) + if (ERROR_BUFFER_OVERFLOW == (dwRetVal = GetAdaptersAddresses(family, flags, nullptr, pAddress, &outBufLen))) memory.resize(outBufLen, false); // adjust size and try again else if (ERROR_NO_DATA == dwRetVal) // no network interfaces found return result; @@ -1140,7 +1140,7 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) Poco::UnicodeConverter::toUTF8(pAddress->Description, displayName); bool isUp = (pAddress->OperStatus == IfOperStatusUp); - bool isIP = (0 != pAddress->FirstUnicastAddress); + bool isIP = (nullptr != pAddress->FirstUnicastAddress); if (((ipOnly && isIP) || !ipOnly) && ((upOnly && isUp) || !upOnly)) { NetworkInterface ni(name, displayName, adapterName, ifIndex); @@ -1369,13 +1369,13 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) NetworkInterface intf; Map::iterator ifIt; - struct ifaddrs* ifaces = 0; - struct ifaddrs* currIface = 0; + struct ifaddrs* ifaces = nullptr; + struct ifaddrs* currIface = nullptr; if (getifaddrs(&ifaces) < 0) throw NetException("cannot get network adapter list"); - for (currIface = ifaces; currIface != 0; currIface = currIface->ifa_next) + for (currIface = ifaces; currIface != nullptr; currIface = currIface->ifa_next) { try { @@ -1587,8 +1587,8 @@ NetworkInterface::Map NetworkInterface::map(bool ipOnly, bool upOnly) NetworkInterface intf; Map::iterator ifIt; - struct ifaddrs* ifaces = 0; - struct ifaddrs* iface = 0; + struct ifaddrs* ifaces = nullptr; + struct ifaddrs* iface = nullptr; if (getifaddrs(&ifaces) < 0) throw NetException("cannot get network adapter list"); diff --git a/Net/src/PollSet.cpp b/Net/src/PollSet.cpp index 3c7715e4e..d5244af07 100644 --- a/Net/src/PollSet.cpp +++ b/Net/src/PollSet.cpp @@ -115,7 +115,7 @@ public: poco_socket_t fd = socket.impl()->sockfd(); struct epoll_event ev; ev.events = 0; - ev.data.ptr = 0; + ev.data.ptr = nullptr; int err = epoll_ctl(_epollfd, EPOLL_CTL_DEL, fd, &ev); if (err) SocketImpl::error(); @@ -282,7 +282,7 @@ private: return ret; } - int addFD(int fd, int mode, int op, void* ptr = 0) + int addFD(int fd, int mode, int op, void* ptr = nullptr) { struct epoll_event ev{}; ev.events = 0; @@ -335,7 +335,7 @@ private: }; -const epoll_event PollSetImpl::EPOLL_NULL_EVENT = {0, {0}}; +const epoll_event PollSetImpl::EPOLL_NULL_EVENT = {0, {nullptr}}; #elif defined(POCO_HAVE_FD_POLL) diff --git a/Net/src/RemoteSyslogListener.cpp b/Net/src/RemoteSyslogListener.cpp index 65ba45ca7..b0122cb4f 100644 --- a/Net/src/RemoteSyslogListener.cpp +++ b/Net/src/RemoteSyslogListener.cpp @@ -510,8 +510,8 @@ const std::string RemoteSyslogListener::LOG_PROP_STRUCTURED_DATA("structured-dat RemoteSyslogListener::RemoteSyslogListener(): - _pListener(0), - _pParser(0), + _pListener(nullptr), + _pParser(nullptr), _port(RemoteSyslogChannel::SYSLOG_PORT), _reusePort(false), _threads(1), @@ -521,8 +521,8 @@ RemoteSyslogListener::RemoteSyslogListener(): RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port): - _pListener(0), - _pParser(0), + _pListener(nullptr), + _pParser(nullptr), _port(port), _reusePort(false), _threads(1), @@ -532,8 +532,8 @@ RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port): RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port, int threads): - _pListener(0), - _pParser(0), + _pListener(nullptr), + _pParser(nullptr), _port(port), _reusePort(false), _threads(threads), @@ -543,8 +543,8 @@ RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port, int threads): RemoteSyslogListener::RemoteSyslogListener(Poco::UInt16 port, bool reusePort, int threads): - _pListener(0), - _pParser(0), + _pListener(nullptr), + _pParser(nullptr), _port(port), _reusePort(reusePort), _threads(threads), @@ -653,8 +653,8 @@ void RemoteSyslogListener::close() _threadPool.joinAll(); delete _pListener; delete _pParser; - _pListener = 0; - _pParser = 0; + _pListener = nullptr; + _pParser = nullptr; SplitterChannel::close(); } diff --git a/Net/src/SMTPClientSession.cpp b/Net/src/SMTPClientSession.cpp index 4e6cdbc94..9bf6baca4 100644 --- a/Net/src/SMTPClientSession.cpp +++ b/Net/src/SMTPClientSession.cpp @@ -154,7 +154,7 @@ void SMTPClientSession::loginUsingCRAM(const std::string& username, const std::s encoder.close(); status = sendCommand(challengeResponseBase64.str(), response); - if (!isPositiveCompletion(status)) throw SMTPException(std::string("Login using ") + method + " failed", response, status); + if (!isPositiveCompletion(status)) throw SMTPException(std::string("Login using ") + method + " failed", response, status); } diff --git a/Net/src/SSPINTLMCredentials.cpp b/Net/src/SSPINTLMCredentials.cpp index ebb57fecc..923a0cfb8 100644 --- a/Net/src/SSPINTLMCredentials.cpp +++ b/Net/src/SSPINTLMCredentials.cpp @@ -52,7 +52,7 @@ class SSPINTLMProvider public: SSPINTLMProvider(): _securityLib("security.dll"), - _pSecFunTable(0) + _pSecFunTable(nullptr) { InitSecurityInterfaceW pInitSecurityInterface = reinterpret_cast(_securityLib.getSymbol("InitSecurityInterfaceW")); if (pInitSecurityInterface) @@ -94,13 +94,13 @@ public: TimeStamp expiry; status = _pSecFunTable->AcquireCredentialsHandleW( - NULL, + nullptr, package, SECPKG_CRED_OUTBOUND, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, &pContext->_pImpl->credentials, &expiry); @@ -132,12 +132,12 @@ public: TimeStamp expiry; SECURITY_STATUS status = _pSecFunTable->InitializeSecurityContextW( &context._pImpl->credentials, - NULL, + nullptr, const_cast(context._pImpl->spn.c_str()), 0, 0, SECURITY_NETWORK_DREP, - NULL, + nullptr, 0, &context._pImpl->context, &msgBufferDesc, diff --git a/Net/src/SocketAddress.cpp b/Net/src/SocketAddress.cpp index e5e2dd5fb..3b26c90a9 100644 --- a/Net/src/SocketAddress.cpp +++ b/Net/src/SocketAddress.cpp @@ -423,7 +423,7 @@ Poco::UInt16 SocketAddress::resolveService(const std::string& service) #if defined(POCO_VXWORKS) throw ServiceNotFoundException(service); #else - struct servent* se = getservbyname(service.c_str(), NULL); + struct servent* se = getservbyname(service.c_str(), nullptr); if (se) return ntohs(se->s_port); else diff --git a/Net/src/SocketImpl.cpp b/Net/src/SocketImpl.cpp index c72b4c37a..047163615 100644 --- a/Net/src/SocketImpl.cpp +++ b/Net/src/SocketImpl.cpp @@ -401,7 +401,7 @@ int SocketImpl::sendBytes(const SocketBufVec& buffers, int flags) DWORD sent = 0; rc = WSASend(_sockfd, const_cast(&buffers[0]), static_cast(buffers.size()), &sent, - static_cast(flags), 0, 0); + static_cast(flags), nullptr, nullptr); if (rc == SOCKET_ERROR) error(); rc = sent; #elif defined(POCO_OS_FAMILY_UNIX) @@ -464,7 +464,7 @@ int SocketImpl::receiveBytes(SocketBufVec& buffers, int flags) DWORD recvd = 0; DWORD dwFlags = static_cast(flags); rc = WSARecv(_sockfd, &buffers[0], static_cast(buffers.size()), - &recvd, &dwFlags, 0, 0); + &recvd, &dwFlags, nullptr, nullptr); if (rc == SOCKET_ERROR) error(); rc = recvd; #elif defined(POCO_OS_FAMILY_UNIX) @@ -554,7 +554,7 @@ int SocketImpl::sendTo(const SocketBufVec& buffers, const SocketAddress& address rc = WSASendTo(_sockfd, const_cast(&buffers[0]), static_cast(buffers.size()), &sent, static_cast(flags), - address.addr(), address.length(), 0, 0); + address.addr(), address.length(), nullptr, nullptr); if (rc == SOCKET_ERROR) error(); rc = sent; #elif defined(POCO_OS_FAMILY_UNIX) @@ -655,7 +655,7 @@ int SocketImpl::receiveFrom(SocketBufVec& buffers, struct sockaddr** pSA, poco_s DWORD recvd = 0; DWORD dwFlags = static_cast(flags); rc = WSARecvFrom(_sockfd, &buffers[0], static_cast(buffers.size()), - &recvd, &dwFlags, *pSA, *ppSALen, 0, 0); + &recvd, &dwFlags, *pSA, *ppSALen, nullptr, nullptr); if (rc == SOCKET_ERROR) error(); rc = recvd; #elif defined(POCO_OS_FAMILY_UNIX) @@ -1458,7 +1458,7 @@ std::streamsize SocketImpl::sendFileNative(FileInputStream& fileInputStream, std memset(&overlapped, 0, sizeof(overlapped)); overlapped.Offset = offsetHelper.LowPart; overlapped.OffsetHigh = offsetHelper.HighPart; - overlapped.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + overlapped.hEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr); if (overlapped.hEvent == nullptr) { int err = GetLastError(); @@ -1497,7 +1497,7 @@ namespace sent = sendfile(sd, fd, &noffset, count); #elif POCO_OS == POCO_OS_MAC_OS_X off_t len = count; - int result = sendfile(fd, sd, offset, &len, NULL, 0); + int result = sendfile(fd, sd, offset, &len, nullptr, 0); if (result < 0) { sent = -1; @@ -1508,7 +1508,7 @@ namespace } #elif POCO_OS == POCO_OS_FREE_BSD off_t sbytes; - int result = sendfile(fd, sd, offset, count, NULL, &sbytes, 0); + int result = sendfile(fd, sd, offset, count, nullptr, &sbytes, 0); if (result < 0) { sent = -1; diff --git a/Net/src/UDPClient.cpp b/Net/src/UDPClient.cpp index 701e06c12..893379273 100644 --- a/Net/src/UDPClient.cpp +++ b/Net/src/UDPClient.cpp @@ -22,7 +22,7 @@ namespace Net { UDPClient::UDPClient(const std::string& address, Poco::UInt16 port, bool listen): _address(address, port), - _pThread(0), + _pThread(nullptr), _stop(false) { _socket.bind(SocketAddress(address, 0), true, true); diff --git a/Net/testsuite/src/FTPStreamFactoryTest.cpp b/Net/testsuite/src/FTPStreamFactoryTest.cpp index 0f3b7b129..9e25488c7 100644 --- a/Net/testsuite/src/FTPStreamFactoryTest.cpp +++ b/Net/testsuite/src/FTPStreamFactoryTest.cpp @@ -56,7 +56,7 @@ FTPStreamFactoryTest::~FTPStreamFactoryTest() void FTPStreamFactoryTest::testDownload() { - FTPStreamFactory::setPasswordProvider(0); + FTPStreamFactory::setPasswordProvider(nullptr); DialogServer server; server.addResponse("220 localhost FTP ready"); @@ -92,7 +92,7 @@ void FTPStreamFactoryTest::testDownload() void FTPStreamFactoryTest::testList() { - FTPStreamFactory::setPasswordProvider(0); + FTPStreamFactory::setPasswordProvider(nullptr); DialogServer server; server.addResponse("220 localhost FTP ready"); @@ -130,7 +130,7 @@ void FTPStreamFactoryTest::testList() void FTPStreamFactoryTest::testUserInfo() { - FTPStreamFactory::setPasswordProvider(0); + FTPStreamFactory::setPasswordProvider(nullptr); DialogServer server; server.addResponse("220 localhost FTP ready"); @@ -207,7 +207,7 @@ void FTPStreamFactoryTest::testPasswordProvider() void FTPStreamFactoryTest::testMissingPasswordProvider() { - FTPStreamFactory::setPasswordProvider(0); + FTPStreamFactory::setPasswordProvider(nullptr); DialogServer server; server.addResponse("220 localhost FTP ready"); diff --git a/Net/testsuite/src/HTTPResponseTest.cpp b/Net/testsuite/src/HTTPResponseTest.cpp index f28ec40e2..b1a54f555 100644 --- a/Net/testsuite/src/HTTPResponseTest.cpp +++ b/Net/testsuite/src/HTTPResponseTest.cpp @@ -197,7 +197,7 @@ void HTTPResponseTest::testCookies() response2.getCookies(cookies); assertTrue (cookies.size() == 2); assertTrue (((cookies[0].getName() == "name1") && (cookies[1].getName() == "name2")) - || ((cookies[0].getName() == "name2") && (cookies[1].getName() == "name1"))); + || ((cookies[0].getName() == "name2") && (cookies[1].getName() == "name1"))); } diff --git a/Net/testsuite/src/HTTPTestServer.cpp b/Net/testsuite/src/HTTPTestServer.cpp index 02f01a096..401f6a0d0 100644 --- a/Net/testsuite/src/HTTPTestServer.cpp +++ b/Net/testsuite/src/HTTPTestServer.cpp @@ -115,8 +115,8 @@ void HTTPTestServer::run() bool HTTPTestServer::requestComplete() const { return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") && - (_lastRequest.find("\r\n\r\n") != std::string::npos)) || - (_lastRequest.find("\r\n0\r\n") != std::string::npos); + (_lastRequest.find("\r\n\r\n") != std::string::npos)) || + (_lastRequest.find("\r\n0\r\n") != std::string::npos); } @@ -125,7 +125,7 @@ std::string HTTPTestServer::handleRequest() const std::string response; response.reserve(16000); if (_lastRequest.substr(0, 10) == "GET /small" || - _lastRequest.substr(0, 11) == "HEAD /small") + _lastRequest.substr(0, 11) == "HEAD /small") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -139,8 +139,8 @@ std::string HTTPTestServer::handleRequest() const response.append(body); } else if (_lastRequest.substr(0, 10) == "GET /large" || - _lastRequest.substr(0, 11) == "HEAD /large" || - _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") + _lastRequest.substr(0, 11) == "HEAD /large" || + _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") { std::string body(LARGE_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -261,7 +261,7 @@ std::string HTTPTestServer::handleRequest() const response.append("\r\n"); } else if (_lastRequest.substr(0, 5) == "GET /" || - _lastRequest.substr(0, 6) == "HEAD /") + _lastRequest.substr(0, 6) == "HEAD /") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); diff --git a/Net/testsuite/src/MailMessageTest.cpp b/Net/testsuite/src/MailMessageTest.cpp index e544f1f0c..61d749c85 100644 --- a/Net/testsuite/src/MailMessageTest.cpp +++ b/Net/testsuite/src/MailMessageTest.cpp @@ -540,8 +540,8 @@ void MailMessageTest::testReadMultiPartMixedCaseHeaders() ); MailMessage message; - MailInputStream mis(istr); - message.read(mis); + MailInputStream mis(istr); + message.read(mis); assertTrue (message.isMultipart()); assertTrue (message.parts().size() == 2); @@ -560,37 +560,37 @@ void MailMessageTest::testReadMultiPartMixedCaseHeaders() void MailMessageTest::testReadMultiPartInvalidContentDisposition() { - std::istringstream istr( - "Content-type: multipart/mixed; boundary=MIME_boundary_01234567\r\n" - "Date: Thu, 1 Jan 1970 00:00:00 GMT\r\n" - "From: poco@appinf.com\r\n" - "Mime-Version: 1.0\r\n" - "Subject: Test Message\r\n" - "To: John Doe \r\n" - "\r\n" - "\r\n" - "Hello World!\r\n" - "\r\n" - "--MIME_boundary_01234567\r\n" - "Content-Disposition: \r\n" - "Content-Transfer-Encoding: base64\r\n" - "Content-Type: application/octet-stream; name=sample\r\n" - "\r\n" - "VGhpcyBpcyBzb21lIGJpbmFyeSBkYXRhLiBSZWFsbHku\r\n" - "--MIME_boundary_01234567--\r\n" - ); + std::istringstream istr( + "Content-type: multipart/mixed; boundary=MIME_boundary_01234567\r\n" + "Date: Thu, 1 Jan 1970 00:00:00 GMT\r\n" + "From: poco@appinf.com\r\n" + "Mime-Version: 1.0\r\n" + "Subject: Test Message\r\n" + "To: John Doe \r\n" + "\r\n" + "\r\n" + "Hello World!\r\n" + "\r\n" + "--MIME_boundary_01234567\r\n" + "Content-Disposition: \r\n" + "Content-Transfer-Encoding: base64\r\n" + "Content-Type: application/octet-stream; name=sample\r\n" + "\r\n" + "VGhpcyBpcyBzb21lIGJpbmFyeSBkYXRhLiBSZWFsbHku\r\n" + "--MIME_boundary_01234567--\r\n" + ); - MailMessage message; - MailInputStream mis(istr); - message.read(mis); + MailMessage message; + MailInputStream mis(istr); + message.read(mis); - assertTrue (message.isMultipart()); - assertTrue (message.parts().size() == 1); - assertTrue (message.get(MailMessage::HEADER_CONTENT_TYPE) == "multipart/mixed; boundary=MIME_boundary_01234567"); + assertTrue (message.isMultipart()); + assertTrue (message.parts().size() == 1); + assertTrue (message.get(MailMessage::HEADER_CONTENT_TYPE) == "multipart/mixed; boundary=MIME_boundary_01234567"); - assertTrue (message.parts()[0].encoding == MailMessage::ContentTransferEncoding::ENCODING_BASE64); - assertTrue (message.parts()[0].disposition == MailMessage::ContentDisposition::CONTENT_INLINE); - assertTrue (message.parts()[0].pSource->headers().get(MailMessage::HEADER_CONTENT_TYPE) == "application/octet-stream; name=sample"); + assertTrue (message.parts()[0].encoding == MailMessage::ContentTransferEncoding::ENCODING_BASE64); + assertTrue (message.parts()[0].disposition == MailMessage::ContentDisposition::CONTENT_INLINE); + assertTrue (message.parts()[0].pSource->headers().get(MailMessage::HEADER_CONTENT_TYPE) == "application/octet-stream; name=sample"); } @@ -758,14 +758,14 @@ void MailMessageTest::testEncodeWord() assertTrue (encoded == "=?ISO-8859-1?q?This_text_contains_German_Umlauts=3A_=C4=D6?="); plain = "This text contains German Umlauts: \304\326. " - "It is also a very long text. Longer than 75 " - "characters. Long enough to become three lines " - "after being word-encoded."; + "It is also a very long text. Longer than 75 " + "characters. Long enough to become three lines " + "after being word-encoded."; encoded = MailMessage::encodeWord(plain, "ISO-8859-1"); assertTrue (encoded == "=?ISO-8859-1?q?This_text_contains_German_Umlauts=3A_=C4=D6=2E_It_?=\r\n" - " =?ISO-8859-1?q?is_also_a_very_long_text=2E_Longer_than_75_characters=2E_?=\r\n" - " =?ISO-8859-1?q?Long_enough_to_become_three_lines_after_being_word-encode?=\r\n" - " =?ISO-8859-1?q?d=2E?="); + " =?ISO-8859-1?q?is_also_a_very_long_text=2E_Longer_than_75_characters=2E_?=\r\n" + " =?ISO-8859-1?q?Long_enough_to_become_three_lines_after_being_word-encode?=\r\n" + " =?ISO-8859-1?q?d=2E?="); } diff --git a/Net/testsuite/src/PollSetTest.cpp b/Net/testsuite/src/PollSetTest.cpp index 5897b80f8..56f478f67 100644 --- a/Net/testsuite/src/PollSetTest.cpp +++ b/Net/testsuite/src/PollSetTest.cpp @@ -433,8 +433,8 @@ void PollSetTest::testPollClosedServer() assertTrue(ss2 == smm.begin()->first); // socket closed or error - assertTrue(0 >= ss1.receiveBytes(0, 0)); - assertTrue(0 >= ss2.receiveBytes(0, 0)); + assertTrue(0 >= ss1.receiveBytes(nullptr, 0)); + assertTrue(0 >= ss2.receiveBytes(nullptr, 0)); } diff --git a/Net/testsuite/src/QuotedPrintableTest.cpp b/Net/testsuite/src/QuotedPrintableTest.cpp index 135dc6e6d..2e58fbb7b 100644 --- a/Net/testsuite/src/QuotedPrintableTest.cpp +++ b/Net/testsuite/src/QuotedPrintableTest.cpp @@ -44,11 +44,11 @@ void QuotedPrintableTest::testEncode() encoder.close(); std::string txt = ostr.str(); assertTrue (txt == "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\r\n" - "Proin id odio sit amet metus dignissim porttitor.=20\r\n" - "Aliquam nulla ipsum, faucibus non, aliquet quis, aliquet id, felis. Proin s=\r\n" - "odales molestie arcu.\r\n" - "\t=08Sed suscipit, mi in facilisis feugiat, \t =20\r\n" - "=80=81\r\n"); + "Proin id odio sit amet metus dignissim porttitor.=20\r\n" + "Aliquam nulla ipsum, faucibus non, aliquet quis, aliquet id, felis. Proin s=\r\n" + "odales molestie arcu.\r\n" + "\t=08Sed suscipit, mi in facilisis feugiat, \t =20\r\n" + "=80=81\r\n"); } @@ -56,11 +56,11 @@ void QuotedPrintableTest::testDecode() { std::istringstream istr( "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\r\n" - "Proin id odio sit amet metus dignissim porttitor.=20\r\n" - "Aliquam nulla ipsum, faucibus non, aliquet quis, aliquet id, felis. Proin s=\r\n" - "odales molestie arcu.\r\n" - "\t=08Sed suscipit, mi in facilisis feugiat, \t =20\r\n" - "=80=81\r\n" + "Proin id odio sit amet metus dignissim porttitor.=20\r\n" + "Aliquam nulla ipsum, faucibus non, aliquet quis, aliquet id, felis. Proin s=\r\n" + "odales molestie arcu.\r\n" + "\t=08Sed suscipit, mi in facilisis feugiat, \t =20\r\n" + "=80=81\r\n" ); QuotedPrintableDecoder decoder(istr); std::string str; @@ -71,10 +71,10 @@ void QuotedPrintableTest::testDecode() c = decoder.get(); } assertTrue (str == "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.\r\n" - "Proin id odio sit amet metus dignissim porttitor. \r\n" - "Aliquam nulla ipsum, faucibus non, aliquet quis, aliquet id, felis. Proin sodales molestie arcu.\r\n" - "\t\bSed suscipit, mi in facilisis feugiat, \t \r\n" - "\200\201\r\n"); + "Proin id odio sit amet metus dignissim porttitor. \r\n" + "Aliquam nulla ipsum, faucibus non, aliquet quis, aliquet id, felis. Proin sodales molestie arcu.\r\n" + "\t\bSed suscipit, mi in facilisis feugiat, \t \r\n" + "\200\201\r\n"); } diff --git a/Net/testsuite/src/SocketAddressTest.cpp b/Net/testsuite/src/SocketAddressTest.cpp index c6e9a0c75..fbfcf332a 100644 --- a/Net/testsuite/src/SocketAddressTest.cpp +++ b/Net/testsuite/src/SocketAddressTest.cpp @@ -149,10 +149,10 @@ void SocketAddressTest::testSocketAddress() void SocketAddressTest::testSocketRelationals() { SocketAddress sa1("192.168.1.100", 100); - SocketAddress sa2("192.168.1.100:100"); + SocketAddress sa2("192.168.1.100:100"); assertTrue (sa1 == sa2); - SocketAddress sa3("192.168.1.101", "99"); + SocketAddress sa3("192.168.1.101", "99"); assertTrue (sa2 < sa3); SocketAddress sa4("192.168.1.101", "102"); diff --git a/Net/testsuite/src/SocketConnectorTest.cpp b/Net/testsuite/src/SocketConnectorTest.cpp index a9128ea8f..43239a70b 100644 --- a/Net/testsuite/src/SocketConnectorTest.cpp +++ b/Net/testsuite/src/SocketConnectorTest.cpp @@ -105,7 +105,7 @@ namespace { char buffer[32]; int n = _socket.receiveBytes(buffer, sizeof(buffer)); - if (n <= 0) onShutdown(0); + if (n <= 0) onShutdown(nullptr); } void onWritable(const AutoPtr& pNf) diff --git a/NetSSL_OpenSSL/samples/SetSourceIP/src/SetSourceIP.cpp b/NetSSL_OpenSSL/samples/SetSourceIP/src/SetSourceIP.cpp index 99af7a109..870f1ccc8 100644 --- a/NetSSL_OpenSSL/samples/SetSourceIP/src/SetSourceIP.cpp +++ b/NetSSL_OpenSSL/samples/SetSourceIP/src/SetSourceIP.cpp @@ -131,7 +131,7 @@ int main(int argc, char **argv) Poco::SharedPtr ptrCert = new Poco::Net::ConsoleCertificateHandler(false); // ask the user via console - Poco::Net::SSLManager::instance().initializeClient(NULL, ptrCert, context); + Poco::Net::SSLManager::instance().initializeClient(nullptr, ptrCert, context); session = new Poco::Net::HTTPSClientSession(uri.getHost(), uri.getPort()); } diff --git a/NetSSL_OpenSSL/src/CertificateHandlerFactoryMgr.cpp b/NetSSL_OpenSSL/src/CertificateHandlerFactoryMgr.cpp index 24461f1d5..a84ab9d19 100644 --- a/NetSSL_OpenSSL/src/CertificateHandlerFactoryMgr.cpp +++ b/NetSSL_OpenSSL/src/CertificateHandlerFactoryMgr.cpp @@ -56,7 +56,7 @@ const CertificateHandlerFactory* CertificateHandlerFactoryMgr::getFactory(const if (it != _factories.end()) return it->second; else - return 0; + return nullptr; } diff --git a/NetSSL_OpenSSL/src/Context.cpp b/NetSSL_OpenSSL/src/Context.cpp index 267785cb0..837952aef 100644 --- a/NetSSL_OpenSSL/src/Context.cpp +++ b/NetSSL_OpenSSL/src/Context.cpp @@ -54,7 +54,7 @@ Context::Params::Params(KeyDHGroup dhBits): Context::Context(Usage usage, const Params& params): _usage(usage), _mode(params.verificationMode), - _pSSLContext(0), + _pSSLContext(nullptr), _extendedCertificateVerification(true), _ocspStaplingResponseVerification(false) { @@ -73,7 +73,7 @@ Context::Context( const std::string& cipherList): _usage(usage), _mode(verificationMode), - _pSSLContext(0), + _pSSLContext(nullptr), _extendedCertificateVerification(true), _ocspStaplingResponseVerification(false) { @@ -98,7 +98,7 @@ Context::Context( const std::string& cipherList): _usage(usage), _mode(verificationMode), - _pSSLContext(0), + _pSSLContext(nullptr), _extendedCertificateVerification(true), _ocspStaplingResponseVerification(false) { @@ -142,9 +142,9 @@ void Context::init(const Params& params) { Poco::File aFile(params.caLocation); if (aFile.isDirectory()) - errCode = SSL_CTX_load_verify_locations(_pSSLContext, 0, Poco::Path::transcode(params.caLocation).c_str()); + errCode = SSL_CTX_load_verify_locations(_pSSLContext, nullptr, Poco::Path::transcode(params.caLocation).c_str()); else - errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(params.caLocation).c_str(), 0); + errCode = SSL_CTX_load_verify_locations(_pSSLContext, Poco::Path::transcode(params.caLocation).c_str(), nullptr); if (errCode != 1) { std::string msg = Utility::getLastError(); @@ -484,7 +484,7 @@ void Context::requireMinimumProtocol(Protocols protocol) if (!SSL_CTX_set_min_proto_version(_pSSLContext, version)) { unsigned long err = ERR_get_error(); - throw SSLException("Cannot set minimum supported version on SSL_CTX object", ERR_error_string(err, 0)); + throw SSLException("Cannot set minimum supported version on SSL_CTX object", ERR_error_string(err, nullptr)); } #else @@ -661,7 +661,7 @@ void Context::createSSLContext() if (!_pSSLContext) { unsigned long err = ERR_get_error(); - throw SSLException("Cannot create SSL_CTX object", ERR_error_string(err, 0)); + throw SSLException("Cannot create SSL_CTX object", ERR_error_string(err, nullptr)); } #if OPENSSL_VERSION_NUMBER >= 0x10100000L @@ -670,9 +670,9 @@ void Context::createSSLContext() if (!SSL_CTX_set_min_proto_version(_pSSLContext, minTLSVersion)) { SSL_CTX_free(_pSSLContext); - _pSSLContext = 0; + _pSSLContext = nullptr; unsigned long err = ERR_get_error(); - throw SSLException("Cannot set minimum supported version on SSL_CTX object", ERR_error_string(err, 0)); + throw SSLException("Cannot set minimum supported version on SSL_CTX object", ERR_error_string(err, nullptr)); } } #endif @@ -770,15 +770,15 @@ void Context::initDH(KeyDHGroup keyDHGroup, const std::string& dhParamsFile) #if OPENSSL_VERSION_NUMBER >= 0x30000000L - EVP_PKEY_CTX* pKeyCtx = NULL; - OSSL_DECODER_CTX* pOSSLDecodeCtx = NULL; - EVP_PKEY* pKey = NULL; + EVP_PKEY_CTX* pKeyCtx = nullptr; + OSSL_DECODER_CTX* pOSSLDecodeCtx = nullptr; + EVP_PKEY* pKey = nullptr; bool freeEVPPKey = true; if (!dhParamsFile.empty()) { freeEVPPKey = false; - pOSSLDecodeCtx = OSSL_DECODER_CTX_new_for_pkey(&pKey, NULL, NULL, "DH", - OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, NULL, NULL); + pOSSLDecodeCtx = OSSL_DECODER_CTX_new_for_pkey(&pKey, nullptr, nullptr, "DH", + OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS, nullptr, nullptr); if (!pOSSLDecodeCtx) { @@ -824,7 +824,7 @@ void Context::initDH(KeyDHGroup keyDHGroup, const std::string& dhParamsFile) } else { - pKeyCtx = EVP_PKEY_CTX_new_from_name(NULL, "DH", NULL); + pKeyCtx = EVP_PKEY_CTX_new_from_name(nullptr, "DH", nullptr); if (!pKeyCtx) { std::string err = "Context::initDH():EVP_PKEY_CTX_new_from_name()\n"; @@ -1006,22 +1006,22 @@ void Context::initECDH(const std::string& curve) { #ifndef OPENSSL_NO_ECDH #if OPENSSL_VERSION_NUMBER >= 0x1000200fL - const std::string groups(curve.empty() ? + const std::string groups(curve.empty() ? #if OPENSSL_VERSION_NUMBER >= 0x1010100fL - "X448:X25519:P-521:P-384:P-256" + "X448:X25519:P-521:P-384:P-256" #elif OPENSSL_VERSION_NUMBER >= 0x1010000fL - // while OpenSSL 1.1.0 didn't support Ed25519 (EdDSA using Curve25519), - // it did support X25519 (ECDH using Curve25516). - "X25519:P-521:P-384:P-256" + // while OpenSSL 1.1.0 didn't support Ed25519 (EdDSA using Curve25519), + // it did support X25519 (ECDH using Curve25516). + "X25519:P-521:P-384:P-256" #else - "P-521:P-384:P-256" + "P-521:P-384:P-256" #endif - : curve); - if (SSL_CTX_set1_curves_list(_pSSLContext, groups.c_str()) == 0) - { - throw SSLContextException("Cannot set ECDH groups", groups); - } - SSL_CTX_set_options(_pSSLContext, SSL_OP_SINGLE_ECDH_USE); + : curve); + if (SSL_CTX_set1_curves_list(_pSSLContext, groups.c_str()) == 0) + { + throw SSLContextException("Cannot set ECDH groups", groups); + } + SSL_CTX_set_options(_pSSLContext, SSL_OP_SINGLE_ECDH_USE); #else int nid = 0; if (!curve.empty()) diff --git a/NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp b/NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp index 21dc4e3ea..92b930523 100644 --- a/NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp +++ b/NetSSL_OpenSSL/src/HTTPSStreamFactory.cpp @@ -71,7 +71,7 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) URI resolvedURI(uri); URI proxyUri; - HTTPClientSession* pSession = 0; + HTTPClientSession* pSession = nullptr; HTTPResponse res; try { @@ -127,8 +127,8 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) pSession->sendRequest(req); std::istream& rs = pSession->receiveResponse(res); bool moved = (res.getStatus() == HTTPResponse::HTTP_MOVED_PERMANENTLY || - res.getStatus() == HTTPResponse::HTTP_FOUND || - res.getStatus() == HTTPResponse::HTTP_SEE_OTHER || + res.getStatus() == HTTPResponse::HTTP_FOUND || + res.getStatus() == HTTPResponse::HTTP_SEE_OTHER || res.getStatus() == HTTPResponse::HTTP_TEMPORARY_REDIRECT); if (moved) { @@ -139,7 +139,7 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) authorize = false; } delete pSession; - pSession = 0; + pSession = nullptr; ++redirects; retry = true; } @@ -156,7 +156,7 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) // only use for one single request! proxyUri.resolve(res.get("Location")); delete pSession; - pSession = 0; + pSession = nullptr; retry = true; // only allow useproxy once } else if (res.getStatus() == HTTPResponse::HTTP_UNAUTHORIZED && !authorize) diff --git a/NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp b/NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp index cc49ecbab..abd6530c3 100644 --- a/NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp +++ b/NetSSL_OpenSSL/src/PrivateKeyFactoryMgr.cpp @@ -54,7 +54,7 @@ const PrivateKeyFactory* PrivateKeyFactoryMgr::getFactory(const std::string& nam if (it != _factories.end()) return it->second; else - return 0; + return nullptr; } diff --git a/NetSSL_OpenSSL/src/SSLManager.cpp b/NetSSL_OpenSSL/src/SSLManager.cpp index a7c900948..8e086eabf 100644 --- a/NetSSL_OpenSSL/src/SSLManager.cpp +++ b/NetSSL_OpenSSL/src/SSLManager.cpp @@ -567,7 +567,7 @@ void SSLManager::initPassphraseHandler(bool server) std::string className(config.getString(prefix + CFG_DELEGATE_HANDLER, VAL_DELEGATE_HANDLER)); - const PrivateKeyFactory* pFactory = 0; + const PrivateKeyFactory* pFactory = nullptr; if (privateKeyFactoryMgr().hasFactory(className)) { pFactory = privateKeyFactoryMgr().getFactory(className); @@ -594,7 +594,7 @@ void SSLManager::initCertificateHandler(bool server) std::string className(config.getString(prefix+CFG_CERTIFICATE_HANDLER, VAL_CERTIFICATE_HANDLER)); - const CertificateHandlerFactory* pFactory = 0; + const CertificateHandlerFactory* pFactory = nullptr; if (certificateHandlerFactoryMgr().hasFactory(className)) { pFactory = certificateHandlerFactoryMgr().getFactory(className); diff --git a/NetSSL_OpenSSL/src/SecureSocketImpl.cpp b/NetSSL_OpenSSL/src/SecureSocketImpl.cpp index e105f5cad..81576349b 100644 --- a/NetSSL_OpenSSL/src/SecureSocketImpl.cpp +++ b/NetSSL_OpenSSL/src/SecureSocketImpl.cpp @@ -603,7 +603,7 @@ int SecureSocketImpl::handleError(int rc) throw SSLException(msg); } } - break; + break; } return rc; } diff --git a/NetSSL_OpenSSL/src/X509Certificate.cpp b/NetSSL_OpenSSL/src/X509Certificate.cpp index 0d9458a74..16b94efbf 100644 --- a/NetSSL_OpenSSL/src/X509Certificate.cpp +++ b/NetSSL_OpenSSL/src/X509Certificate.cpp @@ -160,7 +160,7 @@ bool X509Certificate::verify(const Poco::Crypto::X509Certificate& certificate, c } return ok; #else - if (X509_check_host(const_cast(certificate.certificate()), hostName.c_str(), hostName.length(), 0, NULL) == 1) + if (X509_check_host(const_cast(certificate.certificate()), hostName.c_str(), hostName.length(), 0, nullptr) == 1) { return true; } @@ -169,7 +169,7 @@ bool X509Certificate::verify(const Poco::Crypto::X509Certificate& certificate, c IPAddress ip; if (IPAddress::tryParse(hostName, ip)) { - return (X509_check_ip_asc(const_cast(certificate.certificate()), hostName.c_str(), 0) == 1); + return (X509_check_ip_asc(const_cast(certificate.certificate()), hostName.c_str(), 0) == 1); } } return false; diff --git a/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp b/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp index d0f8a1054..aeeb4dc83 100644 --- a/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp +++ b/NetSSL_OpenSSL/testsuite/src/HTTPSClientSessionTest.cpp @@ -315,7 +315,7 @@ void HTTPSClientSessionTest::testMultipleSSLInit() Context::VerificationMode::VERIFY_STRICT, 9, false, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH" ) ); - SSLManager::instance().initializeClient(0, ptrCert, context); + SSLManager::instance().initializeClient(nullptr, ptrCert, context); }; auto deinitSSL = []() @@ -490,7 +490,7 @@ void HTTPSClientSessionTest::testServerAbort() StreamCopier::copyStream(rs, ostr); assertTrue (ostr.str() == HTTPSTestServer::SMALL_BODY); assertTrue (dynamic_cast( - s.networkException()) != NULL ); + s.networkException()) != nullptr ); } diff --git a/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.cpp b/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.cpp index 7c906f4a2..5460d0f31 100644 --- a/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.cpp +++ b/NetSSL_OpenSSL/testsuite/src/HTTPSServerTest.cpp @@ -107,7 +107,7 @@ namespace else if (request.getURI() == "/auth") return new AuthRequestHandler(); else - return 0; + return nullptr; } }; } diff --git a/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.cpp b/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.cpp index f78a4130d..5f9e1dd5d 100644 --- a/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.cpp +++ b/NetSSL_OpenSSL/testsuite/src/HTTPSTestServer.cpp @@ -97,7 +97,7 @@ void HTTPSTestServer::run() ss.sendBytes(response.data(), (int) response.size()); if(_lastRequest.find("/connection/abort")!=std::string::npos) { SecureStreamSocketImpl* sss = dynamic_cast(ss.impl()); - if(sss!=NULL) sss->abort(); + if(sss!=nullptr) sss->abort(); } Poco::Thread::sleep(1000); } @@ -113,8 +113,8 @@ void HTTPSTestServer::run() bool HTTPSTestServer::requestComplete() const { return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") && - (_lastRequest.find("\r\n\r\n") != std::string::npos)) || - (_lastRequest.find("\r\n0\r\n") != std::string::npos); + (_lastRequest.find("\r\n\r\n") != std::string::npos)) || + (_lastRequest.find("\r\n0\r\n") != std::string::npos); } @@ -123,7 +123,7 @@ std::string HTTPSTestServer::handleRequest() const std::string response; response.reserve(16000); if (_lastRequest.substr(0, 10) == "GET /small" || - _lastRequest.substr(0, 11) == "HEAD /small") + _lastRequest.substr(0, 11) == "HEAD /small") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -137,8 +137,8 @@ std::string HTTPSTestServer::handleRequest() const response.append(body); } else if (_lastRequest.substr(0, 10) == "GET /large" || - _lastRequest.substr(0, 11) == "HEAD /large" || - _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") + _lastRequest.substr(0, 11) == "HEAD /large" || + _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") { std::string body(LARGE_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -152,7 +152,7 @@ std::string HTTPSTestServer::handleRequest() const response.append(body); } else if (_lastRequest.substr(0, 13) == "GET /nolength" || - _lastRequest.substr(0, 14) == "HEAD /nolength") + _lastRequest.substr(0, 14) == "HEAD /nolength") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -230,7 +230,7 @@ std::string HTTPSTestServer::handleRequest() const response.append("\r\n"); } else if (_lastRequest.substr(0, 5) == "GET /" || - _lastRequest.substr(0, 6) == "HEAD /") + _lastRequest.substr(0, 6) == "HEAD /") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); diff --git a/NetSSL_Win/src/CertificateHandlerFactoryMgr.cpp b/NetSSL_Win/src/CertificateHandlerFactoryMgr.cpp index 06d56abdd..4572eecac 100644 --- a/NetSSL_Win/src/CertificateHandlerFactoryMgr.cpp +++ b/NetSSL_Win/src/CertificateHandlerFactoryMgr.cpp @@ -56,7 +56,7 @@ const CertificateHandlerFactory* CertificateHandlerFactoryMgr::getFactory(const if (it != _factories.end()) return it->second; else - return 0; + return nullptr; } diff --git a/NetSSL_Win/src/Context.cpp b/NetSSL_Win/src/Context.cpp index cb57a0085..cd729b2d0 100644 --- a/NetSSL_Win/src/Context.cpp +++ b/NetSSL_Win/src/Context.cpp @@ -52,11 +52,11 @@ Context::Context(Usage usage, _extendedCertificateVerification(true), _certInfoOrPath(certificateInfoOrPath), _certStoreName(certStore), - _hMemCertStore(0), - _hCollectionCertStore(0), - _hRootCertStore(0), - _hCertStore(0), - _pCert(0), + _hMemCertStore(nullptr), + _hCollectionCertStore(nullptr), + _hRootCertStore(nullptr), + _hCertStore(nullptr), + _pCert(nullptr), _securityFunctions(SSLManager::instance().securityFunctions()) { init(); @@ -94,9 +94,9 @@ void Context::init() _hMemCertStore = CertOpenStore( CERT_STORE_PROV_MEMORY, // The memory provider type 0, // The encoding type is not needed - NULL, // Use the default provider + 0, // Use the default provider 0, // Accept the default dwFlags - NULL); // pvPara is not used + nullptr); // pvPara is not used if (!_hMemCertStore) throw SSLException("Failed to create memory certificate store", GetLastError()); @@ -104,9 +104,9 @@ void Context::init() _hCollectionCertStore = CertOpenStore( CERT_STORE_PROV_COLLECTION, // A collection store 0, // Encoding type; not used with a collection store - NULL, // Use the default provider + 0, // Use the default provider 0, // No flags - NULL); // Not needed + nullptr); // Not needed if (!_hCollectionCertStore) throw SSLException("Failed to create collection store", GetLastError()); @@ -137,7 +137,7 @@ void Context::enableExtendedCertificateVerification(bool flag) void Context::addTrustedCert(const Poco::Net::X509Certificate& cert) { Poco::FastMutex::ScopedLock lock(_mutex); - if (!CertAddCertificateContextToStore(_hMemCertStore, cert.system(), CERT_STORE_ADD_REPLACE_EXISTING, 0)) + if (!CertAddCertificateContextToStore(_hMemCertStore, cert.system(), CERT_STORE_ADD_REPLACE_EXISTING, nullptr)) throw CertificateException("Failed to add certificate to store", GetLastError()); } @@ -204,7 +204,7 @@ void Context::loadCertificate() chBlob.cbData = bufferSize; chBlob.pbData = buffer; - _pCert = CertFindCertificateInStore(_hCertStore, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, 0, CERT_FIND_HASH, &chBlob, NULL); + _pCert = CertFindCertificateInStore(_hCertStore, PKCS_7_ASN_ENCODING | X509_ASN_ENCODING, 0, CERT_FIND_HASH, &chBlob, nullptr); if (!_pCert) throw NoCertificateException(Poco::format("Failed to find certificate %s in store %s", _certInfoOrPath, _certStoreName)); } else @@ -220,7 +220,7 @@ void Context::loadCertificate() cert_rdn.cRDNAttr = 1; cert_rdn.rgRDNAttr = &cert_rdn_attr; - _pCert = CertFindCertificateInStore(_hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_SUBJECT_ATTR, &cert_rdn, NULL); + _pCert = CertFindCertificateInStore(_hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_SUBJECT_ATTR, &cert_rdn, nullptr); if (!_pCert) throw NoCertificateException(Poco::format("Failed to find certificate %s in store %s", _certInfoOrPath, _certStoreName)); } } @@ -261,11 +261,11 @@ void Context::importCertificate(const char* pBuffer, std::size_t size) if (hTempStore) { - PCCERT_CONTEXT pCert = 0; + PCCERT_CONTEXT pCert = nullptr; pCert = CertEnumCertificatesInStore(hTempStore, pCert); while (pCert) { - PCCERT_CONTEXT pStoreCert = 0; + PCCERT_CONTEXT pStoreCert = nullptr; BOOL res = CertAddCertificateContextToStore(_hMemCertStore, pCert, CERT_STORE_ADD_REPLACE_EXISTING, &pStoreCert); if (res) { @@ -276,7 +276,7 @@ void Context::importCertificate(const char* pBuffer, std::size_t size) else { CertFreeCertificateContext(pStoreCert); - pStoreCert = 0; + pStoreCert = nullptr; } } pCert = CertEnumCertificatesInStore(hTempStore, pCert); @@ -308,7 +308,7 @@ void Context::acquireSchannelCredentials(CredHandle& credHandle) const if (_pCert) { schannelCred.cCreds = 1; // how many cred are stored in &pCertContext - schannelCred.paCred = const_cast(&_pCert); + schannelCred.paCred = const_cast(&_pCert); } schannelCred.grbitEnabledProtocols = proto(); @@ -346,19 +346,19 @@ void Context::acquireSchannelCredentials(CredHandle& credHandle) const schannelCred.dwFlags |= SCH_USE_STRONG_CRYPTO; #endif - schannelCred.hRootStore = schannelCred.hRootStore = isForServerUse() ? _hCollectionCertStore : NULL; + schannelCred.hRootStore = schannelCred.hRootStore = isForServerUse() ? _hCollectionCertStore : nullptr; TimeStamp tsExpiry; tsExpiry.LowPart = tsExpiry.HighPart = 0; - ::SEC_WCHAR name[] = UNISP_NAME_W; + ::SEC_WCHAR name[] = UNISP_NAME_W; SECURITY_STATUS status = _securityFunctions.AcquireCredentialsHandleW( - NULL, - name, + nullptr, + name, isForServerUse() ? SECPKG_CRED_INBOUND : SECPKG_CRED_OUTBOUND, - NULL, + nullptr, &schannelCred, - NULL, - NULL, + nullptr, + nullptr, &credHandle, &tsExpiry); diff --git a/NetSSL_Win/src/HTTPSStreamFactory.cpp b/NetSSL_Win/src/HTTPSStreamFactory.cpp index b2cb86821..5b1a43db0 100644 --- a/NetSSL_Win/src/HTTPSStreamFactory.cpp +++ b/NetSSL_Win/src/HTTPSStreamFactory.cpp @@ -69,7 +69,7 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) URI resolvedURI(uri); URI proxyUri; - HTTPClientSession* pSession = 0; + HTTPClientSession* pSession = nullptr; HTTPResponse res; try { @@ -118,8 +118,8 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) pSession->sendRequest(req); std::istream& rs = pSession->receiveResponse(res); bool moved = (res.getStatus() == HTTPResponse::HTTP_MOVED_PERMANENTLY || - res.getStatus() == HTTPResponse::HTTP_FOUND || - res.getStatus() == HTTPResponse::HTTP_SEE_OTHER || + res.getStatus() == HTTPResponse::HTTP_FOUND || + res.getStatus() == HTTPResponse::HTTP_SEE_OTHER || res.getStatus() == HTTPResponse::HTTP_TEMPORARY_REDIRECT); if (moved) { @@ -130,7 +130,7 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) authorize = false; } delete pSession; - pSession = 0; + pSession = nullptr; ++redirects; retry = true; } @@ -146,7 +146,7 @@ std::istream* HTTPSStreamFactory::open(const URI& uri) // single request via the proxy. 305 responses MUST only be generated by origin servers. // only use for one single request! proxyUri.resolve(res.get("Location")); - delete pSession; pSession = 0; + delete pSession; pSession = nullptr; retry = true; // only allow useproxy once } else if (res.getStatus() == HTTPResponse::HTTP_UNAUTHORIZED && !authorize) diff --git a/NetSSL_Win/src/PrivateKeyFactoryMgr.cpp b/NetSSL_Win/src/PrivateKeyFactoryMgr.cpp index 7a19faead..418c64ccd 100644 --- a/NetSSL_Win/src/PrivateKeyFactoryMgr.cpp +++ b/NetSSL_Win/src/PrivateKeyFactoryMgr.cpp @@ -54,7 +54,7 @@ const PrivateKeyFactory* PrivateKeyFactoryMgr::getFactory(const std::string& nam if (it != _factories.end()) return it->second; else - return 0; + return nullptr; } diff --git a/NetSSL_Win/src/SSLManager.cpp b/NetSSL_Win/src/SSLManager.cpp index 3fe79c383..f24eac5cb 100644 --- a/NetSSL_Win/src/SSLManager.cpp +++ b/NetSSL_Win/src/SSLManager.cpp @@ -62,7 +62,7 @@ const std::string SSLManager::CFG_REQUIRE_TLSV1_3("requireTLSv1_3"); SSLManager::SSLManager(): - _hSecurityModule(0) + _hSecurityModule(nullptr) { loadSecurityLibrary(); } @@ -278,7 +278,7 @@ void SSLManager::initPassphraseHandler(bool server) std::string className(config.getString(prefix + CFG_DELEGATE_HANDLER, VAL_DELEGATE_HANDLER)); - const PrivateKeyFactory* pFactory = 0; + const PrivateKeyFactory* pFactory = nullptr; if (privateKeyFactoryMgr().hasFactory(className)) { pFactory = privateKeyFactoryMgr().getFactory(className); @@ -305,7 +305,7 @@ void SSLManager::initCertificateHandler(bool server) std::string className(config.getString(prefix + CFG_CERTIFICATE_HANDLER, VAL_CERTIFICATE_HANDLER)); - const CertificateHandlerFactory* pFactory = 0; + const CertificateHandlerFactory* pFactory = nullptr; if (certificateHandlerFactoryMgr().hasFactory(className)) { pFactory = certificateHandlerFactoryMgr().getFactory(className); @@ -326,12 +326,12 @@ void SSLManager::shutdown() { ClientVerificationError.clear(); ServerVerificationError.clear(); - _ptrServerPassphraseHandler = 0; - _ptrServerCertificateHandler = 0; - _ptrDefaultServerContext = 0; - _ptrClientPassphraseHandler = 0; - _ptrClientCertificateHandler = 0; - _ptrDefaultClientContext = 0; + _ptrServerPassphraseHandler = nullptr; + _ptrServerCertificateHandler = nullptr; + _ptrDefaultServerContext = nullptr; + _ptrClientPassphraseHandler = nullptr; + _ptrClientCertificateHandler = nullptr; + _ptrDefaultClientContext = nullptr; unloadSecurityLibrary(); } @@ -371,7 +371,7 @@ void SSLManager::loadSecurityLibrary() // _hSecurityModule = LoadLibraryW(dllPath.c_str()); - if(_hSecurityModule == 0) + if(_hSecurityModule == nullptr) { throw Poco::SystemException("Failed to load security DLL"); } @@ -381,7 +381,7 @@ void SSLManager::loadSecurityLibrary() if (!pInitSecurityInterface) { FreeLibrary(_hSecurityModule); - _hSecurityModule = 0; + _hSecurityModule = nullptr; throw Poco::SystemException("Failed to initialize security DLL (no init function)"); } @@ -389,7 +389,7 @@ void SSLManager::loadSecurityLibrary() if (!pSecurityFunc) { FreeLibrary(_hSecurityModule); - _hSecurityModule = 0; + _hSecurityModule = nullptr; throw Poco::SystemException("Failed to initialize security DLL (no function table)"); } @@ -402,7 +402,7 @@ void SSLManager::unloadSecurityLibrary() if (_hSecurityModule) { FreeLibrary(_hSecurityModule); - _hSecurityModule = 0; + _hSecurityModule = nullptr; } } diff --git a/NetSSL_Win/src/SecureSocketImpl.cpp b/NetSSL_Win/src/SecureSocketImpl.cpp index 15c87e941..53e42e04a 100644 --- a/NetSSL_Win/src/SecureSocketImpl.cpp +++ b/NetSSL_Win/src/SecureSocketImpl.cpp @@ -63,8 +63,8 @@ SecureSocketImpl::SecureSocketImpl(Poco::AutoPtr pSocketImpl, Contex _shutdownFlags(0), _clientAuthRequired(pContext->verificationMode() >= Context::VERIFY_STRICT), _securityFunctions(SSLManager::instance().securityFunctions()), - _pOwnCertificate(0), - _pPeerCertificate(0), + _pOwnCertificate(nullptr), + _pPeerCertificate(nullptr), _contextFlags(0), _overflowBuffer(0), _sendBuffer(0), @@ -105,11 +105,11 @@ SecureSocketImpl::~SecureSocketImpl() void SecureSocketImpl::initCommon() { _contextFlags = ISC_REQ_SEQUENCE_DETECT - | ISC_REQ_REPLAY_DETECT - | ISC_REQ_CONFIDENTIALITY - | ISC_RET_EXTENDED_ERROR - | ISC_REQ_ALLOCATE_MEMORY - | ISC_REQ_STREAM; + | ISC_REQ_REPLAY_DETECT + | ISC_REQ_CONFIDENTIALITY + | ISC_RET_EXTENDED_ERROR + | ISC_REQ_ALLOCATE_MEMORY + | ISC_REQ_STREAM; if (_pContext->verificationMode() == Context::VERIFY_NONE) { @@ -155,13 +155,13 @@ void SecureSocketImpl::cleanup() if (_pOwnCertificate) { CertFreeCertificateContext(_pOwnCertificate); - _pOwnCertificate = 0; + _pOwnCertificate = nullptr; } if (_pPeerCertificate) { CertFreeCertificateContext(_pPeerCertificate); - _pPeerCertificate = 0; + _pPeerCertificate = nullptr; } _outSecBuffer.release(); @@ -327,7 +327,7 @@ void SecureSocketImpl::verifyPeerCertificate(const std::string& hostName) { Context::VerificationMode mode = _pContext->verificationMode(); if (mode == Context::VERIFY_NONE || !_pContext->extendedCertificateVerificationEnabled() || - (mode != Context::VERIFY_STRICT && isLocalHost(hostName))) + (mode != Context::VERIFY_STRICT && isLocalHost(hostName))) { return; } @@ -435,8 +435,8 @@ int SecureSocketImpl::sendBytes(const void* buffer, int length, int flags) int dataSize = dataToSend; if (dataSize > _streamSizes.cbMaximumMessage) dataSize = _streamSizes.cbMaximumMessage; - SecBuffer* pDataBuffer = 0; - SecBuffer* pExtraBuffer = 0; + SecBuffer* pDataBuffer = nullptr; + SecBuffer* pExtraBuffer = nullptr; if (_sendBuffer.size() < _sendBufferPending + dataSize + _streamSizes.cbHeader + _streamSizes.cbTrailer) { @@ -557,7 +557,7 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags) else needData = true; int bytesDecoded = 0; - _extraSecBuffer.pvBuffer = 0; + _extraSecBuffer.pvBuffer = nullptr; _extraSecBuffer.cbBuffer = 0; SECURITY_STATUS securityStatus = decodeBufferFull(_recvBuffer.begin(), _recvBufferOffset, reinterpret_cast(buffer), length, bytesDecoded); if (_extraSecBuffer.cbBuffer > 0) @@ -571,7 +571,7 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags) cont = false; } - _extraSecBuffer.pvBuffer = 0; + _extraSecBuffer.pvBuffer = nullptr; _extraSecBuffer.cbBuffer = 0; if (bytesDecoded > 0) @@ -627,7 +627,7 @@ int SecureSocketImpl::receiveBytes(void* buffer, int length, int flags) _recvBufferOffset = _extraSecBuffer.cbBuffer; } - _extraSecBuffer.pvBuffer = 0; + _extraSecBuffer.pvBuffer = nullptr; _extraSecBuffer.cbBuffer = 0; } } @@ -644,10 +644,10 @@ SECURITY_STATUS SecureSocketImpl::decodeMessage(BYTE* pBuffer, DWORD bufSize, Au msg.setSecBufferEmpty(1); msg.setSecBufferEmpty(2); msg.setSecBufferEmpty(3); - pDataBuffer = 0; - pExtraBuffer = 0; + pDataBuffer = nullptr; + pExtraBuffer = nullptr; - SECURITY_STATUS securityStatus = _securityFunctions.DecryptMessage(&_hContext, &msg, 0, 0); + SECURITY_STATUS securityStatus = _securityFunctions.DecryptMessage(&_hContext, &msg, 0, nullptr); // TODO: when decrypting the close_notify alert, returns SEC_E_DECRYPT_FAILURE // instead of SEC_I_CONTEXT_EXPIRED @@ -674,11 +674,11 @@ SECURITY_STATUS SecureSocketImpl::decodeBufferFull(BYTE* pBuffer, DWORD bufSize, poco_check_ptr (pOutBuffer); poco_assert (outLength > 0); - _extraSecBuffer.pvBuffer = 0; + _extraSecBuffer.pvBuffer = nullptr; _extraSecBuffer.cbBuffer = 0; - SecBuffer* pDataBuffer = 0; - SecBuffer* pExtraBuffer = 0; + SecBuffer* pDataBuffer = nullptr; + SecBuffer* pExtraBuffer = nullptr; int bytes = 0; bytesDecoded = 0; @@ -710,7 +710,7 @@ SECURITY_STATUS SecureSocketImpl::decodeBufferFull(BYTE* pBuffer, DWORD bufSize, // make pOutBuffer full std::memcpy(pOutBuffer, pDataBuffer->pvBuffer, outLength); // no longer valid to write to pOutBuffer - pOutBuffer = 0; + pOutBuffer = nullptr; // copy the rest to ptrOverflow std::memcpy(overflowBuffer.begin(), reinterpret_cast(pDataBuffer->pvBuffer) + outLength, bytes - outLength); overflowOffset = bytes - outLength; @@ -737,7 +737,7 @@ SECURITY_STATUS SecureSocketImpl::decodeBufferFull(BYTE* pBuffer, DWORD bufSize, if (securityStatus == SEC_E_OK) { // everything decoded - pBuffer = 0; + pBuffer = nullptr; bufSize = 0; } else if (securityStatus != SEC_E_INCOMPLETE_MESSAGE && securityStatus != SEC_I_RENEGOTIATE && securityStatus != SEC_I_CONTEXT_EXPIRED) @@ -765,7 +765,7 @@ SECURITY_STATUS SecureSocketImpl::decodeBufferFull(BYTE* pBuffer, DWORD bufSize, _extraSecBuffer.pvBuffer = pBuffer; } - if (pBuffer == 0) securityStatus = SEC_E_OK; + if (pBuffer == nullptr) securityStatus = SEC_E_OK; return securityStatus; } @@ -790,14 +790,14 @@ PCCERT_CONTEXT SecureSocketImpl::loadCertificate(bool mustFindCertificate) if (mustFindCertificate) throw; else - return 0; + return nullptr; } } void SecureSocketImpl::connectSSL(bool completeHandshake) { - poco_assert_dbg(_pPeerCertificate == 0); + poco_assert_dbg(_pPeerCertificate == nullptr); if (_peerHostName.empty()) { @@ -836,7 +836,7 @@ void SecureSocketImpl::stateError() void SecureSocketImpl::stateClientConnected() { if (_peerHostName.empty()) - _peerHostName = _pSocket->peerAddress().host().toString(); + _peerHostName = _pSocket->peerAddress().host().toString(); setState(ST_CLIENT_HSK_START); } @@ -848,7 +848,7 @@ void SecureSocketImpl::stateClientHandshakeStart() // get initial security token _outSecBuffer.reset(true); - _outSecBuffer.setSecBufferToken(0, 0, 0); + _outSecBuffer.setSecBufferToken(0, nullptr, 0); _recvBuffer.setCapacity(IO_BUFFER_SIZE); _recvBufferOffset = 0; @@ -858,12 +858,12 @@ void SecureSocketImpl::stateClientHandshakeStart() Poco::UnicodeConverter::convert(_peerHostName, whostName); _securityStatus = _securityFunctions.InitializeSecurityContextW( &_hCreds, - 0, + nullptr, const_cast(whostName.c_str()), _contextFlags, 0, 0, - 0, + nullptr, 0, &_hContext, &_outSecBuffer, @@ -883,7 +883,7 @@ void SecureSocketImpl::stateClientHandshakeStart() } } - _extraSecBuffer.pvBuffer = 0; + _extraSecBuffer.pvBuffer = nullptr; _extraSecBuffer.cbBuffer = 0; _needData = true; @@ -948,11 +948,11 @@ int SecureSocketImpl::getRecordLength(const BYTE* pRec, int len) { // TLS Record Header: // struct { - // ContentType type; /* 1 byte */ - // ProtocolVersion version; /* 2 bytes */ - // uint16 length; /* must be <= 2^14 */ - // opaque fragment[TLSPlaintext.length]; - // } TLSPlaintext; + // ContentType type; /* 1 byte */ + // ProtocolVersion version; /* 2 bytes */ + // uint16 length; /* must be <= 2^14 */ + // opaque fragment[TLSPlaintext.length]; + // } TLSPlaintext; if (len >= 5) { @@ -1010,7 +1010,7 @@ void SecureSocketImpl::stateClientHandshakeLoopProcess() { _inSecBuffer.setSecBufferToken(0, _recvBuffer.begin(), _recvBufferOffset); _inSecBuffer.setSecBufferEmpty(1); - _outSecBuffer.setSecBufferToken(0, 0, 0); + _outSecBuffer.setSecBufferToken(0, nullptr, 0); PRINT_STATE("stateClientHandshakeLoopProcess before InitializeSecurityContextW: "); @@ -1019,13 +1019,13 @@ void SecureSocketImpl::stateClientHandshakeLoopProcess() _securityStatus = _securityFunctions.InitializeSecurityContextW( &_hCreds, &_hContext, - 0, + nullptr, _contextFlags, 0, 0, &_inSecBuffer, 0, - 0, + nullptr, &_outSecBuffer, &outFlags, &ts); @@ -1152,7 +1152,7 @@ void SecureSocketImpl::stateClientVerify() if (_pPeerCertificate) { CertFreeCertificateContext(_pPeerCertificate); - _pPeerCertificate = 0; + _pPeerCertificate = nullptr; } throw; } @@ -1219,17 +1219,17 @@ void SecureSocketImpl::stateServerHandshakeLoopProcess() PRINT_STATE("stateServerHandshakeLoopProcess before AcceptSecurityContext: "); _inSecBuffer.setSecBufferToken(0, _recvBuffer.begin(), _recvBufferOffset); _inSecBuffer.setSecBufferEmpty(1); - _outSecBuffer.setSecBufferToken(0, 0, 0); + _outSecBuffer.setSecBufferToken(0, nullptr, 0); TimeStamp tsExpiry; DWORD outFlags; _securityStatus = _securityFunctions.AcceptSecurityContext( &_hCreds, - _initServerContext ? NULL : &_hContext, + _initServerContext ? nullptr : &_hContext, &_inSecBuffer, _contextFlags, 0, - _initServerContext ? &_hContext : NULL, + _initServerContext ? &_hContext : nullptr, &_outSecBuffer, &outFlags, &tsExpiry); @@ -1246,7 +1246,7 @@ void SecureSocketImpl::stateServerHandshakeLoopProcess() else if (_securityStatus == SEC_E_OK || _securityStatus == SEC_I_CONTINUE_NEEDED || (FAILED(_securityStatus) && (0 != (outFlags & ISC_RET_EXTENDED_ERROR)))) { drainExtraBuffer(); - if (_outSecBuffer[0].cbBuffer != 0 && _outSecBuffer[0].pvBuffer != 0) + if (_outSecBuffer[0].cbBuffer != 0 && _outSecBuffer[0].pvBuffer != nullptr) { setState(ST_SERVER_HSK_LOOP_SEND); return; @@ -1291,7 +1291,7 @@ void SecureSocketImpl::stateServerHandshakeVerify() if (_pPeerCertificate) { CertFreeCertificateContext(_pPeerCertificate); - _pPeerCertificate = 0; + _pPeerCertificate = nullptr; } throw SSLException("Cannot obtain client certificate", Utility::formatError(securityStatus)); } @@ -1371,18 +1371,18 @@ void SecureSocketImpl::verifyCertificateChainClient(PCCERT_CONTEXT pServerCert) X509Certificate cert(pServerCert, true); CERT_CHAIN_PARA chainPara; - PCCERT_CHAIN_CONTEXT pChainContext = NULL; + PCCERT_CHAIN_CONTEXT pChainContext = nullptr; std::memset(&chainPara, 0, sizeof(chainPara)); chainPara.cbSize = sizeof(chainPara); if (!CertGetCertificateChain( - NULL, + nullptr, _pPeerCertificate, - NULL, + nullptr, pServerCert->hCertStore, &chainPara, 0, - NULL, + nullptr, &pChainContext)) { throw SSLException("Cannot get certificate chain", GetLastError()); @@ -1393,7 +1393,7 @@ void SecureSocketImpl::verifyCertificateChainClient(PCCERT_CONTEXT pServerCert) polHttps.cbStruct = sizeof(HTTPSPolicyCallbackData); polHttps.dwAuthType = AUTHTYPE_SERVER; polHttps.fdwChecks = SECURITY_FLAG_IGNORE_UNKNOWN_CA; // we do our own check later on - polHttps.pwszServerName = 0; + polHttps.pwszServerName = nullptr; CERT_CHAIN_POLICY_PARA polPara; std::memset(&polPara, 0, sizeof(polPara)); @@ -1441,7 +1441,7 @@ void SecureSocketImpl::verifyCertificateChainClient(PCCERT_CONTEXT pServerCert) certs.push_back(pChainContext->rgpChain[i]->rgpElement[k]->pCertContext); } // verify that the root of the chain can be found in the trusted store - PCCERT_CONTEXT pResult = CertFindCertificateInStore(trustedCerts, certs.back()->dwCertEncodingType, 0, CERT_FIND_ISSUER_OF, certs.back(), 0); + PCCERT_CONTEXT pResult = CertFindCertificateInStore(trustedCerts, certs.back()->dwCertEncodingType, 0, CERT_FIND_ISSUER_OF, certs.back(), nullptr); if (!pResult) { poco_assert_dbg (GetLastError() == CRYPT_E_NOT_FOUND); @@ -1467,7 +1467,7 @@ void SecureSocketImpl::verifyCertificateChainClient(PCCERT_CONTEXT pServerCert) static_cast(certs.size()), (void**) &certs[0], CERT_VERIFY_REV_CHAIN_FLAG, - NULL, + nullptr, &revStat); // Revocation check of the root certificate may fail due to missing CRL points, etc. @@ -1499,19 +1499,19 @@ void SecureSocketImpl::serverVerifyCertificate() DWORD status = SEC_E_OK; X509Certificate cert(_pPeerCertificate, true); - PCCERT_CHAIN_CONTEXT pChainContext = NULL; + PCCERT_CHAIN_CONTEXT pChainContext = nullptr; CERT_CHAIN_PARA chainPara; std::memset(&chainPara, 0, sizeof(chainPara)); chainPara.cbSize = sizeof(chainPara); if (!CertGetCertificateChain( - NULL, + nullptr, _pPeerCertificate, - NULL, - NULL, + nullptr, + nullptr, &chainPara, CERT_CHAIN_REVOCATION_CHECK_CHAIN, - NULL, + nullptr, &pChainContext)) { throw SSLException("Cannot get certificate chain", GetLastError()); @@ -1522,7 +1522,7 @@ void SecureSocketImpl::serverVerifyCertificate() polHttps.cbStruct = sizeof(HTTPSPolicyCallbackData); polHttps.dwAuthType = AUTHTYPE_CLIENT; polHttps.fdwChecks = 0; - polHttps.pwszServerName = 0; + polHttps.pwszServerName = nullptr; CERT_CHAIN_POLICY_PARA policyPara; std::memset(&policyPara, 0, sizeof(policyPara)); @@ -1572,7 +1572,7 @@ void SecureSocketImpl::serverVerifyCertificate() static_cast(certs.size()), (void**) &certs[0], CERT_VERIFY_REV_CHAIN_FLAG, - NULL, + nullptr, &revStat); // Revocation check of the root certificate may fail due to missing CRL points, etc. @@ -1612,25 +1612,25 @@ int SecureSocketImpl::clientShutdown(PCredHandle phCreds, CtxtHandle* phContext) if (FAILED(status)) throw SSLException(Utility::formatError(status)); DWORD sspiFlags = ISC_REQ_SEQUENCE_DETECT - | ISC_REQ_REPLAY_DETECT - | ISC_REQ_CONFIDENTIALITY - | ISC_RET_EXTENDED_ERROR - | ISC_REQ_ALLOCATE_MEMORY - | ISC_REQ_STREAM; + | ISC_REQ_REPLAY_DETECT + | ISC_REQ_CONFIDENTIALITY + | ISC_RET_EXTENDED_ERROR + | ISC_REQ_ALLOCATE_MEMORY + | ISC_REQ_STREAM; AutoSecBufferDesc<1> outBuffer(&_securityFunctions, true); - outBuffer.setSecBufferToken(0, 0, 0); + outBuffer.setSecBufferToken(0, nullptr, 0); DWORD sspiOutFlags; TimeStamp expiry; status = _securityFunctions.InitializeSecurityContextW( phCreds, phContext, - NULL, + nullptr, sspiFlags, 0, 0, - NULL, + nullptr, 0, phContext, &outBuffer, @@ -1667,24 +1667,24 @@ int SecureSocketImpl::serverShutdown(PCredHandle phCreds, CtxtHandle* phContext) if (FAILED(status)) return status; DWORD sspiFlags = ASC_REQ_SEQUENCE_DETECT - | ASC_REQ_REPLAY_DETECT - | ASC_REQ_CONFIDENTIALITY - | ASC_REQ_EXTENDED_ERROR - | ASC_REQ_ALLOCATE_MEMORY - | ASC_REQ_STREAM; + | ASC_REQ_REPLAY_DETECT + | ASC_REQ_CONFIDENTIALITY + | ASC_REQ_EXTENDED_ERROR + | ASC_REQ_ALLOCATE_MEMORY + | ASC_REQ_STREAM; AutoSecBufferDesc<1> outBuffer(&_securityFunctions, true); - outBuffer.setSecBufferToken(0,0,0); + outBuffer.setSecBufferToken(0,nullptr,0); DWORD sspiOutFlags; TimeStamp expiry; status = _securityFunctions.AcceptSecurityContext( phCreds, phContext, - NULL, + nullptr, sspiFlags, 0, - NULL, + nullptr, &outBuffer, &sspiOutFlags, &expiry); diff --git a/NetSSL_Win/src/SecureStreamSocketImpl.cpp b/NetSSL_Win/src/SecureStreamSocketImpl.cpp index 876162a61..0adace2b9 100644 --- a/NetSSL_Win/src/SecureStreamSocketImpl.cpp +++ b/NetSSL_Win/src/SecureStreamSocketImpl.cpp @@ -169,7 +169,7 @@ bool SecureStreamSocketImpl::secure() const bool SecureStreamSocketImpl::havePeerCertificate() const { - return _impl.peerCertificate() != 0; + return _impl.peerCertificate() != nullptr; } diff --git a/NetSSL_Win/src/X509Certificate.cpp b/NetSSL_Win/src/X509Certificate.cpp index 301f57dab..015c2cc39 100644 --- a/NetSSL_Win/src/X509Certificate.cpp +++ b/NetSSL_Win/src/X509Certificate.cpp @@ -34,7 +34,7 @@ namespace Net { X509Certificate::X509Certificate(const std::string& path): - _pCert(0) + _pCert(nullptr) { importCertificate(path); init(); @@ -42,7 +42,7 @@ X509Certificate::X509Certificate(const std::string& path): X509Certificate::X509Certificate(std::istream& istr): - _pCert(0) + _pCert(nullptr) { importCertificate(istr); init(); @@ -50,7 +50,7 @@ X509Certificate::X509Certificate(std::istream& istr): X509Certificate::X509Certificate(const std::string& certName, const std::string& certStoreName, bool useMachineStore): - _pCert(0) + _pCert(nullptr) { loadCertificate(certName, certStoreName, useMachineStore); init(); @@ -217,7 +217,7 @@ std::string X509Certificate::commonName() const std::string X509Certificate::issuerName(NID nid) const { std::string result; - DWORD size = CertGetNameStringW(_pCert, CERT_NAME_ATTR_TYPE, CERT_NAME_ISSUER_FLAG, nid2oid(nid), 0, 0); + DWORD size = CertGetNameStringW(_pCert, CERT_NAME_ATTR_TYPE, CERT_NAME_ISSUER_FLAG, nid2oid(nid), nullptr, 0); Poco::Buffer data(size); CertGetNameStringW(_pCert, CERT_NAME_ATTR_TYPE, CERT_NAME_ISSUER_FLAG, nid2oid(nid), data.begin(), size); Poco::UnicodeConverter::convert(data.begin(), result); @@ -228,7 +228,7 @@ std::string X509Certificate::issuerName(NID nid) const std::string X509Certificate::subjectName(NID nid) const { std::string result; - DWORD size = CertGetNameStringW(_pCert, CERT_NAME_ATTR_TYPE, 0, nid2oid(nid), 0, 0); + DWORD size = CertGetNameStringW(_pCert, CERT_NAME_ATTR_TYPE, 0, nid2oid(nid), nullptr, 0); Poco::Buffer data(size); CertGetNameStringW(_pCert, CERT_NAME_ATTR_TYPE, 0, nid2oid(nid), data.begin(), size); Poco::UnicodeConverter::convert(data.begin(), result); @@ -257,7 +257,7 @@ void X509Certificate::extractNames(std::string& cmnName, std::set& pExt->Value.pbData, pExt->Value.cbData, flags, - 0, + nullptr, buffer.begin(), &bufferSize); if (!rc && GetLastError() == ERROR_MORE_DATA) @@ -269,7 +269,7 @@ void X509Certificate::extractNames(std::string& cmnName, std::set& pExt->Value.pbData, pExt->Value.cbData, flags, - 0, + nullptr, buffer.begin(), &bufferSize); } @@ -314,18 +314,18 @@ Poco::DateTime X509Certificate::expiresOn() const bool X509Certificate::issuedBy(const X509Certificate& issuerCertificate) const { CERT_CHAIN_PARA chainPara; - PCCERT_CHAIN_CONTEXT pChainContext = 0; + PCCERT_CHAIN_CONTEXT pChainContext = nullptr; std::memset(&chainPara, 0, sizeof(chainPara)); chainPara.cbSize = sizeof(chainPara); if (!CertGetCertificateChain( - NULL, + nullptr, _pCert, - NULL, - NULL, + nullptr, + nullptr, &chainPara, 0, - NULL, + nullptr, &pChainContext)) { throw SSLException("Cannot get certificate chain", subjectName(), GetLastError()); @@ -353,7 +353,7 @@ bool X509Certificate::issuedBy(const X509Certificate& issuerCertificate) const void* X509Certificate::nid2oid(NID nid) { - const char* result = 0; + const char* result = nullptr; switch (nid) { case NID_COMMON_NAME: @@ -406,7 +406,7 @@ void X509Certificate::loadCertificate(const std::string& certName, const std::st cert_rdn.cRDNAttr = 1; cert_rdn.rgRDNAttr = &cert_rdn_attr; - _pCert = CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_SUBJECT_ATTR, &cert_rdn, NULL); + _pCert = CertFindCertificateInStore(hCertStore, X509_ASN_ENCODING, 0, CERT_FIND_SUBJECT_ATTR, &cert_rdn, nullptr); if (!_pCert) { CertCloseStore(hCertStore, 0); diff --git a/NetSSL_Win/testsuite/src/HTTPSTestServer.cpp b/NetSSL_Win/testsuite/src/HTTPSTestServer.cpp index 199303a03..ee9199e3a 100644 --- a/NetSSL_Win/testsuite/src/HTTPSTestServer.cpp +++ b/NetSSL_Win/testsuite/src/HTTPSTestServer.cpp @@ -107,8 +107,8 @@ void HTTPSTestServer::run() bool HTTPSTestServer::requestComplete() const { return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") && - (_lastRequest.find("\r\n\r\n") != std::string::npos)) || - (_lastRequest.find("\r\n0\r\n") != std::string::npos); + (_lastRequest.find("\r\n\r\n") != std::string::npos)) || + (_lastRequest.find("\r\n0\r\n") != std::string::npos); } @@ -117,7 +117,7 @@ std::string HTTPSTestServer::handleRequest() const std::string response; response.reserve(16000); if (_lastRequest.substr(0, 10) == "GET /small" || - _lastRequest.substr(0, 11) == "HEAD /small") + _lastRequest.substr(0, 11) == "HEAD /small") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -131,8 +131,8 @@ std::string HTTPSTestServer::handleRequest() const response.append(body); } else if (_lastRequest.substr(0, 10) == "GET /large" || - _lastRequest.substr(0, 11) == "HEAD /large" || - _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") + _lastRequest.substr(0, 11) == "HEAD /large" || + _lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large") { std::string body(LARGE_BODY); response.append("HTTP/1.0 200 OK\r\n"); @@ -213,7 +213,7 @@ std::string HTTPSTestServer::handleRequest() const response.append("\r\n"); } else if (_lastRequest.substr(0, 5) == "GET /" || - _lastRequest.substr(0, 6) == "HEAD /") + _lastRequest.substr(0, 6) == "HEAD /") { std::string body(SMALL_BODY); response.append("HTTP/1.0 200 OK\r\n"); diff --git a/PageCompiler/src/PageReader.cpp b/PageCompiler/src/PageReader.cpp index eefd2925b..4d77d47d1 100644 --- a/PageCompiler/src/PageReader.cpp +++ b/PageCompiler/src/PageReader.cpp @@ -27,7 +27,7 @@ const std::string PageReader::ESC_EXPR_END(");\n"); PageReader::PageReader(Page& page, const std::string& path): _page(page), - _pParent(0), + _pParent(nullptr), _path(path), _line(0), _emitLineDirectives(false) diff --git a/PocoDoc/src/DocWriter.cpp b/PocoDoc/src/DocWriter.cpp index e4fe787e6..3b1af752d 100644 --- a/PocoDoc/src/DocWriter.cpp +++ b/PocoDoc/src/DocWriter.cpp @@ -52,7 +52,7 @@ using namespace Poco::CppParser; std::string DocWriter::_language; DocWriter::StringMap DocWriter::_strings; -Poco::Logger* DocWriter::_pLogger(0); +Poco::Logger* DocWriter::_pLogger(nullptr); const std::string DocWriter::RFC_URI("https://www.ietf.org/rfc/rfc"); const std::string DocWriter::GITHUB_POCO_URI("https://github.com/pocoproject/poco"); const std::string DocWriter::DATABASE_DIR("/dist/"); @@ -66,7 +66,7 @@ DocWriter::DocWriter(const NameSpace::SymbolTable& symbols, const std::string& p _literalMode(false), _symbols(symbols), _path(path), - _pNameSpace(0), + _pNameSpace(nullptr), _pendingLine(false), _indent(0), _titleId(0), @@ -2559,7 +2559,7 @@ NameSpace* DocWriter::rootNameSpace() const return pNS; } } - return 0; + return nullptr; } diff --git a/PocoDoc/src/PocoDoc.cpp b/PocoDoc/src/PocoDoc.cpp index 3e9bbbc94..fdef5cefd 100644 --- a/PocoDoc/src/PocoDoc.cpp +++ b/PocoDoc/src/PocoDoc.cpp @@ -293,7 +293,7 @@ protected: if (usePipe) { Poco::Pipe inPipe; - ProcessHandle proc = Process::launch(exec, args, 0, &inPipe, 0); + ProcessHandle proc = Process::launch(exec, args, nullptr, &inPipe, nullptr); return new Preprocessor(proc, new Poco::PipeInputStream(inPipe)); } else diff --git a/Redis/include/Poco/Redis/Array.h b/Redis/include/Poco/Redis/Array.h index 41a85b49b..4f581fe27 100644 --- a/Redis/include/Poco/Redis/Array.h +++ b/Redis/include/Poco/Redis/Array.h @@ -130,7 +130,7 @@ public: if ( RedisTypeTraits::TypeId == element->type() ) { auto* concrete = dynamic_cast* >(element.get()); - if ( concrete != NULL ) return concrete->value(); + if ( concrete != nullptr ) return concrete->value(); } throw BadCastException(); } diff --git a/Redis/include/Poco/Redis/Client.h b/Redis/include/Poco/Redis/Client.h index 009cd1899..b5586f7ee 100644 --- a/Redis/include/Poco/Redis/Client.h +++ b/Redis/include/Poco/Redis/Client.h @@ -177,7 +177,7 @@ public: if (redisResult->type() == RedisTypeTraits::TypeId) { Type* type = dynamic_cast*>(redisResult.get()); - if (type != NULL) result = type->value(); + if (type != nullptr) result = type->value(); } else throw BadCastException(); } diff --git a/Redis/src/Client.cpp b/Redis/src/Client.cpp index 7f2cb5fd6..cf0befc98 100644 --- a/Redis/src/Client.cpp +++ b/Redis/src/Client.cpp @@ -25,8 +25,8 @@ namespace Redis { Client::Client(): _address(), _socket(), - _input(0), - _output(0) + _input(nullptr), + _output(nullptr) { } @@ -34,8 +34,8 @@ Client::Client(): Client::Client(const std::string& hostAndPort): _address(hostAndPort), _socket(), - _input(0), - _output(0) + _input(nullptr), + _output(nullptr) { connect(); } @@ -44,8 +44,8 @@ Client::Client(const std::string& hostAndPort): Client::Client(const std::string& host, int port): _address(host, port), _socket(), - _input(0), - _output(0) + _input(nullptr), + _output(nullptr) { connect(); } @@ -54,8 +54,8 @@ Client::Client(const std::string& host, int port): Client::Client(const Net::SocketAddress& addrs): _address(addrs), _socket(), - _input(0), - _output(0) + _input(nullptr), + _output(nullptr) { connect(); } @@ -64,8 +64,8 @@ Client::Client(const Net::SocketAddress& addrs): Client::Client(const Net::StreamSocket& socket): _address(), _socket(), - _input(0), - _output(0) + _input(nullptr), + _output(nullptr) { connect(socket); } @@ -158,10 +158,10 @@ void Client::connect(const Poco::Net::StreamSocket& socket) void Client::disconnect() { delete _input; - _input = 0; + _input = nullptr; delete _output; - _output = 0; + _output = nullptr; _socket.close(); } @@ -169,7 +169,7 @@ void Client::disconnect() bool Client::isConnected() const { - return _input != 0; + return _input != nullptr; } diff --git a/Redis/src/RedisEventArgs.cpp b/Redis/src/RedisEventArgs.cpp index 014da2bb8..1c95cda21 100644 --- a/Redis/src/RedisEventArgs.cpp +++ b/Redis/src/RedisEventArgs.cpp @@ -23,7 +23,7 @@ namespace Redis { RedisEventArgs::RedisEventArgs(RedisType::Ptr pMessage): _message(pMessage), - _exception(0), + _exception(nullptr), _stop(false) { } @@ -31,7 +31,7 @@ RedisEventArgs::RedisEventArgs(RedisType::Ptr pMessage): RedisEventArgs::RedisEventArgs(Exception* pException): _message(), - _exception(pException ? pException->clone() : 0), + _exception(pException ? pException->clone() : nullptr), _stop(false) { } diff --git a/Redis/testsuite/src/RedisTest.cpp b/Redis/testsuite/src/RedisTest.cpp index 45e5900a3..f318983e1 100644 --- a/Redis/testsuite/src/RedisTest.cpp +++ b/Redis/testsuite/src/RedisTest.cpp @@ -1588,7 +1588,7 @@ public: if (!args.message().isNull()) { Type* arrayType = dynamic_cast*>(args.message().get()); - if (arrayType != NULL) + if (arrayType != nullptr) { Array& array = arrayType->value(); if (array.size() == 3) diff --git a/SevenZip/src/Archive.cpp b/SevenZip/src/Archive.cpp index 8a0dc1ff2..67addfbcd 100644 --- a/SevenZip/src/Archive.cpp +++ b/SevenZip/src/Archive.cpp @@ -95,7 +95,7 @@ public: if (entry.isFile()) { Poco::UInt32 blockIndex = 0; - Byte* pOutBuffer = 0; + Byte* pOutBuffer = nullptr; std::size_t outBufferSize = 0; std::size_t offset = 0; std::size_t extractedSize = 0; @@ -204,7 +204,7 @@ protected: Poco::UInt64 size = f->Size; std::vector utf16Path; - std::size_t utf16PathLen = SzArEx_GetFileNameUtf16(&_db, i, 0); + std::size_t utf16PathLen = SzArEx_GetFileNameUtf16(&_db, i, nullptr); utf16Path.resize(utf16PathLen, 0); utf16PathLen--; // we don't need terminating 0 later on SzArEx_GetFileNameUtf16(&_db, i, &utf16Path[0]); diff --git a/Util/include/Poco/Util/JSONConfiguration.h b/Util/include/Poco/Util/JSONConfiguration.h index 9f33675fb..ab4bb0f28 100644 --- a/Util/include/Poco/Util/JSONConfiguration.h +++ b/Util/include/Poco/Util/JSONConfiguration.h @@ -136,7 +136,7 @@ private: void setValue(const std::string& key, const Poco::Dynamic::Var& value); - JSON::Object::Ptr _object; + JSON::Object::Ptr _object; }; diff --git a/Util/include/Poco/Util/WinRegistryConfiguration.h b/Util/include/Poco/Util/WinRegistryConfiguration.h index 0dfebe2aa..9c35259b3 100644 --- a/Util/include/Poco/Util/WinRegistryConfiguration.h +++ b/Util/include/Poco/Util/WinRegistryConfiguration.h @@ -42,8 +42,8 @@ public: /// All further keys are relative to the root path and can be /// dot separated, e.g. the path MyService.ServiceName will be converted to /// HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyService\ServiceName. - /// The extraSam parameter will be passed along to WinRegistryKey, to control - /// registry virtualization for example. + /// The extraSam parameter will be passed along to WinRegistryKey, to control + /// registry virtualization for example. protected: ~WinRegistryConfiguration(); @@ -61,7 +61,7 @@ protected: friend class WinConfigurationTest; private: std::string _rootPath; - REGSAM _extraSam; + REGSAM _extraSam; }; diff --git a/Util/src/Application.cpp b/Util/src/Application.cpp index 9efecbf1a..599558f25 100644 --- a/Util/src/Application.cpp +++ b/Util/src/Application.cpp @@ -69,7 +69,7 @@ namespace Poco { namespace Util { -Application* Application::_pInstance = 0; +Application* Application::_pInstance = nullptr; Application::Application(): @@ -99,13 +99,13 @@ Application::Application(int argc, char* argv[]): Application::~Application() { - _pInstance = 0; + _pInstance = nullptr; } void Application::setup() { - poco_assert (_pInstance == 0); + poco_assert (_pInstance == nullptr); _pConfig->add(new SystemConfiguration, PRIO_SYSTEM, false); _pConfig->add(new MapConfiguration, PRIO_APPLICATION, true); @@ -344,18 +344,18 @@ Application::WindowSize Application::windowSize() #if defined(POCO_OS_FAMILY_WINDOWS) CONSOLE_SCREEN_BUFFER_INFO csbi; - if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) - { - size.width = csbi.srWindow.Right - csbi.srWindow.Left + 1; - size.height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; - } + if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) + { + size.width = csbi.srWindow.Right - csbi.srWindow.Left + 1; + size.height = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; + } #elif defined(POCO_OS_FAMILY_UNIX) struct winsize winsz; - if (ioctl(0, TIOCGWINSZ , &winsz) != -1) - { - size.width = winsz.ws_col; - size.height = winsz.ws_row; - } + if (ioctl(0, TIOCGWINSZ , &winsz) != -1) + { + size.width = winsz.ws_col; + size.height = winsz.ws_row; + } #endif return size; @@ -496,7 +496,7 @@ void Application::getApplicationPath(Poco::Path& appPath) const } #elif defined(POCO_OS_FAMILY_WINDOWS) wchar_t path[1024]; - int n = GetModuleFileNameW(0, path, sizeof(path)/sizeof(wchar_t)); + int n = GetModuleFileNameW(nullptr, path, sizeof(path)/sizeof(wchar_t)); if (n > 0) { std::string p; diff --git a/Util/src/LayeredConfiguration.cpp b/Util/src/LayeredConfiguration.cpp index c8ed78019..d3c18bd4e 100644 --- a/Util/src/LayeredConfiguration.cpp +++ b/Util/src/LayeredConfiguration.cpp @@ -110,7 +110,7 @@ AbstractConfiguration::Ptr LayeredConfiguration::find(const std::string& label) { if (conf.label == label) return conf.pConfig; } - return 0; + return nullptr; } diff --git a/Util/src/LoggingConfigurator.cpp b/Util/src/LoggingConfigurator.cpp index e05c7323a..321e2db13 100644 --- a/Util/src/LoggingConfigurator.cpp +++ b/Util/src/LoggingConfigurator.cpp @@ -145,7 +145,7 @@ Channel::Ptr LoggingConfigurator::createChannel(AbstractConfiguration::Ptr pConf } else if (p == "formatter"s) { - AutoPtr pFormattingChannel(new FormattingChannel(0, pChannel)); + AutoPtr pFormattingChannel(new FormattingChannel(nullptr, pChannel)); if (pConfig->hasProperty("formatter.class"s)) { AutoPtr pFormatterConfig(pConfig->createView(p)); diff --git a/Util/src/Option.cpp b/Util/src/Option.cpp index 5f7c4951d..f20a2c58a 100644 --- a/Util/src/Option.cpp +++ b/Util/src/Option.cpp @@ -31,8 +31,8 @@ Option::Option(): _required(false), _repeatable(false), _argRequired(false), - _pValidator(0), - _pCallback(0) + _pValidator(nullptr), + _pCallback(nullptr) { } @@ -62,8 +62,8 @@ Option::Option(const std::string& fullName, const std::string& shortName): _required(false), _repeatable(false), _argRequired(false), - _pValidator(0), - _pCallback(0) + _pValidator(nullptr), + _pCallback(nullptr) { } @@ -75,8 +75,8 @@ Option::Option(const std::string& fullName, const std::string& shortName, const _required(required), _repeatable(false), _argRequired(false), - _pValidator(0), - _pCallback(0) + _pValidator(nullptr), + _pCallback(nullptr) { } @@ -89,8 +89,8 @@ Option::Option(const std::string& fullName, const std::string& shortName, const _repeatable(false), _argName(argName), _argRequired(argRequired), - _pValidator(0), - _pCallback(0) + _pValidator(nullptr), + _pCallback(nullptr) { } @@ -190,7 +190,7 @@ Option& Option::group(const std::string& group) Option& Option::binding(const std::string& propertyName) { - return binding(propertyName, 0); + return binding(propertyName, nullptr); } diff --git a/Util/src/OptionSet.cpp b/Util/src/OptionSet.cpp index 3cf6b2ccc..ddb545288 100644 --- a/Util/src/OptionSet.cpp +++ b/Util/src/OptionSet.cpp @@ -81,7 +81,7 @@ bool OptionSet::hasOption(const std::string& name, bool matchShort) const const Option& OptionSet::getOption(const std::string& name, bool matchShort) const { - const Option* pOption = 0; + const Option* pOption = nullptr; for (const auto& opt: _options) { if ((matchShort && opt.matchesShort(name)) || (!matchShort && opt.matchesPartial(name))) diff --git a/Util/src/ServerApplication.cpp b/Util/src/ServerApplication.cpp index c11fff60c..1c8cb4405 100644 --- a/Util/src/ServerApplication.cpp +++ b/Util/src/ServerApplication.cpp @@ -57,7 +57,7 @@ namespace Util { Poco::NamedEvent ServerApplication::_terminate(Poco::ProcessImpl::terminationEventName(Poco::Process::id())); Poco::Event ServerApplication::_terminated; SERVICE_STATUS ServerApplication::_serviceStatus; -SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = 0; +SERVICE_STATUS_HANDLE ServerApplication::_serviceStatusHandle = nullptr; #endif #if defined(POCO_VXWORKS) || POCO_OS == POCO_OS_ANDROID Poco::Event ServerApplication::_terminate; @@ -336,8 +336,8 @@ bool ServerApplication::isService() wchar_t name[] = L""; svcDispatchTable[0].lpServiceName = name; svcDispatchTable[0].lpServiceProc = ServiceMain; - svcDispatchTable[1].lpServiceName = NULL; - svcDispatchTable[1].lpServiceProc = NULL; + svcDispatchTable[1].lpServiceName = nullptr; + svcDispatchTable[1].lpServiceProc = nullptr; return StartServiceCtrlDispatcherW(svcDispatchTable) != 0; } @@ -345,7 +345,7 @@ bool ServerApplication::isService() bool ServerApplication::hasConsole() { HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); - return hStdOut != INVALID_HANDLE_VALUE && hStdOut != NULL; + return hStdOut != INVALID_HANDLE_VALUE && hStdOut != nullptr; } diff --git a/Util/src/WinRegistryKey.cpp b/Util/src/WinRegistryKey.cpp index 960e8f728..369b04009 100644 --- a/Util/src/WinRegistryKey.cpp +++ b/Util/src/WinRegistryKey.cpp @@ -54,7 +54,7 @@ namespace WinRegistryKey::WinRegistryKey(const std::string& key, bool readOnly, REGSAM extraSam): - _hKey(0), + _hKey(nullptr), _readOnly(readOnly), _extraSam(extraSam) { @@ -72,7 +72,7 @@ WinRegistryKey::WinRegistryKey(const std::string& key, bool readOnly, REGSAM ext WinRegistryKey::WinRegistryKey(HKEY hRootKey, const std::string& subKey, bool readOnly, REGSAM extraSam): _hRootKey(hRootKey), _subKey(subKey), - _hKey(0), + _hKey(nullptr), _readOnly(readOnly), _extraSam(extraSam) { @@ -104,13 +104,13 @@ std::string WinRegistryKey::getString(const std::string& name) DWORD size; std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_LINK)) + if (RegQueryValueExW(_hKey, uname.c_str(), nullptr, &type, nullptr, &size) != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_LINK)) throw NotFoundException(key(name)); if (size > 0) { DWORD len = size/2; Poco::Buffer buffer(len + 1); - RegQueryValueExW(_hKey, uname.c_str(), NULL, NULL, (BYTE*) buffer.begin(), &size); + RegQueryValueExW(_hKey, uname.c_str(), nullptr, nullptr, (BYTE*) buffer.begin(), &size); buffer[len] = 0; std::wstring uresult(buffer.begin()); std::string result; @@ -140,13 +140,13 @@ std::string WinRegistryKey::getStringExpand(const std::string& name) DWORD size; std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_LINK)) + if (RegQueryValueExW(_hKey, uname.c_str(), nullptr, &type, nullptr, &size) != ERROR_SUCCESS || (type != REG_SZ && type != REG_EXPAND_SZ && type != REG_LINK)) throw NotFoundException(key(name)); if (size > 0) { DWORD len = size/2; Poco::Buffer buffer(len + 1); - RegQueryValueExW(_hKey, uname.c_str(), NULL, NULL, (BYTE*) buffer.begin(), &size); + RegQueryValueExW(_hKey, uname.c_str(), nullptr, nullptr, (BYTE*) buffer.begin(), &size); buffer[len] = 0; wchar_t temp; @@ -182,12 +182,12 @@ std::vector WinRegistryKey::getBinary( const std::string& name ) std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS || type != REG_BINARY) + if (RegQueryValueExW(_hKey, uname.c_str(), nullptr, &type, nullptr, &size) != ERROR_SUCCESS || type != REG_BINARY) throw NotFoundException(key(name)); if (size > 0) { result.resize(size); - RegQueryValueExW(_hKey, uname.c_str(), NULL, NULL, (BYTE*) &result[0], &size); + RegQueryValueExW(_hKey, uname.c_str(), nullptr, nullptr, (BYTE*) &result[0], &size); } return result; } @@ -212,7 +212,7 @@ int WinRegistryKey::getInt(const std::string& name) DWORD size = sizeof(data); std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, (BYTE*) &data, &size) != ERROR_SUCCESS || (type != REG_DWORD && type != REG_DWORD_BIG_ENDIAN)) + if (RegQueryValueExW(_hKey, uname.c_str(), nullptr, &type, (BYTE*) &data, &size) != ERROR_SUCCESS || (type != REG_DWORD && type != REG_DWORD_BIG_ENDIAN)) throw NotFoundException(key(name)); return data; } @@ -238,7 +238,7 @@ Poco::Int64 WinRegistryKey::getInt64(const std::string& name) DWORD size = sizeof(data); std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, (BYTE*) &data, &size) != ERROR_SUCCESS || type != REG_QWORD) + if (RegQueryValueExW(_hKey, uname.c_str(), nullptr, &type, (BYTE*) &data, &size) != ERROR_SUCCESS || type != REG_QWORD) throw NotFoundException(key(name)); return data; } @@ -320,7 +320,7 @@ WinRegistryKey::Type WinRegistryKey::type(const std::string& name) DWORD size; std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - if (RegQueryValueExW(_hKey, uname.c_str(), NULL, &type, NULL, &size) != ERROR_SUCCESS) + if (RegQueryValueExW(_hKey, uname.c_str(), nullptr, &type, nullptr, &size) != ERROR_SUCCESS) throw NotFoundException(key(name)); Type aType = (Type)type; @@ -338,7 +338,7 @@ bool WinRegistryKey::exists(const std::string& name) { std::wstring uname; Poco::UnicodeConverter::toUTF16(name, uname); - exists = RegQueryValueExW(hKey, uname.c_str(), NULL, NULL, NULL, NULL) == ERROR_SUCCESS; + exists = RegQueryValueExW(hKey, uname.c_str(), nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS; RegCloseKey(hKey); } return exists; @@ -358,7 +358,7 @@ void WinRegistryKey::open() } else { - if (RegCreateKeyExW(_hRootKey, usubKey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE | _extraSam, NULL, &_hKey, NULL) != ERROR_SUCCESS) + if (RegCreateKeyExW(_hRootKey, usubKey.c_str(), 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE | _extraSam, nullptr, &_hKey, nullptr) != ERROR_SUCCESS) throw SystemException("Cannot open registry key: ", key()); } } @@ -370,7 +370,7 @@ void WinRegistryKey::close() if (_hKey) { RegCloseKey(_hKey); - _hKey = 0; + _hKey = nullptr; } } @@ -458,14 +458,14 @@ void WinRegistryKey::subKeys(WinRegistryKey::Keys& keys) DWORD subKeyCount = 0; DWORD valueCount = 0; - if (RegQueryInfoKey(_hKey, NULL, NULL, NULL, &subKeyCount, NULL, NULL, &valueCount, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) + if (RegQueryInfoKey(_hKey, nullptr, nullptr, nullptr, &subKeyCount, nullptr, nullptr, &valueCount, nullptr, nullptr, nullptr, nullptr) != ERROR_SUCCESS) return; wchar_t buf[256]; DWORD bufSize = sizeof(buf)/sizeof(wchar_t); for (DWORD i = 0; i< subKeyCount; ++i) { - if (RegEnumKeyExW(_hKey, i, buf, &bufSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + if (RegEnumKeyExW(_hKey, i, buf, &bufSize, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS) { std::wstring uname(buf); std::string name; @@ -483,14 +483,14 @@ void WinRegistryKey::values(WinRegistryKey::Values& vals) DWORD valueCount = 0; - if (RegQueryInfoKey(_hKey, NULL, NULL, NULL, NULL, NULL, NULL, &valueCount, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) + if (RegQueryInfoKey(_hKey, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, &valueCount, nullptr, nullptr, nullptr, nullptr) != ERROR_SUCCESS) return ; wchar_t buf[256]; DWORD bufSize = sizeof(buf)/sizeof(wchar_t); for (DWORD i = 0; i< valueCount; ++i) { - if (RegEnumValueW(_hKey, i, buf, &bufSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + if (RegEnumValueW(_hKey, i, buf, &bufSize, nullptr, nullptr, nullptr, nullptr) == ERROR_SUCCESS) { std::wstring uname(buf); std::string name; diff --git a/Util/src/WinService.cpp b/Util/src/WinService.cpp index b2a9d8f6c..0a4b88ba1 100644 --- a/Util/src/WinService.cpp +++ b/Util/src/WinService.cpp @@ -36,9 +36,9 @@ const std::string WinService::REGISTRY_DESCRIPTION("Description"); WinService::WinService(const std::string& name): _name(name), - _svcHandle(0) + _svcHandle(nullptr) { - _scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + _scmHandle = OpenSCManager(nullptr, nullptr, SC_MANAGER_ALL_ACCESS); if (!_scmHandle) throw SystemException("cannot open Service Control Manager"); } @@ -46,7 +46,7 @@ WinService::WinService(const std::string& name): WinService::WinService(SC_HANDLE scmHandle, const std::string& name): _scmHandle(scmHandle), _name(name), - _svcHandle(0) + _svcHandle(nullptr) { if (!_scmHandle) throw SystemException("Service Control Manager not connected"); } @@ -105,7 +105,7 @@ void WinService::registerService(const std::string& path, const std::string& dis SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, upath.c_str(), - NULL, NULL, NULL, NULL, NULL); + nullptr, nullptr, nullptr, nullptr, nullptr); if (!_svcHandle) throw SystemException("cannot register service", _name); } @@ -154,7 +154,7 @@ bool WinService::isStopped() const void WinService::start() { open(); - if (!StartService(_svcHandle, 0, NULL)) + if (!StartService(_svcHandle, 0, nullptr)) throw SystemException("cannot start service", _name); SERVICE_STATUS svcStatus; @@ -200,7 +200,7 @@ void WinService::setStartup(WinService::Startup startup) default: startType = SERVICE_NO_CHANGE; } - if (!ChangeServiceConfig(_svcHandle, SERVICE_NO_CHANGE, startType, SERVICE_NO_CHANGE, NULL, NULL, NULL, NULL, NULL, NULL, NULL)) + if (!ChangeServiceConfig(_svcHandle, SERVICE_NO_CHANGE, startType, SERVICE_NO_CHANGE, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { throw SystemException("cannot change service startup mode"); } @@ -242,8 +242,8 @@ void WinService::setFailureActions(FailureActionVector failureActions, const std open(); auto actions = new SC_ACTION[failureActions.size()]; SERVICE_FAILURE_ACTIONSW ac; - ac.lpCommand = NULL; - ac.lpRebootMsg = NULL; + ac.lpCommand = nullptr; + ac.lpRebootMsg = nullptr; std::wstring urebootMessage; Poco::UnicodeConverter::toUTF16(rebootMessage, urebootMessage); @@ -374,7 +374,7 @@ bool WinService::tryOpen() const Poco::UnicodeConverter::toUTF16(_name, uname); _svcHandle = OpenServiceW(_scmHandle, uname.c_str(), SERVICE_ALL_ACCESS); } - return _svcHandle != 0; + return _svcHandle != nullptr; } @@ -383,7 +383,7 @@ void WinService::close() const if (_svcHandle) { CloseServiceHandle(_svcHandle); - _svcHandle = 0; + _svcHandle = nullptr; } } diff --git a/Util/src/XMLConfiguration.cpp b/Util/src/XMLConfiguration.cpp index 38a5e2ff7..2dc543960 100644 --- a/Util/src/XMLConfiguration.cpp +++ b/Util/src/XMLConfiguration.cpp @@ -253,29 +253,29 @@ void XMLConfiguration::setRaw(const std::string& key, const std::string& value) Poco::XML::Node* pNode = findNode(it, key.end(), _pRoot, true); if (pNode) { - unsigned short nodeType = pNode->nodeType(); - if (Poco::XML::Node::ATTRIBUTE_NODE == nodeType) - { - pNode->setNodeValue(value); - } - else if (Poco::XML::Node::ELEMENT_NODE == nodeType) - { - Poco::XML::Node* pChildNode = pNode->firstChild(); - if (pChildNode) - { - if (Poco::XML::Node::TEXT_NODE == pChildNode->nodeType()) - { - pChildNode->setNodeValue(value); - } - } - else - { + unsigned short nodeType = pNode->nodeType(); + if (Poco::XML::Node::ATTRIBUTE_NODE == nodeType) + { + pNode->setNodeValue(value); + } + else if (Poco::XML::Node::ELEMENT_NODE == nodeType) + { + Poco::XML::Node* pChildNode = pNode->firstChild(); + if (pChildNode) + { + if (Poco::XML::Node::TEXT_NODE == pChildNode->nodeType()) + { + pChildNode->setNodeValue(value); + } + } + else + { Poco::AutoPtr pText = _pDocument->createTextNode(value); pNode->appendChild(pText); - } - } + } + } } - else throw NotFoundException("Node not found in XMLConfiguration", key); + else throw NotFoundException("Node not found in XMLConfiguration", key); } @@ -419,7 +419,7 @@ Poco::XML::Node* XMLConfiguration::findElement(const std::string& name, Poco::XM pNode->appendChild(pElem); return pElem; } - else return 0; + else return nullptr; } @@ -475,7 +475,7 @@ Poco::XML::Node* XMLConfiguration::findElement(const std::string& attr, const st Poco::XML::Node* XMLConfiguration::findAttribute(const std::string& name, Poco::XML::Node* pNode, bool create) { - Poco::XML::Node* pResult(0); + Poco::XML::Node* pResult(nullptr); Poco::XML::Element* pElem = dynamic_cast(pNode); if (pElem) { diff --git a/Util/testsuite/src/LocalConfigurationViewTest.cpp b/Util/testsuite/src/LocalConfigurationViewTest.cpp index 94f2f852a..6af0fea95 100644 --- a/Util/testsuite/src/LocalConfigurationViewTest.cpp +++ b/Util/testsuite/src/LocalConfigurationViewTest.cpp @@ -28,74 +28,74 @@ LocalConfigurationViewTest::~LocalConfigurationViewTest() { } void LocalConfigurationViewTest::testLocalView() { - AbstractConfiguration::Ptr pConf = createConfiguration(); - AbstractConfiguration::Ptr pView = pConf->createLocalView(""); - assertTrue(pView->hasProperty("prop1")); - assertTrue(pView->hasProperty("prop2")); + AbstractConfiguration::Ptr pConf = createConfiguration(); + AbstractConfiguration::Ptr pView = pConf->createLocalView(""); + assertTrue(pView->hasProperty("prop1")); + assertTrue(pView->hasProperty("prop2")); - AbstractConfiguration::Keys keys; - pView->keys(keys); - assertTrue(keys.size() == 13); - assertTrue(std::find(keys.begin(), keys.end(), "prop1") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "prop2") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "prop3") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "prop4") != keys.end()); + AbstractConfiguration::Keys keys; + pView->keys(keys); + assertTrue(keys.size() == 13); + assertTrue(std::find(keys.begin(), keys.end(), "prop1") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "prop2") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "prop3") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "prop4") != keys.end()); - assertTrue(pView->getString("prop1") == "foo"); - assertTrue(pView->getString("prop3.string1") == "foo"); + assertTrue(pView->getString("prop1") == "foo"); + assertTrue(pView->getString("prop3.string1") == "foo"); - pView->setString("prop6", "foobar"); - assertTrue(pConf->getString("prop6") == "foobar"); + pView->setString("prop6", "foobar"); + assertTrue(pConf->getString("prop6") == "foobar"); - pView = pConf->createLocalView("prop1"); - pView->keys(keys); - assertTrue(keys.empty()); - assertFalse(pView->hasProperty("prop1")); + pView = pConf->createLocalView("prop1"); + pView->keys(keys); + assertTrue(keys.empty()); + assertFalse(pView->hasProperty("prop1")); - pView->setString("prop11", "foobar"); - assertTrue(pConf->getString("prop1.prop11") == "foobar"); + pView->setString("prop11", "foobar"); + assertTrue(pConf->getString("prop1.prop11") == "foobar"); - pView = pConf->createLocalView("prop3"); - pView->keys(keys); - assertTrue(keys.size() == 2); - assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "string2") != keys.end()); + pView = pConf->createLocalView("prop3"); + pView->keys(keys); + assertTrue(keys.size() == 2); + assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "string2") != keys.end()); - assertTrue(pView->getString("string1") == "foo"); - assertTrue(pView->getString("string2") == "bar"); + assertTrue(pView->getString("string1") == "foo"); + assertTrue(pView->getString("string2") == "bar"); - pView->setString("string3", "foobar"); - assertTrue(pConf->getString("prop3.string3") == "foobar"); + pView->setString("string3", "foobar"); + assertTrue(pConf->getString("prop3.string3") == "foobar"); - pView = pConf->createLocalView("prop5"); - pView->keys(keys); - assertTrue(keys.size() == 4); - assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "sub1") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "sub2") != keys.end()); + pView = pConf->createLocalView("prop5"); + pView->keys(keys); + assertTrue(keys.size() == 4); + assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "sub1") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "sub2") != keys.end()); - assertTrue(pView->getString("sub1.string1") == "FOO"); - assertTrue(pView->getString("sub2.string2") == "Bar"); + assertTrue(pView->getString("sub1.string1") == "FOO"); + assertTrue(pView->getString("sub2.string2") == "Bar"); - pView = pConf->createLocalView("prop5.sub1"); - pView->keys(keys); - assertTrue(keys.size() == 2); - assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); - assertTrue(std::find(keys.begin(), keys.end(), "string2") != keys.end()); + pView = pConf->createLocalView("prop5.sub1"); + pView->keys(keys); + assertTrue(keys.size() == 2); + assertTrue(std::find(keys.begin(), keys.end(), "string1") != keys.end()); + assertTrue(std::find(keys.begin(), keys.end(), "string2") != keys.end()); - assertTrue(pView->getString("string1") == "FOO"); - assertTrue(pView->getString("string2") == "BAR"); + assertTrue(pView->getString("string1") == "FOO"); + assertTrue(pView->getString("string2") == "BAR"); - pView->setString("string3", "foobar"); - assertTrue(pConf->getString("prop5.sub1.string3") == "foobar"); + pView->setString("string3", "foobar"); + assertTrue(pConf->getString("prop5.sub1.string3") == "foobar"); - pView->remove("string3"); - assertTrue(!pConf->hasProperty("prop5.sub1.string3")); + pView->remove("string3"); + assertTrue(!pConf->hasProperty("prop5.sub1.string3")); } AbstractConfiguration::Ptr LocalConfigurationViewTest::allocConfiguration() const { - return new MapConfiguration; + return new MapConfiguration; } void LocalConfigurationViewTest::setUp() { @@ -105,10 +105,10 @@ void LocalConfigurationViewTest::tearDown() { } CppUnit::Test* LocalConfigurationViewTest::suite() { - CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LocalConfigurationViewTest"); + CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("LocalConfigurationViewTest"); - AbstractConfigurationTest_addTests(pSuite, LocalConfigurationViewTest); - CppUnit_addTest(pSuite, LocalConfigurationViewTest, testLocalView); + AbstractConfigurationTest_addTests(pSuite, LocalConfigurationViewTest); + CppUnit_addTest(pSuite, LocalConfigurationViewTest, testLocalView); - return pSuite; + return pSuite; } diff --git a/Util/testsuite/src/LocalConfigurationViewTest.h b/Util/testsuite/src/LocalConfigurationViewTest.h index 34b67756b..63487600b 100644 --- a/Util/testsuite/src/LocalConfigurationViewTest.h +++ b/Util/testsuite/src/LocalConfigurationViewTest.h @@ -17,18 +17,18 @@ class LocalConfigurationViewTest : public AbstractConfigurationTest { public: - LocalConfigurationViewTest(const std::string& name); - virtual ~LocalConfigurationViewTest(); + LocalConfigurationViewTest(const std::string& name); + virtual ~LocalConfigurationViewTest(); - void testLocalView(); + void testLocalView(); - void setUp(); - void tearDown(); + void setUp(); + void tearDown(); - static CppUnit::Test* suite(); + static CppUnit::Test* suite(); private: - virtual Poco::Util::AbstractConfiguration::Ptr allocConfiguration() const; + virtual Poco::Util::AbstractConfiguration::Ptr allocConfiguration() const; }; #endif // LocalConfigurationViewTest_INCLUDED diff --git a/Util/testsuite/src/PropertyFileConfigurationTest.cpp b/Util/testsuite/src/PropertyFileConfigurationTest.cpp index 1a6919fa4..a78957a76 100644 --- a/Util/testsuite/src/PropertyFileConfigurationTest.cpp +++ b/Util/testsuite/src/PropertyFileConfigurationTest.cpp @@ -114,8 +114,8 @@ void PropertyFileConfigurationTest::testSave() pConf->save(ostr); std::string propFile = ostr.str(); assertTrue (propFile == "prop1: value1\n" - "prop2: 42\n" - "prop3: value\\\\1\\txxx\n"); + "prop2: 42\n" + "prop3: value\\\\1\\txxx\n"); } diff --git a/Util/testsuite/src/WinServiceTest.cpp b/Util/testsuite/src/WinServiceTest.cpp index c2453a01a..fe73e8421 100644 --- a/Util/testsuite/src/WinServiceTest.cpp +++ b/Util/testsuite/src/WinServiceTest.cpp @@ -18,7 +18,7 @@ WinServiceTest::~WinServiceTest() void WinServiceTest::testServiceCouldCreatedWithExistingConnection() { - SC_HANDLE scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); + SC_HANDLE scmHandle = OpenSCManager(nullptr, nullptr, SC_MANAGER_ALL_ACCESS); assertTrue(scmHandle); diff --git a/XML/include/Poco/DOM/DOMBuilder.h b/XML/include/Poco/DOM/DOMBuilder.h index 08552b54e..92bd225fb 100644 --- a/XML/include/Poco/DOM/DOMBuilder.h +++ b/XML/include/Poco/DOM/DOMBuilder.h @@ -46,7 +46,7 @@ class XML_API DOMBuilder: protected DTDHandler, protected ContentHandler, protec /// must be supplied to the DOMBuilder. { public: - DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = 0, std::size_t maxDepth = 0); + DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool = nullptr, std::size_t maxDepth = 0); /// Creates a DOMBuilder using the given XMLReader. /// If a NamePool is given, it becomes the Document's NamePool. /// diff --git a/XML/include/Poco/DOM/DOMParser.h b/XML/include/Poco/DOM/DOMParser.h index 6c053be37..1e91e0d57 100644 --- a/XML/include/Poco/DOM/DOMParser.h +++ b/XML/include/Poco/DOM/DOMParser.h @@ -38,7 +38,7 @@ class XML_API DOMParser /// support of a WhitespaceFilter. { public: - explicit DOMParser(NamePool* pNamePool = 0); + explicit DOMParser(NamePool* pNamePool = nullptr); /// Creates a new DOMParser. /// If a NamePool is given, it becomes the Document's NamePool. diff --git a/XML/include/Poco/DOM/Document.h b/XML/include/Poco/DOM/Document.h index 91754ea59..b197061f7 100644 --- a/XML/include/Poco/DOM/Document.h +++ b/XML/include/Poco/DOM/Document.h @@ -60,7 +60,7 @@ class XML_API Document: public AbstractContainerNode, public DocumentEvent public: using AutoReleasePool = Poco::AutoReleasePool; - explicit Document(NamePool* pNamePool = 0); + explicit Document(NamePool* pNamePool = nullptr); /// Creates a new document. If pNamePool == 0, the document /// creates its own name pool, otherwise it uses the given name pool. /// Sharing a name pool makes sense for documents containing instances @@ -70,7 +70,7 @@ public: /// Creates a new document using a name pool with the given size, which /// should be a prime number (e.g., 251, 509, 1021, 4093). - Document(DocumentType* pDocumentType, NamePool* pNamePool = 0); + Document(DocumentType* pDocumentType, NamePool* pNamePool = nullptr); /// Creates a new document. If pNamePool == 0, the document /// creates its own name pool, otherwise it uses the given name pool. /// Sharing a name pool makes sense for documents containing instances diff --git a/XML/include/Poco/DOM/NodeIterator.h b/XML/include/Poco/DOM/NodeIterator.h index a1997bcc1..e51810e29 100644 --- a/XML/include/Poco/DOM/NodeIterator.h +++ b/XML/include/Poco/DOM/NodeIterator.h @@ -46,7 +46,7 @@ class XML_API NodeIterator /// not conform to the DOM Level 2 Traversal specification. { public: - NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0); + NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFilter = nullptr); /// Creates a NodeIterator over the subtree rooted at the specified node. NodeIterator(const NodeIterator& iterator); diff --git a/XML/include/Poco/DOM/TreeWalker.h b/XML/include/Poco/DOM/TreeWalker.h index 738c61ea4..87250517e 100644 --- a/XML/include/Poco/DOM/TreeWalker.h +++ b/XML/include/Poco/DOM/TreeWalker.h @@ -54,7 +54,7 @@ class XML_API TreeWalker /// does not conform to the DOM Level 2 Traversal specification. { public: - TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter = 0); + TreeWalker(Node* root, unsigned long whatToShow, NodeFilter* pFilter = nullptr); /// Creates a TreeWalker over the subtree rooted at the specified node. TreeWalker(const TreeWalker& walker); diff --git a/XML/include/Poco/XML/XMLStreamParser.h b/XML/include/Poco/XML/XMLStreamParser.h index 125621193..e965ea42f 100644 --- a/XML/include/Poco/XML/XMLStreamParser.h +++ b/XML/include/Poco/XML/XMLStreamParser.h @@ -130,7 +130,7 @@ public: { using value_type = EventType; - Iterator(XMLStreamParser* p = 0, EventType e = EV_EOF): + Iterator(XMLStreamParser* p = nullptr, EventType e = EV_EOF): _parser(p), _e(e) { @@ -596,7 +596,7 @@ inline Content XMLStreamParser::content() const inline const XMLStreamParser::ElementEntry* XMLStreamParser::getElement() const { - return _elementState.empty() ? 0 : getElementImpl(); + return _elementState.empty() ? nullptr : getElementImpl(); } diff --git a/XML/src/AbstractContainerNode.cpp b/XML/src/AbstractContainerNode.cpp index 9232b83d9..6fae9b979 100644 --- a/XML/src/AbstractContainerNode.cpp +++ b/XML/src/AbstractContainerNode.cpp @@ -32,14 +32,14 @@ const XMLString AbstractContainerNode::WILDCARD(toXMLString("*")); AbstractContainerNode::AbstractContainerNode(Document* pOwnerDocument): AbstractNode(pOwnerDocument), - _pFirstChild(0) + _pFirstChild(nullptr) { } AbstractContainerNode::AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node): AbstractNode(pOwnerDocument, node), - _pFirstChild(0) + _pFirstChild(nullptr) { } @@ -72,7 +72,7 @@ Node* AbstractContainerNode::lastChild() const while (pChild->_pNext) pChild = pChild->_pNext; return pChild; } - return 0; + return nullptr; } @@ -343,7 +343,7 @@ Node* AbstractContainerNode::removeChild(Node* oldChild) Node* AbstractContainerNode::appendChild(Node* newChild) { - return insertBefore(newChild, 0); + return insertBefore(newChild, nullptr); } @@ -402,13 +402,13 @@ Node* AbstractContainerNode::getNodeByPath(const XMLString& path) const for (unsigned long i = 0; i < length; i++) { XMLString::const_iterator beg = it; - const Node* pNode = findNode(beg, path.end(), pList->item(i), 0, indexBound); + const Node* pNode = findNode(beg, path.end(), pList->item(i), nullptr, indexBound); if (pNode) return const_cast(pNode); } - return 0; + return nullptr; } } - return const_cast(findNode(it, path.end(), this, 0, indexBound)); + return const_cast(findNode(it, path.end(), this, nullptr, indexBound)); } @@ -448,7 +448,7 @@ Node* AbstractContainerNode::getNodeByPathNS(const XMLString& path, const NSMap& if (pNode) return const_cast(pNode); } } - return 0; + return nullptr; } } return const_cast(findNode(it, path.end(), this, &nsMap, indexBound)); @@ -540,7 +540,7 @@ const Node* AbstractContainerNode::findElement(const XMLString& name, const Node return pNode; pNode = pNode->nextSibling(); } - return 0; + return nullptr; } @@ -586,7 +586,7 @@ const Node* AbstractContainerNode::findElement(const XMLString& attr, const XMLS const Attr* AbstractContainerNode::findAttribute(const XMLString& name, const Node* pNode, const NSMap* pNSMap) { - const Attr* pResult(0); + const Attr* pResult(nullptr); const Element* pElem = dynamic_cast(pNode); if (pElem) { diff --git a/XML/src/AbstractNode.cpp b/XML/src/AbstractNode.cpp index 7e2e2e6d6..ffc2ce8a2 100644 --- a/XML/src/AbstractNode.cpp +++ b/XML/src/AbstractNode.cpp @@ -33,19 +33,19 @@ const XMLString AbstractNode::EMPTY_STRING; AbstractNode::AbstractNode(Document* pOwnerDocument): - _pParent(0), - _pNext(0), + _pParent(nullptr), + _pNext(nullptr), _pOwner(pOwnerDocument), - _pEventDispatcher(0) + _pEventDispatcher(nullptr) { } AbstractNode::AbstractNode(Document* pOwnerDocument, const AbstractNode& node): - _pParent(0), - _pNext(0), + _pParent(nullptr), + _pNext(nullptr), _pOwner(pOwnerDocument), - _pEventDispatcher(0) + _pEventDispatcher(nullptr) { } @@ -95,13 +95,13 @@ NodeList* AbstractNode::childNodes() const Node* AbstractNode::firstChild() const { - return 0; + return nullptr; } Node* AbstractNode::lastChild() const { - return 0; + return nullptr; } @@ -116,7 +116,7 @@ Node* AbstractNode::previousSibling() const pSibling = pSibling->_pNext; } } - return 0; + return nullptr; } @@ -128,7 +128,7 @@ Node* AbstractNode::nextSibling() const NamedNodeMap* AbstractNode::attributes() const { - return 0; + return nullptr; } @@ -223,13 +223,13 @@ XMLString AbstractNode::innerText() const Node* AbstractNode::getNodeByPath(const XMLString& path) const { - return 0; + return nullptr; } Node* AbstractNode::getNodeByPathNS(const XMLString& path, const NSMap& nsMap) const { - return 0; + return nullptr; } @@ -305,7 +305,7 @@ void AbstractNode::bubbleEvent(Event* evt) void AbstractNode::dispatchSubtreeModified() { - AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMSubtreeModified, this, true, false, 0); + AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMSubtreeModified, this, true, false, nullptr); dispatchEvent(pEvent.get()); } @@ -326,14 +326,14 @@ void AbstractNode::dispatchNodeRemoved() void AbstractNode::dispatchNodeRemovedFromDocument() { - AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeRemovedFromDocument, this, false, false, 0); + AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeRemovedFromDocument, this, false, false, nullptr); dispatchEvent(pEvent.get()); } void AbstractNode::dispatchNodeInsertedIntoDocument() { - AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeInsertedIntoDocument, this, false, false, 0); + AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMNodeInsertedIntoDocument, this, false, false, nullptr); dispatchEvent(pEvent.get()); } @@ -347,7 +347,7 @@ void AbstractNode::dispatchAttrModified(Attr* pAttr, MutationEvent::AttrChangeTy void AbstractNode::dispatchCharacterDataModified(const XMLString& prevValue, const XMLString& newValue) { - AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMCharacterDataModified, this, true, false, 0, prevValue, newValue, EMPTY_STRING, MutationEvent::MODIFICATION); + AutoPtr pEvent = new MutationEvent(_pOwner, MutationEvent::DOMCharacterDataModified, this, true, false, nullptr, prevValue, newValue, EMPTY_STRING, MutationEvent::MODIFICATION); dispatchEvent(pEvent.get()); } diff --git a/XML/src/Attr.cpp b/XML/src/Attr.cpp index 15c9e1688..8ebe3740f 100644 --- a/XML/src/Attr.cpp +++ b/XML/src/Attr.cpp @@ -56,7 +56,7 @@ void Attr::setValue(const XMLString& value) Node* Attr::parentNode() const { - return 0; + return nullptr; } @@ -72,7 +72,7 @@ Node* Attr::previousSibling() const } return pSibling; } - return 0; + return nullptr; } diff --git a/XML/src/AttrMap.cpp b/XML/src/AttrMap.cpp index 8c14227c5..527f146b8 100644 --- a/XML/src/AttrMap.cpp +++ b/XML/src/AttrMap.cpp @@ -61,7 +61,7 @@ Node* AttrMap::removeNamedItem(const XMLString& name) if (pAttr) return _pElement->removeAttributeNode(pAttr); else - return 0; + return nullptr; } @@ -109,7 +109,7 @@ Node* AttrMap::removeNamedItemNS(const XMLString& namespaceURI, const XMLString& if (pAttr) return _pElement->removeAttributeNode(pAttr); else - return 0; + return nullptr; } diff --git a/XML/src/AttributesImpl.cpp b/XML/src/AttributesImpl.cpp index ad1c7baa9..f833d38f2 100644 --- a/XML/src/AttributesImpl.cpp +++ b/XML/src/AttributesImpl.cpp @@ -281,7 +281,7 @@ AttributesImpl::Attribute* AttributesImpl::find(const XMLString& qname) const if (it->qname == qname) return const_cast(&(*it)); } - return 0; + return nullptr; } @@ -292,7 +292,7 @@ AttributesImpl::Attribute* AttributesImpl::find(const XMLString& namespaceURI, c if (it->namespaceURI == namespaceURI && it->localName == localName) return const_cast(&(*it)); } - return 0; + return nullptr; } diff --git a/XML/src/DOMBuilder.cpp b/XML/src/DOMBuilder.cpp index 846e810d3..bbd2cb715 100644 --- a/XML/src/DOMBuilder.cpp +++ b/XML/src/DOMBuilder.cpp @@ -42,9 +42,9 @@ DOMBuilder::DOMBuilder(XMLReader& xmlReader, NamePool* pNamePool, std::size_t ma _xmlReader(xmlReader), _pNamePool(pNamePool), _maxDepth(maxDepth), - _pDocument(0), - _pParent(0), - _pPrevious(0), + _pDocument(nullptr), + _pParent(nullptr), + _pPrevious(nullptr), _inCDATA(false), _namespaces(true), _depth(0) @@ -200,7 +200,7 @@ void DOMBuilder::startElement(const XMLString& uri, const XMLString& localName, Attr* pPrevAttr = nullptr; for (const auto& attr: attrs) { - AutoPtr pAttr = new Attr(_pDocument, 0, attr.namespaceURI, attr.localName, attr.qname, attr.value, attr.specified); + AutoPtr pAttr = new Attr(_pDocument, nullptr, attr.namespaceURI, attr.localName, attr.qname, attr.value, attr.specified); pPrevAttr = pElem->addAttributeNodeNP(pPrevAttr, pAttr); } appendNode(pElem); diff --git a/XML/src/DOMImplementation.cpp b/XML/src/DOMImplementation.cpp index c2d0d76a8..6c986c2fe 100644 --- a/XML/src/DOMImplementation.cpp +++ b/XML/src/DOMImplementation.cpp @@ -55,7 +55,7 @@ bool DOMImplementation::hasFeature(const XMLString& feature, const XMLString& ve DocumentType* DOMImplementation::createDocumentType(const XMLString& name, const XMLString& publicId, const XMLString& systemId) const { - return new DocumentType(0, name, publicId, systemId); + return new DocumentType(nullptr, name, publicId, systemId); } diff --git a/XML/src/DOMSerializer.cpp b/XML/src/DOMSerializer.cpp index e6dcff0cd..a3d2ea3e5 100644 --- a/XML/src/DOMSerializer.cpp +++ b/XML/src/DOMSerializer.cpp @@ -43,12 +43,12 @@ const XMLString DOMSerializer::CDATA = toXMLString("CDATA"); DOMSerializer::DOMSerializer(): - _pEntityResolver(0), - _pDTDHandler(0), - _pContentHandler(0), - _pErrorHandler(0), - _pDeclHandler(0), - _pLexicalHandler(0) + _pEntityResolver(nullptr), + _pDTDHandler(nullptr), + _pContentHandler(nullptr), + _pErrorHandler(nullptr), + _pDeclHandler(nullptr), + _pLexicalHandler(nullptr) { } diff --git a/XML/src/DOMWriter.cpp b/XML/src/DOMWriter.cpp index 17aa225df..5325e866f 100644 --- a/XML/src/DOMWriter.cpp +++ b/XML/src/DOMWriter.cpp @@ -31,7 +31,7 @@ namespace XML { DOMWriter::DOMWriter(): - _pTextEncoding(0), + _pTextEncoding(nullptr), _options(0), _indent("\t") { diff --git a/XML/src/DTDMap.cpp b/XML/src/DTDMap.cpp index 1420d4a77..0ccdda20c 100644 --- a/XML/src/DTDMap.cpp +++ b/XML/src/DTDMap.cpp @@ -92,7 +92,7 @@ unsigned long DTDMap::length() const Node* DTDMap::getNamedItemNS(const XMLString& namespaceURI, const XMLString& localName) const { - return 0; + return nullptr; } diff --git a/XML/src/DefaultHandler.cpp b/XML/src/DefaultHandler.cpp index bcbe9465d..a7be727e8 100644 --- a/XML/src/DefaultHandler.cpp +++ b/XML/src/DefaultHandler.cpp @@ -31,7 +31,7 @@ DefaultHandler::~DefaultHandler() InputSource* DefaultHandler::resolveEntity(const XMLString* publicId, const XMLString& systemId) { - return 0; + return nullptr; } diff --git a/XML/src/Document.cpp b/XML/src/Document.cpp index 9a7417cfb..0781091fe 100644 --- a/XML/src/Document.cpp +++ b/XML/src/Document.cpp @@ -39,8 +39,8 @@ const XMLString Document::NODE_NAME = toXMLString("#document"); Document::Document(NamePool* pNamePool): - AbstractContainerNode(0), - _pDocumentType(0), + AbstractContainerNode(nullptr), + _pDocumentType(nullptr), _eventSuspendLevel(0) { if (pNamePool) @@ -56,8 +56,8 @@ Document::Document(NamePool* pNamePool): Document::Document(unsigned long namePoolSize): - AbstractContainerNode(0), - _pDocumentType(0), + AbstractContainerNode(nullptr), + _pDocumentType(nullptr), _pNamePool(new NamePool(namePoolSize)), _eventSuspendLevel(0) { @@ -65,7 +65,7 @@ Document::Document(unsigned long namePoolSize): Document::Document(DocumentType* pDocumentType, NamePool* pNamePool): - AbstractContainerNode(0), + AbstractContainerNode(nullptr), _pDocumentType(pDocumentType), _eventSuspendLevel(0) { @@ -87,7 +87,7 @@ Document::Document(DocumentType* pDocumentType, NamePool* pNamePool): Document::Document(DocumentType* pDocumentType, unsigned long namePoolSize): - AbstractContainerNode(0), + AbstractContainerNode(nullptr), _pDocumentType(pDocumentType), _pNamePool(new NamePool(namePoolSize)), _eventSuspendLevel(0) @@ -149,7 +149,7 @@ Element* Document::documentElement() const return static_cast(pCur); pCur = pCur->nextSibling(); } - return 0; + return nullptr; } @@ -191,7 +191,7 @@ ProcessingInstruction* Document::createProcessingInstruction(const XMLString& ta Attr* Document::createAttribute(const XMLString& name) const { - return new Attr(const_cast(this), 0, EMPTY_STRING, EMPTY_STRING, name, EMPTY_STRING); + return new Attr(const_cast(this), nullptr, EMPTY_STRING, EMPTY_STRING, name, EMPTY_STRING); } @@ -233,7 +233,7 @@ Element* Document::createElementNS(const XMLString& namespaceURI, const XMLStrin Attr* Document::createAttributeNS(const XMLString& namespaceURI, const XMLString& qualifiedName) const { - return new Attr(const_cast(this), 0, namespaceURI, Name::localName(qualifiedName), qualifiedName, EMPTY_STRING); + return new Attr(const_cast(this), nullptr, namespaceURI, Name::localName(qualifiedName), qualifiedName, EMPTY_STRING); } @@ -245,7 +245,7 @@ NodeList* Document::getElementsByTagNameNS(const XMLString& namespaceURI, const Element* Document::getElementById(const XMLString& elementId) const { - return 0; + return nullptr; } diff --git a/XML/src/Element.cpp b/XML/src/Element.cpp index 1485bed07..a6bd8febb 100644 --- a/XML/src/Element.cpp +++ b/XML/src/Element.cpp @@ -28,7 +28,7 @@ namespace XML { Element::Element(Document* pOwnerDocument, const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname): AbstractContainerNode(pOwnerDocument), _name(pOwnerDocument->namePool().insert(qname, namespaceURI, localName)), - _pFirstAttr(0) + _pFirstAttr(nullptr) { } @@ -36,7 +36,7 @@ Element::Element(Document* pOwnerDocument, const XMLString& namespaceURI, const Element::Element(Document* pOwnerDocument, const Element& element): AbstractContainerNode(pOwnerDocument, element), _name(pOwnerDocument->namePool().insert(element._name)), - _pFirstAttr(0) + _pFirstAttr(nullptr) { Attr* pAttr = element._pFirstAttr; while (pAttr) @@ -418,7 +418,7 @@ Element* Element::getElementById(const XMLString& elementId, const XMLString& id } pNode = pNode->nextSibling(); } - return 0; + return nullptr; } @@ -437,7 +437,7 @@ Element* Element::getElementByIdNS(const XMLString& elementId, const XMLString& } pNode = pNode->nextSibling(); } - return 0; + return nullptr; } diff --git a/XML/src/ElementsByTagNameList.cpp b/XML/src/ElementsByTagNameList.cpp index 661658039..1845bbe77 100644 --- a/XML/src/ElementsByTagNameList.cpp +++ b/XML/src/ElementsByTagNameList.cpp @@ -62,7 +62,7 @@ namespace Node* ElementsByTagNameList::find(const Node* pParent, unsigned long index) const { - if (!pParent) return 0; + if (!pParent) return nullptr; // preorder search Node* pCur = pParent->firstChild(); @@ -123,7 +123,7 @@ unsigned long ElementsByTagNameListNS::length() const Node* ElementsByTagNameListNS::find(const Node* pParent, unsigned long index) const { - if (!pParent) return 0; + if (!pParent) return nullptr; // preorder search Node* pCur = pParent->firstChild(); diff --git a/XML/src/Event.cpp b/XML/src/Event.cpp index ffdff7385..c277d6548 100644 --- a/XML/src/Event.cpp +++ b/XML/src/Event.cpp @@ -23,8 +23,8 @@ namespace XML { Event::Event(Document* pOwnerDocument, const XMLString& type): _pOwner(pOwnerDocument), _type(type), - _pTarget(0), - _pCurrentTarget(0), + _pTarget(nullptr), + _pCurrentTarget(nullptr), _currentPhase(CAPTURING_PHASE), _bubbles(true), _cancelable(true), @@ -38,7 +38,7 @@ Event::Event(Document* pOwnerDocument, const XMLString& type, EventTarget* pTarg _pOwner(pOwnerDocument), _type(type), _pTarget(pTarget), - _pCurrentTarget(0), + _pCurrentTarget(nullptr), _currentPhase(CAPTURING_PHASE), _bubbles(canBubble), _cancelable(isCancelable), diff --git a/XML/src/InputSource.cpp b/XML/src/InputSource.cpp index 1ec8cfc0b..54dc42050 100644 --- a/XML/src/InputSource.cpp +++ b/XML/src/InputSource.cpp @@ -20,23 +20,23 @@ namespace XML { InputSource::InputSource(): - _bistr(0), - _cistr(0) + _bistr(nullptr), + _cistr(nullptr) { } InputSource::InputSource(const XMLString& systemId): _systemId(systemId), - _bistr(0), - _cistr(0) + _bistr(nullptr), + _cistr(nullptr) { } InputSource::InputSource(XMLByteInputStream& bistr): _bistr(&bistr), - _cistr(0) + _cistr(nullptr) { } diff --git a/XML/src/MutationEvent.cpp b/XML/src/MutationEvent.cpp index d9a5567c7..bc723c6be 100644 --- a/XML/src/MutationEvent.cpp +++ b/XML/src/MutationEvent.cpp @@ -29,9 +29,9 @@ const XMLString MutationEvent::DOMCharacterDataModified = toXMLString("DOMCha MutationEvent::MutationEvent(Document* pOwnerDocument, const XMLString& type): - Event(pOwnerDocument, type, 0, true, false), + Event(pOwnerDocument, type, nullptr, true, false), _change(MODIFICATION), - _pRelatedNode(0) + _pRelatedNode(nullptr) { } diff --git a/XML/src/NodeAppender.cpp b/XML/src/NodeAppender.cpp index 41d874c7e..38b63cc73 100644 --- a/XML/src/NodeAppender.cpp +++ b/XML/src/NodeAppender.cpp @@ -23,7 +23,7 @@ namespace XML { NodeAppender::NodeAppender(Element* parent): _pParent(parent), - _pLast(0) + _pLast(nullptr) { poco_check_ptr (parent); @@ -39,7 +39,7 @@ NodeAppender::~NodeAppender() void NodeAppender::appendChild(Node* newChild) { poco_check_ptr (newChild); - poco_assert (_pLast == 0 || _pLast->_pNext == 0); + poco_assert (_pLast == nullptr || _pLast->_pNext == nullptr); if (static_cast(newChild)->_pOwner != _pParent->_pOwner) throw DOMException(DOMException::WRONG_DOCUMENT_ERR); diff --git a/XML/src/NodeIterator.cpp b/XML/src/NodeIterator.cpp index 80cfe66f2..497f9224f 100644 --- a/XML/src/NodeIterator.cpp +++ b/XML/src/NodeIterator.cpp @@ -26,7 +26,7 @@ NodeIterator::NodeIterator(Node* root, unsigned long whatToShow, NodeFilter* pFi _pRoot(root), _whatToShow(whatToShow), _pFilter(pFilter), - _pCurrent(0) + _pCurrent(nullptr) { } @@ -140,13 +140,13 @@ Node* NodeIterator::next() const if (pSibling) return pSibling; pNext = pNext->parentNode(); } - return 0; + return nullptr; } Node* NodeIterator::previous() const { - if (_pCurrent == _pRoot) return 0; + if (_pCurrent == _pRoot) return nullptr; Node* pPrev = _pCurrent->previousSibling(); while (pPrev) { diff --git a/XML/src/ParserEngine.cpp b/XML/src/ParserEngine.cpp index 296254566..06cb1d357 100644 --- a/XML/src/ParserEngine.cpp +++ b/XML/src/ParserEngine.cpp @@ -84,20 +84,20 @@ const XMLString ParserEngine::EMPTY_STRING; ParserEngine::ParserEngine(): - _parser(0), - _pBuffer(0), + _parser(nullptr), + _pBuffer(nullptr), _encodingSpecified(false), _expandInternalEntities(true), _externalGeneralEntities(false), _externalParameterEntities(false), _enablePartialReads(false), _pNamespaceStrategy(new NoNamespacesStrategy()), - _pEntityResolver(0), - _pDTDHandler(0), - _pDeclHandler(0), - _pContentHandler(0), - _pLexicalHandler(0), - _pErrorHandler(0), + _pEntityResolver(nullptr), + _pDTDHandler(nullptr), + _pDeclHandler(nullptr), + _pContentHandler(nullptr), + _pLexicalHandler(nullptr), + _pErrorHandler(nullptr), _maximumAmplificationFactor(0.0), _activationThresholdBytes(0) { @@ -105,8 +105,8 @@ ParserEngine::ParserEngine(): ParserEngine::ParserEngine(const XMLString& encoding): - _parser(0), - _pBuffer(0), + _parser(nullptr), + _pBuffer(nullptr), _encodingSpecified(true), _encoding(encoding), _expandInternalEntities(true), @@ -114,12 +114,12 @@ ParserEngine::ParserEngine(const XMLString& encoding): _externalParameterEntities(false), _enablePartialReads(false), _pNamespaceStrategy(new NoNamespacesStrategy()), - _pEntityResolver(0), - _pDTDHandler(0), - _pDeclHandler(0), - _pContentHandler(0), - _pLexicalHandler(0), - _pErrorHandler(0), + _pEntityResolver(nullptr), + _pDTDHandler(nullptr), + _pDeclHandler(nullptr), + _pContentHandler(nullptr), + _pLexicalHandler(nullptr), + _pErrorHandler(nullptr), _maximumAmplificationFactor(0.0), _activationThresholdBytes(0) { @@ -463,7 +463,7 @@ void ParserEngine::init() if (dynamic_cast(_pNamespaceStrategy)) { - _parser = XML_ParserCreateNS(_encodingSpecified ? _encoding.c_str() : 0, '\t'); + _parser = XML_ParserCreateNS(_encodingSpecified ? _encoding.c_str() : nullptr, '\t'); if (_parser) { XML_SetNamespaceDeclHandler(_parser, handleStartNamespaceDecl, handleEndNamespaceDecl); @@ -471,7 +471,7 @@ void ParserEngine::init() } else if (dynamic_cast(_pNamespaceStrategy)) { - _parser = XML_ParserCreateNS(_encodingSpecified ? _encoding.c_str() : 0, '\t'); + _parser = XML_ParserCreateNS(_encodingSpecified ? _encoding.c_str() : nullptr, '\t'); if (_parser) { XML_SetReturnNSTriplet(_parser, 1); @@ -480,7 +480,7 @@ void ParserEngine::init() } else { - _parser = XML_ParserCreate(_encodingSpecified ? _encoding.c_str() : 0); + _parser = XML_ParserCreate(_encodingSpecified ? _encoding.c_str() : nullptr); } if (!_parser) throw XMLException("Cannot create Expat parser"); @@ -724,7 +724,7 @@ void ParserEngine::handleUnparsedEntityDecl(void* userData, const XML_Char* enti XMLString pubId; if (publicId) pubId.assign(publicId); if (pThis->_pDTDHandler) - pThis->_pDTDHandler->unparsedEntityDecl(entityName, publicId ? &pubId : 0, systemId, notationName); + pThis->_pDTDHandler->unparsedEntityDecl(entityName, publicId ? &pubId : nullptr, systemId, notationName); } @@ -737,7 +737,7 @@ void ParserEngine::handleNotationDecl(void* userData, const XML_Char* notationNa XMLString sysId; if (systemId) sysId.assign(systemId); if (pThis->_pDTDHandler) - pThis->_pDTDHandler->notationDecl(notationName, publicId ? &pubId : 0, systemId ? &sysId : 0); + pThis->_pDTDHandler->notationDecl(notationName, publicId ? &pubId : nullptr, systemId ? &sysId : nullptr); } @@ -762,17 +762,17 @@ int ParserEngine::handleExternalEntityRef(XML_Parser parser, const XML_Char* con if (pThis->_pEntityResolver) { pEntityResolver = pThis->_pEntityResolver; - pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, toXMLString(uri.toString())); + pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : nullptr, toXMLString(uri.toString())); } if (!pInputSource && pThis->_externalGeneralEntities) { pEntityResolver = &defaultResolver; - pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : 0, toXMLString(uri.toString())); + pInputSource = pEntityResolver->resolveEntity(publicId ? &pubId : nullptr, toXMLString(uri.toString())); } if (pInputSource) { - XML_Parser extParser = XML_ExternalEntityParserCreate(pThis->_parser, context, 0); + XML_Parser extParser = XML_ExternalEntityParserCreate(pThis->_parser, context, nullptr); if (!extParser) throw XMLException("Cannot create external entity parser"); try @@ -814,7 +814,7 @@ int ParserEngine::handleUnknownEncoding(void* encodingHandlerData, const XML_Cha info->data = knownEncoding; info->convert = &ParserEngine::convert; - info->release = 0; + info->release = nullptr; return XML_STATUS_OK; } else return XML_STATUS_ERROR; @@ -910,7 +910,7 @@ void ParserEngine::handleExternalParsedEntityDecl(void* userData, const XML_Char XMLString pubId; if (publicId) pubId.assign(publicId); if (pThis->_pDeclHandler) - pThis->_pDeclHandler->externalEntityDecl(entityName, publicId ? &pubId : 0, systemId); + pThis->_pDeclHandler->externalEntityDecl(entityName, publicId ? &pubId : nullptr, systemId); } diff --git a/XML/src/SAXParser.cpp b/XML/src/SAXParser.cpp index fa4af4392..3217800f2 100644 --- a/XML/src/SAXParser.cpp +++ b/XML/src/SAXParser.cpp @@ -203,7 +203,7 @@ void SAXParser::parse(const XMLString& systemId) { setupParse(); EntityResolverImpl entityResolver; - InputSource* pInputSource = entityResolver.resolveEntity(0, systemId); + InputSource* pInputSource = entityResolver.resolveEntity(nullptr, systemId); if (pInputSource) { try diff --git a/XML/src/TreeWalker.cpp b/XML/src/TreeWalker.cpp index ef67eb620..10dd859fa 100644 --- a/XML/src/TreeWalker.cpp +++ b/XML/src/TreeWalker.cpp @@ -65,7 +65,7 @@ void TreeWalker::setCurrentNode(Node* pNode) Node* TreeWalker::parentNode() { - if (!_pCurrent || _pCurrent == _pRoot) return 0; + if (!_pCurrent || _pCurrent == _pRoot) return nullptr; Node* pParent = _pCurrent->parentNode(); while (pParent && pParent != _pRoot && accept(pParent) != NodeFilter::FILTER_ACCEPT) @@ -80,9 +80,9 @@ Node* TreeWalker::parentNode() Node* TreeWalker::firstChild() { - if (!_pCurrent) return 0; + if (!_pCurrent) return nullptr; - Node* pNode = accept(_pCurrent) != NodeFilter::FILTER_REJECT ? _pCurrent->firstChild() : 0; + Node* pNode = accept(_pCurrent) != NodeFilter::FILTER_REJECT ? _pCurrent->firstChild() : nullptr; while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT) pNode = pNode->nextSibling(); if (pNode) @@ -93,9 +93,9 @@ Node* TreeWalker::firstChild() Node* TreeWalker::lastChild() { - if (!_pCurrent) return 0; + if (!_pCurrent) return nullptr; - Node* pNode = accept(_pCurrent) != NodeFilter::FILTER_REJECT ? _pCurrent->lastChild() : 0; + Node* pNode = accept(_pCurrent) != NodeFilter::FILTER_REJECT ? _pCurrent->lastChild() : nullptr; while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT) pNode = pNode->previousSibling(); if (pNode) @@ -106,7 +106,7 @@ Node* TreeWalker::lastChild() Node* TreeWalker::previousSibling() { - if (!_pCurrent) return 0; + if (!_pCurrent) return nullptr; Node* pNode = _pCurrent->previousSibling(); while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT) @@ -119,7 +119,7 @@ Node* TreeWalker::previousSibling() Node* TreeWalker::nextSibling() { - if (!_pCurrent) return 0; + if (!_pCurrent) return nullptr; Node* pNode = _pCurrent->nextSibling(); while (pNode && accept(pNode) != NodeFilter::FILTER_ACCEPT) @@ -132,7 +132,7 @@ Node* TreeWalker::nextSibling() Node* TreeWalker::previousNode() { - if (!_pCurrent) return 0; + if (!_pCurrent) return nullptr; Node* pPrev = previous(_pCurrent); while (pPrev && accept(pPrev) != NodeFilter::FILTER_ACCEPT) @@ -145,7 +145,7 @@ Node* TreeWalker::previousNode() Node* TreeWalker::nextNode() { - if (!_pCurrent) return 0; + if (!_pCurrent) return nullptr; Node* pNext = next(_pCurrent); while (pNext && accept(pNext) != NodeFilter::FILTER_ACCEPT) @@ -195,7 +195,7 @@ int TreeWalker::accept(Node* pNode) const Node* TreeWalker::next(Node* pNode) const { - Node* pNext = accept(pNode) != NodeFilter::FILTER_REJECT ? pNode->firstChild() : 0; + Node* pNext = accept(pNode) != NodeFilter::FILTER_REJECT ? pNode->firstChild() : nullptr; if (pNext) return pNext; pNext = pNode; while (pNext && pNext != _pRoot) @@ -204,17 +204,17 @@ Node* TreeWalker::next(Node* pNode) const if (pSibling) return pSibling; pNext = pNext->parentNode(); } - return 0; + return nullptr; } Node* TreeWalker::previous(Node* pNode) const { - if (pNode == _pRoot) return 0; + if (pNode == _pRoot) return nullptr; Node* pPrev = pNode->previousSibling(); while (pPrev) { - Node* pLastChild = accept(pPrev) != NodeFilter::FILTER_REJECT ? pPrev->lastChild() : 0; + Node* pLastChild = accept(pPrev) != NodeFilter::FILTER_REJECT ? pPrev->lastChild() : nullptr; if (pLastChild) pPrev = pLastChild; else diff --git a/XML/src/WhitespaceFilter.cpp b/XML/src/WhitespaceFilter.cpp index 13e246074..51f9535b2 100644 --- a/XML/src/WhitespaceFilter.cpp +++ b/XML/src/WhitespaceFilter.cpp @@ -21,7 +21,7 @@ namespace XML { WhitespaceFilter::WhitespaceFilter(): - _pLexicalHandler(0), + _pLexicalHandler(nullptr), _filter(true) { } @@ -29,7 +29,7 @@ WhitespaceFilter::WhitespaceFilter(): WhitespaceFilter::WhitespaceFilter(XMLReader* pReader): XMLFilterImpl(pReader), - _pLexicalHandler(0), + _pLexicalHandler(nullptr), _filter(true) { } diff --git a/XML/src/XMLFilterImpl.cpp b/XML/src/XMLFilterImpl.cpp index 0042ca7a5..1e5d73b5a 100644 --- a/XML/src/XMLFilterImpl.cpp +++ b/XML/src/XMLFilterImpl.cpp @@ -21,21 +21,21 @@ namespace XML { XMLFilterImpl::XMLFilterImpl(): - _pParent(0), - _pEntityResolver(0), - _pDTDHandler(0), - _pContentHandler(0), - _pErrorHandler(0) + _pParent(nullptr), + _pEntityResolver(nullptr), + _pDTDHandler(nullptr), + _pContentHandler(nullptr), + _pErrorHandler(nullptr) { } XMLFilterImpl::XMLFilterImpl(XMLReader* pParent): _pParent(pParent), - _pEntityResolver(0), - _pDTDHandler(0), - _pContentHandler(0), - _pErrorHandler(0) + _pEntityResolver(nullptr), + _pDTDHandler(nullptr), + _pContentHandler(nullptr), + _pErrorHandler(nullptr) { } @@ -176,7 +176,7 @@ InputSource* XMLFilterImpl::resolveEntity(const XMLString* publicId, const XMLSt if (_pEntityResolver) return _pEntityResolver->resolveEntity(publicId, systemId); else - return 0; + return nullptr; } diff --git a/XML/src/XMLStreamParser.cpp b/XML/src/XMLStreamParser.cpp index a8c76315c..06c6990a1 100644 --- a/XML/src/XMLStreamParser.cpp +++ b/XML/src/XMLStreamParser.cpp @@ -101,7 +101,7 @@ XMLStreamParser::XMLStreamParser(const void* data, std::size_t size, const std:: _inputName(iname), _feature(f) { - poco_assert(data != 0 && size != 0); + poco_assert(data != nullptr && size != 0); _data.buf = data; init(); @@ -137,9 +137,9 @@ void XMLStreamParser::init() // Allocate the XMLStreamParser. Make sure nothing else can throw after // this call since otherwise we will leak it. // - _parser = XML_ParserCreateNS(0, XML_Char(' ')); + _parser = XML_ParserCreateNS(nullptr, XML_Char(' ')); - if (_parser == 0) + if (_parser == nullptr) throw std::bad_alloc(); // Get prefixes in addition to namespaces and local names. @@ -343,7 +343,7 @@ const XMLStreamParser::ElementEntry* XMLStreamParser::getElementImpl() const // an entry in the element stack. In this case, we need to get the // one before it, if any. // - const ElementEntry* r(0); + const ElementEntry* r(nullptr); ElementState::size_type n(_elementState.size() - 1); if (_elementState[n].depth == _depth) @@ -637,7 +637,7 @@ XMLStreamParser::EventType XMLStreamParser::nextBody() const size_t cap(4096); char* b(static_cast(XML_GetBuffer(_parser, cap))); - if (b == 0) + if (b == nullptr) throw std::bad_alloc(); // Temporarily unset the exception failbit. Also clear the fail bit @@ -679,7 +679,7 @@ static void splitName(const XML_Char* s, QName& qn) const char* p(strchr(s, ' ')); - if (p == 0) + if (p == nullptr) { ns.clear(); name = s; @@ -692,7 +692,7 @@ static void splitName(const XML_Char* s, QName& qn) s = p + 1; p = strchr(s, ' '); - if (p == 0) + if (p == nullptr) { name = s; prefix.clear(); @@ -746,14 +746,14 @@ void XMLStreamParser::handleStartElement(void* v, const XMLChar* name, const XML // Handle attributes. // - if (*atts != 0) + if (*atts != nullptr) { bool am((p._feature & RECEIVE_ATTRIBUTE_MAP) != 0); bool ae((p._feature & RECEIVE_ATTRIBUTES_EVENT) != 0); // Provision an entry for this element. // - ElementEntry* pe(0); + ElementEntry* pe(nullptr); if (am) { p._elementState.emplace_back(p._depth + 1); @@ -762,7 +762,7 @@ void XMLStreamParser::handleStartElement(void* v, const XMLChar* name, const XML if (am || ae) { - for (; *atts != 0; atts += 2) + for (; *atts != nullptr; atts += 2) { if (am) { @@ -914,8 +914,8 @@ void XMLStreamParser::handleStartNamespaceDecl(void* v, const XMLChar* prefix, c return; p._startNamespace.emplace_back(); - p._startNamespace.back().prefix() = (prefix != 0 ? prefix : ""); - p._startNamespace.back().namespaceURI() = (ns != 0 ? ns : ""); + p._startNamespace.back().prefix() = (prefix != nullptr ? prefix : ""); + p._startNamespace.back().namespaceURI() = (ns != nullptr ? ns : ""); } @@ -933,7 +933,7 @@ void XMLStreamParser::handleEndNamespaceDecl(void* v, const XMLChar* prefix) return; p._endNamespace.emplace_back(); - p._endNamespace.back().prefix() = (prefix != 0 ? prefix : ""); + p._endNamespace.back().prefix() = (prefix != nullptr ? prefix : ""); } diff --git a/XML/src/XMLWriter.cpp b/XML/src/XMLWriter.cpp index 05caecac4..36b7d2abb 100644 --- a/XML/src/XMLWriter.cpp +++ b/XML/src/XMLWriter.cpp @@ -60,7 +60,7 @@ const std::string XMLWriter::MARKUP_END_CDATA = "]]>"; XMLWriter::XMLWriter(XMLByteOutputStream& str, int options): - _pTextConverter(0), + _pTextConverter(nullptr), _pInEncoding(new NATIVE_ENCODING), _pOutEncoding(new Poco::UTF8Encoding), _options(options), @@ -83,9 +83,9 @@ XMLWriter::XMLWriter(XMLByteOutputStream& str, int options): XMLWriter::XMLWriter(XMLByteOutputStream& str, int options, const std::string& encodingName, Poco::TextEncoding& textEncoding): - _pTextConverter(0), + _pTextConverter(nullptr), _pInEncoding(new NATIVE_ENCODING), - _pOutEncoding(0), + _pOutEncoding(nullptr), _options(options), _encoding(encodingName), _depth(-1), @@ -106,9 +106,9 @@ XMLWriter::XMLWriter(XMLByteOutputStream& str, int options, const std::string& e XMLWriter::XMLWriter(XMLByteOutputStream& str, int options, const std::string& encodingName, Poco::TextEncoding* pTextEncoding): - _pTextConverter(0), + _pTextConverter(nullptr), _pInEncoding(new NATIVE_ENCODING), - _pOutEncoding(0), + _pOutEncoding(nullptr), _options(options), _encoding(encodingName), _depth(-1), diff --git a/XML/testsuite/src/DocumentTest.cpp b/XML/testsuite/src/DocumentTest.cpp index 8ec29fe44..29d69912e 100644 --- a/XML/testsuite/src/DocumentTest.cpp +++ b/XML/testsuite/src/DocumentTest.cpp @@ -44,7 +44,7 @@ void DocumentTest::testDocumentElement() AutoPtr pDoc = new Document; AutoPtr pRoot = pDoc->createElement("root"); - assertTrue (pDoc->documentElement() == 0); + assertTrue (pDoc->documentElement() == nullptr); pDoc->appendChild(pRoot); assertTrue (pDoc->documentElement() == pRoot); @@ -213,10 +213,10 @@ void DocumentTest::testElementById() assertTrue (pFound == pElem3); pFound = pDoc->getElementById("4", "id"); - assertTrue (pFound == 0); + assertTrue (pFound == nullptr); pFound = pDoc->getElementById("0", "ID"); - assertTrue (pFound == 0); + assertTrue (pFound == nullptr); } @@ -252,13 +252,13 @@ void DocumentTest::testElementByIdNS() assertTrue (pFound == pElem3); pFound = pDoc->getElementByIdNS("4", "urn:ns1", "id"); - assertTrue (pFound == 0); + assertTrue (pFound == nullptr); pFound = pDoc->getElementByIdNS("0", "urn:ns1", "ID"); - assertTrue (pFound == 0); + assertTrue (pFound == nullptr); pFound = pDoc->getElementByIdNS("0", "urn:ns2", "id"); - assertTrue (pFound == 0); + assertTrue (pFound == nullptr); } diff --git a/XML/testsuite/src/DocumentTypeTest.cpp b/XML/testsuite/src/DocumentTypeTest.cpp index 46ea2c95e..71c3ac330 100644 --- a/XML/testsuite/src/DocumentTypeTest.cpp +++ b/XML/testsuite/src/DocumentTypeTest.cpp @@ -43,7 +43,7 @@ void DocumentTypeTest::testDocumentType() { AutoPtr pDoctype = DOMImplementation::instance().createDocumentType("test", "public", "system"); - assertTrue (pDoctype->ownerDocument() == 0); + assertTrue (pDoctype->ownerDocument() == nullptr); assertTrue (pDoctype->name() == "test"); assertTrue (pDoctype->publicId() == "public"); assertTrue (pDoctype->systemId() == "system"); diff --git a/XML/testsuite/src/ElementTest.cpp b/XML/testsuite/src/ElementTest.cpp index 016cfa38a..a1e284c81 100644 --- a/XML/testsuite/src/ElementTest.cpp +++ b/XML/testsuite/src/ElementTest.cpp @@ -55,7 +55,7 @@ void ElementTest::testAttributes() assertTrue (pElem->getAttribute("a1") == "v1"); Attr* pAttr1 = pElem->getAttributeNode("a1"); - assertTrue (pAttr1 != 0); + assertTrue (pAttr1 != nullptr); assertTrue (pAttr1->name() == "a1"); assertTrue (pAttr1->nodeName() == "a1"); assertTrue (pAttr1->value() == "v1"); @@ -64,8 +64,8 @@ void ElementTest::testAttributes() assertTrue (pAttr1->ownerDocument() == pDoc); assertTrue (pAttr1->innerText() == "v1"); - assertTrue (pAttr1->previousSibling() == 0); - assertTrue (pAttr1->nextSibling() == 0); + assertTrue (pAttr1->previousSibling() == nullptr); + assertTrue (pAttr1->nextSibling() == nullptr); pAttr1->setValue("V1"); assertTrue (pElem->getAttribute("a1") == "V1"); @@ -77,18 +77,18 @@ void ElementTest::testAttributes() assertTrue (pElem->getAttribute("a2") == "v2"); Attr* pAttr2 = pElem->getAttributeNode("a2"); - assertTrue (pAttr2 != 0); + assertTrue (pAttr2 != nullptr); assertTrue (pAttr2->name() == "a2"); assertTrue (pAttr2->value() == "v2"); assertTrue (pAttr2->ownerElement() == pElem); - assertTrue (pAttr1->previousSibling() == 0); + assertTrue (pAttr1->previousSibling() == nullptr); assertTrue (pAttr1->nextSibling() == pAttr2); assertTrue (pAttr2->previousSibling() == pAttr1); - assertTrue (pAttr2->nextSibling() == 0); + assertTrue (pAttr2->nextSibling() == nullptr); Attr* pAttr3 = pElem->getAttributeNode("a3"); - assertTrue (pAttr3 == 0); + assertTrue (pAttr3 == nullptr); pAttr3 = pDoc->createAttribute("a3"); pAttr3->setValue("v3"); @@ -102,12 +102,12 @@ void ElementTest::testAttributes() assertTrue (pElem->hasAttribute("a3")); assertTrue (pElem->getAttribute("a3") == "v3"); - assertTrue (pAttr1->previousSibling() == 0); + assertTrue (pAttr1->previousSibling() == nullptr); assertTrue (pAttr1->nextSibling() == pAttr2); assertTrue (pAttr2->previousSibling() == pAttr1); assertTrue (pAttr2->nextSibling() == pAttr3); assertTrue (pAttr3->previousSibling() == pAttr2); - assertTrue (pAttr3->nextSibling() == 0); + assertTrue (pAttr3->nextSibling() == nullptr); pAttr2 = pDoc->createAttribute("a2"); pAttr2->setValue("V2"); @@ -177,7 +177,7 @@ void ElementTest::testAttributesNS() assertTrue (pElem->getAttributeNS("urn:ns1", "a1") == "v1"); Attr* pAttr1 = pElem->getAttributeNodeNS("urn:ns1", "a1"); - assertTrue (pAttr1 != 0); + assertTrue (pAttr1 != nullptr); assertTrue (pAttr1->name() == "a1"); assertTrue (pAttr1->namespaceURI() == "urn:ns1"); assertTrue (pAttr1->prefix().empty()); @@ -197,7 +197,7 @@ void ElementTest::testAttributesNS() assertTrue (pElem->getAttributeNS("urn:ns1", "a2") == "v2"); Attr* pAttr2 = pElem->getAttributeNodeNS("urn:ns1", "a2"); - assertTrue (pAttr2 != 0); + assertTrue (pAttr2 != nullptr); assertTrue (pAttr2->name() == "a2"); assertTrue (pAttr2->namespaceURI() == "urn:ns1"); assertTrue (pAttr2->prefix().empty()); @@ -206,7 +206,7 @@ void ElementTest::testAttributesNS() assertTrue (pAttr2->ownerElement() == pElem); Attr* pAttr3 = pElem->getAttributeNodeNS("urn:ns2", "p:a3"); - assertTrue (pAttr3 == 0); + assertTrue (pAttr3 == nullptr); pAttr3 = pDoc->createAttributeNS("urn:ns2", "p:a3"); pAttr3->setValue("v3"); @@ -578,9 +578,9 @@ void ElementTest::testChildElement() assertTrue (pRoot->getChildElement("elem1") == pElem1); assertTrue (pRoot->getChildElement("elem2") == pElem2); assertTrue (pRoot->getChildElement("elem3") == pElem3); - assertTrue (pRoot->getChildElement("elem4") == 0); + assertTrue (pRoot->getChildElement("elem4") == nullptr); - assertTrue (pElem1->getChildElement("elem11") == 0); + assertTrue (pElem1->getChildElement("elem11") == nullptr); } @@ -601,10 +601,10 @@ void ElementTest::testChildElementNS() assertTrue (pRoot->getChildElementNS("urn:ns", "elem1") == pElem1); assertTrue (pRoot->getChildElementNS("urn:ns", "elem2") == pElem2); assertTrue (pRoot->getChildElementNS("urn:ns", "elem3") == pElem3); - assertTrue (pRoot->getChildElementNS("urn:ns", "elem4") == 0); - assertTrue (pRoot->getChildElementNS("urn:NS", "elem1") == 0); + assertTrue (pRoot->getChildElementNS("urn:ns", "elem4") == nullptr); + assertTrue (pRoot->getChildElementNS("urn:NS", "elem1") == nullptr); - assertTrue (pElem1->getChildElementNS("urn:ns", "elem11") == 0); + assertTrue (pElem1->getChildElementNS("urn:ns", "elem11") == nullptr); } @@ -707,7 +707,7 @@ void ElementTest::testNodeByPath() assertTrue (pNode == pElem12); pNode = pRoot->getNodeByPath("/elem1/elemA[2]"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pRoot->getNodeByPath("/elem2/elemB"); assertTrue (pNode == pElem21); @@ -722,13 +722,13 @@ void ElementTest::testNodeByPath() assertTrue (pNode == pElem23); pNode = pRoot->getNodeByPath("/elem2/elemB[3]"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pRoot->getNodeByPath("/elem2/elemB[@attr1]"); assertTrue (pNode && pNode->nodeValue() == "value1"); pNode = pRoot->getNodeByPath("/elem2/elemB[@attr2]"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pRoot->getNodeByPath("/elem2/elemB[@attr1='value2']"); assertTrue (pNode == pElem22); @@ -752,7 +752,7 @@ void ElementTest::testNodeByPath() assertTrue (pNode == pElem31); pNode = pDoc->getNodeByPath("//elemB[@attr1='value5']"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pDoc->getNodeByPath("//[@attr1='value1']"); assertTrue (pNode == pElem21); @@ -770,16 +770,16 @@ void ElementTest::testNodeByPath() assertTrue (pNode == pElem24); pNode = pDoc->getNodeByPath("/root/elem2[1]/elemC"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pDoc->getNodeByPath("/root/elem2[0]/elemD"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pDoc->getNodeByPath("/root/elem2[1]/elemD"); assertTrue (pNode == pElem32); pNode = pDoc->getNodeByPath("/root/elem2[@index=0]/elemD"); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pDoc->getNodeByPath("/root/elem2[@index=1]/elemD"); assertTrue (pNode == pElem32); @@ -879,7 +879,7 @@ void ElementTest::testNodeByPathNS() assertTrue (pNode == pElem12); pNode = pRoot->getNodeByPathNS("/ns1:elem1/NS2:elemA[2]", nsMap); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pRoot->getNodeByPathNS("/ns1:elem2/NS2:elemB", nsMap); assertTrue (pNode == pElem21); @@ -894,13 +894,13 @@ void ElementTest::testNodeByPathNS() assertTrue (pNode == pElem23); pNode = pRoot->getNodeByPathNS("/ns1:elem2/NS2:elemB[3]", nsMap); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pRoot->getNodeByPathNS("/ns1:elem2/NS2:elemB[@NS2:attr1]", nsMap); assertTrue (pNode && pNode->nodeValue() == "value1"); pNode = pRoot->getNodeByPathNS("/ns1:elem2/NS2:elemB[@NS2:attr2]", nsMap); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pRoot->getNodeByPathNS("/ns1:elem2/NS2:elemB[@NS2:attr1='value2']", nsMap); assertTrue (pNode == pElem22); @@ -912,7 +912,7 @@ void ElementTest::testNodeByPathNS() assertTrue (pNode && pNode->nodeValue() == "value1"); pNode = pRoot->getNodeByPathNS("/NS2:elem1", nsMap); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pDoc->getNodeByPathNS("//NS2:elemB[@NS2:attr1='value1']", nsMap); assertTrue (pNode == pElem21); @@ -927,7 +927,7 @@ void ElementTest::testNodeByPathNS() assertTrue (pNode == pElem31); pNode = pDoc->getNodeByPathNS("//NS2:elemB[@NS2:attr1='value5']", nsMap); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); pNode = pDoc->getNodeByPathNS("//[@NS2:attr1='value1']", nsMap); assertTrue (pNode == pElem21); @@ -942,7 +942,7 @@ void ElementTest::testNodeByPathNS() assertTrue (pNode == pElem22); pNode = pRoot->getNodeByPathNS("/ns1:elem2/ns1:*[@NS2:attr1='value2']", nsMap); - assertTrue (pNode == 0); + assertTrue (pNode == nullptr); } @@ -973,4 +973,4 @@ CppUnit::Test* ElementTest::suite() CppUnit_addTest(pSuite, ElementTest, testNodeByPathNS); return pSuite; -} \ No newline at end of file +} diff --git a/XML/testsuite/src/NodeAppenderTest.cpp b/XML/testsuite/src/NodeAppenderTest.cpp index 8ece486b7..8b6884f9f 100644 --- a/XML/testsuite/src/NodeAppenderTest.cpp +++ b/XML/testsuite/src/NodeAppenderTest.cpp @@ -57,9 +57,9 @@ void NodeAppenderTest::testAppendNode() assertTrue (pElem1->nextSibling() == pElem2); assertTrue (pElem2->nextSibling() == pElem3); - assertTrue (pElem3->nextSibling() == 0); + assertTrue (pElem3->nextSibling() == nullptr); - assertTrue (pElem1->previousSibling() == 0); + assertTrue (pElem1->previousSibling() == nullptr); assertTrue (pElem2->previousSibling() == pElem1); assertTrue (pElem3->previousSibling() == pElem2); @@ -93,7 +93,7 @@ void NodeAppenderTest::testAppendNodeList() pFrag3->appendChild(pElem4); appender.appendChild(pFrag1); - assertTrue (pRoot->firstChild() == 0); + assertTrue (pRoot->firstChild() == nullptr); appender.appendChild(pFrag2); assertTrue (pRoot->firstChild() == pElem1); @@ -101,9 +101,9 @@ void NodeAppenderTest::testAppendNodeList() assertTrue (pElem1->nextSibling() == pElem2); assertTrue (pElem2->nextSibling() == pElem3); - assertTrue (pElem3->nextSibling() == 0); + assertTrue (pElem3->nextSibling() == nullptr); - assertTrue (pElem1->previousSibling() == 0); + assertTrue (pElem1->previousSibling() == nullptr); assertTrue (pElem2->previousSibling() == pElem1); assertTrue (pElem3->previousSibling() == pElem2); diff --git a/XML/testsuite/src/NodeIteratorTest.cpp b/XML/testsuite/src/NodeIteratorTest.cpp index 22cda4539..41cda8d1f 100644 --- a/XML/testsuite/src/NodeIteratorTest.cpp +++ b/XML/testsuite/src/NodeIteratorTest.cpp @@ -76,14 +76,14 @@ void NodeIteratorTest::testShowAll() assertTrue (it.nextNode() == pText1); assertTrue (it.nextNode() == pElem2); assertTrue (it.nextNode() == pText2); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); assertTrue (it.previousNode() == pText2); assertTrue (it.previousNode() == pElem2); assertTrue (it.previousNode() == pText1); assertTrue (it.previousNode() == pElem1); assertTrue (it.previousNode() == pRoot); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); } @@ -107,12 +107,12 @@ void NodeIteratorTest::testShowElements() assertTrue (it.nextNode() == pRoot); assertTrue (it.nextNode() == pElem1); assertTrue (it.nextNode() == pElem2); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); assertTrue (it.previousNode() == pElem2); assertTrue (it.previousNode() == pElem1); assertTrue (it.previousNode() == pRoot); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); } @@ -135,10 +135,10 @@ void NodeIteratorTest::testFilter() NodeIterator it(pRoot, NodeFilter::SHOW_ELEMENT, &filter); assertTrue (it.nextNode() == pElem1); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); assertTrue (it.previousNode() == pElem1); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); } @@ -159,9 +159,9 @@ void NodeIteratorTest::testShowNothing() NodeIterator it(pRoot, 0); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); } diff --git a/XML/testsuite/src/NodeTest.cpp b/XML/testsuite/src/NodeTest.cpp index e8c62c0ea..d9835adbf 100644 --- a/XML/testsuite/src/NodeTest.cpp +++ b/XML/testsuite/src/NodeTest.cpp @@ -40,53 +40,53 @@ void NodeTest::testInsert() AutoPtr pRoot = pDoc->createElement("root"); assertTrue (!pRoot->hasChildNodes()); - assertTrue (pRoot->firstChild() == 0); - assertTrue (pRoot->lastChild() == 0); + assertTrue (pRoot->firstChild() == nullptr); + assertTrue (pRoot->lastChild() == nullptr); AutoPtr pChild1 = pDoc->createElement("child1"); - pRoot->insertBefore(pChild1, 0); + pRoot->insertBefore(pChild1, nullptr); assertTrue (pRoot->hasChildNodes()); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild1); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); AutoPtr pChild3 = pDoc->createElement("child3"); - pRoot->insertBefore(pChild3, 0); + pRoot->insertBefore(pChild3, nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild1); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); AutoPtr pChild0 = pDoc->createElement("child0"); pRoot->insertBefore(pChild0, pChild1); assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild1); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); AutoPtr pChild2 = pDoc->createElement("child2"); pRoot->insertBefore(pChild2, pChild3); assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); } @@ -100,30 +100,30 @@ void NodeTest::testAppend() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild1); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); AutoPtr pChild2 = pDoc->createElement("child2"); pRoot->appendChild(pChild2); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild2); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->nextSibling() == nullptr); AutoPtr pChild3 = pDoc->createElement("child3"); pRoot->appendChild(pChild3); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); } @@ -145,40 +145,40 @@ void NodeTest::testRemove() pRoot->appendChild(pChild4); pRoot->removeChild(pChild2); - assertTrue (pChild2->previousSibling() == 0); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); + assertTrue (pChild2->nextSibling() == nullptr); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild1); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); pRoot->removeChild(pChild4); - assertTrue (pChild4->previousSibling() == 0); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->previousSibling() == nullptr); + assertTrue (pChild4->nextSibling() == nullptr); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild1); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild3); pRoot->removeChild(pChild1); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild3); assertTrue (pRoot->lastChild() == pChild3); pRoot->removeChild(pChild3); - assertTrue (pChild3->previousSibling() == 0); - assertTrue (pChild3->nextSibling() == 0); - assertTrue (pRoot->firstChild() == 0); - assertTrue (pRoot->lastChild() == 0); + assertTrue (pChild3->previousSibling() == nullptr); + assertTrue (pChild3->nextSibling() == nullptr); + assertTrue (pRoot->firstChild() == nullptr); + assertTrue (pRoot->lastChild() == nullptr); } @@ -202,66 +202,66 @@ void NodeTest::testReplace() AutoPtr pChild11 = pDoc->createElement("child11"); pRoot->replaceChild(pChild11, pChild1); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild11); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild22 = pDoc->createElement("child22"); pRoot->replaceChild(pChild22, pChild2); - assertTrue (pChild2->previousSibling() == 0); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); + assertTrue (pChild2->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild22); assertTrue (pChild22->previousSibling() == pChild11); assertTrue (pChild22->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild22); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild33 = pDoc->createElement("child33"); pRoot->replaceChild(pChild33, pChild3); - assertTrue (pChild3->previousSibling() == 0); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->previousSibling() == nullptr); + assertTrue (pChild3->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild22); assertTrue (pChild22->previousSibling() == pChild11); assertTrue (pChild22->nextSibling() == pChild33); assertTrue (pChild33->previousSibling() == pChild22); assertTrue (pChild33->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild33); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild44 = pDoc->createElement("child44"); pRoot->replaceChild(pChild44, pChild4); - assertTrue (pChild4->previousSibling() == 0); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->previousSibling() == nullptr); + assertTrue (pChild4->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild44); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild22); assertTrue (pChild22->previousSibling() == pChild11); assertTrue (pChild22->nextSibling() == pChild33); assertTrue (pChild33->previousSibling() == pChild22); assertTrue (pChild33->nextSibling() == pChild44); assertTrue (pChild44->previousSibling() == pChild33); - assertTrue (pChild44->nextSibling() == 0); + assertTrue (pChild44->nextSibling() == nullptr); } @@ -272,30 +272,30 @@ void NodeTest::testInsertFragment1() AutoPtr pFrag = pDoc->createDocumentFragment(); assertTrue (!pRoot->hasChildNodes()); - assertTrue (pRoot->firstChild() == 0); - assertTrue (pRoot->lastChild() == 0); + assertTrue (pRoot->firstChild() == nullptr); + assertTrue (pRoot->lastChild() == nullptr); AutoPtr pChild1 = pDoc->createElement("child1"); pFrag->appendChild(pChild1); - pRoot->insertBefore(pFrag, 0); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + pRoot->insertBefore(pFrag, nullptr); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild1); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); AutoPtr pChild3 = pDoc->createElement("child3"); pFrag->appendChild(pChild3); - pRoot->insertBefore(pFrag, 0); + pRoot->insertBefore(pFrag, nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild1); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); AutoPtr pChild0 = pDoc->createElement("child0"); pFrag->appendChild(pChild0); @@ -303,12 +303,12 @@ void NodeTest::testInsertFragment1() assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild1); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); AutoPtr pChild2 = pDoc->createElement("child2"); pFrag->appendChild(pChild2); @@ -316,14 +316,14 @@ void NodeTest::testInsertFragment1() assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); } @@ -334,40 +334,40 @@ void NodeTest::testInsertFragment2() AutoPtr pFrag = pDoc->createDocumentFragment(); assertTrue (!pRoot->hasChildNodes()); - assertTrue (pRoot->firstChild() == 0); - assertTrue (pRoot->lastChild() == 0); + assertTrue (pRoot->firstChild() == nullptr); + assertTrue (pRoot->lastChild() == nullptr); AutoPtr pChild2 = pDoc->createElement("child2"); AutoPtr pChild3 = pDoc->createElement("child3"); pFrag->appendChild(pChild2); pFrag->appendChild(pChild3); - pRoot->insertBefore(pFrag, 0); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + pRoot->insertBefore(pFrag, nullptr); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); assertTrue (pRoot->firstChild() == pChild2); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild2->previousSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); AutoPtr pChild6 = pDoc->createElement("child6"); AutoPtr pChild7 = pDoc->createElement("child7"); pFrag->appendChild(pChild6); pFrag->appendChild(pChild7); - pRoot->insertBefore(pFrag, 0); + pRoot->insertBefore(pFrag, nullptr); assertTrue (pRoot->firstChild() == pChild2); assertTrue (pRoot->lastChild() == pChild7); - assertTrue (pChild2->previousSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); assertTrue (pChild3->nextSibling() == pChild6); assertTrue (pChild6->previousSibling() == pChild3); assertTrue (pChild6->nextSibling() == pChild7); assertTrue (pChild7->previousSibling() == pChild6); - assertTrue (pChild7->nextSibling() == 0); + assertTrue (pChild7->nextSibling() == nullptr); AutoPtr pChild0 = pDoc->createElement("child0"); AutoPtr pChild1 = pDoc->createElement("child1"); @@ -377,7 +377,7 @@ void NodeTest::testInsertFragment2() assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild7); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild2); @@ -388,7 +388,7 @@ void NodeTest::testInsertFragment2() assertTrue (pChild6->previousSibling() == pChild3); assertTrue (pChild6->nextSibling() == pChild7); assertTrue (pChild7->previousSibling() == pChild6); - assertTrue (pChild7->nextSibling() == 0); + assertTrue (pChild7->nextSibling() == nullptr); AutoPtr pChild4 = pDoc->createElement("child4"); AutoPtr pChild5 = pDoc->createElement("child5"); @@ -398,7 +398,7 @@ void NodeTest::testInsertFragment2() assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild7); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild2); @@ -413,7 +413,7 @@ void NodeTest::testInsertFragment2() assertTrue (pChild6->previousSibling() == pChild5); assertTrue (pChild6->nextSibling() == pChild7); assertTrue (pChild7->previousSibling() == pChild6); - assertTrue (pChild7->nextSibling() == 0); + assertTrue (pChild7->nextSibling() == nullptr); } @@ -424,8 +424,8 @@ void NodeTest::testInsertFragment3() AutoPtr pFrag = pDoc->createDocumentFragment(); assertTrue (!pRoot->hasChildNodes()); - assertTrue (pRoot->firstChild() == 0); - assertTrue (pRoot->lastChild() == 0); + assertTrue (pRoot->firstChild() == nullptr); + assertTrue (pRoot->lastChild() == nullptr); AutoPtr pChild3 = pDoc->createElement("child3"); AutoPtr pChild4 = pDoc->createElement("child4"); @@ -433,18 +433,18 @@ void NodeTest::testInsertFragment3() pFrag->appendChild(pChild3); pFrag->appendChild(pChild4); pFrag->appendChild(pChild5); - pRoot->insertBefore(pFrag, 0); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + pRoot->insertBefore(pFrag, nullptr); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); assertTrue (pRoot->firstChild() == pChild3); assertTrue (pRoot->lastChild() == pChild5); - assertTrue (pChild3->previousSibling() == 0); + assertTrue (pChild3->previousSibling() == nullptr); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); assertTrue (pChild4->nextSibling() == pChild5); assertTrue (pChild5->previousSibling() == pChild4); - assertTrue (pChild5->nextSibling() == 0); + assertTrue (pChild5->nextSibling() == nullptr); AutoPtr pChild9 = pDoc->createElement("child9"); AutoPtr pChild10 = pDoc->createElement("child10"); @@ -452,11 +452,11 @@ void NodeTest::testInsertFragment3() pFrag->appendChild(pChild9); pFrag->appendChild(pChild10); pFrag->appendChild(pChild11); - pRoot->insertBefore(pFrag, 0); + pRoot->insertBefore(pFrag, nullptr); assertTrue (pRoot->firstChild() == pChild3); assertTrue (pRoot->lastChild() == pChild11); - assertTrue (pChild3->previousSibling() == 0); + assertTrue (pChild3->previousSibling() == nullptr); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); assertTrue (pChild4->nextSibling() == pChild5); @@ -467,7 +467,7 @@ void NodeTest::testInsertFragment3() assertTrue (pChild10->previousSibling() == pChild9); assertTrue (pChild10->nextSibling() == pChild11); assertTrue (pChild11->previousSibling() == pChild10); - assertTrue (pChild11->nextSibling() == 0); + assertTrue (pChild11->nextSibling() == nullptr); AutoPtr pChild0 = pDoc->createElement("child0"); AutoPtr pChild1 = pDoc->createElement("child1"); @@ -479,7 +479,7 @@ void NodeTest::testInsertFragment3() assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild11); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild2); @@ -496,7 +496,7 @@ void NodeTest::testInsertFragment3() assertTrue (pChild10->previousSibling() == pChild9); assertTrue (pChild10->nextSibling() == pChild11); assertTrue (pChild11->previousSibling() == pChild10); - assertTrue (pChild11->nextSibling() == 0); + assertTrue (pChild11->nextSibling() == nullptr); AutoPtr pChild6 = pDoc->createElement("child6"); AutoPtr pChild7 = pDoc->createElement("child7"); @@ -508,7 +508,7 @@ void NodeTest::testInsertFragment3() assertTrue (pRoot->firstChild() == pChild0); assertTrue (pRoot->lastChild() == pChild11); - assertTrue (pChild0->previousSibling() == 0); + assertTrue (pChild0->previousSibling() == nullptr); assertTrue (pChild0->nextSibling() == pChild1); assertTrue (pChild1->previousSibling() == pChild0); assertTrue (pChild1->nextSibling() == pChild2); @@ -531,7 +531,7 @@ void NodeTest::testInsertFragment3() assertTrue (pChild10->previousSibling() == pChild9); assertTrue (pChild10->nextSibling() == pChild11); assertTrue (pChild11->previousSibling() == pChild10); - assertTrue (pChild11->nextSibling() == 0); + assertTrue (pChild11->nextSibling() == nullptr); } @@ -544,13 +544,13 @@ void NodeTest::testAppendFragment1() AutoPtr pChild1 = pDoc->createElement("child1"); pFrag->appendChild(pChild1); pRoot->appendChild(pFrag); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild1); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); AutoPtr pChild2 = pDoc->createElement("child2"); pFrag->appendChild(pChild2); @@ -558,10 +558,10 @@ void NodeTest::testAppendFragment1() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild2); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->nextSibling() == nullptr); AutoPtr pChild3 = pDoc->createElement("child3"); pFrag->appendChild(pChild3); @@ -569,12 +569,12 @@ void NodeTest::testAppendFragment1() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); } @@ -589,15 +589,15 @@ void NodeTest::testAppendFragment2() pFrag->appendChild(pChild1); pFrag->appendChild(pChild2); pRoot->appendChild(pFrag); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild2); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->nextSibling() == nullptr); AutoPtr pChild3 = pDoc->createElement("child3"); AutoPtr pChild4 = pDoc->createElement("child4"); @@ -607,14 +607,14 @@ void NodeTest::testAppendFragment2() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild5 = pDoc->createElement("child5"); AutoPtr pChild6 = pDoc->createElement("child6"); @@ -624,7 +624,7 @@ void NodeTest::testAppendFragment2() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild6); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); @@ -635,7 +635,7 @@ void NodeTest::testAppendFragment2() assertTrue (pChild5->previousSibling() == pChild4); assertTrue (pChild5->nextSibling() == pChild6); assertTrue (pChild6->previousSibling() == pChild5); - assertTrue (pChild6->nextSibling() == 0); + assertTrue (pChild6->nextSibling() == nullptr); } @@ -652,17 +652,17 @@ void NodeTest::testAppendFragment3() pFrag->appendChild(pChild2); pFrag->appendChild(pChild3); pRoot->appendChild(pFrag); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild3); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->nextSibling() == nullptr); AutoPtr pChild4 = pDoc->createElement("child4"); AutoPtr pChild5 = pDoc->createElement("child5"); @@ -674,7 +674,7 @@ void NodeTest::testAppendFragment3() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild6); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); @@ -685,7 +685,7 @@ void NodeTest::testAppendFragment3() assertTrue (pChild5->previousSibling() == pChild4); assertTrue (pChild5->nextSibling() == pChild6); assertTrue (pChild6->previousSibling() == pChild5); - assertTrue (pChild6->nextSibling() == 0); + assertTrue (pChild6->nextSibling() == nullptr); AutoPtr pChild7 = pDoc->createElement("child7"); AutoPtr pChild8 = pDoc->createElement("child8"); @@ -697,7 +697,7 @@ void NodeTest::testAppendFragment3() assertTrue (pRoot->firstChild() == pChild1); assertTrue (pRoot->lastChild() == pChild9); - assertTrue (pChild1->previousSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); assertTrue (pChild1->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild1); assertTrue (pChild2->nextSibling() == pChild3); @@ -714,7 +714,7 @@ void NodeTest::testAppendFragment3() assertTrue (pChild8->previousSibling() == pChild7); assertTrue (pChild8->nextSibling() == pChild9); assertTrue (pChild9->previousSibling() == pChild8); - assertTrue (pChild9->nextSibling() == 0); + assertTrue (pChild9->nextSibling() == nullptr); } @@ -739,72 +739,72 @@ void NodeTest::testReplaceFragment1() AutoPtr pChild11 = pDoc->createElement("child11"); pFrag->appendChild(pChild11); pRoot->replaceChild(pFrag, pChild1); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild2); assertTrue (pChild2->previousSibling() == pChild11); assertTrue (pChild2->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild2); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild22 = pDoc->createElement("child22"); pFrag->appendChild(pChild22); pRoot->replaceChild(pFrag, pChild2); - assertTrue (pChild2->previousSibling() == 0); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); + assertTrue (pChild2->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild22); assertTrue (pChild22->previousSibling() == pChild11); assertTrue (pChild22->nextSibling() == pChild3); assertTrue (pChild3->previousSibling() == pChild22); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild33 = pDoc->createElement("child33"); pFrag->appendChild(pChild33); pRoot->replaceChild(pFrag, pChild3); - assertTrue (pChild3->previousSibling() == 0); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->previousSibling() == nullptr); + assertTrue (pChild3->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild22); assertTrue (pChild22->previousSibling() == pChild11); assertTrue (pChild22->nextSibling() == pChild33); assertTrue (pChild33->previousSibling() == pChild22); assertTrue (pChild33->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild33); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild44 = pDoc->createElement("child44"); pFrag->appendChild(pChild44); pRoot->replaceChild(pFrag, pChild4); - assertTrue (pChild4->previousSibling() == 0); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->previousSibling() == nullptr); + assertTrue (pChild4->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild44); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild22); assertTrue (pChild22->previousSibling() == pChild11); assertTrue (pChild22->nextSibling() == pChild33); assertTrue (pChild33->previousSibling() == pChild22); assertTrue (pChild33->nextSibling() == pChild44); assertTrue (pChild44->previousSibling() == pChild33); - assertTrue (pChild44->nextSibling() == 0); + assertTrue (pChild44->nextSibling() == nullptr); } @@ -831,14 +831,14 @@ void NodeTest::testReplaceFragment2() pFrag->appendChild(pChild11); pFrag->appendChild(pChild12); pRoot->replaceChild(pFrag, pChild1); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild2); @@ -847,7 +847,7 @@ void NodeTest::testReplaceFragment2() assertTrue (pChild3->previousSibling() == pChild2); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild21 = pDoc->createElement("child21"); AutoPtr pChild22 = pDoc->createElement("child22"); @@ -855,11 +855,11 @@ void NodeTest::testReplaceFragment2() pFrag->appendChild(pChild22); pRoot->replaceChild(pFrag, pChild2); - assertTrue (pChild2->previousSibling() == 0); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); + assertTrue (pChild2->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild21); @@ -870,7 +870,7 @@ void NodeTest::testReplaceFragment2() assertTrue (pChild3->previousSibling() == pChild22); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild31 = pDoc->createElement("child31"); AutoPtr pChild32 = pDoc->createElement("child32"); @@ -878,11 +878,11 @@ void NodeTest::testReplaceFragment2() pFrag->appendChild(pChild32); pRoot->replaceChild(pFrag, pChild3); - assertTrue (pChild3->previousSibling() == 0); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->previousSibling() == nullptr); + assertTrue (pChild3->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild21); @@ -895,7 +895,7 @@ void NodeTest::testReplaceFragment2() assertTrue (pChild32->previousSibling() == pChild31); assertTrue (pChild32->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild32); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild41 = pDoc->createElement("child41"); AutoPtr pChild42 = pDoc->createElement("child42"); @@ -903,11 +903,11 @@ void NodeTest::testReplaceFragment2() pFrag->appendChild(pChild42); pRoot->replaceChild(pFrag, pChild4); - assertTrue (pChild4->previousSibling() == 0); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->previousSibling() == nullptr); + assertTrue (pChild4->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild42); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild21); @@ -922,7 +922,7 @@ void NodeTest::testReplaceFragment2() assertTrue (pChild41->previousSibling() == pChild32); assertTrue (pChild41->nextSibling() == pChild42); assertTrue (pChild42->previousSibling() == pChild41); - assertTrue (pChild42->nextSibling() == 0); + assertTrue (pChild42->nextSibling() == nullptr); } @@ -951,14 +951,14 @@ void NodeTest::testReplaceFragment3() pFrag->appendChild(pChild12); pFrag->appendChild(pChild13); pRoot->replaceChild(pFrag, pChild1); - assertTrue (pFrag->firstChild() == 0); - assertTrue (pFrag->lastChild() == 0); + assertTrue (pFrag->firstChild() == nullptr); + assertTrue (pFrag->lastChild() == nullptr); - assertTrue (pChild1->previousSibling() == 0); - assertTrue (pChild1->nextSibling() == 0); + assertTrue (pChild1->previousSibling() == nullptr); + assertTrue (pChild1->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild13); @@ -969,7 +969,7 @@ void NodeTest::testReplaceFragment3() assertTrue (pChild3->previousSibling() == pChild2); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild21 = pDoc->createElement("child21"); AutoPtr pChild22 = pDoc->createElement("child22"); @@ -979,11 +979,11 @@ void NodeTest::testReplaceFragment3() pFrag->appendChild(pChild23); pRoot->replaceChild(pFrag, pChild2); - assertTrue (pChild2->previousSibling() == 0); - assertTrue (pChild2->nextSibling() == 0); + assertTrue (pChild2->previousSibling() == nullptr); + assertTrue (pChild2->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild13); @@ -998,7 +998,7 @@ void NodeTest::testReplaceFragment3() assertTrue (pChild3->previousSibling() == pChild23); assertTrue (pChild3->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild3); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild31 = pDoc->createElement("child31"); AutoPtr pChild32 = pDoc->createElement("child32"); @@ -1008,11 +1008,11 @@ void NodeTest::testReplaceFragment3() pFrag->appendChild(pChild33); pRoot->replaceChild(pFrag, pChild3); - assertTrue (pChild3->previousSibling() == 0); - assertTrue (pChild3->nextSibling() == 0); + assertTrue (pChild3->previousSibling() == nullptr); + assertTrue (pChild3->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild4); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild13); @@ -1031,7 +1031,7 @@ void NodeTest::testReplaceFragment3() assertTrue (pChild33->previousSibling() == pChild32); assertTrue (pChild33->nextSibling() == pChild4); assertTrue (pChild4->previousSibling() == pChild33); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->nextSibling() == nullptr); AutoPtr pChild41 = pDoc->createElement("child41"); AutoPtr pChild42 = pDoc->createElement("child42"); @@ -1041,11 +1041,11 @@ void NodeTest::testReplaceFragment3() pFrag->appendChild(pChild43); pRoot->replaceChild(pFrag, pChild4); - assertTrue (pChild4->previousSibling() == 0); - assertTrue (pChild4->nextSibling() == 0); + assertTrue (pChild4->previousSibling() == nullptr); + assertTrue (pChild4->nextSibling() == nullptr); assertTrue (pRoot->firstChild() == pChild11); assertTrue (pRoot->lastChild() == pChild43); - assertTrue (pChild11->previousSibling() == 0); + assertTrue (pChild11->previousSibling() == nullptr); assertTrue (pChild11->nextSibling() == pChild12); assertTrue (pChild12->previousSibling() == pChild11); assertTrue (pChild12->nextSibling() == pChild13); @@ -1068,7 +1068,7 @@ void NodeTest::testReplaceFragment3() assertTrue (pChild42->previousSibling() == pChild41); assertTrue (pChild42->nextSibling() == pChild43); assertTrue (pChild43->previousSibling() == pChild42); - assertTrue (pChild43->nextSibling() == 0); + assertTrue (pChild43->nextSibling() == nullptr); } diff --git a/XML/testsuite/src/SAXParserTest.cpp b/XML/testsuite/src/SAXParserTest.cpp index e58746614..82ac7870d 100644 --- a/XML/testsuite/src/SAXParserTest.cpp +++ b/XML/testsuite/src/SAXParserTest.cpp @@ -51,7 +51,7 @@ public: pIS->setSystemId(systemId); return pIS; } - return 0; + return nullptr; } void releaseInputSource(InputSource* pSource) diff --git a/XML/testsuite/src/TreeWalkerTest.cpp b/XML/testsuite/src/TreeWalkerTest.cpp index 0bd027235..1401ba530 100644 --- a/XML/testsuite/src/TreeWalkerTest.cpp +++ b/XML/testsuite/src/TreeWalkerTest.cpp @@ -87,30 +87,30 @@ void TreeWalkerTest::testShowAll() assertTrue (it.nextNode() == pText1); assertTrue (it.nextNode() == pElem2); assertTrue (it.nextNode() == pText2); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); assertTrue (it.currentNode() == pText2); assertTrue (it.previousNode() == pElem2); assertTrue (it.previousNode() == pText1); assertTrue (it.previousNode() == pElem1); assertTrue (it.previousNode() == pRoot); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); assertTrue (it.currentNode() == pRoot); - assertTrue (it.parentNode() == 0); + assertTrue (it.parentNode() == nullptr); assertTrue (it.currentNode() == pRoot); assertTrue (it.firstChild() == pElem1); assertTrue (it.parentNode() == pRoot); assertTrue (it.lastChild() == pElem2); assertTrue (it.previousSibling() == pElem1); - assertTrue (it.previousSibling() == 0); + assertTrue (it.previousSibling() == nullptr); assertTrue (it.currentNode() == pElem1); assertTrue (it.nextSibling() == pElem2); - assertTrue (it.nextSibling() == 0); + assertTrue (it.nextSibling() == nullptr); assertTrue (it.currentNode() == pElem2); assertTrue (it.firstChild() == pText2); - assertTrue (it.nextSibling() == 0); - assertTrue (it.previousSibling() == 0); + assertTrue (it.nextSibling() == nullptr); + assertTrue (it.previousSibling() == nullptr); assertTrue (it.parentNode() == pElem2); assertTrue (it.lastChild() == pText2); } @@ -136,26 +136,26 @@ void TreeWalkerTest::testShowElements() assertTrue (it.currentNode() == pRoot); assertTrue (it.nextNode() == pElem1); assertTrue (it.nextNode() == pElem2); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); assertTrue (it.currentNode() == pElem2); assertTrue (it.previousNode() == pElem1); assertTrue (it.previousNode() == pRoot); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); assertTrue (it.currentNode() == pRoot); - assertTrue (it.parentNode() == 0); + assertTrue (it.parentNode() == nullptr); assertTrue (it.currentNode() == pRoot); assertTrue (it.firstChild() == pElem1); assertTrue (it.parentNode() == pRoot); assertTrue (it.lastChild() == pElem2); - assertTrue (it.firstChild() == 0); + assertTrue (it.firstChild() == nullptr); assertTrue (it.currentNode() == pElem2); - assertTrue (it.lastChild() == 0); + assertTrue (it.lastChild() == nullptr); assertTrue (it.currentNode() == pElem2); assertTrue (it.previousSibling() == pElem1); - assertTrue (it.firstChild() == 0); - assertTrue (it.lastChild() == 0); + assertTrue (it.firstChild() == nullptr); + assertTrue (it.lastChild() == nullptr); assertTrue (it.parentNode() == pRoot); } @@ -179,53 +179,53 @@ void TreeWalkerTest::testFilter() TreeWalker it1(pRoot, NodeFilter::SHOW_ELEMENT, &skipFilter); assertTrue (it1.nextNode() == pElem1); - assertTrue (it1.nextNode() == 0); + assertTrue (it1.nextNode() == nullptr); assertTrue (it1.currentNode() == pElem1); - assertTrue (it1.previousNode() == 0); + assertTrue (it1.previousNode() == nullptr); - assertTrue (it1.parentNode() == 0); - assertTrue (it1.firstChild() == 0); - assertTrue (it1.lastChild() == 0); - assertTrue (it1.nextSibling() == 0); - assertTrue (it1.previousSibling() == 0); + assertTrue (it1.parentNode() == nullptr); + assertTrue (it1.firstChild() == nullptr); + assertTrue (it1.lastChild() == nullptr); + assertTrue (it1.nextSibling() == nullptr); + assertTrue (it1.previousSibling() == nullptr); TreeWalker it2(pRoot, NodeFilter::SHOW_ALL, &skipFilter); assertTrue (it2.nextNode() == pElem1); assertTrue (it2.nextNode() == pText1); assertTrue (it2.nextNode() == pText2); - assertTrue (it2.nextNode() == 0); + assertTrue (it2.nextNode() == nullptr); assertTrue (it2.currentNode() == pText2); assertTrue (it2.previousNode() == pText1); assertTrue (it2.previousNode() == pElem1); - assertTrue (it2.previousNode() == 0); + assertTrue (it2.previousNode() == nullptr); assertTrue (it2.currentNode() == pElem1); - assertTrue (it2.parentNode() == 0); - assertTrue (it2.nextSibling() == 0); - assertTrue (it2.previousSibling() == 0); + assertTrue (it2.parentNode() == nullptr); + assertTrue (it2.nextSibling() == nullptr); + assertTrue (it2.previousSibling() == nullptr); assertTrue (it2.firstChild() == pText1); - assertTrue (it2.nextSibling() == 0); - assertTrue (it2.previousSibling() == 0); + assertTrue (it2.nextSibling() == nullptr); + assertTrue (it2.previousSibling() == nullptr); assertTrue (it2.parentNode() == pElem1); RejectNodeFilter rejectFilter; TreeWalker it3(pRoot, NodeFilter::SHOW_ELEMENT, &rejectFilter); assertTrue (it3.nextNode() == pElem1); - assertTrue (it3.nextNode() == 0); + assertTrue (it3.nextNode() == nullptr); assertTrue (it3.currentNode() == pElem1); assertTrue (it3.previousNode() == pRoot); - assertTrue (it3.previousNode() == 0); + assertTrue (it3.previousNode() == nullptr); assertTrue (it3.currentNode() == pRoot); - assertTrue (it3.parentNode() == 0); + assertTrue (it3.parentNode() == nullptr); assertTrue (it3.firstChild() == pElem1); - assertTrue (it3.nextSibling() == 0); - assertTrue (it3.previousSibling() == 0); + assertTrue (it3.nextSibling() == nullptr); + assertTrue (it3.previousSibling() == nullptr); assertTrue (it3.parentNode() == pRoot); assertTrue (it3.lastChild() == pElem1); @@ -233,24 +233,24 @@ void TreeWalkerTest::testFilter() assertTrue (it4.nextNode() == pElem1); assertTrue (it4.nextNode() == pText1); - assertTrue (it4.nextNode() == 0); + assertTrue (it4.nextNode() == nullptr); assertTrue (it4.currentNode() == pText1); assertTrue (it4.previousNode() == pElem1); assertTrue (it4.previousNode() == pRoot); - assertTrue (it4.previousNode() == 0); + assertTrue (it4.previousNode() == nullptr); assertTrue (it4.currentNode() == pRoot); - assertTrue (it4.parentNode() == 0); + assertTrue (it4.parentNode() == nullptr); assertTrue (it4.firstChild() == pElem1); assertTrue (it4.firstChild() == pText1); - assertTrue (it4.nextSibling() == 0); - assertTrue (it4.previousSibling() == 0); + assertTrue (it4.nextSibling() == nullptr); + assertTrue (it4.previousSibling() == nullptr); assertTrue (it4.parentNode() == pElem1); assertTrue (it4.lastChild() == pText1); assertTrue (it4.parentNode() == pElem1); - assertTrue (it4.nextSibling() == 0); - assertTrue (it4.previousSibling() == 0); + assertTrue (it4.nextSibling() == nullptr); + assertTrue (it4.previousSibling() == nullptr); assertTrue (it4.parentNode() == pRoot); } @@ -272,15 +272,15 @@ void TreeWalkerTest::testShowNothing() TreeWalker it(pRoot, 0); - assertTrue (it.nextNode() == 0); + assertTrue (it.nextNode() == nullptr); - assertTrue (it.previousNode() == 0); + assertTrue (it.previousNode() == nullptr); assertTrue (it.currentNode() == pRoot); - assertTrue (it.firstChild() == 0); - assertTrue (it.lastChild() == 0); - assertTrue (it.nextSibling() == 0); - assertTrue (it.previousSibling() == 0); + assertTrue (it.firstChild() == nullptr); + assertTrue (it.lastChild() == nullptr); + assertTrue (it.nextSibling() == nullptr); + assertTrue (it.previousSibling() == nullptr); } diff --git a/XML/testsuite/src/XMLWriterTest.cpp b/XML/testsuite/src/XMLWriterTest.cpp index 77898a1ee..9ab01faf9 100644 --- a/XML/testsuite/src/XMLWriterTest.cpp +++ b/XML/testsuite/src/XMLWriterTest.cpp @@ -173,9 +173,9 @@ void XMLWriterTest::testDTDNotation() writer.startDocument(); writer.startDTD("test", "", ""); std::string systemId("quicktime"); - writer.notationDecl("mov", 0, &systemId); + writer.notationDecl("mov", nullptr, &systemId); std::string publicId("-//W3C//NOTATION XML 1.0//EN"); - writer.notationDecl("xml", &publicId, 0); + writer.notationDecl("xml", &publicId, nullptr); writer.endDTD(); writer.startElement("", "", "foo"); writer.endElement("", "", "foo"); @@ -198,9 +198,9 @@ void XMLWriterTest::testDTDEntity() writer.startDocument(); writer.startDTD("test", "", ""); std::string systemId("quicktime"); - writer.notationDecl("mov", 0, &systemId); + writer.notationDecl("mov", nullptr, &systemId); std::string publicId("-//W3C//NOTATION XML 1.0//EN"); - writer.unparsedEntityDecl("movie", 0, "movie.mov", "mov"); + writer.unparsedEntityDecl("movie", nullptr, "movie.mov", "mov"); writer.endDTD(); writer.startElement("", "", "foo"); writer.endElement("", "", "foo"); diff --git a/Zip/src/AutoDetectStream.cpp b/Zip/src/AutoDetectStream.cpp index e60060d36..61211c913 100644 --- a/Zip/src/AutoDetectStream.cpp +++ b/Zip/src/AutoDetectStream.cpp @@ -48,7 +48,7 @@ AutoDetectStreamBuf::~AutoDetectStreamBuf() int AutoDetectStreamBuf::readFromDevice(char* buffer, std::streamsize length) { poco_assert_dbg(length >= 8); - if (_pIstr == 0 || length == 0) return -1; + if (_pIstr == nullptr || length == 0) return -1; if (_reposition) { diff --git a/Zip/src/PartialStream.cpp b/Zip/src/PartialStream.cpp index c0282537d..32a4513c2 100644 --- a/Zip/src/PartialStream.cpp +++ b/Zip/src/PartialStream.cpp @@ -28,7 +28,7 @@ PartialStreamBuf::PartialStreamBuf(std::istream& in, std::ios::pos_type start, s _numBytes(end-start), _bytesWritten(0), _pIstr(&in), - _pOstr(0), + _pOstr(nullptr), _prefix(pre), _postfix(post), _ignoreStart(0), @@ -44,7 +44,7 @@ PartialStreamBuf::PartialStreamBuf(std::ostream& out, std::size_t start, std::si _start(0), _numBytes(0), _bytesWritten(0), - _pIstr(0), + _pIstr(nullptr), _pOstr(&out), _ignoreStart(start), _buffer(end), @@ -60,7 +60,7 @@ PartialStreamBuf::~PartialStreamBuf() int PartialStreamBuf::readFromDevice(char* buffer, std::streamsize length) { - if (_pIstr == 0 ||length == 0) return -1; + if (_pIstr == nullptr ||length == 0) return -1; if (!_initialized) { _initialized = true; @@ -106,7 +106,7 @@ int PartialStreamBuf::readFromDevice(char* buffer, std::streamsize length) int PartialStreamBuf::writeToDevice(const char* buffer, std::streamsize length) { - if (_pOstr == 0 || length == 0) return -1; + if (_pOstr == nullptr || length == 0) return -1; if (!_initialized) { _initialized = true; diff --git a/Zip/src/ZipManipulator.cpp b/Zip/src/ZipManipulator.cpp index 5e3377984..20e2583bc 100644 --- a/Zip/src/ZipManipulator.cpp +++ b/Zip/src/ZipManipulator.cpp @@ -34,7 +34,7 @@ ZipManipulator::ZipManipulator(const std::string& zipFile, bool backupOriginalFi _zipFile(zipFile), _backupOriginalFile(backupOriginalFile), _changes(), - _in(0) + _in(nullptr) { Poco::FileInputStream in(zipFile); _in = new ZipArchive(in); diff --git a/Zip/src/ZipStream.cpp b/Zip/src/ZipStream.cpp index 0436264fa..f0227ca1c 100644 --- a/Zip/src/ZipStream.cpp +++ b/Zip/src/ZipStream.cpp @@ -32,7 +32,7 @@ namespace Zip { ZipStreamBuf::ZipStreamBuf(std::istream& istr, const ZipLocalFileHeader& fileEntry, bool reposition): Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::in), _pIstr(&istr), - _pOstr(0), + _pOstr(nullptr), _ptrBuf(), _ptrOBuf(), _ptrHelper(), @@ -41,7 +41,7 @@ ZipStreamBuf::ZipStreamBuf(std::istream& istr, const ZipLocalFileHeader& fileEnt _expectedCrc32(0), _checkCRC(true), _bytesWritten(0), - _pHeader(0) + _pHeader(nullptr) { if (fileEntry.isDirectory()) return; @@ -82,7 +82,7 @@ ZipStreamBuf::ZipStreamBuf(std::istream& istr, const ZipLocalFileHeader& fileEnt ZipStreamBuf::ZipStreamBuf(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bool reposition): Poco::BufferedStreamBuf(STREAM_BUFFER_SIZE, std::ios::out), - _pIstr(0), + _pIstr(nullptr), _pOstr(&ostr), _ptrBuf(), _ptrOBuf(), @@ -140,10 +140,10 @@ ZipStreamBuf::ZipStreamBuf(std::ostream& ostr, ZipLocalFileHeader& fileEntry, bo ZipStreamBuf::~ZipStreamBuf() { // make sure destruction of streams happens in correct order - _ptrOBuf = 0; - _ptrOHelper = 0; - _ptrBuf = 0; - _ptrHelper = 0; + _ptrOBuf = nullptr; + _ptrOHelper = nullptr; + _ptrBuf = nullptr; + _ptrHelper = nullptr; } @@ -207,7 +207,7 @@ void ZipStreamBuf::close(Poco::UInt64& extraDataSize) _ptrOHelper->flush(); _ptrOHelper->close(); } - _ptrOBuf = 0; + _ptrOBuf = nullptr; if (!*_pOstr) throw Poco::IOException("Bad output stream"); // write an extra datablock if required @@ -258,7 +258,7 @@ void ZipStreamBuf::close(Poco::UInt64& extraDataSize) _pOstr->seekp(0, std::ios_base::end); if (!*_pOstr) throw Poco::IOException("Bad output stream"); } - _pHeader = 0; + _pHeader = nullptr; } } diff --git a/cmake/DefinePlatformSpecific.cmake b/cmake/DefinePlatformSpecific.cmake index c87c31b6a..94fe609fc 100644 --- a/cmake/DefinePlatformSpecific.cmake +++ b/cmake/DefinePlatformSpecific.cmake @@ -62,9 +62,13 @@ if (ENABLE_COMPILER_WARNINGS) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # using clang add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter) + # Warn when using 0 or NULL instead of nullptr constant + add_compile_options(-Wzero-as-null-pointer-constant) elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # using GCC add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter) + # Warn when using 0 or NULL instead of nullptr constant + add_compile_options(-Wzero-as-null-pointer-constant) elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # using Visual Studio C++ add_compile_options(/W4) diff --git a/dependencies/v8_double_conversion/src/bignum-dtoa.h b/dependencies/v8_double_conversion/src/bignum-dtoa.h index 34b961992..063c5741b 100644 --- a/dependencies/v8_double_conversion/src/bignum-dtoa.h +++ b/dependencies/v8_double_conversion/src/bignum-dtoa.h @@ -77,7 +77,7 @@ enum BignumDtoaMode { // 'BignumDtoa' expects the given buffer to be big enough to hold all digits // and a terminating null-character. void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, - Vector buffer, int* length, int* point); + Vector buffer, int* length, int* point); } // namespace double_conversion diff --git a/dependencies/v8_double_conversion/src/bignum.h b/dependencies/v8_double_conversion/src/bignum.h index 14d1ca86f..12ec101bd 100644 --- a/dependencies/v8_double_conversion/src/bignum.h +++ b/dependencies/v8_double_conversion/src/bignum.h @@ -75,27 +75,27 @@ class Bignum { // +1 if a > b. static int Compare(const Bignum& a, const Bignum& b); static bool Equal(const Bignum& a, const Bignum& b) { - return Compare(a, b) == 0; + return Compare(a, b) == 0; } static bool LessEqual(const Bignum& a, const Bignum& b) { - return Compare(a, b) <= 0; + return Compare(a, b) <= 0; } static bool Less(const Bignum& a, const Bignum& b) { - return Compare(a, b) < 0; + return Compare(a, b) < 0; } // Returns Compare(a + b, c); static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c); // Returns a + b == c static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) { - return PlusCompare(a, b, c) == 0; + return PlusCompare(a, b, c) == 0; } // Returns a + b <= c static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) { - return PlusCompare(a, b, c) <= 0; + return PlusCompare(a, b, c) <= 0; } // Returns a + b < c static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) { - return PlusCompare(a, b, c) < 0; + return PlusCompare(a, b, c) < 0; } private: typedef uint32_t Chunk; @@ -112,18 +112,18 @@ class Bignum { static const int kBigitCapacity = kMaxSignificantBits / kBigitSize; static void EnsureCapacity(const int size) { - if (size > kBigitCapacity) { - DOUBLE_CONVERSION_UNREACHABLE(); - } + if (size > kBigitCapacity) { + DOUBLE_CONVERSION_UNREACHABLE(); + } } void Align(const Bignum& other); void Clamp(); bool IsClamped() const { - return used_bigits_ == 0 || RawBigit(used_bigits_ - 1) != 0; + return used_bigits_ == 0 || RawBigit(used_bigits_ - 1) != 0; } void Zero() { - used_bigits_ = 0; - exponent_ = 0; + used_bigits_ = 0; + exponent_ = 0; } // Requires this to have enough capacity (no tests done). // Updates used_bigits_ if necessary. diff --git a/dependencies/v8_double_conversion/src/cached-powers.h b/dependencies/v8_double_conversion/src/cached-powers.h index f38c26d20..ab5144b63 100644 --- a/dependencies/v8_double_conversion/src/cached-powers.h +++ b/dependencies/v8_double_conversion/src/cached-powers.h @@ -44,9 +44,9 @@ namespace PowersOfTenCache { // Returns a cached power-of-ten with a binary exponent in the range // [min_exponent; max_exponent] (boundaries included). void GetCachedPowerForBinaryExponentRange(int min_exponent, - int max_exponent, - DiyFp* power, - int* decimal_exponent); + int max_exponent, + DiyFp* power, + int* decimal_exponent); // Returns a cached power of ten x ~= 10^k such that // k <= decimal_exponent < k + kCachedPowersDecimalDistance. @@ -54,8 +54,8 @@ namespace PowersOfTenCache { // kMinDecimalExponent <= requested_exponent, and // requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance. void GetCachedPowerForDecimalExponent(int requested_exponent, - DiyFp* power, - int* found_exponent); + DiyFp* power, + int* found_exponent); } // namespace PowersOfTenCache diff --git a/dependencies/v8_double_conversion/src/diy-fp.h b/dependencies/v8_double_conversion/src/diy-fp.h index a2200c4de..5a8fc7ee3 100644 --- a/dependencies/v8_double_conversion/src/diy-fp.h +++ b/dependencies/v8_double_conversion/src/diy-fp.h @@ -50,73 +50,73 @@ class DiyFp { // must be greater or equal than the significand of other. // The result will not be normalized. void Subtract(const DiyFp& other) { - DOUBLE_CONVERSION_ASSERT(e_ == other.e_); - DOUBLE_CONVERSION_ASSERT(f_ >= other.f_); - f_ -= other.f_; + DOUBLE_CONVERSION_ASSERT(e_ == other.e_); + DOUBLE_CONVERSION_ASSERT(f_ >= other.f_); + f_ -= other.f_; } // Returns a - b. // The exponents of both numbers must be the same and a must be greater // or equal than b. The result will not be normalized. static DiyFp Minus(const DiyFp& a, const DiyFp& b) { - DiyFp result = a; - result.Subtract(b); - return result; + DiyFp result = a; + result.Subtract(b); + return result; } // this *= other. void Multiply(const DiyFp& other) { - // Simply "emulates" a 128 bit multiplication. - // However: the resulting number only contains 64 bits. The least - // significant 64 bits are only used for rounding the most significant 64 - // bits. - const uint64_t kM32 = 0xFFFFFFFFU; - const uint64_t a = f_ >> 32; - const uint64_t b = f_ & kM32; - const uint64_t c = other.f_ >> 32; - const uint64_t d = other.f_ & kM32; - const uint64_t ac = a * c; - const uint64_t bc = b * c; - const uint64_t ad = a * d; - const uint64_t bd = b * d; - // By adding 1U << 31 to tmp we round the final result. - // Halfway cases will be rounded up. - const uint64_t tmp = (bd >> 32) + (ad & kM32) + (bc & kM32) + (1U << 31); - e_ += other.e_ + 64; - f_ = ac + (ad >> 32) + (bc >> 32) + (tmp >> 32); + // Simply "emulates" a 128 bit multiplication. + // However: the resulting number only contains 64 bits. The least + // significant 64 bits are only used for rounding the most significant 64 + // bits. + const uint64_t kM32 = 0xFFFFFFFFU; + const uint64_t a = f_ >> 32; + const uint64_t b = f_ & kM32; + const uint64_t c = other.f_ >> 32; + const uint64_t d = other.f_ & kM32; + const uint64_t ac = a * c; + const uint64_t bc = b * c; + const uint64_t ad = a * d; + const uint64_t bd = b * d; + // By adding 1U << 31 to tmp we round the final result. + // Halfway cases will be rounded up. + const uint64_t tmp = (bd >> 32) + (ad & kM32) + (bc & kM32) + (1U << 31); + e_ += other.e_ + 64; + f_ = ac + (ad >> 32) + (bc >> 32) + (tmp >> 32); } // returns a * b; static DiyFp Times(const DiyFp& a, const DiyFp& b) { - DiyFp result = a; - result.Multiply(b); - return result; + DiyFp result = a; + result.Multiply(b); + return result; } void Normalize() { - DOUBLE_CONVERSION_ASSERT(f_ != 0); - uint64_t significand = f_; - int32_t exponent = e_; + DOUBLE_CONVERSION_ASSERT(f_ != 0); + uint64_t significand = f_; + int32_t exponent = e_; - // This method is mainly called for normalizing boundaries. In general, - // boundaries need to be shifted by 10 bits, and we optimize for this case. - const uint64_t k10MSBits = DOUBLE_CONVERSION_UINT64_2PART_C(0xFFC00000, 00000000); - while ((significand & k10MSBits) == 0) { - significand <<= 10; - exponent -= 10; - } - while ((significand & kUint64MSB) == 0) { - significand <<= 1; - exponent--; - } - f_ = significand; - e_ = exponent; + // This method is mainly called for normalizing boundaries. In general, + // boundaries need to be shifted by 10 bits, and we optimize for this case. + const uint64_t k10MSBits = DOUBLE_CONVERSION_UINT64_2PART_C(0xFFC00000, 00000000); + while ((significand & k10MSBits) == 0) { + significand <<= 10; + exponent -= 10; + } + while ((significand & kUint64MSB) == 0) { + significand <<= 1; + exponent--; + } + f_ = significand; + e_ = exponent; } static DiyFp Normalize(const DiyFp& a) { - DiyFp result = a; - result.Normalize(); - return result; + DiyFp result = a; + result.Normalize(); + return result; } uint64_t f() const { return f_; } diff --git a/dependencies/v8_double_conversion/src/fast-dtoa.h b/dependencies/v8_double_conversion/src/fast-dtoa.h index 5f1e8eee5..eca5da000 100644 --- a/dependencies/v8_double_conversion/src/fast-dtoa.h +++ b/dependencies/v8_double_conversion/src/fast-dtoa.h @@ -77,11 +77,11 @@ static const int kFastDtoaMaximalSingleLength = 9; // false. // For both modes the buffer must be large enough to hold the result. bool FastDtoa(double d, - FastDtoaMode mode, - int requested_digits, - Vector buffer, - int* length, - int* decimal_point); + FastDtoaMode mode, + int requested_digits, + Vector buffer, + int* length, + int* decimal_point); } // namespace double_conversion diff --git a/dependencies/v8_double_conversion/src/fixed-dtoa.h b/dependencies/v8_double_conversion/src/fixed-dtoa.h index 3bdd08e21..8a371ba1b 100644 --- a/dependencies/v8_double_conversion/src/fixed-dtoa.h +++ b/dependencies/v8_double_conversion/src/fixed-dtoa.h @@ -49,7 +49,7 @@ namespace double_conversion { // This method only works for some parameters. If it can't handle the input it // returns false. The output is null-terminated when the function succeeds. bool FastFixedDtoa(double v, int fractional_count, - Vector buffer, int* length, int* decimal_point); + Vector buffer, int* length, int* decimal_point); } // namespace double_conversion diff --git a/dependencies/v8_double_conversion/src/ieee.h b/dependencies/v8_double_conversion/src/ieee.h index 9203f4d55..e3ba809e6 100644 --- a/dependencies/v8_double_conversion/src/ieee.h +++ b/dependencies/v8_double_conversion/src/ieee.h @@ -55,133 +55,133 @@ class Double { explicit Double(double d) : d64_(double_to_uint64(d)) {} explicit Double(uint64_t d64) : d64_(d64) {} explicit Double(DiyFp diy_fp) - : d64_(DiyFpToUint64(diy_fp)) {} + : d64_(DiyFpToUint64(diy_fp)) {} // The value encoded by this Double must be greater or equal to +0.0. // It must not be special (infinity, or NaN). DiyFp AsDiyFp() const { - DOUBLE_CONVERSION_ASSERT(Sign() > 0); - DOUBLE_CONVERSION_ASSERT(!IsSpecial()); - return DiyFp(Significand(), Exponent()); + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + DOUBLE_CONVERSION_ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); } // The value encoded by this Double must be strictly greater than 0. DiyFp AsNormalizedDiyFp() const { - DOUBLE_CONVERSION_ASSERT(value() > 0.0); - uint64_t f = Significand(); - int e = Exponent(); + DOUBLE_CONVERSION_ASSERT(value() > 0.0); + uint64_t f = Significand(); + int e = Exponent(); - // The current double could be a denormal. - while ((f & kHiddenBit) == 0) { - f <<= 1; - e--; - } - // Do the final shifts in one go. - f <<= DiyFp::kSignificandSize - kSignificandSize; - e -= DiyFp::kSignificandSize - kSignificandSize; - return DiyFp(f, e); + // The current double could be a denormal. + while ((f & kHiddenBit) == 0) { + f <<= 1; + e--; + } + // Do the final shifts in one go. + f <<= DiyFp::kSignificandSize - kSignificandSize; + e -= DiyFp::kSignificandSize - kSignificandSize; + return DiyFp(f, e); } // Returns the double's bit as uint64. uint64_t AsUint64() const { - return d64_; + return d64_; } // Returns the next greater double. Returns +infinity on input +infinity. double NextDouble() const { - if (d64_ == kInfinity) return Double(kInfinity).value(); - if (Sign() < 0 && Significand() == 0) { - // -0.0 - return 0.0; - } - if (Sign() < 0) { - return Double(d64_ - 1).value(); - } else { - return Double(d64_ + 1).value(); - } + if (d64_ == kInfinity) return Double(kInfinity).value(); + if (Sign() < 0 && Significand() == 0) { + // -0.0 + return 0.0; + } + if (Sign() < 0) { + return Double(d64_ - 1).value(); + } else { + return Double(d64_ + 1).value(); + } } double PreviousDouble() const { - if (d64_ == (kInfinity | kSignMask)) return -Infinity(); - if (Sign() < 0) { - return Double(d64_ + 1).value(); - } else { - if (Significand() == 0) return -0.0; - return Double(d64_ - 1).value(); - } + if (d64_ == (kInfinity | kSignMask)) return -Infinity(); + if (Sign() < 0) { + return Double(d64_ + 1).value(); + } else { + if (Significand() == 0) return -0.0; + return Double(d64_ - 1).value(); + } } int Exponent() const { - if (IsDenormal()) return kDenormalExponent; + if (IsDenormal()) return kDenormalExponent; - uint64_t d64 = AsUint64(); - int biased_e = - static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); - return biased_e - kExponentBias; + uint64_t d64 = AsUint64(); + int biased_e = + static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; } uint64_t Significand() const { - uint64_t d64 = AsUint64(); - uint64_t significand = d64 & kSignificandMask; - if (!IsDenormal()) { - return significand + kHiddenBit; - } else { - return significand; - } + uint64_t d64 = AsUint64(); + uint64_t significand = d64 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } } // Returns true if the double is a denormal. bool IsDenormal() const { - uint64_t d64 = AsUint64(); - return (d64 & kExponentMask) == 0; + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == 0; } // We consider denormals not to be special. // Hence only Infinity and NaN are special. bool IsSpecial() const { - uint64_t d64 = AsUint64(); - return (d64 & kExponentMask) == kExponentMask; + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == kExponentMask; } bool IsNan() const { - uint64_t d64 = AsUint64(); - return ((d64 & kExponentMask) == kExponentMask) && - ((d64 & kSignificandMask) != 0); + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) != 0); } bool IsQuietNan() const { #if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) - return IsNan() && ((AsUint64() & kQuietNanBit) == 0); + return IsNan() && ((AsUint64() & kQuietNanBit) == 0); #else - return IsNan() && ((AsUint64() & kQuietNanBit) != 0); + return IsNan() && ((AsUint64() & kQuietNanBit) != 0); #endif } bool IsSignalingNan() const { #if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) - return IsNan() && ((AsUint64() & kQuietNanBit) != 0); + return IsNan() && ((AsUint64() & kQuietNanBit) != 0); #else - return IsNan() && ((AsUint64() & kQuietNanBit) == 0); + return IsNan() && ((AsUint64() & kQuietNanBit) == 0); #endif } bool IsInfinite() const { - uint64_t d64 = AsUint64(); - return ((d64 & kExponentMask) == kExponentMask) && - ((d64 & kSignificandMask) == 0); + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) == 0); } int Sign() const { - uint64_t d64 = AsUint64(); - return (d64 & kSignMask) == 0? 1: -1; + uint64_t d64 = AsUint64(); + return (d64 & kSignMask) == 0? 1: -1; } // Precondition: the value encoded by this Double must be greater or equal // than +0.0. DiyFp UpperBoundary() const { - DOUBLE_CONVERSION_ASSERT(Sign() > 0); - return DiyFp(Significand() * 2 + 1, Exponent() - 1); + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); } // Computes the two boundaries of this. @@ -189,32 +189,32 @@ class Double { // exponent as m_plus. // Precondition: the value encoded by this Double must be greater than 0. void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { - DOUBLE_CONVERSION_ASSERT(value() > 0.0); - DiyFp v = this->AsDiyFp(); - DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); - DiyFp m_minus; - if (LowerBoundaryIsCloser()) { - m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); - } else { - m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); - } - m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); - m_minus.set_e(m_plus.e()); - *out_m_plus = m_plus; - *out_m_minus = m_minus; + DOUBLE_CONVERSION_ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; } bool LowerBoundaryIsCloser() const { - // The boundary is closer if the significand is of the form f == 2^p-1 then - // the lower boundary is closer. - // Think of v = 1000e10 and v- = 9999e9. - // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but - // at a distance of 1e8. - // The only exception is for the smallest normal: the largest denormal is - // at the same distance as its successor. - // Note: denormals have the same exponent as the smallest normals. - bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); - return physical_significand_is_zero && (Exponent() != kDenormalExponent); + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); } double value() const { return uint64_to_double(d64_); } @@ -226,19 +226,19 @@ class Double { // kSignificandSize. The only exceptions are denormals. They start with // leading zeroes and their effective significand-size is hence smaller. static int SignificandSizeForOrderOfMagnitude(int order) { - if (order >= (kDenormalExponent + kSignificandSize)) { - return kSignificandSize; - } - if (order <= kDenormalExponent) return 0; - return order - kDenormalExponent; + if (order >= (kDenormalExponent + kSignificandSize)) { + return kSignificandSize; + } + if (order <= kDenormalExponent) return 0; + return order - kDenormalExponent; } static double Infinity() { - return Double(kInfinity).value(); + return Double(kInfinity).value(); } static double NaN() { - return Double(kNaN).value(); + return Double(kNaN).value(); } private: @@ -254,30 +254,30 @@ class Double { const uint64_t d64_; static uint64_t DiyFpToUint64(DiyFp diy_fp) { - uint64_t significand = diy_fp.f(); - int exponent = diy_fp.e(); - while (significand > kHiddenBit + kSignificandMask) { - significand >>= 1; - exponent++; - } - if (exponent >= kMaxExponent) { - return kInfinity; - } - if (exponent < kDenormalExponent) { - return 0; - } - while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { - significand <<= 1; - exponent--; - } - uint64_t biased_exponent; - if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { - biased_exponent = 0; - } else { - biased_exponent = static_cast(exponent + kExponentBias); - } - return (significand & kSignificandMask) | - (biased_exponent << kPhysicalSignificandSize); + uint64_t significand = diy_fp.f(); + int exponent = diy_fp.e(); + while (significand > kHiddenBit + kSignificandMask) { + significand >>= 1; + exponent++; + } + if (exponent >= kMaxExponent) { + return kInfinity; + } + if (exponent < kDenormalExponent) { + return 0; + } + while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { + significand <<= 1; + exponent--; + } + uint64_t biased_exponent; + if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { + biased_exponent = 0; + } else { + biased_exponent = static_cast(exponent + kExponentBias); + } + return (significand & kSignificandMask) | + (biased_exponent << kPhysicalSignificandSize); } DOUBLE_CONVERSION_DISALLOW_COPY_AND_ASSIGN(Double); @@ -300,80 +300,80 @@ class Single { // The value encoded by this Single must be greater or equal to +0.0. // It must not be special (infinity, or NaN). DiyFp AsDiyFp() const { - DOUBLE_CONVERSION_ASSERT(Sign() > 0); - DOUBLE_CONVERSION_ASSERT(!IsSpecial()); - return DiyFp(Significand(), Exponent()); + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + DOUBLE_CONVERSION_ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); } // Returns the single's bit as uint64. uint32_t AsUint32() const { - return d32_; + return d32_; } int Exponent() const { - if (IsDenormal()) return kDenormalExponent; + if (IsDenormal()) return kDenormalExponent; - uint32_t d32 = AsUint32(); - int biased_e = - static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); - return biased_e - kExponentBias; + uint32_t d32 = AsUint32(); + int biased_e = + static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; } uint32_t Significand() const { - uint32_t d32 = AsUint32(); - uint32_t significand = d32 & kSignificandMask; - if (!IsDenormal()) { - return significand + kHiddenBit; - } else { - return significand; - } + uint32_t d32 = AsUint32(); + uint32_t significand = d32 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } } // Returns true if the single is a denormal. bool IsDenormal() const { - uint32_t d32 = AsUint32(); - return (d32 & kExponentMask) == 0; + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == 0; } // We consider denormals not to be special. // Hence only Infinity and NaN are special. bool IsSpecial() const { - uint32_t d32 = AsUint32(); - return (d32 & kExponentMask) == kExponentMask; + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == kExponentMask; } bool IsNan() const { - uint32_t d32 = AsUint32(); - return ((d32 & kExponentMask) == kExponentMask) && - ((d32 & kSignificandMask) != 0); + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) != 0); } bool IsQuietNan() const { #if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) - return IsNan() && ((AsUint32() & kQuietNanBit) == 0); + return IsNan() && ((AsUint32() & kQuietNanBit) == 0); #else - return IsNan() && ((AsUint32() & kQuietNanBit) != 0); + return IsNan() && ((AsUint32() & kQuietNanBit) != 0); #endif } bool IsSignalingNan() const { #if (defined(__mips__) && !defined(__mips_nan2008)) || defined(__hppa__) - return IsNan() && ((AsUint32() & kQuietNanBit) != 0); + return IsNan() && ((AsUint32() & kQuietNanBit) != 0); #else - return IsNan() && ((AsUint32() & kQuietNanBit) == 0); + return IsNan() && ((AsUint32() & kQuietNanBit) == 0); #endif } bool IsInfinite() const { - uint32_t d32 = AsUint32(); - return ((d32 & kExponentMask) == kExponentMask) && - ((d32 & kSignificandMask) == 0); + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) == 0); } int Sign() const { - uint32_t d32 = AsUint32(); - return (d32 & kSignMask) == 0? 1: -1; + uint32_t d32 = AsUint32(); + return (d32 & kSignMask) == 0? 1: -1; } // Computes the two boundaries of this. @@ -381,49 +381,49 @@ class Single { // exponent as m_plus. // Precondition: the value encoded by this Single must be greater than 0. void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { - DOUBLE_CONVERSION_ASSERT(value() > 0.0); - DiyFp v = this->AsDiyFp(); - DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); - DiyFp m_minus; - if (LowerBoundaryIsCloser()) { - m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); - } else { - m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); - } - m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); - m_minus.set_e(m_plus.e()); - *out_m_plus = m_plus; - *out_m_minus = m_minus; + DOUBLE_CONVERSION_ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; } // Precondition: the value encoded by this Single must be greater or equal // than +0.0. DiyFp UpperBoundary() const { - DOUBLE_CONVERSION_ASSERT(Sign() > 0); - return DiyFp(Significand() * 2 + 1, Exponent() - 1); + DOUBLE_CONVERSION_ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); } bool LowerBoundaryIsCloser() const { - // The boundary is closer if the significand is of the form f == 2^p-1 then - // the lower boundary is closer. - // Think of v = 1000e10 and v- = 9999e9. - // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but - // at a distance of 1e8. - // The only exception is for the smallest normal: the largest denormal is - // at the same distance as its successor. - // Note: denormals have the same exponent as the smallest normals. - bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); - return physical_significand_is_zero && (Exponent() != kDenormalExponent); + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); } float value() const { return uint32_to_float(d32_); } static float Infinity() { - return Single(kInfinity).value(); + return Single(kInfinity).value(); } static float NaN() { - return Single(kNaN).value(); + return Single(kNaN).value(); } private: diff --git a/dependencies/v8_double_conversion/src/string-to-double.h b/dependencies/v8_double_conversion/src/string-to-double.h index fdf302d4c..ba65cfc19 100644 --- a/dependencies/v8_double_conversion/src/string-to-double.h +++ b/dependencies/v8_double_conversion/src/string-to-double.h @@ -37,16 +37,16 @@ class StringToDoubleConverter { // Enumeration for allowing octals and ignoring junk when converting // strings to numbers. enum Flags { - NO_FLAGS = 0, - ALLOW_HEX = 1, - ALLOW_OCTALS = 2, - ALLOW_TRAILING_JUNK = 4, - ALLOW_LEADING_SPACES = 8, - ALLOW_TRAILING_SPACES = 16, - ALLOW_SPACES_AFTER_SIGN = 32, - ALLOW_CASE_INSENSITIVITY = 64, - ALLOW_CASE_INSENSIBILITY = 64, // Deprecated - ALLOW_HEX_FLOATS = 128, + NO_FLAGS = 0, + ALLOW_HEX = 1, + ALLOW_OCTALS = 2, + ALLOW_TRAILING_JUNK = 4, + ALLOW_LEADING_SPACES = 8, + ALLOW_TRAILING_SPACES = 16, + ALLOW_SPACES_AFTER_SIGN = 32, + ALLOW_CASE_INSENSITIVITY = 64, + ALLOW_CASE_INSENSIBILITY = 64, // Deprecated + ALLOW_HEX_FLOATS = 128, }; static const uc16 kNoSeparator = '\0'; @@ -165,17 +165,17 @@ class StringToDoubleConverter { // StringToDouble("1.000 000") -> 1.0 // StringToDouble("1.0e1 000") -> NaN // junk_string_value StringToDoubleConverter(int flags, - double empty_string_value, - double junk_string_value, - const char* infinity_symbol, - const char* nan_symbol, - uc16 separator = kNoSeparator) - : flags_(flags), - empty_string_value_(empty_string_value), - junk_string_value_(junk_string_value), - infinity_symbol_(infinity_symbol), - nan_symbol_(nan_symbol), - separator_(separator) { + double empty_string_value, + double junk_string_value, + const char* infinity_symbol, + const char* nan_symbol, + uc16 separator = kNoSeparator) + : flags_(flags), + empty_string_value_(empty_string_value), + junk_string_value_(junk_string_value), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol), + separator_(separator) { } // Performs the conversion. @@ -184,37 +184,37 @@ class StringToDoubleConverter { // Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included // in the 'processed_characters_count'. Trailing junk is never included. double StringToDouble(const char* buffer, - int length, - int* processed_characters_count) const; + int length, + int* processed_characters_count) const; // Same as StringToDouble above but for 16 bit characters. double StringToDouble(const uc16* buffer, - int length, - int* processed_characters_count) const; + int length, + int* processed_characters_count) const; // Same as StringToDouble but reads a float. // Note that this is not equivalent to static_cast(StringToDouble(...)) // due to potential double-rounding. float StringToFloat(const char* buffer, - int length, - int* processed_characters_count) const; + int length, + int* processed_characters_count) const; // Same as StringToFloat above but for 16 bit characters. float StringToFloat(const uc16* buffer, - int length, - int* processed_characters_count) const; + int length, + int* processed_characters_count) const; // Same as StringToDouble for T = double, and StringToFloat for T = float. template T StringTo(const char* buffer, - int length, - int* processed_characters_count) const; + int length, + int* processed_characters_count) const; // Same as StringTo above but for 16 bit characters. template T StringTo(const uc16* buffer, - int length, - int* processed_characters_count) const; + int length, + int* processed_characters_count) const; private: const int flags_; @@ -226,9 +226,9 @@ class StringToDoubleConverter { template double StringToIeee(Iterator start_pointer, - int length, - bool read_as_double, - int* processed_characters_count) const; + int length, + bool read_as_double, + int* processed_characters_count) const; DOUBLE_CONVERSION_DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); }; diff --git a/dependencies/v8_double_conversion/src/strtod.h b/dependencies/v8_double_conversion/src/strtod.h index 77221fb9d..c725ffc1a 100644 --- a/dependencies/v8_double_conversion/src/strtod.h +++ b/dependencies/v8_double_conversion/src/strtod.h @@ -52,9 +52,9 @@ float StrtofTrimmed(Vector trimmed, int exponent); inline Vector TrimTrailingZeros(Vector buffer) { for (int i = buffer.length() - 1; i >= 0; --i) { - if (buffer[i] != '0') { - return buffer.SubVector(0, i + 1); - } + if (buffer[i] != '0') { + return buffer.SubVector(0, i + 1); + } } return Vector(buffer.start(), 0); } diff --git a/dependencies/v8_double_conversion/src/utils.h b/dependencies/v8_double_conversion/src/utils.h index 4f4dd71bf..91638ab47 100644 --- a/dependencies/v8_double_conversion/src/utils.h +++ b/dependencies/v8_double_conversion/src/utils.h @@ -44,7 +44,7 @@ #include #ifndef DOUBLE_CONVERSION_ASSERT #define DOUBLE_CONVERSION_ASSERT(condition) \ - assert(condition) + assert(condition) #endif #if defined(DOUBLE_CONVERSION_NON_PREFIXED_MACROS) && !defined(ASSERT) #define ASSERT DOUBLE_CONVERSION_ASSERT @@ -136,24 +136,24 @@ int main(int argc, char** argv) { // // If it prints "correct" then the architecture should be here, in the "correct" section. #if defined(_M_X64) || defined(__x86_64__) || \ - defined(__ARMEL__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \ - defined(__hppa__) || defined(__ia64__) || \ - defined(__mips__) || \ - defined(__loongarch__) || \ - defined(__nios2__) || defined(__ghs) || \ - defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ - defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ - defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ - defined(__SH4__) || defined(__alpha__) || \ - defined(_MIPS_ARCH_MIPS32R2) || defined(__ARMEB__) ||\ - defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \ - defined(__riscv) || defined(__e2k__) || \ - defined(__or1k__) || defined(__arc__) || defined(__ARC64__) || \ - defined(__microblaze__) || defined(__XTENSA__) || \ - defined(__EMSCRIPTEN__) || defined(__wasm32__) + defined(__ARMEL__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \ + defined(__hppa__) || defined(__ia64__) || \ + defined(__mips__) || \ + defined(__loongarch__) || \ + defined(__nios2__) || defined(__ghs) || \ + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || defined(__ARMEB__) ||\ + defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \ + defined(__riscv) || defined(__e2k__) || \ + defined(__or1k__) || defined(__arc__) || defined(__ARC64__) || \ + defined(__microblaze__) || defined(__XTENSA__) || \ + defined(__EMSCRIPTEN__) || defined(__wasm32__) #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 #elif defined(__mc68000__) || \ - defined(__pnacl__) || defined(__native_client__) + defined(__pnacl__) || defined(__native_client__) #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) #if defined(_WIN32) @@ -250,16 +250,16 @@ class Vector { public: Vector() : start_(DOUBLE_CONVERSION_NULLPTR), length_(0) {} Vector(T* data, int len) : start_(data), length_(len) { - DOUBLE_CONVERSION_ASSERT(len == 0 || (len > 0 && data != DOUBLE_CONVERSION_NULLPTR)); + DOUBLE_CONVERSION_ASSERT(len == 0 || (len > 0 && data != DOUBLE_CONVERSION_NULLPTR)); } // Returns a vector using the same backing storage as this one, // spanning from and including 'from', to but not including 'to'. Vector SubVector(int from, int to) { - DOUBLE_CONVERSION_ASSERT(to <= length_); - DOUBLE_CONVERSION_ASSERT(from < to); - DOUBLE_CONVERSION_ASSERT(0 <= from); - return Vector(start() + from, to - from); + DOUBLE_CONVERSION_ASSERT(to <= length_); + DOUBLE_CONVERSION_ASSERT(from < to); + DOUBLE_CONVERSION_ASSERT(0 <= from); + return Vector(start() + from, to - from); } // Returns the length of the vector. @@ -273,8 +273,8 @@ class Vector { // Access individual vector elements - checks bounds in debug mode. T& operator[](int index) const { - DOUBLE_CONVERSION_ASSERT(0 <= index && index < length_); - return start_[index]; + DOUBLE_CONVERSION_ASSERT(0 <= index && index < length_); + return start_[index]; } T& first() { return start_[0]; } @@ -282,8 +282,8 @@ class Vector { T& last() { return start_[length_ - 1]; } void pop_back() { - DOUBLE_CONVERSION_ASSERT(!is_empty()); - --length_; + DOUBLE_CONVERSION_ASSERT(!is_empty()); + --length_; } private: @@ -298,7 +298,7 @@ class Vector { class StringBuilder { public: StringBuilder(char* buffer, int buffer_size) - : buffer_(buffer, buffer_size), position_(0) { } + : buffer_(buffer, buffer_size), position_(0) { } ~StringBuilder() { if (!is_finalized()) Finalize(); } @@ -306,8 +306,8 @@ class StringBuilder { // Get the current position in the builder. int position() const { - DOUBLE_CONVERSION_ASSERT(!is_finalized()); - return position_; + DOUBLE_CONVERSION_ASSERT(!is_finalized()); + return position_; } // Reset the position. @@ -317,45 +317,45 @@ class StringBuilder { // 0-characters; use the Finalize() method to terminate the string // instead. void AddCharacter(char c) { - DOUBLE_CONVERSION_ASSERT(c != '\0'); - DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ < buffer_.length()); - buffer_[position_++] = c; + DOUBLE_CONVERSION_ASSERT(c != '\0'); + DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_++] = c; } // Add an entire string to the builder. Uses strlen() internally to // compute the length of the input string. void AddString(const char* s) { - AddSubstring(s, StrLength(s)); + AddSubstring(s, StrLength(s)); } // Add the first 'n' characters of the given string 's' to the // builder. The input string must have enough characters. void AddSubstring(const char* s, int n) { - DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ + n < buffer_.length()); - DOUBLE_CONVERSION_ASSERT(static_cast(n) <= strlen(s)); - memmove(&buffer_[position_], s, static_cast(n)); - position_ += n; + DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ + n < buffer_.length()); + DOUBLE_CONVERSION_ASSERT(static_cast(n) <= strlen(s)); + memmove(&buffer_[position_], s, static_cast(n)); + position_ += n; } // Add character padding to the builder. If count is non-positive, // nothing is added to the builder. void AddPadding(char c, int count) { - for (int i = 0; i < count; i++) { - AddCharacter(c); - } + for (int i = 0; i < count; i++) { + AddCharacter(c); + } } // Finalize the string by 0-terminating it and returning the buffer. char* Finalize() { - DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ < buffer_.length()); - buffer_[position_] = '\0'; - // Make sure nobody managed to add a 0-character to the - // buffer while building the string. - DOUBLE_CONVERSION_ASSERT(strlen(buffer_.start()) == static_cast(position_)); - position_ = -1; - DOUBLE_CONVERSION_ASSERT(is_finalized()); - return buffer_.start(); + DOUBLE_CONVERSION_ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_] = '\0'; + // Make sure nobody managed to add a 0-character to the + // buffer while building the string. + DOUBLE_CONVERSION_ASSERT(strlen(buffer_.start()) == static_cast(position_)); + position_ = -1; + DOUBLE_CONVERSION_ASSERT(is_finalized()); + return buffer_.start(); } private: @@ -397,7 +397,7 @@ Dest BitCast(const Source& source) { // A compile error here means your Dest and Source have different sizes. #if __cplusplus >= 201103L static_assert(sizeof(Dest) == sizeof(Source), - "source and destination size mismatch"); + "source and destination size mismatch"); #else DOUBLE_CONVERSION_UNUSED typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];