From 6fd12a076d213255e37c00ca8955baa5f1cb77a1 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 5 Jul 2018 16:43:26 +0200 Subject: [PATCH 001/569] add scripts for automated building of C# nuget on Kokoro --- kokoro/release/csharp/windows/build_nuget.bat | 5 +++++ kokoro/release/csharp/windows/release.cfg | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 kokoro/release/csharp/windows/build_nuget.bat create mode 100644 kokoro/release/csharp/windows/release.cfg diff --git a/kokoro/release/csharp/windows/build_nuget.bat b/kokoro/release/csharp/windows/build_nuget.bat new file mode 100644 index 0000000000..bc15bd57ef --- /dev/null +++ b/kokoro/release/csharp/windows/build_nuget.bat @@ -0,0 +1,5 @@ +@rem enter repo root +cd /d %~dp0\..\..\..\.. + +cd csharp\src +call build_packages.bat diff --git a/kokoro/release/csharp/windows/release.cfg b/kokoro/release/csharp/windows/release.cfg new file mode 100644 index 0000000000..f508c65bda --- /dev/null +++ b/kokoro/release/csharp/windows/release.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/release/csharp/windows/build_nuget.bat" +timeout_mins: 60 + +action { + define_artifacts { + regex: "**/*.nupkg" + } +} From 9d0b9e4ea01fd1d895e312ee15a01866ad29085d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 13 Jul 2018 11:45:28 +0200 Subject: [PATCH 002/569] fix build_nuget.bat --- kokoro/release/csharp/windows/build_nuget.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kokoro/release/csharp/windows/build_nuget.bat b/kokoro/release/csharp/windows/build_nuget.bat index bc15bd57ef..5da1e13602 100644 --- a/kokoro/release/csharp/windows/build_nuget.bat +++ b/kokoro/release/csharp/windows/build_nuget.bat @@ -1,5 +1,5 @@ @rem enter repo root cd /d %~dp0\..\..\..\.. -cd csharp\src +cd csharp call build_packages.bat From 937884476e8a5873af4e2a44762ed76865ffd877 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 13 Jul 2018 13:26:56 +0200 Subject: [PATCH 003/569] overcome the global.json constraint with a hack --- kokoro/release/csharp/windows/build_nuget.bat | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kokoro/release/csharp/windows/build_nuget.bat b/kokoro/release/csharp/windows/build_nuget.bat index 5da1e13602..7552bec3a9 100644 --- a/kokoro/release/csharp/windows/build_nuget.bat +++ b/kokoro/release/csharp/windows/build_nuget.bat @@ -2,4 +2,13 @@ cd /d %~dp0\..\..\..\.. cd csharp + +@rem see what dotnet version is available +dotnet --version + +@rem TODO(jtattermusch): Kokoro workers currently only have dotnet SDK 2.1.3 +@rem so we just overwrite the SDK requirement in global.json as the results +@rem should be fully compatible. +echo { "sdk": { "version": "2.1.3" } } >global.json + call build_packages.bat From 2f6443edcc86f5f3465bf37f5a5f9348d513f0c4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 16 Jul 2018 19:17:42 +0200 Subject: [PATCH 004/569] use SDK version available on Kokoro --- csharp/global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/global.json b/csharp/global.json index 5ab775b9b4..080dcb9403 100644 --- a/csharp/global.json +++ b/csharp/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.0.3" + "version": "2.1.3" } } From d754a0c478db3632d1dd490f62f33542c554fe5f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 16 Jul 2018 19:19:02 +0200 Subject: [PATCH 005/569] Revert "overcome the global.json constraint with a hack" This reverts commit c02346c72aafd1826b0397dbbce4ce04bf252f50. --- kokoro/release/csharp/windows/build_nuget.bat | 9 --------- 1 file changed, 9 deletions(-) diff --git a/kokoro/release/csharp/windows/build_nuget.bat b/kokoro/release/csharp/windows/build_nuget.bat index 7552bec3a9..5da1e13602 100644 --- a/kokoro/release/csharp/windows/build_nuget.bat +++ b/kokoro/release/csharp/windows/build_nuget.bat @@ -2,13 +2,4 @@ cd /d %~dp0\..\..\..\.. cd csharp - -@rem see what dotnet version is available -dotnet --version - -@rem TODO(jtattermusch): Kokoro workers currently only have dotnet SDK 2.1.3 -@rem so we just overwrite the SDK requirement in global.json as the results -@rem should be fully compatible. -echo { "sdk": { "version": "2.1.3" } } >global.json - call build_packages.bat From 149e31a6c046236c2d7d2fc8e2997270ae10fc3d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 17 Jul 2018 10:21:29 +0200 Subject: [PATCH 006/569] upgrade dotnet SDK to 2.1.3 on kokoro linux --- kokoro/linux/prepare_build_linux_rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kokoro/linux/prepare_build_linux_rc b/kokoro/linux/prepare_build_linux_rc index f64ea95238..d9b3bec3aa 100644 --- a/kokoro/linux/prepare_build_linux_rc +++ b/kokoro/linux/prepare_build_linux_rc @@ -7,7 +7,7 @@ sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsof sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB3E94ADBE1229CF sudo apt-get update # We use the .NET Core SDK 2.x to build... -sudo apt-get install -y dotnet-sdk-2.0.3 +sudo apt-get install -y dotnet-sdk-2.1.3 # But we also need the 1.x framework to test against, as we # target netstandard1.x sudo apt-get install -y dotnet-sharedframework-microsoft.netcore.app-1.0.5 From 770dde7d314e4fb06ab12244dbd1972157c648ad Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Fri, 3 Aug 2018 16:26:18 -0700 Subject: [PATCH 007/569] Update php package.xml to 3.6.1 (#5000) --- php/ext/google/protobuf/package.xml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/php/ext/google/protobuf/package.xml b/php/ext/google/protobuf/package.xml index 28d713f344..a3bf2752e7 100644 --- a/php/ext/google/protobuf/package.xml +++ b/php/ext/google/protobuf/package.xml @@ -10,11 +10,11 @@ protobuf-opensource@google.com yes - 2018-06-06 + 2018-08-03 - 3.6.0 - 3.6.0 + 3.6.1 + 3.6.1 stable @@ -245,6 +245,22 @@ G A release. 3-Clause BSD License +G A release. + + + + + 3.6.1 + 3.6.1 + + + stable + stable + + 2018-08-03 + + 3-Clause BSD License + G A release. From fba5ef410ad4a851fb4200b7380e3320ee048266 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 6 Aug 2018 22:07:52 -0700 Subject: [PATCH 008/569] Python wheel kokoro dev (#5002) * Add config for building python wheel * Update submodules * Fix setup.py to use c++11 * Fix syntax error * Fix syntax error * Add dir for artifact * Update artifact dirctory * Remove python 3.3 * Clean up virtual env * Clean up env * Test environment * Test env variable * Automatic update version number * Remove dependency on python-wheel branch --- .../release/python/linux/build_artifacts.sh | 45 +++++++++++++++++ kokoro/release/python/linux/config.sh | 48 +++++++++++++++++++ kokoro/release/python/linux/release.cfg | 8 ++++ 3 files changed, 101 insertions(+) create mode 100755 kokoro/release/python/linux/build_artifacts.sh create mode 100644 kokoro/release/python/linux/config.sh create mode 100644 kokoro/release/python/linux/release.cfg diff --git a/kokoro/release/python/linux/build_artifacts.sh b/kokoro/release/python/linux/build_artifacts.sh new file mode 100755 index 0000000000..032e30d566 --- /dev/null +++ b/kokoro/release/python/linux/build_artifacts.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +set -ex + +# change to repo root +pushd $(dirname $0)/../../../.. + +export REPO_DIR=protobuf +export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"` +export BUILD_COMMIT=v$BUILD_VERSION +export PLAT=x86_64 +export UNICODE_WIDTH=32 +export MACOSX_DEPLOYMENT_TARGET=10.9 + +mkdir artifacts +export ARTIFACT_DIR=$(pwd)/artifacts + +git clone https://github.com/matthew-brett/multibuild.git +cp kokoro/release/python/linux/config.sh config.sh + +build_artifact_version() { + MB_PYTHON_VERSION=$1 + + # Clean up env + rm -rf venv + sudo rm -rf protobuf + git clone https://github.com/google/protobuf.git + + source multibuild/common_utils.sh + source multibuild/travis_steps.sh + before_install + + clean_code $REPO_DIR $BUILD_COMMIT + sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py + cat $REPO_DIR/python/setup.py + + build_wheel $REPO_DIR/python $PLAT + + mv wheelhouse/* $ARTIFACT_DIR +} + +build_artifact_version 2.7 +build_artifact_version 3.4 +build_artifact_version 3.5 +build_artifact_version 3.6 diff --git a/kokoro/release/python/linux/config.sh b/kokoro/release/python/linux/config.sh new file mode 100644 index 0000000000..bfa8a0098b --- /dev/null +++ b/kokoro/release/python/linux/config.sh @@ -0,0 +1,48 @@ +# Define custom utilities +# Test for OSX with [ -n "$IS_OSX" ] + +function pre_build { + # Any stuff that you need to do before you start building the wheels + # Runs in the root directory of this repository. + pushd protobuf + + # Build protoc + ./autogen.sh + ./configure + + CXXFLAGS="-fPIC -g -O2" ./configure + make -j8 + + # Generate python dependencies. + pushd python + python setup.py build_py + popd + + popd +} + +function bdist_wheel_cmd { + # Builds wheel with bdist_wheel, puts into wheelhouse + # + # It may sometimes be useful to use bdist_wheel for the wheel building + # process. For example, versioneer has problems with versions which are + # fixed with bdist_wheel: + # https://github.com/warner/python-versioneer/issues/121 + local abs_wheelhouse=$1 + + # Modify build version + pwd + ls + python setup.py bdist_wheel --cpp_implementation --compile_static_extension + cp dist/*.whl $abs_wheelhouse +} + +function build_wheel { + build_wheel_cmd "bdist_wheel_cmd" $@ +} + +function run_tests { + # Runs tests on installed distribution from an empty directory + python --version + python -c "from google.protobuf.pyext import _message;" +} diff --git a/kokoro/release/python/linux/release.cfg b/kokoro/release/python/linux/release.cfg new file mode 100644 index 0000000000..b31b3f1192 --- /dev/null +++ b/kokoro/release/python/linux/release.cfg @@ -0,0 +1,8 @@ +# Configuration for Linux release builds +build_file: "protobuf/kokoro/release/python/linux/build_artifacts.sh" + +action { + define_artifacts { + regex: "github/protobuf/artifacts/**" + } +} From 2949ebd842e25c1bcb8b63b377a454a0887ea5a2 Mon Sep 17 00:00:00 2001 From: Rodrigo Hernandez Date: Tue, 7 Aug 2018 12:30:20 -0600 Subject: [PATCH 009/569] Updating Iterators to be compatible with C++17 The std::iterator class is being deprecated on MSVC++, and currently if the compilation flag /std:c++latest is used a warning is issued in this regard if any iterators use the class as a base class. If an external source file being compiled includes the repeated_field.h header, the iterator clases RepeatedPtrIterator and RepeatedPtrOverPtrsIterator trigger the warning. This change solves the warning and should avoid it in the future when the default is to remove the class. Using typedef instead of the modern "using x = y;" to make it also work on VS2015. --- src/google/protobuf/repeated_field.h | 40 +++++++++------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index 79682b69c6..0141f6660e 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -2205,23 +2205,14 @@ namespace internal { // This code based on net/proto/proto-array-internal.h by Jeffrey Yasskin // (jyasskin@google.com). template -class RepeatedPtrIterator - : public std::iterator< - std::random_access_iterator_tag, Element> { +class RepeatedPtrIterator { public: typedef RepeatedPtrIterator iterator; - typedef std::iterator< - std::random_access_iterator_tag, Element> superclass; - - // Shadow the value_type in std::iterator<> because const_iterator::value_type - // needs to be T, not const T. - typedef typename std::remove_const::type value_type; - - // Let the compiler know that these are type names, so we don't have to - // write "typename" in front of them everywhere. - typedef typename superclass::reference reference; - typedef typename superclass::pointer pointer; - typedef typename superclass::difference_type difference_type; + typedef std::random_access_iterator_tag iterator_category; + typedef Element value_type; + typedef std::ptrdiff_t difference_type; + typedef Element* pointer; + typedef Element& reference; RepeatedPtrIterator() : it_(NULL) {} explicit RepeatedPtrIterator(void* const* it) : it_(it) {} @@ -2301,21 +2292,14 @@ class RepeatedPtrIterator // referenced by the iterator. It should either be "void *" for a mutable // iterator, or "const void* const" for a constant iterator. template -class RepeatedPtrOverPtrsIterator - : public std::iterator { +class RepeatedPtrOverPtrsIterator { public: typedef RepeatedPtrOverPtrsIterator iterator; - typedef std::iterator superclass; - - // Shadow the value_type in std::iterator<> because const_iterator::value_type - // needs to be T, not const T. - typedef typename std::remove_const::type value_type; - - // Let the compiler know that these are type names, so we don't have to - // write "typename" in front of them everywhere. - typedef typename superclass::reference reference; - typedef typename superclass::pointer pointer; - typedef typename superclass::difference_type difference_type; + typedef std::random_access_iterator_tag iterator_category; + typedef Element value_type; + typedef std::ptrdiff_t difference_type; + typedef Element* pointer; + typedef Element& reference; RepeatedPtrOverPtrsIterator() : it_(NULL) {} explicit RepeatedPtrOverPtrsIterator(VoidPtr* it) : it_(it) {} From af3b2ab9159ab59003c539d48d8920a1d7dcd5ac Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Wed, 8 Aug 2018 15:52:16 -0700 Subject: [PATCH 010/569] Python wheel kokoro for mac (#5017) * Add config for building python wheel on mac * Specify os name * Clean up venv * Debug * Recover old path --- .../release/python/macos/build_artifacts.sh | 47 +++++++++++++++++++ kokoro/release/python/macos/release.cfg | 8 ++++ 2 files changed, 55 insertions(+) create mode 100755 kokoro/release/python/macos/build_artifacts.sh create mode 100644 kokoro/release/python/macos/release.cfg diff --git a/kokoro/release/python/macos/build_artifacts.sh b/kokoro/release/python/macos/build_artifacts.sh new file mode 100755 index 0000000000..2aec5e6471 --- /dev/null +++ b/kokoro/release/python/macos/build_artifacts.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +set -ex + +# change to repo root +pushd $(dirname $0)/../../../.. + +export REPO_DIR=protobuf +export BUILD_VERSION=`grep -i "version" python/google/protobuf/__init__.py | grep -o "'.*'" | tr -d "'"` +export BUILD_COMMIT=v$BUILD_VERSION +export PLAT=x86_64 +export UNICODE_WIDTH=32 +export MACOSX_DEPLOYMENT_TARGET=10.9 +export TRAVIS_OS_NAME="osx" + +mkdir artifacts +export ARTIFACT_DIR=$(pwd)/artifacts + +git clone https://github.com/matthew-brett/multibuild.git +cp kokoro/release/python/linux/config.sh config.sh + +OLD_PATH=$PATH + +build_artifact_version() { + MB_PYTHON_VERSION=$1 + + # Clean up env + rm -rf venv + sudo rm -rf protobuf + git clone https://github.com/google/protobuf.git + export PATH=$OLD_PATH + + source multibuild/common_utils.sh + source multibuild/travis_steps.sh + before_install + + clean_code $REPO_DIR $BUILD_COMMIT + + build_wheel $REPO_DIR/python $PLAT + + mv wheelhouse/* $ARTIFACT_DIR +} + +build_artifact_version 2.7 +build_artifact_version 3.4 +build_artifact_version 3.5 +build_artifact_version 3.6 diff --git a/kokoro/release/python/macos/release.cfg b/kokoro/release/python/macos/release.cfg new file mode 100644 index 0000000000..85cf81b507 --- /dev/null +++ b/kokoro/release/python/macos/release.cfg @@ -0,0 +1,8 @@ +# Configuration for Mac OSX release builds +build_file: "protobuf/kokoro/release/python/macos/build_artifacts.sh" + +action { + define_artifacts { + regex: "github/protobuf/artifacts/**" + } +} From 84963a55110dd5e95d6d4d90fbe48b4a2addc4ff Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Thu, 9 Aug 2018 10:46:22 -0400 Subject: [PATCH 011/569] Fix TryCreateParentDirectory on Windows On Windows, both '/' and '\' are valid path separators. So when creating the parent directories, split the filename on both Signed-off-by: Akshat Gokhale --- src/google/protobuf/compiler/command_line_interface.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index 8380367fa8..12dec9c2fd 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -168,7 +168,12 @@ bool VerifyDirectoryExists(const string& path) { // directories listed in |filename|. bool TryCreateParentDirectory(const string& prefix, const string& filename) { // Recursively create parent directories to the output file. +#if defined(_WIN32) + // on Windows, both '/' and '\' are valid path separators + std::vector parts = Split(filename, "/\\", true); +#else std::vector parts = Split(filename, "/", true); +#endif string path_so_far = prefix; for (int i = 0; i < parts.size() - 1; i++) { path_so_far += parts[i]; From f2a1356966cef3889434368598ac888d131489fb Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Mon, 13 Aug 2018 10:33:56 -0700 Subject: [PATCH 012/569] Python wheel kokoro for windows (#5034) * Add kokoro config for building python wheels on windows * Move script to root * Debug * Debug * Change working directory * Add msbuild to path * Debug * Fix python dir name * Debug * Move artifacts to targeted directory * Update artifact directory * Debug * Debug * Automatic generation of version * Reduce file numbers --- .../python/windows/build_artifacts.bat | 53 ++++++++++++++++ .../python/windows/build_single_artifact.bat | 62 +++++++++++++++++++ kokoro/release/python/windows/release.cfg | 8 +++ 3 files changed, 123 insertions(+) create mode 100644 kokoro/release/python/windows/build_artifacts.bat create mode 100644 kokoro/release/python/windows/build_single_artifact.bat create mode 100644 kokoro/release/python/windows/release.cfg diff --git a/kokoro/release/python/windows/build_artifacts.bat b/kokoro/release/python/windows/build_artifacts.bat new file mode 100644 index 0000000000..86270e6fb6 --- /dev/null +++ b/kokoro/release/python/windows/build_artifacts.bat @@ -0,0 +1,53 @@ +REM Move scripts to root +cd github\protobuf +copy kokoro\release\python\windows\build_single_artifact.bat build_single_artifact.bat + +REM Set environment variables +set REPO_DIR=protobuf +set PACKAGE_NAME=protobuf +set BUILD_DLL=OFF +set UNICODE=ON +set PB_TEST_DEP="six==1.9" +set OTHER_TEST_DEP="setuptools==38.5.1" +set OLD_PATH=C:\Program Files (x86)\MSBuild\14.0\bin\;%PATH% +for /f "tokens=*" %%i in ( 'grep -i "version" python/google/protobuf/__init__.py ^| grep -o "'.*'"' ) do set BUILD_VERSION=%%i +set BUILD_COMMIT=v%BUILD_VERSION:'=% + +REM Fetch multibuild +git clone https://github.com/matthew-brett/multibuild.git + +REM Install zlib +mkdir zlib +curl -L -o zlib.zip http://www.winimage.com/zLibDll/zlib123dll.zip +curl -L -o zlib-src.zip http://www.winimage.com/zLibDll/zlib123.zip +7z x zlib.zip -ozlib +7z x zlib-src.zip -ozlib\include +SET ZLIB_ROOT=%cd%\zlib +del /Q zlib.zip +del /Q zlib-src.zip + +REM Create directory for artifacts +SET ARTIFACT_DIR=%cd%\artifacts +mkdir %ARTIFACT_DIR% + +REM Build wheel + +SET PYTHON=C:\python35_32bit +SET PYTHON_VERSION=3.5 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat + +SET PYTHON=C:\python35 +SET PYTHON_VERSION=3.5 +SET PYTHON_ARCH=64 +CALL build_single_artifact.bat + +SET PYTHON=C:\python36_32bit +SET PYTHON_VERSION=3.6 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat + +SET PYTHON=C:\python36 +SET PYTHON_VERSION=3.6 +SET PYTHON_ARCH=64 +CALL build_single_artifact.bat diff --git a/kokoro/release/python/windows/build_single_artifact.bat b/kokoro/release/python/windows/build_single_artifact.bat new file mode 100644 index 0000000000..9d58199289 --- /dev/null +++ b/kokoro/release/python/windows/build_single_artifact.bat @@ -0,0 +1,62 @@ +setlocal + +if %PYTHON%==C:\python35_32bit set generator=Visual Studio 14 +if %PYTHON%==C:\python35_32bit set vcplatform=Win32 + +if %PYTHON%==C:\python35 set generator=Visual Studio 14 Win64 +if %PYTHON%==C:\python35 set vcplatform=x64 + +if %PYTHON%==C:\python36_32bit set generator=Visual Studio 14 +if %PYTHON%==C:\python36_32bit set vcplatform=Win32 + +if %PYTHON%==C:\python36 set generator=Visual Studio 14 Win64 +if %PYTHON%==C:\python36 set vcplatform=x64 + +REM Prepend newly installed Python to the PATH of this build (this cannot be +REM done from inside the powershell script as it would require to restart +REM the parent CMD process). +SET PATH=%PYTHON%;%PYTHON%\Scripts;%OLD_PATH% +python -m pip install -U pip +pip install wheel + +REM Check that we have the expected version and architecture for Python +python --version +python -c "import struct; print(struct.calcsize('P') * 8)" + +rmdir /s/q protobuf +git clone https://github.com/google/protobuf.git + +REM Checkout release commit +cd %REPO_DIR% +git checkout %BUILD_COMMIT% + +REM ====================== +REM Build Protobuf Library +REM ====================== + +mkdir src\.libs + +mkdir vcprojects +pushd vcprojects +cmake -G "%generator%" -Dprotobuf_BUILD_SHARED_LIBS=%BUILD_DLL% -Dprotobuf_UNICODE=%UNICODE% -Dprotobuf_BUILD_TESTS=OFF ../cmake +msbuild protobuf.sln /p:Platform=%vcplatform% /p:Configuration=Release +dir /s /b +popd +copy vcprojects\Release\libprotobuf.lib src\.libs\libprotobuf.a +copy vcprojects\Release\libprotobuf-lite.lib src\.libs\libprotobuf-lite.a +SET PATH=%cd%\vcprojects\Release;%PATH% +dir vcprojects\Release + +REM ====================== +REM Build python library +REM ====================== + +cd python + +REM sed -i 's/\ extra_compile_args\ =\ \[\]/\ extra_compile_args\ =\ \[\'\/MT\'\]/g' setup.py + +python setup.py bdist_wheel --cpp_implementation --compile_static_extension +dir dist +copy dist\* %ARTIFACT_DIR% +dir %ARTIFACT_DIR% +cd ..\.. diff --git a/kokoro/release/python/windows/release.cfg b/kokoro/release/python/windows/release.cfg new file mode 100644 index 0000000000..5261606477 --- /dev/null +++ b/kokoro/release/python/windows/release.cfg @@ -0,0 +1,8 @@ +# Configuration for Windows protoc release builds +build_file: "protobuf/kokoro/release/python/windows/build_artifacts.bat" + +action { + define_artifacts { + regex: "github/protobuf/artifacts/**" + } +} From bf784289d280f9c85167c2fbe497ef0a5ec17568 Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Mon, 13 Aug 2018 17:17:33 -0400 Subject: [PATCH 013/569] Always spilt on '\' and '/' --- src/google/protobuf/compiler/command_line_interface.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc index 12dec9c2fd..a1f3bafc6b 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc @@ -168,12 +168,8 @@ bool VerifyDirectoryExists(const string& path) { // directories listed in |filename|. bool TryCreateParentDirectory(const string& prefix, const string& filename) { // Recursively create parent directories to the output file. -#if defined(_WIN32) - // on Windows, both '/' and '\' are valid path separators + // On Windows, both '/' and '\' are valid path separators. std::vector parts = Split(filename, "/\\", true); -#else - std::vector parts = Split(filename, "/", true); -#endif string path_so_far = prefix; for (int i = 0; i < parts.size() - 1; i++) { path_so_far += parts[i]; From ab09b2a2e203b204e11ac64750e62b3f1da7dc6e Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Tue, 14 Aug 2018 11:17:16 -0700 Subject: [PATCH 014/569] Disable surrogate check for ucs2 (#5039) * _SURROGATE_PATTERN check for ucs4 Skip some test for ucs2 by sys.maxunicode --- python/google/protobuf/internal/decoder.py | 5 ++++- python/google/protobuf/internal/message_test.py | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/python/google/protobuf/internal/decoder.py b/python/google/protobuf/internal/decoder.py index 938f6293db..d2ec4f7b71 100755 --- a/python/google/protobuf/internal/decoder.py +++ b/python/google/protobuf/internal/decoder.py @@ -83,7 +83,9 @@ __author__ = 'kenton@google.com (Kenton Varda)' import struct import six +import sys +_UCS2_MAXUNICODE = 65535 if six.PY3: long = int else: @@ -550,7 +552,8 @@ def StringDecoder(field_number, is_repeated, is_packed, key, new_default, e.reason = '%s in field: %s' % (e, key.full_name) raise - if is_strict_utf8 and six.PY2: + if is_strict_utf8 and six.PY2 and sys.maxunicode > _UCS2_MAXUNICODE: + # Only do the check for python2 ucs4 when is_strict_utf8 enabled if _SURROGATE_PATTERN.search(value): reason = ('String field %s contains invalid UTF-8 data when parsing' 'a protocol buffer: surrogates not allowed. Use' diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py index 1a865398f2..ccb9221c91 100755 --- a/python/google/protobuf/internal/message_test.py +++ b/python/google/protobuf/internal/message_test.py @@ -81,6 +81,7 @@ from google.protobuf.internal import testing_refleaks from google.protobuf import message from google.protobuf.internal import _parameterized +UCS2_MAXUNICODE = 65535 if six.PY3: long = int @@ -2209,7 +2210,9 @@ class Proto3Test(BaseTestCase): msg.map_int32_int32[35] = 64 msg.map_string_foreign_message['foo'].c = 5 self.assertEqual(0, len(msg.FindInitializationErrors())) - + + @unittest.skipIf(sys.maxunicode == UCS2_MAXUNICODE, + 'Skip for ucs2') def testStrictUtf8Check(self): # Test u'\ud801' is rejected at parser in both python2 and python3. serialized = (b'r\x03\xed\xa0\x81') @@ -2259,7 +2262,8 @@ class Proto3Test(BaseTestCase): unittest_proto3_arena_pb2.TestAllTypes( optional_string=u'\ud801\ud801') - @unittest.skipIf(six.PY3, 'Surrogates are rejected at setters in Python3') + @unittest.skipIf(six.PY3 or sys.maxunicode == UCS2_MAXUNICODE, + 'Surrogates are rejected at setters in Python3') def testSurrogatesInPython2(self): # Test optional_string=u'\ud801\udc01'. # surrogate pair is acceptable in python2. From b0f332ba0580de254dc51ffbbdfc844b33130459 Mon Sep 17 00:00:00 2001 From: Rodrigo Hernandez Date: Tue, 14 Aug 2018 13:51:15 -0600 Subject: [PATCH 015/569] Reinstate value_type as non-const. --- src/google/protobuf/repeated_field.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index 0141f6660e..be0087e66f 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -2209,7 +2209,7 @@ class RepeatedPtrIterator { public: typedef RepeatedPtrIterator iterator; typedef std::random_access_iterator_tag iterator_category; - typedef Element value_type; + typedef typename std::remove_const::type value_type; typedef std::ptrdiff_t difference_type; typedef Element* pointer; typedef Element& reference; @@ -2296,7 +2296,7 @@ class RepeatedPtrOverPtrsIterator { public: typedef RepeatedPtrOverPtrsIterator iterator; typedef std::random_access_iterator_tag iterator_category; - typedef Element value_type; + typedef typename std::remove_const::type value_type; typedef std::ptrdiff_t difference_type; typedef Element* pointer; typedef Element& reference; From d5f0dac497f833d06f92d246431f4f2f42509e04 Mon Sep 17 00:00:00 2001 From: James Judd Date: Tue, 14 Aug 2018 21:55:35 -0600 Subject: [PATCH 016/569] Change deprecated Bazel single file attr param This removes the need for --incompatible_disable_deprecated_attr_params when using Protobuf --- protobuf.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf.bzl b/protobuf.bzl index 67d61d7ba7..ae391aa643 100644 --- a/protobuf.bzl +++ b/protobuf.bzl @@ -178,7 +178,7 @@ proto_gen = rule( "protoc": attr.label( cfg = "host", executable = True, - single_file = True, + allow_single_file = True, mandatory = True, ), "plugin": attr.label( From d2c35ce4cb6ff767712a879f6bfad9d50ada577d Mon Sep 17 00:00:00 2001 From: Jozef Izso Date: Wed, 15 Aug 2018 15:50:45 +0200 Subject: [PATCH 017/569] Backport the PR #4579 to 3.6.x branch Implements #3380 --- Makefile.am | 1 + cmake/CMakeLists.txt | 11 +++++++++ cmake/libprotobuf-lite.cmake | 8 ++++++- cmake/libprotobuf.cmake | 8 ++++++- cmake/libprotoc.cmake | 2 +- cmake/protoc.cmake | 9 +++++++- cmake/version.rc.in | 45 ++++++++++++++++++++++++++++++++++++ 7 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 cmake/version.rc.in diff --git a/Makefile.am b/Makefile.am index ae4ac858cd..8334db6095 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1036,6 +1036,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \ cmake/protobuf.pc.cmake \ cmake/protoc.cmake \ cmake/tests.cmake \ + cmake/version.rc.in \ editors/README.txt \ editors/proto.vim \ editors/protobuf-mode.el \ diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 02174e96aa..ada9dc2553 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -166,12 +166,23 @@ if (MSVC) add_definitions(/bigobj) string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR}) string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR}) + string(REPLACE "." "," protobuf_RC_FILEVERSION "${protobuf_VERSION}") configure_file(extract_includes.bat.in extract_includes.bat) # Suppress linker warnings about files with no symbols defined. set(CMAKE_STATIC_LINKER_FLAGS /ignore:4221) + + # Configure Resource Compiler + enable_language(RC) + # use English language (0x409) in resource compiler + set(rc_flags "/l0x409") + # fix rc.exe invocations because of usage of add_definitions() + set(CMAKE_RC_COMPILE_OBJECT " ${rc_flags} /fo ") + + configure_file(version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) endif (MSVC) + get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH) include_directories( diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake index 911fce5e5d..82b954a1dd 100644 --- a/cmake/libprotobuf-lite.cmake +++ b/cmake/libprotobuf-lite.cmake @@ -48,8 +48,14 @@ set(libprotobuf_lite_includes ${protobuf_source_dir}/src/google/protobuf/wire_format_lite.h ) +if (MSVC) +set(libprotoc_rc_files + ${CMAKE_CURRENT_BINARY_DIR}/version.rc +) +endif() + add_library(libprotobuf-lite ${protobuf_SHARED_OR_STATIC} - ${libprotobuf_lite_files} ${libprotobuf_lite_includes}) + ${libprotobuf_lite_files} ${libprotobuf_lite_includes} ${libprotobuf_lite_rc_files}) target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) if(MSVC AND protobuf_BUILD_SHARED_LIBS) diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake index 65d05c1944..463d65a382 100644 --- a/cmake/libprotobuf.cmake +++ b/cmake/libprotobuf.cmake @@ -112,8 +112,14 @@ set(libprotobuf_includes ${protobuf_source_dir}/src/google/protobuf/wrappers.pb.h ) +if (MSVC) +set(libprotoc_rc_files + ${CMAKE_CURRENT_BINARY_DIR}/version.rc +) +endif() + add_library(libprotobuf ${protobuf_SHARED_OR_STATIC} - ${libprotobuf_lite_files} ${libprotobuf_files} ${libprotobuf_includes}) + ${libprotobuf_lite_files} ${libprotobuf_files} ${libprotobuf_includes} ${libprotobuf_rc_files}) target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT}) if(protobuf_WITH_ZLIB) target_link_libraries(libprotobuf ${ZLIB_LIBRARIES}) diff --git a/cmake/libprotoc.cmake b/cmake/libprotoc.cmake index 58568bb2fc..92dfd306e3 100644 --- a/cmake/libprotoc.cmake +++ b/cmake/libprotoc.cmake @@ -168,7 +168,7 @@ set(libprotoc_rc_files endif() add_library(libprotoc ${protobuf_SHARED_OR_STATIC} - ${libprotoc_files} ${libprotoc_headers}) + ${libprotoc_files} ${libprotoc_headers} ${libprotoc_rc_files}) target_link_libraries(libprotoc libprotobuf) if(MSVC AND protobuf_BUILD_SHARED_LIBS) target_compile_definitions(libprotoc diff --git a/cmake/protoc.cmake b/cmake/protoc.cmake index 5777b16ed2..9bf6f5a929 100644 --- a/cmake/protoc.cmake +++ b/cmake/protoc.cmake @@ -2,6 +2,13 @@ set(protoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc ) -add_executable(protoc ${protoc_files}) +set(protoc_rc_files + ${CMAKE_CURRENT_BINARY_DIR}/version.rc +) + +add_executable(protoc ${protoc_files} ${protoc_rc_files}) target_link_libraries(protoc libprotobuf libprotoc) add_executable(protobuf::protoc ALIAS protoc) + +set_target_properties(protoc PROPERTIES + VERSION ${protobuf_VERSION}) diff --git a/cmake/version.rc.in b/cmake/version.rc.in new file mode 100644 index 0000000000..cbce1e5389 --- /dev/null +++ b/cmake/version.rc.in @@ -0,0 +1,45 @@ +#define VS_FF_DEBUG 0x1L +#define VS_VERSION_INFO 0x1L +#define VS_FFI_FILEFLAGSMASK 0x17L +#define VER_PRIVATEBUILD 0x0L +#define VER_PRERELEASE 0x0L +#define VOS__WINDOWS32 0x4L +#define VFT_DLL 0x2L +#define VFT2_UNKNOWN 0x0L + +#ifndef DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG VS_FF_DEBUG +#endif + + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @protobuf_RC_FILEVERSION@,0 + PRODUCTVERSION @protobuf_RC_FILEVERSION@,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS VER_DEBUG + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL +BEGIN + BLOCK "VarFileInfo" + BEGIN + // English language (0x409) and the Windows Unicode codepage (1200) + VALUE "Translation", 0x409, 1200 + END + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "FileDescription", "Compiled with @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@\0" + VALUE "ProductVersion", "@protobuf_VERSION@\0" + VALUE "FileVersion", "@protobuf_VERSION@\0" + VALUE "InternalName", "protobuf\0" + VALUE "ProductName", "Protocol Buffers - Google's Data Interchange Format\0" + VALUE "CompanyName", "Google Inc.\0" + VALUE "LegalCopyright", "Copyright 2008 Google Inc. All rights reserved.\0" + VALUE "Licence", "BSD\0" + VALUE "Info", "https://developers.google.com/protocol-buffers/\0" + END + END +END From 33d41628c2d06f3d51764c08caaf7e9ecc305065 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Fri, 20 Jan 2017 15:39:34 -0800 Subject: [PATCH 018/569] Set LIBPROTOBUF_EXPORT on GzipOutputStream::Options This fixes issue #2610. This was originally fixed in a101fa52895fc2ad83d8b5d610243531b1608a08 , but got reverted by d36c0c538a545fac5d9db6ba65c525246d4efa95 --- src/google/protobuf/io/gzip_stream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/io/gzip_stream.h b/src/google/protobuf/io/gzip_stream.h index 15b02fe3d7..df1a446ebc 100644 --- a/src/google/protobuf/io/gzip_stream.h +++ b/src/google/protobuf/io/gzip_stream.h @@ -118,7 +118,7 @@ class LIBPROTOBUF_EXPORT GzipOutputStream : public ZeroCopyOutputStream { ZLIB = 2, }; - struct Options { + struct LIBPROTOBUF_EXPORT Options { // Defaults to GZIP. Format format; From fd25c5617b2a1f1ee875bf6c1e7518473409a211 Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Sun, 1 Jul 2018 14:52:25 -0500 Subject: [PATCH 019/569] Set LIBPROTOBUF_EXPORT on GenericTypeHandler This should fix https://github.com/google/protobuf/issues/4717 --- src/google/protobuf/repeated_field.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index b47ea99484..fbfbf94282 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -705,13 +705,13 @@ void GenericTypeHandler::Merge(const string& from, // Declarations of the specialization as we cannot define them here, as the // header that defines ProtocolMessage depends on types defined in this header. #define DECLARE_SPECIALIZATIONS_FOR_BASE_PROTO_TYPES(TypeName) \ - template<> \ + template<> LIBPROTOBUF_EXPORT \ TypeName* GenericTypeHandler::NewFromPrototype( \ const TypeName* prototype, google::protobuf::Arena* arena); \ - template<> \ + template<> LIBPROTOBUF_EXPORT \ google::protobuf::Arena* GenericTypeHandler::GetArena( \ TypeName* value); \ - template<> \ + template<> LIBPROTOBUF_EXPORT \ void* GenericTypeHandler::GetMaybeArenaPointer( \ TypeName* value); From 228530e2da79603450948d5d701fe4bb4e47c430 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 8 Aug 2018 19:51:16 -0700 Subject: [PATCH 020/569] Support creating FileDescriptors dynamically from binary data. Related to #658 and #5007. --- .../Reflection/DescriptorsTest.cs | 99 ++++++++++++++++--- .../Reflection/DescriptorPool.cs | 8 +- .../Reflection/FieldDescriptor.cs | 12 ++- .../Reflection/FileDescriptor.cs | 63 +++++++++--- .../Reflection/MessageDescriptor.cs | 10 +- .../Reflection/OneofDescriptor.cs | 16 +++ 6 files changed, 168 insertions(+), 40 deletions(-) diff --git a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs index 29a376e049..9abee95126 100644 --- a/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs +++ b/csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs @@ -30,10 +30,11 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #endregion -using System.Linq; using Google.Protobuf.TestProtos; using NUnit.Framework; -using UnitTest.Issues.TestProtos; +using System; +using System.Collections.Generic; +using System.Linq; namespace Google.Protobuf.Reflection { @@ -44,9 +45,32 @@ namespace Google.Protobuf.Reflection public class DescriptorsTest { [Test] - public void FileDescriptor() + public void FileDescriptor_GeneratedCode() + { + TestFileDescriptor( + UnittestProto3Reflection.Descriptor, + UnittestImportProto3Reflection.Descriptor, + UnittestImportPublicProto3Reflection.Descriptor); + } + + [Test] + public void FileDescriptor_BuildFromByteStrings() + { + // The descriptors have to be supplied in an order such that all the + // dependencies come before the descriptors depending on them. + var descriptorData = new List + { + UnittestImportPublicProto3Reflection.Descriptor.Proto.ToByteString(), + UnittestImportProto3Reflection.Descriptor.Proto.ToByteString(), + UnittestProto3Reflection.Descriptor.Proto.ToByteString() + }; + var converted = FileDescriptor.BuildFromByteStrings(descriptorData); + Assert.AreEqual(3, converted.Count); + TestFileDescriptor(converted[2], converted[1], converted[0]); + } + + private void TestFileDescriptor(FileDescriptor file, FileDescriptor importedFile, FileDescriptor importedPublicFile) { - FileDescriptor file = UnittestProto3Reflection.Descriptor; Assert.AreEqual("unittest_proto3.proto", file.Name); Assert.AreEqual("protobuf_unittest3", file.Package); @@ -56,17 +80,12 @@ namespace Google.Protobuf.Reflection // unittest_proto3.proto doesn't have any public imports, but unittest_import_proto3.proto does. Assert.AreEqual(0, file.PublicDependencies.Count); - Assert.AreEqual(1, UnittestImportProto3Reflection.Descriptor.PublicDependencies.Count); - Assert.AreEqual(UnittestImportPublicProto3Reflection.Descriptor, UnittestImportProto3Reflection.Descriptor.PublicDependencies[0]); + Assert.AreEqual(1, importedFile.PublicDependencies.Count); + Assert.AreEqual(importedPublicFile, importedFile.PublicDependencies[0]); Assert.AreEqual(1, file.Dependencies.Count); - Assert.AreEqual(UnittestImportProto3Reflection.Descriptor, file.Dependencies[0]); + Assert.AreEqual(importedFile, file.Dependencies[0]); - MessageDescriptor messageType = TestAllTypes.Descriptor; - Assert.AreSame(typeof(TestAllTypes), messageType.ClrType); - Assert.AreSame(TestAllTypes.Parser, messageType.Parser); - Assert.AreEqual(messageType, file.MessageTypes[0]); - Assert.AreEqual(messageType, file.FindTypeByName("TestAllTypes")); Assert.Null(file.FindTypeByName("NoSuchType")); Assert.Null(file.FindTypeByName("protobuf_unittest3.TestAllTypes")); for (int i = 0; i < file.MessageTypes.Count; i++) @@ -77,8 +96,8 @@ namespace Google.Protobuf.Reflection Assert.AreEqual(file.EnumTypes[0], file.FindTypeByName("ForeignEnum")); Assert.Null(file.FindTypeByName("NoSuchType")); Assert.Null(file.FindTypeByName("protobuf_unittest3.ForeignEnum")); - Assert.AreEqual(1, UnittestImportProto3Reflection.Descriptor.EnumTypes.Count); - Assert.AreEqual("ImportEnum", UnittestImportProto3Reflection.Descriptor.EnumTypes[0].Name); + Assert.AreEqual(1, importedFile.EnumTypes.Count); + Assert.AreEqual("ImportEnum", importedFile.EnumTypes[0].Name); for (int i = 0; i < file.EnumTypes.Count; i++) { Assert.AreEqual(i, file.EnumTypes[i].Index); @@ -97,6 +116,56 @@ namespace Google.Protobuf.Reflection Assert.AreEqual("protobuf_unittest", file.Package); } + [Test] + public void FileDescriptor_BuildFromByteStrings_MissingDependency() + { + var descriptorData = new List + { + UnittestImportProto3Reflection.Descriptor.Proto.ToByteString(), + UnittestProto3Reflection.Descriptor.Proto.ToByteString(), + }; + // This will fail, because we're missing UnittestImportPublicProto3Reflection + Assert.Throws(() => FileDescriptor.BuildFromByteStrings(descriptorData)); + } + + [Test] + public void FileDescriptor_BuildFromByteStrings_DuplicateNames() + { + var descriptorData = new List + { + UnittestImportPublicProto3Reflection.Descriptor.Proto.ToByteString(), + UnittestImportPublicProto3Reflection.Descriptor.Proto.ToByteString(), + }; + // This will fail due to the same name being used twice + Assert.Throws(() => FileDescriptor.BuildFromByteStrings(descriptorData)); + } + + [Test] + public void FileDescriptor_BuildFromByteStrings_IncorrectOrder() + { + var descriptorData = new List + { + UnittestProto3Reflection.Descriptor.Proto.ToByteString(), + UnittestImportPublicProto3Reflection.Descriptor.Proto.ToByteString(), + UnittestImportProto3Reflection.Descriptor.Proto.ToByteString() + }; + // This will fail, because the dependencies should come first + Assert.Throws(() => FileDescriptor.BuildFromByteStrings(descriptorData)); + + } + + [Test] + public void MessageDescriptorFromGeneratedCodeFileDescriptor() + { + var file = UnittestProto3Reflection.Descriptor; + + MessageDescriptor messageType = TestAllTypes.Descriptor; + Assert.AreSame(typeof(TestAllTypes), messageType.ClrType); + Assert.AreSame(TestAllTypes.Parser, messageType.Parser); + Assert.AreEqual(messageType, file.MessageTypes[0]); + Assert.AreEqual(messageType, file.FindTypeByName("TestAllTypes")); + } + [Test] public void MessageDescriptor() { @@ -163,7 +232,7 @@ namespace Google.Protobuf.Reflection Assert.AreEqual("single_nested_enum", enumField.Name); Assert.AreEqual(FieldType.Enum, enumField.FieldType); - // Assert.AreEqual(TestAllTypes.Types.NestedEnum.DescriptorProtoFile, enumField.EnumType); + Assert.AreEqual(messageType.EnumTypes[0], enumField.EnumType); Assert.AreEqual("single_foreign_message", messageField.Name); Assert.AreEqual(FieldType.Message, messageField.FieldType); diff --git a/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs b/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs index 99ca4bf34f..9c2160feed 100644 --- a/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs +++ b/csharp/src/Google.Protobuf/Reflection/DescriptorPool.cs @@ -53,13 +53,13 @@ namespace Google.Protobuf.Reflection private readonly HashSet dependencies; - internal DescriptorPool(FileDescriptor[] dependencyFiles) + internal DescriptorPool(IEnumerable dependencyFiles) { dependencies = new HashSet(); - for (int i = 0; i < dependencyFiles.Length; i++) + foreach (var dependencyFile in dependencyFiles) { - dependencies.Add(dependencyFiles[i]); - ImportPublicDependencies(dependencyFiles[i]); + dependencies.Add(dependencyFile); + ImportPublicDependencies(dependencyFile); } foreach (FileDescriptor dependency in dependencyFiles) diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 2a3d5c7a2d..152467d802 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -116,13 +116,18 @@ namespace Google.Protobuf.Reflection /// that is the responsibility of the accessor. /// /// - /// The value returned by this property will be non-null for all regular fields. However, - /// if a message containing a map field is introspected, the list of nested messages will include + /// In descriptors for generated code, the value returned by this property will be non-null for all + /// regular fields. However, if a message containing a map field is introspected, the list of nested messages will include /// an auto-generated nested key/value pair message for the field. This is not represented in any /// generated type, and the value of the map field itself is represented by a dictionary in the /// reflection API. There are never instances of those "hidden" messages, so no accessor is provided /// and this property will return null. /// + /// + /// In dynamically loaded descriptors, the value returned by this property will current be null; + /// if and when dynamic messages are supported, it will return a suitable accessor to work with + /// them. + /// /// public IFieldAccessor Accessor => accessor; @@ -330,7 +335,8 @@ namespace Google.Protobuf.Reflection private IFieldAccessor CreateAccessor() { // If we're given no property name, that's because we really don't want an accessor. - // (At the moment, that means it's a map entry message...) + // This could be because it's a map message, or it could be that we're loading a FileDescriptor dynamically. + // TODO: Support dynamic messages. if (propertyName == null) { return null; diff --git a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs index be94cb100e..799f729106 100644 --- a/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs @@ -34,6 +34,7 @@ using Google.Protobuf.WellKnownTypes; using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Linq; namespace Google.Protobuf.Reflection { @@ -54,12 +55,12 @@ namespace Google.Protobuf.Reflection ForceReflectionInitialization(); } - private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, FileDescriptor[] dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo) + private FileDescriptor(ByteString descriptorData, FileDescriptorProto proto, IEnumerable dependencies, DescriptorPool pool, bool allowUnknownDependencies, GeneratedClrTypeInfo generatedCodeInfo) { SerializedData = descriptorData; DescriptorPool = pool; Proto = proto; - Dependencies = new ReadOnlyCollection((FileDescriptor[]) dependencies.Clone()); + Dependencies = new ReadOnlyCollection(dependencies.ToList()); PublicDependencies = DeterminePublicDependencies(this, proto, dependencies, allowUnknownDependencies); @@ -67,11 +68,11 @@ namespace Google.Protobuf.Reflection MessageTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.MessageType, (message, index) => - new MessageDescriptor(message, this, null, index, generatedCodeInfo.NestedTypes[index])); + new MessageDescriptor(message, this, null, index, generatedCodeInfo?.NestedTypes[index])); EnumTypes = DescriptorUtil.ConvertAndMakeReadOnly(proto.EnumType, (enumType, index) => - new EnumDescriptor(enumType, this, null, index, generatedCodeInfo.NestedEnums[index])); + new EnumDescriptor(enumType, this, null, index, generatedCodeInfo?.NestedEnums[index])); Services = DescriptorUtil.ConvertAndMakeReadOnly(proto.Service, (service, index) => @@ -98,13 +99,9 @@ namespace Google.Protobuf.Reflection /// Extracts public dependencies from direct dependencies. This is a static method despite its /// first parameter, as the value we're in the middle of constructing is only used for exceptions. /// - private static IList DeterminePublicDependencies(FileDescriptor @this, FileDescriptorProto proto, FileDescriptor[] dependencies, bool allowUnknownDependencies) + private static IList DeterminePublicDependencies(FileDescriptor @this, FileDescriptorProto proto, IEnumerable dependencies, bool allowUnknownDependencies) { - var nameToFileMap = new Dictionary(); - foreach (var file in dependencies) - { - nameToFileMap[file.Name] = file; - } + var nameToFileMap = dependencies.ToDictionary(file => file.Name); var publicDependencies = new List(); for (int i = 0; i < proto.PublicDependency.Count; i++) { @@ -114,8 +111,7 @@ namespace Google.Protobuf.Reflection throw new DescriptorValidationException(@this, "Invalid public dependency index."); } string name = proto.Dependency[index]; - FileDescriptor file = nameToFileMap[name]; - if (file == null) + if (!nameToFileMap.TryGetValue(name, out var file)) { if (!allowUnknownDependencies) { @@ -315,6 +311,49 @@ namespace Google.Protobuf.Reflection } } + /// + /// Converts the given descriptor binary data into FileDescriptor objects. + /// Note: reflection using the returned FileDescriptors is not currently supported. + /// + /// The binary file descriptor proto data. Must not be null, and any + /// dependencies must come before the descriptor which depends on them. (If A depends on B, and B + /// depends on C, then the descriptors must be presented in the order C, B, A.) This is compatible + /// with the order in which protoc provides descriptors to plugins. + /// The file descriptors corresponding to . + public static IReadOnlyList BuildFromByteStrings(IEnumerable descriptorData) + { + ProtoPreconditions.CheckNotNull(descriptorData, nameof(descriptorData)); + + // TODO: See if we can build a single DescriptorPool instead of building lots of them. + // This will all behave correctly, but it's less efficient than we'd like. + var descriptors = new List(); + var descriptorsByName = new Dictionary(); + foreach (var data in descriptorData) + { + var proto = FileDescriptorProto.Parser.ParseFrom(data); + var dependencies = new List(); + foreach (var dependencyName in proto.Dependency) + { + if (!descriptorsByName.TryGetValue(dependencyName, out var dependency)) + { + throw new ArgumentException($"Dependency missing: {dependencyName}"); + } + dependencies.Add(dependency); + } + var pool = new DescriptorPool(dependencies); + FileDescriptor descriptor = new FileDescriptor( + data, proto, dependencies, pool, + allowUnknownDependencies: false, generatedCodeInfo: null); + descriptors.Add(descriptor); + if (descriptorsByName.ContainsKey(descriptor.Name)) + { + throw new ArgumentException($"Duplicate descriptor name: {descriptor.Name}"); + } + descriptorsByName.Add(descriptor.Name, descriptor); + } + return new ReadOnlyCollection(descriptors); + } + /// /// Returns a that represents this instance. /// diff --git a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs index 86942acc02..dbb6768b6a 100644 --- a/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/MessageDescriptor.cs @@ -72,23 +72,21 @@ namespace Google.Protobuf.Reflection ClrType = generatedCodeInfo?.ClrType; ContainingType = parent; - // Note use of generatedCodeInfo. rather than generatedCodeInfo?. here... we don't expect - // to see any nested oneofs, types or enums in "not actually generated" code... we do - // expect fields though (for map entry messages). + // If generatedCodeInfo is null, we just won't generate an accessor for any fields. Oneofs = DescriptorUtil.ConvertAndMakeReadOnly( proto.OneofDecl, (oneof, index) => - new OneofDescriptor(oneof, file, this, index, generatedCodeInfo.OneofNames[index])); + new OneofDescriptor(oneof, file, this, index, generatedCodeInfo?.OneofNames[index])); NestedTypes = DescriptorUtil.ConvertAndMakeReadOnly( proto.NestedType, (type, index) => - new MessageDescriptor(type, file, this, index, generatedCodeInfo.NestedTypes[index])); + new MessageDescriptor(type, file, this, index, generatedCodeInfo?.NestedTypes[index])); EnumTypes = DescriptorUtil.ConvertAndMakeReadOnly( proto.EnumType, (type, index) => - new EnumDescriptor(type, file, this, index, generatedCodeInfo.NestedEnums[index])); + new EnumDescriptor(type, file, this, index, generatedCodeInfo?.NestedEnums[index])); fieldsInDeclarationOrder = DescriptorUtil.ConvertAndMakeReadOnly( proto.Field, diff --git a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs index 5906c2e36d..c026bea677 100644 --- a/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/OneofDescriptor.cs @@ -85,6 +85,16 @@ namespace Google.Protobuf.Reflection /// Gets an accessor for reflective access to the values associated with the oneof /// in a particular message. /// + /// + /// + /// In descriptors for generated code, the value returned by this property will always be non-null. + /// + /// + /// In dynamically loaded descriptors, the value returned by this property will current be null; + /// if and when dynamic messages are supported, it will return a suitable accessor to work with + /// them. + /// + /// /// /// The accessor used for reflective access. /// @@ -110,6 +120,12 @@ namespace Google.Protobuf.Reflection private OneofAccessor CreateAccessor(string clrName) { + // We won't have a CLR name if this is from a dynamically-loaded FileDescriptor. + // TODO: Support dynamic messages. + if (clrName == null) + { + return null; + } var caseProperty = containingType.ClrType.GetProperty(clrName + "Case"); if (caseProperty == null) { From afe98de32a130e0033c9b10fa470bb2ff858ed8d Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Wed, 22 Aug 2018 11:55:30 -0700 Subject: [PATCH 021/569] Replace repo links. --- CHANGES.txt | 12 ++++++------ Protobuf.podspec | 4 ++-- README.md | 2 +- benchmarks/README.md | 4 ++-- cmake/README.md | 4 ++-- conformance/README.md | 4 ++-- csharp/Google.Protobuf.Tools.nuspec | 4 ++-- csharp/README.md | 2 +- .../protos/csharp/protos/unittest_issues.proto | 4 ++-- csharp/protos/unittest_issues.proto | 4 ++-- csharp/src/Google.Protobuf.Test/ByteStringTest.cs | 2 +- csharp/src/Google.Protobuf/Google.Protobuf.csproj | 6 +++--- docs/options.md | 4 ++-- docs/performance.md | 2 +- examples/WORKSPACE | 8 ++++---- examples/add_person.go | 2 +- examples/add_person_test.go | 2 +- examples/list_people.go | 2 +- examples/list_people_test.go | 2 +- generate_changelog.py | 2 +- java/compatibility_tests/v2.5.0/test.sh | 2 +- .../com/google/protobuf/CodedOutputStreamTest.java | 2 +- java/pom.xml | 4 ++-- js/README.md | 8 ++++---- js/package.json | 2 +- kokoro/linux/32-bit/Dockerfile | 2 +- kokoro/linux/64-bit/Dockerfile | 4 ++-- kokoro/linux/benchmark/build.sh | 4 ++-- objectivec/GPBCodedInputStream.m | 4 ++-- objectivec/Tests/GPBMessageTests.m | 2 +- objectivec/Tests/unittest_objc.proto | 2 +- php/tests/compatibility_test.sh | 2 +- protoc-artifacts/README.md | 2 +- protoc-artifacts/build-zip.sh | 2 +- protoc-artifacts/pom.xml | 4 ++-- python/compatibility_tests/v2.5.0/setup.py | 2 +- python/release.sh | 2 +- python/release/wheel/protobuf_optimized_pip.sh | 2 +- python/setup.py | 2 +- ruby/ext/google/protobuf_c/wrap_memcpy.c | 2 +- ruby/pom.xml | 4 ++-- src/README.md | 6 +++--- src/google/protobuf/compiler/java/java_file.cc | 2 +- src/google/protobuf/proto3_arena_unittest.cc | 2 +- src/google/protobuf/util/delimited_message_util.cc | 2 +- src/google/protobuf/util/delimited_message_util.h | 2 +- .../protobuf/util/delimited_message_util_test.cc | 2 +- src/google/protobuf/util/field_comparator_test.cc | 2 +- .../util/internal/protostream_objectwriter.cc | 6 +++--- .../util/internal/protostream_objectwriter_test.cc | 2 +- .../protobuf/util/internal/testdata/books.proto | 2 +- tests.sh | 4 ++-- 52 files changed, 84 insertions(+), 84 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a381084af7..5d11940b31 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -102,7 +102,7 @@ Planned Future Changes * Make C++ implementation C++11 only: we plan to require C++11 to build protobuf code starting from 3.6.0 release. Please join this github issue: - https://github.com/google/protobuf/issues/2780 to provide your feedback. + https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. protoc * Fixed a bug introduced in 3.5.0 and protoc in Windows now accepts non-ascii @@ -133,7 +133,7 @@ Planned Future Changes * Make C++ implementation C++11 only: we plan to require C++11 to build protobuf code starting from 3.6.0 release. Please join this github issue: - https://github.com/google/protobuf/issues/2780 to provide your feedback. + https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. General * Unknown fields are now preserved in proto3 for most of the language @@ -220,14 +220,14 @@ For issues and discussions: - https://github.com/google/protobuf/issues/272 + https://github.com/protocolbuffers/protobuf/issues/272 - Make C++ implementation C++11 only: we plan to require C++11 to build protobuf code starting from 3.5.0 or 3.6.0 release, after unknown fields semantic changes are finished. Please join this github issue: - https://github.com/google/protobuf/issues/2780 + https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. @@ -347,14 +347,14 @@ for the timeline and follow up this github issue: - https://github.com/google/protobuf/issues/272 + https://github.com/protocolbuffers/protobuf/issues/272 for discussion. - Make C++ implementation C++11 only: we plan to require C++11 to build protobuf code starting from 3.4.0 or 3.5.0 release. Please join this github issue: - https://github.com/google/protobuf/issues/2780 + https://github.com/protocolbuffers/protobuf/issues/2780 to provide your feedback. diff --git a/Protobuf.podspec b/Protobuf.podspec index f282f540bb..1338b8d978 100644 --- a/Protobuf.podspec +++ b/Protobuf.podspec @@ -7,12 +7,12 @@ Pod::Spec.new do |s| s.name = 'Protobuf' s.version = '3.6.1' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' - s.homepage = 'https://github.com/google/protobuf' + s.homepage = 'https://github.com/protocolbuffers/protobuf' s.license = '3-Clause BSD License' s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' } s.cocoapods_version = '>= 1.0' - s.source = { :git => 'https://github.com/google/protobuf.git', + s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git', :tag => "v#{s.version}" } s.source_files = 'objectivec/*.{h,m}', diff --git a/README.md b/README.md index 618c6d7829..c16ddf15d0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ with the C++ runtime. For non-C++ users, the simplest way to install the protocol compiler is to download a pre-built binary from our release page: - [https://github.com/google/protobuf/releases](https://github.com/google/protobuf/releases) + [https://github.com/protocolbuffers/protobuf/releases](https://github.com/protocolbuffers/protobuf/releases) In the downloads section of each release, you can find pre-built binaries in zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary diff --git a/benchmarks/README.md b/benchmarks/README.md index 534e0bded7..72885886a7 100644 --- a/benchmarks/README.md +++ b/benchmarks/README.md @@ -5,7 +5,7 @@ This directory contains benchmarking schemas and data sets that you can use to test a variety of performance scenarios against your protobuf language runtime. If you are looking for performance numbers of officially support languages, see [here]( -https://github.com/google/protobuf/blob/master/docs/performance.md) +https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md) ## Prerequisite @@ -63,7 +63,7 @@ PHP benchmark's requirement is the same as PHP protobuf's requirements. The benc include PHP protobuf's src and build the c extension if required. ### Node.js -Node.js benchmark need [node](https://nodejs.org/en/)(higher than V6) and [npm](https://www.npmjs.com/) package manager installed. This benchmark is using the [benchmark](https://www.npmjs.com/package/benchmark) framework to test, which needn't to manually install. And another prerequisite is [protobuf js](https://github.com/google/protobuf/tree/master/js), which needn't to manually install either +Node.js benchmark need [node](https://nodejs.org/en/)(higher than V6) and [npm](https://www.npmjs.com/) package manager installed. This benchmark is using the [benchmark](https://www.npmjs.com/package/benchmark) framework to test, which needn't to manually install. And another prerequisite is [protobuf js](https://github.com/protocolbuffers/protobuf/tree/master/js), which needn't to manually install either ### Big data diff --git a/cmake/README.md b/cmake/README.md index 26a516c7dd..1f370568e1 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -43,7 +43,7 @@ Getting Sources You can get the latest stable source packages from the release page: - https://github.com/google/protobuf/releases/latest + https://github.com/protocolbuffers/protobuf/releases/latest For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package @@ -52,7 +52,7 @@ download `protobuf-all-[VERSION].tar.gz`. Or you can use git to clone from protobuf git repository. - C:\Path\to> git clone -b [release_tag] https://github.com/google/protobuf.git + C:\Path\to> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git Where *[release_tag]* is a git tag like *v3.0.0-beta-1* or a branch name like *master* if you want to get the latest code. diff --git a/conformance/README.md b/conformance/README.md index a5419bf0da..06925dbb55 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -57,10 +57,10 @@ Testing other Protocol Buffer implementations To run these tests against a new Protocol Buffers implementation, write a program in your language that uses the protobuf implementation you want to test. This program should implement the testing protocol defined in -[conformance.proto](https://github.com/google/protobuf/blob/master/conformance/conformance.proto). +[conformance.proto](https://github.com/protocolbuffers/protobuf/blob/master/conformance/conformance.proto). This is designed to be as easy as possible: the C++ version is only 150 lines and is a good example for what this program should look like -(see [conformance_cpp.cc](https://github.com/google/protobuf/blob/master/conformance/conformance_cpp.cc)). +(see [conformance_cpp.cc](https://github.com/protocolbuffers/protobuf/blob/master/conformance/conformance_cpp.cc)). The program only needs to be able to read from stdin and write to stdout. Portability diff --git a/csharp/Google.Protobuf.Tools.nuspec b/csharp/Google.Protobuf.Tools.nuspec index 901d5ce925..05779d442e 100644 --- a/csharp/Google.Protobuf.Tools.nuspec +++ b/csharp/Google.Protobuf.Tools.nuspec @@ -8,8 +8,8 @@ 3.6.1 Google Inc. protobuf-packages - https://github.com/google/protobuf/blob/master/LICENSE - https://github.com/google/protobuf + https://github.com/protocolbuffers/protobuf/blob/master/LICENSE + https://github.com/protocolbuffers/protobuf false Tools for Protocol Buffers Copyright 2015, Google Inc. diff --git a/csharp/README.md b/csharp/README.md index 9d1225f1a8..aafef16ada 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -77,7 +77,7 @@ History of C# protobufs This subtree was originally imported from https://github.com/jskeet/protobuf-csharp-port and represents the latest development version of C# protobufs, that will now be developed and maintained by Google. All the development will be done in open, under this repository -(https://github.com/google/protobuf). +(https://github.com/protocolbuffers/protobuf). The previous project differs from this project in a number of ways: diff --git a/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto b/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto index 6c9f76344a..7bec1f8017 100644 --- a/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto +++ b/csharp/compatibility_tests/v3.0.0/protos/csharp/protos/unittest_issues.proto @@ -19,7 +19,7 @@ message Issue307 { } // Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 -// New issue 309: https://github.com/google/protobuf/issues/309 +// New issue 309: https://github.com/protocolbuffers/protobuf/issues/309 // message A { // optional int32 _A = 1; @@ -35,7 +35,7 @@ message Issue307 { // Similar issue with numeric names // Java code failed too, so probably best for this to be a restriction. -// See https://github.com/google/protobuf/issues/308 +// See https://github.com/protocolbuffers/protobuf/issues/308 // message NumberField { // optional int32 _01 = 1; // } diff --git a/csharp/protos/unittest_issues.proto b/csharp/protos/unittest_issues.proto index 0d8793e1e9..1619f13da1 100644 --- a/csharp/protos/unittest_issues.proto +++ b/csharp/protos/unittest_issues.proto @@ -18,7 +18,7 @@ message Issue307 { } // Old issue 13: http://code.google.com/p/protobuf-csharp-port/issues/detail?id=13 -// New issue 309: https://github.com/google/protobuf/issues/309 +// New issue 309: https://github.com/protocolbuffers/protobuf/issues/309 // message A { // optional int32 _A = 1; @@ -34,7 +34,7 @@ message Issue307 { // Similar issue with numeric names // Java code failed too, so probably best for this to be a restriction. -// See https://github.com/google/protobuf/issues/308 +// See https://github.com/protocolbuffers/protobuf/issues/308 // message NumberField { // optional int32 _01 = 1; // } diff --git a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs index afdd491f36..84e6341e95 100644 --- a/csharp/src/Google.Protobuf.Test/ByteStringTest.cs +++ b/csharp/src/Google.Protobuf.Test/ByteStringTest.cs @@ -227,7 +227,7 @@ namespace Google.Protobuf { // We used to have an awful hash algorithm where only the last four // bytes were relevant. This is a regression test for - // https://github.com/google/protobuf/issues/2511 + // https://github.com/protocolbuffers/protobuf/issues/2511 ByteString b1 = ByteString.CopyFrom(100, 1, 2, 3, 4); ByteString b2 = ByteString.CopyFrom(200, 1, 2, 3, 4); diff --git a/csharp/src/Google.Protobuf/Google.Protobuf.csproj b/csharp/src/Google.Protobuf/Google.Protobuf.csproj index a056b43537..8ea3818a4a 100644 --- a/csharp/src/Google.Protobuf/Google.Protobuf.csproj +++ b/csharp/src/Google.Protobuf/Google.Protobuf.csproj @@ -13,10 +13,10 @@ true Protocol;Buffers;Binary;Serialization;Format;Google;proto;proto3 C# proto3 support - https://github.com/google/protobuf - https://github.com/google/protobuf/blob/master/LICENSE + https://github.com/protocolbuffers/protobuf + https://github.com/protocolbuffers/protobuf/blob/master/LICENSE git - https://github.com/google/protobuf.git + https://github.com/protocolbuffers/protobuf.git + release + + + + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.6 + true + + https://oss.sonatype.org/ + sonatype-nexus-staging + false + + + + + + + diff --git a/java/pom.xml b/java/pom.xml index b9098c0f99..070951a109 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -56,6 +56,13 @@ + + com.google.protobuf + protobuf-bom + ${project.version} + pom + import + junit junit @@ -200,6 +207,7 @@ + bom core util diff --git a/java/util/pom.xml b/java/util/pom.xml index f175cf1522..217ba16fbe 100644 --- a/java/util/pom.xml +++ b/java/util/pom.xml @@ -19,7 +19,6 @@ ${project.groupId} protobuf-java - ${project.version} com.google.guava From 75a185085316b3ac24d584b2f5e812e82109761b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 12 Nov 2018 22:44:10 +0100 Subject: [PATCH 130/569] Remove superfluous const from return type in json_stream_parser.h (#5295) --- src/google/protobuf/util/internal/json_stream_parser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/util/internal/json_stream_parser.h b/src/google/protobuf/util/internal/json_stream_parser.h index 3526ec575b..6dcf7ade54 100644 --- a/src/google/protobuf/util/internal/json_stream_parser.h +++ b/src/google/protobuf/util/internal/json_stream_parser.h @@ -95,7 +95,7 @@ class PROTOBUF_EXPORT JsonStreamParser { private: friend class JsonStreamParserTest; // Return the current recursion depth. - const int recursion_depth() { return recursion_depth_; } + int recursion_depth() { return recursion_depth_; } enum TokenType { BEGIN_STRING, // " or ' From 627cc48f5a58e308c7994be2502f771c9f435ff1 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 13 Nov 2018 18:21:30 +0000 Subject: [PATCH 131/569] Increase C# default recursion limit to 100 (#5339) * Increase C# default recursion limit to 100 This matches the Java and C++ defaults. * Change compatibility tests to use execution-time default recursion limit This way the same tests should pass against all versions, even if the recursion limit changes. (The tests will be testing whether different messages work, admittedly - but that's probably fine.) --- .../src/Google.Protobuf.Test/CodedInputStreamTest.cs | 10 +++++----- .../src/Google.Protobuf.Test/CodedInputStreamTest.cs | 10 +++++----- csharp/src/Google.Protobuf/CodedInputStream.cs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs index ff44895c06..73a578d2b5 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/CodedInputStreamTest.cs @@ -313,14 +313,14 @@ namespace Google.Protobuf [Test] public void MaliciousRecursion() { - ByteString data64 = MakeRecursiveMessage(64).ToByteString(); - ByteString data65 = MakeRecursiveMessage(65).ToByteString(); + ByteString atRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit).ToByteString(); + ByteString beyondRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit + 1).ToByteString(); - AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(data64), 64); + AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(atRecursiveLimit), CodedInputStream.DefaultRecursionLimit); - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(data65)); + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(beyondRecursiveLimit)); - CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(data64.ToByteArray()), 1000000, 63); + CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(atRecursiveLimit.ToByteArray()), 1000000, CodedInputStream.DefaultRecursionLimit - 1); Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(input)); } diff --git a/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs b/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs index 8795fa65f4..58d7a9d655 100644 --- a/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs +++ b/csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs @@ -327,14 +327,14 @@ namespace Google.Protobuf [Test] public void MaliciousRecursion() { - ByteString data64 = MakeRecursiveMessage(64).ToByteString(); - ByteString data65 = MakeRecursiveMessage(65).ToByteString(); + ByteString atRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit).ToByteString(); + ByteString beyondRecursiveLimit = MakeRecursiveMessage(CodedInputStream.DefaultRecursionLimit + 1).ToByteString(); - AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(data64), 64); + AssertMessageDepth(TestRecursiveMessage.Parser.ParseFrom(atRecursiveLimit), CodedInputStream.DefaultRecursionLimit); - Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(data65)); + Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(beyondRecursiveLimit)); - CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(data64.ToByteArray()), 1000000, 63); + CodedInputStream input = CodedInputStream.CreateWithLimits(new MemoryStream(atRecursiveLimit.ToByteArray()), 1000000, CodedInputStream.DefaultRecursionLimit - 1); Assert.Throws(() => TestRecursiveMessage.Parser.ParseFrom(input)); } diff --git a/csharp/src/Google.Protobuf/CodedInputStream.cs b/csharp/src/Google.Protobuf/CodedInputStream.cs index 0428fb54e6..e1de7a0521 100644 --- a/csharp/src/Google.Protobuf/CodedInputStream.cs +++ b/csharp/src/Google.Protobuf/CodedInputStream.cs @@ -93,7 +93,7 @@ namespace Google.Protobuf private uint nextTag = 0; private bool hasNextTag = false; - internal const int DefaultRecursionLimit = 64; + internal const int DefaultRecursionLimit = 100; internal const int DefaultSizeLimit = Int32.MaxValue; internal const int BufferSize = 4096; @@ -260,7 +260,7 @@ namespace Google.Protobuf /// to avoid maliciously-recursive data. /// /// - /// The default limit is 64. + /// The default limit is 100. /// /// /// The recursion limit for this stream. From cf900534a79554961a2446b0c288884145c01424 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 13 Nov 2018 09:50:41 -0800 Subject: [PATCH 132/569] Removed stubs/singleton.h This header is no longer used, so we can delete it. I also tweaked Makefile.am to fix the distcheck test. --- Makefile.am | 1 + src/google/protobuf/stubs/singleton.h | 67 --------------------------- 2 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 src/google/protobuf/stubs/singleton.h diff --git a/Makefile.am b/Makefile.am index 309840a1cf..86aad3caab 100644 --- a/Makefile.am +++ b/Makefile.am @@ -209,6 +209,7 @@ csharp_EXTRA_DIST= \ java_EXTRA_DIST= \ java/README.md \ + java/bom/pom.xml \ java/core/generate-sources-build.xml \ java/core/generate-test-sources-build.xml \ java/core/pom.xml \ diff --git a/src/google/protobuf/stubs/singleton.h b/src/google/protobuf/stubs/singleton.h deleted file mode 100644 index 5f0f461054..0000000000 --- a/src/google/protobuf/stubs/singleton.h +++ /dev/null @@ -1,67 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2014 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ -#define GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ - -#include -#include - -namespace google { -namespace protobuf { -namespace internal { -template -class Singleton { - public: - static T* get() { - GoogleOnceInit(&once_, &Singleton::Init); - return instance_; - } - static void ShutDown() { - delete instance_; - instance_ = nullptr; - } - private: - static void Init() { - instance_ = new T(); - } - static ProtobufOnceType once_; - static T* instance_; -}; - -template -ProtobufOnceType Singleton::once_; - -template -T* Singleton::instance_ = nullptr; -} // namespace internal -} // namespace protobuf -} // namespace google - -#endif // GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ From 83ddea02bdcec2d98fa4d3bbec3d0acc16334114 Mon Sep 17 00:00:00 2001 From: Aleix Conchillo Flaque Date: Wed, 7 Nov 2018 21:55:34 -0800 Subject: [PATCH 133/569] compiler/cpp: replace NULL with nullptr This avoids compiler errors/warnings if zero-as-null-pointer-constant is considered an error or warning. --- src/google/protobuf/any.pb.cc | 6 +- src/google/protobuf/any.pb.h | 14 +- src/google/protobuf/api.pb.cc | 28 +- src/google/protobuf/api.pb.h | 58 +- .../protobuf/compiler/cpp/cpp_enum_field.cc | 4 +- src/google/protobuf/compiler/cpp/cpp_file.cc | 6 +- .../protobuf/compiler/cpp/cpp_map_field.cc | 6 +- .../protobuf/compiler/cpp/cpp_message.cc | 30 +- .../compiler/cpp/cpp_message_field.cc | 58 +- .../protobuf/compiler/cpp/cpp_string_field.cc | 34 +- src/google/protobuf/compiler/plugin.pb.cc | 30 +- src/google/protobuf/compiler/plugin.pb.h | 76 +-- src/google/protobuf/descriptor.pb.cc | 338 +++++----- src/google/protobuf/descriptor.pb.h | 606 +++++++++--------- src/google/protobuf/duration.pb.cc | 10 +- src/google/protobuf/duration.pb.h | 2 +- src/google/protobuf/empty.pb.cc | 10 +- src/google/protobuf/empty.pb.h | 2 +- src/google/protobuf/field_mask.pb.cc | 10 +- src/google/protobuf/field_mask.pb.h | 6 +- src/google/protobuf/source_context.pb.cc | 6 +- src/google/protobuf/source_context.pb.h | 10 +- src/google/protobuf/struct.pb.cc | 46 +- src/google/protobuf/struct.pb.h | 42 +- src/google/protobuf/timestamp.pb.cc | 10 +- src/google/protobuf/timestamp.pb.h | 2 +- src/google/protobuf/type.pb.cc | 88 +-- src/google/protobuf/type.pb.h | 142 ++-- src/google/protobuf/wrappers.pb.cc | 90 +-- src/google/protobuf/wrappers.pb.h | 38 +- 30 files changed, 904 insertions(+), 904 deletions(-) diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc index 156ac47687..d37b23c707 100644 --- a/src/google/protobuf/any.pb.cc +++ b/src/google/protobuf/any.pb.cc @@ -134,13 +134,13 @@ const int Any::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Any::Any() - : ::google::protobuf::Message(), _internal_metadata_(NULL), _any_metadata_(&type_url_, &value_) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr), _any_metadata_(&type_url_, &value_) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Any) } Any::Any(const Any& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _any_metadata_(&type_url_, &value_) { _internal_metadata_.MergeFrom(from._internal_metadata_); type_url_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -422,7 +422,7 @@ void Any::MergeFrom(const ::google::protobuf::Message& from) { const Any* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Any) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { diff --git a/src/google/protobuf/any.pb.h b/src/google/protobuf/any.pb.h index 57b7df82ba..a56549a4b4 100644 --- a/src/google/protobuf/any.pb.h +++ b/src/google/protobuf/any.pb.h @@ -124,7 +124,7 @@ class PROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_inser // implements Message ---------------------------------------------- inline Any* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Any* New(::google::protobuf::Arena* arena) const final { @@ -158,10 +158,10 @@ class PROTOBUF_EXPORT Any : public ::google::protobuf::Message /* @@protoc_inser void InternalSwap(Any* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -243,7 +243,7 @@ inline void Any::set_type_url(::std::string&& value) { } #endif inline void Any::set_type_url(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Any.type_url) @@ -265,7 +265,7 @@ inline ::std::string* Any::release_type_url() { return type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Any::set_allocated_type_url(::std::string* type_url) { - if (type_url != NULL) { + if (type_url != nullptr) { } else { @@ -296,7 +296,7 @@ inline void Any::set_value(::std::string&& value) { } #endif inline void Any::set_value(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Any.value) @@ -318,7 +318,7 @@ inline ::std::string* Any::release_value() { return value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Any::set_allocated_value(::std::string* value) { - if (value != NULL) { + if (value != nullptr) { } else { diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc index 7ecd8efeaf..846ea6b7ae 100644 --- a/src/google/protobuf/api.pb.cc +++ b/src/google/protobuf/api.pb.cc @@ -204,10 +204,10 @@ void Api::clear_options() { options_.Clear(); } void Api::clear_source_context() { - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) { delete source_context_; } - source_context_ = NULL; + source_context_ = nullptr; } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Api::kNameFieldNumber; @@ -220,13 +220,13 @@ const int Api::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Api::Api() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Api) } Api::Api(const Api& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), methods_(from.methods_), options_(from.options_), mixins_(from.mixins_) { @@ -242,7 +242,7 @@ Api::Api(const Api& from) if (from.has_source_context()) { source_context_ = new ::google::protobuf::SourceContext(*from.source_context_); } else { - source_context_ = NULL; + source_context_ = nullptr; } syntax_ = from.syntax_; // @@protoc_insertion_point(copy_constructor:google.protobuf.Api) @@ -289,10 +289,10 @@ void Api::Clear() { mixins_.Clear(); name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) { delete source_context_; } - source_context_ = NULL; + source_context_ = nullptr; syntax_ = 0; _internal_metadata_.Clear(); } @@ -800,7 +800,7 @@ void Api::MergeFrom(const ::google::protobuf::Message& from) { const Api* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Api) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -899,13 +899,13 @@ const int Method::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Method::Method() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Method) } Method::Method(const Method& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -1454,7 +1454,7 @@ void Method::MergeFrom(const ::google::protobuf::Message& from) { const Method* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Method) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1551,13 +1551,13 @@ const int Mixin::kRootFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Mixin::Mixin() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Mixin) } Mixin::Mixin(const Mixin& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -1851,7 +1851,7 @@ void Mixin::MergeFrom(const ::google::protobuf::Message& from) { const Mixin* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Mixin) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { diff --git a/src/google/protobuf/api.pb.h b/src/google/protobuf/api.pb.h index baa725f2af..10edb98483 100644 --- a/src/google/protobuf/api.pb.h +++ b/src/google/protobuf/api.pb.h @@ -118,7 +118,7 @@ class PROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_inser // implements Message ---------------------------------------------- inline Api* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Api* New(::google::protobuf::Arena* arena) const final { @@ -152,10 +152,10 @@ class PROTOBUF_EXPORT Api : public ::google::protobuf::Message /* @@protoc_inser void InternalSwap(Api* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -308,7 +308,7 @@ class PROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc_in // implements Message ---------------------------------------------- inline Method* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Method* New(::google::protobuf::Arena* arena) const final { @@ -342,10 +342,10 @@ class PROTOBUF_EXPORT Method : public ::google::protobuf::Message /* @@protoc_in void InternalSwap(Method* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -491,7 +491,7 @@ class PROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_ins // implements Message ---------------------------------------------- inline Mixin* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Mixin* New(::google::protobuf::Arena* arena) const final { @@ -525,10 +525,10 @@ class PROTOBUF_EXPORT Mixin : public ::google::protobuf::Message /* @@protoc_ins void InternalSwap(Mixin* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -609,7 +609,7 @@ inline void Api::set_name(::std::string&& value) { } #endif inline void Api::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Api.name) @@ -631,7 +631,7 @@ inline ::std::string* Api::release_name() { return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Api::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { } else { @@ -719,7 +719,7 @@ inline void Api::set_version(::std::string&& value) { } #endif inline void Api::set_version(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Api.version) @@ -741,7 +741,7 @@ inline ::std::string* Api::release_version() { return version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Api::set_allocated_version(::std::string* version) { - if (version != NULL) { + if (version != nullptr) { } else { @@ -752,24 +752,24 @@ inline void Api::set_allocated_version(::std::string* version) { // .google.protobuf.SourceContext source_context = 5; inline bool Api::has_source_context() const { - return this != internal_default_instance() && source_context_ != NULL; + return this != internal_default_instance() && source_context_ != nullptr; } inline const ::google::protobuf::SourceContext& Api::source_context() const { const ::google::protobuf::SourceContext* p = source_context_; // @@protoc_insertion_point(field_get:google.protobuf.Api.source_context) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_SourceContext_default_instance_); } inline ::google::protobuf::SourceContext* Api::release_source_context() { // @@protoc_insertion_point(field_release:google.protobuf.Api.source_context) ::google::protobuf::SourceContext* temp = source_context_; - source_context_ = NULL; + source_context_ = nullptr; return temp; } inline ::google::protobuf::SourceContext* Api::mutable_source_context() { - if (source_context_ == NULL) { + if (source_context_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::SourceContext>(GetArenaNoVirtual()); source_context_ = p; } @@ -778,11 +778,11 @@ inline ::google::protobuf::SourceContext* Api::mutable_source_context() { } inline void Api::set_allocated_source_context(::google::protobuf::SourceContext* source_context) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete reinterpret_cast< ::google::protobuf::MessageLite*>(source_context_); } if (source_context) { - ::google::protobuf::Arena* submessage_arena = NULL; + ::google::protobuf::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { source_context = ::google::protobuf::internal::GetOwnedMessage( message_arena, source_context, submessage_arena); @@ -865,7 +865,7 @@ inline void Method::set_name(::std::string&& value) { } #endif inline void Method::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Method.name) @@ -887,7 +887,7 @@ inline ::std::string* Method::release_name() { return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Method::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { } else { @@ -918,7 +918,7 @@ inline void Method::set_request_type_url(::std::string&& value) { } #endif inline void Method::set_request_type_url(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); request_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Method.request_type_url) @@ -940,7 +940,7 @@ inline ::std::string* Method::release_request_type_url() { return request_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Method::set_allocated_request_type_url(::std::string* request_type_url) { - if (request_type_url != NULL) { + if (request_type_url != nullptr) { } else { @@ -985,7 +985,7 @@ inline void Method::set_response_type_url(::std::string&& value) { } #endif inline void Method::set_response_type_url(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); response_type_url_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Method.response_type_url) @@ -1007,7 +1007,7 @@ inline ::std::string* Method::release_response_type_url() { return response_type_url_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Method::set_allocated_response_type_url(::std::string* response_type_url) { - if (response_type_url != NULL) { + if (response_type_url != nullptr) { } else { @@ -1097,7 +1097,7 @@ inline void Mixin::set_name(::std::string&& value) { } #endif inline void Mixin::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.name) @@ -1119,7 +1119,7 @@ inline ::std::string* Mixin::release_name() { return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Mixin::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { } else { @@ -1150,7 +1150,7 @@ inline void Mixin::set_root(::std::string&& value) { } #endif inline void Mixin::set_root(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); root_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.Mixin.root) @@ -1172,7 +1172,7 @@ inline ::std::string* Mixin::release_root() { return root_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Mixin::set_allocated_root(::std::string* root) { - if (root != NULL) { + if (root != nullptr) { } else { diff --git a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc index a406f2eec8..256afb9d9e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum_field.cc @@ -365,8 +365,8 @@ void RepeatedEnumFieldGenerator::GenerateMergeFromCodedStreamWithPacking( "WireFormatLite::ReadPackedEnumPreserveUnknowns(\n" " input,\n" " $number$,\n" - " NULL,\n" - " NULL,\n" + " nullptr,\n" + " nullptr,\n" " this->mutable_$name$())));\n"); } else if (UseUnknownFieldSet(descriptor_->file(), options_)) { format( diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc index 214449af59..5df9e8004b 100644 --- a/src/google/protobuf/compiler/cpp/cpp_file.cc +++ b/src/google/protobuf/compiler/cpp/cpp_file.cc @@ -782,10 +782,10 @@ void FileGenerator::GenerateReflectionInitializationCode(io::Printer* printer) { // MSVC doesn't like empty arrays, so we add a dummy. "const $uint32$ $tablename$::offsets[1] = {};\n" "static constexpr ::$proto_ns$::internal::MigrationSchema* schemas = " - "NULL;" + "nullptr;" "\n" "static constexpr ::$proto_ns$::Message* const* " - "file_default_instances = NULL;\n" + "file_default_instances = nullptr;\n" "\n"); } @@ -1019,7 +1019,7 @@ void FileGenerator::GenerateTables(io::Printer* printer) { } if (message_generators_.empty()) { - format("{ NULL, NULL, 0, -1, -1, false },\n"); + format("{ nullptr, nullptr, 0, -1, -1, false },\n"); } format.Outdent(); diff --git a/src/google/protobuf/compiler/cpp/cpp_map_field.cc b/src/google/protobuf/compiler/cpp/cpp_map_field.cc index 3114bbf7df..c9816731f3 100644 --- a/src/google/protobuf/compiler/cpp/cpp_map_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_map_field.cc @@ -274,7 +274,7 @@ static void GenerateSerializationLoop(const Formatter& format, // If entry is allocated by arena, its desctructor should be avoided. if (supports_arenas) { format( - "if (entry->GetArena() != NULL) {\n" + "if (entry->GetArena() != nullptr) {\n" " entry.release();\n" "}\n"); } @@ -395,7 +395,7 @@ GenerateByteSize(io::Printer* printer) const { // If entry is allocated by arena, its desctructor should be avoided. if (SupportsArenas(descriptor_)) { format( - " if (entry.get() != NULL && entry->GetArena() != NULL) {\n" + " if (entry.get() != nullptr && entry->GetArena() != nullptr) {\n" " entry.release();\n" " }\n"); } @@ -409,7 +409,7 @@ GenerateByteSize(io::Printer* printer) const { // If entry is allocated by arena, its desctructor should be avoided. if (SupportsArenas(descriptor_)) { format( - " if (entry.get() != NULL && entry->GetArena() != NULL) {\n" + " if (entry.get() != nullptr && entry->GetArena() != nullptr) {\n" " entry.release();\n" " }\n"); } diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index f9d87ed1d5..96354dd45b 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -800,7 +800,7 @@ void MessageGenerator::GenerateSingularFieldHasBits( } else { format( "inline bool $classname$::has_$name$() const {\n" - " return this != internal_default_instance() && $name$_ != NULL;\n" + " return this != internal_default_instance() && $name$_ != nullptr;\n" "}\n"); } } @@ -1116,7 +1116,7 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) { "// implements Message ----------------------------------------------\n" "\n" "inline $classname$* New() const$ new_final$ {\n" - " return CreateMaybeMessage<$classname$>(NULL);\n" + " return CreateMaybeMessage<$classname$>(nullptr);\n" "}\n" "\n" "$classname$* New(::$proto_ns$::Arena* arena) const$ new_final$ {\n" @@ -1226,10 +1226,10 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) { format( "private:\n" "inline ::$proto_ns$::Arena* GetArenaNoVirtual() const {\n" - " return NULL;\n" + " return nullptr;\n" "}\n" "inline void* MaybeArenaPtr() const {\n" - " return NULL;\n" + " return nullptr;\n" "}\n"); } @@ -1490,7 +1490,7 @@ bool MessageGenerator::GenerateParseTable(io::Printer* printer, size_t offset, Formatter format(printer, variables_); if (!table_driven_) { - format("{ NULL, NULL, 0, -1, -1, -1, -1, NULL, false },\n"); + format("{ nullptr, nullptr, 0, -1, -1, -1, -1, nullptr, false },\n"); return false; } @@ -1628,7 +1628,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { vars["hasbit"] = SimpleItoa(i); vars["type"] = SimpleItoa(CalcFieldNum(generator, field, options_)); - vars["ptr"] = "NULL"; + vars["ptr"] = "nullptr"; if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { GOOGLE_CHECK(!IsMapEntryMessage(field->message_type())); if (!IsProto1(field->message_type()->file(), options_)) { @@ -1654,7 +1654,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { return 2; } format( - "{PROTOBUF_FIELD_OFFSET($classtype$, _cached_size_), 0, 0, 0, NULL},\n"); + "{PROTOBUF_FIELD_OFFSET($classtype$, _cached_size_), 0, 0, 0, nullptr},\n"); std::vector sorted_extensions; for (int i = 0; i < descriptor_->extension_range_count(); ++i) { sorted_extensions.push_back(descriptor_->extension_range(i)); @@ -1690,7 +1690,7 @@ int MessageGenerator::GenerateFieldMetadata(io::Printer* printer) { classfieldname = field->containing_oneof()->name(); } format.Set("field_name", classfieldname); - string ptr = "NULL"; + string ptr = "nullptr"; if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE) { if (IsMapEntryMessage(field->message_type())) { format( @@ -1819,7 +1819,7 @@ void MessageGenerator::GenerateDefaultInstanceInitializer( format( "$package_ns$::$name$_ = reinterpret_cast(&$1$);\n" - "if ($package_ns$::$name$_ == NULL) {\n" + "if ($package_ns$::$name$_ == nullptr) {\n" " $package_ns$::$name$_ = " "::$proto_ns$::Empty::internal_default_instance();\n" "}\n", @@ -2364,7 +2364,7 @@ void MessageGenerator::GenerateSharedDestructorCode(io::Printer* printer) { format("void $classname$::SharedDtor() {\n"); format.Indent(); if (SupportsArenas(descriptor_)) { - format("$DCHK$(GetArenaNoVirtual() == NULL);\n"); + format("$DCHK$(GetArenaNoVirtual() == nullptr);\n"); } // Write the destructors for each field except oneof members. // optimized_order_ does not contain oneof fields. @@ -2440,7 +2440,7 @@ void MessageGenerator::GenerateArenaDestructorCode(io::Printer* printer) { format( "inline void $classname$::RegisterArenaDtor(::$proto_ns$::Arena* " "arena) {\n" - " if (arena != NULL) {\n" + " if (arena != nullptr) {\n" " arena->OwnCustomDestructor(this, &$classname$::ArenaDtor);\n" " }\n" "}\n"); @@ -2555,7 +2555,7 @@ void MessageGenerator::GenerateStructors(io::Printer* printer) { initializer_with_arena += ", _weak_field_map_(arena)"; } - string initializer_null = superclass + "(), _internal_metadata_(NULL)"; + string initializer_null = superclass + "(), _internal_metadata_(nullptr)"; if (IsAnyMessage(descriptor_, options_)) { initializer_null += ", _any_metadata_(&type_url_, &value_)"; } @@ -2600,7 +2600,7 @@ void MessageGenerator::GenerateStructors(io::Printer* printer) { format.Indent(); format.Indent(); format.Indent(); - format(",\n_internal_metadata_(NULL)"); + format(",\n_internal_metadata_(nullptr)"); if (HasFieldPresence(descriptor_->file())) { if (!IsProto2MessageSet(descriptor_, options_)) { @@ -3001,7 +3001,7 @@ void MessageGenerator::GenerateSwap(io::Printer* printer) { " temp->MergeFrom(*other);\n" " other->CopyFrom(*this);\n" " InternalSwap(temp);\n" - " if (GetArenaNoVirtual() == NULL) {\n" + " if (GetArenaNoVirtual() == nullptr) {\n" " delete temp;\n" " }\n" " }\n" @@ -3084,7 +3084,7 @@ void MessageGenerator::GenerateMergeFrom(io::Printer* printer) { "const $classname$* source =\n" " ::$proto_ns$::DynamicCastToGenerated<$classname$>(\n" " &from);\n" - "if (source == NULL) {\n" + "if (source == nullptr) {\n" "// @@protoc_insertion_point(generalized_merge_from_cast_fail:" "$full_name$)\n" " ::$proto_ns$::internal::ReflectionOps::Merge(from, this);\n" diff --git a/src/google/protobuf/compiler/cpp/cpp_message_field.cc b/src/google/protobuf/compiler/cpp/cpp_message_field.cc index afb272730d..1df2508e76 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message_field.cc @@ -149,7 +149,7 @@ void MessageFieldGenerator::GenerateNonInlineAccessorDefinitions( " $type$* $name$) {\n" // If we're not on an arena, free whatever we were holding before. // (If we are on arena, we can just forget the earlier pointer.) - " if (GetArenaNoVirtual() == NULL) {\n" + " if (GetArenaNoVirtual() == nullptr) {\n" " delete $name$_;\n" " }\n" " $name$_ = $name$;\n" @@ -171,7 +171,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { "inline const $type$& $classname$::$name$() const {\n" " const $type$* p = $casted_member$;\n" " // @@protoc_insertion_point(field_get:$full_name$)\n" - " return p != NULL ? *p : *reinterpret_cast(\n" + " return p != nullptr ? *p : *reinterpret_cast(\n" " &$type_default_instance$);\n" "}\n"); @@ -183,12 +183,12 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { " $type$* temp = $casted_member$;\n"); if (SupportsArenas(descriptor_)) { format( - " if (GetArenaNoVirtual() != NULL) {\n" + " if (GetArenaNoVirtual() != nullptr) {\n" " temp = ::$proto_ns$::internal::DuplicateIfNonNull(temp);\n" " }\n"); } format( - " $name$_ = NULL;\n" + " $name$_ = nullptr;\n" " return temp;\n" "}\n"); @@ -200,7 +200,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { "$type_reference_function$" " $clear_hasbit$\n" " $type$* temp = $casted_member$;\n" - " $name$_ = NULL;\n" + " $name$_ = nullptr;\n" " return temp;\n" "}\n"); } @@ -208,7 +208,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { format( "inline $type$* $classname$::mutable_$name$() {\n" " $set_hasbit$\n" - " if ($name$_ == NULL) {\n" + " if ($name$_ == nullptr) {\n" " auto* p = CreateMaybeMessage<$type$>(GetArenaNoVirtual());\n"); if (implicit_weak_field_) { format(" $name$_ = reinterpret_cast<::$proto_ns$::MessageLite*>(p);\n"); @@ -226,7 +226,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { format( "inline void $classname$::set_allocated_$name$($type$* $name$) {\n" " ::$proto_ns$::Arena* message_arena = GetArenaNoVirtual();\n"); - format(" if (message_arena == NULL) {\n"); + format(" if (message_arena == nullptr) {\n"); if (IsCrossFileMessage(descriptor_)) { format( " delete reinterpret_cast< ::$proto_ns$::MessageLite*>($name$_);\n"); @@ -245,7 +245,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { " " "reinterpret_cast<::$proto_ns$::MessageLite*>($name$)->GetArena();\n"); } else if (!SupportsArenas(descriptor_->message_type())) { - format(" ::$proto_ns$::Arena* submessage_arena = NULL;\n"); + format(" ::$proto_ns$::Arena* submessage_arena = nullptr;\n"); } else { format( " ::$proto_ns$::Arena* submessage_arena =\n" @@ -297,9 +297,9 @@ GenerateInternalAccessorDefinitions(io::Printer* printer) const { format( "const ::$proto_ns$::MessageLite& $classname$::HasBitSetters::$name$(\n" " const $classname$* msg) {\n" - " if (msg->$name$_ != NULL) {\n" + " if (msg->$name$_ != nullptr) {\n" " return *msg->$name$_;\n" - " } else if (&$type_default_instance$ != NULL) {\n" + " } else if (&$type_default_instance$ != nullptr) {\n" " return *reinterpret_cast(\n" " &$type_default_instance$);\n" " } else {\n" @@ -315,8 +315,8 @@ GenerateInternalAccessorDefinitions(io::Printer* printer) const { format(" msg->$set_hasbit$\n"); } format( - " if (msg->$name$_ == NULL) {\n" - " if (&$type_default_instance$ == NULL) {\n" + " if (msg->$name$_ == nullptr) {\n" + " if (&$type_default_instance$ == nullptr) {\n" " msg->$name$_ = ::$proto_ns$::Arena::CreateMessage<\n" " ::$proto_ns$::internal::ImplicitWeakMessage>(\n" " msg->GetArenaNoVirtual());\n" @@ -337,8 +337,8 @@ GenerateInternalAccessorDefinitions(io::Printer* printer) const { format(" msg->$set_hasbit$\n"); } format( - " if (msg->$name$_ == NULL) {\n" - " if (&$type_default_instance$ == NULL) {\n" + " if (msg->$name$_ == nullptr) {\n" + " if (&$type_default_instance$ == nullptr) {\n" " msg->$name$_ = " "new ::$proto_ns$::internal::ImplicitWeakMessage;\n" " } else {\n" @@ -369,12 +369,12 @@ GenerateClearingCode(io::Printer* printer) const { // If we don't have has-bits, message presence is indicated only by ptr != // NULL. Thus on clear, we need to delete the object. format( - "if (GetArenaNoVirtual() == NULL && $name$_ != NULL) {\n" + "if (GetArenaNoVirtual() == nullptr && $name$_ != nullptr) {\n" " delete $name$_;\n" "}\n" - "$name$_ = NULL;\n"); + "$name$_ = nullptr;\n"); } else { - format("if ($name$_ != NULL) $name$_->Clear();\n"); + format("if ($name$_ != nullptr) $name$_->Clear();\n"); } } @@ -385,13 +385,13 @@ GenerateMessageClearingCode(io::Printer* printer) const { // If we don't have has-bits, message presence is indicated only by ptr != // NULL. Thus on clear, we need to delete the object. format( - "if (GetArenaNoVirtual() == NULL && $name$_ != NULL) {\n" + "if (GetArenaNoVirtual() == nullptr && $name$_ != nullptr) {\n" " delete $name$_;\n" "}\n" - "$name$_ = NULL;\n"); + "$name$_ = nullptr;\n"); } else { format( - "$DCHK$($name$_ != NULL);\n" + "$DCHK$($name$_ != nullptr);\n" "$name$_->Clear();\n"); } } @@ -431,7 +431,7 @@ GenerateDestructorCode(io::Printer* printer) const { void MessageFieldGenerator:: GenerateConstructorCode(io::Printer* printer) const { Formatter format(printer, variables_); - format("$name$_ = NULL;\n"); + format("$name$_ = nullptr;\n"); } void MessageFieldGenerator:: @@ -441,7 +441,7 @@ GenerateCopyConstructorCode(io::Printer* printer) const { "if (from.has_$name$()) {\n" " $name$_ = new $type$(*from.$name$_);\n" "} else {\n" - " $name$_ = NULL;\n" + " $name$_ = nullptr;\n" "}\n"); } @@ -517,7 +517,7 @@ void MessageOneofFieldGenerator::GenerateNonInlineAccessorDefinitions( " " "reinterpret_cast<::$proto_ns$::MessageLite*>($name$)->GetArena();\n"); } else if (!SupportsArenas(descriptor_->message_type())) { - format(" ::$proto_ns$::Arena* submessage_arena = NULL;\n"); + format(" ::$proto_ns$::Arena* submessage_arena = nullptr;\n"); } else { format( " ::$proto_ns$::Arena* submessage_arena =\n" @@ -546,15 +546,15 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { " $type$* temp = $field_member$;\n"); if (SupportsArenas(descriptor_)) { format( - " if (GetArenaNoVirtual() != NULL) {\n" + " if (GetArenaNoVirtual() != nullptr) {\n" " temp = ::$proto_ns$::internal::DuplicateIfNonNull(temp);\n" " }\n"); } format( - " $field_member$ = NULL;\n" + " $field_member$ = nullptr;\n" " return temp;\n" " } else {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" "}\n"); @@ -574,10 +574,10 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { " if (has_$name$()) {\n" " clear_has_$oneof_name$();\n" " $type$* temp = $field_member$;\n" - " $field_member$ = NULL;\n" + " $field_member$ = nullptr;\n" " return temp;\n" " } else {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" "}\n" "inline void $classname$::unsafe_arena_set_allocated_$name$" @@ -613,7 +613,7 @@ GenerateClearingCode(io::Printer* printer) const { Formatter format(printer, variables_); if (SupportsArenas(descriptor_)) { format( - "if (GetArenaNoVirtual() == NULL) {\n" + "if (GetArenaNoVirtual() == nullptr) {\n" " delete $field_member$;\n" "}\n"); } else { diff --git a/src/google/protobuf/compiler/cpp/cpp_string_field.cc b/src/google/protobuf/compiler/cpp/cpp_string_field.cc index af4f880134..2676bb59cb 100644 --- a/src/google/protobuf/compiler/cpp/cpp_string_field.cc +++ b/src/google/protobuf/compiler/cpp/cpp_string_field.cc @@ -63,7 +63,7 @@ void SetStringVariables(const FieldDescriptor* descriptor, "::" + default_variable_string + ".get()"; (*variables)["pointer_type"] = descriptor->type() == FieldDescriptor::TYPE_BYTES ? "void" : "char"; - (*variables)["null_check"] = (*variables)["DCHK"] + "(value != NULL);\n"; + (*variables)["null_check"] = (*variables)["DCHK"] + "(value != nullptr);\n"; // NOTE: Escaped here to unblock proto1->proto2 migration. // TODO(liujisi): Extend this to apply for other conflicting methods. (*variables)["release_name"] = @@ -293,7 +293,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { if (HasFieldPresence(descriptor_->file())) { format( " if (!has_$name$()) {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" " $clear_hasbit$\n" " return $name$_.ReleaseNonDefault(" @@ -308,7 +308,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { format( "}\n" "inline void $classname$::set_allocated_$name$($string$* $name$) {\n" - " if ($name$ != NULL) {\n" + " if ($name$ != nullptr) {\n" " $set_hasbit$\n" " } else {\n" " $clear_hasbit$\n" @@ -322,15 +322,15 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { "inline $string$* $classname$::unsafe_arena_release_$name$() {\n" " // " "@@protoc_insertion_point(field_unsafe_arena_release:$full_name$)\n" - " $DCHK$(GetArenaNoVirtual() != NULL);\n" + " $DCHK$(GetArenaNoVirtual() != nullptr);\n" " $clear_hasbit$\n" " return $name$_.UnsafeArenaRelease($default_variable$,\n" " GetArenaNoVirtual());\n" "}\n" "inline void $classname$::unsafe_arena_set_allocated_$name$(\n" " $string$* $name$) {\n" - " $DCHK$(GetArenaNoVirtual() != NULL);\n" - " if ($name$ != NULL) {\n" + " $DCHK$(GetArenaNoVirtual() != nullptr);\n" + " if ($name$ != nullptr) {\n" " $set_hasbit$\n" " } else {\n" " $clear_hasbit$\n" @@ -403,7 +403,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { if (HasFieldPresence(descriptor_->file())) { format( " if (!has_$name$()) {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" " $clear_hasbit$\n" " return $name$_.ReleaseNonDefaultNoArena($default_variable$);\n"); @@ -416,7 +416,7 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { format( "}\n" "inline void $classname$::set_allocated_$name$($string$* $name$) {\n" - " if ($name$ != NULL) {\n" + " if ($name$ != nullptr) {\n" " $set_hasbit$\n" " } else {\n" " $clear_hasbit$\n" @@ -631,7 +631,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { // destructor necessary) or a materialized ::std::string (and is on the Arena's // destructor list). No call to ArenaStringPtr::Destroy is needed. format( - "if (arena != NULL) {\n" + "if (arena != nullptr) {\n" " ::$proto_ns$::internal::TaggedPtr<$string$> str =\n" " ::$proto_ns$::internal::ReadArenaString(input, arena);\n" " DO_(!str.IsNull());\n" @@ -819,14 +819,14 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { " return $field_member$.Release($default_variable$,\n" " GetArenaNoVirtual());\n" " } else {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" "}\n" "inline void $classname$::set_allocated_$name$($string$* $name$) {\n" " if (has_$oneof_name$()) {\n" " clear_$oneof_name$();\n" " }\n" - " if ($name$ != NULL) {\n" + " if ($name$ != nullptr) {\n" " set_has_$name$();\n" " $field_member$.UnsafeSetDefault($name$);\n" " }\n" @@ -837,18 +837,18 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { "inline $string$* $classname$::unsafe_arena_release_$name$() {\n" " // " "@@protoc_insertion_point(field_unsafe_arena_release:$full_name$)\n" - " $DCHK$(GetArenaNoVirtual() != NULL);\n" + " $DCHK$(GetArenaNoVirtual() != nullptr);\n" " if (has_$name$()) {\n" " clear_has_$oneof_name$();\n" " return $field_member$.UnsafeArenaRelease(\n" " $default_variable$, GetArenaNoVirtual());\n" " } else {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" "}\n" "inline void $classname$::unsafe_arena_set_allocated_$name$(" "$string$* $name$) {\n" - " $DCHK$(GetArenaNoVirtual() != NULL);\n" + " $DCHK$(GetArenaNoVirtual() != nullptr);\n" " if (!has_$name$()) {\n" " $field_member$.UnsafeSetDefault($default_variable$);\n" " }\n" @@ -957,14 +957,14 @@ GenerateInlineAccessorDefinitions(io::Printer* printer) const { " clear_has_$oneof_name$();\n" " return $field_member$.ReleaseNoArena($default_variable$);\n" " } else {\n" - " return NULL;\n" + " return nullptr;\n" " }\n" "}\n" "inline void $classname$::set_allocated_$name$($string$* $name$) {\n" " if (has_$oneof_name$()) {\n" " clear_$oneof_name$();\n" " }\n" - " if ($name$ != NULL) {\n" + " if ($name$ != nullptr) {\n" " set_has_$name$();\n" " $field_member$.UnsafeSetDefault($name$);\n" " }\n" @@ -1021,7 +1021,7 @@ GenerateMergeFromCodedStream(io::Printer* printer) const { // destructor necessary) or a materialized ::std::string (and is on the Arena's // destructor list). No call to ArenaStringPtr::Destroy is needed. format( - "if (arena != NULL) {\n" + "if (arena != nullptr) {\n" " clear_$oneof_name$();\n" " if (!has_$name$()) {\n" " $field_member$.UnsafeSetDefault($default_variable$);\n" diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index 171d1fecbb..89291a1e8b 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -245,13 +245,13 @@ const int Version::kSuffixFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Version::Version() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.Version) } Version::Version(const Version& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); suffix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -617,7 +617,7 @@ void Version::MergeFrom(const ::google::protobuf::Message& from) { const Version* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.compiler.Version) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -723,13 +723,13 @@ const int CodeGeneratorRequest::kCompilerVersionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 CodeGeneratorRequest::CodeGeneratorRequest() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorRequest) } CodeGeneratorRequest::CodeGeneratorRequest(const CodeGeneratorRequest& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), file_to_generate_(from.file_to_generate_), proto_file_(from.proto_file_) { @@ -741,7 +741,7 @@ CodeGeneratorRequest::CodeGeneratorRequest(const CodeGeneratorRequest& from) if (from.has_compiler_version()) { compiler_version_ = new ::google::protobuf::compiler::Version(*from.compiler_version_); } else { - compiler_version_ = NULL; + compiler_version_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.compiler.CodeGeneratorRequest) } @@ -750,7 +750,7 @@ void CodeGeneratorRequest::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_CodeGeneratorRequest_google_2fprotobuf_2fcompiler_2fplugin_2eproto.base); parameter_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - compiler_version_ = NULL; + compiler_version_ = nullptr; } CodeGeneratorRequest::~CodeGeneratorRequest() { @@ -786,7 +786,7 @@ void CodeGeneratorRequest::Clear() { parameter_.ClearNonDefaultToEmptyNoArena(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(compiler_version_ != NULL); + GOOGLE_DCHECK(compiler_version_ != nullptr); compiler_version_->Clear(); } } @@ -1150,7 +1150,7 @@ void CodeGeneratorRequest::MergeFrom(const ::google::protobuf::Message& from) { const CodeGeneratorRequest* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.compiler.CodeGeneratorRequest) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1244,13 +1244,13 @@ const int CodeGeneratorResponse_File::kContentFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 CodeGeneratorResponse_File::CodeGeneratorResponse_File() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorResponse.File) } CodeGeneratorResponse_File::CodeGeneratorResponse_File(const CodeGeneratorResponse_File& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -1629,7 +1629,7 @@ void CodeGeneratorResponse_File::MergeFrom(const ::google::protobuf::Message& fr const CodeGeneratorResponse_File* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.compiler.CodeGeneratorResponse.File) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1719,13 +1719,13 @@ const int CodeGeneratorResponse::kFileFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 CodeGeneratorResponse::CodeGeneratorResponse() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.compiler.CodeGeneratorResponse) } CodeGeneratorResponse::CodeGeneratorResponse(const CodeGeneratorResponse& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), file_(from.file_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -2017,7 +2017,7 @@ void CodeGeneratorResponse::MergeFrom(const ::google::protobuf::Message& from) { const CodeGeneratorResponse* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.compiler.CodeGeneratorResponse) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { diff --git a/src/google/protobuf/compiler/plugin.pb.h b/src/google/protobuf/compiler/plugin.pb.h index 6e8c8d25d0..b33bc60646 100644 --- a/src/google/protobuf/compiler/plugin.pb.h +++ b/src/google/protobuf/compiler/plugin.pb.h @@ -137,7 +137,7 @@ class PROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ins // implements Message ---------------------------------------------- inline Version* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Version* New(::google::protobuf::Arena* arena) const final { @@ -171,10 +171,10 @@ class PROTOC_EXPORT Version : public ::google::protobuf::Message /* @@protoc_ins void InternalSwap(Version* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -289,7 +289,7 @@ class PROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message /* // implements Message ---------------------------------------------- inline CodeGeneratorRequest* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } CodeGeneratorRequest* New(::google::protobuf::Arena* arena) const final { @@ -323,10 +323,10 @@ class PROTOC_EXPORT CodeGeneratorRequest : public ::google::protobuf::Message /* void InternalSwap(CodeGeneratorRequest* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -463,7 +463,7 @@ class PROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::Mess // implements Message ---------------------------------------------- inline CodeGeneratorResponse_File* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } CodeGeneratorResponse_File* New(::google::protobuf::Arena* arena) const final { @@ -497,10 +497,10 @@ class PROTOC_EXPORT CodeGeneratorResponse_File : public ::google::protobuf::Mess void InternalSwap(CodeGeneratorResponse_File* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -623,7 +623,7 @@ class PROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Message / // implements Message ---------------------------------------------- inline CodeGeneratorResponse* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } CodeGeneratorResponse* New(::google::protobuf::Arena* arena) const final { @@ -657,10 +657,10 @@ class PROTOC_EXPORT CodeGeneratorResponse : public ::google::protobuf::Message / void InternalSwap(CodeGeneratorResponse* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -801,7 +801,7 @@ inline void Version::set_suffix(::std::string&& value) { } #endif inline void Version::set_suffix(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; suffix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.Version.suffix) @@ -820,13 +820,13 @@ inline ::std::string* Version::mutable_suffix() { inline ::std::string* Version::release_suffix() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.Version.suffix) if (!has_suffix()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return suffix_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void Version::set_allocated_suffix(::std::string* suffix) { - if (suffix != NULL) { + if (suffix != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -865,7 +865,7 @@ inline void CodeGeneratorRequest::set_file_to_generate(int index, ::std::string& } #endif inline void CodeGeneratorRequest::set_file_to_generate(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); file_to_generate_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } @@ -889,7 +889,7 @@ inline void CodeGeneratorRequest::add_file_to_generate(::std::string&& value) { } #endif inline void CodeGeneratorRequest::add_file_to_generate(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); file_to_generate_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.compiler.CodeGeneratorRequest.file_to_generate) } @@ -934,7 +934,7 @@ inline void CodeGeneratorRequest::set_parameter(::std::string&& value) { } #endif inline void CodeGeneratorRequest::set_parameter(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; parameter_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorRequest.parameter) @@ -953,13 +953,13 @@ inline ::std::string* CodeGeneratorRequest::mutable_parameter() { inline ::std::string* CodeGeneratorRequest::release_parameter() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.parameter) if (!has_parameter()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return parameter_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void CodeGeneratorRequest::set_allocated_parameter(::std::string* parameter) { - if (parameter != NULL) { + if (parameter != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -1000,25 +1000,25 @@ inline bool CodeGeneratorRequest::has_compiler_version() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void CodeGeneratorRequest::clear_compiler_version() { - if (compiler_version_ != NULL) compiler_version_->Clear(); + if (compiler_version_ != nullptr) compiler_version_->Clear(); _has_bits_[0] &= ~0x00000002u; } inline const ::google::protobuf::compiler::Version& CodeGeneratorRequest::compiler_version() const { const ::google::protobuf::compiler::Version* p = compiler_version_; // @@protoc_insertion_point(field_get:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::compiler::_Version_default_instance_); } inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::release_compiler_version() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorRequest.compiler_version) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::compiler::Version* temp = compiler_version_; - compiler_version_ = NULL; + compiler_version_ = nullptr; return temp; } inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::mutable_compiler_version() { _has_bits_[0] |= 0x00000002u; - if (compiler_version_ == NULL) { + if (compiler_version_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::compiler::Version>(GetArenaNoVirtual()); compiler_version_ = p; } @@ -1027,11 +1027,11 @@ inline ::google::protobuf::compiler::Version* CodeGeneratorRequest::mutable_comp } inline void CodeGeneratorRequest::set_allocated_compiler_version(::google::protobuf::compiler::Version* compiler_version) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete compiler_version_; } if (compiler_version) { - ::google::protobuf::Arena* submessage_arena = NULL; + ::google::protobuf::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { compiler_version = ::google::protobuf::internal::GetOwnedMessage( message_arena, compiler_version, submessage_arena); @@ -1074,7 +1074,7 @@ inline void CodeGeneratorResponse_File::set_name(::std::string&& value) { } #endif inline void CodeGeneratorResponse_File::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.name) @@ -1093,13 +1093,13 @@ inline ::std::string* CodeGeneratorResponse_File::mutable_name() { inline ::std::string* CodeGeneratorResponse_File::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void CodeGeneratorResponse_File::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -1134,7 +1134,7 @@ inline void CodeGeneratorResponse_File::set_insertion_point(::std::string&& valu } #endif inline void CodeGeneratorResponse_File::set_insertion_point(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; insertion_point_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) @@ -1153,13 +1153,13 @@ inline ::std::string* CodeGeneratorResponse_File::mutable_insertion_point() { inline ::std::string* CodeGeneratorResponse_File::release_insertion_point() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.insertion_point) if (!has_insertion_point()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return insertion_point_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void CodeGeneratorResponse_File::set_allocated_insertion_point(::std::string* insertion_point) { - if (insertion_point != NULL) { + if (insertion_point != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -1194,7 +1194,7 @@ inline void CodeGeneratorResponse_File::set_content(::std::string&& value) { } #endif inline void CodeGeneratorResponse_File::set_content(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000004u; content_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.File.content) @@ -1213,13 +1213,13 @@ inline ::std::string* CodeGeneratorResponse_File::mutable_content() { inline ::std::string* CodeGeneratorResponse_File::release_content() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.File.content) if (!has_content()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000004u; return content_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void CodeGeneratorResponse_File::set_allocated_content(::std::string* content) { - if (content != NULL) { + if (content != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -1258,7 +1258,7 @@ inline void CodeGeneratorResponse::set_error(::std::string&& value) { } #endif inline void CodeGeneratorResponse::set_error(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; error_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.compiler.CodeGeneratorResponse.error) @@ -1277,13 +1277,13 @@ inline ::std::string* CodeGeneratorResponse::mutable_error() { inline ::std::string* CodeGeneratorResponse::release_error() { // @@protoc_insertion_point(field_release:google.protobuf.compiler.CodeGeneratorResponse.error) if (!has_error()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return error_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void CodeGeneratorResponse::set_allocated_error(::std::string* error) { - if (error != NULL) { + if (error != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index a15884e1b1..d4552676e1 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1403,7 +1403,7 @@ const int FileDescriptorSet::kFileFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FileDescriptorSet::FileDescriptorSet() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorSet) } @@ -1417,7 +1417,7 @@ FileDescriptorSet::FileDescriptorSet(::google::protobuf::Arena* arena) } FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), file_(from.file_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -1435,7 +1435,7 @@ FileDescriptorSet::~FileDescriptorSet() { } void FileDescriptorSet::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void FileDescriptorSet::ArenaDtor(void* object) { @@ -1641,7 +1641,7 @@ void FileDescriptorSet::MergeFrom(const ::google::protobuf::Message& from) { const FileDescriptorSet* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorSet) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1688,7 +1688,7 @@ void FileDescriptorSet::Swap(FileDescriptorSet* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -1750,7 +1750,7 @@ FileDescriptorProto::HasBitSetters::source_code_info(const FileDescriptorProto* } void FileDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::FileOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -1763,7 +1763,7 @@ void FileDescriptorProto::unsafe_arena_set_allocated_options( } void FileDescriptorProto::unsafe_arena_set_allocated_source_code_info( ::google::protobuf::SourceCodeInfo* source_code_info) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete source_code_info_; } source_code_info_ = source_code_info; @@ -1790,7 +1790,7 @@ const int FileDescriptorProto::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FileDescriptorProto::FileDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorProto) } @@ -1810,7 +1810,7 @@ FileDescriptorProto::FileDescriptorProto(::google::protobuf::Arena* arena) } FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), dependency_(from.dependency_), message_type_(from.message_type_), @@ -1838,12 +1838,12 @@ FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) if (from.has_options()) { options_ = new ::google::protobuf::FileOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } if (from.has_source_code_info()) { source_code_info_ = new ::google::protobuf::SourceCodeInfo(*from.source_code_info_); } else { - source_code_info_ = NULL; + source_code_info_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorProto) } @@ -1865,7 +1865,7 @@ FileDescriptorProto::~FileDescriptorProto() { } void FileDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); syntax_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -1913,11 +1913,11 @@ void FileDescriptorProto::Clear() { syntax_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } if (cached_has_bits & 0x00000010u) { - GOOGLE_DCHECK(source_code_info_ != NULL); + GOOGLE_DCHECK(source_code_info_ != nullptr); source_code_info_->Clear(); } } @@ -2738,7 +2738,7 @@ void FileDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { const FileDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -2815,7 +2815,7 @@ void FileDescriptorProto::Swap(FileDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -2878,7 +2878,7 @@ DescriptorProto_ExtensionRange::HasBitSetters::options(const DescriptorProto_Ext } void DescriptorProto_ExtensionRange::unsafe_arena_set_allocated_options( ::google::protobuf::ExtensionRangeOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -2896,7 +2896,7 @@ const int DescriptorProto_ExtensionRange::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ExtensionRange) } @@ -2909,13 +2909,13 @@ DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(::google::protobu } DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); if (from.has_options()) { options_ = new ::google::protobuf::ExtensionRangeOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } ::memcpy(&start_, &from.start_, static_cast(reinterpret_cast(&end_) - @@ -2937,7 +2937,7 @@ DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() { } void DescriptorProto_ExtensionRange::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); if (this != internal_default_instance()) delete options_; } @@ -2964,7 +2964,7 @@ void DescriptorProto_ExtensionRange::Clear() { cached_has_bits = _has_bits_[0]; if (cached_has_bits & 0x00000001u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } if (cached_has_bits & 0x00000006u) { @@ -3227,7 +3227,7 @@ void DescriptorProto_ExtensionRange::MergeFrom(const ::google::protobuf::Message const DescriptorProto_ExtensionRange* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ExtensionRange) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -3288,7 +3288,7 @@ void DescriptorProto_ExtensionRange::Swap(DescriptorProto_ExtensionRange* other) temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -3333,7 +3333,7 @@ const int DescriptorProto_ReservedRange::kEndFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 DescriptorProto_ReservedRange::DescriptorProto_ReservedRange() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ReservedRange) } @@ -3346,7 +3346,7 @@ DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(::google::protobuf: } DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&start_, &from.start_, @@ -3367,7 +3367,7 @@ DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() { } void DescriptorProto_ReservedRange::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void DescriptorProto_ReservedRange::ArenaDtor(void* object) { @@ -3606,7 +3606,7 @@ void DescriptorProto_ReservedRange::MergeFrom(const ::google::protobuf::Message& const DescriptorProto_ReservedRange* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ReservedRange) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -3661,7 +3661,7 @@ void DescriptorProto_ReservedRange::Swap(DescriptorProto_ReservedRange* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -3708,7 +3708,7 @@ DescriptorProto::HasBitSetters::options(const DescriptorProto* msg) { } void DescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::MessageOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -3733,7 +3733,7 @@ const int DescriptorProto::kReservedNameFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 DescriptorProto::DescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto) } @@ -3754,7 +3754,7 @@ DescriptorProto::DescriptorProto(::google::protobuf::Arena* arena) } DescriptorProto::DescriptorProto(const DescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), field_(from.field_), nested_type_(from.nested_type_), @@ -3773,7 +3773,7 @@ DescriptorProto::DescriptorProto(const DescriptorProto& from) if (from.has_options()) { options_ = new ::google::protobuf::MessageOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto) } @@ -3782,7 +3782,7 @@ void DescriptorProto::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_DescriptorProto_google_2fprotobuf_2fdescriptor_2eproto.base); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - options_ = NULL; + options_ = nullptr; } DescriptorProto::~DescriptorProto() { @@ -3791,7 +3791,7 @@ DescriptorProto::~DescriptorProto() { } void DescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete options_; } @@ -3831,7 +3831,7 @@ void DescriptorProto::Clear() { name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -4537,7 +4537,7 @@ void DescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { const DescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -4608,7 +4608,7 @@ void DescriptorProto::Swap(DescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -4654,7 +4654,7 @@ const int ExtensionRangeOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 ExtensionRangeOptions::ExtensionRangeOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ExtensionRangeOptions) } @@ -4669,7 +4669,7 @@ ExtensionRangeOptions::ExtensionRangeOptions(::google::protobuf::Arena* arena) } ExtensionRangeOptions::ExtensionRangeOptions(const ExtensionRangeOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -4688,7 +4688,7 @@ ExtensionRangeOptions::~ExtensionRangeOptions() { } void ExtensionRangeOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void ExtensionRangeOptions::ArenaDtor(void* object) { @@ -4918,7 +4918,7 @@ void ExtensionRangeOptions::MergeFrom(const ::google::protobuf::Message& from) { const ExtensionRangeOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ExtensionRangeOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -4970,7 +4970,7 @@ void ExtensionRangeOptions::Swap(ExtensionRangeOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -5041,7 +5041,7 @@ FieldDescriptorProto::HasBitSetters::options(const FieldDescriptorProto* msg) { } void FieldDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::FieldOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -5066,7 +5066,7 @@ const int FieldDescriptorProto::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FieldDescriptorProto::FieldDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldDescriptorProto) } @@ -5079,7 +5079,7 @@ FieldDescriptorProto::FieldDescriptorProto(::google::protobuf::Arena* arena) } FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -5110,7 +5110,7 @@ FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) if (from.has_options()) { options_ = new ::google::protobuf::FieldOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } ::memcpy(&number_, &from.number_, static_cast(reinterpret_cast(&type_) - @@ -5139,7 +5139,7 @@ FieldDescriptorProto::~FieldDescriptorProto() { } void FieldDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); extendee_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -5187,7 +5187,7 @@ void FieldDescriptorProto::Clear() { json_name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000020u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -5869,7 +5869,7 @@ void FieldDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { const FieldDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -5954,7 +5954,7 @@ void FieldDescriptorProto::Swap(FieldDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -6014,7 +6014,7 @@ OneofDescriptorProto::HasBitSetters::options(const OneofDescriptorProto* msg) { } void OneofDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::OneofOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -6031,7 +6031,7 @@ const int OneofDescriptorProto::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OneofDescriptorProto::OneofDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.OneofDescriptorProto) } @@ -6044,7 +6044,7 @@ OneofDescriptorProto::OneofDescriptorProto(::google::protobuf::Arena* arena) } OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -6055,7 +6055,7 @@ OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& from) if (from.has_options()) { options_ = new ::google::protobuf::OneofOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofDescriptorProto) } @@ -6064,7 +6064,7 @@ void OneofDescriptorProto::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_OneofDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto.base); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - options_ = NULL; + options_ = nullptr; } OneofDescriptorProto::~OneofDescriptorProto() { @@ -6073,7 +6073,7 @@ OneofDescriptorProto::~OneofDescriptorProto() { } void OneofDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete options_; } @@ -6105,7 +6105,7 @@ void OneofDescriptorProto::Clear() { name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -6346,7 +6346,7 @@ void OneofDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { const OneofDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -6403,7 +6403,7 @@ void OneofDescriptorProto::Swap(OneofDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -6448,7 +6448,7 @@ const int EnumDescriptorProto_EnumReservedRange::kEndFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto.EnumReservedRange) } @@ -6461,7 +6461,7 @@ EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(::g } EnumDescriptorProto_EnumReservedRange::EnumDescriptorProto_EnumReservedRange(const EnumDescriptorProto_EnumReservedRange& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&start_, &from.start_, @@ -6482,7 +6482,7 @@ EnumDescriptorProto_EnumReservedRange::~EnumDescriptorProto_EnumReservedRange() } void EnumDescriptorProto_EnumReservedRange::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void EnumDescriptorProto_EnumReservedRange::ArenaDtor(void* object) { @@ -6721,7 +6721,7 @@ void EnumDescriptorProto_EnumReservedRange::MergeFrom(const ::google::protobuf:: const EnumDescriptorProto_EnumReservedRange* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumDescriptorProto.EnumReservedRange) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -6776,7 +6776,7 @@ void EnumDescriptorProto_EnumReservedRange::Swap(EnumDescriptorProto_EnumReserve temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -6823,7 +6823,7 @@ EnumDescriptorProto::HasBitSetters::options(const EnumDescriptorProto* msg) { } void EnumDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::EnumOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -6843,7 +6843,7 @@ const int EnumDescriptorProto::kReservedNameFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumDescriptorProto::EnumDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto) } @@ -6859,7 +6859,7 @@ EnumDescriptorProto::EnumDescriptorProto(::google::protobuf::Arena* arena) } EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), value_(from.value_), reserved_range_(from.reserved_range_), @@ -6873,7 +6873,7 @@ EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) if (from.has_options()) { options_ = new ::google::protobuf::EnumOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumDescriptorProto) } @@ -6882,7 +6882,7 @@ void EnumDescriptorProto::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_EnumDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto.base); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - options_ = NULL; + options_ = nullptr; } EnumDescriptorProto::~EnumDescriptorProto() { @@ -6891,7 +6891,7 @@ EnumDescriptorProto::~EnumDescriptorProto() { } void EnumDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete options_; } @@ -6926,7 +6926,7 @@ void EnumDescriptorProto::Clear() { name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -7347,7 +7347,7 @@ void EnumDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { const EnumDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -7408,7 +7408,7 @@ void EnumDescriptorProto::Swap(EnumDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -7462,7 +7462,7 @@ EnumValueDescriptorProto::HasBitSetters::options(const EnumValueDescriptorProto* } void EnumValueDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::EnumValueOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -7480,7 +7480,7 @@ const int EnumValueDescriptorProto::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumValueDescriptorProto::EnumValueDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValueDescriptorProto) } @@ -7493,7 +7493,7 @@ EnumValueDescriptorProto::EnumValueDescriptorProto(::google::protobuf::Arena* ar } EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -7504,7 +7504,7 @@ EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProt if (from.has_options()) { options_ = new ::google::protobuf::EnumValueOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } number_ = from.number_; // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValueDescriptorProto) @@ -7525,7 +7525,7 @@ EnumValueDescriptorProto::~EnumValueDescriptorProto() { } void EnumValueDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete options_; } @@ -7557,7 +7557,7 @@ void EnumValueDescriptorProto::Clear() { name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -7839,7 +7839,7 @@ void EnumValueDescriptorProto::MergeFrom(const ::google::protobuf::Message& from const EnumValueDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValueDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -7900,7 +7900,7 @@ void EnumValueDescriptorProto::Swap(EnumValueDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -7949,7 +7949,7 @@ ServiceDescriptorProto::HasBitSetters::options(const ServiceDescriptorProto* msg } void ServiceDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::ServiceOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -7967,7 +7967,7 @@ const int ServiceDescriptorProto::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 ServiceDescriptorProto::ServiceDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ServiceDescriptorProto) } @@ -7981,7 +7981,7 @@ ServiceDescriptorProto::ServiceDescriptorProto(::google::protobuf::Arena* arena) } ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), method_(from.method_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -7993,7 +7993,7 @@ ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& fro if (from.has_options()) { options_ = new ::google::protobuf::ServiceOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.ServiceDescriptorProto) } @@ -8002,7 +8002,7 @@ void ServiceDescriptorProto::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_ServiceDescriptorProto_google_2fprotobuf_2fdescriptor_2eproto.base); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - options_ = NULL; + options_ = nullptr; } ServiceDescriptorProto::~ServiceDescriptorProto() { @@ -8011,7 +8011,7 @@ ServiceDescriptorProto::~ServiceDescriptorProto() { } void ServiceDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete options_; } @@ -8044,7 +8044,7 @@ void ServiceDescriptorProto::Clear() { name_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000002u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -8342,7 +8342,7 @@ void ServiceDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) const ServiceDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ServiceDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -8401,7 +8401,7 @@ void ServiceDescriptorProto::Swap(ServiceDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -8462,7 +8462,7 @@ MethodDescriptorProto::HasBitSetters::options(const MethodDescriptorProto* msg) } void MethodDescriptorProto::unsafe_arena_set_allocated_options( ::google::protobuf::MethodOptions* options) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete options_; } options_ = options; @@ -8483,7 +8483,7 @@ const int MethodDescriptorProto::kServerStreamingFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 MethodDescriptorProto::MethodDescriptorProto() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MethodDescriptorProto) } @@ -8496,7 +8496,7 @@ MethodDescriptorProto::MethodDescriptorProto(::google::protobuf::Arena* arena) } MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -8517,7 +8517,7 @@ MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) if (from.has_options()) { options_ = new ::google::protobuf::MethodOptions(*from.options_); } else { - options_ = NULL; + options_ = nullptr; } ::memcpy(&client_streaming_, &from.client_streaming_, static_cast(reinterpret_cast(&server_streaming_) - @@ -8542,7 +8542,7 @@ MethodDescriptorProto::~MethodDescriptorProto() { } void MethodDescriptorProto::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); input_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); output_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -8582,7 +8582,7 @@ void MethodDescriptorProto::Clear() { output_type_.ClearNonDefaultToEmpty(); } if (cached_has_bits & 0x00000008u) { - GOOGLE_DCHECK(options_ != NULL); + GOOGLE_DCHECK(options_ != nullptr); options_->Clear(); } } @@ -9026,7 +9026,7 @@ void MethodDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { const MethodDescriptorProto* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MethodDescriptorProto) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -9096,7 +9096,7 @@ void MethodDescriptorProto::Swap(MethodDescriptorProto* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -9220,7 +9220,7 @@ const int FileOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FileOptions::FileOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FileOptions) } @@ -9235,7 +9235,7 @@ FileOptions::FileOptions(::google::protobuf::Arena* arena) } FileOptions::FileOptions(const FileOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -9321,7 +9321,7 @@ FileOptions::~FileOptions() { } void FileOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); java_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); java_outer_classname_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); go_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -10629,7 +10629,7 @@ void FileOptions::MergeFrom(const ::google::protobuf::Message& from) { const FileOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -10750,7 +10750,7 @@ void FileOptions::Swap(FileOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -10833,7 +10833,7 @@ const int MessageOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 MessageOptions::MessageOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MessageOptions) } @@ -10848,7 +10848,7 @@ MessageOptions::MessageOptions(::google::protobuf::Arena* arena) } MessageOptions::MessageOptions(const MessageOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -10873,7 +10873,7 @@ MessageOptions::~MessageOptions() { } void MessageOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void MessageOptions::ArenaDtor(void* object) { @@ -11263,7 +11263,7 @@ void MessageOptions::MergeFrom(const ::google::protobuf::Message& from) { const MessageOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MessageOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -11331,7 +11331,7 @@ void MessageOptions::Swap(MessageOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -11396,7 +11396,7 @@ const int FieldOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FieldOptions::FieldOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldOptions) } @@ -11411,7 +11411,7 @@ FieldOptions::FieldOptions(::google::protobuf::Arena* arena) } FieldOptions::FieldOptions(const FieldOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -11436,7 +11436,7 @@ FieldOptions::~FieldOptions() { } void FieldOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void FieldOptions::ArenaDtor(void* object) { @@ -11931,7 +11931,7 @@ void FieldOptions::MergeFrom(const ::google::protobuf::Message& from) { const FieldOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -12005,7 +12005,7 @@ void FieldOptions::Swap(FieldOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -12048,7 +12048,7 @@ const int OneofOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 OneofOptions::OneofOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.OneofOptions) } @@ -12063,7 +12063,7 @@ OneofOptions::OneofOptions(::google::protobuf::Arena* arena) } OneofOptions::OneofOptions(const OneofOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -12082,7 +12082,7 @@ OneofOptions::~OneofOptions() { } void OneofOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void OneofOptions::ArenaDtor(void* object) { @@ -12312,7 +12312,7 @@ void OneofOptions::MergeFrom(const ::google::protobuf::Message& from) { const OneofOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -12364,7 +12364,7 @@ void OneofOptions::Swap(OneofOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -12409,7 +12409,7 @@ const int EnumOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumOptions::EnumOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumOptions) } @@ -12424,7 +12424,7 @@ EnumOptions::EnumOptions(::google::protobuf::Arena* arena) } EnumOptions::EnumOptions(const EnumOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -12449,7 +12449,7 @@ EnumOptions::~EnumOptions() { } void EnumOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void EnumOptions::ArenaDtor(void* object) { @@ -12763,7 +12763,7 @@ void EnumOptions::MergeFrom(const ::google::protobuf::Message& from) { const EnumOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -12825,7 +12825,7 @@ void EnumOptions::Swap(EnumOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -12868,7 +12868,7 @@ const int EnumValueOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumValueOptions::EnumValueOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValueOptions) } @@ -12883,7 +12883,7 @@ EnumValueOptions::EnumValueOptions(::google::protobuf::Arena* arena) } EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -12904,7 +12904,7 @@ EnumValueOptions::~EnumValueOptions() { } void EnumValueOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void EnumValueOptions::ArenaDtor(void* object) { @@ -13176,7 +13176,7 @@ void EnumValueOptions::MergeFrom(const ::google::protobuf::Message& from) { const EnumValueOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValueOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -13231,7 +13231,7 @@ void EnumValueOptions::Swap(EnumValueOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -13273,7 +13273,7 @@ const int ServiceOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 ServiceOptions::ServiceOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ServiceOptions) } @@ -13288,7 +13288,7 @@ ServiceOptions::ServiceOptions(::google::protobuf::Arena* arena) } ServiceOptions::ServiceOptions(const ServiceOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -13309,7 +13309,7 @@ ServiceOptions::~ServiceOptions() { } void ServiceOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void ServiceOptions::ArenaDtor(void* object) { @@ -13581,7 +13581,7 @@ void ServiceOptions::MergeFrom(const ::google::protobuf::Message& from) { const ServiceOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ServiceOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -13636,7 +13636,7 @@ void ServiceOptions::Swap(ServiceOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -13682,7 +13682,7 @@ const int MethodOptions::kUninterpretedOptionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 MethodOptions::MethodOptions() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.MethodOptions) } @@ -13697,7 +13697,7 @@ MethodOptions::MethodOptions(::google::protobuf::Arena* arena) } MethodOptions::MethodOptions(const MethodOptions& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), uninterpreted_option_(from.uninterpreted_option_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -13722,7 +13722,7 @@ MethodOptions::~MethodOptions() { } void MethodOptions::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void MethodOptions::ArenaDtor(void* object) { @@ -14052,7 +14052,7 @@ void MethodOptions::MergeFrom(const ::google::protobuf::Message& from) { const MethodOptions* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MethodOptions) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -14114,7 +14114,7 @@ void MethodOptions::Swap(MethodOptions* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -14160,7 +14160,7 @@ const int UninterpretedOption_NamePart::kIsExtensionFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 UninterpretedOption_NamePart::UninterpretedOption_NamePart() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption.NamePart) } @@ -14173,7 +14173,7 @@ UninterpretedOption_NamePart::UninterpretedOption_NamePart(::google::protobuf::A } UninterpretedOption_NamePart::UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_part_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -14198,7 +14198,7 @@ UninterpretedOption_NamePart::~UninterpretedOption_NamePart() { } void UninterpretedOption_NamePart::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_part_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -14472,7 +14472,7 @@ void UninterpretedOption_NamePart::MergeFrom(const ::google::protobuf::Message& const UninterpretedOption_NamePart* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UninterpretedOption.NamePart) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -14528,7 +14528,7 @@ void UninterpretedOption_NamePart::Swap(UninterpretedOption_NamePart* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -14590,7 +14590,7 @@ const int UninterpretedOption::kAggregateValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 UninterpretedOption::UninterpretedOption() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption) } @@ -14604,7 +14604,7 @@ UninterpretedOption::UninterpretedOption(::google::protobuf::Arena* arena) } UninterpretedOption::UninterpretedOption(const UninterpretedOption& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), name_(from.name_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -14646,7 +14646,7 @@ UninterpretedOption::~UninterpretedOption() { } void UninterpretedOption::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); identifier_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); aggregate_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -15167,7 +15167,7 @@ void UninterpretedOption::MergeFrom(const ::google::protobuf::Message& from) { const UninterpretedOption* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UninterpretedOption) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -15236,7 +15236,7 @@ void UninterpretedOption::Swap(UninterpretedOption* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -15291,7 +15291,7 @@ const int SourceCodeInfo_Location::kLeadingDetachedCommentsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 SourceCodeInfo_Location::SourceCodeInfo_Location() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo.Location) } @@ -15307,7 +15307,7 @@ SourceCodeInfo_Location::SourceCodeInfo_Location(::google::protobuf::Arena* aren } SourceCodeInfo_Location::SourceCodeInfo_Location(const SourceCodeInfo_Location& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), path_(from.path_), span_(from.span_), @@ -15339,7 +15339,7 @@ SourceCodeInfo_Location::~SourceCodeInfo_Location() { } void SourceCodeInfo_Location::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); leading_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); trailing_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -15852,7 +15852,7 @@ void SourceCodeInfo_Location::MergeFrom(const ::google::protobuf::Message& from) const SourceCodeInfo_Location* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceCodeInfo.Location) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -15909,7 +15909,7 @@ void SourceCodeInfo_Location::Swap(SourceCodeInfo_Location* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -15951,7 +15951,7 @@ const int SourceCodeInfo::kLocationFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 SourceCodeInfo::SourceCodeInfo() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo) } @@ -15965,7 +15965,7 @@ SourceCodeInfo::SourceCodeInfo(::google::protobuf::Arena* arena) } SourceCodeInfo::SourceCodeInfo(const SourceCodeInfo& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), location_(from.location_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -15983,7 +15983,7 @@ SourceCodeInfo::~SourceCodeInfo() { } void SourceCodeInfo::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void SourceCodeInfo::ArenaDtor(void* object) { @@ -16189,7 +16189,7 @@ void SourceCodeInfo::MergeFrom(const ::google::protobuf::Message& from) { const SourceCodeInfo* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceCodeInfo) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -16235,7 +16235,7 @@ void SourceCodeInfo::Swap(SourceCodeInfo* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -16283,7 +16283,7 @@ const int GeneratedCodeInfo_Annotation::kEndFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo.Annotation) } @@ -16297,7 +16297,7 @@ GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(::google::protobuf::A } GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), path_(from.path_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -16327,7 +16327,7 @@ GeneratedCodeInfo_Annotation::~GeneratedCodeInfo_Annotation() { } void GeneratedCodeInfo_Annotation::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); source_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -16711,7 +16711,7 @@ void GeneratedCodeInfo_Annotation::MergeFrom(const ::google::protobuf::Message& const GeneratedCodeInfo_Annotation* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.GeneratedCodeInfo.Annotation) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -16770,7 +16770,7 @@ void GeneratedCodeInfo_Annotation::Swap(GeneratedCodeInfo_Annotation* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -16810,7 +16810,7 @@ const int GeneratedCodeInfo::kAnnotationFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 GeneratedCodeInfo::GeneratedCodeInfo() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo) } @@ -16824,7 +16824,7 @@ GeneratedCodeInfo::GeneratedCodeInfo(::google::protobuf::Arena* arena) } GeneratedCodeInfo::GeneratedCodeInfo(const GeneratedCodeInfo& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), _has_bits_(from._has_bits_), annotation_(from.annotation_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -16842,7 +16842,7 @@ GeneratedCodeInfo::~GeneratedCodeInfo() { } void GeneratedCodeInfo::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void GeneratedCodeInfo::ArenaDtor(void* object) { @@ -17048,7 +17048,7 @@ void GeneratedCodeInfo::MergeFrom(const ::google::protobuf::Message& from) { const GeneratedCodeInfo* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.GeneratedCodeInfo) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -17094,7 +17094,7 @@ void GeneratedCodeInfo::Swap(GeneratedCodeInfo* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } diff --git a/src/google/protobuf/descriptor.pb.h b/src/google/protobuf/descriptor.pb.h index b9245b29fd..4775db70da 100644 --- a/src/google/protobuf/descriptor.pb.h +++ b/src/google/protobuf/descriptor.pb.h @@ -362,7 +362,7 @@ class PROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message /* // implements Message ---------------------------------------------- inline FileDescriptorSet* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } FileDescriptorSet* New(::google::protobuf::Arena* arena) const final { @@ -502,7 +502,7 @@ class PROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Message / // implements Message ---------------------------------------------- inline FileDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } FileDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -831,7 +831,7 @@ class PROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::protobuf // implements Message ---------------------------------------------- inline DescriptorProto_ExtensionRange* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } DescriptorProto_ExtensionRange* New(::google::protobuf::Arena* arena) const final { @@ -987,7 +987,7 @@ class PROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protobuf: // implements Message ---------------------------------------------- inline DescriptorProto_ReservedRange* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } DescriptorProto_ReservedRange* New(::google::protobuf::Arena* arena) const final { @@ -1130,7 +1130,7 @@ class PROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message /* @@ // implements Message ---------------------------------------------- inline DescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } DescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -1412,7 +1412,7 @@ class PROTOBUF_EXPORT ExtensionRangeOptions : public ::google::protobuf::Message // implements Message ---------------------------------------------- inline ExtensionRangeOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } ExtensionRangeOptions* New(::google::protobuf::Arena* arena) const final { @@ -1555,7 +1555,7 @@ class PROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Message // implements Message ---------------------------------------------- inline FieldDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } FieldDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -1938,7 +1938,7 @@ class PROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Message // implements Message ---------------------------------------------- inline OneofDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } OneofDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -2103,7 +2103,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto_EnumReservedRange : public ::google::p // implements Message ---------------------------------------------- inline EnumDescriptorProto_EnumReservedRange* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } EnumDescriptorProto_EnumReservedRange* New(::google::protobuf::Arena* arena) const final { @@ -2246,7 +2246,7 @@ class PROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Message / // implements Message ---------------------------------------------- inline EnumDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } EnumDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -2462,7 +2462,7 @@ class PROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::Mess // implements Message ---------------------------------------------- inline EnumValueDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } EnumValueDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -2635,7 +2635,7 @@ class PROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Messag // implements Message ---------------------------------------------- inline ServiceDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } ServiceDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -2813,7 +2813,7 @@ class PROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Message // implements Message ---------------------------------------------- inline MethodDescriptorProto* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } MethodDescriptorProto* New(::google::protobuf::Arena* arena) const final { @@ -3044,7 +3044,7 @@ class PROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message /* @@prot // implements Message ---------------------------------------------- inline FileOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } FileOptions* New(::google::protobuf::Arena* arena) const final { @@ -3545,7 +3545,7 @@ class PROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message /* @@p // implements Message ---------------------------------------------- inline MessageOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } MessageOptions* New(::google::protobuf::Arena* arena) const final { @@ -3720,7 +3720,7 @@ class PROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message /* @@pro // implements Message ---------------------------------------------- inline FieldOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } FieldOptions* New(::google::protobuf::Arena* arena) const final { @@ -3967,7 +3967,7 @@ class PROTOBUF_EXPORT OneofOptions : public ::google::protobuf::Message /* @@pro // implements Message ---------------------------------------------- inline OneofOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } OneofOptions* New(::google::protobuf::Arena* arena) const final { @@ -4110,7 +4110,7 @@ class PROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message /* @@prot // implements Message ---------------------------------------------- inline EnumOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } EnumOptions* New(::google::protobuf::Arena* arena) const final { @@ -4269,7 +4269,7 @@ class PROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message /* @ // implements Message ---------------------------------------------- inline EnumValueOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } EnumValueOptions* New(::google::protobuf::Arena* arena) const final { @@ -4420,7 +4420,7 @@ class PROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message /* @@p // implements Message ---------------------------------------------- inline ServiceOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } ServiceOptions* New(::google::protobuf::Arena* arena) const final { @@ -4571,7 +4571,7 @@ class PROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message /* @@pr // implements Message ---------------------------------------------- inline MethodOptions* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } MethodOptions* New(::google::protobuf::Arena* arena) const final { @@ -4758,7 +4758,7 @@ class PROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobuf:: // implements Message ---------------------------------------------- inline UninterpretedOption_NamePart* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } UninterpretedOption_NamePart* New(::google::protobuf::Arena* arena) const final { @@ -4921,7 +4921,7 @@ class PROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Message / // implements Message ---------------------------------------------- inline UninterpretedOption* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } UninterpretedOption* New(::google::protobuf::Arena* arena) const final { @@ -5162,7 +5162,7 @@ class PROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Messa // implements Message ---------------------------------------------- inline SourceCodeInfo_Location* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } SourceCodeInfo_Location* New(::google::protobuf::Arena* arena) const final { @@ -5390,7 +5390,7 @@ class PROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message /* @@p // implements Message ---------------------------------------------- inline SourceCodeInfo* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } SourceCodeInfo* New(::google::protobuf::Arena* arena) const final { @@ -5532,7 +5532,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobuf:: // implements Message ---------------------------------------------- inline GeneratedCodeInfo_Annotation* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } GeneratedCodeInfo_Annotation* New(::google::protobuf::Arena* arena) const final { @@ -5714,7 +5714,7 @@ class PROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message /* // implements Message ---------------------------------------------- inline GeneratedCodeInfo* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } GeneratedCodeInfo* New(::google::protobuf::Arena* arena) const final { @@ -5864,7 +5864,7 @@ inline void FileDescriptorProto::set_name(::std::string&& value) { } #endif inline void FileDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -5885,13 +5885,13 @@ inline ::std::string* FileDescriptorProto::mutable_name() { inline ::std::string* FileDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -5902,15 +5902,15 @@ inline void FileDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* FileDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -5946,7 +5946,7 @@ inline void FileDescriptorProto::set_package(::std::string&& value) { } #endif inline void FileDescriptorProto::set_package(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -5967,13 +5967,13 @@ inline ::std::string* FileDescriptorProto::mutable_package() { inline ::std::string* FileDescriptorProto::release_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package) if (!has_package()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileDescriptorProto::set_allocated_package(::std::string* package) { - if (package != NULL) { + if (package != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -5984,15 +5984,15 @@ inline void FileDescriptorProto::set_allocated_package(::std::string* package) { } inline ::std::string* FileDescriptorProto::unsafe_arena_release_package() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.package) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000002u; return package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileDescriptorProto::unsafe_arena_set_allocated_package( ::std::string* package) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (package != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (package != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -6028,7 +6028,7 @@ inline void FileDescriptorProto::set_dependency(int index, ::std::string&& value } #endif inline void FileDescriptorProto::set_dependency(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); dependency_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) } @@ -6052,7 +6052,7 @@ inline void FileDescriptorProto::add_dependency(::std::string&& value) { } #endif inline void FileDescriptorProto::add_dependency(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); dependency_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) } @@ -6256,35 +6256,35 @@ inline bool FileDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void FileDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000008u; } inline const ::google::protobuf::FileOptions& FileDescriptorProto::options() const { const ::google::protobuf::FileOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_FileOptions_default_instance_); } inline ::google::protobuf::FileOptions* FileDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options) _has_bits_[0] &= ~0x00000008u; ::google::protobuf::FileOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::FileOptions* FileDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.options) _has_bits_[0] &= ~0x00000008u; ::google::protobuf::FileOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000008u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::FileOptions>(GetArenaNoVirtual()); options_ = p; } @@ -6293,7 +6293,7 @@ inline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { } inline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -6316,35 +6316,35 @@ inline bool FileDescriptorProto::has_source_code_info() const { return (_has_bits_[0] & 0x00000010u) != 0; } inline void FileDescriptorProto::clear_source_code_info() { - if (source_code_info_ != NULL) source_code_info_->Clear(); + if (source_code_info_ != nullptr) source_code_info_->Clear(); _has_bits_[0] &= ~0x00000010u; } inline const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_code_info() const { const ::google::protobuf::SourceCodeInfo* p = source_code_info_; // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.source_code_info) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_SourceCodeInfo_default_instance_); } inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::release_source_code_info() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info) _has_bits_[0] &= ~0x00000010u; ::google::protobuf::SourceCodeInfo* temp = source_code_info_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - source_code_info_ = NULL; + source_code_info_ = nullptr; return temp; } inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::unsafe_arena_release_source_code_info() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.source_code_info) _has_bits_[0] &= ~0x00000010u; ::google::protobuf::SourceCodeInfo* temp = source_code_info_; - source_code_info_ = NULL; + source_code_info_ = nullptr; return temp; } inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() { _has_bits_[0] |= 0x00000010u; - if (source_code_info_ == NULL) { + if (source_code_info_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::SourceCodeInfo>(GetArenaNoVirtual()); source_code_info_ = p; } @@ -6353,7 +6353,7 @@ inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_c } inline void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete source_code_info_; } if (source_code_info) { @@ -6397,7 +6397,7 @@ inline void FileDescriptorProto::set_syntax(::std::string&& value) { } #endif inline void FileDescriptorProto::set_syntax(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000004u; syntax_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -6418,13 +6418,13 @@ inline ::std::string* FileDescriptorProto::mutable_syntax() { inline ::std::string* FileDescriptorProto::release_syntax() { // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax) if (!has_syntax()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000004u; return syntax_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { - if (syntax != NULL) { + if (syntax != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -6435,15 +6435,15 @@ inline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { } inline ::std::string* FileDescriptorProto::unsafe_arena_release_syntax() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileDescriptorProto.syntax) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000004u; return syntax_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileDescriptorProto::unsafe_arena_set_allocated_syntax( ::std::string* syntax) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (syntax != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (syntax != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -6498,35 +6498,35 @@ inline bool DescriptorProto_ExtensionRange::has_options() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void DescriptorProto_ExtensionRange::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000001u; } inline const ::google::protobuf::ExtensionRangeOptions& DescriptorProto_ExtensionRange::options() const { const ::google::protobuf::ExtensionRangeOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_ExtensionRangeOptions_default_instance_); } inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.ExtensionRange.options) _has_bits_[0] &= ~0x00000001u; ::google::protobuf::ExtensionRangeOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.ExtensionRange.options) _has_bits_[0] &= ~0x00000001u; ::google::protobuf::ExtensionRangeOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange::mutable_options() { _has_bits_[0] |= 0x00000001u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::ExtensionRangeOptions>(GetArenaNoVirtual()); options_ = p; } @@ -6535,7 +6535,7 @@ inline ::google::protobuf::ExtensionRangeOptions* DescriptorProto_ExtensionRange } inline void DescriptorProto_ExtensionRange::set_allocated_options(::google::protobuf::ExtensionRangeOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -6623,7 +6623,7 @@ inline void DescriptorProto::set_name(::std::string&& value) { } #endif inline void DescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -6644,13 +6644,13 @@ inline ::std::string* DescriptorProto::mutable_name() { inline ::std::string* DescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void DescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -6661,15 +6661,15 @@ inline void DescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* DescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void DescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -6864,35 +6864,35 @@ inline bool DescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void DescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000002u; } inline const ::google::protobuf::MessageOptions& DescriptorProto::options() const { const ::google::protobuf::MessageOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_MessageOptions_default_instance_); } inline ::google::protobuf::MessageOptions* DescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::MessageOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::MessageOptions* DescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.DescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::MessageOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000002u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::MessageOptions>(GetArenaNoVirtual()); options_ = p; } @@ -6901,7 +6901,7 @@ inline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { } inline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -6975,7 +6975,7 @@ inline void DescriptorProto::set_reserved_name(int index, ::std::string&& value) } #endif inline void DescriptorProto::set_reserved_name(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) } @@ -6999,7 +6999,7 @@ inline void DescriptorProto::add_reserved_name(::std::string&& value) { } #endif inline void DescriptorProto::add_reserved_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) } @@ -7082,7 +7082,7 @@ inline void FieldDescriptorProto::set_name(::std::string&& value) { } #endif inline void FieldDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7103,13 +7103,13 @@ inline ::std::string* FieldDescriptorProto::mutable_name() { inline ::std::string* FieldDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -7120,15 +7120,15 @@ inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* FieldDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -7220,7 +7220,7 @@ inline void FieldDescriptorProto::set_type_name(::std::string&& value) { } #endif inline void FieldDescriptorProto::set_type_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000004u; type_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7241,13 +7241,13 @@ inline ::std::string* FieldDescriptorProto::mutable_type_name() { inline ::std::string* FieldDescriptorProto::release_type_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name) if (!has_type_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000004u; return type_name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) { - if (type_name != NULL) { + if (type_name != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -7258,15 +7258,15 @@ inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_na } inline ::std::string* FieldDescriptorProto::unsafe_arena_release_type_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.type_name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000004u; return type_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::unsafe_arena_set_allocated_type_name( ::std::string* type_name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (type_name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (type_name != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -7302,7 +7302,7 @@ inline void FieldDescriptorProto::set_extendee(::std::string&& value) { } #endif inline void FieldDescriptorProto::set_extendee(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; extendee_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7323,13 +7323,13 @@ inline ::std::string* FieldDescriptorProto::mutable_extendee() { inline ::std::string* FieldDescriptorProto::release_extendee() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee) if (!has_extendee()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return extendee_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) { - if (extendee != NULL) { + if (extendee != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -7340,15 +7340,15 @@ inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee } inline ::std::string* FieldDescriptorProto::unsafe_arena_release_extendee() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.extendee) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000002u; return extendee_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::unsafe_arena_set_allocated_extendee( ::std::string* extendee) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (extendee != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (extendee != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -7384,7 +7384,7 @@ inline void FieldDescriptorProto::set_default_value(::std::string&& value) { } #endif inline void FieldDescriptorProto::set_default_value(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000008u; default_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7405,13 +7405,13 @@ inline ::std::string* FieldDescriptorProto::mutable_default_value() { inline ::std::string* FieldDescriptorProto::release_default_value() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value) if (!has_default_value()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000008u; return default_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) { - if (default_value != NULL) { + if (default_value != nullptr) { _has_bits_[0] |= 0x00000008u; } else { _has_bits_[0] &= ~0x00000008u; @@ -7422,15 +7422,15 @@ inline void FieldDescriptorProto::set_allocated_default_value(::std::string* def } inline ::std::string* FieldDescriptorProto::unsafe_arena_release_default_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.default_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000008u; return default_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::unsafe_arena_set_allocated_default_value( ::std::string* default_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (default_value != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (default_value != nullptr) { _has_bits_[0] |= 0x00000008u; } else { _has_bits_[0] &= ~0x00000008u; @@ -7484,7 +7484,7 @@ inline void FieldDescriptorProto::set_json_name(::std::string&& value) { } #endif inline void FieldDescriptorProto::set_json_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000010u; json_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7505,13 +7505,13 @@ inline ::std::string* FieldDescriptorProto::mutable_json_name() { inline ::std::string* FieldDescriptorProto::release_json_name() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name) if (!has_json_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000010u; return json_name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) { - if (json_name != NULL) { + if (json_name != nullptr) { _has_bits_[0] |= 0x00000010u; } else { _has_bits_[0] &= ~0x00000010u; @@ -7522,15 +7522,15 @@ inline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_na } inline ::std::string* FieldDescriptorProto::unsafe_arena_release_json_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.json_name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000010u; return json_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FieldDescriptorProto::unsafe_arena_set_allocated_json_name( ::std::string* json_name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (json_name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (json_name != nullptr) { _has_bits_[0] |= 0x00000010u; } else { _has_bits_[0] &= ~0x00000010u; @@ -7545,35 +7545,35 @@ inline bool FieldDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000020u) != 0; } inline void FieldDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000020u; } inline const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() const { const ::google::protobuf::FieldOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_FieldOptions_default_instance_); } inline ::google::protobuf::FieldOptions* FieldDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options) _has_bits_[0] &= ~0x00000020u; ::google::protobuf::FieldOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::FieldOptions* FieldDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FieldDescriptorProto.options) _has_bits_[0] &= ~0x00000020u; ::google::protobuf::FieldOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000020u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::FieldOptions>(GetArenaNoVirtual()); options_ = p; } @@ -7582,7 +7582,7 @@ inline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() } inline void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -7630,7 +7630,7 @@ inline void OneofDescriptorProto::set_name(::std::string&& value) { } #endif inline void OneofDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7651,13 +7651,13 @@ inline ::std::string* OneofDescriptorProto::mutable_name() { inline ::std::string* OneofDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void OneofDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -7668,15 +7668,15 @@ inline void OneofDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* OneofDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void OneofDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -7691,35 +7691,35 @@ inline bool OneofDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void OneofDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000002u; } inline const ::google::protobuf::OneofOptions& OneofDescriptorProto::options() const { const ::google::protobuf::OneofOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_OneofOptions_default_instance_); } inline ::google::protobuf::OneofOptions* OneofDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::OneofOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::OneofOptions* OneofDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.OneofDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::OneofOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000002u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::OneofOptions>(GetArenaNoVirtual()); options_ = p; } @@ -7728,7 +7728,7 @@ inline ::google::protobuf::OneofOptions* OneofDescriptorProto::mutable_options() } inline void OneofDescriptorProto::set_allocated_options(::google::protobuf::OneofOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -7816,7 +7816,7 @@ inline void EnumDescriptorProto::set_name(::std::string&& value) { } #endif inline void EnumDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -7837,13 +7837,13 @@ inline ::std::string* EnumDescriptorProto::mutable_name() { inline ::std::string* EnumDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -7854,15 +7854,15 @@ inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* EnumDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void EnumDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -7907,35 +7907,35 @@ inline bool EnumDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void EnumDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000002u; } inline const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() const { const ::google::protobuf::EnumOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_EnumOptions_default_instance_); } inline ::google::protobuf::EnumOptions* EnumDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::EnumOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::EnumOptions* EnumDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::EnumOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000002u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::EnumOptions>(GetArenaNoVirtual()); options_ = p; } @@ -7944,7 +7944,7 @@ inline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { } inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -8018,7 +8018,7 @@ inline void EnumDescriptorProto::set_reserved_name(int index, ::std::string&& va } #endif inline void EnumDescriptorProto::set_reserved_name(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); reserved_name_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.reserved_name) } @@ -8042,7 +8042,7 @@ inline void EnumDescriptorProto::add_reserved_name(::std::string&& value) { } #endif inline void EnumDescriptorProto::add_reserved_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); reserved_name_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.EnumDescriptorProto.reserved_name) } @@ -8091,7 +8091,7 @@ inline void EnumValueDescriptorProto::set_name(::std::string&& value) { } #endif inline void EnumValueDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8112,13 +8112,13 @@ inline ::std::string* EnumValueDescriptorProto::mutable_name() { inline ::std::string* EnumValueDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8129,15 +8129,15 @@ inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* EnumValueDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void EnumValueDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8170,35 +8170,35 @@ inline bool EnumValueDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void EnumValueDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000002u; } inline const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::options() const { const ::google::protobuf::EnumValueOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_EnumValueOptions_default_instance_); } inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::EnumValueOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.EnumValueDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::EnumValueOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000002u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::EnumValueOptions>(GetArenaNoVirtual()); options_ = p; } @@ -8207,7 +8207,7 @@ inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_o } inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -8255,7 +8255,7 @@ inline void ServiceDescriptorProto::set_name(::std::string&& value) { } #endif inline void ServiceDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8276,13 +8276,13 @@ inline ::std::string* ServiceDescriptorProto::mutable_name() { inline ::std::string* ServiceDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8293,15 +8293,15 @@ inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* ServiceDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ServiceDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8346,35 +8346,35 @@ inline bool ServiceDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void ServiceDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000002u; } inline const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options() const { const ::google::protobuf::ServiceOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_ServiceOptions_default_instance_); } inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::ServiceOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.ServiceDescriptorProto.options) _has_bits_[0] &= ~0x00000002u; ::google::protobuf::ServiceOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000002u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::ServiceOptions>(GetArenaNoVirtual()); options_ = p; } @@ -8383,7 +8383,7 @@ inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_optio } inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -8431,7 +8431,7 @@ inline void MethodDescriptorProto::set_name(::std::string&& value) { } #endif inline void MethodDescriptorProto::set_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8452,13 +8452,13 @@ inline ::std::string* MethodDescriptorProto::mutable_name() { inline ::std::string* MethodDescriptorProto::release_name() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name) if (!has_name()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { - if (name != NULL) { + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8469,15 +8469,15 @@ inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { } inline ::std::string* MethodDescriptorProto::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.name) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void MethodDescriptorProto::unsafe_arena_set_allocated_name( ::std::string* name) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8513,7 +8513,7 @@ inline void MethodDescriptorProto::set_input_type(::std::string&& value) { } #endif inline void MethodDescriptorProto::set_input_type(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; input_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8534,13 +8534,13 @@ inline ::std::string* MethodDescriptorProto::mutable_input_type() { inline ::std::string* MethodDescriptorProto::release_input_type() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type) if (!has_input_type()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return input_type_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) { - if (input_type != NULL) { + if (input_type != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -8551,15 +8551,15 @@ inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input } inline ::std::string* MethodDescriptorProto::unsafe_arena_release_input_type() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.input_type) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000002u; return input_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void MethodDescriptorProto::unsafe_arena_set_allocated_input_type( ::std::string* input_type) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (input_type != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (input_type != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -8595,7 +8595,7 @@ inline void MethodDescriptorProto::set_output_type(::std::string&& value) { } #endif inline void MethodDescriptorProto::set_output_type(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000004u; output_type_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8616,13 +8616,13 @@ inline ::std::string* MethodDescriptorProto::mutable_output_type() { inline ::std::string* MethodDescriptorProto::release_output_type() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type) if (!has_output_type()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000004u; return output_type_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) { - if (output_type != NULL) { + if (output_type != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -8633,15 +8633,15 @@ inline void MethodDescriptorProto::set_allocated_output_type(::std::string* outp } inline ::std::string* MethodDescriptorProto::unsafe_arena_release_output_type() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.output_type) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000004u; return output_type_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void MethodDescriptorProto::unsafe_arena_set_allocated_output_type( ::std::string* output_type) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (output_type != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (output_type != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -8656,35 +8656,35 @@ inline bool MethodDescriptorProto::has_options() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void MethodDescriptorProto::clear_options() { - if (options_ != NULL) options_->Clear(); + if (options_ != nullptr) options_->Clear(); _has_bits_[0] &= ~0x00000008u; } inline const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() const { const ::google::protobuf::MethodOptions* p = options_; // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.options) - return p != NULL ? *p : *reinterpret_cast( + return p != nullptr ? *p : *reinterpret_cast( &::google::protobuf::_MethodOptions_default_instance_); } inline ::google::protobuf::MethodOptions* MethodDescriptorProto::release_options() { // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options) _has_bits_[0] &= ~0x00000008u; ::google::protobuf::MethodOptions* temp = options_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::MethodOptions* MethodDescriptorProto::unsafe_arena_release_options() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.MethodDescriptorProto.options) _has_bits_[0] &= ~0x00000008u; ::google::protobuf::MethodOptions* temp = options_; - options_ = NULL; + options_ = nullptr; return temp; } inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() { _has_bits_[0] |= 0x00000008u; - if (options_ == NULL) { + if (options_ == nullptr) { auto* p = CreateMaybeMessage<::google::protobuf::MethodOptions>(GetArenaNoVirtual()); options_ = p; } @@ -8693,7 +8693,7 @@ inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options } inline void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); - if (message_arena == NULL) { + if (message_arena == nullptr) { delete options_; } if (options) { @@ -8777,7 +8777,7 @@ inline void FileOptions::set_java_package(::std::string&& value) { } #endif inline void FileOptions::set_java_package(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; java_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8798,13 +8798,13 @@ inline ::std::string* FileOptions::mutable_java_package() { inline ::std::string* FileOptions::release_java_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package) if (!has_java_package()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return java_package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_java_package(::std::string* java_package) { - if (java_package != NULL) { + if (java_package != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8815,15 +8815,15 @@ inline void FileOptions::set_allocated_java_package(::std::string* java_package) } inline ::std::string* FileOptions::unsafe_arena_release_java_package() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_package) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return java_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_java_package( ::std::string* java_package) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (java_package != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (java_package != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -8859,7 +8859,7 @@ inline void FileOptions::set_java_outer_classname(::std::string&& value) { } #endif inline void FileOptions::set_java_outer_classname(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; java_outer_classname_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -8880,13 +8880,13 @@ inline ::std::string* FileOptions::mutable_java_outer_classname() { inline ::std::string* FileOptions::release_java_outer_classname() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname) if (!has_java_outer_classname()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return java_outer_classname_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) { - if (java_outer_classname != NULL) { + if (java_outer_classname != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -8897,15 +8897,15 @@ inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_ } inline ::std::string* FileOptions::unsafe_arena_release_java_outer_classname() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.java_outer_classname) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000002u; return java_outer_classname_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_java_outer_classname( ::std::string* java_outer_classname) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (java_outer_classname != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (java_outer_classname != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -9014,7 +9014,7 @@ inline void FileOptions::set_go_package(::std::string&& value) { } #endif inline void FileOptions::set_go_package(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000004u; go_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9035,13 +9035,13 @@ inline ::std::string* FileOptions::mutable_go_package() { inline ::std::string* FileOptions::release_go_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package) if (!has_go_package()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000004u; return go_package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_go_package(::std::string* go_package) { - if (go_package != NULL) { + if (go_package != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -9052,15 +9052,15 @@ inline void FileOptions::set_allocated_go_package(::std::string* go_package) { } inline ::std::string* FileOptions::unsafe_arena_release_go_package() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.go_package) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000004u; return go_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_go_package( ::std::string* go_package) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (go_package != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (go_package != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -9204,7 +9204,7 @@ inline void FileOptions::set_objc_class_prefix(::std::string&& value) { } #endif inline void FileOptions::set_objc_class_prefix(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000008u; objc_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9225,13 +9225,13 @@ inline ::std::string* FileOptions::mutable_objc_class_prefix() { inline ::std::string* FileOptions::release_objc_class_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix) if (!has_objc_class_prefix()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000008u; return objc_class_prefix_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_class_prefix) { - if (objc_class_prefix != NULL) { + if (objc_class_prefix != nullptr) { _has_bits_[0] |= 0x00000008u; } else { _has_bits_[0] &= ~0x00000008u; @@ -9242,15 +9242,15 @@ inline void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_cla } inline ::std::string* FileOptions::unsafe_arena_release_objc_class_prefix() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.objc_class_prefix) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000008u; return objc_class_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_objc_class_prefix( ::std::string* objc_class_prefix) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (objc_class_prefix != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (objc_class_prefix != nullptr) { _has_bits_[0] |= 0x00000008u; } else { _has_bits_[0] &= ~0x00000008u; @@ -9286,7 +9286,7 @@ inline void FileOptions::set_csharp_namespace(::std::string&& value) { } #endif inline void FileOptions::set_csharp_namespace(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000010u; csharp_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9307,13 +9307,13 @@ inline ::std::string* FileOptions::mutable_csharp_namespace() { inline ::std::string* FileOptions::release_csharp_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace) if (!has_csharp_namespace()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000010u; return csharp_namespace_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) { - if (csharp_namespace != NULL) { + if (csharp_namespace != nullptr) { _has_bits_[0] |= 0x00000010u; } else { _has_bits_[0] &= ~0x00000010u; @@ -9324,15 +9324,15 @@ inline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_na } inline ::std::string* FileOptions::unsafe_arena_release_csharp_namespace() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.csharp_namespace) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000010u; return csharp_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_csharp_namespace( ::std::string* csharp_namespace) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (csharp_namespace != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (csharp_namespace != nullptr) { _has_bits_[0] |= 0x00000010u; } else { _has_bits_[0] &= ~0x00000010u; @@ -9368,7 +9368,7 @@ inline void FileOptions::set_swift_prefix(::std::string&& value) { } #endif inline void FileOptions::set_swift_prefix(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000020u; swift_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9389,13 +9389,13 @@ inline ::std::string* FileOptions::mutable_swift_prefix() { inline ::std::string* FileOptions::release_swift_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.swift_prefix) if (!has_swift_prefix()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000020u; return swift_prefix_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) { - if (swift_prefix != NULL) { + if (swift_prefix != nullptr) { _has_bits_[0] |= 0x00000020u; } else { _has_bits_[0] &= ~0x00000020u; @@ -9406,15 +9406,15 @@ inline void FileOptions::set_allocated_swift_prefix(::std::string* swift_prefix) } inline ::std::string* FileOptions::unsafe_arena_release_swift_prefix() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.swift_prefix) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000020u; return swift_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_swift_prefix( ::std::string* swift_prefix) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (swift_prefix != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (swift_prefix != nullptr) { _has_bits_[0] |= 0x00000020u; } else { _has_bits_[0] &= ~0x00000020u; @@ -9450,7 +9450,7 @@ inline void FileOptions::set_php_class_prefix(::std::string&& value) { } #endif inline void FileOptions::set_php_class_prefix(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000040u; php_class_prefix_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9471,13 +9471,13 @@ inline ::std::string* FileOptions::mutable_php_class_prefix() { inline ::std::string* FileOptions::release_php_class_prefix() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_class_prefix) if (!has_php_class_prefix()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000040u; return php_class_prefix_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_php_class_prefix(::std::string* php_class_prefix) { - if (php_class_prefix != NULL) { + if (php_class_prefix != nullptr) { _has_bits_[0] |= 0x00000040u; } else { _has_bits_[0] &= ~0x00000040u; @@ -9488,15 +9488,15 @@ inline void FileOptions::set_allocated_php_class_prefix(::std::string* php_class } inline ::std::string* FileOptions::unsafe_arena_release_php_class_prefix() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_class_prefix) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000040u; return php_class_prefix_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_php_class_prefix( ::std::string* php_class_prefix) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (php_class_prefix != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (php_class_prefix != nullptr) { _has_bits_[0] |= 0x00000040u; } else { _has_bits_[0] &= ~0x00000040u; @@ -9532,7 +9532,7 @@ inline void FileOptions::set_php_namespace(::std::string&& value) { } #endif inline void FileOptions::set_php_namespace(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000080u; php_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9553,13 +9553,13 @@ inline ::std::string* FileOptions::mutable_php_namespace() { inline ::std::string* FileOptions::release_php_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_namespace) if (!has_php_namespace()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000080u; return php_namespace_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_php_namespace(::std::string* php_namespace) { - if (php_namespace != NULL) { + if (php_namespace != nullptr) { _has_bits_[0] |= 0x00000080u; } else { _has_bits_[0] &= ~0x00000080u; @@ -9570,15 +9570,15 @@ inline void FileOptions::set_allocated_php_namespace(::std::string* php_namespac } inline ::std::string* FileOptions::unsafe_arena_release_php_namespace() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_namespace) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000080u; return php_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_php_namespace( ::std::string* php_namespace) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (php_namespace != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (php_namespace != nullptr) { _has_bits_[0] |= 0x00000080u; } else { _has_bits_[0] &= ~0x00000080u; @@ -9614,7 +9614,7 @@ inline void FileOptions::set_php_metadata_namespace(::std::string&& value) { } #endif inline void FileOptions::set_php_metadata_namespace(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000100u; php_metadata_namespace_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9635,13 +9635,13 @@ inline ::std::string* FileOptions::mutable_php_metadata_namespace() { inline ::std::string* FileOptions::release_php_metadata_namespace() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.php_metadata_namespace) if (!has_php_metadata_namespace()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000100u; return php_metadata_namespace_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_php_metadata_namespace(::std::string* php_metadata_namespace) { - if (php_metadata_namespace != NULL) { + if (php_metadata_namespace != nullptr) { _has_bits_[0] |= 0x00000100u; } else { _has_bits_[0] &= ~0x00000100u; @@ -9652,15 +9652,15 @@ inline void FileOptions::set_allocated_php_metadata_namespace(::std::string* php } inline ::std::string* FileOptions::unsafe_arena_release_php_metadata_namespace() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.php_metadata_namespace) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000100u; return php_metadata_namespace_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_php_metadata_namespace( ::std::string* php_metadata_namespace) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (php_metadata_namespace != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (php_metadata_namespace != nullptr) { _has_bits_[0] |= 0x00000100u; } else { _has_bits_[0] &= ~0x00000100u; @@ -9696,7 +9696,7 @@ inline void FileOptions::set_ruby_package(::std::string&& value) { } #endif inline void FileOptions::set_ruby_package(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000200u; ruby_package_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -9717,13 +9717,13 @@ inline ::std::string* FileOptions::mutable_ruby_package() { inline ::std::string* FileOptions::release_ruby_package() { // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.ruby_package) if (!has_ruby_package()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000200u; return ruby_package_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::set_allocated_ruby_package(::std::string* ruby_package) { - if (ruby_package != NULL) { + if (ruby_package != nullptr) { _has_bits_[0] |= 0x00000200u; } else { _has_bits_[0] &= ~0x00000200u; @@ -9734,15 +9734,15 @@ inline void FileOptions::set_allocated_ruby_package(::std::string* ruby_package) } inline ::std::string* FileOptions::unsafe_arena_release_ruby_package() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.FileOptions.ruby_package) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000200u; return ruby_package_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void FileOptions::unsafe_arena_set_allocated_ruby_package( ::std::string* ruby_package) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (ruby_package != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (ruby_package != nullptr) { _has_bits_[0] |= 0x00000200u; } else { _has_bits_[0] &= ~0x00000200u; @@ -10341,7 +10341,7 @@ inline void UninterpretedOption_NamePart::set_name_part(::std::string&& value) { } #endif inline void UninterpretedOption_NamePart::set_name_part(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_part_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -10362,13 +10362,13 @@ inline ::std::string* UninterpretedOption_NamePart::mutable_name_part() { inline ::std::string* UninterpretedOption_NamePart::release_name_part() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part) if (!has_name_part()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_part_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) { - if (name_part != NULL) { + if (name_part != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -10379,15 +10379,15 @@ inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* } inline ::std::string* UninterpretedOption_NamePart::unsafe_arena_release_name_part() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.NamePart.name_part) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return name_part_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption_NamePart::unsafe_arena_set_allocated_name_part( ::std::string* name_part) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (name_part != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (name_part != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -10475,7 +10475,7 @@ inline void UninterpretedOption::set_identifier_value(::std::string&& value) { } #endif inline void UninterpretedOption::set_identifier_value(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; identifier_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -10496,13 +10496,13 @@ inline ::std::string* UninterpretedOption::mutable_identifier_value() { inline ::std::string* UninterpretedOption::release_identifier_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value) if (!has_identifier_value()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return identifier_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) { - if (identifier_value != NULL) { + if (identifier_value != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -10513,15 +10513,15 @@ inline void UninterpretedOption::set_allocated_identifier_value(::std::string* i } inline ::std::string* UninterpretedOption::unsafe_arena_release_identifier_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.identifier_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return identifier_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption::unsafe_arena_set_allocated_identifier_value( ::std::string* identifier_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (identifier_value != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (identifier_value != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -10611,7 +10611,7 @@ inline void UninterpretedOption::set_string_value(::std::string&& value) { } #endif inline void UninterpretedOption::set_string_value(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; string_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -10632,13 +10632,13 @@ inline ::std::string* UninterpretedOption::mutable_string_value() { inline ::std::string* UninterpretedOption::release_string_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value) if (!has_string_value()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return string_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption::set_allocated_string_value(::std::string* string_value) { - if (string_value != NULL) { + if (string_value != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -10649,15 +10649,15 @@ inline void UninterpretedOption::set_allocated_string_value(::std::string* strin } inline ::std::string* UninterpretedOption::unsafe_arena_release_string_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.string_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000002u; return string_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption::unsafe_arena_set_allocated_string_value( ::std::string* string_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (string_value != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (string_value != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -10693,7 +10693,7 @@ inline void UninterpretedOption::set_aggregate_value(::std::string&& value) { } #endif inline void UninterpretedOption::set_aggregate_value(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000004u; aggregate_value_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -10714,13 +10714,13 @@ inline ::std::string* UninterpretedOption::mutable_aggregate_value() { inline ::std::string* UninterpretedOption::release_aggregate_value() { // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value) if (!has_aggregate_value()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000004u; return aggregate_value_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) { - if (aggregate_value != NULL) { + if (aggregate_value != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -10731,15 +10731,15 @@ inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* ag } inline ::std::string* UninterpretedOption::unsafe_arena_release_aggregate_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.UninterpretedOption.aggregate_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000004u; return aggregate_value_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UninterpretedOption::unsafe_arena_set_allocated_aggregate_value( ::std::string* aggregate_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (aggregate_value != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (aggregate_value != nullptr) { _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; @@ -10839,7 +10839,7 @@ inline void SourceCodeInfo_Location::set_leading_comments(::std::string&& value) } #endif inline void SourceCodeInfo_Location::set_leading_comments(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; leading_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -10860,13 +10860,13 @@ inline ::std::string* SourceCodeInfo_Location::mutable_leading_comments() { inline ::std::string* SourceCodeInfo_Location::release_leading_comments() { // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments) if (!has_leading_comments()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return leading_comments_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) { - if (leading_comments != NULL) { + if (leading_comments != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -10877,15 +10877,15 @@ inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::strin } inline ::std::string* SourceCodeInfo_Location::unsafe_arena_release_leading_comments() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.leading_comments) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return leading_comments_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void SourceCodeInfo_Location::unsafe_arena_set_allocated_leading_comments( ::std::string* leading_comments) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (leading_comments != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (leading_comments != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -10921,7 +10921,7 @@ inline void SourceCodeInfo_Location::set_trailing_comments(::std::string&& value } #endif inline void SourceCodeInfo_Location::set_trailing_comments(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; trailing_comments_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -10942,13 +10942,13 @@ inline ::std::string* SourceCodeInfo_Location::mutable_trailing_comments() { inline ::std::string* SourceCodeInfo_Location::release_trailing_comments() { // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) if (!has_trailing_comments()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000002u; return trailing_comments_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) { - if (trailing_comments != NULL) { + if (trailing_comments != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -10959,15 +10959,15 @@ inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::stri } inline ::std::string* SourceCodeInfo_Location::unsafe_arena_release_trailing_comments() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000002u; return trailing_comments_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void SourceCodeInfo_Location::unsafe_arena_set_allocated_trailing_comments( ::std::string* trailing_comments) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (trailing_comments != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (trailing_comments != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; @@ -11003,7 +11003,7 @@ inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, :: } #endif inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); leading_detached_comments_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } @@ -11027,7 +11027,7 @@ inline void SourceCodeInfo_Location::add_leading_detached_comments(::std::string } #endif inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); leading_detached_comments_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) } @@ -11140,7 +11140,7 @@ inline void GeneratedCodeInfo_Annotation::set_source_file(::std::string&& value) } #endif inline void GeneratedCodeInfo_Annotation::set_source_file(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; source_file_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); @@ -11161,13 +11161,13 @@ inline ::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { inline ::std::string* GeneratedCodeInfo_Annotation::release_source_file() { // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) if (!has_source_file()) { - return NULL; + return nullptr; } _has_bits_[0] &= ~0x00000001u; return source_file_.ReleaseNonDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) { - if (source_file != NULL) { + if (source_file != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; @@ -11178,15 +11178,15 @@ inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::strin } inline ::std::string* GeneratedCodeInfo_Annotation::unsafe_arena_release_source_file() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); _has_bits_[0] &= ~0x00000001u; return source_file_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GeneratedCodeInfo_Annotation::unsafe_arena_set_allocated_source_file( ::std::string* source_file) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); - if (source_file != NULL) { + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); + if (source_file != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc index bc0cb3ef06..53c1a55994 100644 --- a/src/google/protobuf/duration.pb.cc +++ b/src/google/protobuf/duration.pb.cc @@ -109,7 +109,7 @@ const int Duration::kNanosFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Duration::Duration() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Duration) } @@ -122,7 +122,7 @@ Duration::Duration(::google::protobuf::Arena* arena) } Duration::Duration(const Duration& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&seconds_, &from.seconds_, static_cast(reinterpret_cast(&nanos_) - @@ -142,7 +142,7 @@ Duration::~Duration() { } void Duration::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void Duration::ArenaDtor(void* object) { @@ -372,7 +372,7 @@ void Duration::MergeFrom(const ::google::protobuf::Message& from) { const Duration* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Duration) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -423,7 +423,7 @@ void Duration::Swap(Duration* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } diff --git a/src/google/protobuf/duration.pb.h b/src/google/protobuf/duration.pb.h index 25c55e8df2..7735f2c69f 100644 --- a/src/google/protobuf/duration.pb.h +++ b/src/google/protobuf/duration.pb.h @@ -115,7 +115,7 @@ class PROTOBUF_EXPORT Duration : public ::google::protobuf::Message /* @@protoc_ // implements Message ---------------------------------------------- inline Duration* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Duration* New(::google::protobuf::Arena* arena) const final { diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc index 724607cf21..1dd90474b0 100644 --- a/src/google/protobuf/empty.pb.cc +++ b/src/google/protobuf/empty.pb.cc @@ -104,7 +104,7 @@ class Empty::HasBitSetters { #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Empty::Empty() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Empty) } @@ -117,7 +117,7 @@ Empty::Empty(::google::protobuf::Arena* arena) } Empty::Empty(const Empty& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:google.protobuf.Empty) } @@ -131,7 +131,7 @@ Empty::~Empty() { } void Empty::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void Empty::ArenaDtor(void* object) { @@ -273,7 +273,7 @@ void Empty::MergeFrom(const ::google::protobuf::Message& from) { const Empty* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Empty) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -318,7 +318,7 @@ void Empty::Swap(Empty* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } diff --git a/src/google/protobuf/empty.pb.h b/src/google/protobuf/empty.pb.h index 4a40eca506..0a717a60bb 100644 --- a/src/google/protobuf/empty.pb.h +++ b/src/google/protobuf/empty.pb.h @@ -115,7 +115,7 @@ class PROTOBUF_EXPORT Empty : public ::google::protobuf::Message /* @@protoc_ins // implements Message ---------------------------------------------- inline Empty* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Empty* New(::google::protobuf::Arena* arena) const final { diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index af51c07e2c..f58a99e89d 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -107,7 +107,7 @@ const int FieldMask::kPathsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 FieldMask::FieldMask() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.FieldMask) } @@ -121,7 +121,7 @@ FieldMask::FieldMask(::google::protobuf::Arena* arena) } FieldMask::FieldMask(const FieldMask& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), paths_(from.paths_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldMask) @@ -138,7 +138,7 @@ FieldMask::~FieldMask() { } void FieldMask::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void FieldMask::ArenaDtor(void* object) { @@ -352,7 +352,7 @@ void FieldMask::MergeFrom(const ::google::protobuf::Message& from) { const FieldMask* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldMask) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -398,7 +398,7 @@ void FieldMask::Swap(FieldMask* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } diff --git a/src/google/protobuf/field_mask.pb.h b/src/google/protobuf/field_mask.pb.h index 14a62d4303..10155215fc 100644 --- a/src/google/protobuf/field_mask.pb.h +++ b/src/google/protobuf/field_mask.pb.h @@ -115,7 +115,7 @@ class PROTOBUF_EXPORT FieldMask : public ::google::protobuf::Message /* @@protoc // implements Message ---------------------------------------------- inline FieldMask* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } FieldMask* New(::google::protobuf::Arena* arena) const final { @@ -238,7 +238,7 @@ inline void FieldMask::set_paths(int index, ::std::string&& value) { } #endif inline void FieldMask::set_paths(int index, const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); paths_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:google.protobuf.FieldMask.paths) } @@ -262,7 +262,7 @@ inline void FieldMask::add_paths(::std::string&& value) { } #endif inline void FieldMask::add_paths(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); paths_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:google.protobuf.FieldMask.paths) } diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc index 1ebde35408..5ee61e7fcb 100644 --- a/src/google/protobuf/source_context.pb.cc +++ b/src/google/protobuf/source_context.pb.cc @@ -108,13 +108,13 @@ const int SourceContext::kFileNameFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 SourceContext::SourceContext() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.SourceContext) } SourceContext::SourceContext(const SourceContext& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); file_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.file_name().size() > 0) { @@ -339,7 +339,7 @@ void SourceContext::MergeFrom(const ::google::protobuf::Message& from) { const SourceContext* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceContext) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { diff --git a/src/google/protobuf/source_context.pb.h b/src/google/protobuf/source_context.pb.h index 5c5fe86f32..10c0148e4f 100644 --- a/src/google/protobuf/source_context.pb.h +++ b/src/google/protobuf/source_context.pb.h @@ -108,7 +108,7 @@ class PROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @@pr // implements Message ---------------------------------------------- inline SourceContext* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } SourceContext* New(::google::protobuf::Arena* arena) const final { @@ -142,10 +142,10 @@ class PROTOBUF_EXPORT SourceContext : public ::google::protobuf::Message /* @@pr void InternalSwap(SourceContext* other); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { - return NULL; + return nullptr; } inline void* MaybeArenaPtr() const { - return NULL; + return nullptr; } public: @@ -211,7 +211,7 @@ inline void SourceContext::set_file_name(::std::string&& value) { } #endif inline void SourceContext::set_file_name(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); file_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:google.protobuf.SourceContext.file_name) @@ -233,7 +233,7 @@ inline ::std::string* SourceContext::release_file_name() { return file_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } inline void SourceContext::set_allocated_file_name(::std::string* file_name) { - if (file_name != NULL) { + if (file_name != nullptr) { } else { diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc index 6472923550..464436f9ba 100644 --- a/src/google/protobuf/struct.pb.cc +++ b/src/google/protobuf/struct.pb.cc @@ -237,7 +237,7 @@ const int Struct::kFieldsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Struct::Struct() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Struct) } @@ -251,7 +251,7 @@ Struct::Struct(::google::protobuf::Arena* arena) } Struct::Struct(const Struct& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); fields_.MergeFrom(from.fields_); // @@protoc_insertion_point(copy_constructor:google.protobuf.Struct) @@ -268,7 +268,7 @@ Struct::~Struct() { } void Struct::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void Struct::ArenaDtor(void* object) { @@ -442,7 +442,7 @@ void Struct::SerializeWithCachedSizes( for (size_type i = 0; i < n; i++) { entry.reset(fields_.NewEntryWrapper(items[static_cast(i)]->first, items[static_cast(i)]->second)); ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(1, *entry, output); - if (entry->GetArena() != NULL) { + if (entry->GetArena() != nullptr) { entry.release(); } Utf8Check::Check(&(*items[static_cast(i)])); @@ -454,7 +454,7 @@ void Struct::SerializeWithCachedSizes( it != this->fields().end(); ++it) { entry.reset(fields_.NewEntryWrapper(it->first, it->second)); ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(1, *entry, output); - if (entry->GetArena() != NULL) { + if (entry->GetArena() != nullptr) { entry.release(); } Utf8Check::Check(&(*it)); @@ -507,7 +507,7 @@ void Struct::SerializeWithCachedSizes( for (size_type i = 0; i < n; i++) { entry.reset(fields_.NewEntryWrapper(items[static_cast(i)]->first, items[static_cast(i)]->second)); target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessageNoVirtualToArray(1, *entry, deterministic, target); - if (entry->GetArena() != NULL) { + if (entry->GetArena() != nullptr) { entry.release(); } Utf8Check::Check(&(*items[static_cast(i)])); @@ -519,7 +519,7 @@ void Struct::SerializeWithCachedSizes( it != this->fields().end(); ++it) { entry.reset(fields_.NewEntryWrapper(it->first, it->second)); target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessageNoVirtualToArray(1, *entry, deterministic, target); - if (entry->GetArena() != NULL) { + if (entry->GetArena() != nullptr) { entry.release(); } Utf8Check::Check(&(*it)); @@ -556,14 +556,14 @@ size_t Struct::ByteSizeLong() const { for (::google::protobuf::Map< ::std::string, ::google::protobuf::Value >::const_iterator it = this->fields().begin(); it != this->fields().end(); ++it) { - if (entry.get() != NULL && entry->GetArena() != NULL) { + if (entry.get() != nullptr && entry->GetArena() != nullptr) { entry.release(); } entry.reset(fields_.NewEntryWrapper(it->first, it->second)); total_size += ::google::protobuf::internal::WireFormatLite:: MessageSizeNoVirtual(*entry); } - if (entry.get() != NULL && entry->GetArena() != NULL) { + if (entry.get() != nullptr && entry->GetArena() != nullptr) { entry.release(); } } @@ -579,7 +579,7 @@ void Struct::MergeFrom(const ::google::protobuf::Message& from) { const Struct* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Struct) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -625,7 +625,7 @@ void Struct::Swap(Struct* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -714,7 +714,7 @@ const int Value::kListValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Value::Value() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Value) } @@ -727,7 +727,7 @@ Value::Value(::google::protobuf::Arena* arena) } Value::Value(const Value& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); clear_has_kind(); switch (from.kind_case()) { @@ -774,7 +774,7 @@ Value::~Value() { } void Value::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); if (has_kind()) { clear_kind(); } @@ -816,13 +816,13 @@ void Value::clear_kind() { break; } case kStructValue: { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete kind_.struct_value_; } break; } case kListValue: { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete kind_.list_value_; } break; @@ -1243,7 +1243,7 @@ void Value::MergeFrom(const ::google::protobuf::Message& from) { const Value* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Value) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1317,7 +1317,7 @@ void Value::Swap(Value* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -1353,7 +1353,7 @@ const int ListValue::kValuesFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 ListValue::ListValue() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.ListValue) } @@ -1367,7 +1367,7 @@ ListValue::ListValue(::google::protobuf::Arena* arena) } ListValue::ListValue(const ListValue& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), values_(from.values_) { _internal_metadata_.MergeFrom(from._internal_metadata_); // @@protoc_insertion_point(copy_constructor:google.protobuf.ListValue) @@ -1384,7 +1384,7 @@ ListValue::~ListValue() { } void ListValue::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void ListValue::ArenaDtor(void* object) { @@ -1589,7 +1589,7 @@ void ListValue::MergeFrom(const ::google::protobuf::Message& from) { const ListValue* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ListValue) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1635,7 +1635,7 @@ void ListValue::Swap(ListValue* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } diff --git a/src/google/protobuf/struct.pb.h b/src/google/protobuf/struct.pb.h index 3aa798a41f..857d67d2fd 100644 --- a/src/google/protobuf/struct.pb.h +++ b/src/google/protobuf/struct.pb.h @@ -175,7 +175,7 @@ class PROTOBUF_EXPORT Struct : public ::google::protobuf::Message /* @@protoc_in // implements Message ---------------------------------------------- inline Struct* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Struct* New(::google::protobuf::Arena* arena) const final { @@ -320,7 +320,7 @@ class PROTOBUF_EXPORT Value : public ::google::protobuf::Message /* @@protoc_ins // implements Message ---------------------------------------------- inline Value* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Value* New(::google::protobuf::Arena* arena) const final { @@ -538,7 +538,7 @@ class PROTOBUF_EXPORT ListValue : public ::google::protobuf::Message /* @@protoc // implements Message ---------------------------------------------- inline ListValue* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } ListValue* New(::google::protobuf::Arena* arena) const final { @@ -752,7 +752,7 @@ inline void Value::set_string_value(::std::string&& value) { } #endif inline void Value::set_string_value(const char* value) { - GOOGLE_DCHECK(value != NULL); + GOOGLE_DCHECK(value != nullptr); if (!has_string_value()) { clear_kind(); set_has_string_value(); @@ -792,14 +792,14 @@ inline ::std::string* Value::release_string_value() { return kind_.string_value_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } else { - return NULL; + return nullptr; } } inline void Value::set_allocated_string_value(::std::string* string_value) { if (has_kind()) { clear_kind(); } - if (string_value != NULL) { + if (string_value != nullptr) { set_has_string_value(); kind_.string_value_.UnsafeSetDefault(string_value); } @@ -807,17 +807,17 @@ inline void Value::set_allocated_string_value(::std::string* string_value) { } inline ::std::string* Value::unsafe_arena_release_string_value() { // @@protoc_insertion_point(field_unsafe_arena_release:google.protobuf.Value.string_value) - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); if (has_string_value()) { clear_has_kind(); return kind_.string_value_.UnsafeArenaRelease( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } else { - return NULL; + return nullptr; } } inline void Value::unsafe_arena_set_allocated_string_value(::std::string* string_value) { - GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() != nullptr); if (!has_string_value()) { kind_.string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -867,7 +867,7 @@ inline void Value::set_has_struct_value() { } inline void Value::clear_struct_value() { if (has_struct_value()) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete kind_.struct_value_; } clear_has_kind(); @@ -878,13 +878,13 @@ inline ::google::protobuf::Struct* Value::release_struct_value() { if (has_struct_value()) { clear_has_kind(); ::google::protobuf::Struct* temp = kind_.struct_value_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - kind_.struct_value_ = NULL; + kind_.struct_value_ = nullptr; return temp; } else { - return NULL; + return nullptr; } } inline const ::google::protobuf::Struct& Value::struct_value() const { @@ -898,10 +898,10 @@ inline ::google::protobuf::Struct* Value::unsafe_arena_release_struct_value() { if (has_struct_value()) { clear_has_kind(); ::google::protobuf::Struct* temp = kind_.struct_value_; - kind_.struct_value_ = NULL; + kind_.struct_value_ = nullptr; return temp; } else { - return NULL; + return nullptr; } } inline void Value::unsafe_arena_set_allocated_struct_value(::google::protobuf::Struct* struct_value) { @@ -932,7 +932,7 @@ inline void Value::set_has_list_value() { } inline void Value::clear_list_value() { if (has_list_value()) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete kind_.list_value_; } clear_has_kind(); @@ -943,13 +943,13 @@ inline ::google::protobuf::ListValue* Value::release_list_value() { if (has_list_value()) { clear_has_kind(); ::google::protobuf::ListValue* temp = kind_.list_value_; - if (GetArenaNoVirtual() != NULL) { + if (GetArenaNoVirtual() != nullptr) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp); } - kind_.list_value_ = NULL; + kind_.list_value_ = nullptr; return temp; } else { - return NULL; + return nullptr; } } inline const ::google::protobuf::ListValue& Value::list_value() const { @@ -963,10 +963,10 @@ inline ::google::protobuf::ListValue* Value::unsafe_arena_release_list_value() { if (has_list_value()) { clear_has_kind(); ::google::protobuf::ListValue* temp = kind_.list_value_; - kind_.list_value_ = NULL; + kind_.list_value_ = nullptr; return temp; } else { - return NULL; + return nullptr; } } inline void Value::unsafe_arena_set_allocated_list_value(::google::protobuf::ListValue* list_value) { diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc index 04684b6083..650c18a48d 100644 --- a/src/google/protobuf/timestamp.pb.cc +++ b/src/google/protobuf/timestamp.pb.cc @@ -109,7 +109,7 @@ const int Timestamp::kNanosFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Timestamp::Timestamp() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Timestamp) } @@ -122,7 +122,7 @@ Timestamp::Timestamp(::google::protobuf::Arena* arena) } Timestamp::Timestamp(const Timestamp& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); ::memcpy(&seconds_, &from.seconds_, static_cast(reinterpret_cast(&nanos_) - @@ -142,7 +142,7 @@ Timestamp::~Timestamp() { } void Timestamp::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); } void Timestamp::ArenaDtor(void* object) { @@ -372,7 +372,7 @@ void Timestamp::MergeFrom(const ::google::protobuf::Message& from) { const Timestamp* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Timestamp) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -423,7 +423,7 @@ void Timestamp::Swap(Timestamp* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } diff --git a/src/google/protobuf/timestamp.pb.h b/src/google/protobuf/timestamp.pb.h index 2335796c61..8f0fba0777 100644 --- a/src/google/protobuf/timestamp.pb.h +++ b/src/google/protobuf/timestamp.pb.h @@ -115,7 +115,7 @@ class PROTOBUF_EXPORT Timestamp : public ::google::protobuf::Message /* @@protoc // implements Message ---------------------------------------------- inline Timestamp* New() const final { - return CreateMaybeMessage(NULL); + return CreateMaybeMessage(nullptr); } Timestamp* New(::google::protobuf::Arena* arena) const final { diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 01b86a56c7..a84e34cacd 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -384,7 +384,7 @@ Type::HasBitSetters::source_context(const Type* msg) { } void Type::unsafe_arena_set_allocated_source_context( ::google::protobuf::SourceContext* source_context) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete source_context_; } source_context_ = source_context; @@ -396,10 +396,10 @@ void Type::unsafe_arena_set_allocated_source_context( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Type.source_context) } void Type::clear_source_context() { - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) { delete source_context_; } - source_context_ = NULL; + source_context_ = nullptr; } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Type::kNameFieldNumber; @@ -411,7 +411,7 @@ const int Type::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Type::Type() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Type) } @@ -427,7 +427,7 @@ Type::Type(::google::protobuf::Arena* arena) } Type::Type(const Type& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), fields_(from.fields_), oneofs_(from.oneofs_), options_(from.options_) { @@ -440,7 +440,7 @@ Type::Type(const Type& from) if (from.has_source_context()) { source_context_ = new ::google::protobuf::SourceContext(*from.source_context_); } else { - source_context_ = NULL; + source_context_ = nullptr; } syntax_ = from.syntax_; // @@protoc_insertion_point(copy_constructor:google.protobuf.Type) @@ -461,7 +461,7 @@ Type::~Type() { } void Type::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete source_context_; } @@ -491,10 +491,10 @@ void Type::Clear() { oneofs_.Clear(); options_.Clear(); name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) { delete source_context_; } - source_context_ = NULL; + source_context_ = nullptr; syntax_ = 0; _internal_metadata_.Clear(); } @@ -949,7 +949,7 @@ void Type::MergeFrom(const ::google::protobuf::Message& from) { const Type* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Type) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1006,7 +1006,7 @@ void Type::Swap(Type* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -1056,7 +1056,7 @@ const int Field::kDefaultValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Field::Field() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Field) } @@ -1070,7 +1070,7 @@ Field::Field(::google::protobuf::Arena* arena) } Field::Field(const Field& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -1117,7 +1117,7 @@ Field::~Field() { } void Field::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); type_url_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); json_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -1783,7 +1783,7 @@ void Field::MergeFrom(const ::google::protobuf::Message& from) { const Field* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Field) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -1856,7 +1856,7 @@ void Field::Swap(Field* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -1908,7 +1908,7 @@ Enum::HasBitSetters::source_context(const Enum* msg) { } void Enum::unsafe_arena_set_allocated_source_context( ::google::protobuf::SourceContext* source_context) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete source_context_; } source_context_ = source_context; @@ -1920,10 +1920,10 @@ void Enum::unsafe_arena_set_allocated_source_context( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Enum.source_context) } void Enum::clear_source_context() { - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) { delete source_context_; } - source_context_ = NULL; + source_context_ = nullptr; } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Enum::kNameFieldNumber; @@ -1934,7 +1934,7 @@ const int Enum::kSyntaxFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Enum::Enum() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Enum) } @@ -1949,7 +1949,7 @@ Enum::Enum(::google::protobuf::Arena* arena) } Enum::Enum(const Enum& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), enumvalue_(from.enumvalue_), options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); @@ -1961,7 +1961,7 @@ Enum::Enum(const Enum& from) if (from.has_source_context()) { source_context_ = new ::google::protobuf::SourceContext(*from.source_context_); } else { - source_context_ = NULL; + source_context_ = nullptr; } syntax_ = from.syntax_; // @@protoc_insertion_point(copy_constructor:google.protobuf.Enum) @@ -1982,7 +1982,7 @@ Enum::~Enum() { } void Enum::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete source_context_; } @@ -2011,10 +2011,10 @@ void Enum::Clear() { enumvalue_.Clear(); options_.Clear(); name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - if (GetArenaNoVirtual() == NULL && source_context_ != NULL) { + if (GetArenaNoVirtual() == nullptr && source_context_ != nullptr) { delete source_context_; } - source_context_ = NULL; + source_context_ = nullptr; syntax_ = 0; _internal_metadata_.Clear(); } @@ -2403,7 +2403,7 @@ void Enum::MergeFrom(const ::google::protobuf::Message& from) { const Enum* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.Enum) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -2459,7 +2459,7 @@ void Enum::Swap(Enum* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -2501,7 +2501,7 @@ const int EnumValue::kOptionsFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 EnumValue::EnumValue() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.EnumValue) } @@ -2515,7 +2515,7 @@ EnumValue::EnumValue(::google::protobuf::Arena* arena) } EnumValue::EnumValue(const EnumValue& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL), + _internal_metadata_(nullptr), options_(from.options_) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); @@ -2540,7 +2540,7 @@ EnumValue::~EnumValue() { } void EnumValue::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); } @@ -2850,7 +2850,7 @@ void EnumValue::MergeFrom(const ::google::protobuf::Message& from) { const EnumValue* source = ::google::protobuf::DynamicCastToGenerated( &from); - if (source == NULL) { + if (source == nullptr) { // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValue) ::google::protobuf::internal::ReflectionOps::Merge(from, this); } else { @@ -2902,7 +2902,7 @@ void EnumValue::Swap(EnumValue* other) { temp->MergeFrom(*other); other->CopyFrom(*this); InternalSwap(temp); - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete temp; } } @@ -2944,7 +2944,7 @@ Option::HasBitSetters::value(const Option* msg) { } void Option::unsafe_arena_set_allocated_value( ::google::protobuf::Any* value) { - if (GetArenaNoVirtual() == NULL) { + if (GetArenaNoVirtual() == nullptr) { delete value_; } value_ = value; @@ -2956,10 +2956,10 @@ void Option::unsafe_arena_set_allocated_value( // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.protobuf.Option.value) } void Option::clear_value() { - if (GetArenaNoVirtual() == NULL && value_ != NULL) { + if (GetArenaNoVirtual() == nullptr && value_ != nullptr) { delete value_; } - value_ = NULL; + value_ = nullptr; } #if !defined(_MSC_VER) || _MSC_VER >= 1900 const int Option::kNameFieldNumber; @@ -2967,7 +2967,7 @@ const int Option::kValueFieldNumber; #endif // !defined(_MSC_VER) || _MSC_VER >= 1900 Option::Option() - : ::google::protobuf::Message(), _internal_metadata_(NULL) { + : ::google::protobuf::Message(), _internal_metadata_(nullptr) { SharedCtor(); // @@protoc_insertion_point(constructor:google.protobuf.Option) } @@ -2980,7 +2980,7 @@ Option::Option(::google::protobuf::Arena* arena) } Option::Option(const Option& from) : ::google::protobuf::Message(), - _internal_metadata_(NULL) { + _internal_metadata_(nullptr) { _internal_metadata_.MergeFrom(from._internal_metadata_); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (from.name().size() > 0) { @@ -2990,7 +2990,7 @@ Option::Option(const Option& from) if (from.has_value()) { value_ = new ::google::protobuf::Any(*from.value_); } else { - value_ = NULL; + value_ = nullptr; } // @@protoc_insertion_point(copy_constructor:google.protobuf.Option) } @@ -2999,7 +2999,7 @@ void Option::SharedCtor() { ::google::protobuf::internal::InitSCC( &scc_info_Option_google_2fprotobuf_2ftype_2eproto.base); name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); - value_ = NULL; + value_ = nullptr; } Option::~Option() { @@ -3008,7 +3008,7 @@ Option::~Option() { } void Option::SharedDtor() { - GOOGLE_DCHECK(GetArenaNoVirtual() == NULL); + GOOGLE_DCHECK(GetArenaNoVirtual() == nullptr); name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); if (this != internal_default_instance()) delete value_; } @@ -3035,10 +3035,10 @@ void Option::Clear() { (void) cached_has_bits; name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); - if (GetArenaNoVirtual() == NULL && value_ != NULL) { + if (GetArenaNoVirtual() == nullptr && value_ != nullptr) { delete value_; } - value_ = NULL; + value_ = nullptr; _internal_metadata_.Clear(); } @@ -3270,7 +3270,7 @@ void Option::MergeFrom(const ::google::protobuf::Message& from) { const Option* source = ::google::protobuf::DynamicCastToGenerated