diff --git a/lib/cpplint_1.4.5/.flake8 b/lib/cpplint_1.4.5/.flake8 new file mode 100644 index 00000000000..2b209310748 --- /dev/null +++ b/lib/cpplint_1.4.5/.flake8 @@ -0,0 +1,37 @@ +[flake8] +ignore = + # indentation is not a multiple of four, + E111,E114, + # visually indented line with same indent as next logical line, + E129, + # expected 2 blank lines, found 1 + E302,E305, + # closing bracket does not match indentation of opening bracket's line + E123, + # multiple spaces before operator + E221, + # line break before binary operator + W503, + # line break after binary operator + W504, + # multiple statements on one line + E701, + # continuation line under-indented for hanging indent + E121, + # closing bracket does not match visual indentation + E124, + # continuation line with same indent as next logical line + E125, + # continuation line over-indented for visual indent + E127, + # continuation line under-indented for visual indent + E128, + # unexpected indentation + E116, + # too many blank lines + E303, + # missing whitespace around arithmetic operator + E226, + # test for membership should be 'not in' + E713, +max-line-length=120 diff --git a/lib/cpplint_1.4.5/.gitignore b/lib/cpplint_1.4.5/.gitignore new file mode 100644 index 00000000000..e527734fb02 --- /dev/null +++ b/lib/cpplint_1.4.5/.gitignore @@ -0,0 +1,127 @@ +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +### Python Patch ### +.venv/ + +### Python.VirtualEnv Stack ### +# Virtualenv +# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ +[Bb]in +[Ii]nclude +[Ll]ib +[Ll]ib64 +[Ll]ocal +[Ss]cripts +pyvenv.cfg +pip-selfcheck.json diff --git a/lib/cpplint_1.4.5/.pylintrc b/lib/cpplint_1.4.5/.pylintrc new file mode 100644 index 00000000000..0f7b914c312 --- /dev/null +++ b/lib/cpplint_1.4.5/.pylintrc @@ -0,0 +1,47 @@ +[BASIC] +include-naming-hint=yes +method-rgx=[A-Z_][A-Za-z0-9]{2,49}$ +function-rgx=[A-Z_][A-Za-z0-9]{2,49}$|main|unicode_escape_decode +const-rgx=[a-zA-Z_][A-Za-z0-9_]{2,49}$ +variable-rgx=[a-z_][a-z0-9_]{0,49}$ +argument-rgx=[a-z_][a-z0-9_]{0,49}$ +class-rgx=[A-Z_][a-zA-Z0-9]+$|basestring|unicode|long|xrange + +[MESSAGES CONTROL] +disable= + global-statement, + multiple-statements, + missing-docstring, + no-else-return, + no-self-use, + consider-merging-isinstance, + bad-continuation, + fixme, + bad-option-value, + anomalous-unicode-escape-in-string, + unused-argument, + useless-object-inheritance, + consider-using-dict-comprehension, + consider-using-in, + unnecessary-pass + +[REPORTS] +output-format=colorized +reports=no +score=no + +[FORMAT] +indent-string=' ' +indent-after-paren=4 +max-module-lines=10000 + +[DESIGN] +max-locals=25 +max-line-length=100 +max-attributes=10 +max-branches=30 +max-args=20 +max-statements=75 +max-returns=10 +min-public-methods=0 +max-bool-expr=10 diff --git a/lib/cpplint_1.4.5/.style.yapf b/lib/cpplint_1.4.5/.style.yapf new file mode 100644 index 00000000000..274a4e01fd6 --- /dev/null +++ b/lib/cpplint_1.4.5/.style.yapf @@ -0,0 +1,5 @@ +[style] +based_on_style = chromium +dedent_closing_brackets = True +coalesce_brackets = True +continuation_indent_width = 2 diff --git a/lib/cpplint_1.4.5/.travis.yml b/lib/cpplint_1.4.5/.travis.yml new file mode 100644 index 00000000000..2a7b03b2389 --- /dev/null +++ b/lib/cpplint_1.4.5/.travis.yml @@ -0,0 +1,19 @@ +language: python + +python: + - "3.8" + - "3.7" + - "3.6" + - "3.5" + - "2.7" + - "pypy" + - "pypy3" + +install: + - pip install --upgrade pip + - pip install --upgrade setuptools + - pip install -e .[dev] + - pip install tox-travis + +script: + - tox diff --git a/lib/cpplint_1.4.5/CONTRIBUTING.rst b/lib/cpplint_1.4.5/CONTRIBUTING.rst new file mode 100644 index 00000000000..eea8162b0fc --- /dev/null +++ b/lib/cpplint_1.4.5/CONTRIBUTING.rst @@ -0,0 +1,142 @@ +Contributing guide +================== + +Thanks for your interest in contributing to cpplint. + +Any kinds of contributions are welcome: Bug reports, Documentation, Patches. + +However cpplint is a bit special as a project because it aims to closely follow what Google does in the upstream repository. +That means Google remains the source of all major requirements and functinoality of cpplint, where as this fork adds extensions to cpplint run on more environments and in more companies. +The difference between this cpplint and Google should remain so small that anyone can at a glance see there is no added change that could be regarded as a security vulnerability. + +Here are some tips to make best use of your time: + +1. Feature suggestions should initially be opened at the `upstream repository `_, but feel free to open an issue here to and link to the upstream issue. + +2. Consider the goals and non-goals of this project: + +Goals: + +* Provides cpplint as a PyPI package for multiple python versions +* Add a few features and fixes aimed at usages outside Google + +Non-Goals: + +* Become an independent fork adding major features +* Fix python style issues in cpplint + + +Development +----------- + +For many tasks, it is okay to just develop using a single installed python version. But if you need to test/debug the project in multiple python versions, you need to install those version:: + +1. (Optional) Install multiple python versions + + 1. (Optional) Install [pyenv](https://github.com/pyenv/pyenv-installer) to manage python versions + 2. (Optional) Using pyenv, install the python versions used in testing:: + + pyenv install 2.7.16 + pyenv install 3.6.8 + +It may be okay to run and test python against locally installed libraries, but if you need to have a consistent build, it is recommended to manage your environment using virtualenv: [virtualenv](https://virtualenv.pypa.io/en/latest/ ), [virtualenvwrapper](https://pypi.org/project/virtualenvwrapper/ ): + +1. (Optional) Setup a local virtual environment with all necessary tools and libraries:: + + mkvirtualenv cpplint [-p /usr/bin/python3] + pip install .[dev] + +Alternatively you can locally install patches like this:: + + pip install --user -e .[dev] + +You can setup your local environment for developing patches for cpplint like this: + +.. code-block:: bash + + # run a single test + pytest cpplint_unittest.py -k testExclude + # run all tests + ./setup.py test + ./setup.py lint + ./setup.py style + ./setup.py ci # all the above + ./tox # all of the above in all python environments + +Releasing +--------- + +To release a new version: + +.. code-block:: bash + + # prepare files for release + vi cpplint.py # increment the version + vi changelog.rst # log changes + git commit -m "Releasing x.y.z" + git add cpplint.py changelog.rst + # test-release (on env by mkvirtualenv -p /usr/bin/python3) + pip install --upgrade setuptools wheel twine + python3 setup.py sdist bdist_wheel + twine upload --repository testpypi dist/* + # ... Check website and downloads from https://test.pypi.org/project/cpplint/ + # Actual release + twine upload dist/* + git tag x.y.z + git push + git push --tags + + +Catching up with Upstream +------------------------- + +For maintainers, it is a regular duty to look at what cpplint changes were merged upstream, to include them in this fork. + +Checkout here and upstream google: + +.. code-block:: bash + + git clone git@github.com:cpplint/cpplint.git + cd cpplint + git remote add google https://github.com/google/styleguide + +To incorporate google's changes: + +.. code-block:: bash + + git fetch google gh-pages + git checkout -b updates FETCH_HEAD + git rebase master # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly) + # solve conflicts with files deleted in our fork (this is idempotent and safe to be called. when cpplint.py has conflicts, it will do nothing) + git status | grep 'new file:' | awk '{print $3}' | xargs -r git rm --cached ; git status | grep 'deleted by us' | awk '{print $4}' | xargs -r git rm ; git status --untracked-files=no | grep 'nothing to commit' && git rebase --skip + + git push -u origin updates + # check travis + git push origin --delete updates + + git rebase updates master + git branch -D updates + git push + +Setup fetching of pull requests in .git/config: + +.. code-block:: bash + + [remote "origin"] + url = git@github.com:cpplint/cpplint.git + fetch = +refs/heads/*:refs/remotes/origin/* + # following line should be new, fetches PRs from cpplint + fetch = +refs/pull/*/head:refs/remotes/origin/pr/* + [remote "google"] + url = https://github.com/google/styleguide + fetch = +refs/heads/*:refs/remotes/google/* + # following line should be new, fetches PRs from google/styleguides + fetch = +refs/pull/*/head:refs/remotes/google/pr/* + + +To compare this for with upstream (after git fetch): + +.. code-block:: bash + + git diff google/gh-pages:cpplint/cpplint.py master:cpplint.py + git diff google/gh-pages:cpplint/cpplint_unittest.py master:cpplint_unittest.py diff --git a/lib/cpplint_4.45/README b/lib/cpplint_1.4.5/LICENSE similarity index 67% rename from lib/cpplint_4.45/README rename to lib/cpplint_1.4.5/LICENSE index 4ffb1ebd1d8..1756a599c18 100644 --- a/lib/cpplint_4.45/README +++ b/lib/cpplint_1.4.5/LICENSE @@ -1,21 +1,3 @@ -This is automated checker to make sure a C++ file follows Google's C++ style -guide (http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml). As it -heavily relies on regular expressions, cpplint.py won't catch all violations of -the style guide and will very occasionally report a false positive. There is a -list of things we currently don't handle very well at the top of cpplint.py, -and we welcome patches to improve it. - -The linting tool takes a list of files as input. For full usage instructions, -please see the output of: - - ./cpplint.py --help - -Unit tests are provided in cpplint_unittest.py. This file can safely be ignored -by end users who have downloaded this package and only want to run the lint -tool. - ---- - cpplint.py and its corresponding unit tests are Copyright (C) 2009 Google Inc. Redistribution and use in source and binary forms, with or without diff --git a/lib/cpplint_1.4.5/MANIFEST.in b/lib/cpplint_1.4.5/MANIFEST.in new file mode 100644 index 00000000000..d76f0fd9941 --- /dev/null +++ b/lib/cpplint_1.4.5/MANIFEST.in @@ -0,0 +1,17 @@ +# MANIFEST.in file required to deliver test files with source tar +include *.py +include LICENSE +include test-requirements +include dev-requirements + +# all samples for clitest +graft samples + +global-exclude .tox +global-exclude *~ +global-exclude __pycache__ +global-exclude .coverage +global-exclude *.py[co] +global-exclude *.db +global-exclude .git* +global-exclude *.orig diff --git a/lib/cpplint_1.4.5/README.rst b/lib/cpplint_1.4.5/README.rst new file mode 100644 index 00000000000..77107970341 --- /dev/null +++ b/lib/cpplint_1.4.5/README.rst @@ -0,0 +1,81 @@ +cpplint - static code checker for C++ +===================================== + +.. image:: https://travis-ci.org/cpplint/cpplint.svg?branch=master + :target: https://travis-ci.org/cpplint/cpplint + +.. image:: https://img.shields.io/pypi/v/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +.. image:: https://img.shields.io/pypi/pyversions/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +.. image:: https://img.shields.io/pypi/status/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +.. image:: https://img.shields.io/pypi/l/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +.. image:: https://img.shields.io/pypi/dd/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +.. image:: https://img.shields.io/pypi/dw/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +.. image:: https://img.shields.io/pypi/dm/cpplint.svg + :target: https://pypi.python.org/pypi/cpplint + +Cpplint is a command-line tool to check C/C++ files for style issues following `Google's C++ style guide `_. +Cpplint is developed and maintained by Google Inc. at `google/styleguide `_, also see the `wikipedia entry `_ + +While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts. +Also see discussion here https://github.com/google/styleguide/pull/528. + + +Installation +============ + + +To install cpplint from PyPI, run: + +.. code-block:: bash + + $ pip install cpplint + +Then run it with: + +.. code-block:: bash + + $ cpplint [OPTIONS] files + +For full usage instructions, run: + +.. code-block:: bash + + $ cpplint --help + +Changes +------- + +The modifications in this fork are minor fixes and cosmetic changes: + +* more default extensions +* python 3 compatibility +* customizable file extensions with the --extensions argument +* continuous integration on travis +* support for recursive file discovery via the --recursive argument +* support for excluding files via --exclude +* JUnit XML output format +* Overriding repository root auto-detection via --repository +* Support ``#pragma once`` as an alternative to header include guards + + +Acknowledgements +---------------- + +Thanks to Google Inc. for open-sourcing their in-house tool. +Thanks to maintainers of the fork + +* `tkruse `_ +* `mattyclarkson `_ +* `theandrewdavis `_ diff --git a/lib/cpplint_1.4.5/changelog.rst b/lib/cpplint_1.4.5/changelog.rst new file mode 100644 index 00000000000..6e0830b2ea6 --- /dev/null +++ b/lib/cpplint_1.4.5/changelog.rst @@ -0,0 +1,140 @@ +Changelog +--------- + +1.4.5 +----- + +* Avoid false positive for [build/include_what_you_use] in case of `foo.set` and `foo->set` usage. +* Avoid false positive for [build/include_what_you_use] in case of `map` is user defined function +* Escape backslashes in pydoc strings to get rid of DeprecationWarning. +* Fix false positive "should include its header" for 3rd party headers +* Add support for c++17 tuple destructuring +* fix #123: Inconsistent behavior of --headers and --extensions +* Fix #114: --exclude not working recursively +* fix #112, identifying of copy constructors should allow combinations of volatile and const + +1.4.4 +----- + +Another cleanup release + +* NOBUG: fix unit/cli tests for source release +* NOBUG: reduce diff to upstream by intentionally using deprecated functions where upstream uses them +* add `--version` command (https://github.com/cpplint/cpplint/issues/27) + +1.4.3 +----- + +* Revert "Fix the `build/endif_comment` check", same as reverted in upstream + +1.4.2 +----- + +* Cleanup release, fixes further issues with tests and source distribution + +1.4.1 +----- + +* Cleanup release, only adds test support files to source dist + +1.4.0 +----- + +* Incorporate cpplint updates from google (e5d807c6a0d, 2018-05-03) + * Fix the `build/endif_comment` check (https://github.com/google/styleguide/pull/169) + * Teach the explicit constructor check about constexpr (#56) + * Changed vs7 output format (#57) + * Remove presubmit check for DISALLOW_* macros (#54) + * add `--quiet` flag as in upstream (https://github.com/google/styleguide/pull/293) + * support `--root` argument to run in different folder (https://github.com/google/styleguide/pull/291) + * Fix 16bit Unicode issue (https://github.com/google/styleguide/issues/337) + +1.3.0 +----- + +* Incorporate cpplint updates from google (6d3a7d8a2, 2016-07-14) +* Add --headers flag to choose which extensions are header files. +* Add regression testsing. + +1.2.2 +----- + +* Fixes bug causing RValue detection with namespaces to fail. + +1.2.1 +----- + +* Fixes error in setup.py. + +1.2.0 +----- + +* Adds `.cu` and `.cuh` as supported file extensions by default. +* Moves the warning "Include the directory when naming .h files" from the `build/include` category to the `build/include_subdir` category. + +1.1.0 +----- + +* Adds quiet option to suppress non error-related output. + +1.0.1 +----- + +* Updates PyPi README. + +1.0.0 +----- + +* Fixes a --repository flag bug. + +0.0.9 +----- + +* Adds the --exclude flag to exclude files from being linted. + +0.0.8 +----- + +* Adds the --repository flag to set the location of the project root for header guard calculations. +* Adds support for ``#pragma once`` as an alternative to header include guards. + +0.0.7 +----- + +* Fixes a Windows include guard bug. +* Adds escaping and more detail to JUnit XML output. + +0.0.6 +----- + +* Adds the --recursive flag. +* Adds JUnit XML output. + +0.0.5 +----- + +* Maintenance release, undoes earlier project folder structure changes to remain as true to upstream as possible. + +0.0.4 +----- + +* Merged with upstream revision r141 (2014-12-04) +* This includes many new checks, see commit messages for details +* This also reverts some renaming of files, to stay close to the original project + + +0.0.3 +----- + +* python 3 compatibility + +0.0.2 +----- + +* fixed and extended allowed extensions + +0.0.1 +----- + +* import from googlecode, added setup.py +* imported revision r83 (2012-05-11) diff --git a/lib/cpplint_4.45/cpplint.py b/lib/cpplint_1.4.5/cpplint.py similarity index 83% rename from lib/cpplint_4.45/cpplint.py rename to lib/cpplint_1.4.5/cpplint.py index ccc25d4c56b..ca20b551878 100755 --- a/lib/cpplint_4.45/cpplint.py +++ b/lib/cpplint_1.4.5/cpplint.py @@ -44,23 +44,48 @@ import codecs import copy import getopt +import glob +import itertools import math # for log import os import re import sre_compile import string import sys +import sysconfig import unicodedata +import xml.etree.ElementTree + +# if empty, use defaults +_valid_extensions = set([]) + +__VERSION__ = '1.4.5' + +try: + xrange # Python 2 +except NameError: + # -- pylint: disable=redefined-builtin + xrange = range # Python 3 _USAGE = """ -Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...] +Syntax: cpplint.py [--verbose=#] [--output=emacs|eclipse|vs7|junit] + [--filter=-x,+y,...] [--counting=total|toplevel|detailed] [--root=subdir] - [--linelength=digits] + [--repository=path] + [--linelength=digits] [--headers=x,y,...] + [--recursive] + [--exclude=path] + [--extensions=hpp,cpp,...] + [--quiet] + [--version] [file] ... + Style checker for C/C++ source files. + This is a fork of the Google style checker with minor extensions. + The style guidelines this tries to follow are those in - http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml + https://google.github.io/styleguide/cppguide.html Every problem is given a confidence score from 1-5, with 5 meaning we are certain of the problem, and 1 meaning it could be a legitimate construct. @@ -71,17 +96,25 @@ suppresses errors of all categories on that line. The files passed in will be linted; at least one file must be provided. - Default linted extensions are .cc, .cpp, .cu, .cuh and .h. Change the - extensions with the --extensions flag. + Default linted extensions are %s. + Other file types will be ignored. + Change the extensions with the --extensions flag. Flags: - output=vs7 + output=emacs|eclipse|vs7|junit By default, the output is formatted to ease emacs parsing. Visual Studio - compatible output (vs7) may also be used. Other formats are unsupported. + compatible output (vs7) may also be used. Further support exists for + eclipse (eclipse), and JUnit (junit). XML parsers such as those used + in Jenkins and Bamboo may also be used. Other formats are unsupported. verbose=# Specify a number 0-5 to restrict errors to certain verbosity levels. + Errors with lower verbosity levels have lower confidence and are more + likely to be false positives. + + quiet + Don't print anything if no errors are found. filter=-x,+y,... Specify a comma-separated list of category-filters to apply: only @@ -105,21 +138,46 @@ also be printed. If 'detailed' is provided, then a count is provided for each category like 'build/class'. + repository=path + The top level directory of the repository, used to derive the header + guard CPP variable. By default, this is determined by searching for a + path that contains .git, .hg, or .svn. When this flag is specified, the + given path is used instead. This option allows the header guard CPP + variable to remain consistent even if members of a team have different + repository root directories (such as when checking out a subdirectory + with SVN). In addition, users of non-mainstream version control systems + can use this flag to ensure readable header guard CPP variables. + + Examples: + Assuming that Alice checks out ProjectName and Bob checks out + ProjectName/trunk and trunk contains src/chrome/ui/browser.h, then + with no --repository flag, the header guard CPP variable will be: + + Alice => TRUNK_SRC_CHROME_BROWSER_UI_BROWSER_H_ + Bob => SRC_CHROME_BROWSER_UI_BROWSER_H_ + + If Alice uses the --repository=trunk flag and Bob omits the flag or + uses --repository=. then the header guard CPP variable will be: + + Alice => SRC_CHROME_BROWSER_UI_BROWSER_H_ + Bob => SRC_CHROME_BROWSER_UI_BROWSER_H_ + root=subdir The root directory used for deriving header guard CPP variable. - By default, the header guard CPP variable is calculated as the relative - path to the directory that contains .git, .hg, or .svn. When this flag - is specified, the relative path is calculated from the specified - directory. If the specified directory does not exist, this flag is - ignored. + This directory is relative to the top level directory of the repository + which by default is determined by searching for a directory that contains + .git, .hg, or .svn but can also be controlled with the --repository flag. + If the specified directory does not exist, this flag is ignored. Examples: - Assuming that src/.git exists, the header guard CPP variables for + Assuming that src is the top level directory of the repository (and + cwd=top/src), the header guard CPP variables for src/chrome/browser/ui/browser.h are: No flag => CHROME_BROWSER_UI_BROWSER_H_ --root=chrome => BROWSER_UI_BROWSER_H_ --root=chrome/browser => UI_BROWSER_H_ + --root=.. => SRC_CHROME_BROWSER_UI_BROWSER_H_ linelength=digits This is the allowed line length for the project. The default value is @@ -128,11 +186,38 @@ Examples: --linelength=120 + recursive + Search for files to lint recursively. Each directory given in the list + of files to be linted is replaced by all files that descend from that + directory. Files with extensions not in the valid extensions list are + excluded. + + exclude=path + Exclude the given path from the list of files to be linted. Relative + paths are evaluated relative to the current directory and shell globbing + is performed. This flag can be provided multiple times to exclude + multiple files. + + Examples: + --exclude=one.cc + --exclude=src/*.cc + --exclude=src/*.cc --exclude=test/*.cc + extensions=extension,extension,... The allowed file extensions that cpplint will check Examples: - --extensions=hpp,cpp + --extensions=%s + + headers=x,y,... + The header extensions that cpplint will treat as .h in checks. Values are + automatically added to --extensions list. + (by default, only files with extensions %s will be assumed to be headers) + + Examples: + --headers=%s + --headers=hpp,hxx + --headers=hpp cpplint.py supports per-directory configurations specified in CPPLINT.cfg files. CPPLINT.cfg file can contain a number of key=value pairs. @@ -142,6 +227,8 @@ filter=+filter1,-filter2,... exclude_files=regex linelength=80 + root=subdir + headers=x,y,... "set noparent" option prevents cpplint from traversing directory tree upwards looking for more .cfg files in parent directories. This option @@ -153,16 +240,22 @@ "exclude_files" allows to specify a regular expression to be matched against a file name. If the expression matches, the file is skipped and not run - through liner. + through the linter. "linelength" allows to specify the allowed line length for the project. + The "root" option is similar in function to the --root flag (see example + above). Paths are relative to the directory of the CPPLINT.cfg. + + The "headers" option is similar in function to the --headers flag + (see example above). + CPPLINT.cfg has an effect on files in the same directory and all sub-directories, unless overridden by a nested configuration file. Example file: filter=-build/include_order,+build/include_alpha - exclude_files=.*\.cc + exclude_files=.*\\.cc The above example disables build/include_order warning and enables build/include_alpha as well as excludes all .cc from being @@ -177,15 +270,19 @@ _ERROR_CATEGORIES = [ 'build/class', 'build/c++11', + 'build/c++14', + 'build/c++tr1', 'build/deprecated', 'build/endif_comment', 'build/explicit_make_pair', 'build/forward_decl', 'build/header_guard', 'build/include', + 'build/include_subdir', 'build/include_alpha', 'build/include_order', 'build/include_what_you_use', + 'build/namespaces_literals', 'build/namespaces', 'build/printf_format', 'build/storage_class', @@ -196,7 +293,6 @@ 'readability/check', 'readability/constructors', 'readability/fn_size', - 'readability/function', 'readability/inheritance', 'readability/multiline_comment', 'readability/multiline_string', @@ -227,6 +323,7 @@ 'whitespace/comma', 'whitespace/comments', 'whitespace/empty_conditional_body', + 'whitespace/empty_if_body', 'whitespace/empty_loop_body', 'whitespace/end_of_line', 'whitespace/ending_newline', @@ -245,6 +342,7 @@ # compatibility they may still appear in NOLINT comments. _LEGACY_ERROR_CATEGORIES = [ 'readability/streams', + 'readability/function', ] # The default state of the category filter. This is overridden by the --filter= @@ -253,6 +351,16 @@ # All entries here should start with a '-' or '+', as in the --filter= flag. _DEFAULT_FILTERS = ['-build/include_alpha'] +# The default list of categories suppressed for C (not C++) files. +_DEFAULT_C_SUPPRESSED_CATEGORIES = [ + 'readability/casting', + ] + +# The default list of categories suppressed for Linux Kernel files. +_DEFAULT_KERNEL_SUPPRESSED_CATEGORIES = [ + 'whitespace/tab', + ] + # We used to check for high-bit characters, but after much discussion we # decided those were OK, as long as they were in UTF-8 and didn't represent # hard-coded international strings, which belong in a separate i18n file. @@ -346,6 +454,7 @@ 'random', 'ratio', 'regex', + 'scoped_allocator', 'set', 'sstream', 'stack', @@ -364,6 +473,18 @@ 'utility', 'valarray', 'vector', + # 17.6.1.2 C++14 headers + 'shared_mutex', + # 17.6.1.2 C++17 headers + 'any', + 'charconv', + 'codecvt', + 'execution', + 'filesystem', + 'memory_resource', + 'optional', + 'string_view', + 'variant', # 17.6.1.2 C++ headers for C library facilities 'cassert', 'ccomplex', @@ -393,6 +514,19 @@ 'cwctype', ]) +# Type names +_TYPES = re.compile( + r'^(?:' + # [dcl.type.simple] + r'(char(16_t|32_t)?)|wchar_t|' + r'bool|short|int|long|signed|unsigned|float|double|' + # [support.types] + r'(ptrdiff_t|size_t|max_align_t|nullptr_t)|' + # [cstdint.syn] + r'(u?int(_fast|_least)?(8|16|32|64)_t)|' + r'(u?int(max|ptr)_t)|' + r')$') + # These headers are excluded from [build/include] and [build/include_order] # checks: @@ -402,20 +536,23 @@ _THIRD_PARTY_HEADERS_PATTERN = re.compile( r'^(?:[^/]*[A-Z][^/]*\.h|lua\.h|lauxlib\.h|lualib\.h)$') +# Pattern for matching FileInfo.BaseName() against test file name +_test_suffixes = ['_test', '_regtest', '_unittest'] +_TEST_FILE_SUFFIX = '(' + '|'.join(_test_suffixes) + r')$' + +# Pattern that matches only complete whitespace, possibly across multiple lines. +_EMPTY_CONDITIONAL_BODY_PATTERN = re.compile(r'^\s*$', re.DOTALL) # Assertion macros. These are defined in base/logging.h and -# testing/base/gunit.h. Note that the _M versions need to come first -# for substring matching to work. +# testing/base/public/gunit.h. _CHECK_MACROS = [ 'DCHECK', 'CHECK', - 'EXPECT_TRUE_M', 'EXPECT_TRUE', - 'ASSERT_TRUE_M', 'ASSERT_TRUE', - 'EXPECT_FALSE_M', 'EXPECT_FALSE', - 'ASSERT_FALSE_M', 'ASSERT_FALSE', + 'EXPECT_TRUE', 'ASSERT_TRUE', + 'EXPECT_FALSE', 'ASSERT_FALSE', ] # Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE -_CHECK_REPLACEMENT = dict([(m, {}) for m in _CHECK_MACROS]) +_CHECK_REPLACEMENT = dict([(macro_var, {}) for macro_var in _CHECK_MACROS]) for op, replacement in [('==', 'EQ'), ('!=', 'NE'), ('>=', 'GE'), ('>', 'GT'), @@ -424,16 +561,12 @@ _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % replacement - _CHECK_REPLACEMENT['EXPECT_TRUE_M'][op] = 'EXPECT_%s_M' % replacement - _CHECK_REPLACEMENT['ASSERT_TRUE_M'][op] = 'ASSERT_%s_M' % replacement for op, inv_replacement in [('==', 'NE'), ('!=', 'EQ'), ('>=', 'LT'), ('>', 'LE'), ('<=', 'GT'), ('<', 'GE')]: _CHECK_REPLACEMENT['EXPECT_FALSE'][op] = 'EXPECT_%s' % inv_replacement _CHECK_REPLACEMENT['ASSERT_FALSE'][op] = 'ASSERT_%s' % inv_replacement - _CHECK_REPLACEMENT['EXPECT_FALSE_M'][op] = 'EXPECT_%s_M' % inv_replacement - _CHECK_REPLACEMENT['ASSERT_FALSE_M'][op] = 'ASSERT_%s_M' % inv_replacement # Alternative tokens and their replacements. For full list, see section 2.5 # Alternative tokens [lex.digraph] in the C++ standard. @@ -482,6 +615,12 @@ r'(?:\s+(volatile|__volatile__))?' r'\s*[{(]') +# Match strings that indicate we're working on a C (not C++) file. +_SEARCH_C_FILE = re.compile(r'\b(?:LINT_C_FILE|' + r'vim?:\s*.*(\s*|:)filetype=c(\s*|:|$))') + +# Match string that indicates we're working on a Linux Kernel file. +_SEARCH_KERNEL_FILE = re.compile(r'\b(?:LINT_KERNEL_FILE)') _regexp_compile_cache = {} @@ -492,17 +631,97 @@ # The root directory used for deriving header guard CPP variable. # This is set by --root flag. _root = None +_root_debug = False + +# The top level repository directory. If set, _root is calculated relative to +# this directory instead of the directory containing version control artifacts. +# This is set by the --repository flag. +_repository = None + +# Files to exclude from linting. This is set by the --exclude flag. +_excludes = None + +# Whether to supress PrintInfo messages +_quiet = False # The allowed line length of files. # This is set by --linelength flag. _line_length = 80 +try: + unicode +except NameError: + # -- pylint: disable=redefined-builtin + basestring = unicode = str + +try: + long +except NameError: + # -- pylint: disable=redefined-builtin + long = int + +if sys.version_info < (3,): + # -- pylint: disable=no-member + # BINARY_TYPE = str + itervalues = dict.itervalues + iteritems = dict.iteritems +else: + # BINARY_TYPE = bytes + itervalues = dict.values + iteritems = dict.items + +def unicode_escape_decode(x): + if sys.version_info < (3,): + return codecs.unicode_escape_decode(x)[0] + else: + return x + +# Treat all headers starting with 'h' equally: .h, .hpp, .hxx etc. +# This is set by --headers flag. +_hpp_headers = set([]) + +# {str, bool}: a map from error categories to booleans which indicate if the +# category should be suppressed for every line. +_global_error_suppressions = {} + +def ProcessHppHeadersOption(val): + global _hpp_headers + try: + _hpp_headers = {ext.strip() for ext in val.split(',')} + except ValueError: + PrintUsage('Header extensions must be comma separated list.') + +def IsHeaderExtension(file_extension): + return file_extension in GetHeaderExtensions() + +def GetHeaderExtensions(): + if _hpp_headers: + return _hpp_headers + if _valid_extensions: + return {h for h in _valid_extensions if 'h' in h} + return set(['h', 'hh', 'hpp', 'hxx', 'h++', 'cuh']) + # The allowed extensions for file names -# This is set by --extensions flag. -_valid_extensions = set(['cc', 'h', 'cpp', 'cu', 'cuh']) +# This is set by --extensions flag +def GetAllExtensions(): + return GetHeaderExtensions().union(_valid_extensions or set( + ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu'])) + +def ProcessExtensionsOption(val): + global _valid_extensions + try: + extensions = [ext.strip() for ext in val.split(',')] + _valid_extensions = set(extensions) + except ValueError: + PrintUsage('Extensions should be a comma-separated list of values;' + 'for example: extensions=hpp,cpp\n' + 'This could not be parsed: "%s"' % (val,)) + +def GetNonHeaderExtensions(): + return GetAllExtensions().difference(GetHeaderExtensions()) def ParseNolintSuppressions(filename, raw_line, linenum, error): - """Updates the global list of error-suppressions. + """Updates the global list of line error-suppressions. Parses any NOLINT comments on the current line, updating the global error_suppressions store. Reports an error if the NOLINT comment @@ -533,24 +752,45 @@ def ParseNolintSuppressions(filename, raw_line, linenum, error): 'Unknown NOLINT error category: %s' % category) +def ProcessGlobalSuppresions(lines): + """Updates the list of global error suppressions. + + Parses any lint directives in the file that have global effect. + + Args: + lines: An array of strings, each representing a line of the file, with the + last element being empty if the file is terminated with a newline. + """ + for line in lines: + if _SEARCH_C_FILE.search(line): + for category in _DEFAULT_C_SUPPRESSED_CATEGORIES: + _global_error_suppressions[category] = True + if _SEARCH_KERNEL_FILE.search(line): + for category in _DEFAULT_KERNEL_SUPPRESSED_CATEGORIES: + _global_error_suppressions[category] = True + + def ResetNolintSuppressions(): """Resets the set of NOLINT suppressions to empty.""" _error_suppressions.clear() + _global_error_suppressions.clear() def IsErrorSuppressedByNolint(category, linenum): """Returns true if the specified error category is suppressed on this line. Consults the global error_suppressions map populated by - ParseNolintSuppressions/ResetNolintSuppressions. + ParseNolintSuppressions/ProcessGlobalSuppresions/ResetNolintSuppressions. Args: category: str, the category of the error. linenum: int, the current line number. Returns: - bool, True iff the error should be suppressed due to a NOLINT comment. + bool, True iff the error should be suppressed due to a NOLINT comment or + global suppression. """ - return (linenum in _error_suppressions.get(category, set()) or + return (_global_error_suppressions.get(category, False) or + linenum in _error_suppressions.get(category, set()) or linenum in _error_suppressions.get(None, set())) @@ -589,6 +829,11 @@ def Search(pattern, s): return _regexp_compile_cache[pattern].search(s) +def _IsSourceExtension(s): + """File extension (excluding dot) matches a source file extension.""" + return s in GetNonHeaderExtensions() + + class _IncludeState(object): """Tracks line numbers for includes, and the order in which includes appear. @@ -626,6 +871,8 @@ class _IncludeState(object): def __init__(self): self.include_list = [[]] + self._section = None + self._last_header = None self.ResetSection('') def FindHeader(self, header): @@ -766,16 +1013,30 @@ def __init__(self): self._filters_backup = self.filters[:] self.counting = 'total' # In what way are we counting errors? self.errors_by_category = {} # string to int dict storing error counts + self.quiet = False # Suppress non-error messagess? # output format: # "emacs" - format that emacs can parse (default) + # "eclipse" - format that eclipse can parse # "vs7" - format that Microsoft Visual Studio 7 can parse + # "junit" - format that Jenkins, Bamboo, etc can parse self.output_format = 'emacs' + # For JUnit output, save errors and failures until the end so that they + # can be written into the XML + self._junit_errors = [] + self._junit_failures = [] + def SetOutputFormat(self, output_format): """Sets the output format for errors.""" self.output_format = output_format + def SetQuiet(self, quiet): + """Sets the module's quiet settings, and returns the previous setting.""" + last_quiet = self.quiet + self.quiet = quiet + return last_quiet + def SetVerboseLevel(self, level): """Sets the module's verbosity, and returns the previous setting.""" last_verbose_level = self.verbose_level @@ -840,10 +1101,69 @@ def IncrementErrorCount(self, category): def PrintErrorCounts(self): """Print a summary of errors by category, and the total.""" - for category, count in self.errors_by_category.iteritems(): - sys.stderr.write('Category \'%s\' errors found: %d\n' % + for category, count in sorted(iteritems(self.errors_by_category)): + self.PrintInfo('Category \'%s\' errors found: %d\n' % (category, count)) - sys.stderr.write('Total errors found: %d\n' % self.error_count) + if self.error_count > 0: + self.PrintInfo('Total errors found: %d\n' % self.error_count) + + def PrintInfo(self, message): + if not _quiet and self.output_format != 'junit': + sys.stdout.write(message) + + def PrintError(self, message): + if self.output_format == 'junit': + self._junit_errors.append(message) + else: + sys.stderr.write(message) + + def AddJUnitFailure(self, filename, linenum, message, category, confidence): + self._junit_failures.append((filename, linenum, message, category, + confidence)) + + def FormatJUnitXML(self): + num_errors = len(self._junit_errors) + num_failures = len(self._junit_failures) + + testsuite = xml.etree.ElementTree.Element('testsuite') + testsuite.attrib['errors'] = str(num_errors) + testsuite.attrib['failures'] = str(num_failures) + testsuite.attrib['name'] = 'cpplint' + + if num_errors == 0 and num_failures == 0: + testsuite.attrib['tests'] = str(1) + xml.etree.ElementTree.SubElement(testsuite, 'testcase', name='passed') + + else: + testsuite.attrib['tests'] = str(num_errors + num_failures) + if num_errors > 0: + testcase = xml.etree.ElementTree.SubElement(testsuite, 'testcase') + testcase.attrib['name'] = 'errors' + error = xml.etree.ElementTree.SubElement(testcase, 'error') + error.text = '\n'.join(self._junit_errors) + if num_failures > 0: + # Group failures by file + failed_file_order = [] + failures_by_file = {} + for failure in self._junit_failures: + failed_file = failure[0] + if failed_file not in failed_file_order: + failed_file_order.append(failed_file) + failures_by_file[failed_file] = [] + failures_by_file[failed_file].append(failure) + # Create a testcase for each file + for failed_file in failed_file_order: + failures = failures_by_file[failed_file] + testcase = xml.etree.ElementTree.SubElement(testsuite, 'testcase') + testcase.attrib['name'] = failed_file + failure = xml.etree.ElementTree.SubElement(testcase, 'failure') + template = '{0}: {1} [{2}] [{3}]' + texts = [template.format(f[1], f[2], f[3], f[4]) for f in failures] + failure.text = '\n'.join(texts) + + xml_decl = '\n' + return xml_decl + xml.etree.ElementTree.tostring(testsuite, 'utf-8').decode('utf-8') + _cpplint_state = _CppLintState() @@ -857,6 +1177,14 @@ def _SetOutputFormat(output_format): """Sets the module's output format.""" _cpplint_state.SetOutputFormat(output_format) +def _Quiet(): + """Return's the module's quiet setting.""" + return _cpplint_state.quiet + +def _SetQuiet(quiet): + """Set the module's quiet status, and return previous setting.""" + return _cpplint_state.SetQuiet(quiet) + def _VerboseLevel(): """Returns the module's verbosity setting.""" @@ -944,6 +1272,9 @@ def Check(self, error, filename, linenum): filename: The name of the current file. linenum: The number of the line to check. """ + if not self.in_a_function: + return + if Match(r'T(EST|est)', self.current_function): base_trigger = self._TEST_TRIGGER else: @@ -986,12 +1317,12 @@ def FullName(self): return os.path.abspath(self._filename).replace('\\', '/') def RepositoryName(self): - """FullName after removing the local path to the repository. + r"""FullName after removing the local path to the repository. If we have a real absolute path name here we can try to do something smart: detecting the root of the checkout and truncating /path/to/checkout from the name so that we get header guards that don't include things like - "C:\Documents and Settings\..." or "/home/username/..." in them and thus + "C:\\Documents and Settings\\..." or "/home/username/..." in them and thus people on different computers who have checked the source out to different locations won't see bogus errors. """ @@ -1000,6 +1331,20 @@ def RepositoryName(self): if os.path.exists(fullname): project_dir = os.path.dirname(fullname) + # If the user specified a repository path, it exists, and the file is + # contained in it, use the specified repository path + if _repository: + repo = FileInfo(_repository).FullName() + root_dir = project_dir + while os.path.exists(root_dir): + # allow case insensitive compare on Windows + if os.path.normcase(root_dir) == os.path.normcase(repo): + return os.path.relpath(fullname, root_dir).replace('\\', '/') + one_up_dir = os.path.dirname(root_dir) + if one_up_dir == root_dir: + break + root_dir = one_up_dir + if os.path.exists(os.path.join(project_dir, ".svn")): # If there's a .svn file in the current directory, we recursively look # up the directory tree for the top of the SVN checkout @@ -1014,12 +1359,13 @@ def RepositoryName(self): # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by # searching up from the current path. - root_dir = os.path.dirname(fullname) - while (root_dir != os.path.dirname(root_dir) and - not os.path.exists(os.path.join(root_dir, ".git")) and - not os.path.exists(os.path.join(root_dir, ".hg")) and - not os.path.exists(os.path.join(root_dir, ".svn"))): - root_dir = os.path.dirname(root_dir) + root_dir = current_dir = os.path.dirname(fullname) + while current_dir != os.path.dirname(current_dir): + if (os.path.exists(os.path.join(current_dir, ".git")) or + os.path.exists(os.path.join(current_dir, ".hg")) or + os.path.exists(os.path.join(current_dir, ".svn"))): + root_dir = current_dir + current_dir = os.path.dirname(current_dir) if (os.path.exists(os.path.join(root_dir, ".git")) or os.path.exists(os.path.join(root_dir, ".hg")) or @@ -1049,7 +1395,7 @@ def BaseName(self): return self.Split()[1] def Extension(self): - """File extension - text following the final period.""" + """File extension - text following the final period, includes that period.""" return self.Split()[2] def NoExtension(self): @@ -1058,7 +1404,7 @@ def NoExtension(self): def IsSource(self): """File has a source file extension.""" - return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx') + return _IsSourceExtension(self.Extension()[1:]) def _ShouldPrintError(category, confidence, linenum): @@ -1114,15 +1460,18 @@ def Error(filename, linenum, category, confidence, message): if _ShouldPrintError(category, confidence, linenum): _cpplint_state.IncrementErrorCount(category) if _cpplint_state.output_format == 'vs7': - sys.stderr.write('%s(%s): %s [%s] [%d]\n' % ( - filename, linenum, message, category, confidence)) + _cpplint_state.PrintError('%s(%s): error cpplint: [%s] %s [%d]\n' % ( + filename, linenum, category, message, confidence)) elif _cpplint_state.output_format == 'eclipse': sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % ( filename, linenum, message, category, confidence)) + elif _cpplint_state.output_format == 'junit': + _cpplint_state.AddJUnitFailure(filename, linenum, message, category, + confidence) else: - sys.stderr.write('%s:%s: %s [%s] [%d]\n' % ( - filename, linenum, message, category, confidence)) - + final_message = '%s:%s: %s [%s] [%d]\n' % ( + filename, linenum, message, category, confidence) + sys.stderr.write(final_message) # Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard. _RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile( @@ -1204,8 +1553,18 @@ def CleanseRawStrings(raw_lines): while delimiter is None: # Look for beginning of a raw string. # See 2.14.15 [lex.string] for syntax. - matched = Match(r'^(.*)\b(?:R|u8R|uR|UR|LR)"([^\s\\()]*)\((.*)$', line) - if matched: + # + # Once we have matched a raw string, we check the prefix of the + # line to make sure that the line is not part of a single line + # comment. It's done this way because we remove raw strings + # before removing comments as opposed to removing comments + # before removing raw strings. This is because there are some + # cpplint checks that requires the comments to be preserved, but + # we don't want to check comments that are inside raw strings. + matched = Match(r'^(.*?)\b(?:R|u8R|uR|UR|LR)"([^\s\\()]*)\((.*)$', line) + if (matched and + not Match(r'^([^\'"]|\'(\\.|[^\'])*\'|"(\\.|[^"])*")*//', + matched.group(1))): delimiter = ')' + matched.group(2) + '"' end = matched.group(3).find(delimiter) @@ -1647,6 +2006,30 @@ def GetIndentLevel(line): else: return 0 +def PathSplitToList(path): + """Returns the path split into a list by the separator. + + Args: + path: An absolute or relative path (e.g. '/a/b/c/' or '../a') + + Returns: + A list of path components (e.g. ['a', 'b', 'c]). + """ + lst = [] + while True: + (head, tail) = os.path.split(path) + if head == path: # absolute paths end + lst.append(head) + break + if tail == path: # relative paths end + lst.append(tail) + break + + path = head + lst.append(tail) + + lst.reverse() + return lst def GetHeaderGuardCPPVariable(filename): """Returns the CPP variable that should be used as a header guard. @@ -1666,11 +2049,61 @@ def GetHeaderGuardCPPVariable(filename): filename = re.sub(r'/\.flymake/([^/]*)$', r'/\1', filename) # Replace 'c++' with 'cpp'. filename = filename.replace('C++', 'cpp').replace('c++', 'cpp') - + fileinfo = FileInfo(filename) file_path_from_root = fileinfo.RepositoryName() - if _root: - file_path_from_root = re.sub('^' + _root + os.sep, '', file_path_from_root) + + def FixupPathFromRoot(): + if _root_debug: + sys.stderr.write("\n_root fixup, _root = '%s', repository name = '%s'\n" + % (_root, fileinfo.RepositoryName())) + + # Process the file path with the --root flag if it was set. + if not _root: + if _root_debug: + sys.stderr.write("_root unspecified\n") + return file_path_from_root + + def StripListPrefix(lst, prefix): + # f(['x', 'y'], ['w, z']) -> None (not a valid prefix) + if lst[:len(prefix)] != prefix: + return None + # f(['a, 'b', 'c', 'd'], ['a', 'b']) -> ['c', 'd'] + return lst[(len(prefix)):] + + # root behavior: + # --root=subdir , lstrips subdir from the header guard + maybe_path = StripListPrefix(PathSplitToList(file_path_from_root), + PathSplitToList(_root)) + + if _root_debug: + sys.stderr.write(("_root lstrip (maybe_path=%s, file_path_from_root=%s," + + " _root=%s)\n") % (maybe_path, file_path_from_root, _root)) + + if maybe_path: + return os.path.join(*maybe_path) + + # --root=.. , will prepend the outer directory to the header guard + full_path = fileinfo.FullName() + root_abspath = os.path.abspath(_root) + + maybe_path = StripListPrefix(PathSplitToList(full_path), + PathSplitToList(root_abspath)) + + if _root_debug: + sys.stderr.write(("_root prepend (maybe_path=%s, full_path=%s, " + + "root_abspath=%s)\n") % (maybe_path, full_path, root_abspath)) + + if maybe_path: + return os.path.join(*maybe_path) + + if _root_debug: + sys.stderr.write("_root ignore, returning %s\n" % (file_path_from_root)) + + # --root=FAKE_DIR is ignored + return file_path_from_root + + file_path_from_root = FixupPathFromRoot() return re.sub(r'[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_' @@ -1697,6 +2130,11 @@ def CheckForHeaderGuard(filename, clean_lines, error): if Search(r'//\s*NOLINT\(build/header_guard\)', i): return + # Allow pragma once instead of header guards + for i in raw_lines: + if Search(r'^\s*#pragma\s+once', i): + return + cppvar = GetHeaderGuardCPPVariable(filename) ifndef = '' @@ -1773,28 +2211,30 @@ def CheckForHeaderGuard(filename, clean_lines, error): def CheckHeaderFileIncluded(filename, include_state, error): - """Logs an error if a .cc file does not include its header.""" + """Logs an error if a source file does not include its header.""" # Do not check test files - if filename.endswith('_test.cc') or filename.endswith('_unittest.cc'): - return - fileinfo = FileInfo(filename) - headerfile = filename[0:len(filename) - 2] + 'h' - if not os.path.exists(headerfile): + if Search(_TEST_FILE_SUFFIX, fileinfo.BaseName()): return - headername = FileInfo(headerfile).RepositoryName() - first_include = 0 - for section_list in include_state.include_list: - for f in section_list: - if headername in f[0] or f[0] in headername: - return - if not first_include: - first_include = f[1] - error(filename, first_include, 'build/include', 5, - '%s should include its header file %s' % (fileinfo.RepositoryName(), - headername)) + for ext in GetHeaderExtensions(): + basefilename = filename[0:len(filename) - len(fileinfo.Extension())] + headerfile = basefilename + '.' + ext + if not os.path.exists(headerfile): + continue + headername = FileInfo(headerfile).RepositoryName() + first_include = None + for section_list in include_state.include_list: + for f in section_list: + if headername in f[0] or f[0] in headername: + return + if not first_include: + first_include = f[1] + + error(filename, first_include, 'build/include', 5, + '%s should include its header file %s' % (fileinfo.RepositoryName(), + headername)) def CheckForBadCharacters(filename, lines, error): @@ -1815,7 +2255,7 @@ def CheckForBadCharacters(filename, lines, error): error: The function to call with any errors found. """ for linenum, line in enumerate(lines): - if u'\ufffd' in line: + if unicode_escape_decode('\ufffd') in line: error(filename, linenum, 'readability/utf8', 5, 'Line contains invalid UTF-8 (or Unicode replacement character).') if '\0' in line: @@ -1997,7 +2437,8 @@ def IsForwardClassDeclaration(clean_lines, linenum): class _BlockInfo(object): """Stores information about a generic block of code.""" - def __init__(self, seen_open_brace): + def __init__(self, linenum, seen_open_brace): + self.starting_linenum = linenum self.seen_open_brace = seen_open_brace self.open_parentheses = 0 self.inline_asm = _NO_ASM @@ -2046,17 +2487,16 @@ def IsBlockInfo(self): class _ExternCInfo(_BlockInfo): """Stores information about an 'extern "C"' block.""" - def __init__(self): - _BlockInfo.__init__(self, True) + def __init__(self, linenum): + _BlockInfo.__init__(self, linenum, True) class _ClassInfo(_BlockInfo): """Stores information about a class.""" def __init__(self, name, class_or_struct, clean_lines, linenum): - _BlockInfo.__init__(self, False) + _BlockInfo.__init__(self, linenum, False) self.name = name - self.starting_linenum = linenum self.is_derived = False self.check_namespace_indentation = True if class_or_struct == 'struct': @@ -2124,9 +2564,8 @@ class _NamespaceInfo(_BlockInfo): """Stores information about a namespace.""" def __init__(self, name, linenum): - _BlockInfo.__init__(self, False) + _BlockInfo.__init__(self, linenum, False) self.name = name or '' - self.starting_linenum = linenum self.check_namespace_indentation = True def CheckEnd(self, filename, clean_lines, linenum, error): @@ -2145,7 +2584,7 @@ def CheckEnd(self, filename, clean_lines, linenum, error): # deciding what these nontrivial things are, so this check is # triggered by namespace size only, which works most of the time. if (linenum - self.starting_linenum < 10 - and not Match(r'};*\s*(//|/\*).*\bnamespace\b', line)): + and not Match(r'^\s*};*\s*(//|/\*).*\bnamespace\b', line)): return # Look for matching comment at end of namespace. @@ -2162,18 +2601,18 @@ def CheckEnd(self, filename, clean_lines, linenum, error): # expected namespace. if self.name: # Named namespace - if not Match((r'};*\s*(//|/\*).*\bnamespace\s+' + re.escape(self.name) + - r'[\*/\.\\\s]*$'), + if not Match((r'^\s*};*\s*(//|/\*).*\bnamespace\s+' + + re.escape(self.name) + r'[\*/\.\\\s]*$'), line): error(filename, linenum, 'readability/namespace', 5, 'Namespace should be terminated with "// namespace %s"' % self.name) else: # Anonymous namespace - if not Match(r'};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line): + if not Match(r'^\s*};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line): # If "// namespace anonymous" or "// anonymous namespace (more text)", # mention "// anonymous namespace" as an acceptable form - if Match(r'}.*\b(namespace anonymous|anonymous namespace)\b', line): + if Match(r'^\s*}.*\b(namespace anonymous|anonymous namespace)\b', line): error(filename, linenum, 'readability/namespace', 5, 'Anonymous namespace should be terminated with "// namespace"' ' or "// anonymous namespace"') @@ -2445,7 +2884,7 @@ def Update(self, filename, clean_lines, linenum, error): # class LOCKABLE API Object { # }; class_decl_match = Match( - r'^(\s*(?:template\s*<[\w\s<>,:]*>\s*)?' + r'^(\s*(?:template\s*<[\w\s<>,:=]*>\s*)?' r'(class|struct)\s+(?:[A-Z_]+\s+)*(\w+(?:::\w+)*))' r'(.*)$', line) if (class_decl_match and @@ -2512,9 +2951,9 @@ def Update(self, filename, clean_lines, linenum, error): if not self.SeenOpenBrace(): self.stack[-1].seen_open_brace = True elif Match(r'^extern\s*"[^"]*"\s*\{', line): - self.stack.append(_ExternCInfo()) + self.stack.append(_ExternCInfo(linenum)) else: - self.stack.append(_BlockInfo(True)) + self.stack.append(_BlockInfo(linenum, True)) if _MATCH_ASM.match(line): self.stack[-1].inline_asm = _BLOCK_ASM @@ -2626,7 +3065,8 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum, r'\s+(register|static|extern|typedef)\b', line): error(filename, linenum, 'build/storage_class', 5, - 'Storage class (static, extern, typedef, etc) should be first.') + 'Storage-class specifier (static, extern, typedef, etc) should be ' + 'at the beginning of the declaration.') if Match(r'\s*#\s*endif\s*[^/\s]+', line): error(filename, linenum, 'build/endif_comment', 5, @@ -2665,11 +3105,10 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum, base_classname = classinfo.name.split('::')[-1] # Look for single-argument constructors that aren't marked explicit. - # Technically a valid construct, but against style. Also look for - # non-single-argument constructors which are also technically valid, but - # strongly suggest something is wrong. + # Technically a valid construct, but against style. explicit_constructor_match = Match( - r'\s+(?:inline\s+)?(explicit\s+)?(?:inline\s+)?%s\s*' + r'\s+(?:(?:inline|constexpr)\s+)*(explicit\s+)?' + r'(?:(?:inline|constexpr)\s+)*%s\s*' r'\(((?:[^()]|\([^()]*\))*)\)' % re.escape(base_classname), line) @@ -2694,6 +3133,7 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum, constructor_args[i] = constructor_arg i += 1 + variadic_args = [arg for arg in constructor_args if '&&...' in arg] defaulted_args = [arg for arg in constructor_args if '=' in arg] noarg_constructor = (not constructor_args or # empty arg list # 'void' arg specifier @@ -2704,20 +3144,24 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum, # all but at most one arg defaulted (len(constructor_args) >= 1 and not noarg_constructor and - len(defaulted_args) >= len(constructor_args) - 1)) + len(defaulted_args) >= len(constructor_args) - 1) or + # variadic arguments with zero or one argument + (len(constructor_args) <= 2 and + len(variadic_args) >= 1)) initializer_list_constructor = bool( onearg_constructor and Search(r'\bstd\s*::\s*initializer_list\b', constructor_args[0])) copy_constructor = bool( onearg_constructor and - Match(r'(const\s+)?%s(\s*<[^>]*>)?(\s+const)?\s*(?:<\w+>\s*)?&' + Match(r'((const\s+(volatile\s+)?)?|(volatile\s+(const\s+)?))?' + r'%s(\s*<[^>]*>)?(\s+const)?\s*(?:<\w+>\s*)?&' % re.escape(base_classname), constructor_args[0].strip())) if (not is_marked_explicit and onearg_constructor and not initializer_list_constructor and not copy_constructor): - if defaulted_args: + if defaulted_args or variadic_args: error(filename, linenum, 'runtime/explicit', 5, 'Constructors callable with one argument ' 'should be marked explicit.') @@ -2728,10 +3172,6 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum, if noarg_constructor: error(filename, linenum, 'runtime/explicit', 5, 'Zero-parameter constructors should not be marked explicit.') - else: - error(filename, linenum, 'runtime/explicit', 0, - 'Constructors that require multiple arguments ' - 'should not be marked explicit.') def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): @@ -2786,6 +3226,7 @@ def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error): error(filename, linenum, 'whitespace/parens', 2, 'Extra space after (') if (Search(r'\w\s+\(', fncall) and + not Search(r'_{0,2}asm_{0,2}\s+_{0,2}volatile_{0,2}\s+\(', fncall) and not Search(r'#\s*define|typedef|using\s+\w+\s*=', fncall) and not Search(r'\w\s+\((\w+::)*\*\w+\)\(', fncall) and not Search(r'\bcase\s+\(', fncall)): @@ -2844,7 +3285,7 @@ def CheckForFunctionLengths(filename, clean_lines, linenum, """Reports for long function bodies. For an overview why this is done, see: - http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions + https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions Uses a simplistic algorithm assuming other style guidelines (especially spacing) are followed. @@ -2885,7 +3326,7 @@ def CheckForFunctionLengths(filename, clean_lines, linenum, if Search(r'(;|})', start_line): # Declarations and trivial functions body_found = True break # ... ignore - elif Search(r'{', start_line): + if Search(r'{', start_line): body_found = True function = Search(r'((\w|:)*)\(', line).group(1) if Match(r'TEST', function): # Handle TEST... macros @@ -2923,9 +3364,7 @@ def CheckComment(line, filename, linenum, next_line_start, error): commentpos = line.find('//') if commentpos != -1: # Check if the // may be in quotes. If so, ignore it - # Comparisons made explicit for clarity -- pylint: disable=g-explicit-bool-comparison - if (line.count('"', 0, commentpos) - - line.count('\\"', 0, commentpos)) % 2 == 0: # not in quotes + if re.sub(r'\\.', '', line[0:commentpos]).count('"') % 2 == 0: # Allow one space for new scopes, two spaces otherwise: if (not (Match(r'^.*{ *//', line) and next_line_start == commentpos) and ((commentpos >= 1 and @@ -2966,36 +3405,6 @@ def CheckComment(line, filename, linenum, next_line_start, error): 'Should have a space between // and comment') -def CheckAccess(filename, clean_lines, linenum, nesting_state, error): - """Checks for improper use of DISALLOW* macros. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] # get rid of comments and strings - - matched = Match((r'\s*(DISALLOW_COPY_AND_ASSIGN|' - r'DISALLOW_IMPLICIT_CONSTRUCTORS)'), line) - if not matched: - return - if nesting_state.stack and isinstance(nesting_state.stack[-1], _ClassInfo): - if nesting_state.stack[-1].access != 'private': - error(filename, linenum, 'readability/constructors', 3, - '%s must be in the private: section' % matched.group(1)) - - else: - # Found DISALLOW* macro outside a class declaration, or perhaps it - # was used inside a function when it should have been part of the - # class declaration. We could issue a warning here, but it - # probably resulted in a compiler error already. - pass - - def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for the correctness of various spacing issues in the code. @@ -3111,8 +3520,8 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): line = clean_lines.elided[linenum] # You shouldn't have spaces before your brackets, except maybe after - # 'delete []' or 'return []() {};' - if Search(r'\w\s+\[', line) and not Search(r'(?:delete|return)\s+\[', line): + # 'delete []', 'return []() {};', or 'auto [abc, ...] = ...;'. + if Search(r'\w\s+\[', line) and not Search(r'(?:auto&?|delete|return)\s+\[', line): error(filename, linenum, 'whitespace/braces', 5, 'Extra space before [') @@ -3174,8 +3583,8 @@ def CheckOperatorSpacing(filename, clean_lines, linenum, error): # macro context and don't do any checks. This avoids false # positives. # - # Note that && is not included here. Those are checked separately - # in CheckRValueReference + # Note that && is not included here. This is because there are too + # many false positives due to RValue references. match = Search(r'[^<>=!\s](==|!=|<=|>=|\|\|)[^<>=!\s,;\)]', line) if match: error(filename, linenum, 'whitespace/operators', 3, @@ -3209,7 +3618,7 @@ def CheckOperatorSpacing(filename, clean_lines, linenum, error): # # We also allow operators following an opening parenthesis, since # those tend to be macros that deal with operators. - match = Search(r'(operator|[^\s(<])(?:L|UL|ULL|l|ul|ull)?<<([^\s,=<])', line) + match = Search(r'(operator|[^\s(<])(?:L|UL|LL|ULL|l|ul|ll|ull)?<<([^\s,=<])', line) if (match and not (match.group(1).isdigit() and match.group(2).isdigit()) and not (match.group(1) == 'operator' and match.group(2) == ';')): error(filename, linenum, 'whitespace/operators', 3, @@ -3313,22 +3722,90 @@ def CheckCommaSpacing(filename, clean_lines, linenum, error): 'Missing space after ;') -def CheckBracesSpacing(filename, clean_lines, linenum, error): +def _IsType(clean_lines, nesting_state, expr): + """Check if expression looks like a type name, returns true if so. + + Args: + clean_lines: A CleansedLines instance containing the file. + nesting_state: A NestingState instance which maintains information about + the current stack of nested blocks being parsed. + expr: The expression to check. + Returns: + True, if token looks like a type. + """ + # Keep only the last token in the expression + last_word = Match(r'^.*(\b\S+)$', expr) + if last_word: + token = last_word.group(1) + else: + token = expr + + # Match native types and stdint types + if _TYPES.match(token): + return True + + # Try a bit harder to match templated types. Walk up the nesting + # stack until we find something that resembles a typename + # declaration for what we are looking for. + typename_pattern = (r'\b(?:typename|class|struct)\s+' + re.escape(token) + + r'\b') + block_index = len(nesting_state.stack) - 1 + while block_index >= 0: + if isinstance(nesting_state.stack[block_index], _NamespaceInfo): + return False + + # Found where the opening brace is. We want to scan from this + # line up to the beginning of the function, minus a few lines. + # template + # class C + # : public ... { // start scanning here + last_line = nesting_state.stack[block_index].starting_linenum + + next_block_start = 0 + if block_index > 0: + next_block_start = nesting_state.stack[block_index - 1].starting_linenum + first_line = last_line + while first_line >= next_block_start: + if clean_lines.elided[first_line].find('template') >= 0: + break + first_line -= 1 + if first_line < next_block_start: + # Didn't find any "template" keyword before reaching the next block, + # there are probably no template things to check for this block + block_index -= 1 + continue + + # Look for typename in the specified range + for i in xrange(first_line, last_line + 1, 1): + if Search(typename_pattern, clean_lines.elided[i]): + return True + block_index -= 1 + + return False + + +def CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error): """Checks for horizontal spacing near commas. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The number of the line to check. + nesting_state: A NestingState instance which maintains information about + the current stack of nested blocks being parsed. error: The function to call with any errors found. """ line = clean_lines.elided[linenum] # Except after an opening paren, or after another opening brace (in case of # an initializer list, for instance), you should have spaces before your - # braces. And since you should never have braces at the beginning of a line, - # this is an easy test. + # braces when they are delimiting blocks, classes, namespaces etc. + # And since you should never have braces at the beginning of a line, + # this is an easy test. Except that braces used for initialization don't + # follow the same rule; we often don't want spaces before those. match = Match(r'^(.*[^ ({>]){', line) + if match: # Try a bit harder to check for brace initialization. This # happens in one of the following forms: @@ -3358,6 +3835,7 @@ def CheckBracesSpacing(filename, clean_lines, linenum, error): # There is a false negative with this approach if people inserted # spurious semicolons, e.g. "if (cond){};", but we will catch the # spurious semicolon with a separate check. + leading_text = match.group(1) (endline, endlinenum, endpos) = CloseExpression( clean_lines, linenum, len(match.group(1))) trailing_text = '' @@ -3366,7 +3844,11 @@ def CheckBracesSpacing(filename, clean_lines, linenum, error): for offset in xrange(endlinenum + 1, min(endlinenum + 3, clean_lines.NumLines() - 1)): trailing_text += clean_lines.elided[offset] - if not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text): + # We also suppress warnings for `uint64_t{expression}` etc., as the style + # guide recommends brace initialization for integral types to avoid + # overflow/truncation. + if (not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text) + and not _IsType(clean_lines, nesting_state, leading_text)): error(filename, linenum, 'whitespace/braces', 5, 'Missing space before {') @@ -3409,406 +3891,6 @@ def IsDecltype(clean_lines, linenum, column): return True return False - -def IsTemplateParameterList(clean_lines, linenum, column): - """Check if the token ending on (linenum, column) is the end of template<>. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: the number of the line to check. - column: end column of the token to check. - Returns: - True if this token is end of a template parameter list, False otherwise. - """ - (_, startline, startpos) = ReverseCloseExpression( - clean_lines, linenum, column) - if (startpos > -1 and - Search(r'\btemplate\s*$', clean_lines.elided[startline][0:startpos])): - return True - return False - - -def IsRValueType(typenames, clean_lines, nesting_state, linenum, column): - """Check if the token ending on (linenum, column) is a type. - - Assumes that text to the right of the column is "&&" or a function - name. - - Args: - typenames: set of type names from template-argument-list. - clean_lines: A CleansedLines instance containing the file. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - linenum: the number of the line to check. - column: end column of the token to check. - Returns: - True if this token is a type, False if we are not sure. - """ - prefix = clean_lines.elided[linenum][0:column] - - # Get one word to the left. If we failed to do so, this is most - # likely not a type, since it's unlikely that the type name and "&&" - # would be split across multiple lines. - match = Match(r'^(.*)(\b\w+|[>*)&])\s*$', prefix) - if not match: - return False - - # Check text following the token. If it's "&&>" or "&&," or "&&...", it's - # most likely a rvalue reference used inside a template. - suffix = clean_lines.elided[linenum][column:] - if Match(r'&&\s*(?:[>,]|\.\.\.)', suffix): - return True - - # Check for known types and end of templates: - # int&& variable - # vector&& variable - # - # Because this function is called recursively, we also need to - # recognize pointer and reference types: - # int* Function() - # int& Function() - if (match.group(2) in typenames or - match.group(2) in ['char', 'char16_t', 'char32_t', 'wchar_t', 'bool', - 'short', 'int', 'long', 'signed', 'unsigned', - 'float', 'double', 'void', 'auto', '>', '*', '&']): - return True - - # If we see a close parenthesis, look for decltype on the other side. - # decltype would unambiguously identify a type, anything else is - # probably a parenthesized expression and not a type. - if match.group(2) == ')': - return IsDecltype( - clean_lines, linenum, len(match.group(1)) + len(match.group(2)) - 1) - - # Check for casts and cv-qualifiers. - # match.group(1) remainder - # -------------- --------- - # const_cast< type&& - # const type&& - # type const&& - if Search(r'\b(?:const_cast\s*<|static_cast\s*<|dynamic_cast\s*<|' - r'reinterpret_cast\s*<|\w+\s)\s*$', - match.group(1)): - return True - - # Look for a preceding symbol that might help differentiate the context. - # These are the cases that would be ambiguous: - # match.group(1) remainder - # -------------- --------- - # Call ( expression && - # Declaration ( type&& - # sizeof ( type&& - # if ( expression && - # while ( expression && - # for ( type&& - # for( ; expression && - # statement ; type&& - # block { type&& - # constructor { expression && - start = linenum - line = match.group(1) - match_symbol = None - while start >= 0: - # We want to skip over identifiers and commas to get to a symbol. - # Commas are skipped so that we can find the opening parenthesis - # for function parameter lists. - match_symbol = Match(r'^(.*)([^\w\s,])[\w\s,]*$', line) - if match_symbol: - break - start -= 1 - line = clean_lines.elided[start] - - if not match_symbol: - # Probably the first statement in the file is an rvalue reference - return True - - if match_symbol.group(2) == '}': - # Found closing brace, probably an indicate of this: - # block{} type&& - return True - - if match_symbol.group(2) == ';': - # Found semicolon, probably one of these: - # for(; expression && - # statement; type&& - - # Look for the previous 'for(' in the previous lines. - before_text = match_symbol.group(1) - for i in xrange(start - 1, max(start - 6, 0), -1): - before_text = clean_lines.elided[i] + before_text - if Search(r'for\s*\([^{};]*$', before_text): - # This is the condition inside a for-loop - return False - - # Did not find a for-init-statement before this semicolon, so this - # is probably a new statement and not a condition. - return True - - if match_symbol.group(2) == '{': - # Found opening brace, probably one of these: - # block{ type&& = ... ; } - # constructor{ expression && expression } - - # Look for a closing brace or a semicolon. If we see a semicolon - # first, this is probably a rvalue reference. - line = clean_lines.elided[start][0:len(match_symbol.group(1)) + 1] - end = start - depth = 1 - while True: - for ch in line: - if ch == ';': - return True - elif ch == '{': - depth += 1 - elif ch == '}': - depth -= 1 - if depth == 0: - return False - end += 1 - if end >= clean_lines.NumLines(): - break - line = clean_lines.elided[end] - # Incomplete program? - return False - - if match_symbol.group(2) == '(': - # Opening parenthesis. Need to check what's to the left of the - # parenthesis. Look back one extra line for additional context. - before_text = match_symbol.group(1) - if linenum > 1: - before_text = clean_lines.elided[linenum - 1] + before_text - before_text = match_symbol.group(1) - - # Patterns that are likely to be types: - # [](type&& - # for (type&& - # sizeof(type&& - # operator=(type&& - # - if Search(r'(?:\]|\bfor|\bsizeof|\boperator\s*\S+\s*)\s*$', before_text): - return True - - # Patterns that are likely to be expressions: - # if (expression && - # while (expression && - # : initializer(expression && - # , initializer(expression && - # ( FunctionCall(expression && - # + FunctionCall(expression && - # + (expression && - # - # The last '+' represents operators such as '+' and '-'. - if Search(r'(?:\bif|\bwhile|[-+=%^(]*>)?\s*$', - match_symbol.group(1)) - if match_func: - # Check for constructors, which don't have return types. - if Search(r'\b(?:explicit|inline)$', match_func.group(1)): - return True - implicit_constructor = Match(r'\s*(\w+)\((?:const\s+)?(\w+)', prefix) - if (implicit_constructor and - implicit_constructor.group(1) == implicit_constructor.group(2)): - return True - return IsRValueType(typenames, clean_lines, nesting_state, linenum, - len(match_func.group(1))) - - # Nothing before the function name. If this is inside a block scope, - # this is probably a function call. - return not (nesting_state.previous_stack_top and - nesting_state.previous_stack_top.IsBlockInfo()) - - if match_symbol.group(2) == '>': - # Possibly a closing bracket, check that what's on the other side - # looks like the start of a template. - return IsTemplateParameterList( - clean_lines, start, len(match_symbol.group(1))) - - # Some other symbol, usually something like "a=b&&c". This is most - # likely not a type. - return False - - -def IsDeletedOrDefault(clean_lines, linenum): - """Check if current constructor or operator is deleted or default. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - Returns: - True if this is a deleted or default constructor. - """ - open_paren = clean_lines.elided[linenum].find('(') - if open_paren < 0: - return False - (close_line, _, close_paren) = CloseExpression( - clean_lines, linenum, open_paren) - if close_paren < 0: - return False - return Match(r'\s*=\s*(?:delete|default)\b', close_line[close_paren:]) - - -def IsRValueAllowed(clean_lines, linenum, typenames): - """Check if RValue reference is allowed on a particular line. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - typenames: set of type names from template-argument-list. - Returns: - True if line is within the region where RValue references are allowed. - """ - # Allow region marked by PUSH/POP macros - for i in xrange(linenum, 0, -1): - line = clean_lines.elided[i] - if Match(r'GOOGLE_ALLOW_RVALUE_REFERENCES_(?:PUSH|POP)', line): - if not line.endswith('PUSH'): - return False - for j in xrange(linenum, clean_lines.NumLines(), 1): - line = clean_lines.elided[j] - if Match(r'GOOGLE_ALLOW_RVALUE_REFERENCES_(?:PUSH|POP)', line): - return line.endswith('POP') - - # Allow operator= - line = clean_lines.elided[linenum] - if Search(r'\boperator\s*=\s*\(', line): - return IsDeletedOrDefault(clean_lines, linenum) - - # Allow constructors - match = Match(r'\s*(?:[\w<>]+::)*([\w<>]+)\s*::\s*([\w<>]+)\s*\(', line) - if match and match.group(1) == match.group(2): - return IsDeletedOrDefault(clean_lines, linenum) - if Search(r'\b(?:explicit|inline)\s+[\w<>]+\s*\(', line): - return IsDeletedOrDefault(clean_lines, linenum) - - if Match(r'\s*[\w<>]+\s*\(', line): - previous_line = 'ReturnType' - if linenum > 0: - previous_line = clean_lines.elided[linenum - 1] - if Match(r'^\s*$', previous_line) or Search(r'[{}:;]\s*$', previous_line): - return IsDeletedOrDefault(clean_lines, linenum) - - # Reject types not mentioned in template-argument-list - while line: - match = Match(r'^.*?(\w+)\s*&&(.*)$', line) - if not match: - break - if match.group(1) not in typenames: - return False - line = match.group(2) - - # All RValue types that were in template-argument-list should have - # been removed by now. Those were allowed, assuming that they will - # be forwarded. - # - # If there are no remaining RValue types left (i.e. types that were - # not found in template-argument-list), flag those as not allowed. - return line.find('&&') < 0 - - -def GetTemplateArgs(clean_lines, linenum): - """Find list of template arguments associated with this function declaration. - - Args: - clean_lines: A CleansedLines instance containing the file. - linenum: Line number containing the start of the function declaration, - usually one line after the end of the template-argument-list. - Returns: - Set of type names, or empty set if this does not appear to have - any template parameters. - """ - # Find start of function - func_line = linenum - while func_line > 0: - line = clean_lines.elided[func_line] - if Match(r'^\s*$', line): - return set() - if line.find('(') >= 0: - break - func_line -= 1 - if func_line == 0: - return set() - - # Collapse template-argument-list into a single string - argument_list = '' - match = Match(r'^(\s*template\s*)<', clean_lines.elided[func_line]) - if match: - # template-argument-list on the same line as function name - start_col = len(match.group(1)) - _, end_line, end_col = CloseExpression(clean_lines, func_line, start_col) - if end_col > -1 and end_line == func_line: - start_col += 1 # Skip the opening bracket - argument_list = clean_lines.elided[func_line][start_col:end_col] - - elif func_line > 1: - # template-argument-list one line before function name - match = Match(r'^(.*)>\s*$', clean_lines.elided[func_line - 1]) - if match: - end_col = len(match.group(1)) - _, start_line, start_col = ReverseCloseExpression( - clean_lines, func_line - 1, end_col) - if start_col > -1: - start_col += 1 # Skip the opening bracket - while start_line < func_line - 1: - argument_list += clean_lines.elided[start_line][start_col:] - start_col = 0 - start_line += 1 - argument_list += clean_lines.elided[func_line - 1][start_col:end_col] - - if not argument_list: - return set() - - # Extract type names - typenames = set() - while True: - match = Match(r'^[,\s]*(?:typename|class)(?:\.\.\.)?\s+(\w+)(.*)$', - argument_list) - if not match: - break - typenames.add(match.group(1)) - argument_list = match.group(2) - return typenames - - -def CheckRValueReference(filename, clean_lines, linenum, nesting_state, error): - """Check for rvalue references. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - nesting_state: A NestingState instance which maintains information about - the current stack of nested blocks being parsed. - error: The function to call with any errors found. - """ - # Find lines missing spaces around &&. - # TODO(unknown): currently we don't check for rvalue references - # with spaces surrounding the && to avoid false positives with - # boolean expressions. - line = clean_lines.elided[linenum] - match = Match(r'^(.*\S)&&', line) - if not match: - match = Match(r'(.*)&&\S', line) - if (not match) or '(&&)' in line or Search(r'\boperator\s*$', match.group(1)): - return - - # Either poorly formed && or an rvalue reference, check the context - # to get a more accurate error message. Mostly we want to determine - # if what's to the left of "&&" is a type or not. - typenames = GetTemplateArgs(clean_lines, linenum) - and_pos = len(match.group(1)) - if IsRValueType(typenames, clean_lines, nesting_state, linenum, and_pos): - if not IsRValueAllowed(clean_lines, linenum, typenames): - error(filename, linenum, 'build/c++11', 3, - 'RValue references are an unapproved C++ feature.') - else: - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around &&') - - def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error): """Checks for additional blank line issues related to sections. @@ -3906,10 +3988,13 @@ def CheckBraces(filename, clean_lines, linenum, error): # used for brace initializers inside function calls. We don't detect this # perfectly: we just don't complain if the last non-whitespace character on # the previous non-blank line is ',', ';', ':', '(', '{', or '}', or if the - # previous line starts a preprocessor block. + # previous line starts a preprocessor block. We also allow a brace on the + # following line if it is part of an array initialization and would not fit + # within the 80 character limit of the preceding line. prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0] if (not Search(r'[,;:}{(]\s*$', prevline) and - not Match(r'\s*#', prevline)): + not Match(r'\s*#', prevline) and + not (GetLineWidth(prevline) > _line_length - 2 and '[]' in prevline)): error(filename, linenum, 'whitespace/braces', 4, '{ should almost always be at the end of the previous line') @@ -3954,11 +4039,11 @@ def CheckBraces(filename, clean_lines, linenum, error): # its line, and the line after that should have an indent level equal to or # lower than the if. We also check for ambiguous if/else nesting without # braces. - if_else_match = Search(r'\b(if\s*\(|else\b)', line) + if_else_match = Search(r'\b(if\s*(|constexpr)\s*\(|else\b)', line) if if_else_match and not Match(r'\s*#', line): if_indent = GetIndentLevel(line) endline, endlinenum, endpos = line, linenum, if_else_match.end() - if_match = Search(r'\bif\s*\(', line) + if_match = Search(r'\bif\s*(|constexpr)\s*\(', line) if if_match: # This could be a multiline if condition, so find the end first. pos = if_match.end() - 1 @@ -4085,13 +4170,14 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error): # In addition to macros, we also don't want to warn on # - Compound literals # - Lambdas - # - alignas specifier with anonymous structs: + # - alignas specifier with anonymous structs + # - decltype closing_brace_pos = match.group(1).rfind(')') opening_parenthesis = ReverseCloseExpression( clean_lines, linenum, closing_brace_pos) if opening_parenthesis[2] > -1: line_prefix = opening_parenthesis[0][0:opening_parenthesis[2]] - macro = Search(r'\b([A-Z_]+)\s*$', line_prefix) + macro = Search(r'\b([A-Z_][A-Z0-9_]*)\s*$', line_prefix) func = Match(r'^(.*\])\s*$', line_prefix) if ((macro and macro.group(1) not in ( @@ -4100,6 +4186,7 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error): 'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or (func and not Search(r'\boperator\s*\[\s*\]', func.group(1))) or Search(r'\b(?:struct|union)\s+alignas\s*$', line_prefix) or + Search(r'\bdecltype$', line_prefix) or Search(r'\s+=\s*$', line_prefix)): match = None if (match and @@ -4136,6 +4223,14 @@ def CheckTrailingSemicolon(filename, clean_lines, linenum, error): # outputting warnings for the matching closing brace, if there are # nested blocks with trailing semicolons, we will get the error # messages in reversed order. + + # We need to check the line forward for NOLINT + raw_lines = clean_lines.raw_lines + ParseNolintSuppressions(filename, raw_lines[endlinenum-1], endlinenum-1, + error) + ParseNolintSuppressions(filename, raw_lines[endlinenum], endlinenum, + error) + error(filename, endlinenum, 'readability/braces', 4, "You don't need a ; after a }") @@ -4159,7 +4254,7 @@ def CheckEmptyBlockBody(filename, clean_lines, linenum, error): line = clean_lines.elided[linenum] matched = Match(r'\s*(for|while|if)\s*\(', line) if matched: - # Find the end of the conditional expression + # Find the end of the conditional expression. (end_line, end_linenum, end_pos) = CloseExpression( clean_lines, linenum, line.find('(')) @@ -4174,6 +4269,75 @@ def CheckEmptyBlockBody(filename, clean_lines, linenum, error): error(filename, end_linenum, 'whitespace/empty_loop_body', 5, 'Empty loop bodies should use {} or continue') + # Check for if statements that have completely empty bodies (no comments) + # and no else clauses. + if end_pos >= 0 and matched.group(1) == 'if': + # Find the position of the opening { for the if statement. + # Return without logging an error if it has no brackets. + opening_linenum = end_linenum + opening_line_fragment = end_line[end_pos:] + # Loop until EOF or find anything that's not whitespace or opening {. + while not Search(r'^\s*\{', opening_line_fragment): + if Search(r'^(?!\s*$)', opening_line_fragment): + # Conditional has no brackets. + return + opening_linenum += 1 + if opening_linenum == len(clean_lines.elided): + # Couldn't find conditional's opening { or any code before EOF. + return + opening_line_fragment = clean_lines.elided[opening_linenum] + # Set opening_line (opening_line_fragment may not be entire opening line). + opening_line = clean_lines.elided[opening_linenum] + + # Find the position of the closing }. + opening_pos = opening_line_fragment.find('{') + if opening_linenum == end_linenum: + # We need to make opening_pos relative to the start of the entire line. + opening_pos += end_pos + (closing_line, closing_linenum, closing_pos) = CloseExpression( + clean_lines, opening_linenum, opening_pos) + if closing_pos < 0: + return + + # Now construct the body of the conditional. This consists of the portion + # of the opening line after the {, all lines until the closing line, + # and the portion of the closing line before the }. + if (clean_lines.raw_lines[opening_linenum] != + CleanseComments(clean_lines.raw_lines[opening_linenum])): + # Opening line ends with a comment, so conditional isn't empty. + return + if closing_linenum > opening_linenum: + # Opening line after the {. Ignore comments here since we checked above. + bodylist = list(opening_line[opening_pos+1:]) + # All lines until closing line, excluding closing line, with comments. + bodylist.extend(clean_lines.raw_lines[opening_linenum+1:closing_linenum]) + # Closing line before the }. Won't (and can't) have comments. + bodylist.append(clean_lines.elided[closing_linenum][:closing_pos-1]) + body = '\n'.join(bodylist) + else: + # If statement has brackets and fits on a single line. + body = opening_line[opening_pos+1:closing_pos-1] + + # Check if the body is empty + if not _EMPTY_CONDITIONAL_BODY_PATTERN.search(body): + return + # The body is empty. Now make sure there's not an else clause. + current_linenum = closing_linenum + current_line_fragment = closing_line[closing_pos:] + # Loop until EOF or find anything that's not whitespace or else clause. + while Search(r'^\s*$|^(?=\s*else)', current_line_fragment): + if Search(r'^(?=\s*else)', current_line_fragment): + # Found an else clause, so don't log an error. + return + current_linenum += 1 + if current_linenum == len(clean_lines.elided): + break + current_line_fragment = clean_lines.elided[current_linenum] + + # The body is empty and there's no else clause until EOF or other code. + error(filename, end_linenum, 'whitespace/empty_if_body', 4, + ('If statement had no body and no else clause')) + def FindCheckMacro(line): """Find a replaceable CHECK-like macro. @@ -4364,6 +4528,16 @@ def GetLineWidth(line): if unicodedata.east_asian_width(uc) in ('W', 'F'): width += 2 elif not unicodedata.combining(uc): + # Issue 337 + # https://mail.python.org/pipermail/python-list/2012-August/628809.html + if (sys.version_info.major, sys.version_info.minor) <= (3, 2): + # https://github.com/python/cpython/blob/2.7/Include/unicodeobject.h#L81 + is_wide_build = sysconfig.get_config_var("Py_UNICODE_SIZE") >= 4 + # https://github.com/python/cpython/blob/2.7/Objects/unicodeobject.c#L564 + is_low_surrogate = 0xDC00 <= ord(uc) <= 0xDFFF + if not is_wide_build and is_low_surrogate: + width -= 1 + width += 1 return width else: @@ -4393,6 +4567,7 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, # raw strings, raw_lines = clean_lines.lines_without_raw_strings line = raw_lines[linenum] + prev = raw_lines[linenum - 1] if linenum > 0 else '' if line.find('\t') != -1: error(filename, linenum, 'whitespace/tab', 1, @@ -4416,22 +4591,27 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, cleansed_line = clean_lines.elided[linenum] while initial_spaces < len(line) and line[initial_spaces] == ' ': initial_spaces += 1 - if line and line[-1].isspace(): - error(filename, linenum, 'whitespace/end_of_line', 4, - 'Line ends in whitespace. Consider deleting these extra spaces.') # There are certain situations we allow one space, notably for # section labels, and also lines containing multi-line raw strings. - elif ((initial_spaces == 1 or initial_spaces == 3) and - not Match(scope_or_label_pattern, cleansed_line) and - not (clean_lines.raw_lines[linenum] != line and - Match(r'^\s*""', line))): + # We also don't check for lines that look like continuation lines + # (of lines ending in double quotes, commas, equals, or angle brackets) + # because the rules for how to indent those are non-trivial. + if (not Search(r'[",=><] *$', prev) and + (initial_spaces == 1 or initial_spaces == 3) and + not Match(scope_or_label_pattern, cleansed_line) and + not (clean_lines.raw_lines[linenum] != line and + Match(r'^\s*""', line))): error(filename, linenum, 'whitespace/indent', 3, 'Weird number of spaces at line-start. ' 'Are you using a 2-space indent?') + if line and line[-1].isspace(): + error(filename, linenum, 'whitespace/end_of_line', 4, + 'Line ends in whitespace. Consider deleting these extra spaces.') + # Check if the line is a header guard. is_header_guard = False - if file_extension == 'h': + if IsHeaderExtension(file_extension): cppvar = GetHeaderGuardCPPVariable(filename) if (line.startswith('#ifndef %s' % cppvar) or line.startswith('#define %s' % cppvar) or @@ -4445,20 +4625,23 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, # # The "$Id:...$" comment may also get very long without it being the # developers fault. + # + # Doxygen documentation copying can get pretty long when using an overloaded + # function declaration if (not line.startswith('#include') and not is_header_guard and not Match(r'^\s*//.*http(s?)://\S*$', line) and - not Match(r'^// \$Id:.*#[0-9]+ \$$', line)): + not Match(r'^\s*//\s*[^\s]*$', line) and + not Match(r'^// \$Id:.*#[0-9]+ \$$', line) and + not Match(r'^\s*/// [@\\](copydoc|copydetails|copybrief) .*$', line)): line_width = GetLineWidth(line) - extended_length = int((_line_length * 1.25)) - if line_width > extended_length: - error(filename, linenum, 'whitespace/line_length', 4, - 'Lines should very rarely be longer than %i characters' % - extended_length) - elif line_width > _line_length: + if line_width > _line_length: error(filename, linenum, 'whitespace/line_length', 2, 'Lines should be <= %i characters long' % _line_length) if (cleansed_line.count(';') > 1 and + # allow simple single line lambdas + not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}\n\r]*\}', + line) and # for loops are allowed two ;'s (and may run over two lines). cleansed_line.find('for') == -1 and (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or @@ -4474,14 +4657,12 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state, CheckBraces(filename, clean_lines, linenum, error) CheckTrailingSemicolon(filename, clean_lines, linenum, error) CheckEmptyBlockBody(filename, clean_lines, linenum, error) - CheckAccess(filename, clean_lines, linenum, nesting_state, error) CheckSpacing(filename, clean_lines, linenum, nesting_state, error) CheckOperatorSpacing(filename, clean_lines, linenum, error) CheckParenthesisSpacing(filename, clean_lines, linenum, error) CheckCommaSpacing(filename, clean_lines, linenum, error) - CheckBracesSpacing(filename, clean_lines, linenum, error) + CheckBracesSpacing(filename, clean_lines, linenum, nesting_state, error) CheckSpacingForFunctionCall(filename, clean_lines, linenum, error) - CheckRValueReference(filename, clean_lines, linenum, nesting_state, error) CheckCheck(filename, clean_lines, linenum, error) CheckAltTokens(filename, clean_lines, linenum, error) classinfo = nesting_state.InnermostClass() @@ -4517,31 +4698,17 @@ def _DropCommonSuffixes(filename): Returns: The filename with the common suffix removed. """ - for suffix in ('test.cc', 'regtest.cc', 'unittest.cc', - 'inl.h', 'impl.h', 'internal.h'): + for suffix in itertools.chain( + ('%s.%s' % (test_suffix.lstrip('_'), ext) + for test_suffix, ext in itertools.product(_test_suffixes, GetNonHeaderExtensions())), + ('%s.%s' % (suffix, ext) + for suffix, ext in itertools.product(['inl', 'imp', 'internal'], GetHeaderExtensions()))): if (filename.endswith(suffix) and len(filename) > len(suffix) and filename[-len(suffix) - 1] in ('-', '_')): return filename[:-len(suffix) - 1] return os.path.splitext(filename)[0] -def _IsTestFilename(filename): - """Determines if the given filename has a suffix that identifies it as a test. - - Args: - filename: The input filename. - - Returns: - True if 'filename' looks like a test, False otherwise. - """ - if (filename.endswith('_test.cc') or - filename.endswith('_unittest.cc') or - filename.endswith('_regtest.cc')): - return True - else: - return False - - def _ClassifyInclude(fileinfo, include, is_system): """Figures out what kind of header 'include' is. @@ -4570,6 +4737,10 @@ def _ClassifyInclude(fileinfo, include, is_system): # those already checked for above. is_cpp_h = include in _CPP_HEADERS + # Headers with C++ extensions shouldn't be considered C system headers + if is_system and os.path.splitext(include)[1] in ['.hpp', '.hxx', '.h++']: + is_system = False + if is_system: if is_cpp_h: return _CPP_SYS_HEADER @@ -4582,9 +4753,11 @@ def _ClassifyInclude(fileinfo, include, is_system): target_dir, target_base = ( os.path.split(_DropCommonSuffixes(fileinfo.RepositoryName()))) include_dir, include_base = os.path.split(_DropCommonSuffixes(include)) + target_dir_pub = os.path.normpath(target_dir + '/../public') + target_dir_pub = target_dir_pub.replace('\\', '/') if target_base == include_base and ( include_dir == target_dir or - include_dir == os.path.normpath(target_dir + '/../public')): + include_dir == target_dir_pub): return _LIKELY_MY_HEADER # If the target and include share some initial basename @@ -4628,7 +4801,7 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): # naming convention but not the include convention. match = Match(r'#include\s*"([^/]+\.h)"', line) if match and not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1)): - error(filename, linenum, 'build/include', 4, + error(filename, linenum, 'build/include_subdir', 4, 'Include the directory when naming .h files') # we shouldn't include a file more than once. actually, there are a @@ -4643,11 +4816,28 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error): error(filename, linenum, 'build/include', 4, '"%s" already included at %s:%s' % (include, filename, duplicate_line)) - elif (include.endswith('.cc') and + return + + for extension in GetNonHeaderExtensions(): + if (include.endswith('.' + extension) and os.path.dirname(fileinfo.RepositoryName()) != os.path.dirname(include)): - error(filename, linenum, 'build/include', 4, - 'Do not include .cc files from other packages') - elif not _THIRD_PARTY_HEADERS_PATTERN.match(include): + error(filename, linenum, 'build/include', 4, + 'Do not include .' + extension + ' files from other packages') + return + + # We DO want to include a 3rd party looking header if it matches the + # filename. Otherwise we get an erroneous error "...should include its + # header" error later. + third_src_header = False + for ext in GetHeaderExtensions(): + basefilename = filename[0:len(filename) - len(fileinfo.Extension())] + headerfile = basefilename + '.' + ext + headername = FileInfo(headerfile).RepositoryName() + if headername in include or include in headername: + third_src_header = True + break + + if third_src_header or not _THIRD_PARTY_HEADERS_PATTERN.match(include): include_state.include_list[-1].append((include, linenum)) # We want to ensure that headers appear in the right order: @@ -4701,7 +4891,7 @@ def _GetTextInside(text, start_pattern): # Give opening punctuations to get the matching close-punctuations. matching_punctuation = {'(': ')', '{': '}', '[': ']'} - closing_punctuation = set(matching_punctuation.itervalues()) + closing_punctuation = set(itervalues(matching_punctuation)) # Find the position to start extracting text. match = re.search(start_pattern, text, re.M) @@ -4756,6 +4946,9 @@ def _GetTextInside(text, start_pattern): _RE_PATTERN_CONST_REF_PARAM = ( r'(?:.*\s*\bconst\s*&\s*' + _RE_PATTERN_IDENT + r'|const\s+' + _RE_PATTERN_TYPE + r'\s*&\s*' + _RE_PATTERN_IDENT + r')') +# Stream types. +_RE_PATTERN_REF_STREAM_PARAM = ( + r'(?:.*stream\s*&\s*' + _RE_PATTERN_IDENT + r')') def CheckLanguage(filename, clean_lines, linenum, file_extension, @@ -4792,15 +4985,13 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, if match: include_state.ResetSection(match.group(1)) - # Make Windows paths like Unix. - fullname = os.path.abspath(filename).replace('\\', '/') - + # Perform other checks now that we are sure that this is not an include line CheckCasts(filename, clean_lines, linenum, error) CheckGlobalStatic(filename, clean_lines, linenum, error) CheckPrintf(filename, clean_lines, linenum, error) - if file_extension == 'h': + if IsHeaderExtension(file_extension): # TODO(unknown): check that 1-arg constructors are explicit. # How to tell it's a constructor? # (handled in CheckForNonStandardConstructs for now) @@ -4861,9 +5052,14 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, % (match.group(1), match.group(2))) if Search(r'\busing namespace\b', line): - error(filename, linenum, 'build/namespaces', 5, - 'Do not use namespace using-directives. ' - 'Use using-declarations instead.') + if Search(r'\bliterals\b', line): + error(filename, linenum, 'build/namespaces_literals', 5, + 'Do not use namespace using-directives. ' + 'Use using-declarations instead.') + else: + error(filename, linenum, 'build/namespaces', 5, + 'Do not use namespace using-directives. ' + 'Use using-declarations instead.') # Detect variable-length arrays. match = Match(r'\s*(.+::)?(\w+) [a-z]\w*\[(.+)];', line) @@ -4907,12 +5103,12 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, # Check for use of unnamed namespaces in header files. Registration # macros are typically OK, so we allow use of "namespace {" on lines # that end with backslashes. - if (file_extension == 'h' + if (IsHeaderExtension(file_extension) and Search(r'\bnamespace\s*{', line) and line[-1] != '\\'): error(filename, linenum, 'build/namespaces', 4, 'Do not use unnamed namespaces in header files. See ' - 'http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' + 'https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' ' for more information.') @@ -4933,9 +5129,13 @@ def CheckGlobalStatic(filename, clean_lines, linenum, error): # Check for people declaring static/global STL strings at the top level. # This is dangerous because the C++ language does not guarantee that - # globals with constructors are initialized before the first access. + # globals with constructors are initialized before the first access, and + # also because globals can be destroyed when some threads are still running. + # TODO(unknown): Generalize this to also find static unique_ptr instances. + # TODO(unknown): File bugs for clang-tidy to find these. match = Match( - r'((?:|static +)(?:|const +))string +([a-zA-Z0-9_:]+)\b(.*)', + r'((?:|static +)(?:|const +))(?::*std::)?string( +const)? +' + r'([a-zA-Z0-9_:]+)\b(.*)', line) # Remove false positives: @@ -4955,15 +5155,20 @@ def CheckGlobalStatic(filename, clean_lines, linenum, error): # matching identifiers. # string Class::operator*() if (match and - not Search(r'\bstring\b(\s+const)?\s*\*\s*(const\s+)?\w', line) and + not Search(r'\bstring\b(\s+const)?\s*[\*\&]\s*(const\s+)?\w', line) and not Search(r'\boperator\W', line) and - not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)*\s*\(([^"]|$)', match.group(3))): - error(filename, linenum, 'runtime/string', 4, - 'For a static/global string constant, use a C style string instead: ' - '"%schar %s[]".' % - (match.group(1), match.group(2))) + not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)*\s*\(([^"]|$)', match.group(4))): + if Search(r'\bconst\b', line): + error(filename, linenum, 'runtime/string', 4, + 'For a static/global string constant, use a C style string ' + 'instead: "%schar%s %s[]".' % + (match.group(1), match.group(2) or '', match.group(3))) + else: + error(filename, linenum, 'runtime/string', 4, + 'Static/global string variables are not permitted.') - if Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line): + if (Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line) or + Search(r'\b([A-Za-z0-9_]*_)\(CHECK_NOTNULL\(\1\)\)', line)): error(filename, linenum, 'runtime/init', 4, 'You seem to be initializing a member variable with itself.') @@ -5208,7 +5413,8 @@ def CheckForNonConstReference(filename, clean_lines, linenum, decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body for parameter in re.findall(_RE_PATTERN_REF_PARAM, decls): - if not Match(_RE_PATTERN_CONST_REF_PARAM, parameter): + if (not Match(_RE_PATTERN_CONST_REF_PARAM, parameter) and + not Match(_RE_PATTERN_REF_STREAM_PARAM, parameter)): error(filename, linenum, 'runtime/references', 2, 'Is this a non-const reference? ' 'If so, make const or use a pointer: ' + @@ -5231,7 +5437,7 @@ def CheckCasts(filename, clean_lines, linenum, error): # Parameterless conversion functions, such as bool(), are allowed as they are # probably a member operator declaration or default constructor. match = Search( - r'(\bnew\s+|\S<\s*(?:const\s+)?)?\b' + r'(\bnew\s+(?:const\s+)?|\S<\s*(?:const\s+)?)?\b' r'(int|float|double|bool|char|int32|uint32|int64|uint64)' r'(\([^)].*)', line) expecting_function = ExpectingFunctionArgs(clean_lines, linenum) @@ -5372,63 +5578,12 @@ def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error): if context.endswith(' operator++') or context.endswith(' operator--'): return False - # A single unnamed argument for a function tends to look like old - # style cast. If we see those, don't issue warnings for deprecated - # casts, instead issue warnings for unnamed arguments where - # appropriate. - # - # These are things that we want warnings for, since the style guide - # explicitly require all parameters to be named: - # Function(int); - # Function(int) { - # ConstMember(int) const; - # ConstMember(int) const { - # ExceptionMember(int) throw (...); - # ExceptionMember(int) throw (...) { - # PureVirtual(int) = 0; - # [](int) -> bool { - # - # These are functions of some sort, where the compiler would be fine - # if they had named parameters, but people often omit those - # identifiers to reduce clutter: - # (FunctionPointer)(int); - # (FunctionPointer)(int) = value; - # Function((function_pointer_arg)(int)) - # Function((function_pointer_arg)(int), int param) - # ; - # <(FunctionPointerTemplateArgument)(int)>; + # A single unnamed argument for a function tends to look like old style cast. + # If we see those, don't issue warnings for deprecated casts. remainder = line[match.end(0):] if Match(r'^\s*(?:;|const\b|throw\b|final\b|override\b|[=>{),]|->)', remainder): - # Looks like an unnamed parameter. - - # Don't warn on any kind of template arguments. - if Match(r'^\s*>', remainder): - return False - - # Don't warn on assignments to function pointers, but keep warnings for - # unnamed parameters to pure virtual functions. Note that this pattern - # will also pass on assignments of "0" to function pointers, but the - # preferred values for those would be "nullptr" or "NULL". - matched_zero = Match(r'^\s=\s*(\S+)\s*;', remainder) - if matched_zero and matched_zero.group(1) != '0': - return False - - # Don't warn on function pointer declarations. For this we need - # to check what came before the "(type)" string. - if Match(r'.*\)\s*$', line[0:match.start(0)]): - return False - - # Don't warn if the parameter is named with block comments, e.g.: - # Function(int /*unused_param*/); - raw_line = clean_lines.raw_lines[linenum] - if '/*' in raw_line: - return False - - # Passed all filters, issue warning here. - error(filename, linenum, 'readability/function', 3, - 'All parameters should be named in a function') - return True + return False # At this point, all that should be left is actual casts. error(filename, linenum, 'readability/casting', 4, @@ -5481,13 +5636,16 @@ def ExpectingFunctionArgs(clean_lines, linenum): )), ('', ('numeric_limits',)), ('', ('list',)), - ('', ('map', 'multimap',)), - ('', ('allocator',)), + ('', ('multimap',)), + ('', ('allocator', 'make_shared', 'make_unique', 'shared_ptr', + 'unique_ptr', 'weak_ptr')), ('', ('queue', 'priority_queue',)), - ('', ('set', 'multiset',)), + ('', ('multiset',)), ('', ('stack',)), ('', ('char_traits', 'basic_string',)), ('', ('tuple',)), + ('', ('unordered_map', 'unordered_multimap')), + ('', ('unordered_set', 'unordered_multiset')), ('', ('pair',)), ('', ('vector',)), @@ -5498,18 +5656,36 @@ def ExpectingFunctionArgs(clean_lines, linenum): ('', ('slist',)), ) -_RE_PATTERN_STRING = re.compile(r'\bstring\b') +_HEADERS_MAYBE_TEMPLATES = ( + ('', ('copy', 'max', 'min', 'min_element', 'sort', + 'transform', + )), + ('', ('forward', 'make_pair', 'move', 'swap')), + ) -_re_pattern_algorithm_header = [] -for _template in ('copy', 'max', 'min', 'min_element', 'sort', 'swap', - 'transform'): - # Match max(..., ...), max(..., ...), but not foo->max, foo.max or - # type::max(). - _re_pattern_algorithm_header.append( - (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'), - _template, - '')) +_RE_PATTERN_STRING = re.compile(r'\bstring\b') +_re_pattern_headers_maybe_templates = [] +for _header, _templates in _HEADERS_MAYBE_TEMPLATES: + for _template in _templates: + # Match max(..., ...), max(..., ...), but not foo->max, foo.max or + # 'type::max()'. + _re_pattern_headers_maybe_templates.append( + (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'), + _template, + _header)) +# Match set, but not foo->set, foo.set +_re_pattern_headers_maybe_templates.append( + (re.compile(r'[^>.]\bset\s*\<'), + 'set<>', + '')) +# Match 'map var' and 'std::map(...)', but not 'map(...)'' +_re_pattern_headers_maybe_templates.append( + (re.compile(r'(std\b::\bmap\s*\<)|(^(std\b::\b)map\b\(\s*\<)'), + 'map<>', + '')) + +# Other scripts may reach in and modify this pattern. _re_pattern_templates = [] for _header, _templates in _HEADERS_CONTAINING_TEMPLATES: for _template in _templates: @@ -5540,7 +5716,7 @@ def FilesBelongToSameModule(filename_cc, filename_h): some false positives. This should be sufficiently rare in practice. Args: - filename_cc: is the path for the .cc file + filename_cc: is the path for the source (e.g. .cc) file filename_h: is the path for the header path Returns: @@ -5548,20 +5724,23 @@ def FilesBelongToSameModule(filename_cc, filename_h): bool: True if filename_cc and filename_h belong to the same module. string: the additional prefix needed to open the header file. """ + fileinfo_cc = FileInfo(filename_cc) + if not fileinfo_cc.Extension().lstrip('.') in GetNonHeaderExtensions(): + return (False, '') - if not filename_cc.endswith('.cc'): + fileinfo_h = FileInfo(filename_h) + if not IsHeaderExtension(fileinfo_h.Extension().lstrip('.')): return (False, '') - filename_cc = filename_cc[:-len('.cc')] - if filename_cc.endswith('_unittest'): - filename_cc = filename_cc[:-len('_unittest')] - elif filename_cc.endswith('_test'): - filename_cc = filename_cc[:-len('_test')] + + filename_cc = filename_cc[:-(len(fileinfo_cc.Extension()))] + matched_test_suffix = Search(_TEST_FILE_SUFFIX, fileinfo_cc.BaseName()) + if matched_test_suffix: + filename_cc = filename_cc[:-len(matched_test_suffix.group(1))] + filename_cc = filename_cc.replace('/public/', '/') filename_cc = filename_cc.replace('/internal/', '/') - if not filename_h.endswith('.h'): - return (False, '') - filename_h = filename_h[:-len('.h')] + filename_h = filename_h[:-(len(fileinfo_h.Extension()))] if filename_h.endswith('-inl'): filename_h = filename_h[:-len('-inl')] filename_h = filename_h.replace('/public/', '/') @@ -5636,7 +5815,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, if prefix.endswith('std::') or not prefix.endswith('::'): required[''] = (linenum, 'string') - for pattern, template, header in _re_pattern_algorithm_header: + for pattern, template, header in _re_pattern_headers_maybe_templates: if pattern.search(line): required[header] = (linenum, template) @@ -5645,8 +5824,13 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, continue for pattern, template, header in _re_pattern_templates: - if pattern.search(line): - required[header] = (linenum, template) + matched = pattern.search(line) + if matched: + # Don't warn about IWYU in non-STL namespaces: + # (We check only the first match per line; good enough.) + prefix = line[:matched.start()] + if prefix.endswith('std::') or not prefix.endswith('::'): + required[header] = (linenum, template) # The policy is that if you #include something in foo.h you don't need to # include it again in foo.cc. Here, we will look at possible includes. @@ -5671,7 +5855,7 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, # include_dict is modified during iteration, so we iterate over a copy of # the keys. - header_keys = include_dict.keys() + header_keys = list(include_dict.keys()) for header in header_keys: (same_module, common_path) = FilesBelongToSameModule(abs_filename, header) fullpath = common_path + header @@ -5683,11 +5867,13 @@ def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error, # didn't include it in the .h file. # TODO(unknown): Do a better job of finding .h files so we are confident that # not having the .h file means there isn't one. - if filename.endswith('.cc') and not header_found: - return + if not header_found: + for extension in GetNonHeaderExtensions(): + if filename.endswith('.' + extension): + return # All the lines have been processed, report the errors found. - for required_header_unstripped in required: + for required_header_unstripped in sorted(required, key=required.__getitem__): template = required[required_header_unstripped][1] if required_header_unstripped.strip('<>"') not in include_dict: error(filename, required[required_header_unstripped][0], @@ -5719,31 +5905,6 @@ def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error): ' OR use pair directly OR if appropriate, construct a pair directly') -def CheckDefaultLambdaCaptures(filename, clean_lines, linenum, error): - """Check that default lambda captures are not used. - - Args: - filename: The name of the current file. - clean_lines: A CleansedLines instance containing the file. - linenum: The number of the line to check. - error: The function to call with any errors found. - """ - line = clean_lines.elided[linenum] - - # A lambda introducer specifies a default capture if it starts with "[=" - # or if it starts with "[&" _not_ followed by an identifier. - match = Match(r'^(.*)\[\s*(?:=|&[^\w])', line) - if match: - # Found a potential error, check what comes after the lambda-introducer. - # If it's not open parenthesis (for lambda-declarator) or open brace - # (for compound-statement), it's not a lambda. - line, _, pos = CloseExpression(clean_lines, linenum, len(match.group(1))) - if pos >= 0 and Match(r'^\s*[{(]', line[pos:]): - error(filename, linenum, 'build/c++11', - 4, # 4 = high confidence - 'Default lambda captures are an unapproved C++ feature.') - - def CheckRedundantVirtual(filename, clean_lines, linenum, error): """Check if line contains a redundant "virtual" function-specifier. @@ -5851,11 +6012,9 @@ def IsBlockInNameSpace(nesting_state, is_forward_declaration): Whether or not the new block is directly in a namespace. """ if is_forward_declaration: - if len(nesting_state.stack) >= 1 and ( - isinstance(nesting_state.stack[-1], _NamespaceInfo)): - return True - else: - return False + return len(nesting_state.stack) >= 1 and ( + isinstance(nesting_state.stack[-1], _NamespaceInfo)) + return (len(nesting_state.stack) > 1 and nesting_state.stack[-1].check_namespace_indentation and @@ -5905,7 +6064,7 @@ def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum, def ProcessLine(filename, file_extension, clean_lines, line, include_state, function_state, nesting_state, error, - extra_check_functions=[]): + extra_check_functions=None): """Processes a single line in the file. Args: @@ -5942,11 +6101,11 @@ def ProcessLine(filename, file_extension, clean_lines, line, CheckPosixThreading(filename, clean_lines, line, error) CheckInvalidIncrement(filename, clean_lines, line, error) CheckMakePairUsesDeduction(filename, clean_lines, line, error) - CheckDefaultLambdaCaptures(filename, clean_lines, line, error) CheckRedundantVirtual(filename, clean_lines, line, error) CheckRedundantOverrideOrFinal(filename, clean_lines, line, error) - for check_fn in extra_check_functions: - check_fn(filename, clean_lines, line, error) + if extra_check_functions: + for check_fn in extra_check_functions: + check_fn(filename, clean_lines, line, error) def FlagCxx11Features(filename, clean_lines, linenum, error): """Flag those c++11 features that we only allow in certain places. @@ -5959,8 +6118,14 @@ def FlagCxx11Features(filename, clean_lines, linenum, error): """ line = clean_lines.elided[linenum] - # Flag unapproved C++11 headers. include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line) + + # Flag unapproved C++ TR1 headers. + if include and include.group(1).startswith('tr1/'): + error(filename, linenum, 'build/c++tr1', 5, + ('C++ TR1 headers such as <%s> are unapproved.') % include.group(1)) + + # Flag unapproved C++11 headers. if include and include.group(1) in ('cfenv', 'condition_variable', 'fenv.h', @@ -5994,8 +6159,27 @@ def FlagCxx11Features(filename, clean_lines, linenum, error): 'they may let you use it.') % top_name) +def FlagCxx14Features(filename, clean_lines, linenum, error): + """Flag those C++14 features that we restrict. + + Args: + filename: The name of the current file. + clean_lines: A CleansedLines instance containing the file. + linenum: The number of the line to check. + error: The function to call with any errors found. + """ + line = clean_lines.elided[linenum] + + include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line) + + # Flag unapproved C++14 headers. + if include and include.group(1) in ('scoped_allocator', 'shared_mutex'): + error(filename, linenum, 'build/c++14', 5, + ('<%s> is an unapproved C++14 header.') % include.group(1)) + + def ProcessFileData(filename, file_extension, lines, error, - extra_check_functions=[]): + extra_check_functions=None): """Performs lint checks and reports any errors to the given error function. Args: @@ -6019,11 +6203,11 @@ def ProcessFileData(filename, file_extension, lines, error, ResetNolintSuppressions() CheckForCopyright(filename, lines, error) - + ProcessGlobalSuppresions(lines) RemoveMultiLineComments(filename, lines, error) clean_lines = CleansedLines(lines) - if file_extension == 'h': + if IsHeaderExtension(file_extension): CheckForHeaderGuard(filename, clean_lines, error) for line in xrange(clean_lines.NumLines()): @@ -6034,9 +6218,9 @@ def ProcessFileData(filename, file_extension, lines, error, nesting_state.CheckCompletedBlocks(filename, error) CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error) - + # Check that the .cc file has included its header if it exists. - if file_extension == 'cc': + if _IsSourceExtension(file_extension): CheckHeaderFileIncluded(filename, include_state, error) # We check here rather than inside ProcessLine so that we see raw @@ -6092,7 +6276,10 @@ def ProcessConfigOverrides(filename): if base_name: pattern = re.compile(val) if pattern.match(base_name): - sys.stderr.write('Ignoring "%s": file excluded by "%s". ' + if _cpplint_state.quiet: + # Suppress "Ignoring file" warning when using --quiet. + return False + _cpplint_state.PrintInfo('Ignoring "%s": file excluded by "%s". ' 'File path component "%s" matches ' 'pattern "%s"\n' % (filename, cfg_file, base_name, val)) @@ -6100,28 +6287,36 @@ def ProcessConfigOverrides(filename): elif name == 'linelength': global _line_length try: - _line_length = int(val) + _line_length = int(val) except ValueError: - sys.stderr.write('Line length must be numeric.') + _cpplint_state.PrintError('Line length must be numeric.') + elif name == 'extensions': + ProcessExtensionsOption(val) + elif name == 'root': + global _root + # root directories are specified relative to CPPLINT.cfg dir. + _root = os.path.join(os.path.dirname(cfg_file), val) + elif name == 'headers': + ProcessHppHeadersOption(val) else: - sys.stderr.write( + _cpplint_state.PrintError( 'Invalid configuration option (%s) in file %s\n' % (name, cfg_file)) except IOError: - sys.stderr.write( + _cpplint_state.PrintError( "Skipping config file '%s': Can't open for reading\n" % cfg_file) keep_looking = False # Apply all the accumulated filters in reverse order (top-level directory # config options having the least priority). - for filter in reversed(cfg_filters): - _AddFilters(filter) + for cfg_filter in reversed(cfg_filters): + _AddFilters(cfg_filter) return True -def ProcessFile(filename, vlevel, extra_check_functions=[]): +def ProcessFile(filename, vlevel, extra_check_functions=None): """Does google-lint on a single file. Args: @@ -6137,6 +6332,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): _SetVerboseLevel(vlevel) _BackupFilters() + old_errors = _cpplint_state.error_count if not ProcessConfigOverrides(filename): _RestoreFilters() @@ -6170,7 +6366,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): lf_lines.append(linenum + 1) except IOError: - sys.stderr.write( + _cpplint_state.PrintError( "Skipping input '%s': Can't open for reading\n" % filename) _RestoreFilters() return @@ -6180,9 +6376,9 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): # When reading from stdin, the extension is unknown, so no cpplint tests # should rely on the extension. - if filename != '-' and file_extension not in _valid_extensions: - sys.stderr.write('Ignoring %s; not a valid file name ' - '(%s)\n' % (filename, ', '.join(_valid_extensions))) + if filename != '-' and file_extension not in GetAllExtensions(): + _cpplint_state.PrintError('Ignoring %s; not a valid file name ' + '(%s)\n' % (filename, ', '.join(GetAllExtensions()))) else: ProcessFileData(filename, file_extension, lines, Error, extra_check_functions) @@ -6205,7 +6401,10 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): Error(filename, linenum, 'whitespace/newline', 1, 'Unexpected \\r (^M) found; better to use only \\n') - sys.stderr.write('Done processing %s\n' % filename) + # Suppress printing anything if --quiet was passed unless the error + # count has increased after processing this file. + if not _cpplint_state.quiet or old_errors != _cpplint_state.error_count: + _cpplint_state.PrintInfo('Done processing %s\n' % filename) _RestoreFilters() @@ -6215,12 +6414,21 @@ def PrintUsage(message): Args: message: The optional error message. """ - sys.stderr.write(_USAGE) + sys.stderr.write(_USAGE % (list(GetAllExtensions()), + ','.join(list(GetAllExtensions())), + GetHeaderExtensions(), + ','.join(GetHeaderExtensions()))) + if message: sys.exit('\nFATAL ERROR: ' + message) else: - sys.exit(1) + sys.exit(0) +def PrintVersion(): + sys.stdout.write('Cpplint fork (https://github.com/cpplint/cpplint)\n') + sys.stdout.write('cpplint ' + __VERSION__ + '\n') + sys.stdout.write('Python ' + sys.version + '\n') + sys.exit(0) def PrintCategories(): """Prints a list of all the error-categories used by error messages. @@ -6244,27 +6452,41 @@ def ParseArguments(args): """ try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', + 'v=', + 'version', 'counting=', 'filter=', 'root=', + 'repository=', 'linelength=', - 'extensions=']) + 'extensions=', + 'exclude=', + 'recursive', + 'headers=', + 'quiet']) except getopt.GetoptError: PrintUsage('Invalid arguments.') verbosity = _VerboseLevel() output_format = _OutputFormat() filters = '' + quiet = _Quiet() counting_style = '' + recursive = False for (opt, val) in opts: if opt == '--help': PrintUsage(None) + if opt == '--version': + PrintVersion() elif opt == '--output': - if val not in ('emacs', 'vs7', 'eclipse'): - PrintUsage('The only allowed output formats are emacs, vs7 and eclipse.') + if val not in ('emacs', 'vs7', 'eclipse', 'junit'): + PrintUsage('The only allowed output formats are emacs, vs7, eclipse ' + 'and junit.') output_format = val - elif opt == '--verbose': + elif opt == '--quiet': + quiet = True + elif opt == '--verbose' or opt == '--v': verbosity = int(val) elif opt == '--filter': filters = val @@ -6277,44 +6499,123 @@ def ParseArguments(args): elif opt == '--root': global _root _root = val + elif opt == '--repository': + global _repository + _repository = val elif opt == '--linelength': global _line_length try: - _line_length = int(val) + _line_length = int(val) except ValueError: - PrintUsage('Line length must be digits.') + PrintUsage('Line length must be digits.') + elif opt == '--exclude': + global _excludes + if not _excludes: + _excludes = set() + _excludes.update(glob.glob(val)) elif opt == '--extensions': - global _valid_extensions - try: - _valid_extensions = set(val.split(',')) - except ValueError: - PrintUsage('Extensions must be comma seperated list.') + ProcessExtensionsOption(val) + elif opt == '--headers': + ProcessHppHeadersOption(val) + elif opt == '--recursive': + recursive = True if not filenames: PrintUsage('No files were specified.') + if recursive: + filenames = _ExpandDirectories(filenames) + + if _excludes: + filenames = _FilterExcludedFiles(filenames) + _SetOutputFormat(output_format) + _SetQuiet(quiet) _SetVerboseLevel(verbosity) _SetFilters(filters) _SetCountingStyle(counting_style) return filenames +def _ExpandDirectories(filenames): + """Searches a list of filenames and replaces directories in the list with + all files descending from those directories. Files with extensions not in + the valid extensions list are excluded. -def main(): - filenames = ParseArguments(sys.argv[1:]) - - # Change stderr to write with replacement characters so we don't die - # if we try to print something containing non-ASCII characters. - sys.stderr = codecs.StreamReaderWriter(sys.stderr, - codecs.getreader('utf8'), - codecs.getwriter('utf8'), - 'replace') + Args: + filenames: A list of files or directories - _cpplint_state.ResetErrorCounts() + Returns: + A list of all files that are members of filenames or descended from a + directory in filenames + """ + expanded = set() for filename in filenames: - ProcessFile(filename, _cpplint_state.verbose_level) - _cpplint_state.PrintErrorCounts() + if not os.path.isdir(filename): + expanded.add(filename) + continue + + for root, _, files in os.walk(filename): + for loopfile in files: + fullname = os.path.join(root, loopfile) + if fullname.startswith('.' + os.path.sep): + fullname = fullname[len('.' + os.path.sep):] + expanded.add(fullname) + + filtered = [] + for filename in expanded: + if os.path.splitext(filename)[1][1:] in GetAllExtensions(): + filtered.append(filename) + return filtered + +def _FilterExcludedFiles(fnames): + """Filters out files listed in the --exclude command line switch. File paths + in the switch are evaluated relative to the current working directory + """ + exclude_paths = [os.path.abspath(f) for f in _excludes] + # because globbing does not work recursively, exclude all subpath of all excluded entries + return [f for f in fnames + if not any(e for e in exclude_paths + if _IsParentOrSame(e, os.path.abspath(f)))] + +def _IsParentOrSame(parent, child): + """Return true if child is subdirectory of parent. + Assumes both paths are absolute and don't contain symlinks. + """ + parent = os.path.normpath(parent) + child = os.path.normpath(child) + if parent == child: + return True + + prefix = os.path.commonprefix([parent, child]) + if prefix != parent: + return False + # Note: os.path.commonprefix operates on character basis, so + # take extra care of situations like '/foo/ba' and '/foo/bar/baz' + child_suffix = child[len(prefix):] + child_suffix = child_suffix.lstrip(os.sep) + return child == os.path.join(prefix, child_suffix) + +def main(): + filenames = ParseArguments(sys.argv[1:]) + backup_err = sys.stderr + try: + # Change stderr to write with replacement characters so we don't die + # if we try to print something containing non-ASCII characters. + sys.stderr = codecs.StreamReader(sys.stderr, 'replace') + + _cpplint_state.ResetErrorCounts() + for filename in filenames: + ProcessFile(filename, _cpplint_state.verbose_level) + # If --quiet is passed, suppress printing error count unless there are errors. + if not _cpplint_state.quiet or _cpplint_state.error_count > 0: + _cpplint_state.PrintErrorCounts() + + if _cpplint_state.output_format == 'junit': + sys.stderr.write(_cpplint_state.FormatJUnitXML()) + + finally: + sys.stderr = backup_err sys.exit(_cpplint_state.error_count > 0) diff --git a/lib/cpplint_1.4.5/cpplint_clitest.py b/lib/cpplint_1.4.5/cpplint_clitest.py new file mode 100755 index 00000000000..1385a4075e5 --- /dev/null +++ b/lib/cpplint_1.4.5/cpplint_clitest.py @@ -0,0 +1,206 @@ +#!/usr/bin/env python +# -*- coding: utf-8; -*- +# +# Copyright (c) 2009 Google Inc. All rights reserved. +# +# 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. + +"""Command Line interface integration test for cpplint.py.""" + +import os +import sys +import subprocess +import unittest +import shutil +import tempfile + +BASE_CMD = sys.executable + ' ' + os.path.abspath('./cpplint.py ') + +def RunShellCommand(cmd, cwd='.'): + """ + executes a command + :param cmd: A string to execute. + :param cwd: from which folder to run. + """ + + stdout_target = subprocess.PIPE + stderr_target = subprocess.PIPE + + proc = subprocess.Popen(cmd, + shell=True, + cwd=cwd, + stdout=stdout_target, + stderr=stderr_target) + out, err = proc.communicate() + # print(err) # to get the output at time of test + return (proc.returncode, out, err) + + +class UsageTest(unittest.TestCase): + + def testHelp(self): + (status, out, err) = RunShellCommand(BASE_CMD + ' --help') + self.assertEqual(0, status) + self.assertEqual(b'', out) + self.assertTrue(err.startswith(b'\nSyntax: cpplint')) + +class TemporaryFolderClassSetup(object): + """ + Regression tests: The test starts a filetreewalker scanning for files name *.def + Such files are expected to have as first line the argument + to a cpplint invocation from within the same directory, as second line the + expected status code, and all other lines the expected systemerr output (two blank + lines at end). + """ + + @classmethod + def setUpClass(cls): + """setup tmp folder for testing with samples and custom additions by subclasses""" + try: + cls._root = tempfile.mkdtemp() + shutil.copytree('samples', os.path.join(cls._root, 'samples')) + cls.prepare_directory(cls._root) + except Exception as e: + try: + cls.tearDownClass() + except Exception as e2: + pass + raise + + @classmethod + def tearDownClass(cls): + if (cls._root): + # pass + shutil.rmtree(cls._root) + + @classmethod + def prepare_directory(cls, root): + """Override in subclass to manipulate temporary samples root folder before tests""" + pass + + def get_extra_command_args(self, cwd): + """Override in subclass to add arguments to command""" + return '' + + def checkAllInFolder(self, foldername, expectedDefs): + # uncomment to show complete diff + # self.maxDiff = None + count = 0 + for dirpath, _, fnames in os.walk(foldername): + for f in fnames: + if f.endswith('.def'): + count += 1 + self._checkDef(os.path.join(dirpath, f)) + self.assertEqual(count, expectedDefs) + + def _checkDef(self, path): + """runs command and compares to expected output from def file""" + # self.maxDiff = None # to see full diff + with open(path, 'rb') as filehandle: + datalines = filehandle.readlines() + stdoutLines = int(datalines[2]) + self._runAndCheck(os.path.dirname(path), + datalines[0].decode('utf8').strip(), + int(datalines[1]), + [line.decode('utf8').strip() for line in datalines[3:3 + stdoutLines]], + [line.decode('utf8').strip() for line in datalines[3 + stdoutLines:]]) + + def _runAndCheck(self, rel_cwd, args, expectedStatus, expectedOut, expectedErr): + cmd = BASE_CMD + self.get_extra_command_args(rel_cwd) + args + cwd = os.path.join(self._root, rel_cwd) + # command to reproduce, do not forget first two lines have special meaning + print("\ncd " + cwd + " && " + cmd + " 2> ") + (status, out, err) = RunShellCommand(cmd, cwd) + try: + self.assertEqual(expectedStatus, status, 'bad command status %s' % status) + self.assertEqual(expectedErr, err.decode('utf8').split('\n')) + self.assertEqual(expectedOut, out.decode('utf8').split('\n')) + except AssertionError as e: + e.args += ('Failed check in %s for command: %s' % (cwd, cmd),) + raise e + + +class NoRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase): + """runs in a temporary folder (under /tmp in linux) without any .git/.hg/.svn file""" + + def get_extra_command_args(self, cwd): + return (' --repository %s ' % self._root) + + def testChromiumSample(self): + self.checkAllInFolder('./samples/chromium-sample', 1) + + def testVlcSample(self): + self.checkAllInFolder('./samples/vlc-sample', 1) + + def testSillySample(self): + self.checkAllInFolder('./samples/silly-sample', 2) + + def testBoostSample(self): + self.checkAllInFolder('./samples/boost-sample', 3) + + def testProtobufSample(self): + self.checkAllInFolder('./samples/protobuf-sample', 1) + + def testCodeliteSample(self): + self.checkAllInFolder('./samples/codelite-sample', 1) + + +class GitRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase): + """runs in a temporary folder with .git file""" + + @classmethod + def prepare_directory(cls, root): + with open(os.path.join(root, '.git'), 'a'): + pass + + def testCodeliteSample(self): + self.checkAllInFolder('./samples/codelite-sample', 1) + +class MercurialRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase): + """runs in a temporary folder with .hg file""" + + @classmethod + def prepare_directory(cls, root): + with open(os.path.join(root, '.hg'), 'a'): + pass + + def testCodeliteSample(self): + self.checkAllInFolder('./samples/codelite-sample', 1) + +class SvnRepoSignatureTests(TemporaryFolderClassSetup, unittest.TestCase): + """runs in a temporary folder with .svn file""" + + @classmethod + def prepare_directory(cls, root): + with open(os.path.join(root, '.svn'), 'a'): + pass + + def testCodeliteSample(self): + self.checkAllInFolder('./samples/codelite-sample', 1) + +if __name__ == '__main__': + unittest.main() diff --git a/lib/cpplint_4.45/cpplint_unittest.py b/lib/cpplint_1.4.5/cpplint_unittest.py similarity index 80% rename from lib/cpplint_4.45/cpplint_unittest.py rename to lib/cpplint_1.4.5/cpplint_unittest.py index aaa3b24c67e..f58884ee9ad 100755 --- a/lib/cpplint_4.45/cpplint_unittest.py +++ b/lib/cpplint_1.4.5/cpplint_unittest.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8; -*- # # Copyright (c) 2009 Google Inc. All rights reserved. @@ -37,11 +37,44 @@ import os import random import re +import shutil +import subprocess import sys +import tempfile import unittest +import pytest import cpplint +try: + xrange # Python 2 +except NameError: + # -- pylint: disable=redefined-builtin + xrange = range # Python 3 + +try: + unicode +except NameError: + # -- pylint: disable=redefined-builtin + basestring = unicode = str + +try: + long(2) +except NameError: + # -- pylint: disable=redefined-builtin + long = int + +def unicode_escape_decode(x): + if sys.version_info < (3,): + return codecs.unicode_escape_decode(x)[0] + else: + return x + +def codecs_latin_encode(x): + if sys.version_info < (3,): + return x + else: + return codecs.latin_1_encode(x)[0] # This class works as an error collector and replaces cpplint.Error # function for the unit tests. We also verify each category we see @@ -102,7 +135,7 @@ class MockIo(object): def __init__(self, mock_file): self.mock_file = mock_file - def open(self, # pylint: disable-msg=C6409 + def open(self, # pylint: disable=C6409 unused_filename, unused_mode, unused_encoding, _): return self.mock_file @@ -234,8 +267,12 @@ def TestIncludeWhatYouUse(self, code, expected_message): self.PerformIncludeWhatYouUse(code)) def TestBlankLinesCheck(self, lines, start_errors, end_errors): + for extension in ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']: + self.doTestBlankLinesCheck(lines, start_errors, end_errors, extension) + + def doTestBlankLinesCheck(self, lines, start_errors, end_errors, extension): error_collector = ErrorCollector(self.assert_) - cpplint.ProcessFileData('foo.cc', 'cc', lines, error_collector) + cpplint.ProcessFileData('foo.' + extension, extension, lines, error_collector) self.assertEquals( start_errors, error_collector.Results().count( @@ -290,6 +327,14 @@ def testNameSpaceIndentationNoError(self): results = self.GetNamespaceResults(lines) self.assertEquals(results, '') + def testWhitespaceBeforeNamespace(self): + lines = [' namespace Test {', + ' void foo() { }', + ' } // namespace Test'] + + results = self.GetNamespaceResults(lines) + self.assertEquals(results, '') + def testFalsePositivesNoError(self): lines = ['namespace Test {', 'struct OuterClass {', @@ -305,8 +350,11 @@ def testFalsePositivesNoError(self): # Test get line width. def testGetLineWidth(self): self.assertEquals(0, cpplint.GetLineWidth('')) - self.assertEquals(10, cpplint.GetLineWidth(u'x' * 10)) + self.assertEquals(10, cpplint.GetLineWidth(unicode('x') * 10)) + self.assertEquals(16, cpplint.GetLineWidth(unicode_escape_decode('\u90fd|\u9053|\u5e9c|\u770c|\u652f\u5e81'))) self.assertEquals(16, cpplint.GetLineWidth(u'都|道|府|県|支庁')) + self.assertEquals(5 + 13 + 9, cpplint.GetLineWidth( + u'd𝐱/dt' + u'f : t ⨯ 𝐱 → ℝ' + u't ⨯ 𝐱 → ℝ')) def testGetTextInside(self): self.assertEquals('', cpplint._GetTextInside('fun()', r'fun\(')) @@ -362,13 +410,23 @@ def testLineLengthCheck(self): '// Hello', '') self.TestLint( - '// ' + 'x' * 80, + '// x' + ' x' * 40, 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') self.TestLint( - '// ' + 'x' * 100, - 'Lines should very rarely be longer than 100 characters' - ' [whitespace/line_length] [4]') + '// x' + ' x' * 50, + 'Lines should be <= 80 characters long' + ' [whitespace/line_length] [2]') + self.TestLint( + '// //some/path/to/f' + ('i' * 100) + 'le', + '') + self.TestLint( + '// //some/path/to/f' + ('i' * 100) + 'le', + '') + self.TestLint( + '// //some/path/to/f' + ('i' * 50) + 'le and some comments', + 'Lines should be <= 80 characters long' + ' [whitespace/line_length] [2]') self.TestLint( '// http://g' + ('o' * 100) + 'gle.com/', '') @@ -405,6 +463,15 @@ def testLineLengthCheck(self): 'static const char kL' + ('o' * 50) + 'ngIdentifier[] = R"()";\n', 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') + self.TestLint( + ' /// @copydoc ' + ('o' * (cpplint._line_length * 2)), + '') + self.TestLint( + ' /// @copydetails ' + ('o' * (cpplint._line_length * 2)), + '') + self.TestLint( + ' /// @copybrief ' + ('o' * (cpplint._line_length * 2)), + '') # Test error suppression annotations. def testErrorSuppression(self): @@ -445,6 +512,79 @@ def testErrorSuppression(self): ''], error_collector) self.assertEquals('', error_collector.Results()) + # LINT_C_FILE silences cast warnings for entire file. + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('test.h', 'h', + ['// Copyright 2014 Your Company.', + '// NOLINT(build/header_guard)', + 'int64 a = (uint64) 65;', + '// LINT_C_FILE', + ''], + error_collector) + self.assertEquals('', error_collector.Results()) + # Vim modes silence cast warnings for entire file. + for modeline in ['vi:filetype=c', + 'vi:sw=8 filetype=c', + 'vi:sw=8 filetype=c ts=8', + 'vi: filetype=c', + 'vi: sw=8 filetype=c', + 'vi: sw=8 filetype=c ts=8', + 'vim:filetype=c', + 'vim:sw=8 filetype=c', + 'vim:sw=8 filetype=c ts=8', + 'vim: filetype=c', + 'vim: sw=8 filetype=c', + 'vim: sw=8 filetype=c ts=8', + 'vim: set filetype=c:', + 'vim: set sw=8 filetype=c:', + 'vim: set sw=8 filetype=c ts=8:', + 'vim: set filetype=c :', + 'vim: set sw=8 filetype=c :', + 'vim: set sw=8 filetype=c ts=8 :', + 'vim: se filetype=c:', + 'vim: se sw=8 filetype=c:', + 'vim: se sw=8 filetype=c ts=8:', + 'vim: se filetype=c :', + 'vim: se sw=8 filetype=c :', + 'vim: se sw=8 filetype=c ts=8 :']: + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('test.h', 'h', + ['// Copyright 2014 Your Company.', + '// NOLINT(build/header_guard)', + 'int64 a = (uint64) 65;', + '/* Prevent warnings about the modeline', + modeline, + '*/', + ''], + error_collector) + self.assertEquals('', error_collector.Results()) + # LINT_KERNEL_FILE silences whitespace/tab warnings for entire file. + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('test.h', 'h', + ['// Copyright 2014 Your Company.', + '// NOLINT(build/header_guard)', + 'struct test {', + '\tint member;', + '};', + '// LINT_KERNEL_FILE', + ''], + error_collector) + self.assertEquals('', error_collector.Results()) + # NOLINT, NOLINTNEXTLINE silences the readability/braces warning for "};". + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('test.cc', 'cc', + ['// Copyright 2014 Your Company.', + 'for (int i = 0; i != 100; ++i) {', + ' std::cout << i << std::endl;', + '}; // NOLINT', + 'for (int i = 0; i != 100; ++i) {', + ' std::cout << i << std::endl;', + '// NOLINTNEXTLINE', + '};', + '// LINT_KERNEL_FILE', + ''], + error_collector) + self.assertEquals('', error_collector.Results()) # Test Variable Declarations. def testVariableDeclarations(self): @@ -509,14 +649,55 @@ def testCStyleCast(self): self.TestLint('[](int/*unused*/) -> bool {', '') self.TestLint('[](int /*unused*/) -> bool {', '') self.TestLint('auto f = [](MyStruct* /*unused*/)->int {', '') - self.TestLint( - '[](int) -> bool {', - 'All parameters should be named in a function' - ' [readability/function] [3]') - self.TestLint( - 'auto f = [](MyStruct*)->int {', - 'All parameters should be named in a function' - ' [readability/function] [3]') + self.TestLint('[](int) -> bool {', '') + self.TestLint('auto f = [](MyStruct*)->int {', '') + + # Cast with brace initializers + self.TestLint('int64_t{4096} * 1000 * 1000', '') + self.TestLint('size_t{4096} * 1000 * 1000', '') + self.TestLint('uint_fast16_t{4096} * 1000 * 1000', '') + + # Brace initializer with templated type + self.TestMultiLineLint( + """ + template + void Function(int arg1, + int arg2) { + variable &= ~Type1{0} - 1; + }""", + '') + self.TestMultiLineLint( + """ + template + class Class { + void Function() { + variable &= ~Type{0} - 1; + } + };""", + '') + self.TestMultiLineLint( + """ + template + class Class { + void Function() { + variable &= ~Type{0} - 1; + } + };""", + '') + self.TestMultiLineLint( + """ + namespace { + template + class Class { + void Function() { + if (block) { + variable &= ~Type{0} - 1; + } + } + }; + }""", + '') # Test taking address of casts (runtime/casting) def testRuntimeCasting(self): @@ -559,6 +740,10 @@ def testRuntimeSelfinit(self): 'Foo::Foo(Bar r, Bel l) : r_(r_), l_(l_) { }', 'You seem to be initializing a member variable with itself.' ' [runtime/init] [4]') + self.TestLint( + 'Foo::Foo(Bar r, Bel l) : r_(CHECK_NOTNULL(r_)) { }', + 'You seem to be initializing a member variable with itself.' + ' [runtime/init] [4]') self.TestLint( 'Foo::Foo(Bar r, Bel l) : r_(r), l_(l) { }', '') @@ -568,14 +753,12 @@ def testRuntimeSelfinit(self): # Test for unnamed arguments in a method. def testCheckForUnnamedParams(self): - message = ('All parameters should be named in a function' - ' [readability/function] [3]') - self.TestLint('virtual void Func(int*) const;', message) - self.TestLint('virtual void Func(int*);', message) - self.TestLint('void Method(char*) {', message) - self.TestLint('void Method(char*);', message) - self.TestLint('static void operator delete[](void*) throw();', message) - self.TestLint('int Method(int);', message) + self.TestLint('virtual void Func(int*) const;', '') + self.TestLint('virtual void Func(int*);', '') + self.TestLint('void Method(char*) {', '') + self.TestLint('void Method(char*);', '') + self.TestLint('static void operator delete[](void*) throw();', '') + self.TestLint('int Method(int);', '') self.TestLint('virtual void Func(int* p);', '') self.TestLint('void operator delete(void* x) throw();', '') @@ -627,6 +810,7 @@ def testDeprecatedCast(self): self.TestLint('operator bool();', '') # Conversion operator self.TestLint('new int64(123);', '') # "new" operator on basic type self.TestLint('new int64(123);', '') # "new" operator on basic type + self.TestLint('new const int(42);', '') # "new" on const-qualified type self.TestLint('using a = bool(int arg);', '') # C++11 alias-declaration self.TestLint('x = bit_cast(y);', '') # array of array self.TestLint('void F(const char(&src)[N]);', '') # array of references @@ -745,11 +929,13 @@ def testTypedefForPointerToFunction(self): def testIncludeWhatYouUseNoImplementationFiles(self): code = 'std::vector foo;' - self.assertEquals('Add #include for vector<>' - ' [build/include_what_you_use] [4]', - self.PerformIncludeWhatYouUse(code, 'foo.h')) - self.assertEquals('', - self.PerformIncludeWhatYouUse(code, 'foo.cc')) + for extension in ['h', 'hpp', 'hxx', 'h++', 'cuh']: + self.assertEquals('Add #include for vector<>' + ' [build/include_what_you_use] [4]', + self.PerformIncludeWhatYouUse(code, 'foo.' + extension)) + for extension in ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']: + self.assertEquals('', + self.PerformIncludeWhatYouUse(code, 'foo.' + extension)) def testIncludeWhatYouUse(self): self.TestIncludeWhatYouUse( @@ -775,6 +961,12 @@ def testIncludeWhatYouUse(self): """, 'Add #include for pair<>' ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include + auto foo = std::make_pair(1, 2); + """, + 'Add #include for make_pair' + ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include std::pair foo; @@ -814,6 +1006,11 @@ def testIncludeWhatYouUse(self): """, 'Add #include for hash_map<>' ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include "base/containers/hash_tables.h" + base::hash_map foobar; + """, + '') self.TestIncludeWhatYouUse( """#include "base/foobar.h" bool foobar = std::less(0,1); @@ -838,7 +1035,7 @@ def testIncludeWhatYouUse(self): """#include "base/foobar.h" bool foobar = swap(0,1); """, - 'Add #include for swap [build/include_what_you_use] [4]') + 'Add #include for swap [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include "base/foobar.h" bool foobar = transform(a.begin(), a.end(), b.start(), Foo); @@ -862,6 +1059,18 @@ def testIncludeWhatYouUse(self): """, 'Add #include for multimap<>' ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include + void a(const std::unordered_map &foobar); + """, + 'Add #include for unordered_map<>' + ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include + void a(const std::unordered_set &foobar); + """, + 'Add #include for unordered_set<>' + ' [build/include_what_you_use] [4]') self.TestIncludeWhatYouUse( """#include void a(const std::priority_queue &foobar); @@ -885,6 +1094,60 @@ def testIncludeWhatYouUse(self): int i = numeric_limits::max() """, '') + self.TestIncludeWhatYouUse( + """#include + std::unique_ptr x; + """, + 'Add #include for unique_ptr<>' + ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include + auto x = std::make_unique(0); + """, + 'Add #include for make_unique<>' + ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include + vector foo(vector x) { return std::move(x); } + """, + 'Add #include for move' + ' [build/include_what_you_use] [4]') + self.TestIncludeWhatYouUse( + """#include + int a, b; + std::swap(a, b); + """, + 'Add #include for swap' + ' [build/include_what_you_use] [4]') + # False positive for std::set + self.TestIncludeWhatYouUse( + """ + #include + struct Foo { + template + void set(const std::string& name, const T& value); + }; + Foo bar; + Foo* pbar = &bar; + bar.set("int", 5); + pbar->set("bool", false);""", + '') + # False positive for std::map + self.TestIncludeWhatYouUse( + """ + template + struct Foo { + T t; + }; + template + Foo map(T t) { + return Foo{ t }; + } + struct Bar { + }; + auto res = map(); + """, + '') # Test the UpdateIncludeState code path. mock_header_contents = ['#include "blah/foo.h"', '#include "blah/bar.h"'] @@ -934,7 +1197,13 @@ def testFilesBelongToSameModule(self): f = cpplint.FilesBelongToSameModule self.assertEquals((True, ''), f('a.cc', 'a.h')) self.assertEquals((True, ''), f('base/google.cc', 'base/google.h')) + self.assertEquals((True, ''), f('base/google_test.c', 'base/google.h')) self.assertEquals((True, ''), f('base/google_test.cc', 'base/google.h')) + self.assertEquals((True, ''), f('base/google_test.cc', 'base/google.hpp')) + self.assertEquals((True, ''), f('base/google_test.cxx', 'base/google.hxx')) + self.assertEquals((True, ''), f('base/google_test.cpp', 'base/google.hpp')) + self.assertEquals((True, ''), f('base/google_test.c++', 'base/google.h++')) + self.assertEquals((True, ''), f('base/google_test.cu', 'base/google.cuh')) self.assertEquals((True, ''), f('base/google_unittest.cc', 'base/google.h')) self.assertEquals((True, ''), @@ -974,6 +1243,22 @@ def testCleanseLine(self): cpplint.CleanseComments('f(a, /**/b/**/, c);')) def testRawStrings(self): + self.TestMultiLineLint( + """ + int main() { + struct A { + A(std::string s, A&& a); + }; + }""", + '') + + self.TestMultiLineLint( + """ + template > class unique_ptr { + public: + unique_ptr(unique_ptr&& u) noexcept; + };""", + '') self.TestMultiLineLint( """ void Func() { @@ -1075,16 +1360,17 @@ def testMultilineStrings(self): 'Use C++11 raw strings or concatenation instead.' ' [readability/multiline_string] [5]') - file_path = 'mydir/foo.cc' + for extension in ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']: + file_path = 'mydir/foo.' + extension - error_collector = ErrorCollector(self.assert_) - cpplint.ProcessFileData(file_path, 'cc', - ['const char* str = "This is a\\', - ' multiline string.";'], - error_collector) - self.assertEquals( - 2, # One per line. - error_collector.ResultList().count(multiline_string_error_message)) + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData(file_path, extension, + ['const char* str = "This is a\\', + ' multiline string.";'], + error_collector) + self.assertEquals( + 2, # One per line. + error_collector.ResultList().count(multiline_string_error_message)) # Test non-explicit single-argument constructors def testExplicitSingleArgumentConstructors(self): @@ -1133,6 +1419,80 @@ class Foo { };""", 'Single-parameter constructors should be marked explicit.' ' [runtime/explicit] [5]') + # missing explicit for constexpr constructors is bad as well + self.TestMultiLineLint( + """ + class Foo { + constexpr Foo(int f); + };""", + 'Single-parameter constructors should be marked explicit.' + ' [runtime/explicit] [5]') + # missing explicit for constexpr+inline constructors is bad as well + self.TestMultiLineLint( + """ + class Foo { + constexpr inline Foo(int f); + };""", + 'Single-parameter constructors should be marked explicit.' + ' [runtime/explicit] [5]') + self.TestMultiLineLint( + """ + class Foo { + inline constexpr Foo(int f); + };""", + 'Single-parameter constructors should be marked explicit.' + ' [runtime/explicit] [5]') + # explicit with inline is accepted + self.TestMultiLineLint( + """ + class Foo { + inline explicit Foo(int f); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + explicit inline Foo(int f); + };""", + '') + # explicit with constexpr is accepted + self.TestMultiLineLint( + """ + class Foo { + constexpr explicit Foo(int f); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + explicit constexpr Foo(int f); + };""", + '') + # explicit with constexpr+inline is accepted + self.TestMultiLineLint( + """ + class Foo { + inline constexpr explicit Foo(int f); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + explicit inline constexpr Foo(int f); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + constexpr inline explicit Foo(int f); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + explicit constexpr inline Foo(int f); + };""", + '') # structs are caught as well. self.TestMultiLineLint( """ @@ -1199,16 +1559,13 @@ class Foo { };""", 'Zero-parameter constructors should not be marked explicit.' ' [runtime/explicit] [5]') - # Warn explicit multi-argument constructors at lowest severity + # No warning for multi-parameter constructors self.TestMultiLineLint( """ class Foo { explicit Foo(int f, int g); };""", - 'Constructors that require multiple arguments ' - 'should not be marked explicit. [runtime/explicit] [0]') - # but explicit multi-argument constructors with only one non-default - # argument are OK + '') self.TestMultiLineLint( """ class Foo { @@ -1312,6 +1669,24 @@ class Foo { Foo(const Foo&); };""", '') + self.TestMultiLineLint( + """ + class Foo { + Foo(volatile Foo&); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + Foo(volatile const Foo&); + };""", + '') + self.TestMultiLineLint( + """ + class Foo { + Foo(const volatile Foo&); + };""", + '') self.TestMultiLineLint( """ class Foo { @@ -1338,6 +1713,47 @@ class Foo { Foo(std::initializer_list &arg) {} };""", '') + # Special case for variadic arguments + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('foo.cc', 'cc', + ['class Foo {', + ' template', + ' explicit Foo(const int arg, Args&&... args) {}', + '};'], + error_collector) + self.assertEquals(0, error_collector.ResultList().count( + 'Constructors that require multiple arguments should not be marked ' + 'explicit. [runtime/explicit] [0]')) + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('foo.cc', 'cc', + ['class Foo {', + ' template', + ' explicit Foo(Args&&... args) {}', + '};'], + error_collector) + self.assertEquals(0, error_collector.ResultList().count( + 'Constructors that require multiple arguments should not be marked ' + 'explicit. [runtime/explicit] [0]')) + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('foo.cc', 'cc', + ['class Foo {', + ' template', + ' Foo(const int arg, Args&&... args) {}', + '};'], + error_collector) + self.assertEquals(1, error_collector.ResultList().count( + 'Constructors callable with one argument should be marked explicit.' + ' [runtime/explicit] [5]')) + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('foo.cc', 'cc', + ['class Foo {', + ' template', + ' Foo(Args&&... args) {}', + '};'], + error_collector) + self.assertEquals(1, error_collector.ResultList().count( + 'Constructors callable with one argument should be marked explicit.' + ' [runtime/explicit] [5]')) # Anything goes inside an assembly block error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', @@ -1718,74 +2134,6 @@ def testDisallowMacrosAtEnd(self): error_collector) self.assertEquals('', error_collector.Results()) - # DISALLOW* macros should be in the private: section. - def testMisplacedDisallowMacros(self): - for macro_name in ( - 'DISALLOW_COPY_AND_ASSIGN', - 'DISALLOW_IMPLICIT_CONSTRUCTORS'): - self.TestMultiLineLint( - """ - class A {' - public: - %s(A); - };""" % macro_name, - ('%s must be in the private: section' % macro_name) + - ' [readability/constructors] [3]') - - self.TestMultiLineLint( - """ - struct B {' - %s(B); - };""" % macro_name, - ('%s must be in the private: section' % macro_name) + - ' [readability/constructors] [3]') - - self.TestMultiLineLint( - """ - class Outer1 {' - private: - struct Inner1 { - %s(Inner1); - }; - %s(Outer1); - };""" % (macro_name, macro_name), - ('%s must be in the private: section' % macro_name) + - ' [readability/constructors] [3]') - - self.TestMultiLineLint( - """ - class Outer2 {' - private: - class Inner2 { - %s(Inner2); - }; - %s(Outer2); - };""" % (macro_name, macro_name), - '') - # Extra checks to make sure that nested classes are handled - # correctly. Use different macros for inner and outer classes so - # that we can tell the error messages apart. - self.TestMultiLineLint( - """ - class Outer3 { - struct Inner3 { - DISALLOW_COPY_AND_ASSIGN(Inner3); - }; - DISALLOW_IMPLICIT_CONSTRUCTORS(Outer3); - };""", - ('DISALLOW_COPY_AND_ASSIGN must be in the private: section' - ' [readability/constructors] [3]')) - self.TestMultiLineLint( - """ - struct Outer4 { - class Inner4 { - DISALLOW_COPY_AND_ASSIGN(Inner4); - }; - DISALLOW_IMPLICIT_CONSTRUCTORS(Outer4); - };""", - ('DISALLOW_IMPLICIT_CONSTRUCTORS must be in the private: section' - ' [readability/constructors] [3]')) - # Brace usage def testBraces(self): # Braces shouldn't be followed by a ; unless they're defining a struct @@ -1863,18 +2211,6 @@ def testCheckCheck(self): 'EXPECT_TRUE(+42 >= x);', 'Consider using EXPECT_GE instead of EXPECT_TRUE(a >= b)' ' [readability/check] [2]') - self.TestLint( - 'EXPECT_TRUE_M(-42 > x);', - 'Consider using EXPECT_GT_M instead of EXPECT_TRUE_M(a > b)' - ' [readability/check] [2]') - self.TestLint( - 'EXPECT_TRUE_M(42U <= x);', - 'Consider using EXPECT_LE_M instead of EXPECT_TRUE_M(a <= b)' - ' [readability/check] [2]') - self.TestLint( - 'EXPECT_TRUE_M(42L < x);', - 'Consider using EXPECT_LT_M instead of EXPECT_TRUE_M(a < b)' - ' [readability/check] [2]') self.TestLint( 'EXPECT_FALSE(x == 42);', @@ -1896,10 +2232,6 @@ def testCheckCheck(self): 'ASSERT_FALSE(x <= 42);', 'Consider using ASSERT_GT instead of ASSERT_FALSE(a <= b)' ' [readability/check] [2]') - self.TestLint( - 'ASSERT_FALSE_M(x < 42);', - 'Consider using ASSERT_GE_M instead of ASSERT_FALSE_M(a < b)' - ' [readability/check] [2]') self.TestLint('CHECK(x<42);', ['Missing spaces around <' @@ -2033,6 +2365,10 @@ def testNonConstReference(self): self.TestLint('stream& operator>>(stream& s, Foo& f);', '') self.TestLint('stream& operator<<(stream& s, Foo& f);', '') self.TestLint('void swap(Bar& a, Bar& b);', '') + self.TestLint('ostream& LogFunc(ostream& s);', '') + self.TestLint('ostringstream& LogFunc(ostringstream& s);', '') + self.TestLint('istream& LogFunc(istream& s);', '') + self.TestLint('istringstream& LogFunc(istringstream& s);', '') # Returning a non-const reference from a function is OK. self.TestLint('int& g();', '') # Passing a const reference to a struct (using the struct keyword) is OK. @@ -2282,6 +2618,9 @@ def testSpacingForFncall(self): self.TestLint('((a+b))', '') self.TestLint('foo (foo)', 'Extra space before ( in function call' ' [whitespace/parens] [4]') + # asm volatile () may have a space, as it isn't a function call. + self.TestLint('asm volatile ("")', '') + self.TestLint('__asm__ __volatile__ ("")', '') self.TestLint('} catch (const Foo& ex) {', '') self.TestLint('case (42):', '') self.TestLint('typedef foo (*foo)(foo)', '') @@ -2319,9 +2658,20 @@ def testSpacingBeforeBraces(self): self.TestLint('for {', '') self.TestLint('EXPECT_DEBUG_DEATH({', '') self.TestLint('std::is_convertible{}', '') + self.TestLint('blah{32}', 'Missing space before {' + ' [whitespace/braces] [5]') + self.TestLint('int8_t{3}', '') + self.TestLint('int16_t{3}', '') + self.TestLint('int32_t{3}', '') + self.TestLint('uint64_t{12345}', '') + self.TestLint('constexpr int64_t kBatchGapMicros =' + ' int64_t{7} * 24 * 3600 * 1000000; // 1 wk.', '') + self.TestLint('MoveOnly(int i1, int i2) : ip1{new int{i1}}, ' + 'ip2{new int{i2}} {}', + '') def testSemiColonAfterBraces(self): - self.TestLint('if (cond) {};', + self.TestLint('if (cond) { func(); };', 'You don\'t need a ; after a } [readability/braces] [4]') self.TestLint('void Func() {};', 'You don\'t need a ; after a } [readability/braces] [4]') @@ -2337,8 +2687,11 @@ def testSemiColonAfterBraces(self): self.TestLint('class X : public Y {};', '') self.TestLint('class X : public MACRO() {};', '') + self.TestLint('class X : public decltype(expr) {};', '') self.TestLint('DEFINE_FACADE(PCQueue::Watcher, PCQueue) {};', '') self.TestLint('VCLASS(XfaTest, XfaContextTest) {};', '') + self.TestLint('class STUBBY_CLASS(H, E) {};', '') + self.TestLint('class STUBBY2_CLASS(H, E) {};', '') self.TestLint('TEST(TestCase, TestName) {};', 'You don\'t need a ; after a } [readability/braces] [4]') self.TestLint('TEST_F(TestCase, TestName) {};', @@ -2365,19 +2718,6 @@ def testLambda(self): '};\n', '') - for lambda_with_default_capture in ('void f() { [=]{}; }', - 'void f() { [=](int i) {}; }', - 'void f() { [=, &x]{}; }', - 'void f() { [&]{}; }', - 'void f() { [ & ]{}; }', - 'void f() { [&, y]{}; }'): - self.TestLint(lambda_with_default_capture, - 'Default lambda captures are an unapproved C++ feature. ' - '[build/c++11] [4]') - - # "[&...]" isn't necessarily a default capture, though "[=...]" always is. - self.TestLint('void f() { [&variable]{}; }', '') - # Avoid false positives with operator[] self.TestLint('table_to_children[&*table].push_back(dependent);', '') @@ -2412,13 +2752,28 @@ def testBraceInitializerList(self): ' }\n' '};\n', '') self.TestMultiLineLint('if (true) {\n' - ' if (false){}\n' + ' if (false){ func(); }\n' '}\n', 'Missing space before { [whitespace/braces] [5]') self.TestMultiLineLint('MyClass::MyClass()\n' ' : initializer_{\n' ' Func()} {\n' '}\n', '') + self.TestLint('const pair kCL' + + ('o' * 41) + 'gStr[] = {\n', + 'Lines should be <= 80 characters long' + ' [whitespace/line_length] [2]') + self.TestMultiLineLint('const pair kCL' + + ('o' * 40) + 'ngStr[] =\n' + ' {\n' + ' {"gooooo", "oooogle"},\n' + '};\n', '') + self.TestMultiLineLint('const pair kCL' + + ('o' * 39) + 'ngStr[] =\n' + ' {\n' + ' {"gooooo", "oooogle"},\n' + '};\n', '{ should almost always be at the end of ' + 'the previous line [whitespace/braces] [4]') def testSpacingAroundElse(self): self.TestLint('}else {', 'Missing space before else' @@ -2455,6 +2810,7 @@ def testSpacingForBinaryOps(self): 'Missing spaces around << [whitespace/operators] [3]') self.TestLint('a<>b', 'Missing spaces around >> [whitespace/operators] [3]') @@ -2481,141 +2837,6 @@ def testSpacingForBinaryOps(self): self.TestLint('using Vector3::operator==;', '') self.TestLint('using Vector3::operator!=;', '') - def testRvalueReference(self): - space_error = 'Missing spaces around && [whitespace/operators] [3]' - rvalue_error = ('RValue references are an unapproved C++ feature.' - ' [build/c++11] [3]') - - # Places where lack of space are allowed - self.TestLint('DEFINE_BINARY_OPERATOR(&&)', '') - self.TestLint('bool operator&&(A b) {}', '') - self.TestLint('bool operator&&(A b) {', '') - self.TestLint('bool operator&&(A b);', '') - - # Assignment expressions - self.TestLint('a = b && c;', '') - self.TestLint('a = b&& c;', space_error) - self.TestLint('a = b &&c;', space_error) - self.TestLint('a = (b&& c);', space_error) - self.TestLint('a = (b &&c);', space_error) - self.TestLint('a&& b = c;', rvalue_error) - self.TestLint('a&& c = d;', rvalue_error) - self.TestLint('auto&& a = b;', rvalue_error) - self.TestLint('const a&& b = c;', rvalue_error) - self.TestLint('struct a&& b = c;', rvalue_error) - self.TestLint('decltype(a)&& b = c;', rvalue_error) - - # Cast expressions - self.TestLint('a = const_cast(c);', rvalue_error) - self.TestLint('a = const_cast(c);', rvalue_error) - self.TestLint('a = static_cast(c);', rvalue_error) - self.TestLint('a = static_cast(c);', rvalue_error) - self.TestLint('a = dynamic_cast(c);', rvalue_error) - self.TestLint('a = dynamic_cast(c);', rvalue_error) - self.TestLint('a = reinterpret_cast(c);', rvalue_error) - self.TestLint('a = reinterpret_cast(c);', rvalue_error) - self.TestLint('a = cast < b&& c;', space_error) - - # Function parameters - for indent in ['', ' ']: - for head in ['void Func', 'vector Func', 'vector\nFunc', - 'inline void Func', - 'Constructor', 'Constructor::Constructor', - 'operator=', 'operator =', 'operator = ']: - for body in [' {}', ' {', ';']: - self.TestMultiLineLint(indent + head + '(A&& b)' + body, rvalue_error) - self.TestMultiLineLint(indent + head + '(A &&b)' + body, rvalue_error) - self.TestMultiLineLint(indent + head + '(A&&... b)' + body, - rvalue_error) - self.TestMultiLineLint(indent + head + '(A&& c)' + body, - rvalue_error) - self.TestMultiLineLint(indent + head + '(A &&c)' + body, - rvalue_error) - - # Function templates - self.TestLint('std::conditional::type', rvalue_error) - self.TestLint('std::conditional::type', rvalue_error) - - # Template functions - self.TestLint('template R&& F()', rvalue_error) - self.TestLint('template R&& F() {', rvalue_error) - self.TestMultiLineLint('template \nR&& F()', rvalue_error) - self.TestMultiLineLint('template \nR&& F() {', rvalue_error) - self.TestLint('template void F(T a, R&& b)', rvalue_error) - self.TestLint('template void F(T a, R &&b)', rvalue_error) - self.TestLint('template void F(T a, R&& b) {', rvalue_error) - - # For loops - self.TestLint('for (a&& b;;)', rvalue_error) - self.TestLint('for (a&& b;;) {', rvalue_error) - self.TestLint('for (; a&& b;)', space_error) - self.TestLint('for (; a&& b;) {', space_error) - - # Constructors - self.TestLint('A(a&& b)', rvalue_error) - self.TestLint('explicit A(a&& b)', rvalue_error) - self.TestLint('A(a b) : c(d&& e)', space_error) - self.TestLint('A(a b) : c(), d(e&& f)', space_error) - - def testAllowedRvalueReference(self): - # Verify that RValue reference warnings for a line range can be silenced - error_collector = ErrorCollector(self.assert_) - cpplint.ProcessFileData('foo.cc', 'cc', - ['// Copyright 2014 Your Company.', - 'GOOGLE_ALLOW_RVALUE_REFERENCES_PUSH', - 'void F(A&& b);', - 'GOOGLE_ALLOW_RVALUE_REFERENCES_POP', - ''], - error_collector) - self.assertEquals(error_collector.Results(), '') - - # RValue references for constructors and operator= - error_collector = ErrorCollector(self.assert_) - cpplint.ProcessFileData( - 'foo.cc', 'cc', - ['// Copyright 2014 Your Company.', - 'class X {', - ' X(X&& param) = delete; // NOLINT(runtime/explicit)', - ' X(X &¶m) = default; // NOLINT(runtime/explicit)', - ' inline X(X&& param) = default; // NOLINT(runtime/explicit)', - '', - ' X& operator=(X&& param) = delete;', - ' X& operator=(X&& param) = default;', - '};', - 'A::A(A&&) = default;', - 'Outer::Inner::Inner(Inner&&) = default;', - ''], - error_collector) - self.assertEquals(error_collector.Results(), '') - - # Assume templated function parameters are forwarded, and are allowed - error_collector = ErrorCollector(self.assert_) - cpplint.ProcessFileData( - 'foo.cc', 'cc', - ['// Copyright 2014 Your Company.', - 'template ', - 'void Function1(Allowed1&& a);', - '', - 'template ', - 'void Function2(Allowed2&& a, Allowed3 &&b) {', - '}', - '', - 'template ', - 'void Function3(Ignored1 *a, Allowed4&& b) {', - '}', - '', - 'template ', - 'void Function4(Allowed5&&... a) {', - '}', - '', - 'template ', - 'void Function5(', - ' Allowed6 &&...a) {', - '}', - ''], - error_collector) - self.assertEquals(error_collector.Results(), '') - def testSpacingBeforeLastSemicolon(self): self.TestLint('call_function() ;', 'Extra space before last semicolon. If this should be an ' @@ -2649,6 +2870,11 @@ def testEmptyBlockBody(self): self.TestLint('for (;;)', '') self.TestLint('for (;;) continue;', '') self.TestLint('for (;;) func();', '') + self.TestLint('if (test) {}', + 'If statement had no body and no else clause' + ' [whitespace/empty_if_body] [4]') + self.TestLint('if (test) func();', '') + self.TestLint('if (test) {} else {}', '') self.TestMultiLineLint("""while (true && false);""", 'Empty loop bodies should use {} or continue' @@ -2665,6 +2891,39 @@ def testEmptyBlockBody(self): while (false);""", 'Empty loop bodies should use {} or continue' ' [whitespace/empty_loop_body] [5]') + self.TestMultiLineLint("""if (test) { + }""", + 'If statement had no body and no else clause' + ' [whitespace/empty_if_body] [4]') + self.TestMultiLineLint("""if (test, + func({})) { + }""", + 'If statement had no body and no else clause' + ' [whitespace/empty_if_body] [4]') + self.TestMultiLineLint("""if (test) + func();""", '') + self.TestLint('if (test) { hello; }', '') + self.TestLint('if (test({})) { hello; }', '') + self.TestMultiLineLint("""if (test) { + func(); + }""", '') + self.TestMultiLineLint("""if (test) { + // multiline + // comment + }""", '') + self.TestMultiLineLint("""if (test) { // comment + }""", '') + self.TestMultiLineLint("""if (test) { + } else { + }""", '') + self.TestMultiLineLint("""if (func(p1, + p2, + p3)) { + func(); + }""", '') + self.TestMultiLineLint("""if (func({}, p1)) { + func(); + }""", '') def testSpacingForRangeBasedFor(self): # Basic correctly formatted case: @@ -2693,19 +2952,48 @@ def testSpacingForRangeBasedFor(self): # Static or global STL strings. def testStaticOrGlobalSTLStrings(self): + # A template for the error message for a const global/static string. error_msg = ('For a static/global string constant, use a C style ' 'string instead: "%s[]". [runtime/string] [4]') + # The error message for a non-const global/static string variable. + nonconst_error_msg = ('Static/global string variables are not permitted.' + ' [runtime/string] [4]') self.TestLint('string foo;', - error_msg % 'char foo') + nonconst_error_msg) self.TestLint('string kFoo = "hello"; // English', - error_msg % 'char kFoo') + nonconst_error_msg) self.TestLint('static string foo;', - error_msg % 'static char foo') + nonconst_error_msg) self.TestLint('static const string foo;', error_msg % 'static const char foo') + self.TestLint('static const std::string foo;', + error_msg % 'static const char foo') self.TestLint('string Foo::bar;', - error_msg % 'char Foo::bar') + nonconst_error_msg) + + self.TestLint('std::string foo;', + nonconst_error_msg) + self.TestLint('std::string kFoo = "hello"; // English', + nonconst_error_msg) + self.TestLint('static std::string foo;', + nonconst_error_msg) + self.TestLint('static const std::string foo;', + error_msg % 'static const char foo') + self.TestLint('std::string Foo::bar;', + nonconst_error_msg) + + self.TestLint('::std::string foo;', + nonconst_error_msg) + self.TestLint('::std::string kFoo = "hello"; // English', + nonconst_error_msg) + self.TestLint('static ::std::string foo;', + nonconst_error_msg) + self.TestLint('static const ::std::string foo;', + error_msg % 'static const char foo') + self.TestLint('::std::string Foo::bar;', + nonconst_error_msg) + self.TestLint('string* pointer', '') self.TestLint('string *pointer', '') self.TestLint('string* pointer = Func();', '') @@ -2725,12 +3013,14 @@ def testStaticOrGlobalSTLStrings(self): self.TestLint('string Foo::bar() {}', '') self.TestLint('string Foo::operator*() {}', '') # Rare case. - self.TestLint('string foo("foobar");', error_msg % 'char foo') + self.TestLint('string foo("foobar");', nonconst_error_msg) # Should not catch local or member variables. self.TestLint(' string foo', '') # Should not catch functions. self.TestLint('string EmptyString() { return ""; }', '') self.TestLint('string EmptyString () { return ""; }', '') + self.TestLint('string const& FileInfo::Pathname() const;', '') + self.TestLint('string const &FileInfo::Pathname() const;', '') self.TestLint('string VeryLongNameFunctionSometimesEndsWith(\n' ' VeryLongNameType very_long_name_variable) {}', '') self.TestLint('template<>\n' @@ -2761,21 +3051,24 @@ def testStaticOrGlobalSTLStrings(self): 'NestedClass::MemberFunction3();', 'string TemplateClass::', 'NestedClass::MemberFunction4();', - 'string Class', + 'const string Class', '::static_member_variable1;', - 'string Class::', + 'const string Class::', 'static_member_variable2;', - 'string Class', + 'const string Class', '::static_member_variable3 = "initial value";', - 'string Class::', + 'const string Class::', 'static_member_variable4 = "initial value";', + 'string Class::', + 'static_member_variable5;', ''], error_collector) self.assertEquals(error_collector.Results(), - [error_msg % 'char Class::static_member_variable1', - error_msg % 'char Class::static_member_variable2', - error_msg % 'char Class::static_member_variable3', - error_msg % 'char Class::static_member_variable4']) + [error_msg % 'const char Class::static_member_variable1', + error_msg % 'const char Class::static_member_variable2', + error_msg % 'const char Class::static_member_variable3', + error_msg % 'const char Class::static_member_variable4', + nonconst_error_msg]) def testNoSpacesInFunctionCalls(self): self.TestLint('TellStory(1, 3);', @@ -2825,6 +3118,9 @@ def testToDoComments(self): self.TestLint('// TODO(ljenkins): Fix this', '') self.TestLint('#if 1 // TEST_URLTODOCID_WHICH_HAS_THAT_WORD_IN_IT_H_', '') self.TestLint('// See also similar TODO above', '') + self.TestLint(r'EXPECT_EQ("\\", ' + r'NormalizePath("/./../foo///bar/..//x/../..", ""));', + '') def testTwoSpacesBetweenCodeAndComments(self): self.TestLint('} // namespace foo', @@ -2908,6 +3204,14 @@ def DoTest(self, lines): DoTest(self, ['', '', '', 'using namespace foo;']) DoTest(self, ['// hello', 'using namespace foo;']) + def testUsingLiteralsNamespaces(self): + self.TestLint('using namespace std::literals;', 'Do not use namespace' + ' using-directives. Use using-declarations instead.' + ' [build/namespaces_literals] [5]') + self.TestLint('using namespace std::literals::chrono_literals;', 'Do' + ' not use namespace using-directives. Use using-declarations instead.' + ' [build/namespaces_literals] [5]') + def testNewlineAtEOF(self): def DoTest(self, data, is_missing_eof): error_collector = ErrorCollector(self.assert_) @@ -2926,9 +3230,13 @@ def DoTest(self, data, is_missing_eof): def testInvalidUtf8(self): def DoTest(self, raw_bytes, has_invalid_utf8): error_collector = ErrorCollector(self.assert_) + if sys.version_info < (3,): + unidata = unicode(raw_bytes, 'utf8', 'replace').split('\n') + else: + unidata = str(raw_bytes, 'utf8', 'replace').split('\n') cpplint.ProcessFileData( 'foo.cc', 'cc', - unicode(raw_bytes, 'utf8', 'replace').split('\n'), + unidata, error_collector) # The warning appears only once. self.assertEquals( @@ -2938,12 +3246,12 @@ def DoTest(self, raw_bytes, has_invalid_utf8): ' (or Unicode replacement character).' ' [readability/utf8] [5]')) - DoTest(self, 'Hello world\n', False) - DoTest(self, '\xe9\x8e\xbd\n', False) - DoTest(self, '\xe9x\x8e\xbd\n', True) + DoTest(self, codecs_latin_encode('Hello world\n'), False) + DoTest(self, codecs_latin_encode('\xe9\x8e\xbd\n'), False) + DoTest(self, codecs_latin_encode('\xe9x\x8e\xbd\n'), True) # This is the encoding of the replacement character itself (which # you can see by evaluating codecs.getencoder('utf8')(u'\ufffd')). - DoTest(self, '\xef\xbf\xbd\n', True) + DoTest(self, codecs_latin_encode('\xef\xbf\xbd\n'), True) def testBadCharacters(self): # Test for NUL bytes only @@ -2958,10 +3266,16 @@ def testBadCharacters(self): # Make sure both NUL bytes and UTF-8 are caught if they appear on # the same line. error_collector = ErrorCollector(self.assert_) + raw_bytes = codecs_latin_encode('\xe9x\0') + if sys.version_info < (3,): + unidata = unicode(raw_bytes, 'utf8', 'replace') + else: + unidata = str(raw_bytes, 'utf8', 'replace') cpplint.ProcessFileData( 'nul_utf8.cc', 'cc', ['// Copyright 2014 Your Company.', - unicode('\xe9x\0', 'utf8', 'replace'), ''], + unidata, + ''], error_collector) self.assertEquals( error_collector.Results(), @@ -3182,6 +3496,54 @@ def testMultipleStatementsOnSameLine(self): error_collector) cpplint._cpplint_state.verbose_level = old_verbose_level + def testLambdasOnSameLine(self): + error_collector = ErrorCollector(self.assert_) + old_verbose_level = cpplint._cpplint_state.verbose_level + cpplint._cpplint_state.verbose_level = 0 + cpplint.ProcessFileData('foo.cc', 'cc', + ['const auto lambda = ' + '[](const int i) { return i; };'], + error_collector) + cpplint._cpplint_state.verbose_level = old_verbose_level + self.assertEquals(0, error_collector.Results().count( + 'More than one command on the same line [whitespace/newline] [0]')) + + error_collector = ErrorCollector(self.assert_) + old_verbose_level = cpplint._cpplint_state.verbose_level + cpplint._cpplint_state.verbose_level = 0 + cpplint.ProcessFileData('foo.cc', 'cc', + ['const auto result = std::any_of(vector.begin(), ' + 'vector.end(), ' + '[](const int i) { return i > 0; });'], + error_collector) + cpplint._cpplint_state.verbose_level = old_verbose_level + self.assertEquals(0, error_collector.Results().count( + 'More than one command on the same line [whitespace/newline] [0]')) + + error_collector = ErrorCollector(self.assert_) + old_verbose_level = cpplint._cpplint_state.verbose_level + cpplint._cpplint_state.verbose_level = 0 + cpplint.ProcessFileData('foo.cc', 'cc', + ['return mutex::Lock([this]() { ' + 'this->ReadLock(); }, [this]() { ' + 'this->ReadUnlock(); });'], + error_collector) + cpplint._cpplint_state.verbose_level = old_verbose_level + self.assertEquals(0, error_collector.Results().count( + 'More than one command on the same line [whitespace/newline] [0]')) + + error_collector = ErrorCollector(self.assert_) + old_verbose_level = cpplint._cpplint_state.verbose_level + cpplint._cpplint_state.verbose_level = 0 + cpplint.ProcessFileData('foo.cc', 'cc', + ['return mutex::Lock([this]() { ' + 'this->ReadLock(); }, [this]() { ' + 'this->ReadUnlock(); }, object);'], + error_collector) + cpplint._cpplint_state.verbose_level = old_verbose_level + self.assertEquals(0, error_collector.Results().count( + 'More than one command on the same line [whitespace/newline] [0]')) + def testEndOfNamespaceComments(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData('foo.cc', 'cc', @@ -3360,10 +3722,9 @@ class foo { '') self.TestMultiLineLint( TrimExtraIndent(''' - static const char kNotRawString[] = "(" - ")";'''), - 'Weird number of spaces at line-start. ' - 'Are you using a 2-space indent? [whitespace/indent] [3]') + KV>'''), + '') self.TestMultiLineLint( ' static const char kSingleLineRawString[] = R"(...)";', 'Weird number of spaces at line-start. ' @@ -3477,6 +3838,15 @@ def testConditionals(self): goto fail;""", 'If/else bodies with multiple statements require braces' ' [readability/braces] [4]') + self.TestMultiLineLint( + """ + if constexpr (foo) { + goto fail; + goto fail; + } else if constexpr (bar) { + hello(); + }""", + '') self.TestMultiLineLint( """ if (foo) @@ -3646,27 +4016,28 @@ def testTab(self): 'Tab found; better to use spaces [whitespace/tab] [1]') def testParseArguments(self): - old_usage = cpplint._USAGE - old_error_categories = cpplint._ERROR_CATEGORIES old_output_format = cpplint._cpplint_state.output_format old_verbose_level = cpplint._cpplint_state.verbose_level + old_headers = cpplint._hpp_headers old_filters = cpplint._cpplint_state.filters old_line_length = cpplint._line_length old_valid_extensions = cpplint._valid_extensions try: # Don't print usage during the tests, or filter categories - cpplint._USAGE = '' - cpplint._ERROR_CATEGORIES = '' + sys.stdout = open(os.devnull, 'w') + sys.stderr = open(os.devnull, 'w') self.assertRaises(SystemExit, cpplint.ParseArguments, []) self.assertRaises(SystemExit, cpplint.ParseArguments, ['--badopt']) self.assertRaises(SystemExit, cpplint.ParseArguments, ['--help']) + self.assertRaises(SystemExit, cpplint.ParseArguments, ['--version']) self.assertRaises(SystemExit, cpplint.ParseArguments, ['--v=0']) self.assertRaises(SystemExit, cpplint.ParseArguments, ['--filter=']) # This is illegal because all filters must start with + or - self.assertRaises(SystemExit, cpplint.ParseArguments, ['--filter=foo']) self.assertRaises(SystemExit, cpplint.ParseArguments, ['--filter=+a,b,-c']) + self.assertRaises(SystemExit, cpplint.ParseArguments, ['--headers']) self.assertEquals(['foo.cc'], cpplint.ParseArguments(['foo.cc'])) self.assertEquals(old_output_format, cpplint._cpplint_state.output_format) @@ -3702,39 +4073,224 @@ def testParseArguments(self): self.assertEquals(['foo.cc', 'foo.h'], cpplint.ParseArguments(['foo.cc', 'foo.h'])) + cpplint._hpp_headers = old_headers + cpplint._valid_extensions = old_valid_extensions self.assertEqual(['foo.h'], cpplint.ParseArguments(['--linelength=120', 'foo.h'])) self.assertEqual(120, cpplint._line_length) + self.assertEqual(set(['h', 'hh', 'hpp', 'hxx', 'h++', 'cuh']), cpplint.GetHeaderExtensions()) # Default value + cpplint._hpp_headers = old_headers + cpplint._valid_extensions = old_valid_extensions + self.assertEqual(['foo.h'], + cpplint.ParseArguments(['--headers=h', 'foo.h'])) + self.assertEqual(set(['h', 'c', 'cc', 'cpp', 'cxx', 'c++', 'cu']), cpplint.GetAllExtensions()) + + cpplint._hpp_headers = old_headers + cpplint._valid_extensions = old_valid_extensions self.assertEqual(['foo.h'], cpplint.ParseArguments(['--extensions=hpp,cpp,cpp', 'foo.h'])) - self.assertEqual(set(['hpp', 'cpp']), cpplint._valid_extensions) + self.assertEqual(set(['hpp', 'cpp']), cpplint.GetAllExtensions()) + self.assertEqual(set(['hpp']), cpplint.GetHeaderExtensions()) + + cpplint._hpp_headers = old_headers + cpplint._valid_extensions = old_valid_extensions + self.assertEqual(['foo.h'], + cpplint.ParseArguments(['--extensions=cpp,cpp', '--headers=hpp,h', 'foo.h'])) + self.assertEqual(set(['hpp', 'h']), cpplint.GetHeaderExtensions()) + self.assertEqual(set(['hpp', 'h', 'cpp']), cpplint.GetAllExtensions()) + finally: - cpplint._USAGE = old_usage - cpplint._ERROR_CATEGORIES = old_error_categories + sys.stdout == sys.__stdout__ + sys.stderr == sys.__stderr__ cpplint._cpplint_state.output_format = old_output_format cpplint._cpplint_state.verbose_level = old_verbose_level cpplint._cpplint_state.filters = old_filters cpplint._line_length = old_line_length cpplint._valid_extensions = old_valid_extensions + cpplint._hpp_headers = old_headers + + def testRecursiveArgument(self): + working_dir = os.getcwd() + temp_dir = tempfile.mkdtemp() + try: + src_dir = os.path.join(temp_dir, "src") + nested_dir = os.path.join(temp_dir, "src", "nested") + os.makedirs(nested_dir) + open(os.path.join(temp_dir, "one.cpp"), 'w').close() + open(os.path.join(src_dir, "two.cpp"), 'w').close() + open(os.path.join(nested_dir, "three.cpp"), 'w').close() + os.chdir(temp_dir) + expected = ['one.cpp', os.path.join('src', 'two.cpp'), + os.path.join('src', 'nested', 'three.cpp')] + cpplint._excludes = None + actual = cpplint.ParseArguments(['--recursive', 'one.cpp', 'src']) + self.assertEquals(set(expected), set(actual)) + finally: + os.chdir(working_dir) + shutil.rmtree(temp_dir) + + def testRecursiveExcludeInvalidFileExtension(self): + working_dir = os.getcwd() + temp_dir = tempfile.mkdtemp() + try: + src_dir = os.path.join(temp_dir, "src") + os.makedirs(src_dir) + open(os.path.join(temp_dir, "one.cpp"), 'w').close() + open(os.path.join(src_dir, "two.cpp"), 'w').close() + open(os.path.join(src_dir, "three.cc"), 'w').close() + os.chdir(temp_dir) + expected = ['one.cpp', os.path.join('src', 'two.cpp')] + cpplint._excludes = None + actual = cpplint.ParseArguments(['--recursive', '--extensions=cpp', + 'one.cpp', 'src']) + self.assertEquals(set(expected), set(actual)) + finally: + os.chdir(working_dir) + shutil.rmtree(temp_dir) + cpplint._hpp_headers = set([]) + cpplint._valid_extensions = set([]) + + def testRecursiveExclude(self): + working_dir = os.getcwd() + temp_dir = tempfile.mkdtemp() + try: + src_dir = os.path.join(temp_dir, 'src') + src2_dir = os.path.join(temp_dir, 'src2') + os.makedirs(src_dir) + os.makedirs(src2_dir) + open(os.path.join(src_dir, 'one.cc'), 'w').close() + open(os.path.join(src_dir, 'two.cc'), 'w').close() + open(os.path.join(src_dir, 'three.cc'), 'w').close() + open(os.path.join(src2_dir, 'one.cc'), 'w').close() + open(os.path.join(src2_dir, 'two.cc'), 'w').close() + open(os.path.join(src2_dir, 'three.cc'), 'w').close() + os.chdir(temp_dir) + + expected = [ + os.path.join('src', 'one.cc'), + os.path.join('src', 'two.cc'), + os.path.join('src', 'three.cc') + ] + cpplint._excludes = None + actual = cpplint.ParseArguments(['src']) + self.assertEquals(set(['src']), set(actual)) + + cpplint._excludes = None + actual = cpplint.ParseArguments(['--recursive', 'src']) + self.assertEquals(set(expected), set(actual)) + + expected = [os.path.join('src', 'one.cc')] + cpplint._excludes = None + actual = cpplint.ParseArguments(['--recursive', + '--exclude=src{0}t*'.format(os.sep), 'src']) + self.assertEquals(set(expected), set(actual)) + + expected = [os.path.join('src', 'one.cc')] + cpplint._excludes = None + actual = cpplint.ParseArguments(['--recursive', + '--exclude=src/two.cc', '--exclude=src/three.cc', 'src']) + self.assertEquals(set(expected), set(actual)) + + expected = set([ + os.path.join('src2', 'one.cc'), + os.path.join('src2', 'two.cc'), + os.path.join('src2', 'three.cc') + ]) + cpplint._excludes = None + actual = cpplint.ParseArguments(['--recursive', + '--exclude=src', '.']) + self.assertEquals(expected, set(actual)) + finally: + os.chdir(working_dir) + shutil.rmtree(temp_dir) + + def testJUnitXML(self): + try: + cpplint._cpplint_state._junit_errors = [] + cpplint._cpplint_state._junit_failures = [] + expected = ('\n' + '' + '' + '') + self.assertEquals(expected, cpplint._cpplint_state.FormatJUnitXML()) + + cpplint._cpplint_state._junit_errors = ['ErrMsg1'] + cpplint._cpplint_state._junit_failures = [] + expected = ('\n' + '' + 'ErrMsg1' + '') + self.assertEquals(expected, cpplint._cpplint_state.FormatJUnitXML()) + + cpplint._cpplint_state._junit_errors = ['ErrMsg1', 'ErrMsg2'] + cpplint._cpplint_state._junit_failures = [] + expected = ('\n' + '' + 'ErrMsg1\nErrMsg2' + '') + self.assertEquals(expected, cpplint._cpplint_state.FormatJUnitXML()) + + cpplint._cpplint_state._junit_errors = ['ErrMsg'] + cpplint._cpplint_state._junit_failures = [ + ('File', 5, 'FailMsg', 'category/subcategory', 3)] + expected = ('\n' + '' + 'ErrMsg' + '5: FailMsg [category/subcategory] ' + '[3]') + self.assertEquals(expected, cpplint._cpplint_state.FormatJUnitXML()) + + cpplint._cpplint_state._junit_errors = [] + cpplint._cpplint_state._junit_failures = [ + ('File1', 5, 'FailMsg1', 'category/subcategory', 3), + ('File2', 99, 'FailMsg2', 'category/subcategory', 3), + ('File1', 19, 'FailMsg3', 'category/subcategory', 3)] + expected = ('\n' + '' + '5: FailMsg1 [category/subcategory]' + ' [3]\n19: FailMsg3 [category/subcategory] [3]' + '99: FailMsg2 ' + '[category/subcategory] [3]') + self.assertEquals(expected, cpplint._cpplint_state.FormatJUnitXML()) + + cpplint._cpplint_state._junit_errors = ['&'] + cpplint._cpplint_state._junit_failures = [ + ('File1', 5, '&', 'category/subcategory', 3)] + expected = ('\n' + '' + '&</error>' + '5: ' + '&</failure> [category/subcategory] [3]' + '') + self.assertEquals(expected, cpplint._cpplint_state.FormatJUnitXML()) + + finally: + cpplint._cpplint_state._junit_errors = [] + cpplint._cpplint_state._junit_failures = [] + + def testQuiet(self): + self.assertEquals(cpplint._cpplint_state.quiet, False) + cpplint.ParseArguments(['--quiet', 'one.cpp']) + self.assertEquals(cpplint._cpplint_state.quiet, True) def testLineLength(self): old_line_length = cpplint._line_length try: cpplint._line_length = 80 self.TestLint( - '// %s' % ('H' * 77), + '// H %s' % ('H' * 75), '') self.TestLint( - '// %s' % ('H' * 78), + '// H %s' % ('H' * 76), 'Lines should be <= 80 characters long' ' [whitespace/line_length] [2]') cpplint._line_length = 120 self.TestLint( - '// %s' % ('H' * 117), + '// H %s' % ('H' * 115), '') self.TestLint( - '// %s' % ('H' * 118), + '// H %s' % ('H' * 116), 'Lines should be <= 120 characters long' ' [whitespace/line_length] [2]') finally: @@ -3791,18 +4347,25 @@ def testDuplicateHeader(self): error_collector.ResultList()) def testUnnamedNamespacesInHeaders(self): + for extension in ['h', 'hpp', 'hxx', 'h++', 'cuh']: + self.doTestUnnamedNamespacesInHeaders(extension) + + def doTestUnnamedNamespacesInHeaders(self, extension): self.TestLanguageRulesCheck( - 'foo.h', 'namespace {', + 'foo.' + extension, 'namespace {', 'Do not use unnamed namespaces in header files. See' - ' http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' + ' https://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces' ' for more information. [build/namespaces] [4]') # namespace registration macros are OK. - self.TestLanguageRulesCheck('foo.h', 'namespace { \\', '') + self.TestLanguageRulesCheck('foo.' + extension, 'namespace { \\', '') # named namespaces are OK. - self.TestLanguageRulesCheck('foo.h', 'namespace foo {', '') - self.TestLanguageRulesCheck('foo.h', 'namespace foonamespace {', '') - self.TestLanguageRulesCheck('foo.cc', 'namespace {', '') - self.TestLanguageRulesCheck('foo.cc', 'namespace foo {', '') + self.TestLanguageRulesCheck('foo.' + extension, 'namespace foo {', '') + self.TestLanguageRulesCheck('foo.' + extension, 'namespace foonamespace {', '') + + def testUnnamedNamespacesInNonHeaders(self): + for extension in ['c', 'cc', 'cpp', 'cxx', 'c++', 'cu']: + self.TestLanguageRulesCheck('foo.' + extension, 'namespace {', '') + self.TestLanguageRulesCheck('foo.' + extension, 'namespace foo {', '') def testBuildClass(self): # Test that the linter can parse to the end of class definitions, @@ -3873,7 +4436,8 @@ def GetBuildHeaderGuardPreprocessorSymbol(self, file_path): cpplint.ProcessFileData(file_path, 'h', [], error_collector) for error in error_collector.ResultList(): matched = re.search( - 'No #ifndef header guard found, suggested CPP variable is: ([A-Z_]+)', + 'No #ifndef header guard found, suggested CPP variable is: ' + '([A-Z0-9_]+)', error) if matched is not None: return matched.group(1) @@ -4072,9 +4636,54 @@ def testBuildHeaderGuard(self): ' [build/header_guard] [5]' % expected_guard), error_collector.ResultList()) + # Cuda guard + file_path = 'mydir/foo.cuh' + expected_guard = self.GetBuildHeaderGuardPreprocessorSymbol(file_path) + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData(file_path, 'cuh', + ['#ifndef FOO', + '#define FOO', + '#endif // FOO'], + error_collector) + self.assertEquals( + 1, + error_collector.ResultList().count( + '#ifndef header guard has wrong style, please use: %s' + ' [build/header_guard] [5]' % expected_guard), + error_collector.ResultList()) + self.assertEquals( + 1, + error_collector.ResultList().count( + '#endif line should be "#endif // %s"' + ' [build/header_guard] [5]' % expected_guard), + error_collector.ResultList()) + + def testPragmaOnce(self): + error_collector = ErrorCollector(self.assert_) + cpplint.ProcessFileData('mydir/foo.h', 'h', + ['// Copyright 2014 Your Company.', '#pragma once', ''], + error_collector) + self.assertEquals([], error_collector.ResultList()) + def testBuildHeaderGuardWithRoot(self): - file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), + temp_directory = tempfile.mkdtemp() + try: + test_directory = os.path.join(temp_directory, "test") + os.makedirs(test_directory) + os.makedirs(os.path.join(test_directory, ".svn")) + header_directory = os.path.join(test_directory, "cpplint") + os.makedirs(header_directory) + self.doTestBuildHeaderGuardWithRoot(header_directory) + finally: + shutil.rmtree(temp_directory) + + def doTestBuildHeaderGuardWithRoot(self, header_directory): + + # note: Tested file paths must be real, otherwise + # the repository name lookup will fail. + file_path = os.path.join(header_directory, 'cpplint_test_header.h') + open(file_path, 'a').close() file_info = cpplint.FileInfo(file_path) if file_info.FullName() == file_info.RepositoryName(): # When FileInfo cannot deduce the root directory of the repository, @@ -4087,22 +4696,226 @@ def testBuildHeaderGuardWithRoot(self): self.assertEquals('CPPLINT_CPPLINT_TEST_HEADER_H_', cpplint.GetHeaderGuardCPPVariable(file_path)) + # + # test --root flags: + # this changes the cpp header guard prefix + # + + # left-strip the header guard by using a root dir inside of the repo dir. + # relative directory cpplint._root = 'cpplint' self.assertEquals('CPPLINT_TEST_HEADER_H_', cpplint.GetHeaderGuardCPPVariable(file_path)) + + nested_header_directory = os.path.join(header_directory, "nested") + nested_file_path = os.path.join(nested_header_directory, 'cpplint_test_header.h') + os.makedirs(nested_header_directory) + open(nested_file_path, 'a').close() + + cpplint._root = os.path.join('cpplint', 'nested') + actual = cpplint.GetHeaderGuardCPPVariable(nested_file_path) + self.assertEquals('CPPLINT_TEST_HEADER_H_', + actual) + + # absolute directory + # (note that CPPLINT.cfg root=setting is always made absolute) + cpplint._root = header_directory + self.assertEquals('CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + cpplint._root = nested_header_directory + self.assertEquals('CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(nested_file_path)) + # --root flag is ignored if an non-existent directory is specified. cpplint._root = 'NON_EXISTENT_DIR' self.assertEquals('CPPLINT_CPPLINT_TEST_HEADER_H_', cpplint.GetHeaderGuardCPPVariable(file_path)) + # prepend to the header guard by using a root dir that is more outer + # than the repo dir + + # (using absolute paths) + # (note that CPPLINT.cfg root=setting is always made absolute) + this_files_path = os.path.dirname(os.path.abspath(file_path)) + (styleguide_path, this_files_dir) = os.path.split(this_files_path) + (styleguide_parent_path, styleguide_dir_name) = os.path.split(styleguide_path) + # parent dir of styleguide + cpplint._root = styleguide_parent_path + self.assertIsNotNone(styleguide_parent_path) + # do not hardcode the 'styleguide' repository name, it could be anything. + expected_prefix = re.sub(r'[^a-zA-Z0-9]', '_', styleguide_dir_name).upper() + '_' + # do not have 'styleguide' repo in '/' + self.assertEquals('%sCPPLINT_CPPLINT_TEST_HEADER_H_' %(expected_prefix), + cpplint.GetHeaderGuardCPPVariable(file_path)) + + # To run the 'relative path' tests, we must be in the directory of this test file. + cur_dir = os.getcwd() + os.chdir(this_files_path) + + # (using relative paths) + styleguide_rel_path = os.path.relpath(styleguide_path, this_files_path) + # '..' + cpplint._root = styleguide_rel_path + self.assertEquals('CPPLINT_CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + styleguide_rel_path = os.path.relpath(styleguide_parent_path, + this_files_path) # '../..' + cpplint._root = styleguide_rel_path + self.assertEquals('%sCPPLINT_CPPLINT_TEST_HEADER_H_' %(expected_prefix), + cpplint.GetHeaderGuardCPPVariable(file_path)) + + cpplint._root = None + + # Restore previous CWD. + os.chdir(cur_dir) + + def testIncludeItsHeader(self): + temp_directory = tempfile.mkdtemp() + cur_dir = os.getcwd() + try: + test_directory = os.path.join(temp_directory, "test") + os.makedirs(test_directory) + file_path = os.path.join(test_directory, 'foo.h') + open(file_path, 'a').close() + file_path = os.path.join(test_directory, 'Bar.h') + open(file_path, 'a').close() + + os.chdir(temp_directory) + + error_collector = ErrorCollector(self.assertTrue) + cpplint.ProcessFileData( + 'test/foo.cc', 'cc', + [''], + error_collector) + expected = "{dir}/{fn}.cc should include its header file {dir}/{fn}.h [build/include] [5]".format( + fn="foo", + dir=test_directory) + self.assertEqual( + 1, + error_collector.Results().count(expected)) + + error_collector = ErrorCollector(self.assertTrue) + cpplint.ProcessFileData( + 'test/foo.cc', 'cc', + [r'#include "test/foo.h"', + '' + ], + error_collector) + self.assertEqual( + 0, + error_collector.Results().count(expected)) + + # This should continue to work + error_collector = ErrorCollector(self.assertTrue) + cpplint.ProcessFileData( + 'test/Bar.cc', 'cc', + [r'#include "test/Bar.h"', + '' + ], + error_collector) + expected = "{dir}/{fn}.cc should include its header file {dir}/{fn}.h [build/include] [5]".format( + fn="Bar", + dir=test_directory) + self.assertEqual( + 0, + error_collector.Results().count(expected)) + + # Since Bar.cc & Bar.h look 3rd party-ish, it should be ok without the include dir + error_collector = ErrorCollector(self.assertTrue) + cpplint.ProcessFileData( + 'test/Bar.cc', 'cc', + [r'#include "Bar.h"', + '' + ], + error_collector) + self.assertEqual( + 0, + error_collector.Results().count(expected)) + + finally: + # Restore previous CWD. + os.chdir(cur_dir) + shutil.rmtree(temp_directory) + + def testPathSplitToList(self): + self.assertEquals([''], + cpplint.PathSplitToList(os.path.join(''))) + + self.assertEquals(['.'], + cpplint.PathSplitToList(os.path.join('.'))) + + self.assertEquals(['..'], + cpplint.PathSplitToList(os.path.join('..'))) + + self.assertEquals(['..', 'a', 'b'], + cpplint.PathSplitToList(os.path.join('..', 'a', 'b'))) + + self.assertEquals(['a', 'b', 'c', 'd'], + cpplint.PathSplitToList(os.path.join('a', 'b', 'c', 'd'))) + + def testBuildHeaderGuardWithRepository(self): + temp_directory = tempfile.mkdtemp() + temp_directory2 = tempfile.mkdtemp() + try: + os.makedirs(os.path.join(temp_directory, ".svn")) + trunk_dir = os.path.join(temp_directory, "trunk") + os.makedirs(trunk_dir) + header_directory = os.path.join(trunk_dir, "cpplint") + os.makedirs(header_directory) + file_path = os.path.join(header_directory, 'cpplint_test_header.h') + open(file_path, 'a').close() + + # search for .svn if _repository is not specified + self.assertEquals('TRUNK_CPPLINT_CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + # use the provided repository root for header guards + cpplint._repository = os.path.relpath(trunk_dir) + self.assertEquals('CPPLINT_CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + cpplint._repository = os.path.abspath(trunk_dir) + self.assertEquals('CPPLINT_CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + # ignore _repository if it doesnt exist + cpplint._repository = os.path.join(temp_directory, 'NON_EXISTANT') + self.assertEquals('TRUNK_CPPLINT_CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + # ignore _repository if it exists but file isn't in it + cpplint._repository = os.path.relpath(temp_directory2) + self.assertEquals('TRUNK_CPPLINT_CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + # _root should be relative to _repository + cpplint._repository = os.path.relpath(trunk_dir) + cpplint._root = 'cpplint' + self.assertEquals('CPPLINT_TEST_HEADER_H_', + cpplint.GetHeaderGuardCPPVariable(file_path)) + + finally: + shutil.rmtree(temp_directory) + shutil.rmtree(temp_directory2) + cpplint._repository = None + cpplint._root = None + def testBuildInclude(self): # Test that include statements have slashes in them. self.TestLint('#include "foo.h"', 'Include the directory when naming .h files' - ' [build/include] [4]') + ' [build/include_subdir] [4]') self.TestLint('#include "Python.h"', '') self.TestLint('#include "lua.h"', '') + def testHppInclude(self): + code = '\n'.join([ + '#include ', + '#include ' + ]) + self.TestLanguageRulesCheck('foo.h', code, '') + def testBuildPrintfFormat(self): error_collector = ErrorCollector(self.assert_) cpplint.ProcessFileData( @@ -4176,8 +4989,8 @@ def testBuildStorageClass(self): storage_classes = ['extern', 'register', 'static', 'typedef'] build_storage_class_error_message = ( - 'Storage class (static, extern, typedef, etc) should be first.' - ' [build/storage_class] [5]') + 'Storage-class specifier (static, extern, typedef, etc) should be ' + 'at the beginning of the declaration. [build/storage_class] [5]') # Some explicit cases. Legal in C++, deprecated in C99. self.TestLint('const int static foo = 5;', @@ -4285,7 +5098,7 @@ def Helper(self, package, extension, lines, count): lines = lines[:] # Header files need to have an ifdef guard wrapped around their code. - if extension == 'h': + if extension.startswith('h'): guard = filename.upper().replace('/', '_').replace('.', '_') + '_' lines.insert(0, '#ifndef ' + guard) lines.insert(1, '#define ' + guard) @@ -4309,6 +5122,9 @@ def TestCxx11Feature(self, code, expected_error): self.assertEquals(expected_error, collector.Results()) def testBlockedHeaders(self): + self.TestCxx11Feature('#include ', + 'C++ TR1 headers such as are ' + 'unapproved. [build/c++tr1] [5]') self.TestCxx11Feature('#include ', ' is an unapproved C++11 header.' ' [build/c++11] [5]') @@ -4353,6 +5169,25 @@ def testExplicitMakePair(self): ' [build/explicit_make_pair] [4]') self.TestLint('my_make_pair', '') +class Cxx14Test(CpplintTestBase): + + def TestCxx14Feature(self, code, expected_error): + lines = code.split('\n') + collector = ErrorCollector(self.assert_) + cpplint.RemoveMultiLineComments('foo.h', lines, collector) + clean_lines = cpplint.CleansedLines(lines) + cpplint.FlagCxx14Features('foo.cc', clean_lines, 0, collector) + self.assertEquals(expected_error, collector.Results()) + + def testBlockedHeaders(self): + self.TestCxx14Feature('#include ', + ' is an unapproved C++14 header.' + ' [build/c++14] [5]') + self.TestCxx14Feature('#include ', + ' is an unapproved C++14 header.' + ' [build/c++14] [5]') + + class CleansedLinesTest(unittest.TestCase): def testInit(self): @@ -4492,6 +5327,18 @@ def testClassifyInclude(self): classify_include(file_info('foo/foo.cc'), 'string', False)) + self.assertEquals(cpplint._OTHER_HEADER, + classify_include(file_info('foo/foo.cc'), + 'boost/any.hpp', + True)) + self.assertEqual(cpplint._OTHER_HEADER, + classify_include(file_info('foo/foo.hxx'), + 'boost/any.hpp', + True)) + self.assertEqual(cpplint._OTHER_HEADER, + classify_include(file_info('foo/foo.h++'), + 'boost/any.hpp', + True)) self.assertEqual(cpplint._LIKELY_MY_HEADER, classify_include(file_info('foo/foo.cc'), @@ -4511,16 +5358,33 @@ def testClassifyInclude(self): False)) def testTryDropCommonSuffixes(self): + cpplint._hpp_headers = set([]) + cpplint._valid_extensions = set([]) self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo-inl.h')) + self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo-inl.hxx')) + self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo-inl.h++')) + self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo-inl.hpp')) self.assertEqual('foo/bar/foo', cpplint._DropCommonSuffixes('foo/bar/foo_inl.h')) self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo.cc')) + self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo.cxx')) + self.assertEqual('foo/foo', cpplint._DropCommonSuffixes('foo/foo.c')) self.assertEqual('foo/foo_unusualinternal', cpplint._DropCommonSuffixes('foo/foo_unusualinternal.h')) + self.assertEqual('foo/foo_unusualinternal', + cpplint._DropCommonSuffixes('foo/foo_unusualinternal.hpp')) self.assertEqual('', cpplint._DropCommonSuffixes('_test.cc')) + self.assertEqual('', + cpplint._DropCommonSuffixes('_test.c')) + self.assertEqual('', + cpplint._DropCommonSuffixes('_test.c++')) + self.assertEqual('test', + cpplint._DropCommonSuffixes('test.c')) self.assertEqual('test', cpplint._DropCommonSuffixes('test.cc')) + self.assertEqual('test', + cpplint._DropCommonSuffixes('test.c++')) def testRegression(self): def Format(includes): @@ -4970,6 +5834,20 @@ def testFunctionLengthNotDeterminable(self): 'Lint failed to find start of function body.' ' [readability/fn_size] [5]') + def testFunctionLengthCheckWithNamespace(self): + old_verbosity = cpplint._SetVerboseLevel(1) + self.TestFunctionLengthsCheck( + ('namespace {\n' + 'void CodeCoverageCL35256059() {\n' + + (' X++;\n' * 3000) + + '}\n' + '} // namespace\n'), + ('Small and focused functions are preferred: ' + 'CodeCoverageCL35256059() has 3000 non-comment lines ' + '(error triggered by exceeding 20 lines).' + ' [readability/fn_size] [5]')) + cpplint._SetVerboseLevel(old_verbosity) + def TrimExtraIndent(text_block): """Trim a uniform amount of whitespace off of each line in a string. @@ -5298,6 +6176,12 @@ def testTemplate(self): self.assertTrue(isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) self.assertEquals(self.nesting_state.stack[0].name, 'K') + def testTemplateDefaultArg(self): + self.UpdateWithLines([ + 'template > class unique_ptr {',]) + self.assertEquals(len(self.nesting_state.stack), 1) + self.assertTrue(self.nesting_state.stack[0], isinstance(self.nesting_state.stack[0], cpplint._ClassInfo)) + def testTemplateInnerClass(self): self.UpdateWithLines(['class A {', ' public:']) @@ -5420,7 +6304,93 @@ def testInlineAssembly(self): self.assertEquals(len(self.nesting_state.stack), 0) -# pylint: disable-msg=C6409 +class QuietTest(unittest.TestCase): + + def setUp(self): + self.temp_dir = tempfile.mkdtemp() + self.this_dir_path = os.path.abspath(self.temp_dir) + self.python_executable = sys.executable or 'python' + self.cpplint_test_h = os.path.join(self.this_dir_path, + 'cpplint_test_header.h') + open(self.cpplint_test_h, 'w').close() + + def tearDown(self): + shutil.rmtree(self.temp_dir) + + def _runCppLint(self, *args): + cpplint_abspath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cpplint.py') + + cmd_line = [self.python_executable, cpplint_abspath] + \ + list(args) + \ + [ self.cpplint_test_h ] + + return_code = 0 + try: + output = subprocess.check_output(cmd_line, + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError as err: + return_code = err.returncode + output = err.output + if isinstance(output, bytes): + output = output.decode('utf-8') + return (return_code, output) + + def testNonQuietWithErrors(self): + # This will fail: the test header is missing a copyright and header guard. + (return_code, output) = self._runCppLint() + self.assertEquals(1, return_code) + # Always-on behavior: Print error messages as they come up. + self.assertIn("[legal/copyright]", output) + self.assertIn("[build/header_guard]", output) + # If --quiet was unspecified: Print 'Done processing' and 'Total errors..' + self.assertIn("Done processing", output) + self.assertIn("Total errors found:", output) + + def testQuietWithErrors(self): + # When there are errors, behavior is identical to not passing --quiet. + (return_code, output) = self._runCppLint('--quiet') + self.assertEquals(1, return_code) + self.assertIn("[legal/copyright]", output) + self.assertIn("[build/header_guard]", output) + # Even though --quiet was used, print these since there were errors. + self.assertIn("Done processing", output) + self.assertIn("Total errors found:", output) + + def testNonQuietWithoutErrors(self): + # This will succeed. We filtered out all the known errors for that file. + (return_code, output) = self._runCppLint('--filter=' + + '-legal/copyright,' + + '-build/header_guard') + self.assertEquals(0, return_code, output) + # No cpplint errors are printed since there were no errors. + self.assertNotIn("[legal/copyright]", output) + self.assertNotIn("[build/header_guard]", output) + # Print 'Done processing' since + # --quiet was not specified. + self.assertIn("Done processing", output) + + def testQuietWithoutErrors(self): + # This will succeed. We filtered out all the known errors for that file. + (return_code, output) = self._runCppLint('--quiet', + '--filter=' + + '-legal/copyright,' + + '-build/header_guard') + self.assertEquals(0, return_code, output) + # No cpplint errors are printed since there were no errors. + self.assertNotIn("[legal/copyright]", output) + self.assertNotIn("[build/header_guard]", output) + # --quiet was specified and there were no errors: + # skip the printing of 'Done processing' and 'Total errors..' + self.assertNotIn("Done processing", output) + self.assertNotIn("Total errors found:", output) + # Output with no errors must be completely blank! + self.assertEquals("", output) + +#class FileFilterTest(unittest.TestCase): +# def testFilterExcludedFiles(self): +# self.assertEquals([], _FilterExcludedFiles([])) + +# pylint: disable=C6409 def setUp(): """Runs before all tests are executed. """ @@ -5429,7 +6399,7 @@ def setUp(): cpplint._cpplint_state.SetFilters('') -# pylint: disable-msg=C6409 +# pylint: disable=C6409 def tearDown(): """A global check to make sure all error-categories have been tested. @@ -5445,6 +6415,13 @@ def tearDown(): pass +@pytest.fixture(autouse=True) +def run_around_tests(): + setUp() + yield + tearDown() + + if __name__ == '__main__': # We don't want to run the VerifyAllCategoriesAreSeen() test unless # we're running the full test suite: if we only run one test, diff --git a/lib/cpplint_1.4.5/dev-requirements b/lib/cpplint_1.4.5/dev-requirements new file mode 100644 index 00000000000..ff4a653cb31 --- /dev/null +++ b/lib/cpplint_1.4.5/dev-requirements @@ -0,0 +1,12 @@ +# requirements to run development steps + +# also change in tox.ini +flake8>=3.7.8 +pylint>=1.8.4 +tox>=3.0.0 +tox-pyenv + +# Below only run with python3, installed in tox.ini +# mypy +# coala +# coala-bears diff --git a/lib/cpplint_1.4.5/samples/boost-sample/LICENSE b/lib/cpplint_1.4.5/samples/boost-sample/LICENSE new file mode 100644 index 00000000000..7925d62e6b1 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/boost-sample/LICENSE @@ -0,0 +1,24 @@ +Boost Software License - Version 1.0 - August 17th, 2003 + +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + diff --git a/lib/cpplint_1.4.5/samples/boost-sample/README.md b/lib/cpplint_1.4.5/samples/boost-sample/README.md new file mode 100644 index 00000000000..6266a4abfb4 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/boost-sample/README.md @@ -0,0 +1,3 @@ +# VLC sample + +code taken for regression testing from https://github.com/boostorg diff --git a/lib/cpplint_1.4.5/samples/boost-sample/exclude.def b/lib/cpplint_1.4.5/samples/boost-sample/exclude.def new file mode 100644 index 00000000000..460937d613d --- /dev/null +++ b/lib/cpplint_1.4.5/samples/boost-sample/exclude.def @@ -0,0 +1,73 @@ +--recursive --exclude=headers/* src +1 +3 +Done processing src/tr1/c_policy.hpp +Total errors found: 66 + +src/tr1/c_policy.hpp:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_BOOST_SAMPLE_SRC_TR1_C_POLICY_HPP_ [build/header_guard] [5] +src/tr1/c_policy.hpp:9: Missing space before { [whitespace/braces] [5] +src/tr1/c_policy.hpp:13: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:14: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:15: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:16: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:17: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:18: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:19: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:20: public: should be indented +1 space inside struct policy [whitespace/indent] [3] +src/tr1/c_policy.hpp:21: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:22: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:23: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:24: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:25: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:26: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:27: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:28: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:30: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:32: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:34: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:35: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:36: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:37: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:38: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:39: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:44: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:45: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:46: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:47: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:48: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:49: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:50: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:51: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:52: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:53: public: should be indented +1 space inside struct policy [whitespace/indent] [3] +src/tr1/c_policy.hpp:54: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:55: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:56: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:57: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:58: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:59: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:60: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:61: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:63: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:65: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:67: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:68: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:69: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:70: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:71: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:72: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:76: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:88: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:89: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:89: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:93: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:105: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:106: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:106: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:109: Namespace should be terminated with "// namespace policies" [readability/namespace] [5] +src/tr1/c_policy.hpp:109: Namespace should be terminated with "// namespace math" [readability/namespace] [5] +src/tr1/c_policy.hpp:109: Namespace should be terminated with "// namespace boost" [readability/namespace] [5] +src/tr1/c_policy.hpp:109: At least two spaces is best between code and comments [whitespace/comments] [2] +src/tr1/c_policy.hpp:111: Missing space before { [whitespace/braces] [5] +src/tr1/c_policy.hpp:131: Namespace should be terminated with "// namespace c_policies" [readability/namespace] [5] + diff --git a/lib/cpplint_1.4.5/samples/boost-sample/headers_simple.def b/lib/cpplint_1.4.5/samples/boost-sample/headers_simple.def new file mode 100644 index 00000000000..cd66673c55c --- /dev/null +++ b/lib/cpplint_1.4.5/samples/boost-sample/headers_simple.def @@ -0,0 +1,73 @@ +src/tr1/* +1 +3 +Done processing src/tr1/c_policy.hpp +Total errors found: 66 + +src/tr1/c_policy.hpp:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_BOOST_SAMPLE_SRC_TR1_C_POLICY_HPP_ [build/header_guard] [5] +src/tr1/c_policy.hpp:9: Missing space before { [whitespace/braces] [5] +src/tr1/c_policy.hpp:13: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:14: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:15: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:16: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:17: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:18: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:19: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:20: public: should be indented +1 space inside struct policy [whitespace/indent] [3] +src/tr1/c_policy.hpp:21: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:22: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:23: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:24: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:25: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:26: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:27: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:28: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:30: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:32: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:34: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:35: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:36: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:37: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:38: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:39: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:44: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:45: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:46: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:47: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:48: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:49: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:50: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/tr1/c_policy.hpp:51: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:52: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:53: public: should be indented +1 space inside struct policy [whitespace/indent] [3] +src/tr1/c_policy.hpp:54: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:55: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:56: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:57: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:58: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:59: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:60: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:61: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:63: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:65: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:67: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:68: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:69: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:70: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:71: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:72: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:76: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:88: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:89: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:89: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:93: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:105: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/tr1/c_policy.hpp:106: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/tr1/c_policy.hpp:106: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/tr1/c_policy.hpp:109: Namespace should be terminated with "// namespace policies" [readability/namespace] [5] +src/tr1/c_policy.hpp:109: Namespace should be terminated with "// namespace math" [readability/namespace] [5] +src/tr1/c_policy.hpp:109: Namespace should be terminated with "// namespace boost" [readability/namespace] [5] +src/tr1/c_policy.hpp:109: At least two spaces is best between code and comments [whitespace/comments] [2] +src/tr1/c_policy.hpp:111: Missing space before { [whitespace/braces] [5] +src/tr1/c_policy.hpp:131: Namespace should be terminated with "// namespace c_policies" [readability/namespace] [5] + diff --git a/lib/cpplint_1.4.5/samples/boost-sample/simple.def b/lib/cpplint_1.4.5/samples/boost-sample/simple.def new file mode 100644 index 00000000000..453efe4cdee --- /dev/null +++ b/lib/cpplint_1.4.5/samples/boost-sample/simple.def @@ -0,0 +1,2579 @@ +include/boost/math/* +1 +3 +Done processing include/boost/math/octonion.hpp +Total errors found: 2572 + +include/boost/math/octonion.hpp:11: #ifndef header guard has wrong style, please use: SAMPLES_BOOST_SAMPLE_INCLUDE_BOOST_MATH_OCTONION_HPP_ [build/header_guard] [5] +include/boost/math/octonion.hpp:4250: #endif line should be "#endif // SAMPLES_BOOST_SAMPLE_INCLUDE_BOOST_MATH_OCTONION_HPP_" [build/header_guard] [5] +include/boost/math/octonion.hpp:18: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:19: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:20: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:21: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:30: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:75: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:80: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:85: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:90: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:95: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:100: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:102: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:103: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:104: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:105: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:106: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:107: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:108: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:109: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:110: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:111: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:112: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:113: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:114: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:115: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:116: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:117: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:118: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:119: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:120: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:121: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:122: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:123: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:124: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:125: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:126: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:127: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:128: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:129: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:130: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:131: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:132: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:133: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:134: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:135: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:136: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:137: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:138: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:138: Missing spaces around = [whitespace/operators] [4] +include/boost/math/octonion.hpp:139: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:140: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:141: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:142: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:143: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:144: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:145: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:146: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:147: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:148: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:149: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:150: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:151: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:152: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:153: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:154: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:155: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:156: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:157: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:158: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:159: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:160: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:161: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:162: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:164: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:165: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:175: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:176: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:178: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:179: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:180: public: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:181: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:181: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:183: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:186: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:187: Extra space after ( in function call [whitespace/parens] [4] +include/boost/math/octonion.hpp:203: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:206: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:207: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:209: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:210: Extra space after ( in function call [whitespace/parens] [4] +include/boost/math/octonion.hpp:211: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:212: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:213: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:222: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:225: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:226: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:228: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:229: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:229: Extra space after ( in function call [whitespace/parens] [4] +include/boost/math/octonion.hpp:230: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:239: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:242: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:243: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:246: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:247: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:249: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:260: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:263: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:264: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:267: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:268: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:271: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:272: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:273: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:274: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:275: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:276: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:277: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:279: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:281: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:283: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:290: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:292: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:294: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:296: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:299: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:300: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:302: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:305: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:306: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:308: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:311: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:312: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:313: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:314: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:319: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:320: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:324: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:327: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:328: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:331: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:332: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:333: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:334: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:335: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:336: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:337: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:338: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:339: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:340: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:349: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:352: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:353: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:354: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:356: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:358: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:360: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:363: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:364: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:366: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:369: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:370: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:372: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:375: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:376: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:377: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:378: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:383: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:384: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:388: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:391: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:392: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:395: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:396: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:397: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:398: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:399: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:400: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:401: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:402: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:403: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:404: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:413: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:416: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:417: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:419: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:428: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:437: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:440: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:441: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:443: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:446: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:455: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:464: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:467: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:468: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:469: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:470: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:475: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:484: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:493: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:496: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:497: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:500: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:509: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:518: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:527: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:530: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:531: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:533: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:542: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:551: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:554: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:555: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:557: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:560: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:562: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:571: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:580: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:583: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:584: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:585: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:586: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:591: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:593: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:602: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:611: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:614: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:615: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:618: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:627: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:628: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:629: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:630: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:631: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:632: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:633: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:634: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:635: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:636: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:637: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:638: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:647: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:650: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:651: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:652: protected: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:653: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:653: Do not leave a blank line after "protected:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:655: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:656: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:657: private: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:658: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:658: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:658: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:660: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:661: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:663: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:667: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:668: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:670: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:671: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:672: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:673: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:679: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:680: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:682: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:683: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:684: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:685: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:685: Extra space after ( in function call [whitespace/parens] [4] +include/boost/math/octonion.hpp:686: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:687: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:688: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:689: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:690: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:691: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:692: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:693: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:694: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:695: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:696: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:697: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:698: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:699: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:700: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:701: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:702: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:703: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:704: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:704: Extra space after ( in function call [whitespace/parens] [4] +include/boost/math/octonion.hpp:705: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:706: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:707: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:708: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:709: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:710: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:711: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:712: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:713: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:714: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:715: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:716: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:717: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:718: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:719: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:719: Extra space after ( in function call [whitespace/parens] [4] +include/boost/math/octonion.hpp:720: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:721: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:722: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:723: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:724: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:725: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:726: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:727: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:728: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:729: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:731: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:732: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:740: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:741: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:742: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:743: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:744: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:745: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:746: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:747: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:749: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:750: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:751: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:752: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:753: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:754: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:755: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:756: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:757: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:758: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:760: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:761: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:762: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:763: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:764: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:765: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:766: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:767: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:768: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:769: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:770: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:771: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:772: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:773: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:774: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:776: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:784: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:785: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:786: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:787: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:788: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:789: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:790: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:791: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:793: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:794: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:795: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:796: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:797: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:798: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:799: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:800: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:801: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:802: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:804: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:820: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:835: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:836: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:837: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:838: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:839: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:840: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:841: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:842: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:843: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:844: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:845: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:846: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:847: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:848: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:849: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:850: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:851: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:852: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:853: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:854: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:855: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:856: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:857: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:858: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:859: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:860: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:862: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:863: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:864: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:865: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:866: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:867: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:868: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:869: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:870: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:871: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:872: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:873: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:874: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:875: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:876: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:877: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:878: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:879: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:880: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:881: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:882: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:883: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:884: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:885: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:886: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:887: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:888: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:889: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:891: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:892: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:893: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:894: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:895: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:896: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:897: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:898: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:899: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:900: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:901: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:902: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:903: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:904: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:905: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:906: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:907: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:908: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:909: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:910: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:911: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:912: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:913: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:914: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:915: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:916: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:917: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:918: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:919: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:920: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:921: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:922: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:923: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:925: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:932: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:943: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:945: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:946: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:947: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:948: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:949: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:950: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:951: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:952: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:953: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:954: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:955: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:956: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:957: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:958: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:959: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:960: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:961: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:962: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:963: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:964: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:965: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:966: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:967: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:968: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:969: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:970: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:971: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:972: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:973: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:974: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:975: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:976: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:977: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:978: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:979: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:980: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:981: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:982: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:983: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:984: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:987: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:988: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:989: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:990: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:991: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:992: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:993: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:994: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:995: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:996: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:997: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:998: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:999: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1000: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1001: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1002: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1003: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1004: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1005: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1006: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1007: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1008: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1009: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1010: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1011: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1012: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1013: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1014: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1015: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1016: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1017: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1018: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1019: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1020: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1021: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1022: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1023: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1024: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1025: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1028: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1030: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1031: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1032: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1033: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1034: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1035: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1036: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1037: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1038: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1039: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1040: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1041: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1042: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1043: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1044: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1045: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1046: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1047: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1048: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1049: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1050: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1051: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1052: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1053: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1054: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1055: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1056: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1057: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1058: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1059: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1060: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1061: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1062: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1063: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1064: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1065: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1066: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1067: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1068: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1069: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1070: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1071: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1074: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1075: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1076: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1077: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1078: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1079: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1080: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1081: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1082: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1083: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1084: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1085: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1086: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1087: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1088: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1089: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1090: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1091: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1092: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1093: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1094: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1095: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1096: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1097: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1098: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1099: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1100: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1101: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1102: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1103: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1104: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1105: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1106: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1107: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1108: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1109: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1110: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1111: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1112: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1113: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1114: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1117: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1119: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1120: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1121: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1122: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1123: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1124: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1125: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1126: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1127: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1128: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1129: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1130: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1131: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1132: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1133: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1134: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1135: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1136: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1137: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1138: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1139: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1140: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1141: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1142: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1143: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1144: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1145: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1146: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1147: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1148: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1149: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1150: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1151: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1152: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1153: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1154: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1155: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1156: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1157: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1158: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1159: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1160: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1161: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1162: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1163: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1164: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1165: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1168: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1169: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1170: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1171: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1172: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1173: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1174: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1175: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1176: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1177: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1178: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1179: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1180: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1181: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1182: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1183: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1184: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1185: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1186: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1187: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1188: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1189: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1190: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1191: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1192: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1193: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1194: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1195: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1196: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1197: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1198: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1199: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1200: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1201: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1202: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1203: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1204: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1205: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1206: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1207: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1208: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1209: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1210: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1211: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1212: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1213: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1216: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1217: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1223: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1229: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1235: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1241: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1247: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1248: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1250: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:1251: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1252: public: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1253: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1253: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1255: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1257: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1260: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1262: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1263: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1264: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1265: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1267: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1268: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1269: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1270: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1272: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1275: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1278: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1279: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1280: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1281: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1282: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1283: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1284: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1286: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1288: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1290: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1297: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1299: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1300: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1301: protected: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1302: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1302: Do not leave a blank line after "protected:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1304: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1305: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1306: private: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1307: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1307: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1307: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1309: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1310: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1312: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:1313: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1314: public: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1315: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1315: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1317: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1319: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1322: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1324: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1325: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1326: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1327: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1329: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1331: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1332: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1333: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1334: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1336: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1339: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1342: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1343: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1344: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1345: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1346: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1347: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1348: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1350: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1352: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1354: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1361: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1363: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1364: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1365: protected: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1366: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1366: Do not leave a blank line after "protected:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1368: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1369: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1370: private: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1371: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1371: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1371: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1373: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1374: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1376: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:1377: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1378: public: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1379: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1379: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1381: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1383: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1386: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1388: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1389: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1390: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1391: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1393: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1394: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1395: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1396: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1397: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1399: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1400: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1403: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1406: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1407: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1408: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1409: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1410: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1411: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1412: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1414: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1416: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1418: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1425: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1427: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1428: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1429: protected: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1430: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1430: Do not leave a blank line after "protected:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1432: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1433: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1434: private: should be indented +1 space inside class octonion [whitespace/indent] [3] +include/boost/math/octonion.hpp:1435: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1435: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1435: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +include/boost/math/octonion.hpp:1437: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1438: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1440: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1442: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1447: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1464: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1465: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1467: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1469: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1471: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1472: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1474: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1481: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1482: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1483: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1484: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1486: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1487: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1488: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1489: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1491: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1492: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1493: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1494: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1496: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1497: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1498: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1499: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1501: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1502: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1503: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1504: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1506: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1507: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1508: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1509: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1511: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1512: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1513: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1514: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1516: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1525: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1526: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1531: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1532: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1534: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1542: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1544: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1545: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1547: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1548: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1551: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1552: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1554: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1555: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1556: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1556: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:1558: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1559: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1561: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1562: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1572: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1574: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1575: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1577: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1578: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1588: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1590: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1591: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1593: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1594: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1604: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1606: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1607: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1609: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1610: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1620: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1622: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1623: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1625: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1626: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1636: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1638: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1639: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1641: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1642: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1652: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1654: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1655: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1657: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1658: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1668: Closing ) should be moved to the previous line [whitespace/parens] [2] +include/boost/math/octonion.hpp:1670: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1671: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1676: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1678: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1680: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1682: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1684: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1686: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1688: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1690: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1692: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1694: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1696: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1698: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1700: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1702: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1704: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1706: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1707: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1708: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1709: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1711: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1711: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:1711: Extra space after ( [whitespace/parens] [2] +include/boost/math/octonion.hpp:1713: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1716: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1718: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1727: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1732: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1735: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1738: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1739: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1740: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1742: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1748: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1750: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1751: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1752: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1754: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1760: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1762: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1763: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1764: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1766: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1772: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1773: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1774: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1776: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1778: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1780: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1781: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1782: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1784: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1790: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1791: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1792: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1793: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1794: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1796: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1802: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1803: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1804: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1807: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1807: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1808: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1810: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1811: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1812: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1814: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1815: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1816: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1818: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1824: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1825: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1826: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1827: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:1829: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1830: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1834: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1835: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1839: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1839: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1840: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1841: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1842: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1844: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1845: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1846: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1854: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1855: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1856: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1857: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:1858: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1859: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1860: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1868: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1869: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1870: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1873: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1873: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1874: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1875: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1876: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1878: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1879: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1880: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1888: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1889: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1890: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1891: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:1893: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1893: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1894: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1898: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1899: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1903: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1904: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1908: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1909: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1913: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1914: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1916: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1917: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1918: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1920: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1921: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1922: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1930: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1931: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1932: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1933: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1934: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1942: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1943: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1944: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1947: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1947: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1948: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1949: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1950: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1952: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1958: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1959: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1960: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1961: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1962: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1970: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1971: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1972: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1974: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1975: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1976: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1977: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1978: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1980: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1981: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1982: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1990: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1991: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1992: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1994: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:1995: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:1997: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:1997: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:1998: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:1999: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2002: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2002: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2003: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2005: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2007: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2009: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2010: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2011: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2013: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2019: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2020: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2021: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2022: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2023: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2025: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2031: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2032: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2033: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2034: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2036: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2036: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2037: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2039: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2041: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2042: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2043: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2044: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2045: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2046: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2047: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2048: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2049: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2055: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2056: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2057: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2058: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2060: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2060: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2061: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2062: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2063: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2064: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2065: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2066: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2067: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2068: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2069: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2075: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2076: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2077: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2078: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2078: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2080: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2080: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2081: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2082: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2085: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2085: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2086: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2087: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2090: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2090: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2091: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2092: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2095: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2095: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2096: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2097: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2098: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2106: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2107: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2108: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2109: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2110: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2111: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2112: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2113: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2114: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2115: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2116: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2117: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2118: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2119: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2120: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2126: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2127: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2128: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2129: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2129: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2130: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2131: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2138: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2139: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2140: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2141: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2143: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2143: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2144: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2145: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2148: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2148: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2149: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2150: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2153: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2153: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2154: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2156: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2158: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2159: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2160: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2161: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2162: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2163: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2164: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2170: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2171: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2172: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2173: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2174: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2175: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2182: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2183: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2184: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2185: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2185: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2187: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2187: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2188: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2189: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2190: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2191: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2191: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2192: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2193: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2194: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2195: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2196: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2197: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2198: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2199: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2200: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2204: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2206: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2207: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2208: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2209: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2209: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2211: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2211: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2212: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2213: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2214: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2215: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2216: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2217: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2218: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2219: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2220: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2224: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2226: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2227: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2228: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2229: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2229: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2231: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2231: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2232: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2233: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2236: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2236: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2237: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2238: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2241: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2241: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2242: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2243: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2246: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2246: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2247: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2248: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2249: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2250: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2251: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2252: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2253: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2254: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2255: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2256: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2257: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2263: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2264: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2265: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2266: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2266: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2267: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2268: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2269: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2270: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2271: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2275: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2277: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2278: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2279: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2280: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2280: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2282: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2282: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2283: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2284: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2287: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2287: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2288: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2289: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2290: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2291: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2292: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2293: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2294: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2295: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2296: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2300: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2302: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2303: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2304: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2305: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2305: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2306: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2307: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2308: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2309: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2310: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2314: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2316: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2317: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2318: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2319: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2319: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2321: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2321: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2322: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2323: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2326: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2326: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2327: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2328: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2331: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2331: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2332: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2333: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2336: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2336: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2337: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2338: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2342: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2342: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2343: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2344: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2348: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2348: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2349: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2351: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2352: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2353: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2355: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2356: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2357: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2359: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2365: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2366: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2367: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2368: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2370: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2370: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2371: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2372: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2373: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2375: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2376: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2377: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2379: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2385: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2386: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2387: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2388: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2388: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2390: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2390: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2391: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2392: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2392: If/else bodies with multiple statements require braces [readability/braces] [4] +include/boost/math/octonion.hpp:2392: Missing space after ; [whitespace/semicolon] [3] +include/boost/math/octonion.hpp:2393: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2394: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2395: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2397: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2403: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2404: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2405: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2406: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2406: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2408: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2408: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2409: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2410: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2413: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2413: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2414: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2415: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2418: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2418: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2419: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2424: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2425: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2429: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2429: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2430: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2431: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2432: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2434: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2440: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2441: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2442: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2444: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2445: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2446: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2447: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2448: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2450: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2451: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2452: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2454: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2460: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2461: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2462: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2463: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2464: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2472: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2473: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2474: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2475: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2477: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2477: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2478: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2479: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2480: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2481: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2482: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2484: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2485: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2486: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2488: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2494: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2495: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2496: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2497: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2499: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2499: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2500: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2501: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2504: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2504: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2505: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2509: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2509: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2510: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2514: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2515: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2517: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2518: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2519: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2521: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2522: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2523: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2525: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2531: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2532: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2533: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2534: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2535: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2537: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2543: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2544: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2545: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2546: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2548: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2548: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2549: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2550: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2551: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2559: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2560: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2561: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2562: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2563: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2565: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2571: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2572: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2573: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2574: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2574: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2575: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2577: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2578: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2579: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2580: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2581: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2582: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2583: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2584: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2585: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2586: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2587: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2593: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2594: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2595: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2596: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2598: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2598: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2599: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2600: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2603: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2603: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2604: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2606: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2608: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2609: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2610: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2611: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2612: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2613: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2614: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2620: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2621: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2622: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2623: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2624: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2625: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2626: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2632: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2633: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2634: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2635: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2637: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2637: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2638: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2639: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2639: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2640: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2641: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2642: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2643: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2644: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2645: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2646: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2647: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2648: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2649: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2650: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2654: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2656: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2657: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2658: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2659: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2659: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2661: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2661: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2662: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2663: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2664: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2665: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2666: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2667: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2668: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2669: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2670: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2674: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2676: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2677: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2678: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2679: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2679: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2681: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2681: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2682: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2683: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2686: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2686: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2687: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2688: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2691: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2691: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2692: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2693: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2696: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2696: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2697: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2698: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2699: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2700: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2701: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2707: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2708: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2709: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2710: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2710: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2711: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2712: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2713: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2715: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2716: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2717: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2718: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2719: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2720: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2721: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2722: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2723: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2727: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2729: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2730: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2731: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2732: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2733: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2734: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2739: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2741: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2742: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2743: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2744: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2744: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2746: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2746: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2747: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2748: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2751: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2751: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2752: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2753: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2756: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2756: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2757: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2759: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2761: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2762: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2763: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2764: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2765: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2766: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2767: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2771: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2773: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2774: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2775: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2776: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2776: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2777: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2778: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2778: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2779: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2780: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2781: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2782: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2783: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2787: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2789: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2790: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2791: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2792: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2792: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2794: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2794: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2795: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2796: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2797: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2798: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2799: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2800: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2801: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2802: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2803: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2807: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2809: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2810: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2811: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2812: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2812: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2814: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2814: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2815: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2816: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2817: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2818: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2819: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2820: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2821: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2822: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2823: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2827: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2829: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2830: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2831: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2832: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2832: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2834: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2834: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2835: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2836: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2839: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2839: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2840: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2841: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2844: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2844: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2845: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2846: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2849: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2849: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2850: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2851: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2851: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2852: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2853: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2854: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2855: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2856: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2857: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2858: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2859: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2860: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2864: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2866: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2867: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2868: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2869: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2870: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2871: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2872: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2876: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2878: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2879: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2880: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2881: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2881: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2882: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2883: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2883: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2885: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2885: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2886: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2887: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2890: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2890: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2891: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2892: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2893: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2894: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2895: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2896: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2897: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2898: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2899: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2903: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2905: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2906: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2907: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2908: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2909: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2910: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2911: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2915: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2917: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2918: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2919: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2920: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2920: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2921: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2922: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2922: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2924: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2924: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2925: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2926: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2929: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2929: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2930: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2931: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2934: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2934: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2935: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2936: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2939: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2939: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2940: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2941: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2945: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2945: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2946: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2947: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2951: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2951: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2952: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2953: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2956: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2956: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2957: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2961: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2961: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2962: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2963: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2964: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2966: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2967: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2968: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2970: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2976: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2977: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2978: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2979: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2980: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2982: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2988: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2989: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2990: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2991: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2993: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2993: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:2994: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:2995: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2995: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:2996: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:2997: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:2998: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3000: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3001: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3002: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3004: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3010: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3011: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3012: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3013: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3015: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3015: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3016: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3017: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3020: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3020: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3021: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3022: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3025: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3025: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3026: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3027: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3028: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3030: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3031: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3032: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3034: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3040: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3041: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3042: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3043: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3044: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3046: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3052: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3053: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3054: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3055: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3057: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3057: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3058: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3059: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3059: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3060: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3061: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3062: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3063: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3064: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3065: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3066: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3067: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3068: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3074: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3075: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3076: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3077: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3079: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3079: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3080: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3081: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3084: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3084: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3085: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3086: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3089: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3089: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3090: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3091: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3094: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3094: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3095: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3099: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3099: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3100: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3105: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3106: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3111: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3112: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3114: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3115: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3116: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3118: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3119: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3120: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3122: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3128: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3129: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3130: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3133: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3133: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3134: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3135: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3136: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3138: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3144: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3145: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3146: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3147: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3148: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3156: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3157: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3158: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3160: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3162: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3163: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3164: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3165: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3166: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3168: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3169: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3170: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3172: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3178: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3179: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3180: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3181: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3183: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3183: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3184: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3188: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3188: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3189: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3191: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3193: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3195: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3196: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3197: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3199: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3205: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3206: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3207: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3208: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3209: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3211: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3217: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3218: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3219: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3220: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3222: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3222: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3223: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3225: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3227: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3228: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3229: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3231: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3232: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3233: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3241: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3242: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3243: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3244: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3246: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3246: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3247: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3248: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3249: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3251: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3252: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3253: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3255: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3261: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3262: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3263: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3264: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3266: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3266: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3267: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3268: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3271: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3271: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3272: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3273: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3276: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3276: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3277: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3281: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3281: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3282: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3283: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3284: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3286: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3292: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3293: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3294: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3296: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3297: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3298: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3299: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3300: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3301: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3302: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3304: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3305: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3306: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3308: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3314: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3315: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3316: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3317: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3318: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3320: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3326: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3327: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3328: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3329: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3331: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3331: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3332: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3333: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3336: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3336: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3337: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3338: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3341: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3341: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3342: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3344: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3346: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3348: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3349: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3350: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3352: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3358: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3359: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3360: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3361: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3362: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3364: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3370: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3371: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3372: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3373: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3375: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3375: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3376: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3378: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3379: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3380: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3381: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3382: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3383: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3384: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3385: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3386: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3387: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3388: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3394: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3395: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3396: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3397: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3399: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3399: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3400: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3401: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3402: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3403: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3404: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3405: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3406: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3407: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3408: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3414: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3415: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3416: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3417: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3417: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3419: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3419: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3420: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3421: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3424: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3424: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3425: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3426: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3429: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3429: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3430: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3431: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3434: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3434: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3435: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3437: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3438: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3439: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3441: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3442: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3443: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3445: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3451: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3452: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3453: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3454: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3455: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3456: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3457: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3463: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3464: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3465: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3466: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3466: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3467: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3468: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3470: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3470: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3471: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3472: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3475: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3475: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3476: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3477: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3478: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3479: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3480: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3481: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3482: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3483: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3484: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3490: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3491: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3492: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3493: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3494: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3495: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3496: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3502: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3503: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3504: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3505: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3505: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3506: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3507: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3509: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3509: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3510: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3511: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3514: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3514: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3515: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3516: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3519: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3519: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3520: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3521: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3524: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3524: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3525: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3526: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3530: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3530: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3531: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3536: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3536: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3537: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3539: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3541: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3543: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3544: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3545: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3547: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3553: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3554: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3555: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3556: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3558: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3558: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3559: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3560: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3561: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3563: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3569: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3570: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3571: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3573: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3574: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3575: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3576: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3577: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3578: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3579: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3581: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3582: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3583: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3585: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3591: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3592: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3593: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3594: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3596: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3596: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3597: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3598: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3599: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3601: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3602: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3603: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3605: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3611: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3612: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3613: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3614: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3616: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3616: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3617: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3618: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3621: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3621: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3622: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3626: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3626: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3627: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3629: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3631: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3633: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3634: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3635: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3637: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3643: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3644: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3645: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3646: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3648: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3648: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3649: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3650: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3651: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3653: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3659: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3660: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3661: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3663: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3664: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3665: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3666: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3667: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3668: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3669: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3670: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3671: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3673: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3674: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3675: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3677: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3683: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3684: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3685: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3686: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3688: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3688: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3689: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3690: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3693: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3693: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3694: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3695: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3696: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3698: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3700: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3701: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3702: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3704: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3710: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3711: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3712: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3713: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3715: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3715: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3716: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3717: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3718: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3719: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3720: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3721: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3722: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3723: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3724: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3730: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3731: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3732: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3733: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3735: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3735: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3736: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3737: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3738: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3739: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3740: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3741: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3742: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3743: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3744: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3750: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3751: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3752: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3753: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3753: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3755: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3755: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3756: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3757: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3758: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3759: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3760: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3761: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3762: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3762: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3763: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3764: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3768: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3770: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3771: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3772: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3773: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3773: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3775: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3775: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3776: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3777: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3778: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3779: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3780: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3781: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3782: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3782: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3783: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3784: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3788: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3790: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3791: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3792: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3793: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3793: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3795: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3795: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3796: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3797: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3800: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3800: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3801: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3802: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3805: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3805: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3806: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3807: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3810: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3810: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3811: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3812: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3815: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3815: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3816: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3817: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3821: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3821: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3822: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3827: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3828: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3833: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3834: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3839: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3840: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3842: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3843: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3844: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3846: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3849: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3853: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3854: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3856: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3856: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3856: Extra space after ( [whitespace/parens] [2] +include/boost/math/octonion.hpp:3857: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3858: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3859: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:3860: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3867: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3876: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3879: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3880: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3882: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3885: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3888: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3889: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3892: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3895: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3896: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3910: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3911: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3914: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3918: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3920: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3923: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3924: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3927: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3931: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3933: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3936: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3937: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3940: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3944: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3946: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3948: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3950: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3952: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3955: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:3956: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3957: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3958: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3960: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3962: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3965: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3966: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:3968: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3969: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3971: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3972: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3974: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3977: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3980: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3981: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3984: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:3994: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3995: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3996: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:3998: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:3999: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4009: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4012: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4013: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:4013: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4014: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:4014: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4015: Lines should be <= 80 characters long [whitespace/line_length] [2] +include/boost/math/octonion.hpp:4015: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4016: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4017: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4018: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4019: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4020: Should have a space between // and comment [whitespace/comments] [4] +include/boost/math/octonion.hpp:4021: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4023: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4025: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4027: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4029: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4031: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4033: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4035: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4037: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4039: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4041: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4043: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4045: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4047: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4050: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4051: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:4053: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4054: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4064: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4067: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4076: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4077: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:4079: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4080: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4090: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4093: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4096: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4097: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:4099: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4100: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4103: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4106: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4108: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4110: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4112: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4114: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4121: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4122: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4125: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4129: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4131: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4133: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4135: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4142: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4143: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4146: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4150: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4152: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4154: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4156: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4163: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4164: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4167: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4170: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4171: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4174: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4177: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4178: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4181: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4184: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4185: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4188: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4191: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4192: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4196: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4198: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4200: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4202: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4204: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4205: Missing spaces around << [whitespace/operators] [3] +include/boost/math/octonion.hpp:4206: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4207: At least two spaces is best between code and comments [whitespace/comments] [2] +include/boost/math/octonion.hpp:4209: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4212: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:4213: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4216: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:4217: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4220: An else should appear on the same line as the preceding } [whitespace/newline] [4] +include/boost/math/octonion.hpp:4221: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4222: Missing space after , [whitespace/comma] [3] +include/boost/math/octonion.hpp:4225: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4226: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4228: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4229: Do not indent within a namespace [runtime/indentation_namespace] [4] +include/boost/math/octonion.hpp:4230: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4231: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +include/boost/math/octonion.hpp:4236: { should almost always be at the end of the previous line [whitespace/braces] [4] +include/boost/math/octonion.hpp:4246: Namespace should be terminated with "// namespace detail" [readability/namespace] [5] +include/boost/math/octonion.hpp:4247: Namespace should be terminated with "// namespace math" [readability/namespace] [5] +include/boost/math/octonion.hpp:4248: Namespace should be terminated with "// namespace boost" [readability/namespace] [5] + diff --git a/lib/cpplint_1.4.5/samples/boost-sample/src/tr1/c_policy.hpp b/lib/cpplint_1.4.5/samples/boost-sample/src/tr1/c_policy.hpp new file mode 100644 index 00000000000..cf1951334ed --- /dev/null +++ b/lib/cpplint_1.4.5/samples/boost-sample/src/tr1/c_policy.hpp @@ -0,0 +1,131 @@ +// Copyright John Maddock 2008. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#include +#include + +namespace boost{ namespace math{ namespace policies{ + +template <> +struct policy< + domain_error, + pole_error, + overflow_error, + evaluation_error, + rounding_error, + default_policy, default_policy, default_policy, default_policy, default_policy, default_policy> +{ +public: + typedef domain_error domain_error_type; + typedef pole_error pole_error_type; + typedef overflow_error overflow_error_type; + typedef underflow_error underflow_error_type; + typedef denorm_error denorm_error_type; + typedef evaluation_error evaluation_error_type; + typedef rounding_error rounding_error_type; + typedef indeterminate_result_error<> indeterminate_result_error_type; +#if BOOST_MATH_DIGITS10_POLICY == 0 + typedef digits2<> precision_type; +#else + typedef detail::precision, digits2<> >::type precision_type; +#endif + typedef promote_float<> promote_float_type; + typedef promote_double<> promote_double_type; + typedef discrete_quantile<> discrete_quantile_type; + typedef assert_undefined<> assert_undefined_type; + typedef max_series_iterations<> max_series_iterations_type; + typedef max_root_iterations<> max_root_iterations_type; +}; + +template <> +struct policy< + domain_error, + pole_error, + overflow_error, + evaluation_error, + rounding_error, + detail::forwarding_arg1, + detail::forwarding_arg2, + default_policy, default_policy, default_policy, default_policy, default_policy, default_policy> +{ +public: + typedef domain_error domain_error_type; + typedef pole_error pole_error_type; + typedef overflow_error overflow_error_type; + typedef underflow_error underflow_error_type; + typedef denorm_error denorm_error_type; + typedef evaluation_error evaluation_error_type; + typedef rounding_error rounding_error_type; + typedef indeterminate_result_error<> indeterminate_result_error_type; +#if BOOST_MATH_DIGITS10_POLICY == 0 + typedef digits2<> precision_type; +#else + typedef detail::precision, digits2<> >::type precision_type; +#endif + typedef promote_float promote_float_type; + typedef promote_double promote_double_type; + typedef discrete_quantile<> discrete_quantile_type; + typedef assert_undefined<> assert_undefined_type; + typedef max_series_iterations<> max_series_iterations_type; + typedef max_root_iterations<> max_root_iterations_type; +}; + +template <> +struct normalise, pole_error, overflow_error, evaluation_error, rounding_error >, + promote_float, + promote_double, + discrete_quantile<>, + assert_undefined<>, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy> +{ + typedef policy, pole_error, overflow_error, evaluation_error, rounding_error, detail::forwarding_arg1, detail::forwarding_arg2> type; +}; + +template <> +struct normalise, pole_error, overflow_error, evaluation_error, rounding_error, detail::forwarding_arg1, detail::forwarding_arg2 >, + promote_float, + promote_double, + discrete_quantile<>, + assert_undefined<>, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy> +{ + typedef policy, pole_error, overflow_error, evaluation_error, rounding_error, detail::forwarding_arg1, detail::forwarding_arg2> type; +}; + +}}} // namespaces + +namespace c_policies{ + +using boost::math::policies::policy; +using boost::math::policies::errno_on_error; +using boost::math::policies::domain_error; +using boost::math::policies::pole_error; +using boost::math::policies::overflow_error; +using boost::math::policies::rounding_error; +using boost::math::policies::evaluation_error; + +typedef policy< + domain_error, + pole_error, + overflow_error, + evaluation_error, + rounding_error +> c_policy; + +BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(c_policy) + +} diff --git a/lib/cpplint_1.4.5/samples/chromium-sample/README.md b/lib/cpplint_1.4.5/samples/chromium-sample/README.md new file mode 100644 index 00000000000..f0c852d35bf --- /dev/null +++ b/lib/cpplint_1.4.5/samples/chromium-sample/README.md @@ -0,0 +1,3 @@ +# VLC sample + +code taken for regression testing from https://github.com/chromium/chromium diff --git a/lib/cpplint_1.4.5/samples/chromium-sample/simple.def b/lib/cpplint_1.4.5/samples/chromium-sample/simple.def new file mode 100644 index 00000000000..c2baca68b6b --- /dev/null +++ b/lib/cpplint_1.4.5/samples/chromium-sample/simple.def @@ -0,0 +1,23 @@ +src/* +1 +6 +Done processing src/chrome_content_renderer_client.cc +Done processing src/chrome_content_renderer_client.h +Done processing src/io_thread.cc +Done processing src/io_thread.h +Total errors found: 13 + +src/chrome_content_renderer_client.cc:113: Include the directory when naming .h files [build/include_subdir] [4] +src/chrome_content_renderer_client.cc:1156: Use int16/int64/etc, rather than the C type long [runtime/int] [4] +src/chrome_content_renderer_client.cc:1161: Use int16/int64/etc, rather than the C type long [runtime/int] [4] +src/chrome_content_renderer_client.cc:5: samples/chromium-sample/src/chrome_content_renderer_client.cc should include its header file samples/chromium-sample/src/chrome_content_renderer_client.h [build/include] [5] +src/chrome_content_renderer_client.h:5: #ifndef header guard has wrong style, please use: SAMPLES_CHROMIUM_SAMPLE_SRC_CHROME_CONTENT_RENDERER_CLIENT_H_ [build/header_guard] [5] +src/chrome_content_renderer_client.h:225: #endif line should be "#endif // SAMPLES_CHROMIUM_SAMPLE_SRC_CHROME_CONTENT_RENDERER_CLIENT_H_" [build/header_guard] [5] +src/chrome_content_renderer_client.h:115: Use int16/int64/etc, rather than the C type long [runtime/int] [4] +src/chrome_content_renderer_client.h:117: Use int16/int64/etc, rather than the C type long [runtime/int] [4] +src/io_thread.cc:1148: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/io_thread.cc:1547: Missing space around colon in range-based for loop [whitespace/forcolon] [2] +src/io_thread.cc:5: samples/chromium-sample/src/io_thread.cc should include its header file samples/chromium-sample/src/io_thread.h [build/include] [5] +src/io_thread.h:5: #ifndef header guard has wrong style, please use: SAMPLES_CHROMIUM_SAMPLE_SRC_IO_THREAD_H_ [build/header_guard] [5] +src/io_thread.h:565: #endif line should be "#endif // SAMPLES_CHROMIUM_SAMPLE_SRC_IO_THREAD_H_" [build/header_guard] [5] + diff --git a/lib/cpplint_1.4.5/samples/chromium-sample/src/chrome_content_renderer_client.cc b/lib/cpplint_1.4.5/samples/chromium-sample/src/chrome_content_renderer_client.cc new file mode 100644 index 00000000000..ed78c480c0e --- /dev/null +++ b/lib/cpplint_1.4.5/samples/chromium-sample/src/chrome_content_renderer_client.cc @@ -0,0 +1,1419 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/renderer/chrome_content_renderer_client.h" + +#include +#include + +#include "base/command_line.h" +#include "base/debug/crash_logging.h" +#include "base/logging.h" +#include "base/macros.h" +#include "base/metrics/field_trial.h" +#include "base/metrics/histogram.h" +#include "base/metrics/user_metrics_action.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" +#include "base/time/time.h" +#include "base/values.h" +#include "build/build_config.h" +#include "chrome/common/channel_info.h" +#include "chrome/common/chrome_isolated_world_ids.h" +#include "chrome/common/chrome_paths.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/common/crash_keys.h" +#include "chrome/common/pepper_permission_util.h" +#include "chrome/common/render_messages.h" +#include "chrome/common/secure_origin_whitelist.h" +#include "chrome/common/url_constants.h" +#include "chrome/grit/generated_resources.h" +#include "chrome/grit/locale_settings.h" +#include "chrome/grit/renderer_resources.h" +#include "chrome/renderer/banners/app_banner_client.h" +#include "chrome/renderer/benchmarking_extension.h" +#include "chrome/renderer/chrome_render_frame_observer.h" +#include "chrome/renderer/chrome_render_thread_observer.h" +#include "chrome/renderer/chrome_render_view_observer.h" +#include "chrome/renderer/content_settings_observer.h" +#include "chrome/renderer/external_extension.h" +#include "chrome/renderer/loadtimes_extension_bindings.h" +#include "chrome/renderer/media/chrome_key_systems.h" +#include "chrome/renderer/net/net_error_helper.h" +#include "chrome/renderer/net_benchmarking_extension.h" +#include "chrome/renderer/page_load_histograms.h" +#include "chrome/renderer/pepper/pepper_helper.h" +#include "chrome/renderer/plugins/non_loadable_plugin_placeholder.h" +#include "chrome/renderer/plugins/plugin_preroller.h" +#include "chrome/renderer/plugins/plugin_uma.h" +#include "chrome/renderer/prerender/prerender_dispatcher.h" +#include "chrome/renderer/prerender/prerender_helper.h" +#include "chrome/renderer/prerender/prerenderer_client.h" +#include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" +#include "chrome/renderer/safe_browsing/threat_dom_details.h" +#include "chrome/renderer/searchbox/search_bouncer.h" +#include "chrome/renderer/searchbox/searchbox.h" +#include "chrome/renderer/searchbox/searchbox_extension.h" +#include "chrome/renderer/tts_dispatcher.h" +#include "chrome/renderer/worker_content_settings_client_proxy.h" +#include "components/autofill/content/renderer/autofill_agent.h" +#include "components/autofill/content/renderer/password_autofill_agent.h" +#include "components/autofill/content/renderer/password_generation_agent.h" +#include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/contextual_search/renderer/overlay_js_render_frame_observer.h" +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h" +#include "components/dom_distiller/content/renderer/distillability_agent.h" +#include "components/dom_distiller/content/renderer/distiller_js_render_frame_observer.h" +#include "components/dom_distiller/core/url_constants.h" +#include "components/error_page/common/localized_error.h" +#include "components/network_hints/renderer/prescient_networking_dispatcher.h" +#include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" +#include "components/password_manager/content/renderer/credential_manager_client.h" +#include "components/pdf/renderer/pepper_pdf_host.h" +#include "components/plugins/renderer/mobile_youtube_plugin.h" +#include "components/signin/core/common/profile_management_switches.h" +#include "components/startup_metric_utils/common/startup_metric_messages.h" +#include "components/version_info/version_info.h" +#include "components/visitedlink/renderer/visitedlink_slave.h" +#include "components/web_cache/renderer/web_cache_impl.h" +#include "content/public/common/content_constants.h" +#include "content/public/common/content_switches.h" +#include "content/public/common/url_constants.h" +#include "content/public/renderer/plugin_instance_throttler.h" +#include "content/public/renderer/render_frame.h" +#include "content/public/renderer/render_thread.h" +#include "content/public/renderer/render_view.h" +#include "content/public/renderer/render_view_visitor.h" +#include "extensions/common/constants.h" +#include "ipc/ipc_sync_channel.h" +#include "net/base/net_errors.h" +#include "ppapi/c/private/ppb_pdf.h" +#include "ppapi/shared_impl/ppapi_switches.h" +#include "third_party/WebKit/public/platform/URLConversion.h" +#include "third_party/WebKit/public/platform/WebCachePolicy.h" +#include "third_party/WebKit/public/platform/WebSecurityOrigin.h" +#include "third_party/WebKit/public/platform/WebURL.h" +#include "third_party/WebKit/public/platform/WebURLError.h" +#include "third_party/WebKit/public/platform/WebURLRequest.h" +#include "third_party/WebKit/public/platform/WebURLResponse.h" +#include "third_party/WebKit/public/web/WebCache.h" +#include "third_party/WebKit/public/web/WebDataSource.h" +#include "third_party/WebKit/public/web/WebDocument.h" +#include "third_party/WebKit/public/web/WebElement.h" +#include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/WebKit/public/web/WebPluginContainer.h" +#include "third_party/WebKit/public/web/WebPluginParams.h" +#include "third_party/WebKit/public/web/WebSecurityPolicy.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/base/layout.h" +#include "ui/base/resource/resource_bundle.h" +#include "ui/base/webui/jstemplate_builder.h" +#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. + +#if !defined(DISABLE_NACL) +#include "components/nacl/common/nacl_constants.h" +#include "components/nacl/renderer/nacl_helper.h" +#endif + +#if defined(ENABLE_EXTENSIONS) +#include "chrome/common/extensions/chrome_extensions_client.h" +#include "chrome/renderer/extensions/chrome_extensions_renderer_client.h" +#include "extensions/common/extension_urls.h" +#include "extensions/common/switches.h" +#include "extensions/renderer/dispatcher.h" +#include "extensions/renderer/renderer_extension_registry.h" +#endif + +#if defined(ENABLE_IPC_FUZZER) +#include "chrome/common/external_ipc_dumper.h" +#endif + +#if defined(ENABLE_PLUGINS) +#include "chrome/renderer/plugins/chrome_plugin_placeholder.h" +#include "chrome/renderer/plugins/power_saver_info.h" +#endif + +#if defined(ENABLE_PRINTING) +#include "chrome/common/chrome_content_client.h" +#include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h" +#include "components/printing/renderer/print_web_view_helper.h" +#include "printing/print_settings.h" +#endif + +#if defined(ENABLE_PRINT_PREVIEW) +#include "chrome/renderer/pepper/chrome_pdf_print_client.h" +#endif + +#if defined(ENABLE_SPELLCHECK) +#include "chrome/renderer/spellchecker/spellcheck.h" +#include "chrome/renderer/spellchecker/spellcheck_provider.h" +#endif + +#if defined(ENABLE_WEBRTC) +#include "chrome/renderer/media/webrtc_logging_message_filter.h" +#endif + +using autofill::AutofillAgent; +using autofill::PasswordAutofillAgent; +using autofill::PasswordGenerationAgent; +using base::ASCIIToUTF16; +using base::UserMetricsAction; +using blink::WebCache; +using blink::WebCachePolicy; +using blink::WebConsoleMessage; +using blink::WebDataSource; +using blink::WebDocument; +using blink::WebFrame; +using blink::WebLocalFrame; +using blink::WebPlugin; +using blink::WebPluginParams; +using blink::WebSecurityOrigin; +using blink::WebSecurityPolicy; +using blink::WebString; +using blink::WebURL; +using blink::WebURLError; +using blink::WebURLRequest; +using blink::WebURLResponse; +using blink::WebVector; +using content::PluginInstanceThrottler; +using content::RenderFrame; +using content::RenderThread; +using content::WebPluginInfo; +using extensions::Extension; + +namespace { + +// Whitelist PPAPI for Android Runtime for Chromium. (See crbug.com/383937) +#if defined(ENABLE_PLUGINS) +const char* const kPredefinedAllowedCameraDeviceOrigins[] = { + "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", + "4EB74897CB187C7633357C2FE832E0AD6A44883A" +}; + +const char* const kPredefinedAllowedCompositorOrigins[] = { + "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", + "4EB74897CB187C7633357C2FE832E0AD6A44883A" +}; +#endif + +#if defined(ENABLE_PLUGINS) +void AppendParams(const std::vector& additional_names, + const std::vector& additional_values, + WebVector* existing_names, + WebVector* existing_values) { + DCHECK(additional_names.size() == additional_values.size()); + DCHECK(existing_names->size() == existing_values->size()); + + size_t existing_size = existing_names->size(); + size_t total_size = existing_size + additional_names.size(); + + WebVector names(total_size); + WebVector values(total_size); + + for (size_t i = 0; i < existing_size; ++i) { + names[i] = (*existing_names)[i]; + values[i] = (*existing_values)[i]; + } + + for (size_t i = 0; i < additional_names.size(); ++i) { + names[existing_size + i] = additional_names[i]; + values[existing_size + i] = additional_values[i]; + } + + existing_names->swap(names); + existing_values->swap(values); +} + +// For certain sandboxed Pepper plugins, use the JavaScript Content Settings. +bool ShouldUseJavaScriptSettingForPlugin(const WebPluginInfo& plugin) { + if (plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_IN_PROCESS && + plugin.type != WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS) { + return false; + } + +#if !defined(DISABLE_NACL) + // Treat Native Client invocations like JavaScript. + if (plugin.name == ASCIIToUTF16(nacl::kNaClPluginName)) + return true; +#endif + +#if defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) + // Treat CDM invocations like JavaScript. + if (plugin.name == ASCIIToUTF16(kWidevineCdmDisplayName)) { + DCHECK(plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS); + return true; + } +#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) + + return false; +} +#endif // defined(ENABLE_PLUGINS) + +#if defined(ENABLE_SPELLCHECK) +class SpellCheckReplacer : public content::RenderViewVisitor { + public: + explicit SpellCheckReplacer(SpellCheck* spellcheck) + : spellcheck_(spellcheck) {} + bool Visit(content::RenderView* render_view) override; + + private: + SpellCheck* spellcheck_; // New shared spellcheck for all views. Weak Ptr. + DISALLOW_COPY_AND_ASSIGN(SpellCheckReplacer); +}; + +bool SpellCheckReplacer::Visit(content::RenderView* render_view) { + SpellCheckProvider* provider = SpellCheckProvider::Get(render_view); + DCHECK(provider); + provider->set_spellcheck(spellcheck_); + return true; +} +#endif + +#if defined(ENABLE_EXTENSIONS) +bool IsStandaloneExtensionProcess() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + extensions::switches::kExtensionProcess); +} +#endif + +// Defers media player loading in background pages until they're visible. +// TODO(dalecurtis): Include an idle listener too. http://crbug.com/509135 +class MediaLoadDeferrer : public content::RenderFrameObserver { + public: + MediaLoadDeferrer(content::RenderFrame* render_frame, + const base::Closure& continue_loading_cb) + : content::RenderFrameObserver(render_frame), + continue_loading_cb_(continue_loading_cb) {} + ~MediaLoadDeferrer() override {} + + private: + // content::RenderFrameObserver implementation: + void WasShown() override { + continue_loading_cb_.Run(); + delete this; + } + + const base::Closure continue_loading_cb_; + + DISALLOW_COPY_AND_ASSIGN(MediaLoadDeferrer); +}; + +} // namespace + +ChromeContentRendererClient::ChromeContentRendererClient() + : main_entry_time_(base::TimeTicks::Now()) { +#if defined(ENABLE_EXTENSIONS) + extensions::ExtensionsClient::Set( + extensions::ChromeExtensionsClient::GetInstance()); + extensions::ExtensionsRendererClient::Set( + ChromeExtensionsRendererClient::GetInstance()); +#endif +#if defined(ENABLE_PLUGINS) + for (size_t i = 0; i < arraysize(kPredefinedAllowedCameraDeviceOrigins); ++i) + allowed_camera_device_origins_.insert( + kPredefinedAllowedCameraDeviceOrigins[i]); + for (size_t i = 0; i < arraysize(kPredefinedAllowedCompositorOrigins); ++i) + allowed_compositor_origins_.insert(kPredefinedAllowedCompositorOrigins[i]); +#endif +#if defined(ENABLE_PRINTING) + printing::SetAgent(GetUserAgent()); +#endif +} + +ChromeContentRendererClient::~ChromeContentRendererClient() { +} + +void ChromeContentRendererClient::RenderThreadStarted() { + RenderThread* thread = RenderThread::Get(); + + thread->Send(new StartupMetricHostMsg_RecordRendererMainEntryTime( + main_entry_time_)); + + chrome_observer_.reset(new ChromeRenderThreadObserver()); + web_cache_impl_.reset(new web_cache::WebCacheImpl()); + +#if defined(ENABLE_EXTENSIONS) + ChromeExtensionsRendererClient::GetInstance()->RenderThreadStarted(); +#endif + + prescient_networking_dispatcher_.reset( + new network_hints::PrescientNetworkingDispatcher()); +#if defined(ENABLE_SPELLCHECK) + // ChromeRenderViewTest::SetUp() creates a Spellcheck and injects it using + // SetSpellcheck(). Don't overwrite it. + if (!spellcheck_) { + spellcheck_.reset(new SpellCheck()); + thread->AddObserver(spellcheck_.get()); + } +#endif + visited_link_slave_.reset(new visitedlink::VisitedLinkSlave()); +#if defined(FULL_SAFE_BROWSING) + phishing_classifier_.reset(safe_browsing::PhishingClassifierFilter::Create()); +#endif + prerender_dispatcher_.reset(new prerender::PrerenderDispatcher()); +#if defined(ENABLE_WEBRTC) + webrtc_logging_message_filter_ = new WebRtcLoggingMessageFilter( + thread->GetIOMessageLoopProxy()); +#endif + + thread->AddObserver(chrome_observer_.get()); +#if defined(FULL_SAFE_BROWSING) + thread->AddObserver(phishing_classifier_.get()); +#endif + thread->AddObserver(visited_link_slave_.get()); + thread->AddObserver(prerender_dispatcher_.get()); + thread->AddObserver(SearchBouncer::GetInstance()); + +#if defined(ENABLE_WEBRTC) + thread->AddFilter(webrtc_logging_message_filter_.get()); +#endif + + thread->RegisterExtension(extensions_v8::ExternalExtension::Get()); + thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kEnableBenchmarking)) + thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get()); + if (command_line->HasSwitch(switches::kEnableNetBenchmarking)) + thread->RegisterExtension(extensions_v8::NetBenchmarkingExtension::Get()); + if (command_line->HasSwitch(switches::kInstantProcess)) + thread->RegisterExtension(extensions_v8::SearchBoxExtension::Get()); + + // chrome-search: and chrome-distiller: pages should not be accessible by + // normal content, and should also be unable to script anything but themselves + // (to help limit the damage that a corrupt page could cause). + WebString chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme)); + + // The Instant process can only display the content but not read it. Other + // processes can't display it or read it. + if (!command_line->HasSwitch(switches::kInstantProcess)) + WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); + + WebString dom_distiller_scheme( + ASCIIToUTF16(dom_distiller::kDomDistillerScheme)); + // TODO(nyquist): Add test to ensure this happens when the flag is set. + WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dom_distiller_scheme); + +#if defined(OS_CHROMEOS) + WebSecurityPolicy::registerURLSchemeAsLocal( + WebString::fromUTF8(content::kExternalFileScheme)); +#endif + +#if defined(OS_ANDROID) + WebSecurityPolicy::registerURLSchemeAsAllowedForReferrer( + WebString::fromUTF8(chrome::kAndroidAppScheme)); +#endif + +#if defined(ENABLE_IPC_FUZZER) + if (command_line->HasSwitch(switches::kIpcDumpDirectory)) { + base::FilePath dump_directory = + command_line->GetSwitchValuePath(switches::kIpcDumpDirectory); + IPC::ChannelProxy::OutgoingMessageFilter* filter = + LoadExternalIPCDumper(dump_directory); + thread->GetChannel()->set_outgoing_message_filter(filter); + } +#endif + + // chrome-search: pages should not be accessible by bookmarklets + // or javascript: URLs typed in the omnibox. + WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( + chrome_search_scheme); + + // chrome-search: resources shouldn't trigger insecure content warnings. Note + // that chrome-extension: and chrome-extension-resource: schemes are taken + // care of in extensions::Dispatcher. + WebSecurityPolicy::registerURLSchemeAsSecure(chrome_search_scheme); + +#if defined(ENABLE_PRINT_PREVIEW) + pdf_print_client_.reset(new ChromePDFPrintClient()); + pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); +#endif + + std::set origins; + GetSecureOriginWhitelist(&origins); + for (const GURL& origin : origins) { + WebSecurityPolicy::addOriginTrustworthyWhiteList( + WebSecurityOrigin::create(origin)); + } + + std::set schemes; + GetSchemesBypassingSecureContextCheckWhitelist(&schemes); + for (const std::string& scheme : schemes) { + WebSecurityPolicy::addSchemeToBypassSecureContextWhitelist( + WebString::fromUTF8(scheme)); + } +} + +void ChromeContentRendererClient::RenderFrameCreated( + content::RenderFrame* render_frame) { + new ChromeRenderFrameObserver(render_frame); + + bool should_whitelist_for_content_settings = + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kInstantProcess); + extensions::Dispatcher* ext_dispatcher = NULL; +#if defined(ENABLE_EXTENSIONS) + ext_dispatcher = + ChromeExtensionsRendererClient::GetInstance()->extension_dispatcher(); +#endif + ContentSettingsObserver* content_settings = new ContentSettingsObserver( + render_frame, ext_dispatcher, should_whitelist_for_content_settings); + if (chrome_observer_.get()) { + content_settings->SetContentSettingRules( + chrome_observer_->content_setting_rules()); + } + +#if defined(ENABLE_EXTENSIONS) + ChromeExtensionsRendererClient::GetInstance()->RenderFrameCreated( + render_frame); +#endif + +#if defined(ENABLE_PLUGINS) + new PepperHelper(render_frame); +#endif + +#if !defined(DISABLE_NACL) + new nacl::NaClHelper(render_frame); +#endif + +#if defined(FULL_SAFE_BROWSING) + safe_browsing::ThreatDOMDetails::Create(render_frame); +#endif + + new NetErrorHelper(render_frame); + + if (render_frame->IsMainFrame()) { + // Only attach MainRenderFrameObserver to the main frame, since + // we only want to log page load metrics for the main frame. + new page_load_metrics::MetricsRenderFrameObserver(render_frame); + } else { + // Avoid any race conditions from having the browser tell subframes that + // they're prerendering. + if (prerender::PrerenderHelper::IsPrerendering( + render_frame->GetRenderView()->GetMainRenderFrame())) { + new prerender::PrerenderHelper(render_frame); + } + } + + // Set up a mojo service to test if this page is a distiller page. + new dom_distiller::DistillerJsRenderFrameObserver( + render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); + + // Create DistillabilityAgent to send distillability updates to + // DistillabilityDriver in the browser process. + new dom_distiller::DistillabilityAgent(render_frame); + + // Set up a mojo service to test if this page is a contextual search page. + new contextual_search::OverlayJsRenderFrameObserver(render_frame); + + PasswordAutofillAgent* password_autofill_agent = + new PasswordAutofillAgent(render_frame); + PasswordGenerationAgent* password_generation_agent = + new PasswordGenerationAgent(render_frame, password_autofill_agent); + new AutofillAgent(render_frame, password_autofill_agent, + password_generation_agent); +} + +void ChromeContentRendererClient::RenderViewCreated( + content::RenderView* render_view) { +#if defined(ENABLE_EXTENSIONS) + ChromeExtensionsRendererClient::GetInstance()->RenderViewCreated(render_view); +#endif + new PageLoadHistograms(render_view); +#if defined(ENABLE_PRINTING) + new printing::PrintWebViewHelper( + render_view, std::unique_ptr( + new ChromePrintWebViewHelperDelegate())); +#endif +#if defined(ENABLE_SPELLCHECK) + new SpellCheckProvider(render_view, spellcheck_.get()); +#endif + new prerender::PrerendererClient(render_view); + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kInstantProcess)) + new SearchBox(render_view); + + new ChromeRenderViewObserver(render_view, web_cache_impl_.get()); + + new password_manager::CredentialManagerClient(render_view); +} + + +SkBitmap* ChromeContentRendererClient::GetSadPluginBitmap() { + return const_cast(ResourceBundle::GetSharedInstance(). + GetImageNamed(IDR_SAD_PLUGIN).ToSkBitmap()); +} + +SkBitmap* ChromeContentRendererClient::GetSadWebViewBitmap() { + return const_cast(ResourceBundle::GetSharedInstance(). + GetImageNamed(IDR_SAD_WEBVIEW).ToSkBitmap()); +} + +bool ChromeContentRendererClient::OverrideCreatePlugin( + content::RenderFrame* render_frame, + WebLocalFrame* frame, + const WebPluginParams& params, + WebPlugin** plugin) { + std::string orig_mime_type = params.mimeType.utf8(); +#if defined(ENABLE_EXTENSIONS) + if (!ChromeExtensionsRendererClient::GetInstance()->OverrideCreatePlugin( + render_frame, params)) { + return false; + } +#endif + + GURL url(params.url); +#if defined(ENABLE_PLUGINS) + ChromeViewHostMsg_GetPluginInfo_Output output; + WebString top_origin = frame->top()->getSecurityOrigin().toString(); + render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( + render_frame->GetRoutingID(), url, blink::WebStringToGURL(top_origin), + orig_mime_type, &output)); + *plugin = CreatePlugin(render_frame, frame, params, output); +#else // !defined(ENABLE_PLUGINS) + +#if defined(OS_ANDROID) + if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { + base::StringPiece template_html( + ResourceBundle::GetSharedInstance().GetRawDataResource( + IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); + *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params, + template_html))->plugin(); + return true; + } +#endif // defined(OS_ANDROID) + + PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); + *plugin = NonLoadablePluginPlaceholder::CreateNotSupportedPlugin( + render_frame, frame, params)->plugin(); + +#endif // defined(ENABLE_PLUGINS) + return true; +} + +WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( + content::RenderFrame* render_frame, + const base::FilePath& plugin_path) { + return NonLoadablePluginPlaceholder::CreateErrorPlugin(render_frame, + plugin_path)->plugin(); +} + +void ChromeContentRendererClient::DeferMediaLoad( + content::RenderFrame* render_frame, + bool has_played_media_before, + const base::Closure& closure) { + // Don't allow autoplay/autoload of media resources in a RenderFrame that is + // hidden and has never played any media before. We want to allow future + // loads even when hidden to allow playlist-like functionality. + // + // NOTE: This is also used to defer media loading for prerender. + // NOTE: Switch can be used to allow autoplay, unless frame is prerendered. + // + // TODO(dalecurtis): Include an idle check too. http://crbug.com/509135 + if ((render_frame->IsHidden() && !has_played_media_before && + !base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableGestureRequirementForMediaPlayback)) || + prerender::PrerenderHelper::IsPrerendering(render_frame)) { + new MediaLoadDeferrer(render_frame, closure); + return; + } + + closure.Run(); +} + +#if defined(ENABLE_PLUGINS) +WebPlugin* ChromeContentRendererClient::CreatePlugin( + content::RenderFrame* render_frame, + WebLocalFrame* frame, + const WebPluginParams& original_params, + const ChromeViewHostMsg_GetPluginInfo_Output& output) { + const WebPluginInfo& info = output.plugin; + const std::string& actual_mime_type = output.actual_mime_type; + const base::string16& group_name = output.group_name; + const std::string& identifier = output.group_identifier; + ChromeViewHostMsg_GetPluginInfo_Status status = output.status; + GURL url(original_params.url); + std::string orig_mime_type = original_params.mimeType.utf8(); + ChromePluginPlaceholder* placeholder = NULL; + + // If the browser plugin is to be enabled, this should be handled by the + // renderer, so the code won't reach here due to the early exit in + // OverrideCreatePlugin. + if (status == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound || + orig_mime_type == content::kBrowserPluginMimeType) { + PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); + placeholder = ChromePluginPlaceholder::CreateLoadableMissingPlugin( + render_frame, frame, original_params); + } else { + // TODO(bauerb): This should be in content/. + WebPluginParams params(original_params); + for (size_t i = 0; i < info.mime_types.size(); ++i) { + if (info.mime_types[i].mime_type == actual_mime_type) { + AppendParams(info.mime_types[i].additional_param_names, + info.mime_types[i].additional_param_values, + ¶ms.attributeNames, ¶ms.attributeValues); + break; + } + } + if (params.mimeType.isNull() && (actual_mime_type.size() > 0)) { + // Webkit might say that mime type is null while we already know the + // actual mime type via ChromeViewHostMsg_GetPluginInfo. In that case + // we should use what we know since WebpluginDelegateProxy does some + // specific initializations based on this information. + params.mimeType = WebString::fromUTF8(actual_mime_type.c_str()); + } + + ContentSettingsObserver* observer = + ContentSettingsObserver::Get(render_frame); + + const ContentSettingsType content_type = + ShouldUseJavaScriptSettingForPlugin(info) + ? CONTENT_SETTINGS_TYPE_JAVASCRIPT + : CONTENT_SETTINGS_TYPE_PLUGINS; + + if ((status == ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized || + status == ChromeViewHostMsg_GetPluginInfo_Status::kBlocked) && + observer->IsPluginTemporarilyAllowed(identifier)) { + status = ChromeViewHostMsg_GetPluginInfo_Status::kAllowed; + } + + auto create_blocked_plugin = [&render_frame, &frame, ¶ms, &info, + &identifier, &group_name]( + int template_id, const base::string16& message) { + return ChromePluginPlaceholder::CreateBlockedPlugin( + render_frame, frame, params, info, identifier, group_name, + template_id, message, PowerSaverInfo()); + }; + switch (status) { + case ChromeViewHostMsg_GetPluginInfo_Status::kNotFound: { + NOTREACHED(); + break; + } + case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: + case ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent: { +#if !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS) + const bool is_nacl_plugin = + info.name == ASCIIToUTF16(nacl::kNaClPluginName); + const bool is_nacl_mime_type = + actual_mime_type == nacl::kNaClPluginMimeType; + const bool is_pnacl_mime_type = + actual_mime_type == nacl::kPnaclPluginMimeType; + if (is_nacl_plugin || is_nacl_mime_type || is_pnacl_mime_type) { + bool is_nacl_unrestricted = false; + if (is_nacl_mime_type) { + is_nacl_unrestricted = + base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableNaCl); + } else if (is_pnacl_mime_type) { + is_nacl_unrestricted = true; + } + GURL manifest_url; + GURL app_url; + if (is_nacl_mime_type || is_pnacl_mime_type) { + // Normal NaCl/PNaCl embed. The app URL is the page URL. + manifest_url = url; + app_url = frame->top()->document().url(); + } else { + // NaCl is being invoked as a content handler. Look up the NaCl + // module using the MIME type. The app URL is the manifest URL. + manifest_url = GetNaClContentHandlerURL(actual_mime_type, info); + app_url = manifest_url; + } + const Extension* extension = + extensions::RendererExtensionRegistry::Get() + ->GetExtensionOrAppByURL(manifest_url); + if (!IsNaClAllowed(manifest_url, + app_url, + is_nacl_unrestricted, + extension, + ¶ms)) { + WebString error_message; + if (is_nacl_mime_type) { + error_message = + "Only unpacked extensions and apps installed from the Chrome " + "Web Store can load NaCl modules without enabling Native " + "Client in about:flags."; + } else if (is_pnacl_mime_type) { + error_message = + "Portable Native Client must not be disabled in about:flags."; + } + frame->addMessageToConsole( + WebConsoleMessage(WebConsoleMessage::LevelError, + error_message)); + placeholder = create_blocked_plugin( + IDR_BLOCKED_PLUGIN_HTML, +#if defined(OS_CHROMEOS) + l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED)); +#else + l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); +#endif + break; + } + } +#endif // !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS) + + // Delay loading plugins if prerendering. + // TODO(mmenke): In the case of prerendering, feed into + // ChromeContentRendererClient::CreatePlugin instead, to + // reduce the chance of future regressions. + bool is_prerendering = + prerender::PrerenderHelper::IsPrerendering(render_frame); + + bool power_saver_setting_on = + status == + ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent; + PowerSaverInfo power_saver_info = + PowerSaverInfo::Get(render_frame, power_saver_setting_on, params, + info, frame->document().url()); + if (power_saver_info.blocked_for_background_tab || is_prerendering || + !power_saver_info.poster_attribute.empty()) { + placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( + render_frame, frame, params, info, identifier, group_name, + power_saver_info.poster_attribute.empty() + ? IDR_BLOCKED_PLUGIN_HTML + : IDR_PLUGIN_POSTER_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), + power_saver_info); + placeholder->set_blocked_for_prerendering(is_prerendering); + placeholder->AllowLoading(); + break; + } + + std::unique_ptr throttler; + if (power_saver_info.power_saver_enabled) { + throttler = PluginInstanceThrottler::Create(); + // PluginPreroller manages its own lifetime. + new PluginPreroller( + render_frame, frame, params, info, identifier, group_name, + l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), + throttler.get()); + } + + return render_frame->CreatePlugin(frame, info, params, + std::move(throttler)); + } + case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { + PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type, + url); + placeholder = create_blocked_plugin( + IDR_DISABLED_PLUGIN_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); + break; + } + case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { +#if defined(ENABLE_PLUGIN_INSTALLATION) + placeholder = create_blocked_plugin( + IDR_BLOCKED_PLUGIN_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); + placeholder->AllowLoading(); + render_frame->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( + render_frame->GetRoutingID(), placeholder->CreateRoutingId(), + identifier)); +#else + NOTREACHED(); +#endif + break; + } + case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed: { + placeholder = create_blocked_plugin( + IDR_BLOCKED_PLUGIN_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); + break; + } + case ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized: { + placeholder = create_blocked_plugin( + IDR_BLOCKED_PLUGIN_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_NOT_AUTHORIZED, group_name)); + placeholder->AllowLoading(); + render_frame->Send(new ChromeViewHostMsg_BlockedUnauthorizedPlugin( + render_frame->GetRoutingID(), group_name, identifier)); + observer->DidBlockContentType(content_type, group_name); + break; + } + case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: { + placeholder = create_blocked_plugin( + IDR_BLOCKED_PLUGIN_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); + placeholder->AllowLoading(); + RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); + observer->DidBlockContentType(content_type, group_name); + break; + } + case ChromeViewHostMsg_GetPluginInfo_Status::kBlockedByPolicy: { + placeholder = create_blocked_plugin( + IDR_BLOCKED_PLUGIN_HTML, + l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_BY_POLICY, + group_name)); + RenderThread::Get()->RecordAction( + UserMetricsAction("Plugin_BlockedByPolicy")); + observer->DidBlockContentType(content_type, group_name); + break; + } + } + } + placeholder->SetStatus(status); + return placeholder->plugin(); +} +#endif // defined(ENABLE_PLUGINS) + +// For NaCl content handling plugins, the NaCl manifest is stored in an +// additonal 'nacl' param associated with the MIME type. +// static +GURL ChromeContentRendererClient::GetNaClContentHandlerURL( + const std::string& actual_mime_type, + const content::WebPluginInfo& plugin) { + // Look for the manifest URL among the MIME type's additonal parameters. + const char kNaClPluginManifestAttribute[] = "nacl"; + base::string16 nacl_attr = ASCIIToUTF16(kNaClPluginManifestAttribute); + for (size_t i = 0; i < plugin.mime_types.size(); ++i) { + if (plugin.mime_types[i].mime_type == actual_mime_type) { + const content::WebPluginMimeType& content_type = plugin.mime_types[i]; + for (size_t i = 0; i < content_type.additional_param_names.size(); ++i) { + if (content_type.additional_param_names[i] == nacl_attr) + return GURL(content_type.additional_param_values[i]); + } + break; + } + } + return GURL(); +} + +#if !defined(DISABLE_NACL) +// static +bool ChromeContentRendererClient::IsNaClAllowed( + const GURL& manifest_url, + const GURL& app_url, + bool is_nacl_unrestricted, + const Extension* extension, + WebPluginParams* params) { + // Temporarily allow these whitelisted apps and WebUIs to use NaCl. + std::string app_url_host = app_url.host(); + std::string manifest_url_path = manifest_url.path(); + + bool is_whitelisted_web_ui = + app_url.spec() == chrome::kChromeUIAppListStartPageURL; + + bool is_photo_app = + // Whitelisted apps must be served over https. + app_url.SchemeIsCryptographic() && manifest_url.SchemeIsCryptographic() && + (base::EndsWith(app_url_host, "plus.google.com", + base::CompareCase::INSENSITIVE_ASCII) || + base::EndsWith(app_url_host, "plus.sandbox.google.com", + base::CompareCase::INSENSITIVE_ASCII)) && + manifest_url.DomainIs("ssl.gstatic.com") && + (manifest_url_path.find("s2/oz/nacl/") == 1 || + manifest_url_path.find("photos/nacl/") == 1); + + std::string manifest_fs_host; + if (manifest_url.SchemeIsFileSystem() && manifest_url.inner_url()) { + manifest_fs_host = manifest_url.inner_url()->host(); + } + bool is_hangouts_app = + // Whitelisted apps must be served over secure scheme. + app_url.SchemeIsCryptographic() && manifest_url.SchemeIsFileSystem() && + manifest_url.inner_url()->SchemeIsCryptographic() && + (base::EndsWith(app_url_host, "talkgadget.google.com", + base::CompareCase::INSENSITIVE_ASCII) || + base::EndsWith(app_url_host, "plus.google.com", + base::CompareCase::INSENSITIVE_ASCII) || + base::EndsWith(app_url_host, "plus.sandbox.google.com", + base::CompareCase::INSENSITIVE_ASCII) || + base::EndsWith(app_url_host, "hangouts.google.com", + base::CompareCase::INSENSITIVE_ASCII)) && + // The manifest must be loaded from the host's FileSystem. + (manifest_fs_host == app_url_host); + + bool is_whitelisted_app = is_photo_app || is_hangouts_app; + + bool is_invoked_by_webstore_installed_extension = false; + bool is_extension_unrestricted = false; + bool is_extension_force_installed = false; +#if defined(ENABLE_EXTENSIONS) + bool is_extension_from_webstore = extension && extension->from_webstore(); + + bool is_invoked_by_extension = app_url.SchemeIs("chrome-extension"); + bool is_invoked_by_hosted_app = extension && + extension->is_hosted_app() && + extension->web_extent().MatchesURL(app_url); + + is_invoked_by_webstore_installed_extension = is_extension_from_webstore && + (is_invoked_by_extension || is_invoked_by_hosted_app); + + // Allow built-in extensions and developer mode extensions. + is_extension_unrestricted = extension && + (extensions::Manifest::IsUnpackedLocation(extension->location()) || + extensions::Manifest::IsComponentLocation(extension->location())); + // Allow extensions force installed by admin policy. + is_extension_force_installed = extension && + extensions::Manifest::IsPolicyLocation(extension->location()); +#endif // defined(ENABLE_EXTENSIONS) + + // Allow NaCl under any of the following circumstances: + // 1) An app or URL is explictly whitelisted above. + // 2) An extension is loaded unpacked or built-in (component) to Chrome. + // 3) An extension is force installed by policy. + // 4) An extension is installed from the webstore, and invoked in that + // context (hosted app URL or chrome-extension:// scheme). + // 5) --enable-nacl is set. + bool is_nacl_allowed_by_location = + is_whitelisted_web_ui || + is_whitelisted_app || + is_extension_unrestricted || + is_extension_force_installed || + is_invoked_by_webstore_installed_extension; + bool is_nacl_allowed = is_nacl_allowed_by_location || is_nacl_unrestricted; + if (is_nacl_allowed) { + // Make sure that PPAPI 'dev' interfaces are only available for unpacked + // and component extensions. Also allow dev interfaces when --enable-nacl + // is set, but do not allow --enable-nacl to provide dev interfaces to + // webstore installed and other normally allowed URLs. + WebString dev_attribute = WebString::fromUTF8("@dev"); + if (is_extension_unrestricted || + (is_nacl_unrestricted && !is_nacl_allowed_by_location)) { + // Add the special '@dev' attribute. + std::vector param_names; + std::vector param_values; + param_names.push_back(dev_attribute); + param_values.push_back(WebString()); + AppendParams( + param_names, + param_values, + ¶ms->attributeNames, + ¶ms->attributeValues); + } else { + // If the params somehow contain '@dev', remove it. + size_t attribute_count = params->attributeNames.size(); + for (size_t i = 0; i < attribute_count; ++i) { + if (params->attributeNames[i].equals(dev_attribute)) + params->attributeNames[i] = WebString(); + } + } + } + return is_nacl_allowed; +} +#endif // defined(DISABLE_NACL) + +bool ChromeContentRendererClient::HasErrorPage(int http_status_code, + std::string* error_domain) { + // Use an internal error page, if we have one for the status code. + if (!error_page::LocalizedError::HasStrings( + error_page::LocalizedError::kHttpErrorDomain, http_status_code)) { + return false; + } + + *error_domain = error_page::LocalizedError::kHttpErrorDomain; + return true; +} + +bool ChromeContentRendererClient::ShouldSuppressErrorPage( + content::RenderFrame* render_frame, + const GURL& url) { + // Unit tests for ChromeContentRendererClient pass a NULL RenderFrame here. + // Unfortunately it's very difficult to construct a mock RenderView, so skip + // this functionality in this case. + if (render_frame && + NetErrorHelper::Get(render_frame)->ShouldSuppressErrorPage(url)) { + return true; + } + // Do not flash an error page if the Instant new tab page fails to load. + return SearchBouncer::GetInstance()->IsNewTabPage(url); +} + +void ChromeContentRendererClient::GetNavigationErrorStrings( + content::RenderFrame* render_frame, + const WebURLRequest& failed_request, + const WebURLError& error, + std::string* error_html, + base::string16* error_description) { + const GURL failed_url = error.unreachableURL; + + bool is_post = base::EqualsASCII( + base::StringPiece16(failed_request.httpMethod()), "POST"); + bool is_ignoring_cache = + failed_request.getCachePolicy() == WebCachePolicy::BypassingCache; + if (error_html) { + NetErrorHelper::Get(render_frame) + ->GetErrorHTML(error, is_post, is_ignoring_cache, error_html); + } + + if (error_description) { + *error_description = error_page::LocalizedError::GetErrorDetails( + error.domain.utf8(), error.reason, is_post); + } +} + +bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { +#if defined(ENABLE_EXTENSIONS) + return !IsStandaloneExtensionProcess(); +#else + return true; +#endif +} + +bool ChromeContentRendererClient:: + AllowTimerSuspensionWhenProcessBackgrounded() { +#if defined(OS_ANDROID) + return true; +#else + return false; +#endif +} + +bool ChromeContentRendererClient::AllowPopup() { +#if defined(ENABLE_EXTENSIONS) + return ChromeExtensionsRendererClient::GetInstance()->AllowPopup(); +#else + return false; +#endif +} + +bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame, + const GURL& url, + const std::string& http_method, + bool is_initial_navigation, + bool is_server_redirect, + bool* send_referrer) { + DCHECK(!frame->parent()); + + // If this is the Instant process, fork all navigations originating from the + // renderer. The destination page will then be bucketed back to this Instant + // process if it is an Instant url, or to another process if not. Conversely, + // fork if this is a non-Instant process navigating to an Instant url, so that + // such navigations can also be bucketed into an Instant renderer. + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kInstantProcess) || + SearchBouncer::GetInstance()->ShouldFork(url)) { + *send_referrer = true; + return true; + } + + // For now, we skip the rest for POST submissions. This is because + // http://crbug.com/101395 is more likely to cause compatibility issues + // with hosted apps and extensions than WebUI pages. We will remove this + // check when cross-process POST submissions are supported. + if (http_method != "GET") + return false; + + // If |url| matches one of the prerendered URLs, stop this navigation and try + // to swap in the prerendered page on the browser process. If the prerendered + // page no longer exists by the time the OpenURL IPC is handled, a normal + // navigation is attempted. + if (prerender_dispatcher_.get() && + prerender_dispatcher_->IsPrerenderURL(url)) { + *send_referrer = true; + return true; + } + +#if defined(ENABLE_EXTENSIONS) + bool should_fork = ChromeExtensionsRendererClient::ShouldFork( + frame, url, is_initial_navigation, is_server_redirect, send_referrer); + if (should_fork) + return true; +#endif // defined(ENABLE_EXTENSIONS) + + return false; +} + +bool ChromeContentRendererClient::WillSendRequest( + WebFrame* frame, + ui::PageTransition transition_type, + const GURL& url, + const GURL& first_party_for_cookies, + GURL* new_url) { + // Check whether the request should be allowed. If not allowed, we reset the + // URL to something invalid to prevent the request and cause an error. +#if defined(ENABLE_EXTENSIONS) + if (ChromeExtensionsRendererClient::GetInstance()->WillSendRequest( + frame, transition_type, url, new_url)) { + return true; + } +#endif + + const content::RenderView* render_view = + content::RenderView::FromWebView(frame->view()); + SearchBox* search_box = SearchBox::Get(render_view); + if (search_box && url.SchemeIs(chrome::kChromeSearchScheme)) { + SearchBox::ImageSourceType type = SearchBox::NONE; + if (url.host() == chrome::kChromeUIFaviconHost) + type = SearchBox::FAVICON; + else if (url.host() == chrome::kChromeUILargeIconHost) + type = SearchBox::LARGE_ICON; + else if (url.host() == chrome::kChromeUIFallbackIconHost) + type = SearchBox::FALLBACK_ICON; + else if (url.host() == chrome::kChromeUIThumbnailHost) + type = SearchBox::THUMB; + + if (type != SearchBox::NONE) + return search_box->GenerateImageURLFromTransientURL(url, type, new_url); + } + + return false; +} + +unsigned long long ChromeContentRendererClient::VisitedLinkHash( + const char* canonical_url, size_t length) { + return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); +} + +bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { + return visited_link_slave_->IsVisited(link_hash); +} + +blink::WebPrescientNetworking* +ChromeContentRendererClient::GetPrescientNetworking() { + return prescient_networking_dispatcher_.get(); +} + +bool ChromeContentRendererClient::ShouldOverridePageVisibilityState( + const content::RenderFrame* render_frame, + blink::WebPageVisibilityState* override_state) { + if (!prerender::PrerenderHelper::IsPrerendering(render_frame)) + return false; + + *override_state = blink::WebPageVisibilityStatePrerender; + return true; +} + +#if defined(ENABLE_SPELLCHECK) +void ChromeContentRendererClient::SetSpellcheck(SpellCheck* spellcheck) { + RenderThread* thread = RenderThread::Get(); + if (spellcheck_.get() && thread) + thread->RemoveObserver(spellcheck_.get()); + spellcheck_.reset(spellcheck); + SpellCheckReplacer replacer(spellcheck_.get()); + content::RenderView::ForEach(&replacer); + if (thread) + thread->AddObserver(spellcheck_.get()); +} +#endif + +bool ChromeContentRendererClient::IsExternalPepperPlugin( + const std::string& module_name) { + // TODO(bbudge) remove this when the trusted NaCl plugin has been removed. + // We must defer certain plugin events for NaCl instances since we switch + // from the in-process to the out-of-process proxy after instantiating them. + return module_name == "Native Client"; +} + +#if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) +bool ChromeContentRendererClient::IsExtensionOrSharedModuleWhitelisted( + const GURL& url, const std::set& whitelist) { + const extensions::ExtensionSet* extension_set = + extensions::RendererExtensionRegistry::Get()->GetMainThreadExtensionSet(); + return chrome::IsExtensionOrSharedModuleWhitelisted(url, extension_set, + whitelist); +} +#endif + +blink::WebSpeechSynthesizer* +ChromeContentRendererClient::OverrideSpeechSynthesizer( + blink::WebSpeechSynthesizerClient* client) { + return new TtsDispatcher(client); +} + +bool ChromeContentRendererClient::AllowPepperMediaStreamAPI( + const GURL& url) { +#if !defined(OS_ANDROID) + // Allow only the Hangouts app to use the MediaStream APIs. It's OK to check + // the whitelist in the renderer, since we're only preventing access until + // these APIs are public and stable. + std::string url_host = url.host(); + if (url.SchemeIs("https") && + (base::EndsWith(url_host, "talkgadget.google.com", + base::CompareCase::INSENSITIVE_ASCII) || + base::EndsWith(url_host, "plus.google.com", + base::CompareCase::INSENSITIVE_ASCII) || + base::EndsWith(url_host, "plus.sandbox.google.com", + base::CompareCase::INSENSITIVE_ASCII)) && + base::StartsWith(url.path(), "/hangouts/", + base::CompareCase::INSENSITIVE_ASCII)) { + return true; + } + // Allow access for tests. + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnablePepperTesting)) { + return true; + } +#endif // !defined(OS_ANDROID) + return false; +} + +void ChromeContentRendererClient::AddSupportedKeySystems( + std::vector>* key_systems) { + AddChromeKeySystems(key_systems); +} + +bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource( + const base::string16& source) const { +#if defined(ENABLE_EXTENSIONS) + return extensions::IsSourceFromAnExtension(source); +#else + return false; +#endif +} + +bool ChromeContentRendererClient::ShouldGatherSiteIsolationStats() const { + // Site isolation stats are gathered currently for non-extension renderer + // processes running a normal web page from the Internet. + // TODO(nick): https://crbug.com/268640 Gather stats for extension processes + // too; we would need to check the extension's manifest to know which sites + // it's allowed to access. +#if defined(ENABLE_EXTENSIONS) + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + return !command_line->HasSwitch(extensions::switches::kExtensionProcess); +#else + return true; +#endif +} + +blink::WebWorkerContentSettingsClientProxy* +ChromeContentRendererClient::CreateWorkerContentSettingsClientProxy( + content::RenderFrame* render_frame, + WebFrame* frame) { + return new WorkerContentSettingsClientProxy(render_frame, frame); +} + +bool ChromeContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() { +#if defined(ENABLE_PLUGINS) + // Allow access for tests. + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnablePepperTesting)) { + return true; + } + + version_info::Channel channel = chrome::GetChannel(); + // Allow dev channel APIs to be used on "Canary", "Dev", and "Unknown" + // releases of Chrome. Permitting "Unknown" allows these APIs to be used on + // Chromium builds as well. + return channel <= version_info::Channel::DEV; +#else + return false; +#endif +} + +bool ChromeContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI( + const GURL& url) { +#if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnablePepperTesting)) + return true; + + if (IsExtensionOrSharedModuleWhitelisted(url, allowed_camera_device_origins_)) + return true; +#endif + + return false; +} + +bool ChromeContentRendererClient::IsPluginAllowedToUseCompositorAPI( + const GURL& url) { +#if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnablePepperTesting)) + return true; + if (IsExtensionOrSharedModuleWhitelisted(url, allowed_compositor_origins_)) + return true; + + version_info::Channel channel = chrome::GetChannel(); + return channel <= version_info::Channel::DEV; +#else + return false; +#endif +} + +content::BrowserPluginDelegate* +ChromeContentRendererClient::CreateBrowserPluginDelegate( + content::RenderFrame* render_frame, + const std::string& mime_type, + const GURL& original_url) { +#if defined(ENABLE_EXTENSIONS) + return ChromeExtensionsRendererClient::CreateBrowserPluginDelegate( + render_frame, mime_type, original_url); +#else + return nullptr; +#endif +} + +void ChromeContentRendererClient::RecordRappor(const std::string& metric, + const std::string& sample) { + RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); +} + +void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, + const GURL& url) { + RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); +} + +std::unique_ptr +ChromeContentRendererClient::CreateAppBannerClient( + content::RenderFrame* render_frame) { + return std::unique_ptr( + new AppBannerClient(render_frame)); +} + +void ChromeContentRendererClient::AddImageContextMenuProperties( + const WebURLResponse& response, + std::map* properties) { + DCHECK(properties); + WebString header_key(ASCIIToUTF16( + data_reduction_proxy::chrome_proxy_header())); + if (!response.httpHeaderField(header_key).isNull() && + response.httpHeaderField(header_key).utf8().find( + data_reduction_proxy::chrome_proxy_lo_fi_directive()) != + std::string::npos) { + (*properties)[data_reduction_proxy::chrome_proxy_header()] = + data_reduction_proxy::chrome_proxy_lo_fi_directive(); + } +} + +void ChromeContentRendererClient::RunScriptsAtDocumentStart( + content::RenderFrame* render_frame) { +#if defined(ENABLE_EXTENSIONS) + ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentStart( + render_frame); + // |render_frame| might be dead by now. +#endif +} + +void ChromeContentRendererClient::RunScriptsAtDocumentEnd( + content::RenderFrame* render_frame) { +#if defined(ENABLE_EXTENSIONS) + ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( + render_frame); + // |render_frame| might be dead by now. +#endif +} + +void +ChromeContentRendererClient::DidInitializeServiceWorkerContextOnWorkerThread( + v8::Local context, + const GURL& url) { +#if defined(ENABLE_EXTENSIONS) + extensions::Dispatcher::DidInitializeServiceWorkerContextOnWorkerThread( + context, url); +#endif +} + +void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( + v8::Local context, + const GURL& url) { +#if defined(ENABLE_EXTENSIONS) + extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(context, + url); +#endif +} + +// If we're in an extension, there is no need disabling multiple routes as +// chrome.system.network.getNetworkInterfaces provides the same +// information. Also, the enforcement of sending and binding UDP is already done +// by chrome extension permission model. +bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { +#if defined(ENABLE_EXTENSIONS) + return !IsStandaloneExtensionProcess(); +#else + return true; +#endif +} diff --git a/lib/cpplint_1.4.5/samples/chromium-sample/src/chrome_content_renderer_client.h b/lib/cpplint_1.4.5/samples/chromium-sample/src/chrome_content_renderer_client.h new file mode 100644 index 00000000000..894fdd0a1dc --- /dev/null +++ b/lib/cpplint_1.4.5/samples/chromium-sample/src/chrome_content_renderer_client.h @@ -0,0 +1,225 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ +#define CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ + +#include + +#include +#include +#include +#include +#include + +#include "base/compiler_specific.h" +#include "base/gtest_prod_util.h" +#include "base/strings/string16.h" +#include "content/public/renderer/content_renderer_client.h" +#include "ipc/ipc_channel_proxy.h" +#include "v8/include/v8.h" + +class ChromeRenderThreadObserver; +#if defined(ENABLE_PRINT_PREVIEW) +class ChromePDFPrintClient; +#endif +class PrescientNetworkingDispatcher; +#if defined(ENABLE_SPELLCHECK) +class SpellCheck; +class SpellCheckProvider; +#endif + +struct ChromeViewHostMsg_GetPluginInfo_Output; + +namespace content { +class BrowserPluginDelegate; +struct WebPluginInfo; +} + +namespace network_hints { +class PrescientNetworkingDispatcher; +} + +namespace extensions { +class Dispatcher; +class Extension; +} + +namespace prerender { +class PrerenderDispatcher; +} + +namespace safe_browsing { +class PhishingClassifierFilter; +} + +namespace visitedlink { +class VisitedLinkSlave; +} + +namespace web_cache { +class WebCacheImpl; +} + +namespace blink { +class WebSecurityOrigin; +} + +#if defined(ENABLE_WEBRTC) +class WebRtcLoggingMessageFilter; +#endif + +class ChromeContentRendererClient : public content::ContentRendererClient { + public: + ChromeContentRendererClient(); + ~ChromeContentRendererClient() override; + + void RenderThreadStarted() override; + void RenderFrameCreated(content::RenderFrame* render_frame) override; + void RenderViewCreated(content::RenderView* render_view) override; + SkBitmap* GetSadPluginBitmap() override; + SkBitmap* GetSadWebViewBitmap() override; + bool OverrideCreatePlugin(content::RenderFrame* render_frame, + blink::WebLocalFrame* frame, + const blink::WebPluginParams& params, + blink::WebPlugin** plugin) override; + blink::WebPlugin* CreatePluginReplacement( + content::RenderFrame* render_frame, + const base::FilePath& plugin_path) override; + bool HasErrorPage(int http_status_code, std::string* error_domain) override; + bool ShouldSuppressErrorPage(content::RenderFrame* render_frame, + const GURL& url) override; + void GetNavigationErrorStrings(content::RenderFrame* render_frame, + const blink::WebURLRequest& failed_request, + const blink::WebURLError& error, + std::string* error_html, + base::string16* error_description) override; + void DeferMediaLoad(content::RenderFrame* render_frame, + bool has_played_media_before, + const base::Closure& closure) override; + bool RunIdleHandlerWhenWidgetsHidden() override; + bool AllowTimerSuspensionWhenProcessBackgrounded() override; + bool AllowPopup() override; + bool ShouldFork(blink::WebLocalFrame* frame, + const GURL& url, + const std::string& http_method, + bool is_initial_navigation, + bool is_server_redirect, + bool* send_referrer) override; + bool WillSendRequest(blink::WebFrame* frame, + ui::PageTransition transition_type, + const GURL& url, + const GURL& first_party_for_cookies, + GURL* new_url) override; + unsigned long long VisitedLinkHash(const char* canonical_url, + size_t length) override; + bool IsLinkVisited(unsigned long long link_hash) override; + blink::WebPrescientNetworking* GetPrescientNetworking() override; + bool ShouldOverridePageVisibilityState( + const content::RenderFrame* render_frame, + blink::WebPageVisibilityState* override_state) override; + bool IsExternalPepperPlugin(const std::string& module_name) override; + blink::WebSpeechSynthesizer* OverrideSpeechSynthesizer( + blink::WebSpeechSynthesizerClient* client) override; + bool ShouldReportDetailedMessageForSource( + const base::string16& source) const override; + bool ShouldGatherSiteIsolationStats() const override; + blink::WebWorkerContentSettingsClientProxy* + CreateWorkerContentSettingsClientProxy(content::RenderFrame* render_frame, + blink::WebFrame* frame) override; + bool AllowPepperMediaStreamAPI(const GURL& url) override; + void AddSupportedKeySystems( + std::vector>* key_systems) + override; + bool IsPluginAllowedToUseDevChannelAPIs() override; + bool IsPluginAllowedToUseCameraDeviceAPI(const GURL& url) override; + bool IsPluginAllowedToUseCompositorAPI(const GURL& url) override; + content::BrowserPluginDelegate* CreateBrowserPluginDelegate( + content::RenderFrame* render_frame, + const std::string& mime_type, + const GURL& original_url) override; + void RecordRappor(const std::string& metric, + const std::string& sample) override; + void RecordRapporURL(const std::string& metric, const GURL& url) override; + std::unique_ptr CreateAppBannerClient( + content::RenderFrame* render_frame) override; + void AddImageContextMenuProperties( + const blink::WebURLResponse& response, + std::map* properties) override; + void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; + void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override; + void DidInitializeServiceWorkerContextOnWorkerThread( + v8::Local context, + const GURL& url) override; + void WillDestroyServiceWorkerContextOnWorkerThread( + v8::Local context, + const GURL& url) override; + bool ShouldEnforceWebRTCRoutingPreferences() override; + +#if defined(ENABLE_SPELLCHECK) + // Sets a new |spellcheck|. Used for testing only. + // Takes ownership of |spellcheck|. + void SetSpellcheck(SpellCheck* spellcheck); +#endif + +#if defined(ENABLE_PLUGINS) + static blink::WebPlugin* CreatePlugin( + content::RenderFrame* render_frame, + blink::WebLocalFrame* frame, + const blink::WebPluginParams& params, + const ChromeViewHostMsg_GetPluginInfo_Output& output); +#endif + +#if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS) + static bool IsExtensionOrSharedModuleWhitelisted( + const GURL& url, const std::set& whitelist); +#endif + + private: + FRIEND_TEST_ALL_PREFIXES(ChromeContentRendererClientTest, NaClRestriction); + FRIEND_TEST_ALL_PREFIXES(ChromeContentRendererClientTest, + ShouldSuppressErrorPage); + + static GURL GetNaClContentHandlerURL(const std::string& actual_mime_type, + const content::WebPluginInfo& plugin); + + // Time at which this object was created. This is very close to the time at + // which the RendererMain function was entered. + base::TimeTicks main_entry_time_; + +#if !defined(DISABLE_NACL) + // Determines if a NaCl app is allowed, and modifies params to pass the app's + // permissions to the trusted NaCl plugin. + static bool IsNaClAllowed(const GURL& manifest_url, + const GURL& app_url, + bool is_nacl_unrestricted, + const extensions::Extension* extension, + blink::WebPluginParams* params); +#endif + + std::unique_ptr chrome_observer_; + std::unique_ptr web_cache_impl_; + + std::unique_ptr + prescient_networking_dispatcher_; + +#if defined(ENABLE_SPELLCHECK) + std::unique_ptr spellcheck_; +#endif + std::unique_ptr visited_link_slave_; + std::unique_ptr phishing_classifier_; + std::unique_ptr prerender_dispatcher_; +#if defined(ENABLE_WEBRTC) + scoped_refptr webrtc_logging_message_filter_; +#endif +#if defined(ENABLE_PRINT_PREVIEW) + std::unique_ptr pdf_print_client_; +#endif +#if defined(ENABLE_PLUGINS) + std::set allowed_camera_device_origins_; + std::set allowed_compositor_origins_; +#endif +}; + +#endif // CHROME_RENDERER_CHROME_CONTENT_RENDERER_CLIENT_H_ diff --git a/lib/cpplint_1.4.5/samples/chromium-sample/src/io_thread.cc b/lib/cpplint_1.4.5/samples/chromium-sample/src/io_thread.cc new file mode 100644 index 00000000000..7b7c1e0efd3 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/chromium-sample/src/io_thread.cc @@ -0,0 +1,1765 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/io_thread.h" + +#include +#include + +#include "base/base64.h" +#include "base/bind.h" +#include "base/bind_helpers.h" +#include "base/command_line.h" +#include "base/compiler_specific.h" +#include "base/debug/leak_tracker.h" +#include "base/environment.h" +#include "base/files/file_path.h" +#include "base/logging.h" +#include "base/macros.h" +#include "base/memory/ptr_util.h" +#include "base/metrics/field_trial.h" +#include "base/metrics/histogram_macros.h" +#include "base/profiler/scoped_tracker.h" +#include "base/stl_util.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_piece.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" +#include "base/strings/utf_string_conversions.h" +#include "base/threading/sequenced_worker_pool.h" +#include "base/threading/thread.h" +#include "base/threading/worker_pool.h" +#include "base/time/time.h" +#include "base/trace_event/trace_event.h" +#include "build/build_config.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/data_usage/tab_id_annotator.h" +#include "chrome/browser/net/async_dns_field_trial.h" +#include "chrome/browser/net/chrome_network_delegate.h" +#include "chrome/browser/net/connect_interceptor.h" +#include "chrome/browser/net/dns_probe_service.h" +#include "chrome/browser/net/proxy_service_factory.h" +#include "chrome/common/channel_info.h" +#include "chrome/common/chrome_content_client.h" +#include "chrome/common/chrome_switches.h" +#include "chrome/common/pref_names.h" +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h" +#include "components/data_usage/core/data_use_aggregator.h" +#include "components/data_usage/core/data_use_amortizer.h" +#include "components/data_usage/core/data_use_annotator.h" +#include "components/metrics/metrics_service.h" +#include "components/net_log/chrome_net_log.h" +#include "components/policy/core/common/policy_service.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" +#include "components/proxy_config/pref_proxy_config_tracker.h" +#include "components/variations/variations_associated_data.h" +#include "components/version_info/version_info.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/browser/cookie_store_factory.h" +#include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" +#include "content/public/common/user_agent.h" +#include "net/base/host_mapping_rules.h" +#include "net/base/sdch_manager.h" +#include "net/cert/cert_verifier.h" +#include "net/cert/cert_verify_proc.h" +#include "net/cert/ct_known_logs.h" +#include "net/cert/ct_log_verifier.h" +#include "net/cert/ct_policy_enforcer.h" +#include "net/cert/ct_verifier.h" +#include "net/cert/multi_log_ct_verifier.h" +#include "net/cert/multi_threaded_cert_verifier.h" +#include "net/cookies/cookie_store.h" +#include "net/dns/host_cache.h" +#include "net/dns/host_resolver.h" +#include "net/dns/mapped_host_resolver.h" +#include "net/ftp/ftp_network_layer.h" +#include "net/http/http_auth_filter.h" +#include "net/http/http_auth_handler_factory.h" +#include "net/http/http_auth_preferences.h" +#include "net/http/http_network_layer.h" +#include "net/http/http_server_properties_impl.h" +#include "net/nqe/external_estimate_provider.h" +#include "net/nqe/network_quality_estimator.h" +#include "net/proxy/proxy_config_service.h" +#include "net/proxy/proxy_script_fetcher_impl.h" +#include "net/proxy/proxy_service.h" +#include "net/quic/crypto/crypto_protocol.h" +#include "net/quic/quic_protocol.h" +#include "net/quic/quic_utils.h" +#include "net/socket/ssl_client_socket.h" +#include "net/socket/tcp_client_socket.h" +#include "net/spdy/spdy_session.h" +#include "net/ssl/channel_id_service.h" +#include "net/ssl/default_channel_id_store.h" +#include "net/url_request/data_protocol_handler.h" +#include "net/url_request/file_protocol_handler.h" +#include "net/url_request/ftp_protocol_handler.h" +#include "net/url_request/static_http_user_agent_settings.h" +#include "net/url_request/url_fetcher.h" +#include "net/url_request/url_request_backoff_manager.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_builder.h" +#include "net/url_request/url_request_context_getter.h" +#include "net/url_request/url_request_job_factory_impl.h" +#include "policy/policy_constants.h" +#include "url/url_constants.h" + +#if defined(ENABLE_EXTENSIONS) +#include "chrome/browser/extensions/event_router_forwarder.h" +#endif + +#if defined(USE_NSS_CERTS) +#include "net/cert_net/nss_ocsp.h" +#endif + +#if BUILDFLAG(ANDROID_JAVA_UI) +#include "base/android/build_info.h" +#include "chrome/browser/android/data_usage/external_data_use_observer.h" +#include "chrome/browser/android/net/external_estimate_provider_android.h" +#include "components/data_usage/android/traffic_stats_amortizer.h" +#endif + +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/net/cert_verify_proc_chromeos.h" +#include "chromeos/network/host_resolver_impl_chromeos.h" +#endif + +#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) +#include +#include "crypto/openssl_util.h" +#endif + +using content::BrowserThread; + +class SafeBrowsingURLRequestContext; + +// The IOThread object must outlive any tasks posted to the IO thread before the +// Quit task, so base::Bind() calls are not refcounted. + +namespace { + +const char kTCPFastOpenFieldTrialName[] = "TCPFastOpen"; +const char kTCPFastOpenHttpsEnabledGroupName[] = "HttpsEnabled"; + +const char kQuicFieldTrialName[] = "QUIC"; +const char kQuicFieldTrialEnabledGroupName[] = "Enabled"; +const char kQuicFieldTrialHttpsEnabledGroupName[] = "HttpsEnabled"; + +// The SPDY trial composes two different trial plus control groups: +// * A "holdback" group with SPDY disabled, and corresponding control +// (SPDY/3.1). The primary purpose of the holdback group is to encourage site +// operators to do feature detection rather than UA-sniffing. As such, this +// trial runs continuously. +// * A SPDY/4 experiment, for SPDY/4 (aka HTTP/2) vs SPDY/3.1 comparisons and +// eventual SPDY/4 deployment. +const char kSpdyFieldTrialName[] = "SPDY"; +const char kSpdyFieldTrialHoldbackGroupNamePrefix[] = "SpdyDisabled"; +const char kSpdyFieldTrialSpdy31GroupNamePrefix[] = "Spdy31Enabled"; +const char kSpdyFieldTrialSpdy4GroupNamePrefix[] = "Spdy4Enabled"; +const char kSpdyFieldTrialParametrizedPrefix[] = "Parametrized"; + +// The AltSvc trial controls whether Alt-Svc headers are parsed. +// Disabled: +// Alt-Svc headers are not parsed. +// Alternate-Protocol headers are parsed. +// Enabled: +// Alt-Svc headers are parsed, but only same-host entries are used by +// default. (Use "enable_alternative_service_with_different_host" QUIC +// parameter to enable entries with different hosts.) +// Alternate-Protocol headers are ignored for responses that have an Alt-Svc +// header. +const char kAltSvcFieldTrialName[] = "ParseAltSvc"; +const char kAltSvcFieldTrialDisabledPrefix[] = "AltSvcDisabled"; +const char kAltSvcFieldTrialEnabledPrefix[] = "AltSvcEnabled"; + +// Field trial for network quality estimator. Seeds RTT and downstream +// throughput observations with values that correspond to the connection type +// determined by the operating system. +const char kNetworkQualityEstimatorFieldTrialName[] = "NetworkQualityEstimator"; + +// Field trial for NPN. +const char kNpnTrialName[] = "NPN"; +const char kNpnTrialEnabledGroupNamePrefix[] = "Enable"; +const char kNpnTrialDisabledGroupNamePrefix[] = "Disable"; + +// Field trial for priority dependencies. +const char kSpdyDependenciesFieldTrial[] = "SpdyEnableDependencies"; +const char kSpdyDependenciesFieldTrialEnable[] = "Enable"; +const char kSpdyDepencenciesFieldTrialDisable[] = "Disable"; + +#if defined(OS_MACOSX) +void ObserveKeychainEvents() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + net::CertDatabase::GetInstance()->SetMessageLoopForKeychainEvents(); +} +#endif + +// Gets file path into ssl_keylog_file from command line argument or +// environment variable. Command line argument has priority when +// both specified. +base::FilePath GetSSLKeyLogFile(const base::CommandLine& command_line) { + if (command_line.HasSwitch(switches::kSSLKeyLogFile)) { + base::FilePath path = + command_line.GetSwitchValuePath(switches::kSSLKeyLogFile); + if (!path.empty()) + return path; + LOG(WARNING) << "ssl-key-log-file argument missing"; + } + + std::unique_ptr env(base::Environment::Create()); + std::string path_str; + env->GetVar("SSLKEYLOGFILE", &path_str); +#if defined(OS_WIN) + // base::Environment returns environment variables in UTF-8 on Windows. + return base::FilePath(base::UTF8ToUTF16(path_str)); +#else + return base::FilePath(path_str); +#endif +} + +// Used for the "system" URLRequestContext. +class SystemURLRequestContext : public net::URLRequestContext { + public: + SystemURLRequestContext() { +#if defined(USE_NSS_CERTS) + net::SetURLRequestContextForNSSHttpIO(this); +#endif + } + + private: + ~SystemURLRequestContext() override { + AssertNoURLRequests(); +#if defined(USE_NSS_CERTS) + net::SetURLRequestContextForNSSHttpIO(NULL); +#endif + } +}; + +std::unique_ptr CreateGlobalHostResolver( + net::NetLog* net_log) { + TRACE_EVENT0("startup", "IOThread::CreateGlobalHostResolver"); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + + net::HostResolver::Options options; + + // Use the retry attempts override from the command-line, if any. + if (command_line.HasSwitch(switches::kHostResolverRetryAttempts)) { + std::string s = + command_line.GetSwitchValueASCII(switches::kHostResolverRetryAttempts); + // Parse the switch (it should be a non-negative integer). + int n; + if (base::StringToInt(s, &n) && n >= 0) { + options.max_retry_attempts = static_cast(n); + } else { + LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s; + } + } + + std::unique_ptr global_host_resolver; +#if defined OS_CHROMEOS + global_host_resolver = + chromeos::HostResolverImplChromeOS::CreateSystemResolver(options, + net_log); +#else + global_host_resolver = + net::HostResolver::CreateSystemResolver(options, net_log); +#endif + + // If hostname remappings were specified on the command-line, layer these + // rules on top of the real host resolver. This allows forwarding all requests + // through a designated test server. + if (!command_line.HasSwitch(switches::kHostResolverRules)) + return global_host_resolver; + + std::unique_ptr remapped_resolver( + new net::MappedHostResolver(std::move(global_host_resolver))); + remapped_resolver->SetRulesFromString( + command_line.GetSwitchValueASCII(switches::kHostResolverRules)); + return std::move(remapped_resolver); +} + +int GetSwitchValueAsInt(const base::CommandLine& command_line, + const std::string& switch_name) { + int value; + if (!base::StringToInt(command_line.GetSwitchValueASCII(switch_name), + &value)) { + return 0; + } + return value; +} + +// Returns the value associated with |key| in |params| or "" if the +// key is not present in the map. +const std::string& GetVariationParam( + const std::map& params, + const std::string& key) { + std::map::const_iterator it = params.find(key); + if (it == params.end()) + return base::EmptyString(); + + return it->second; +} + +} // namespace + +class IOThread::LoggingNetworkChangeObserver + : public net::NetworkChangeNotifier::IPAddressObserver, + public net::NetworkChangeNotifier::ConnectionTypeObserver, + public net::NetworkChangeNotifier::NetworkChangeObserver { + public: + // |net_log| must remain valid throughout our lifetime. + explicit LoggingNetworkChangeObserver(net::NetLog* net_log) + : net_log_(net_log) { + net::NetworkChangeNotifier::AddIPAddressObserver(this); + net::NetworkChangeNotifier::AddConnectionTypeObserver(this); + net::NetworkChangeNotifier::AddNetworkChangeObserver(this); + } + + ~LoggingNetworkChangeObserver() override { + net::NetworkChangeNotifier::RemoveIPAddressObserver(this); + net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); + net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); + } + + // NetworkChangeNotifier::IPAddressObserver implementation. + void OnIPAddressChanged() override { + VLOG(1) << "Observed a change to the network IP addresses"; + + net_log_->AddGlobalEntry(net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); + } + + // NetworkChangeNotifier::ConnectionTypeObserver implementation. + void OnConnectionTypeChanged( + net::NetworkChangeNotifier::ConnectionType type) override { + std::string type_as_string = + net::NetworkChangeNotifier::ConnectionTypeToString(type); + + VLOG(1) << "Observed a change to network connectivity state " + << type_as_string; + + net_log_->AddGlobalEntry( + net::NetLog::TYPE_NETWORK_CONNECTIVITY_CHANGED, + net::NetLog::StringCallback("new_connection_type", &type_as_string)); + } + + // NetworkChangeNotifier::NetworkChangeObserver implementation. + void OnNetworkChanged( + net::NetworkChangeNotifier::ConnectionType type) override { + std::string type_as_string = + net::NetworkChangeNotifier::ConnectionTypeToString(type); + + VLOG(1) << "Observed a network change to state " << type_as_string; + + net_log_->AddGlobalEntry( + net::NetLog::TYPE_NETWORK_CHANGED, + net::NetLog::StringCallback("new_connection_type", &type_as_string)); + } + + private: + net::NetLog* net_log_; + DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver); +}; + +class SystemURLRequestContextGetter : public net::URLRequestContextGetter { + public: + explicit SystemURLRequestContextGetter(IOThread* io_thread); + + // Implementation for net::UrlRequestContextGetter. + net::URLRequestContext* GetURLRequestContext() override; + scoped_refptr GetNetworkTaskRunner() + const override; + + protected: + ~SystemURLRequestContextGetter() override; + + private: + IOThread* const io_thread_; // Weak pointer, owned by BrowserProcess. + scoped_refptr network_task_runner_; + + base::debug::LeakTracker leak_tracker_; +}; + +SystemURLRequestContextGetter::SystemURLRequestContextGetter( + IOThread* io_thread) + : io_thread_(io_thread), + network_task_runner_( + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)) { +} + +SystemURLRequestContextGetter::~SystemURLRequestContextGetter() {} + +net::URLRequestContext* SystemURLRequestContextGetter::GetURLRequestContext() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(io_thread_->globals()->system_request_context.get()); + + return io_thread_->globals()->system_request_context.get(); +} + +scoped_refptr +SystemURLRequestContextGetter::GetNetworkTaskRunner() const { + return network_task_runner_; +} + +IOThread::Globals:: +SystemRequestContextLeakChecker::SystemRequestContextLeakChecker( + Globals* globals) + : globals_(globals) { + DCHECK(globals_); +} + +IOThread::Globals:: +SystemRequestContextLeakChecker::~SystemRequestContextLeakChecker() { + if (globals_->system_request_context.get()) + globals_->system_request_context->AssertNoURLRequests(); +} + +IOThread::Globals::Globals() : system_request_context_leak_checker(this), + enable_brotli(false) {} + +IOThread::Globals::~Globals() {} + +// |local_state| is passed in explicitly in order to (1) reduce implicit +// dependencies and (2) make IOThread more flexible for testing. +IOThread::IOThread( + PrefService* local_state, + policy::PolicyService* policy_service, + net_log::ChromeNetLog* net_log, + extensions::EventRouterForwarder* extension_event_router_forwarder) + : net_log_(net_log), +#if defined(ENABLE_EXTENSIONS) + extension_event_router_forwarder_(extension_event_router_forwarder), +#endif + globals_(NULL), + is_spdy_allowed_by_policy_(true), + is_quic_allowed_by_policy_(true), + creation_time_(base::TimeTicks::Now()), + weak_factory_(this) { + scoped_refptr io_thread_proxy = + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); + auth_schemes_ = local_state->GetString(prefs::kAuthSchemes); + negotiate_disable_cname_lookup_.Init( + prefs::kDisableAuthNegotiateCnameLookup, local_state, + base::Bind(&IOThread::UpdateNegotiateDisableCnameLookup, + base::Unretained(this))); + negotiate_disable_cname_lookup_.MoveToThread(io_thread_proxy); + negotiate_enable_port_.Init( + prefs::kEnableAuthNegotiatePort, local_state, + base::Bind(&IOThread::UpdateNegotiateEnablePort, base::Unretained(this))); + negotiate_enable_port_.MoveToThread(io_thread_proxy); + auth_server_whitelist_.Init( + prefs::kAuthServerWhitelist, local_state, + base::Bind(&IOThread::UpdateServerWhitelist, base::Unretained(this))); + auth_server_whitelist_.MoveToThread(io_thread_proxy); + auth_delegate_whitelist_.Init( + prefs::kAuthNegotiateDelegateWhitelist, local_state, + base::Bind(&IOThread::UpdateDelegateWhitelist, base::Unretained(this))); + auth_delegate_whitelist_.MoveToThread(io_thread_proxy); +#if defined(OS_ANDROID) + auth_android_negotiate_account_type_.Init( + prefs::kAuthAndroidNegotiateAccountType, local_state, + base::Bind(&IOThread::UpdateAndroidAuthNegotiateAccountType, + base::Unretained(this))); + auth_android_negotiate_account_type_.MoveToThread(io_thread_proxy); +#endif +#if defined(OS_POSIX) && !defined(OS_ANDROID) + gssapi_library_name_ = local_state->GetString(prefs::kGSSAPILibraryName); +#endif + pref_proxy_config_tracker_.reset( + ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( + local_state)); + ChromeNetworkDelegate::InitializePrefsOnUIThread( + &system_enable_referrers_, + NULL, + NULL, + NULL, + local_state); + ssl_config_service_manager_.reset( + ssl_config::SSLConfigServiceManager::CreateDefaultManager( + local_state, + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); + + base::Value* dns_client_enabled_default = new base::FundamentalValue( + chrome_browser_net::ConfigureAsyncDnsFieldTrial()); + local_state->SetDefaultPrefValue(prefs::kBuiltInDnsClientEnabled, + dns_client_enabled_default); + chrome_browser_net::LogAsyncDnsPrefSource( + local_state->FindPreference(prefs::kBuiltInDnsClientEnabled)); + + dns_client_enabled_.Init(prefs::kBuiltInDnsClientEnabled, + local_state, + base::Bind(&IOThread::UpdateDnsClientEnabled, + base::Unretained(this))); + dns_client_enabled_.MoveToThread(io_thread_proxy); + + quick_check_enabled_.Init(prefs::kQuickCheckEnabled, + local_state); + quick_check_enabled_.MoveToThread(io_thread_proxy); + + is_spdy_allowed_by_policy_ = + policy_service + ->GetPolicies(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, + std::string())) + .Get(policy::key::kDisableSpdy) == nullptr; + + const base::Value* value = policy_service->GetPolicies( + policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, + std::string())).GetValue(policy::key::kQuicAllowed); + if (value) + value->GetAsBoolean(&is_quic_allowed_by_policy_); + + // Some unit tests use IOThread but do not initialize MetricsService. In that + // case it is fine not to have |metrics_data_use_forwarder_|. + if (g_browser_process->metrics_service()) { + // Callback for updating data use prefs should be obtained on UI thread. + metrics_data_use_forwarder_ = + g_browser_process->metrics_service()->GetDataUseForwardingCallback(); + } + + BrowserThread::SetDelegate(BrowserThread::IO, this); +} + +IOThread::~IOThread() { + // This isn't needed for production code, but in tests, IOThread may + // be multiply constructed. + BrowserThread::SetDelegate(BrowserThread::IO, NULL); + + pref_proxy_config_tracker_->DetachFromPrefService(); + DCHECK(!globals_); +} + +IOThread::Globals* IOThread::globals() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + return globals_; +} + +void IOThread::SetGlobalsForTesting(Globals* globals) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(!globals || !globals_); + globals_ = globals; +} + +net_log::ChromeNetLog* IOThread::net_log() { + return net_log_; +} + +void IOThread::ChangedToOnTheRecord() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + BrowserThread::PostTask( + BrowserThread::IO, + FROM_HERE, + base::Bind(&IOThread::ChangedToOnTheRecordOnIOThread, + base::Unretained(this))); +} + +net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!system_url_request_context_getter_.get()) { + InitSystemRequestContext(); + } + return system_url_request_context_getter_.get(); +} + +void IOThread::Init() { + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile1( + FROM_HERE_WITH_EXPLICIT_FUNCTION("466432 IOThread::InitAsync::Start")); + TRACE_EVENT0("startup", "IOThread::InitAsync"); + DCHECK_CURRENTLY_ON(BrowserThread::IO); + +#if defined(USE_NSS_CERTS) + net::SetMessageLoopForNSSHttpIO(); +#endif + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile2( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CommandLineForCurrentProcess")); + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + + // Export ssl keys if log file specified. + base::FilePath ssl_keylog_file = GetSSLKeyLogFile(command_line); + if (!ssl_keylog_file.empty()) { + net::SSLClientSocket::SetSSLKeyLogFile( + ssl_keylog_file, + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); + } + + DCHECK(!globals_); + globals_ = new Globals; + + // Add an observer that will emit network change events to the ChromeNetLog. + // Assuming NetworkChangeNotifier dispatches in FIFO order, we should be + // logging the network change before other IO thread consumers respond to it. + network_change_observer_.reset( + new LoggingNetworkChangeObserver(net_log_)); + + // Setup the HistogramWatcher to run on the IO thread. + net::NetworkChangeNotifier::InitHistogramWatcher(); + +#if defined(ENABLE_EXTENSIONS) + globals_->extension_event_router_forwarder = + extension_event_router_forwarder_; +#endif + + std::unique_ptr data_use_amortizer; +#if BUILDFLAG(ANDROID_JAVA_UI) + data_use_amortizer.reset(new data_usage::android::TrafficStatsAmortizer()); +#endif + + globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator( + std::unique_ptr( + new chrome_browser_data_usage::TabIdAnnotator()), + std::move(data_use_amortizer))); + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile3( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::ChromeNetworkDelegate")); + std::unique_ptr chrome_network_delegate( + new ChromeNetworkDelegate(extension_event_router_forwarder(), + &system_enable_referrers_, + metrics_data_use_forwarder_)); + // By default, data usage is considered off the record. + chrome_network_delegate->set_data_use_aggregator( + globals_->data_use_aggregator.get(), + true /* is_data_usage_off_the_record */); + +#if BUILDFLAG(ANDROID_JAVA_UI) + globals_->external_data_use_observer.reset( + new chrome::android::ExternalDataUseObserver( + globals_->data_use_aggregator.get(), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), + BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI))); +#endif + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile4( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateGlobalHostResolver")); + globals_->system_network_delegate = std::move(chrome_network_delegate); + globals_->host_resolver = CreateGlobalHostResolver(net_log_); + + std::map network_quality_estimator_params; + variations::GetVariationParams(kNetworkQualityEstimatorFieldTrialName, + &network_quality_estimator_params); + + std::unique_ptr external_estimate_provider; +#if BUILDFLAG(ANDROID_JAVA_UI) + external_estimate_provider.reset( + new chrome::android::ExternalEstimateProviderAndroid()); +#endif + // Pass ownership. + globals_->network_quality_estimator.reset(new net::NetworkQualityEstimator( + std::move(external_estimate_provider), network_quality_estimator_params)); + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile5( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::UpdateDnsClientEnabled::Start")); + UpdateDnsClientEnabled(); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile6( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::UpdateDnsClientEnabled::End")); +#if defined(OS_CHROMEOS) + // Creates a CertVerifyProc that doesn't allow any profile-provided certs. + globals_->cert_verifier.reset(new net::MultiThreadedCertVerifier( + new chromeos::CertVerifyProcChromeOS())); +#else + globals_->cert_verifier.reset(new net::MultiThreadedCertVerifier( + net::CertVerifyProc::CreateDefault())); +#endif + + globals_->transport_security_state.reset(new net::TransportSecurityState()); + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile8( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateLogVerifiers::Start")); + std::vector> ct_logs( + net::ct::CreateLogVerifiersForKnownLogs()); + + // Add logs from command line + if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) { + std::string switch_value = command_line.GetSwitchValueASCII( + switches::kCertificateTransparencyLog); + for (const base::StringPiece& curr_log : base::SplitStringPiece( + switch_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { + std::vector log_metadata = base::SplitString( + curr_log, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); + CHECK_GE(log_metadata.size(), 3u) + << "CT log metadata missing: Switch format is " + << "'description:base64_key:url_without_schema'."; + std::string log_description(log_metadata[0]); + std::string log_url(std::string("https://") + log_metadata[2]); + std::string ct_public_key_data; + CHECK(base::Base64Decode(log_metadata[1], &ct_public_key_data)) + << "Unable to decode CT public key."; + scoped_refptr external_log_verifier( + net::CTLogVerifier::Create(ct_public_key_data, log_description, + log_url)); + CHECK(external_log_verifier) << "Unable to parse CT public key."; + VLOG(1) << "Adding log with description " << log_description; + ct_logs.push_back(external_log_verifier); + } + } + + globals_->ct_logs.assign(ct_logs.begin(), ct_logs.end()); + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile9( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateLogVerifiers::End")); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile7( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateMultiLogVerifier")); + net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier(); + globals_->cert_transparency_verifier.reset(ct_verifier); + // Add built-in logs + ct_verifier->AddLogs(globals_->ct_logs); + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile10( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CTPolicyEnforcer")); + globals_->ct_policy_enforcer.reset(new net::CTPolicyEnforcer()); + params_.ct_policy_enforcer = globals_->ct_policy_enforcer.get(); + + globals_->ssl_config_service = GetSSLConfigService(); + + CreateDefaultAuthHandlerFactory(); + globals_->http_server_properties.reset(new net::HttpServerPropertiesImpl()); + // For the ProxyScriptFetcher, we use a direct ProxyService. + globals_->proxy_script_fetcher_proxy_service = + net::ProxyService::CreateDirectWithNetLog(net_log_); + // In-memory cookie store. + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile11( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateCookieStore::Start")); + globals_->system_cookie_store = + content::CreateCookieStore(content::CookieStoreConfig()); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile12( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateCookieStore::End")); + // In-memory channel ID store. + globals_->system_channel_id_service.reset( + new net::ChannelIDService( + new net::DefaultChannelIDStore(NULL), + base::WorkerPool::GetTaskRunner(true))); + globals_->system_cookie_store->SetChannelIDServiceID( + globals_->system_channel_id_service->GetUniqueID()); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile12_1( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateDnsProbeService")); + globals_->dns_probe_service.reset(new chrome_browser_net::DnsProbeService()); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile12_2( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateHostMappingRules")); + globals_->host_mapping_rules.reset(new net::HostMappingRules()); + params_.host_mapping_rules = globals_->host_mapping_rules.get(); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile12_3( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CreateHTTPUserAgentSettings")); + globals_->http_user_agent_settings.reset( + new net::StaticHttpUserAgentSettings(std::string(), GetUserAgent())); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile12_4( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::CommandLineConfiguration")); + if (command_line.HasSwitch(switches::kHostRules)) { + TRACE_EVENT_BEGIN0("startup", "IOThread::InitAsync:SetRulesFromString"); + globals_->host_mapping_rules->SetRulesFromString( + command_line.GetSwitchValueASCII(switches::kHostRules)); + TRACE_EVENT_END0("startup", "IOThread::InitAsync:SetRulesFromString"); + } + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile12_5( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::QuicConfiguration")); + if (command_line.HasSwitch( + switches::kEnableUserAlternateProtocolPorts)) { + params_.enable_user_alternate_protocol_ports = true; + } + globals_->enable_brotli = + base::FeatureList::IsEnabled(features::kBrotliEncoding); + params_.enable_token_binding = + base::FeatureList::IsEnabled(features::kTokenBinding); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile13( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::InitAsync::InitializeNetworkOptions")); + // TODO(rch): Make the client socket factory a per-network session instance, + // constructed from a NetworkSession::Params, to allow us to move this option + // to IOThread::Globals & HttpNetworkSession::Params. + network_session_configurator_.ParseFieldTrialsAndCommandLine( + is_spdy_allowed_by_policy_, is_quic_allowed_by_policy_, ¶ms_); + bool always_enable_tfo_if_supported = + command_line.HasSwitch(switches::kEnableTcpFastOpen); + // Check for OS support of TCP FastOpen, and turn it on for all connections if + // indicated by user. + net::CheckSupportAndMaybeEnableTCPFastOpen(always_enable_tfo_if_supported); + + TRACE_EVENT_BEGIN0("startup", + "IOThread::Init:ProxyScriptFetcherRequestContext"); + globals_->proxy_script_fetcher_context.reset( + ConstructProxyScriptFetcherContext(globals_, params_, net_log_)); + TRACE_EVENT_END0("startup", + "IOThread::Init:ProxyScriptFetcherRequestContext"); + + const version_info::Channel channel = chrome::GetChannel(); + if (channel == version_info::Channel::UNKNOWN || + channel == version_info::Channel::CANARY || + channel == version_info::Channel::DEV) { + globals_->url_request_backoff_manager.reset( + new net::URLRequestBackoffManager()); + } + +#if defined(OS_MACOSX) + // Start observing Keychain events. This needs to be done on the UI thread, + // as Keychain services requires a CFRunLoop. + BrowserThread::PostTask(BrowserThread::UI, + FROM_HERE, + base::Bind(&ObserveKeychainEvents)); +#endif + + // InitSystemRequestContext turns right around and posts a task back + // to the IO thread, so we can't let it run until we know the IO + // thread has started. + // + // Note that since we are at BrowserThread::Init time, the UI thread + // is blocked waiting for the thread to start. Therefore, posting + // this task to the main thread's message loop here is guaranteed to + // get it onto the message loop while the IOThread object still + // exists. However, the message might not be processed on the UI + // thread until after IOThread is gone, so use a weak pointer. + BrowserThread::PostTask(BrowserThread::UI, + FROM_HERE, + base::Bind(&IOThread::InitSystemRequestContext, + weak_factory_.GetWeakPtr())); + +#if defined(OS_ANDROID) && defined(ARCH_CPU_ARMEL) + // Record how common CPUs with broken NEON units are. See + // https://crbug.com/341598. + crypto::EnsureOpenSSLInit(); + UMA_HISTOGRAM_BOOLEAN("Net.HasBrokenNEON", CRYPTO_has_broken_NEON()); +#endif +} + +void IOThread::CleanUp() { + base::debug::LeakTracker::CheckForLeaks(); + +#if defined(USE_NSS_CERTS) + net::ShutdownNSSHttpIO(); +#endif + + system_url_request_context_getter_ = NULL; + + // Release objects that the net::URLRequestContext could have been pointing + // to. + + // Shutdown the HistogramWatcher on the IO thread. + net::NetworkChangeNotifier::ShutdownHistogramWatcher(); + + // This must be reset before the ChromeNetLog is destroyed. + network_change_observer_.reset(); + + system_proxy_config_service_.reset(); + delete globals_; + globals_ = NULL; + + base::debug::LeakTracker::CheckForLeaks(); +} + +// static +void IOThread::NetworkSessionConfigurator::ParseFieldTrials( + bool is_spdy_allowed_by_policy, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params) { + const base::CommandLine command_line(base::CommandLine::NO_PROGRAM); + ParseFieldTrialsAndCommandLineInternal(command_line, + is_spdy_allowed_by_policy, + is_quic_allowed_by_policy, params); +} + +// static +void IOThread::NetworkSessionConfigurator::ParseFieldTrialsAndCommandLine( + bool is_spdy_allowed_by_policy, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params) { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + ParseFieldTrialsAndCommandLineInternal(command_line, + is_spdy_allowed_by_policy, + is_quic_allowed_by_policy, params); +} + +// static +void IOThread::NetworkSessionConfigurator:: + ParseFieldTrialsAndCommandLineInternal( + const base::CommandLine& command_line, + bool is_spdy_allowed_by_policy, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params) { + // Parameters only controlled by command line. + if (command_line.HasSwitch(switches::kIgnoreCertificateErrors)) + params->ignore_certificate_errors = true; + if (command_line.HasSwitch(switches::kTestingFixedHttpPort)) { + params->testing_fixed_http_port = + GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpPort); + } + if (command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { + params->testing_fixed_https_port = + GetSwitchValueAsInt(command_line, switches::kTestingFixedHttpsPort); + } + + // Always fetch the field trial groups to ensure they are reported correctly. + // The command line flags will be associated with a group that is reported so + // long as trial is actually queried. + + std::string altsvc_trial_group = + base::FieldTrialList::FindFullName(kAltSvcFieldTrialName); + ConfigureAltSvcParams(command_line, altsvc_trial_group, params); + + std::string quic_trial_group = + base::FieldTrialList::FindFullName(kQuicFieldTrialName); + VariationParameters quic_trial_params; + if (!variations::GetVariationParams(kQuicFieldTrialName, &quic_trial_params)) + quic_trial_params.clear(); + ConfigureQuicParams(command_line, quic_trial_group, quic_trial_params, + is_quic_allowed_by_policy, params); + + if (!is_spdy_allowed_by_policy) { + base::FieldTrial* trial = base::FieldTrialList::Find(kSpdyFieldTrialName); + if (trial) + trial->Disable(); + } + std::string spdy_trial_group = + base::FieldTrialList::FindFullName(kSpdyFieldTrialName); + VariationParameters spdy_trial_params; + if (!variations::GetVariationParams(kSpdyFieldTrialName, &spdy_trial_params)) + spdy_trial_params.clear(); + ConfigureSpdyParams(command_line, spdy_trial_group, spdy_trial_params, + is_spdy_allowed_by_policy, params); + + const std::string tfo_trial_group = + base::FieldTrialList::FindFullName(kTCPFastOpenFieldTrialName); + ConfigureTCPFastOpenParams(tfo_trial_group, params); + + std::string npn_trial_group = + base::FieldTrialList::FindFullName(kNpnTrialName); + ConfigureNPNParams(command_line, npn_trial_group, params); + + std::string priority_dependencies_trial_group = + base::FieldTrialList::FindFullName(kSpdyDependenciesFieldTrial); + ConfigurePriorityDependencies(priority_dependencies_trial_group, params); +} + +// static +void IOThread::NetworkSessionConfigurator::ConfigureTCPFastOpenParams( + base::StringPiece tfo_trial_group, + net::HttpNetworkSession::Params* params) { + if (tfo_trial_group == kTCPFastOpenHttpsEnabledGroupName) + params->enable_tcp_fast_open_for_ssl = true; +} + +// static +void IOThread::NetworkSessionConfigurator::ConfigureSpdyParams( + const base::CommandLine& command_line, + base::StringPiece spdy_trial_group, + const VariationParameters& spdy_trial_params, + bool is_spdy_allowed_by_policy, + net::HttpNetworkSession::Params* params) { + // Only handle SPDY field trial parameters and command line flags if + // "spdy.disabled" preference is not forced via policy. + if (!is_spdy_allowed_by_policy) { + params->enable_spdy31 = false; + params->enable_http2 = false; + return; + } + + if (command_line.HasSwitch(switches::kIgnoreUrlFetcherCertRequests)) + net::URLFetcher::SetIgnoreCertificateRequests(true); + + if (command_line.HasSwitch(switches::kDisableHttp2)) { + params->enable_spdy31 = false; + params->enable_http2 = false; + return; + } + + if (spdy_trial_group.starts_with(kSpdyFieldTrialHoldbackGroupNamePrefix)) { + net::HttpStreamFactory::set_spdy_enabled(false); + return; + } + if (spdy_trial_group.starts_with(kSpdyFieldTrialSpdy31GroupNamePrefix)) { + params->enable_spdy31 = true; + params->enable_http2 = false; + return; + } + if (spdy_trial_group.starts_with(kSpdyFieldTrialSpdy4GroupNamePrefix)) { + params->enable_spdy31 = true; + params->enable_http2 = true; + return; + } + if (spdy_trial_group.starts_with(kSpdyFieldTrialParametrizedPrefix)) { + bool spdy_enabled = false; + params->enable_spdy31 = false; + params->enable_http2 = false; + if (base::LowerCaseEqualsASCII( + GetVariationParam(spdy_trial_params, "enable_http2"), "true")) { + spdy_enabled = true; + params->enable_http2 = true; + } + if (base::LowerCaseEqualsASCII( + GetVariationParam(spdy_trial_params, "enable_spdy31"), "true")) { + spdy_enabled = true; + params->enable_spdy31 = true; + } + // TODO(bnc): https://crbug.com/521597 + // HttpStreamFactory::spdy_enabled_ is redundant with params->enable_http2 + // and enable_spdy31, can it be eliminated? + net::HttpStreamFactory::set_spdy_enabled(spdy_enabled); + return; + } +} + +// static +void IOThread::NetworkSessionConfigurator::ConfigureAltSvcParams( + const base::CommandLine& command_line, + base::StringPiece altsvc_trial_group, + net::HttpNetworkSession::Params* params) { + if (command_line.HasSwitch(switches::kEnableAlternativeServices) || + altsvc_trial_group.starts_with(kAltSvcFieldTrialEnabledPrefix)) { + params->parse_alternative_services = true; + return; + } + if (altsvc_trial_group.starts_with(kAltSvcFieldTrialDisabledPrefix)) { + params->parse_alternative_services = false; + } +} + +// static +void IOThread::NetworkSessionConfigurator::ConfigureNPNParams( + const base::CommandLine& command_line, + base::StringPiece npn_trial_group, + net::HttpNetworkSession::Params* params) { + if (npn_trial_group.starts_with(kNpnTrialEnabledGroupNamePrefix)) { + params->enable_npn = true; + } else if (npn_trial_group.starts_with(kNpnTrialDisabledGroupNamePrefix)) { + params->enable_npn = false; + } +} + +// static +void IOThread::NetworkSessionConfigurator::ConfigurePriorityDependencies( + base::StringPiece priority_dependencies_trial_group, + net::HttpNetworkSession::Params* params) { + if (priority_dependencies_trial_group.starts_with( + kSpdyDependenciesFieldTrialEnable)) { + params->enable_priority_dependencies = true; + } else if (priority_dependencies_trial_group.starts_with( + kSpdyDepencenciesFieldTrialDisable)) { + params->enable_priority_dependencies = false; + } +} + +// static +void IOThread::RegisterPrefs(PrefRegistrySimple* registry) { + registry->RegisterStringPref(prefs::kAuthSchemes, + "basic,digest,ntlm,negotiate"); + registry->RegisterBooleanPref(prefs::kDisableAuthNegotiateCnameLookup, false); + registry->RegisterBooleanPref(prefs::kEnableAuthNegotiatePort, false); + registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); + registry->RegisterStringPref(prefs::kAuthNegotiateDelegateWhitelist, + std::string()); + registry->RegisterStringPref(prefs::kGSSAPILibraryName, std::string()); + registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, + std::string()); + registry->RegisterBooleanPref(prefs::kEnableReferrers, true); + data_reduction_proxy::RegisterPrefs(registry); + registry->RegisterBooleanPref(prefs::kBuiltInDnsClientEnabled, true); + registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true); +} + +void IOThread::UpdateServerWhitelist() { + globals_->http_auth_preferences->set_server_whitelist( + auth_server_whitelist_.GetValue()); +} + +void IOThread::UpdateDelegateWhitelist() { + globals_->http_auth_preferences->set_delegate_whitelist( + auth_delegate_whitelist_.GetValue()); +} + +#if defined(OS_ANDROID) +void IOThread::UpdateAndroidAuthNegotiateAccountType() { + globals_->http_auth_preferences->set_auth_android_negotiate_account_type( + auth_android_negotiate_account_type_.GetValue()); +} +#endif + +void IOThread::UpdateNegotiateDisableCnameLookup() { + globals_->http_auth_preferences->set_negotiate_disable_cname_lookup( + negotiate_disable_cname_lookup_.GetValue()); +} + +void IOThread::UpdateNegotiateEnablePort() { + globals_->http_auth_preferences->set_negotiate_enable_port( + negotiate_enable_port_.GetValue()); +} + +void IOThread::CreateDefaultAuthHandlerFactory() { + std::vector supported_schemes = base::SplitString( + auth_schemes_, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + globals_->http_auth_preferences.reset(new net::HttpAuthPreferences( + supported_schemes +#if defined(OS_POSIX) && !defined(OS_ANDROID) + , + gssapi_library_name_ +#endif + )); + UpdateServerWhitelist(); + UpdateDelegateWhitelist(); + UpdateNegotiateDisableCnameLookup(); + UpdateNegotiateEnablePort(); +#if defined(OS_ANDROID) + UpdateAndroidAuthNegotiateAccountType(); +#endif + globals_->http_auth_handler_factory = + net::HttpAuthHandlerRegistryFactory::Create( + globals_->http_auth_preferences.get(), globals_->host_resolver.get()); +} + +void IOThread::ClearHostCache() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + + net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); + if (host_cache) + host_cache->clear(); +} + +const net::HttpNetworkSession::Params& IOThread::NetworkSessionParams() const { + return params_; +} + +base::TimeTicks IOThread::creation_time() const { + return creation_time_; +} + +// static +net::SSLConfigService* IOThread::GetSSLConfigService() { + return ssl_config_service_manager_->Get(); +} + +void IOThread::ChangedToOnTheRecordOnIOThread() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + + // Clear the host cache to avoid showing entries from the OTR session + // in about:net-internals. + ClearHostCache(); +} + +void IOThread::InitSystemRequestContext() { + if (system_url_request_context_getter_.get()) + return; + // If we're in unit_tests, IOThread may not be run. + if (!BrowserThread::IsMessageLoopValid(BrowserThread::IO)) + return; + system_proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService( + pref_proxy_config_tracker_.get()); + system_url_request_context_getter_ = + new SystemURLRequestContextGetter(this); + // Safe to post an unretained this pointer, since IOThread is + // guaranteed to outlive the IO BrowserThread. + BrowserThread::PostTask( + BrowserThread::IO, + FROM_HERE, + base::Bind(&IOThread::InitSystemRequestContextOnIOThread, + base::Unretained(this))); +} + +void IOThread::InitSystemRequestContextOnIOThread() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(!globals_->system_proxy_service.get()); + DCHECK(system_proxy_config_service_.get()); + + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + globals_->system_proxy_service = ProxyServiceFactory::CreateProxyService( + net_log_, globals_->proxy_script_fetcher_context.get(), + globals_->system_network_delegate.get(), + std::move(system_proxy_config_service_), command_line, + quick_check_enabled_.GetValue()); + + globals_->system_request_context.reset( + ConstructSystemRequestContext(globals_, params_, net_log_)); +} + +void IOThread::UpdateDnsClientEnabled() { + globals()->host_resolver->SetDnsClientEnabled(*dns_client_enabled_); +} + +// static +void IOThread::NetworkSessionConfigurator::ConfigureQuicParams( + const base::CommandLine& command_line, + base::StringPiece quic_trial_group, + const VariationParameters& quic_trial_params, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params) { + params->enable_quic = ShouldEnableQuic(command_line, quic_trial_group, + is_quic_allowed_by_policy); + params->disable_quic_on_timeout_with_open_streams = + ShouldDisableQuicWhenConnectionTimesOutWithOpenStreams(quic_trial_params); + + if (ShouldQuicEnableAlternativeServicesForDifferentHost(command_line, + quic_trial_params)) { + params->enable_alternative_service_with_different_host = true; + params->parse_alternative_services = true; + } else { + params->enable_alternative_service_with_different_host = false; + } + + if (params->enable_quic) { + params->quic_always_require_handshake_confirmation = + ShouldQuicAlwaysRequireHandshakeConfirmation(quic_trial_params); + params->quic_disable_connection_pooling = + ShouldQuicDisableConnectionPooling(quic_trial_params); + int receive_buffer_size = GetQuicSocketReceiveBufferSize(quic_trial_params); + if (receive_buffer_size != 0) { + params->quic_socket_receive_buffer_size = receive_buffer_size; + } + float load_server_info_timeout_srtt_multiplier = + GetQuicLoadServerInfoTimeoutSrttMultiplier(quic_trial_params); + if (load_server_info_timeout_srtt_multiplier != 0) { + params->quic_load_server_info_timeout_srtt_multiplier = + load_server_info_timeout_srtt_multiplier; + } + params->quic_enable_connection_racing = + ShouldQuicEnableConnectionRacing(quic_trial_params); + params->quic_enable_non_blocking_io = + ShouldQuicEnableNonBlockingIO(quic_trial_params); + params->quic_disable_disk_cache = + ShouldQuicDisableDiskCache(quic_trial_params); + params->quic_prefer_aes = ShouldQuicPreferAes(quic_trial_params); + int max_number_of_lossy_connections = GetQuicMaxNumberOfLossyConnections( + quic_trial_params); + if (max_number_of_lossy_connections != 0) { + params->quic_max_number_of_lossy_connections = + max_number_of_lossy_connections; + } + float packet_loss_threshold = GetQuicPacketLossThreshold(quic_trial_params); + if (packet_loss_threshold != 0) + params->quic_packet_loss_threshold = packet_loss_threshold; + params->enable_quic_port_selection = + ShouldEnableQuicPortSelection(command_line); + params->quic_connection_options = + GetQuicConnectionOptions(command_line, quic_trial_params); + params->quic_close_sessions_on_ip_change = + ShouldQuicCloseSessionsOnIpChange(quic_trial_params); + int idle_connection_timeout_seconds = GetQuicIdleConnectionTimeoutSeconds( + quic_trial_params); + if (idle_connection_timeout_seconds != 0) { + params->quic_idle_connection_timeout_seconds = + idle_connection_timeout_seconds; + } + params->quic_disable_preconnect_if_0rtt = + ShouldQuicDisablePreConnectIfZeroRtt(quic_trial_params); + params->quic_host_whitelist = + GetQuicHostWhitelist(command_line, quic_trial_params); + params->quic_migrate_sessions_on_network_change = + ShouldQuicMigrateSessionsOnNetworkChange(quic_trial_params); + params->quic_migrate_sessions_early = + ShouldQuicMigrateSessionsEarly(quic_trial_params); + } + + size_t max_packet_length = GetQuicMaxPacketLength(command_line, + quic_trial_params); + if (max_packet_length != 0) { + params->quic_max_packet_length = max_packet_length; + } + + params->quic_user_agent_id = chrome::GetChannelString(); + if (!params->quic_user_agent_id.empty()) + params->quic_user_agent_id.push_back(' '); + params->quic_user_agent_id.append( + version_info::GetProductNameAndVersionForUserAgent()); + params->quic_user_agent_id.push_back(' '); + params->quic_user_agent_id.append(content::BuildOSCpuInfo()); + + net::QuicVersion version = GetQuicVersion(command_line, quic_trial_params); + if (version != net::QUIC_VERSION_UNSUPPORTED) { + net::QuicVersionVector supported_versions; + supported_versions.push_back(version); + params->quic_supported_versions = supported_versions; + } + + if (command_line.HasSwitch(switches::kOriginToForceQuicOn)) { + std::string origins = + command_line.GetSwitchValueASCII(switches::kOriginToForceQuicOn); + for (const std::string& host_port : base::SplitString( + origins, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { + net::HostPortPair quic_origin = net::HostPortPair::FromString(host_port); + if (!quic_origin.IsEmpty()) + params->origins_to_force_quic_on.insert(quic_origin); + } + } +} + +// static +bool IOThread::NetworkSessionConfigurator:: + ShouldDisableQuicWhenConnectionTimesOutWithOpenStreams( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, + "disable_quic_on_timeout_with_open_streams"), + "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldEnableQuic( + const base::CommandLine& command_line, + base::StringPiece quic_trial_group, + bool is_quic_allowed_by_policy) { + if (command_line.HasSwitch(switches::kDisableQuic) || + !is_quic_allowed_by_policy) + return false; + + if (command_line.HasSwitch(switches::kEnableQuic)) + return true; + + return quic_trial_group.starts_with(kQuicFieldTrialEnabledGroupName) || + quic_trial_group.starts_with(kQuicFieldTrialHttpsEnabledGroupName); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldEnableQuicPortSelection( + const base::CommandLine& command_line) { + if (command_line.HasSwitch(switches::kDisableQuicPortSelection)) + return false; + + if (command_line.HasSwitch(switches::kEnableQuicPortSelection)) + return true; + + return false; // Default to disabling port selection on all channels. +} + +// static +net::QuicTagVector +IOThread::NetworkSessionConfigurator::GetQuicConnectionOptions( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params) { + if (command_line.HasSwitch(switches::kQuicConnectionOptions)) { + return net::QuicUtils::ParseQuicConnectionOptions( + command_line.GetSwitchValueASCII(switches::kQuicConnectionOptions)); + } + + VariationParameters::const_iterator it = + quic_trial_params.find("connection_options"); + if (it == quic_trial_params.end()) { + return net::QuicTagVector(); + } + + return net::QuicUtils::ParseQuicConnectionOptions(it->second); +} + +// static +bool IOThread::NetworkSessionConfigurator:: + ShouldQuicAlwaysRequireHandshakeConfirmation( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, + "always_require_handshake_confirmation"), + "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicDisableConnectionPooling( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "disable_connection_pooling"), + "true"); +} + +// static +float IOThread::NetworkSessionConfigurator:: + GetQuicLoadServerInfoTimeoutSrttMultiplier( + const VariationParameters& quic_trial_params) { + double value; + if (base::StringToDouble(GetVariationParam(quic_trial_params, + "load_server_info_time_to_srtt"), + &value)) { + return static_cast(value); + } + return 0.0f; +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicEnableConnectionRacing( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "enable_connection_racing"), + "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicEnableNonBlockingIO( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "enable_non_blocking_io"), + "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicDisableDiskCache( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "disable_disk_cache"), "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicPreferAes( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "prefer_aes"), "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator:: + ShouldQuicEnableAlternativeServicesForDifferentHost( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params) { + // TODO(bnc): Remove inaccurately named "use_alternative_services" parameter. + return command_line.HasSwitch(switches::kEnableAlternativeServices) || + base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "use_alternative_services"), + "true") || + base::LowerCaseEqualsASCII( + GetVariationParam( + quic_trial_params, + "enable_alternative_service_with_different_host"), + "true"); +} + +// static +int IOThread::NetworkSessionConfigurator::GetQuicMaxNumberOfLossyConnections( + const VariationParameters& quic_trial_params) { + int value; + if (base::StringToInt(GetVariationParam(quic_trial_params, + "max_number_of_lossy_connections"), + &value)) { + return value; + } + return 0; +} + +// static +float IOThread::NetworkSessionConfigurator::GetQuicPacketLossThreshold( + const VariationParameters& quic_trial_params) { + double value; + if (base::StringToDouble(GetVariationParam(quic_trial_params, + "packet_loss_threshold"), + &value)) { + return static_cast(value); + } + return 0.0f; +} + +// static +int IOThread::NetworkSessionConfigurator::GetQuicSocketReceiveBufferSize( + const VariationParameters& quic_trial_params) { + int value; + if (base::StringToInt(GetVariationParam(quic_trial_params, + "receive_buffer_size"), + &value)) { + return value; + } + return 0; +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicCloseSessionsOnIpChange( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "close_sessions_on_ip_change"), + "true"); +} + +// static +int IOThread::NetworkSessionConfigurator::GetQuicIdleConnectionTimeoutSeconds( + const VariationParameters& quic_trial_params) { + int value; + if (base::StringToInt(GetVariationParam(quic_trial_params, + "idle_connection_timeout_seconds"), + &value)) { + return value; + } + return 0; +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicDisablePreConnectIfZeroRtt( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "disable_preconnect_if_0rtt"), + "true"); +} + +// static +std::unordered_set +IOThread::NetworkSessionConfigurator::GetQuicHostWhitelist( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params) { + std::string whitelist; + if (command_line.HasSwitch(switches::kQuicHostWhitelist)) { + whitelist = command_line.GetSwitchValueASCII(switches::kQuicHostWhitelist); + } else { + whitelist = GetVariationParam(quic_trial_params, "quic_host_whitelist"); + } + std::unordered_set hosts; + for (const std::string& host :base::SplitString(whitelist, ",", + base::TRIM_WHITESPACE, + base::SPLIT_WANT_ALL)) { + hosts.insert(host); + } + return hosts; +} + +// static +bool IOThread::NetworkSessionConfigurator:: + ShouldQuicMigrateSessionsOnNetworkChange( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, + "migrate_sessions_on_network_change"), + "true"); +} + +// static +bool IOThread::NetworkSessionConfigurator::ShouldQuicMigrateSessionsEarly( + const VariationParameters& quic_trial_params) { + return base::LowerCaseEqualsASCII( + GetVariationParam(quic_trial_params, "migrate_sessions_early"), "true"); +} + +// static +size_t IOThread::NetworkSessionConfigurator::GetQuicMaxPacketLength( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params) { + if (command_line.HasSwitch(switches::kQuicMaxPacketLength)) { + unsigned value; + if (!base::StringToUint( + command_line.GetSwitchValueASCII(switches::kQuicMaxPacketLength), + &value)) { + return 0; + } + return value; + } + + unsigned value; + if (base::StringToUint(GetVariationParam(quic_trial_params, + "max_packet_length"), + &value)) { + return value; + } + return 0; +} + +// static +net::QuicVersion IOThread::NetworkSessionConfigurator::GetQuicVersion( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params) { + if (command_line.HasSwitch(switches::kQuicVersion)) { + return ParseQuicVersion( + command_line.GetSwitchValueASCII(switches::kQuicVersion)); + } + + return ParseQuicVersion(GetVariationParam(quic_trial_params, "quic_version")); +} + +// static +net::QuicVersion IOThread::NetworkSessionConfigurator::ParseQuicVersion( + const std::string& quic_version) { + net::QuicVersionVector supported_versions = net::QuicSupportedVersions(); + for (size_t i = 0; i < supported_versions.size(); ++i) { + net::QuicVersion version = supported_versions[i]; + if (net::QuicVersionToString(version) == quic_version) { + return version; + } + } + + return net::QUIC_VERSION_UNSUPPORTED; +} + +// static +net::URLRequestContext* IOThread::ConstructSystemRequestContext( + IOThread::Globals* globals, + const net::HttpNetworkSession::Params& params, + net::NetLog* net_log) { + net::URLRequestContext* context = new SystemURLRequestContext; + context->set_net_log(net_log); + context->set_host_resolver(globals->host_resolver.get()); + context->set_cert_verifier(globals->cert_verifier.get()); + context->set_transport_security_state( + globals->transport_security_state.get()); + context->set_cert_transparency_verifier( + globals->cert_transparency_verifier.get()); + context->set_ssl_config_service(globals->ssl_config_service.get()); + context->set_http_auth_handler_factory( + globals->http_auth_handler_factory.get()); + context->set_proxy_service(globals->system_proxy_service.get()); + + globals->system_url_request_job_factory.reset( + new net::URLRequestJobFactoryImpl()); + context->set_job_factory(globals->system_url_request_job_factory.get()); + + context->set_cookie_store(globals->system_cookie_store.get()); + context->set_channel_id_service( + globals->system_channel_id_service.get()); + context->set_network_delegate(globals->system_network_delegate.get()); + context->set_http_user_agent_settings( + globals->http_user_agent_settings.get()); + context->set_network_quality_estimator( + globals->network_quality_estimator.get()); + context->set_backoff_manager(globals->url_request_backoff_manager.get()); + + context->set_http_server_properties( + globals->http_server_properties->GetWeakPtr()); + + context->set_enable_brotli(globals->enable_brotli); + + net::HttpNetworkSession::Params system_params(params); + net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( + context, &system_params); + + globals->system_http_network_session.reset( + new net::HttpNetworkSession(system_params)); + globals->system_http_transaction_factory.reset( + new net::HttpNetworkLayer(globals->system_http_network_session.get())); + context->set_http_transaction_factory( + globals->system_http_transaction_factory.get()); + + return context; +} + +// static +net::URLRequestContext* IOThread::ConstructProxyScriptFetcherContext( + IOThread::Globals* globals, + const net::HttpNetworkSession::Params& params, + net::NetLog* net_log) { + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile1( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::ConstructProxyScriptFetcherContext1")); + net::URLRequestContext* context = new net::URLRequestContext; + context->set_net_log(net_log); + context->set_host_resolver(globals->host_resolver.get()); + context->set_cert_verifier(globals->cert_verifier.get()); + context->set_transport_security_state( + globals->transport_security_state.get()); + context->set_cert_transparency_verifier( + globals->cert_transparency_verifier.get()); + context->set_ssl_config_service(globals->ssl_config_service.get()); + context->set_http_auth_handler_factory( + globals->http_auth_handler_factory.get()); + context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get()); + + context->set_job_factory( + globals->proxy_script_fetcher_url_request_job_factory.get()); + + context->set_cookie_store(globals->system_cookie_store.get()); + context->set_channel_id_service( + globals->system_channel_id_service.get()); + context->set_network_delegate(globals->system_network_delegate.get()); + context->set_http_user_agent_settings( + globals->http_user_agent_settings.get()); + context->set_http_server_properties( + globals->http_server_properties->GetWeakPtr()); + + context->set_enable_brotli(globals->enable_brotli); + + net::HttpNetworkSession::Params session_params(params); + net::URLRequestContextBuilder::SetHttpNetworkSessionComponents( + context, &session_params); + + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile2( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::ConstructProxyScriptFetcherContext2")); + globals->proxy_script_fetcher_http_network_session.reset( + new net::HttpNetworkSession(session_params)); + // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432 + // is fixed. + tracked_objects::ScopedTracker tracking_profile3( + FROM_HERE_WITH_EXPLICIT_FUNCTION( + "466432 IOThread::ConstructProxyScriptFetcherContext3")); + globals->proxy_script_fetcher_http_transaction_factory.reset( + new net::HttpNetworkLayer( + globals->proxy_script_fetcher_http_network_session.get())); + context->set_http_transaction_factory( + globals->proxy_script_fetcher_http_transaction_factory.get()); + + std::unique_ptr job_factory( + new net::URLRequestJobFactoryImpl()); + + job_factory->SetProtocolHandler( + url::kDataScheme, base::WrapUnique(new net::DataProtocolHandler())); + job_factory->SetProtocolHandler( + url::kFileScheme, + base::WrapUnique(new net::FileProtocolHandler( + content::BrowserThread::GetBlockingPool() + ->GetTaskRunnerWithShutdownBehavior( + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)))); +#if !defined(DISABLE_FTP_SUPPORT) + globals->proxy_script_fetcher_ftp_transaction_factory.reset( + new net::FtpNetworkLayer(globals->host_resolver.get())); + job_factory->SetProtocolHandler( + url::kFtpScheme, + base::WrapUnique(new net::FtpProtocolHandler( + globals->proxy_script_fetcher_ftp_transaction_factory.get()))); +#endif + globals->proxy_script_fetcher_url_request_job_factory = + std::move(job_factory); + + context->set_job_factory( + globals->proxy_script_fetcher_url_request_job_factory.get()); + + // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the + // system URLRequestContext too. There's no reason this should be tied to a + // profile. + return context; +} + +const metrics::UpdateUsagePrefCallbackType& +IOThread::GetMetricsDataUseForwarder() { + return metrics_data_use_forwarder_; +} diff --git a/lib/cpplint_1.4.5/samples/chromium-sample/src/io_thread.h b/lib/cpplint_1.4.5/samples/chromium-sample/src/io_thread.h new file mode 100644 index 00000000000..8dd47599278 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/chromium-sample/src/io_thread.h @@ -0,0 +1,565 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_IO_THREAD_H_ +#define CHROME_BROWSER_IO_THREAD_H_ + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" +#include "base/strings/string_piece.h" +#include "base/time/time.h" +#include "build/build_config.h" +#include "chrome/browser/net/chrome_network_delegate.h" +#include "chrome/common/features.h" +#include "components/prefs/pref_member.h" +#include "components/ssl_config/ssl_config_service_manager.h" +#include "content/public/browser/browser_thread.h" +#include "content/public/browser/browser_thread_delegate.h" +#include "net/base/network_change_notifier.h" +#include "net/http/http_network_session.h" + +class PrefProxyConfigTracker; +class PrefService; +class PrefRegistrySimple; +class SystemURLRequestContextGetter; + +namespace base { +class CommandLine; +} + +#if BUILDFLAG(ANDROID_JAVA_UI) +namespace chrome { +namespace android { +class ExternalDataUseObserver; +} +} +#endif // BUILDFLAG(ANDROID_JAVA_UI) + +namespace chrome_browser_net { +class DnsProbeService; +} + +namespace data_usage { +class DataUseAggregator; +} + +namespace extensions { +class EventRouterForwarder; +} + +namespace net { +class CTPolicyEnforcer; +class CertVerifier; +class ChannelIDService; +class CookieStore; +class CTLogVerifier; +class FtpTransactionFactory; +class HostMappingRules; +class HostResolver; +class HttpAuthHandlerRegistryFactory; +class HttpAuthPreferences; +class HttpServerProperties; +class HttpTransactionFactory; +class HttpUserAgentSettings; +class NetworkDelegate; +class NetworkQualityEstimator; +class ProxyConfigService; +class ProxyService; +class SSLConfigService; +class TransportSecurityState; +class URLRequestBackoffManager; +class URLRequestContext; +class URLRequestContextGetter; +class URLRequestJobFactory; +} // namespace net + +namespace net_log { +class ChromeNetLog; +} + +namespace policy { +class PolicyService; +} // namespace policy + +namespace test { +class IOThreadPeer; +} // namespace test + +// Contains state associated with, initialized and cleaned up on, and +// primarily used on, the IO thread. +// +// If you are looking to interact with the IO thread (e.g. post tasks +// to it or check if it is the current thread), see +// content::BrowserThread. +class IOThread : public content::BrowserThreadDelegate { + public: + struct Globals { + class SystemRequestContextLeakChecker { + public: + explicit SystemRequestContextLeakChecker(Globals* globals); + ~SystemRequestContextLeakChecker(); + + private: + Globals* const globals_; + }; + + Globals(); + ~Globals(); + + // Global aggregator of data use. It must outlive the + // |system_network_delegate|. + std::unique_ptr data_use_aggregator; +#if BUILDFLAG(ANDROID_JAVA_UI) + // An external observer of data use. + std::unique_ptr + external_data_use_observer; +#endif // BUILDFLAG(ANDROID_JAVA_UI) + // The "system" NetworkDelegate, used for Profile-agnostic network events. + std::unique_ptr system_network_delegate; + std::unique_ptr host_resolver; + std::unique_ptr cert_verifier; + // The ChannelIDService must outlive the HttpTransactionFactory. + std::unique_ptr system_channel_id_service; + // This TransportSecurityState doesn't load or save any state. It's only + // used to enforce pinning for system requests and will only use built-in + // pins. + std::unique_ptr transport_security_state; + std::vector> ct_logs; + std::unique_ptr cert_transparency_verifier; + std::unique_ptr ct_policy_enforcer; + scoped_refptr ssl_config_service; + std::unique_ptr http_auth_handler_factory; + std::unique_ptr http_server_properties; + std::unique_ptr proxy_script_fetcher_proxy_service; + std::unique_ptr + proxy_script_fetcher_http_network_session; + std::unique_ptr + proxy_script_fetcher_http_transaction_factory; + std::unique_ptr + proxy_script_fetcher_ftp_transaction_factory; + std::unique_ptr + proxy_script_fetcher_url_request_job_factory; + std::unique_ptr url_request_backoff_manager; + std::unique_ptr http_auth_preferences; + // TODO(willchan): Remove proxy script fetcher context since it's not + // necessary now that I got rid of refcounting URLRequestContexts. + // + // The first URLRequestContext is |system_url_request_context|. We introduce + // |proxy_script_fetcher_context| for the second context. It has a direct + // ProxyService, since we always directly connect to fetch the PAC script. + std::unique_ptr proxy_script_fetcher_context; + std::unique_ptr system_proxy_service; + std::unique_ptr system_http_network_session; + std::unique_ptr + system_http_transaction_factory; + std::unique_ptr system_url_request_job_factory; + std::unique_ptr system_request_context; + SystemRequestContextLeakChecker system_request_context_leak_checker; + // |system_cookie_store| and |system_channel_id_service| are shared + // between |proxy_script_fetcher_context| and |system_request_context|. + std::unique_ptr system_cookie_store; +#if defined(ENABLE_EXTENSIONS) + scoped_refptr + extension_event_router_forwarder; +#endif + std::unique_ptr host_mapping_rules; + std::unique_ptr http_user_agent_settings; + std::unique_ptr network_quality_estimator; + + // NetErrorTabHelper uses |dns_probe_service| to send DNS probes when a + // main frame load fails with a DNS error in order to provide more useful + // information to the renderer so it can show a more specific error page. + std::unique_ptr dns_probe_service; + + // Enables Brotli Content-Encoding support + bool enable_brotli; + }; + + // Helper class to configure HttpNetworkSession::Params and + // HttpServerProperties based on field trials, policy, and command line. + class NetworkSessionConfigurator { + public: + // Configure |params| based on field trials and policy arguments. + static void ParseFieldTrials(bool is_spdy_allowed_by_policy, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params); + + // Configure |params| based on field trials, policy arguments, + // and command line. + static void ParseFieldTrialsAndCommandLine( + bool is_spdy_allowed_by_policy, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params); + + private: + // Map from name to value for all parameters associate with a field trial. + using VariationParameters = std::map; + + static void ParseFieldTrialsAndCommandLineInternal( + const base::CommandLine& command_line, + bool is_spdy_allowed_by_policy, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params); + + // Configures Alternative Services based on command line options and the + // field trial group. + static void ConfigureAltSvcParams(const base::CommandLine& command_line, + base::StringPiece altsvc_trial_group, + net::HttpNetworkSession::Params* params); + + // Configures QUIC options based on the flags in |command_line| as well as + // the QUIC field trial group and parameters. Must be called before + // ConfigureSpdyParams. + static void ConfigureQuicParams( + const base::CommandLine& command_line, + base::StringPiece quic_trial_group, + const VariationParameters& quic_trial_params, + bool is_quic_allowed_by_policy, + net::HttpNetworkSession::Params* params); + + // Configures available SPDY protocol versions and parameters based on + // command line flags as well as SPDY field trial group and parameters. + // Must be called after ConfigureQuicParams. + static void ConfigureSpdyParams( + const base::CommandLine& command_line, + base::StringPiece spdy_trial_group, + const VariationParameters& spdy_trial_params, + bool is_spdy_allowed_by_policy, + net::HttpNetworkSession::Params* params); + + // Configure TCP FastOpen based on the field trial group. + static void ConfigureTCPFastOpenParams( + base::StringPiece tfo_trial_group, + net::HttpNetworkSession::Params* params); + + // Configures NPN based on command line and the field trial group. + static void ConfigureNPNParams(const base::CommandLine& command_line, + base::StringPiece npn_trial_group, + net::HttpNetworkSession::Params* params); + + // Configures the use of priority dependencies based on the field trial + // group. + static void ConfigurePriorityDependencies( + base::StringPiece priority_dependencies_trial_group, + net::HttpNetworkSession::Params* params); + + // Returns true if QUIC should be disabled when a connection times out with + // open streams. + static bool ShouldDisableQuicWhenConnectionTimesOutWithOpenStreams( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should be enabled, either as a result of a field + // trial or a command line flag. + static bool ShouldEnableQuic(const base::CommandLine& command_line, + base::StringPiece quic_trial_group, + bool quic_allowed_by_policy); + + // Returns true if the selection of the ephemeral port in bind() should be + // performed by Chromium, and false if the OS should select the port. The + // OS option is used to prevent Windows from posting a security warning + // dialog. + static bool ShouldEnableQuicPortSelection( + const base::CommandLine& command_line); + + // Returns true if QUIC should always require handshake confirmation during + // the QUIC handshake. + static bool ShouldQuicAlwaysRequireHandshakeConfirmation( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should disable connection pooling. + static bool ShouldQuicDisableConnectionPooling( + const VariationParameters& quic_trial_params); + + // Returns the ratio of time to load QUIC sever information from disk cache + // to 'smoothed RTT' based on field trial. Returns 0 if there is an error + // parsing the field trial params, or if the default value should be used. + static float GetQuicLoadServerInfoTimeoutSrttMultiplier( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC's connection racing should be enabled. + static bool ShouldQuicEnableConnectionRacing( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC's should use non-blocking IO. + static bool ShouldQuicEnableNonBlockingIO( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC shouldn't load QUIC server information from the disk + // cache. + static bool ShouldQuicDisableDiskCache( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should prefer AES-GCN even without hardware support. + static bool ShouldQuicPreferAes( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should enable alternative services for different + // host. + static bool ShouldQuicEnableAlternativeServicesForDifferentHost( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params); + + // Returns the maximum number of QUIC connections with high packet loss in a + // row after which QUIC should be disabled. Returns 0 if the default value + // should be used. + static int GetQuicMaxNumberOfLossyConnections( + const VariationParameters& quic_trial_params); + + // Returns the packet loss rate in fraction after which a QUIC connection is + // closed and is considered as a lossy connection. Returns 0 if the default + // value should be used. + static float GetQuicPacketLossThreshold( + const VariationParameters& quic_trial_params); + + // Returns the size of the QUIC receive buffer to use, or 0 if the default + // should be used. + static int GetQuicSocketReceiveBufferSize( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should close sessions when any of the client's IP + // addresses change. + static bool ShouldQuicCloseSessionsOnIpChange( + const VariationParameters& quic_trial_params); + + // Returns the idle connection timeout for QUIC connections. Returns 0 if + // there is an error parsing any of the options, or if the default value + // should be used. + static int GetQuicIdleConnectionTimeoutSeconds( + const VariationParameters& quic_trial_params); + + // Returns true if PreConnect should be disabled if QUIC can do 0RTT. + static bool ShouldQuicDisablePreConnectIfZeroRtt( + const VariationParameters& quic_trial_params); + + // Returns the set of hosts to whitelist for QUIC. + static std::unordered_set GetQuicHostWhitelist( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should migrate sessions when primary network + // changes. + static bool ShouldQuicMigrateSessionsOnNetworkChange( + const VariationParameters& quic_trial_params); + + // Returns true if QUIC should migrate sessions early. + static bool ShouldQuicMigrateSessionsEarly( + const VariationParameters& quic_trial_params); + + // Returns the maximum length for QUIC packets, based on any flags in + // |command_line| or the field trial. Returns 0 if there is an error + // parsing any of the options, or if the default value should be used. + static size_t GetQuicMaxPacketLength( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params); + + // Returns the QUIC versions specified by any flags in |command_line| or + // |quic_trial_params|. + static net::QuicVersion GetQuicVersion( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params); + + // Returns the QUIC version specified by |quic_version| or + // QUIC_VERSION_UNSUPPORTED if |quic_version| is invalid. + static net::QuicVersion ParseQuicVersion(const std::string& quic_version); + + // Returns the QUIC connection options specified by any flags in + // |command_line| or |quic_trial_params|. + static net::QuicTagVector GetQuicConnectionOptions( + const base::CommandLine& command_line, + const VariationParameters& quic_trial_params); + }; + + // |net_log| must either outlive the IOThread or be NULL. + IOThread(PrefService* local_state, + policy::PolicyService* policy_service, + net_log::ChromeNetLog* net_log, + extensions::EventRouterForwarder* extension_event_router_forwarder); + + ~IOThread() override; + + static void RegisterPrefs(PrefRegistrySimple* registry); + + // Can only be called on the IO thread. + Globals* globals(); + + // Allows overriding Globals in tests where IOThread::Init() and + // IOThread::CleanUp() are not called. This allows for injecting mocks into + // IOThread global objects. + void SetGlobalsForTesting(Globals* globals); + + net_log::ChromeNetLog* net_log(); + + // Handles changing to On The Record mode, discarding confidential data. + void ChangedToOnTheRecord(); + + // Returns a getter for the URLRequestContext. Only called on the UI thread. + net::URLRequestContextGetter* system_url_request_context_getter(); + + // Clears the host cache. Intended to be used to prevent exposing recently + // visited sites on about:net-internals/#dns and about:dns pages. Must be + // called on the IO thread. + void ClearHostCache(); + + const net::HttpNetworkSession::Params& NetworkSessionParams() const; + + base::TimeTicks creation_time() const; + + // Returns the callback for updating data use prefs. + const metrics::UpdateUsagePrefCallbackType& GetMetricsDataUseForwarder(); + + private: + // Provide SystemURLRequestContextGetter with access to + // InitSystemRequestContext(). + friend class SystemURLRequestContextGetter; + + friend class test::IOThreadPeer; + + // BrowserThreadDelegate implementation, runs on the IO thread. + // This handles initialization and destruction of state that must + // live on the IO thread. + void Init() override; + void CleanUp() override; + + void InitializeNetworkOptions(const base::CommandLine& parsed_command_line); + + // Global state must be initialized on the IO thread, then this + // method must be invoked on the UI thread. + void InitSystemRequestContext(); + + // Lazy initialization of system request context for + // SystemURLRequestContextGetter. To be called on IO thread only + // after global state has been initialized on the IO thread, and + // SystemRequestContext state has been initialized on the UI thread. + void InitSystemRequestContextOnIOThread(); + + void CreateDefaultAuthHandlerFactory(); + + // Returns an SSLConfigService instance. + net::SSLConfigService* GetSSLConfigService(); + + void ChangedToOnTheRecordOnIOThread(); + + void UpdateDnsClientEnabled(); + void UpdateServerWhitelist(); + void UpdateDelegateWhitelist(); + void UpdateAndroidAuthNegotiateAccountType(); + void UpdateNegotiateDisableCnameLookup(); + void UpdateNegotiateEnablePort(); + + extensions::EventRouterForwarder* extension_event_router_forwarder() { +#if defined(ENABLE_EXTENSIONS) + return extension_event_router_forwarder_; +#else + return NULL; +#endif + } + static net::URLRequestContext* ConstructSystemRequestContext( + IOThread::Globals* globals, + const net::HttpNetworkSession::Params& params, + net::NetLog* net_log); + + // TODO(willchan): Remove proxy script fetcher context since it's not + // necessary now that I got rid of refcounting URLRequestContexts. + // See IOThread::Globals for details. + static net::URLRequestContext* ConstructProxyScriptFetcherContext( + IOThread::Globals* globals, + const net::HttpNetworkSession::Params& params, + net::NetLog* net_log); + + // The NetLog is owned by the browser process, to allow logging from other + // threads during shutdown, but is used most frequently on the IOThread. + net_log::ChromeNetLog* net_log_; + +#if defined(ENABLE_EXTENSIONS) + // The extensions::EventRouterForwarder allows for sending events to + // extensions from the IOThread. + extensions::EventRouterForwarder* extension_event_router_forwarder_; +#endif + + // These member variables are basically global, but their lifetimes are tied + // to the IOThread. IOThread owns them all, despite not using scoped_ptr. + // This is because the destructor of IOThread runs on the wrong thread. All + // member variables should be deleted in CleanUp(). + + // These member variables are initialized in Init() and do not change for the + // lifetime of the IO thread. + + Globals* globals_; + + net::HttpNetworkSession::Params params_; + NetworkSessionConfigurator network_session_configurator_; + + // Observer that logs network changes to the ChromeNetLog. + class LoggingNetworkChangeObserver; + std::unique_ptr network_change_observer_; + + BooleanPrefMember system_enable_referrers_; + + BooleanPrefMember dns_client_enabled_; + + BooleanPrefMember quick_check_enabled_; + + // Store HTTP Auth-related policies in this thread. + // TODO(aberent) Make the list of auth schemes a PrefMember, so that the + // policy can change after startup (https://crbug/549273). + std::string auth_schemes_; + BooleanPrefMember negotiate_disable_cname_lookup_; + BooleanPrefMember negotiate_enable_port_; + StringPrefMember auth_server_whitelist_; + StringPrefMember auth_delegate_whitelist_; + +#if defined(OS_ANDROID) + StringPrefMember auth_android_negotiate_account_type_; +#endif +#if defined(OS_POSIX) && !defined(OS_ANDROID) + // No PrefMember for the GSSAPI library name, since changing it after startup + // requires unloading the existing GSSAPI library, which could cause all sorts + // of problems for, for example, active Negotiate transactions. + std::string gssapi_library_name_; +#endif + + // This is an instance of the default SSLConfigServiceManager for the current + // platform and it gets SSL preferences from local_state object. + std::unique_ptr + ssl_config_service_manager_; + + // These member variables are initialized by a task posted to the IO thread, + // which gets posted by calling certain member functions of IOThread. + std::unique_ptr system_proxy_config_service_; + + std::unique_ptr pref_proxy_config_tracker_; + + scoped_refptr + system_url_request_context_getter_; + + // True if SPDY is allowed by policy. + bool is_spdy_allowed_by_policy_; + + // True if QUIC is allowed by policy. + bool is_quic_allowed_by_policy_; + + const base::TimeTicks creation_time_; + + // Callback for updating data use prefs which needs to be initialized on UI + // thread and passed to |ChromeNetworkDelegate|. + metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_; + + base::WeakPtrFactory weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(IOThread); +}; + +#endif // CHROME_BROWSER_IO_THREAD_H_ diff --git a/lib/cpplint_1.4.5/samples/codelite-sample/LICENSE b/lib/cpplint_1.4.5/samples/codelite-sample/LICENSE new file mode 100644 index 00000000000..efeedb07f06 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/codelite-sample/LICENSE @@ -0,0 +1,348 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + +EXCEPTION: +========== + +The only exception is that plugins developed for CodeLite and are linking +against CodeLite sources (either static linking or dynamic linking), +and the plugin is NOT one of the official plugins (i.e. a plugin that was developed by CodeLite's team), +Can be distributed under any license + diff --git a/lib/cpplint_1.4.5/samples/codelite-sample/README.md b/lib/cpplint_1.4.5/samples/codelite-sample/README.md new file mode 100644 index 00000000000..5cd1b36cc53 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/codelite-sample/README.md @@ -0,0 +1,2 @@ +Canary sample taken from codelite https://github.com/eranif/codelite +License applies as per LICENSE file in this folder diff --git a/lib/cpplint_1.4.5/samples/codelite-sample/simple.def b/lib/cpplint_1.4.5/samples/codelite-sample/simple.def new file mode 100644 index 00000000000..d06a66ba2f8 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/codelite-sample/simple.def @@ -0,0 +1,688 @@ +src/* +1 +4 +Done processing src/pptable.cpp +Done processing src/pptable.h +Total errors found: 680 + +src/pptable.cpp:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] +src/pptable.cpp:1: Include the directory when naming .h files [build/include_subdir] [4] +src/pptable.cpp:6: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:7: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:8: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:8: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:10: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:11: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:11: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:12: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:16: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:17: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:18: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:18: At least two spaces is best between code and comments [whitespace/comments] [2] +src/pptable.cpp:19: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:19: At least two spaces is best between code and comments [whitespace/comments] [2] +src/pptable.cpp:20: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:20: At least two spaces is best between code and comments [whitespace/comments] [2] +src/pptable.cpp:21: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:23: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:24: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:24: At least two spaces is best between code and comments [whitespace/comments] [2] +src/pptable.cpp:25: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:25: At least two spaces is best between code and comments [whitespace/comments] [2] +src/pptable.cpp:26: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:27: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:30: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:31: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:32: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:33: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:34: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:35: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:37: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:37: Extra space after ( in function call [whitespace/parens] [4] +src/pptable.cpp:37: Extra space before ) [whitespace/parens] [2] +src/pptable.cpp:39: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:39: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:39: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:40: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:41: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:42: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:43: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:44: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:45: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:46: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:48: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:49: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:49: Extra space after ( in function call [whitespace/parens] [4] +src/pptable.cpp:50: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:51: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:53: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:54: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/pptable.cpp:55: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:56: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:57: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:59: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:59: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:59: Missing space before ( in if( [whitespace/parens] [5] +src/pptable.cpp:60: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:61: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:63: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:64: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:65: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:66: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:67: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/pptable.cpp:68: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:69: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:70: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:74: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:75: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:76: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:77: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:78: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:79: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:80: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:80: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:80: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:81: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:82: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:83: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:84: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:85: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:86: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:87: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:89: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:90: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:90: Extra space after ( in function call [whitespace/parens] [4] +src/pptable.cpp:91: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:92: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:94: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:95: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/pptable.cpp:96: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:97: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:98: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:100: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:100: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:100: Missing space before ( in if( [whitespace/parens] [5] +src/pptable.cpp:101: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:102: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:104: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:105: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:106: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:107: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:108: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/pptable.cpp:109: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:110: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:111: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:115: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:116: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:117: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:118: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:119: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:120: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:120: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:121: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:122: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:123: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:124: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:125: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:126: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:127: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:128: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:129: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:131: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:132: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:132: Extra space after ( in function call [whitespace/parens] [4] +src/pptable.cpp:133: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:135: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:136: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/pptable.cpp:137: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:138: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:139: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:141: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:142: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/pptable.cpp:143: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:144: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:145: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:146: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/pptable.cpp:147: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:148: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:149: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:153: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:153: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:155: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:156: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:158: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:159: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:159: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:159: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:160: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:160: Using C-style cast. Use static_cast(...) instead [readability/casting] [4] +src/pptable.cpp:162: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:164: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:164: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:165: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:166: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:167: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:167: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:168: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:169: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:170: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:170: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:170: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/pptable.cpp:171: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:173: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:177: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:179: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:180: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:181: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:182: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:183: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:184: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:184: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:184: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:185: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:186: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:187: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:188: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:189: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:191: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:192: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:192: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:193: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:198: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:199: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:200: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:201: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:202: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:203: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:203: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:203: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:204: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:205: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:206: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:207: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:208: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:209: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:210: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:211: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:215: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:216: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:218: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:219: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:219: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:220: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:222: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:223: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:224: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:226: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:227: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:228: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:229: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:230: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:231: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:232: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:233: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:233: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:233: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:234: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:234: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:234: Missing space before { [whitespace/braces] [5] +src/pptable.cpp:235: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:236: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:237: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:238: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:240: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:240: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:240: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:241: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:242: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:243: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:244: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:245: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:246: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:247: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:248: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:248: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:248: Extra space after ( in function call [whitespace/parens] [4] +src/pptable.cpp:249: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:251: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:252: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:253: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:254: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:255: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:256: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:258: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:259: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:260: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:261: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:262: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:263: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:264: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:266: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:267: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:268: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:269: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:272: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:273: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:274: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:275: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:276: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:278: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:279: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:280: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:280: Mismatching spaces inside () in if [whitespace/parens] [5] +src/pptable.cpp:281: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:282: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:284: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:285: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:287: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:287: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:287: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:288: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:289: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:291: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:292: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:293: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:295: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:295: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:295: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:296: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:297: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:298: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:299: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:300: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:300: Extra space for operator --; [whitespace/operators] [4] +src/pptable.cpp:301: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:302: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:303: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:304: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:305: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:306: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:307: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:308: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:309: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:310: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:311: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:312: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:313: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:314: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:315: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:316: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:317: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:318: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:319: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:320: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:321: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:322: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:323: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:324: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:325: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:328: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:329: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:330: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:330: Using C-style cast. Use static_cast(...) instead [readability/casting] [4] +src/pptable.cpp:331: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:332: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:334: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:335: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:336: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:336: Mismatching spaces inside () in if [whitespace/parens] [5] +src/pptable.cpp:337: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:338: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:339: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:341: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:341: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:341: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:342: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:343: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:345: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:346: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:347: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:349: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:349: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:349: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:350: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:351: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:352: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:353: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:354: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:354: Extra space for operator --; [whitespace/operators] [4] +src/pptable.cpp:355: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:356: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:357: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:358: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:359: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:360: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:361: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:362: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:363: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:364: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:365: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:366: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:367: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:368: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:369: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:370: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:371: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:372: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:373: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:374: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:375: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:376: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:377: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:378: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:379: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:383: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:384: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:385: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:387: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:387: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:387: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:388: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:389: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:390: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:390: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:391: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:392: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:393: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:393: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:394: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:395: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:396: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:396: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:397: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:398: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:402: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:403: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:404: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:405: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:406: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:406: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:406: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:407: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:408: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:409: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:410: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:411: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:412: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:413: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:414: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:420: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:424: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:428: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:429: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:430: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:431: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:432: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:436: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:437: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:438: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:439: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:440: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:444: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:445: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:446: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:447: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:448: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:450: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:454: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:455: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:456: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:458: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:459: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:460: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:461: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:462: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:463: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:463: If an else has a brace on one side, it should have it on both [readability/braces] [5] +src/pptable.cpp:464: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:465: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:466: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:466: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:467: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:468: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:469: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:473: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:474: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:475: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:476: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:477: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:481: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:482: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:483: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:484: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:485: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:489: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:490: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:491: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:495: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:496: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:497: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:498: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:499: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:500: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:501: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:502: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:502: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:503: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:504: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:504: Missing space before { [whitespace/braces] [5] +src/pptable.cpp:505: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:505: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.cpp:506: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:507: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:509: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:509: Missing space before ( in if( [whitespace/parens] [5] +src/pptable.cpp:510: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:512: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:513: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:514: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:515: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:515: Use int16/int64/etc, rather than the C type long [runtime/int] [4] +src/pptable.cpp:516: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:516: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:517: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:518: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:519: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:520: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:521: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:525: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:526: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:527: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:528: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:529: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:533: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:534: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:538: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:539: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:542: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:542: Is this a non-const reference? If so, make const or use a pointer: wxString &outStr [runtime/references] [2] +src/pptable.cpp:543: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:544: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:545: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:546: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:548: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:549: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:550: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:551: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:552: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:553: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:555: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:556: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:557: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:557: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:558: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:560: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:561: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:562: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:562: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:562: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:563: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:564: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:565: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:566: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:568: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:569: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:570: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:572: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:573: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:574: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:575: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:576: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:577: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:578: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:579: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:582: Static/global string variables are not permitted. [runtime/string] [4] +src/pptable.cpp:584: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:584: Is this a non-const reference? If so, make const or use a pointer: std::string& outStr [runtime/references] [2] +src/pptable.cpp:585: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:586: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:587: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:588: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:589: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:591: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:592: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:593: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:593: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:594: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:596: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:597: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:598: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:599: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:599: Missing spaces around = [whitespace/operators] [4] +src/pptable.cpp:599: Missing spaces around < [whitespace/operators] [3] +src/pptable.cpp:600: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/pptable.cpp:602: Using C-style cast. Use static_cast(...) instead [readability/casting] [4] +src/pptable.cpp:602: Never use sprintf. Use snprintf instead. [runtime/printf] [5] +src/pptable.cpp:604: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:605: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:606: Missing space before ( in while( [whitespace/parens] [5] +src/pptable.cpp:607: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:609: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:612: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:614: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:615: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:616: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:617: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:619: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:619: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:620: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:622: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:623: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/pptable.cpp:624: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:625: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:626: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:627: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:629: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:631: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:631: Should have a space between // and comment [whitespace/comments] [4] +src/pptable.cpp:632: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:632: Should have a space between // and comment [whitespace/comments] [4] +src/pptable.cpp:634: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:635: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:636: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:639: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.cpp:640: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.cpp:641: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:642: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:643: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:644: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:645: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:646: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:647: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:648: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:649: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:650: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:651: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:653: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:654: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:654: Missing space before { [whitespace/braces] [5] +src/pptable.cpp:655: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:656: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:657: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:659: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:660: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:661: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:662: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.cpp:663: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] +src/pptable.h:1: #ifndef header guard has wrong style, please use: SAMPLES_CODELITE_SAMPLE_SRC_PPTABLE_H_ [build/header_guard] [5] +src/pptable.h:131: #endif line should be "#endif // SAMPLES_CODELITE_SAMPLE_SRC_PPTABLE_H_" [build/header_guard] [5] +src/pptable.h:6: Found C system header after C++ system header. Should be: pptable.h, c system, c++ system, other. [build/include_order] [4] +src/pptable.h:19: At least two spaces is best between code and comments [whitespace/comments] [2] +src/pptable.h:27: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:28: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:29: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:30: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:31: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:32: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:49: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.h:49: Is this a non-const reference? If so, make const or use a pointer: wxString &output [runtime/references] [2] +src/pptable.h:63: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.h:63: Is this a non-const reference? If so, make const or use a pointer: std::string& outStr [runtime/references] [2] +src/pptable.h:69: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:70: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:71: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:72: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:73: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:75: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:76: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:77: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:78: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:78: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.h:79: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:80: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:82: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:83: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:83: Missing space before { [whitespace/braces] [5] +src/pptable.h:85: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:86: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:86: Missing space before { [whitespace/braces] [5] +src/pptable.h:88: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:89: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:90: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:91: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:91: Is this a non-const reference? If so, make const or use a pointer: wxFFile &fp [runtime/references] [2] +src/pptable.h:92: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:92: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.h:92: Is this a non-const reference? If so, make const or use a pointer: wxString& initList [runtime/references] [2] +src/pptable.h:92: Is this a non-const reference? If so, make const or use a pointer: wxArrayString &initListArr [runtime/references] [2] +src/pptable.h:93: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:93: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/pptable.h:93: Is this a non-const reference? If so, make const or use a pointer: std::string& initList [runtime/references] [2] +src/pptable.h:93: Is this a non-const reference? If so, make const or use a pointer: std::vector &initListArr [runtime/references] [2] +src/pptable.h:94: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:95: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:96: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:96: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.h:96: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/pptable.h:100: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/pptable.h:101: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:102: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:104: public: should be indented +1 space inside class PPTable [whitespace/indent] [3] +src/pptable.h:105: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:106: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:108: private: should be indented +1 space inside class PPTable [whitespace/indent] [3] +src/pptable.h:109: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:110: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:112: public: should be indented +1 space inside class PPTable [whitespace/indent] [3] +src/pptable.h:113: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:114: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:115: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:115: Extra space before ( in function call [whitespace/parens] [4] +src/pptable.h:116: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:117: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:117: Is this a non-const reference? If so, make const or use a pointer: wxFFile &fp [runtime/references] [2] +src/pptable.h:118: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:119: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:120: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:121: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:123: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:124: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:125: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:126: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:126: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/pptable.h:127: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:128: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:129: Tab found; better to use spaces [whitespace/tab] [1] +src/pptable.h:131: At least two spaces is best between code and comments [whitespace/comments] [2] + diff --git a/lib/cpplint_1.4.5/samples/codelite-sample/src/pptable.cpp b/lib/cpplint_1.4.5/samples/codelite-sample/src/pptable.cpp new file mode 100644 index 00000000000..c11c81178a6 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/codelite-sample/src/pptable.cpp @@ -0,0 +1,665 @@ +#include "pptable.h" +#include +#include + +bool IsWordChar(const wxString &s, int strSize) +{ + if(strSize) { + return s.find_first_of(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_")) != wxString::npos; + + } else { + return s.find_first_of(wxT("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_")) != wxString::npos; + } +} + +bool IsWordCharA(char c, int strSize) +{ + if(strSize) { + return ((c >= 97 && c <= 122) ||// a-z + (c >= 65 && c <= 90) ||// A-Z + (c >= 48 && c <= 57) ||// 0-9 + (c == '_')); + + } else { + return ((c >= 97 && c <= 122) ||// a-z + (c >= 65 && c <= 90) ||// A-Z + (c == '_')); + } +} + +std::string ReplaceWordA(const std::string &str, const std::string &word, const std::string &replaceWith) +{ + char currChar; + char nextChar; + std::string currentWord; + std::string output; + + output.reserve( str.length() * 2 ); + + for(size_t i=0; i i + 1 ) { + nextChar = str[i+1]; + } else { + // we are at the end of buffer + nextChar = '\0'; + } + + currChar = str[i]; + if(!IsWordCharA( currChar, currentWord.length() )) { + output += str[i]; + currentWord.clear(); + + } else { + + currentWord += currChar; + if(IsWordCharA(nextChar, currentWord.length())) { + // do nothing + + } else if( !IsWordCharA(nextChar, currentWord.length()) && currentWord == word ) { + output += replaceWith; + currentWord.clear(); + + } else { + output += currentWord; + currentWord.clear(); + } + + } + } + return output; +} + +// Helper string find metho +wxString ReplaceWord(const wxString &str, const wxString &word, const wxString &replaceWith) +{ + wxString currChar; + wxString nextChar; + wxString currentWord; + wxString output; + for(size_t i=0; i i + 1 ) { + nextChar = str[i+1]; + } else { + // we are at the end of buffer + nextChar = wxT('\0'); + } + + currChar = str[i]; + if(!IsWordChar( currChar, currentWord.Length() )) { + output << str[i]; + currentWord.Clear(); + + } else { + + currentWord << currChar; + if(IsWordChar(nextChar, currentWord.Length())) { + // do nothing + + } else if( !IsWordChar(nextChar, currentWord.Length()) && currentWord == word ) { + output << replaceWith; + currentWord.Clear(); + + } else { + output << currentWord; + currentWord.Clear(); + } + + } + } + return output; +} + +wxArrayString TokenizeWords(const wxString &str) +{ + wxString currChar; + wxString nextChar; + wxString currentWord; + wxArrayString outputArr; + + wxString::const_iterator iter = str.begin(); + for(; iter != str.end(); iter++) { + // Look ahead + if( (iter + 1) != str.end() ) { + nextChar = *(iter+1); + } else { + // we are at the end of buffer + nextChar = wxT('\0'); + } + + currChar = *iter; + if(!IsWordChar( currChar, currentWord.Length() )) { + currentWord.Clear(); + + } else { + + currentWord << currChar; + if(IsWordChar(nextChar, currentWord.Length())) { + // do nothing + + } else { + + outputArr.Add(currentWord); + currentWord.Clear(); + } + + } + } + return outputArr; +} + +static PPTable* ms_instance = NULL; + +void PPToken::processArgs(const wxString &argsList) +{ + args = wxStringTokenize(argsList, wxT(","), wxTOKEN_STRTOK); + + // replace all occurances of 'arg' with %1, %2 etc + for(size_t i=0; i alreadyReplacedMacros; + + // perform the squeeze 5 times max + for(size_t count=0; count < 5; count++) { + bool modified(false); + + // get list of possible macros in the replacement + wxArrayString tmpWords = TokenizeWords(replacement); + wxArrayString words; + + // make sure that a word is not been replaced more than once + // this will avoid recursion + // an example (taken from qglobal.h of the Qt library): + // + // #define qDebug QT_NO_QDEBUG_MACRO + // #define QT_NO_QDEBUG_MACRO if(1); else qDebug + // + for(size_t i=0; iToken(words.Item(i)); + if(tok.flags & IsValid) { + if(tok.flags & IsFunctionLike) { + int where = replacement.Find(words.Item(i)); + if(where != wxNOT_FOUND) { + wxString initList; + wxArrayString initListArr; + if(readInitList( replacement, where + words.Item(i).Length(), initList, initListArr )) { + tok.expandOnce(initListArr); + + replacement.Remove(where, words.Item(i).Length() + initList.Length()); + tok.replacement.Replace(wxT("##"), wxT("")); + replacement.insert(where, tok.replacement); + modified = true; + } + } + + } else { + if(replacement.Replace(words.Item(i), tok.replacement)) { + modified = true; + } + } + } + } + + if(!modified) + break; + } + replacement.Replace(wxT("##"), wxT("")); +} + +bool PPToken::readInitList(const std::string& in, size_t from, std::string& initList, std::vector& initListArr) +{ + if(in.length() < from) { + return false; + } + + std::string tmpString = in.substr(from); + size_t start = tmpString.find('('); + if(start == std::string::npos ) { + return false; + } + + // skip the open brace + tmpString = tmpString.substr(start+1); + + for(size_t i=0; i::iterator iter = m_table.find(name); + if(iter == m_table.end()) { + return PPToken(); + } + + return iter->second; +} + +void PPTable::Add(const PPToken& token) +{ + if(token.name.IsEmpty()) + return; + + wxString name = token.name; + name.Trim().Trim(false); + std::map::iterator iter = m_table.find(name); + if(iter == m_table.end()) + m_table[name] = token; + else { + // if the new token's replacement is empty and the current one is NOT empty, + // replace the two (we prefer empty replacements) + if(iter->second.flags & PPToken::IsOverridable && !iter->second.replacement.IsEmpty() && token.replacement.IsEmpty()) { + m_table[name] = token; + } + } +} + +void PPTable::AddUsed(const wxString& name) +{ + if(name.IsEmpty()) { + return; + } + m_namesUsed.insert(name); +} + +void PPTable::Print(wxFFile &fp) +{ + std::map::iterator iter = m_table.begin(); + for(; iter != m_table.end(); iter++) { + iter->second.print(fp); + } +} + +bool PPTable::Contains(const wxString& name) +{ + std::map::iterator iter = m_table.find(name); + return iter != m_table.end(); +} + +wxString PPTable::Export() +{ + wxString table; + std::map::iterator iter = m_table.begin(); + for(; iter != m_table.end(); iter++) { + iter->second.squeeze(); + wxString replacement = iter->second.replacement; + replacement.Trim().Trim(false); + + // remove extra whitespaces + while(replacement.Replace(wxT(" "), wxT(" "))){} + + if(replacement.IsEmpty()) { + table << iter->second.fullname() << wxT("\n"); + + } else if(iter->second.flags & PPToken::IsFunctionLike) { + table << iter->second.fullname() << wxT("=") << replacement << wxT("\n"); + + } else { + // macros with replacement but they are not in a form of a function + // we take only macros that thier replacement is not a number + long v(-1); + if(!replacement.ToLong(&v) && !replacement.ToLong(&v, 8) && !replacement.ToLong(&v, 16) && replacement.find(wxT('"')) == wxString::npos && !replacement.StartsWith(wxT("0x"))) { + table << iter->second.fullname() << wxT("=") << replacement << wxT("\n"); + } + } + } + return table; +} + +void PPTable::Squeeze() +{ + std::map::iterator iter = m_table.begin(); + for(; iter != m_table.end(); iter++) { + m_table[iter->first].squeeze(); + } +} + +void PPTable::Clear() +{ + m_table.clear(); +} + +void PPTable::ClearNamesUsed() +{ + m_namesUsed.clear(); +} + +bool CLReplacePattern(const wxString& in, const wxString& pattern, const wxString& replaceWith, wxString &outStr) +{ + int where = pattern.Find(wxT("%0")); + if(where != wxNOT_FOUND) { + wxString replacement(replaceWith); + + // a patterened expression + wxString searchFor = pattern.BeforeFirst(wxT('(')); + where = in.Find(searchFor); + if(where == wxNOT_FOUND) { + return false; + } + + wxString initList; + wxArrayString initListArr; + if(PPToken::readInitList(in, searchFor.Length() + where, initList, initListArr) == false) + return false; + + outStr = in; + // update the 'replacement' with the actual values ( replace %0..%n) + for(size_t i=0; i initListArr; + if(PPToken::readInitList(in, repl.searchFor.length() + where, initList, initListArr) == false) + return false; + + // update the 'replacement' with the actual values ( replace %0..%n) + replacement = repl.replaceWith; + char placeHolder[4]; + for(size_t i=0; i +#include +#include +#include +#include +#include +#include + + +#ifndef WXDLLIMPEXP_CL + +#ifdef WXMAKINGDLL_CL +# define WXDLLIMPEXP_CL __declspec(dllexport) +#elif defined(WXUSINGDLL_CL) +# define WXDLLIMPEXP_CL __declspec(dllimport) +#else // not making nor using DLL +# define WXDLLIMPEXP_CL +#endif + +#endif + + +struct WXDLLIMPEXP_CL CLReplacement { + bool is_compound; + bool is_ok; + std::string full_pattern; + std::string searchFor; + std::string replaceWith; + void construct(const std::string& pattern, const std::string& replacement); +}; + +typedef std::list CLReplacementList; + +/** + * @brief perform search and replace using CL pattern + * an example: + * pattern=wx_dynamic_cast(%0, %1) + * replacement=dynamic_cast<%0>(%1) + * in=wx_dynamic_cast(wxApp*, ptr)->OnInit(); + * + * the expected result is: + * dynamic_cast(ptr)->OnInit() + * + * It also supports simple search and replace + */ +bool CLReplacePattern(const wxString &in, const wxString& pattern, const wxString& replacement, wxString &output); + +/** + * @brief perform search and replace using CL pattern + * an example: + * pattern=wx_dynamic_cast(%0, %1) + * replacement=dynamic_cast<%0>(%1) + * in=wx_dynamic_cast(wxApp*, ptr)->OnInit(); + * + * the expected result is: + * dynamic_cast(ptr)->OnInit() + * + * It also supports simple search and replace + */ +bool CLReplacePatternA(const std::string& in, const CLReplacement& repl, std::string& outStr); + +/** + * + */ +struct WXDLLIMPEXP_CL PPToken { + enum { + IsFunctionLike = 0x00000001, + IsValid = 0x00000002, + IsOverridable = 0x00000004 + }; + + int line; // line where found + wxString name; // preprocessor name + wxString replacement; // un processed replacement + wxArrayString args; // for function like macros, contains the argument's names + size_t flags; // PP token flags + wxString fileName; + + PPToken() : line(0), flags(IsOverridable) + {} + + ~PPToken() + {} + + void expandOnce(const wxArrayString& initList); + void processArgs(const wxString &argsList); + wxString signature() const; + void print(wxFFile &fp); + static bool readInitList(const wxString &in, int from, wxString& initList, wxArrayString &initListArr); + static bool readInitList(const std::string &in, size_t from, std::string& initList, std::vector &initListArr); + void squeeze(); + wxString fullname() const; + +}; + +class WXDLLIMPEXP_CL PPTable +{ + std::map m_table; + std::set m_namesUsed; + +public: + static PPTable* Instance(); + static void Release(); + +private: + PPTable(); + ~PPTable(); + +public: + PPToken Token(const wxString &name); + bool Contains(const wxString &name); + void Add (const PPToken& token); + void AddUsed(const wxString& name); + void Print(wxFFile &fp); + wxString Export(); + void Clear(); + void ClearNamesUsed(); + void Squeeze(); + + const std::map& GetTable() const { + return m_table; + } + + const std::set& GetNamesUsed() const { + return m_namesUsed; + } +}; +#endif // PPTABLE_H diff --git a/lib/cpplint_1.4.5/samples/protobuf-sample/LICENSE b/lib/cpplint_1.4.5/samples/protobuf-sample/LICENSE new file mode 100644 index 00000000000..25386d03281 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/protobuf-sample/LICENSE @@ -0,0 +1,33 @@ +Copyright 2008 Google Inc. All rights reserved. + +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. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + diff --git a/lib/cpplint_1.4.5/samples/protobuf-sample/README.md b/lib/cpplint_1.4.5/samples/protobuf-sample/README.md new file mode 100644 index 00000000000..9e5b3352853 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/protobuf-sample/README.md @@ -0,0 +1,3 @@ +# VLC sample + +code taken for regression testing from https://github.com/protocolbuffers/protobuf diff --git a/lib/cpplint_1.4.5/samples/protobuf-sample/simple.def b/lib/cpplint_1.4.5/samples/protobuf-sample/simple.def new file mode 100644 index 00000000000..6135da6985b --- /dev/null +++ b/lib/cpplint_1.4.5/samples/protobuf-sample/simple.def @@ -0,0 +1,2652 @@ +src/* +1 +5 +Done processing src/descriptor.pb.cc +Done processing src/descriptor.pb.h +Done processing src/descriptor_unittest.cc +Total errors found: 2643 + +src/descriptor.pb.cc:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] +src/descriptor.pb.cc:9: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:10: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:11: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:12: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:13: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:14: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:15: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:16: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:17: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.cc:34: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:37: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:43: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:44: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:51: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:63: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:71: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:87: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:93: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:99: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:117: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:121: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:125: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:130: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:131: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:132: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:133: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:134: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:135: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:136: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:137: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:138: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:139: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:140: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:143: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:147: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:151: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:158: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:160: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:161: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:163: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:164: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:167: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:171: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:175: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:177: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:179: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:180: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:183: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:187: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:191: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:193: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:195: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:196: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:199: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:203: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:207: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:212: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:213: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:215: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:216: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:217: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:218: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:219: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:220: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:223: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:227: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:231: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:233: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:234: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:240: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:244: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:248: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:254: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:257: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:261: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:265: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:269: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:270: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:271: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:274: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:278: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:282: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:286: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:287: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:288: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:291: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:295: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:299: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:303: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:304: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:305: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:306: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:307: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:308: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:311: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:315: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:319: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:324: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:325: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:326: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:327: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:330: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:331: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:332: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:334: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:335: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:336: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:337: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:340: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:344: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:348: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:353: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:354: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:357: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:360: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:364: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:366: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:368: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:378: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:381: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:385: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:387: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:389: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:397: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:400: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:404: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:408: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:412: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:413: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:416: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:420: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:422: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:424: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:429: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:432: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:436: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:438: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:440: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:445: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:448: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:452: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:454: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:456: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:461: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:462: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:463: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:464: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:465: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:466: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:469: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:473: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:477: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:479: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:481: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:482: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:485: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:489: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:493: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:500: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:504: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:508: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:510: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:512: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:513: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:514: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:515: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:516: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:519: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:523: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:527: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:531: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:534: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:538: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:542: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:544: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:546: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:547: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:548: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:549: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:552: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:556: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:560: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:577: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:581: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:583: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:585: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:587: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:589: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:591: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:593: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:595: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:611: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:613: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:617: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:621: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:688: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:699: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:713: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:714: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:715: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:719: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:721: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:723: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:725: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:727: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:730: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:740: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:744: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:747: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:764: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:770: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:772: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:775: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:778: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:780: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:781: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:787: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:790: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:793: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:796: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:798: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:800: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:803: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:809: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:818: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:819: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:834: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:838: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:863: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:917: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:932: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:938: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:961: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:964: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:970: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1030: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1063: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:1064: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1099: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:1100: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1133: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1137: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1150: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1182: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1183: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1197: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1198: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1201: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1211: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1212: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1213: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1231: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1237: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1249: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1252: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1260: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1263: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1285: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1288: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1347: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1363: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1379: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1395: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1410: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1423: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1436: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1437: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1440: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1441: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1455: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1456: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1459: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1460: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1708: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1733: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:1756: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:1831: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:1832: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1856: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1860: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1865: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1868: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1872: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1895: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:1896: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1897: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1898: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1899: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1950: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1953: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1955: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1957: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1959: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1962: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1964: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1967: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1973: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1976: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1978: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1981: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:1983: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:1989: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2004: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2007: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2009: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2011: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2013: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2016: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2018: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2021: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2023: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2027: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2030: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2032: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2035: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2037: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2043: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2054: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2058: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2062: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2062: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2066: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2070: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2070: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2075: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2079: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2083: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2087: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2091: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2096: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2109: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2109: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2113: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2113: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2117: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2117: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2121: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2126: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2139: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2139: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2143: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2143: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2147: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2147: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2151: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2156: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2169: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2173: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2186: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2199: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2203: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2216: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2229: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2233: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2241: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2246: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2259: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2263: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2271: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2276: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2315: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2337: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2340: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2342: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2344: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2352: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2359: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2381: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2384: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2386: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2388: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2390: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2393: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2395: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2398: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2400: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2404: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2407: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2409: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2412: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2414: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:2420: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2442: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2463: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:2472: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2477: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2478: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2482: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2484: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2502: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:2506: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:2527: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2530: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2535: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2550: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2587: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2592: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2602: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2607: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2612: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2616: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2641: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:2654: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2657: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:2658: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2669: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2685: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2692: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2700: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:2704: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2708: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2716: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2741: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2762: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:2771: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2776: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2777: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2781: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2783: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2801: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:2805: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:2826: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2829: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2834: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2849: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2886: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2891: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2901: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2906: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2911: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2915: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2940: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:2953: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2956: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:2957: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2968: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2984: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2991: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:2999: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:3007: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3015: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3046: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3060: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3071: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3088: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3106: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3109: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3132: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3135: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3158: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3174: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3190: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3201: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3206: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3222: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3237: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3252: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3263: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3268: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3351: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3433: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3479: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3504: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:3538: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3583: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:3584: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3609: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3612: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3635: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:3636: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3637: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3638: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3639: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3691: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3695: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3695: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3715: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3719: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3743: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3747: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3747: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3767: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3771: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3792: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3795: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3797: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3799: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3801: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3804: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3806: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3809: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3815: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3818: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3820: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3823: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3825: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:3831: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3842: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3846: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3854: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3859: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3872: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3876: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3884: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3889: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3902: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3906: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3919: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3932: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3936: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3949: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3962: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3966: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3970: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3974: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3979: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3992: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:3996: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4004: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4009: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4048: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4066: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4070: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4074: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4078: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4083: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4096: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4100: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4104: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4104: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4108: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4112: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4112: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4117: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4121: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4125: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4129: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4133: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4138: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4148: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4153: Missing space before ( in switch( [whitespace/parens] [5] +src/descriptor.pb.cc:4201: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4206: Missing space before ( in switch( [whitespace/parens] [5] +src/descriptor.pb.cc:4244: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4258: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4262: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4263: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4264: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4266: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4277: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4278: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4279: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4280: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4281: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4298: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4304: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4316: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4322: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4325: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4328: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4334: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4352: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4355: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4394: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4410: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4413: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4430: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4433: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4482: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4496: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4570: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4613: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4633: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4660: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4706: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4721: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4786: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:4802: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:4818: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:4819: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4836: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4849: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4853: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4857: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4866: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4869: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4892: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:4941: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4944: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4946: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4948: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4950: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4953: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4955: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4958: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4964: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4967: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4969: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4972: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4974: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:4980: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:4998: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5002: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5022: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5022: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5026: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5026: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5047: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5047: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5051: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5051: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5069: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5072: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5074: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5076: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5078: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5081: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5083: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5086: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5088: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5092: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5095: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5097: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5100: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5102: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5108: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5123: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5126: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5128: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5130: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5132: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5135: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5137: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5140: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5142: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5146: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5149: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5151: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5154: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5156: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5162: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5177: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5180: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5182: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5184: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5186: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5189: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5191: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5194: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5196: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5200: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5203: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5205: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5208: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5210: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5210: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5216: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5234: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5238: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5255: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5258: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5260: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5262: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5264: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5267: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5269: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5272: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5274: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5278: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5281: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5283: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5286: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5288: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5294: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5331: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5370: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5380: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5381: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:5396: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5402: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5413: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5427: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5430: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5489: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5504: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5536: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:5537: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5554: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5577: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:5614: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5617: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5619: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5621: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5623: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5626: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5628: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5631: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5637: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5640: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5642: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5645: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5647: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:5653: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5674: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5688: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5699: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5716: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5722: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5734: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5753: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5756: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5779: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5794: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5886: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5911: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:5935: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:5936: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5954: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5957: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5980: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:5981: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6023: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6026: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6028: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6030: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6032: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6035: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6037: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6040: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6046: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6049: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6051: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6054: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6056: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6062: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6073: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6077: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6085: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6090: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6129: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6157: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6160: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6171: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6183: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6200: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6206: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6218: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6222: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6237: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6240: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6262: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6276: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6322: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6338: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6354: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6365: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6397: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:6410: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6413: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:6414: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6431: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6437: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6445: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6460: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:6502: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6505: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6507: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6509: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6511: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6514: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6516: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6519: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6525: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6528: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6530: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6533: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6535: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6541: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6559: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6563: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6583: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6587: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6595: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6602: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6630: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6633: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6644: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6655: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6672: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6678: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6690: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6693: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6709: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6712: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6735: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6750: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6813: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6842: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6867: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:6888: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6891: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:6892: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6910: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6913: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6936: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:6937: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6979: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6982: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6984: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6986: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6988: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6991: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:6993: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:6996: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7002: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7005: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7007: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7010: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7012: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7018: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7029: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7033: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7037: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7041: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7046: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7066: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7085: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7116: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7130: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7131: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7132: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7145: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7146: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7147: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7164: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7170: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7188: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:7192: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:7199: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7202: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7205: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7208: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7227: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7230: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7285: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7299: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7314: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7387: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7392: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7402: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7447: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7452: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7456: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7505: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:7521: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:7522: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7539: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7543: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7547: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7550: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7579: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:7624: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7627: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7629: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7631: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7633: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7636: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7638: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7641: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7647: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7650: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7652: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7655: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7657: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7663: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7678: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7681: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7683: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7685: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7687: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7690: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7692: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7695: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7697: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7701: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7704: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7706: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7709: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7711: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7711: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7717: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7732: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7735: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7737: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7739: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7741: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7744: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7746: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7749: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7751: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7755: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7758: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7760: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7763: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7765: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7765: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7771: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7789: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7808: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7833: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7837: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7857: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7861: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:7871: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7876: Missing space before ( in switch( [whitespace/parens] [5] +src/descriptor.pb.cc:7932: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7933: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7938: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7944: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7945: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7955: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7956: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7957: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7958: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7959: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:7960: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:7975: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8000: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:8004: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:8011: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8014: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8018: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8024: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8027: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8047: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8050: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8074: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8084: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8090: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8093: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8109: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8141: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8156: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8171: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8186: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8201: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8216: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8231: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8248: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8275: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8281: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8335: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8342: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8350: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8365: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8370: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8375: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8380: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8385: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8390: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8395: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8452: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8460: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8468: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8484: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8489: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8494: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8499: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8504: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8509: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8514: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8551: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8592: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8595: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8609: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:8645: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:8671: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:8690: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8694: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8710: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8731: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8735: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8759: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:8760: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8762: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:8773: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8813: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8816: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8818: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8820: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8822: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8825: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8827: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8830: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8832: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8836: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8839: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8841: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8844: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8846: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8852: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8867: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8870: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8872: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8874: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8876: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8879: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8881: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8884: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8886: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8890: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8893: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8895: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8898: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8900: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8900: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8906: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8924: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8928: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8948: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8952: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8972: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8976: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8982: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8996: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:8996: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:8998: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9000: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9000: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9018: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9021: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9023: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9025: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9027: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9030: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9032: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9035: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9037: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9041: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9044: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9046: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9049: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9051: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9057: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9075: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9079: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9099: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9103: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9123: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9127: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9147: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9151: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9171: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9175: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9192: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9195: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9197: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9199: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9201: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9204: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9206: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9209: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9211: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9215: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9218: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9220: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9223: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9225: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9225: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9231: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9246: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9249: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9251: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9253: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9255: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9258: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9260: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9263: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9265: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9269: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9272: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9274: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9277: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9279: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9279: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9285: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9296: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9300: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9304: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9313: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9363: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:9378: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9403: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:9407: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:9429: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9432: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9437: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9452: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9467: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9482: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9492: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9498: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9541: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9546: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9551: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9556: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9581: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9586: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9591: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9596: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9611: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9642: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:9668: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:9669: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9689: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9719: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:9720: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9722: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:9731: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9766: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9770: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9790: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9794: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9814: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9818: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9838: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9842: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:9855: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9859: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9863: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9872: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:9887: Missing space before ( in switch( [whitespace/parens] [5] +src/descriptor.pb.cc:9910: Missing space before ( in switch( [whitespace/parens] [5] +src/descriptor.pb.cc:9972: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:9987: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10012: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:10016: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:10041: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10044: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10045: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10050: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10053: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10069: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10084: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10099: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10109: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10115: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10118: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10134: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10144: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10150: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10199: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10204: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10209: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10212: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10220: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10251: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10256: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10261: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10264: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10272: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10287: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10299: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10310: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10330: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:10356: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:10413: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:10414: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10416: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:10462: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10466: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10487: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10491: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10497: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10511: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10515: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10536: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10540: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10560: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10564: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10584: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10588: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:10601: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10605: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10609: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10618: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10664: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:10679: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10704: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:10708: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:10730: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10733: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10738: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10753: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10763: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10769: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10812: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10817: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10842: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10847: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10862: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10883: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:10909: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:10954: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:10955: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:10957: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:10999: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11003: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11023: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11027: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11040: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11044: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11048: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11057: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11101: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:11116: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11122: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11147: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11150: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11155: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11165: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11171: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11214: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11239: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11254: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11294: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:11295: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11336: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:11337: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11339: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:11380: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11384: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11397: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11401: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11405: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11414: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11458: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:11473: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11504: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11507: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11512: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11522: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11528: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11571: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11596: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11611: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11651: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:11652: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11693: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:11694: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11696: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:11737: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11741: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:11754: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11758: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11762: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11771: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11815: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:11830: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11861: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11864: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11869: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11879: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11885: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11928: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11953: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:11968: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12008: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:12050: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:12051: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12053: If/else bodies with multiple statements require braces [readability/braces] [4] +src/descriptor.pb.cc:12094: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:12098: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:12111: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12115: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12119: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12128: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12152: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12163: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12174: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12175: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:12184: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12189: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12190: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12194: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12196: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12208: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12224: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12227: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12249: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12296: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12306: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12322: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12326: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12355: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12378: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12381: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:12382: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12393: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12399: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12410: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12417: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12434: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12483: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12487: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12488: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12498: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12499: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12500: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12501: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:12516: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12522: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12540: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:12544: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:12551: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12554: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12557: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12577: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12580: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12586: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12619: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12634: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12649: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12732: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12737: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12742: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12791: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12796: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12801: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12823: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12874: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:12898: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:12899: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12917: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12930: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12934: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:12957: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:12958: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13001: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13004: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13006: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13008: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13010: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13013: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13015: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13018: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13018: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13020: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13024: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13027: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13029: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13032: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13034: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13034: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13040: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13058: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13062: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13079: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13083: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13087: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13091: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13096: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13113: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13116: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13118: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13120: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13122: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13125: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13127: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13130: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13130: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13132: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13136: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13139: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13141: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13144: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13146: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13146: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13152: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13170: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13174: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13174: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13194: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13198: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13198: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13218: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13222: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13239: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13242: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13244: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13246: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13248: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13251: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13253: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13256: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13258: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13262: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13265: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13267: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13270: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13272: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13272: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13278: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13293: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13296: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13298: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13300: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13302: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13305: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13307: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13310: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13312: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13316: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13319: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13321: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13324: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13326: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:13326: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13332: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13357: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13368: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13369: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13379: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13380: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13381: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:13396: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13402: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13414: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13417: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13435: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13438: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13442: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13443: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13446: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13447: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13460: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13461: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13464: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13465: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13498: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13515: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13516: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13518: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13554: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13564: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13595: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13609: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13665: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13673: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13698: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:13752: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13755: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:13756: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13776: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13780: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13788: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13803: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:13816: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13865: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:13880: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13909: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13912: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13918: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:13978: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14011: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:14012: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14047: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:14080: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14084: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14084: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14088: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14092: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14097: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14110: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14114: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14114: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14118: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14122: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14127: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14144: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14147: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14149: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14151: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14151: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14153: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14156: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14158: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14161: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14161: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14163: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14167: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14170: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14172: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14175: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14177: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14177: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14183: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14198: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14201: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14203: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14205: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14205: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14207: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14210: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14212: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14215: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14215: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14217: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14221: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14224: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14226: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14229: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14231: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14231: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14237: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14248: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14248: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14252: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14252: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14256: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14256: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14260: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14260: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14264: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14264: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14269: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14273: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14273: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14277: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14277: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14281: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14281: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14282: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14285: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14290: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:14307: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14311: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14319: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14324: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14350: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14361: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14373: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14374: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:14383: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14388: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14389: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14393: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14395: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14413: Are you taking an address of something dereferenced from a cast? Wrapping the dereferenced expression in parentheses will make the binding more obvious [readability/casting] [4] +src/descriptor.pb.cc:14417: Missing space after , [whitespace/comma] [3] +src/descriptor.pb.cc:14424: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14444: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14447: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14451: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14452: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14455: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14456: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14487: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14502: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14539: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14559: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14564: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14574: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14604: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14609: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14613: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14645: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] +src/descriptor.pb.cc:14675: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14678: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:14679: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14690: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14697: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14711: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14718: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14726: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:14734: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14787: If statement had no body and no else clause [whitespace/empty_if_body] [4] +src/descriptor.pb.cc:14802: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14808: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14831: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14834: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14840: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14900: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14933: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/descriptor.pb.cc:14934: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:14969: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2] +src/descriptor.pb.cc:15002: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15006: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15006: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15010: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15014: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15019: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15036: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15039: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15041: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15043: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15043: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15045: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15048: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15050: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15053: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15053: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15055: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15059: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15062: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15064: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15067: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15069: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15069: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15075: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15093: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15097: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15117: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15121: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor.pb.cc:15138: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15142: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15146: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15150: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:15155: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.cc:5: samples/protobuf-sample/src/descriptor.pb.cc should include its header file samples/protobuf-sample/src/descriptor.pb.h [build/include] [5] +src/descriptor.pb.h:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] +src/descriptor.pb.h:4: #ifndef header guard has wrong style, please use: SAMPLES_PROTOBUF_SAMPLE_SRC_DESCRIPTOR_PB_H_ [build/header_guard] [5] +src/descriptor.pb.h:7714: #endif line should be "#endif // SAMPLES_PROTOBUF_SAMPLE_SRC_DESCRIPTOR_PB_H_" [build/header_guard] [5] +src/descriptor.pb.h:9: Found C system header after C++ system header. Should be: descriptor.pb.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor.pb.h:37: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:87: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:88: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:89: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:91: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:92: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:98: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:107: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:108: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:109: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:111: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:112: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:118: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:127: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:128: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:129: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:131: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:132: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:147: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:148: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:151: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:167: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:168: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:169: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:171: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:172: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:183: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:225: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:227: private: should be indented +1 space inside class FileDescriptorSet [whitespace/indent] [3] +src/descriptor.pb.h:227: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:232: private: should be indented +1 space inside class FileDescriptorSet [whitespace/indent] [3] +src/descriptor.pb.h:232: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:239: public: should be indented +1 space inside class FileDescriptorSet [whitespace/indent] [3] +src/descriptor.pb.h:239: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:240: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:254: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:256: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:261: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +src/descriptor.pb.h:265: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:266: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:275: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:317: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:319: private: should be indented +1 space inside class FileDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:319: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:324: private: should be indented +1 space inside class FileDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:324: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:331: public: should be indented +1 space inside class FileDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:331: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:332: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:376: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:412: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:422: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:424: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:434: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:436: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:446: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:448: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:467: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:500: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:501: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:502: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:503: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:504: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:505: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:509: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:518: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:525: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:560: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:562: private: should be indented +1 space inside class DescriptorProto_ExtensionRange [whitespace/indent] [3] +src/descriptor.pb.h:562: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:567: private: should be indented +1 space inside class DescriptorProto_ExtensionRange [whitespace/indent] [3] +src/descriptor.pb.h:567: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:574: public: should be indented +1 space inside class DescriptorProto_ExtensionRange [whitespace/indent] [3] +src/descriptor.pb.h:574: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:575: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:608: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:617: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:624: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:659: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:661: private: should be indented +1 space inside class DescriptorProto_ReservedRange [whitespace/indent] [3] +src/descriptor.pb.h:661: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:666: private: should be indented +1 space inside class DescriptorProto_ReservedRange [whitespace/indent] [3] +src/descriptor.pb.h:666: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:673: public: should be indented +1 space inside class DescriptorProto_ReservedRange [whitespace/indent] [3] +src/descriptor.pb.h:673: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:674: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:707: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:758: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:760: private: should be indented +1 space inside class DescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:760: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:765: private: should be indented +1 space inside class DescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:765: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:772: public: should be indented +1 space inside class DescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:772: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:773: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:802: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:804: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:814: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:816: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:828: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:838: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:840: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:843: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:847: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:848: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:850: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:852: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:862: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:864: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:880: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:881: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:883: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:885: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:901: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:915: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:916: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:917: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:918: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:919: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:920: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:922: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:924: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:933: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:975: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:977: private: should be indented +1 space inside class FieldDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:977: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:982: private: should be indented +1 space inside class FieldDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:982: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:989: public: should be indented +1 space inside class FieldDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:989: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:990: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1216: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1225: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1267: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1269: private: should be indented +1 space inside class OneofDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1269: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1274: private: should be indented +1 space inside class OneofDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1274: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1281: public: should be indented +1 space inside class OneofDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1281: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1282: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1310: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1319: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1361: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1363: private: should be indented +1 space inside class EnumDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1363: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1368: private: should be indented +1 space inside class EnumDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1368: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1375: public: should be indented +1 space inside class EnumDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1375: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1376: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1402: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1404: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1427: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1429: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1438: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1445: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1480: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1482: private: should be indented +1 space inside class EnumValueDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1482: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1487: private: should be indented +1 space inside class EnumValueDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1487: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1494: public: should be indented +1 space inside class EnumValueDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1494: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1495: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1545: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1554: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1596: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1598: private: should be indented +1 space inside class ServiceDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1598: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1603: private: should be indented +1 space inside class ServiceDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1603: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1610: public: should be indented +1 space inside class ServiceDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1610: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1611: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1637: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1639: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1662: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1664: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1673: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1715: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1717: private: should be indented +1 space inside class MethodDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1717: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1722: private: should be indented +1 space inside class MethodDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1722: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1729: public: should be indented +1 space inside class MethodDescriptorProto [whitespace/indent] [3] +src/descriptor.pb.h:1729: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1730: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1820: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1871: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:1873: private: should be indented +1 space inside class FileOptions [whitespace/indent] [3] +src/descriptor.pb.h:1873: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1878: private: should be indented +1 space inside class FileOptions [whitespace/indent] [3] +src/descriptor.pb.h:1878: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1885: public: should be indented +1 space inside class FileOptions [whitespace/indent] [3] +src/descriptor.pb.h:1885: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:1886: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:1966: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2048: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2049: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2051: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2053: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2103: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2108: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2159: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2161: private: should be indented +1 space inside class MessageOptions [whitespace/indent] [3] +src/descriptor.pb.h:2161: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2166: private: should be indented +1 space inside class MessageOptions [whitespace/indent] [3] +src/descriptor.pb.h:2166: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2173: public: should be indented +1 space inside class MessageOptions [whitespace/indent] [3] +src/descriptor.pb.h:2173: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2174: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2213: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2214: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2216: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2218: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2238: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2243: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2294: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2296: private: should be indented +1 space inside class FieldOptions [whitespace/indent] [3] +src/descriptor.pb.h:2296: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2301: private: should be indented +1 space inside class FieldOptions [whitespace/indent] [3] +src/descriptor.pb.h:2301: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2308: public: should be indented +1 space inside class FieldOptions [whitespace/indent] [3] +src/descriptor.pb.h:2308: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2309: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2386: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2418: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2419: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2421: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2423: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2449: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2454: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2505: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2507: private: should be indented +1 space inside class EnumOptions [whitespace/indent] [3] +src/descriptor.pb.h:2507: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2512: private: should be indented +1 space inside class EnumOptions [whitespace/indent] [3] +src/descriptor.pb.h:2512: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2519: public: should be indented +1 space inside class EnumOptions [whitespace/indent] [3] +src/descriptor.pb.h:2519: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2520: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2545: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2546: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2548: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2550: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2566: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2569: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2620: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2622: private: should be indented +1 space inside class EnumValueOptions [whitespace/indent] [3] +src/descriptor.pb.h:2622: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2627: private: should be indented +1 space inside class EnumValueOptions [whitespace/indent] [3] +src/descriptor.pb.h:2627: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2634: public: should be indented +1 space inside class EnumValueOptions [whitespace/indent] [3] +src/descriptor.pb.h:2634: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2635: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2653: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2654: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2656: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2658: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2672: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2674: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2725: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2727: private: should be indented +1 space inside class ServiceOptions [whitespace/indent] [3] +src/descriptor.pb.h:2727: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2732: private: should be indented +1 space inside class ServiceOptions [whitespace/indent] [3] +src/descriptor.pb.h:2732: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2739: public: should be indented +1 space inside class ServiceOptions [whitespace/indent] [3] +src/descriptor.pb.h:2739: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2740: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2758: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2759: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2761: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2763: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2777: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2779: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2830: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2832: private: should be indented +1 space inside class MethodOptions [whitespace/indent] [3] +src/descriptor.pb.h:2832: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2837: private: should be indented +1 space inside class MethodOptions [whitespace/indent] [3] +src/descriptor.pb.h:2837: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2844: public: should be indented +1 space inside class MethodOptions [whitespace/indent] [3] +src/descriptor.pb.h:2844: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2845: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2863: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2864: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2866: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2868: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2882: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2884: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2893: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2900: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2935: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:2937: private: should be indented +1 space inside class UninterpretedOption_NamePart [whitespace/indent] [3] +src/descriptor.pb.h:2937: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2942: private: should be indented +1 space inside class UninterpretedOption_NamePart [whitespace/indent] [3] +src/descriptor.pb.h:2942: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2949: public: should be indented +1 space inside class UninterpretedOption_NamePart [whitespace/indent] [3] +src/descriptor.pb.h:2949: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:2950: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:2991: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3000: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3042: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3044: private: should be indented +1 space inside class UninterpretedOption [whitespace/indent] [3] +src/descriptor.pb.h:3044: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3049: private: should be indented +1 space inside class UninterpretedOption [whitespace/indent] [3] +src/descriptor.pb.h:3049: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3056: public: should be indented +1 space inside class UninterpretedOption [whitespace/indent] [3] +src/descriptor.pb.h:3056: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3057: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3073: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3075: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3153: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3160: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3169: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3176: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3211: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3213: private: should be indented +1 space inside class SourceCodeInfo_Location [whitespace/indent] [3] +src/descriptor.pb.h:3213: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3218: private: should be indented +1 space inside class SourceCodeInfo_Location [whitespace/indent] [3] +src/descriptor.pb.h:3218: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3225: public: should be indented +1 space inside class SourceCodeInfo_Location [whitespace/indent] [3] +src/descriptor.pb.h:3225: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3226: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3294: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3295: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3313: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3314: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3365: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3367: private: should be indented +1 space inside class SourceCodeInfo [whitespace/indent] [3] +src/descriptor.pb.h:3367: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3372: private: should be indented +1 space inside class SourceCodeInfo [whitespace/indent] [3] +src/descriptor.pb.h:3372: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3379: public: should be indented +1 space inside class SourceCodeInfo [whitespace/indent] [3] +src/descriptor.pb.h:3379: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3380: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3396: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3398: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3403: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3407: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3408: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3417: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3424: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3459: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3461: private: should be indented +1 space inside class GeneratedCodeInfo_Annotation [whitespace/indent] [3] +src/descriptor.pb.h:3461: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3466: private: should be indented +1 space inside class GeneratedCodeInfo_Annotation [whitespace/indent] [3] +src/descriptor.pb.h:3466: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3473: public: should be indented +1 space inside class GeneratedCodeInfo_Annotation [whitespace/indent] [3] +src/descriptor.pb.h:3473: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3474: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3536: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3545: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3587: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3589: private: should be indented +1 space inside class GeneratedCodeInfo [whitespace/indent] [3] +src/descriptor.pb.h:3589: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3594: private: should be indented +1 space inside class GeneratedCodeInfo [whitespace/indent] [3] +src/descriptor.pb.h:3594: "private:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3601: public: should be indented +1 space inside class GeneratedCodeInfo [whitespace/indent] [3] +src/descriptor.pb.h:3601: "public:" should be preceded by a blank line [whitespace/blank_line] [3] +src/descriptor.pb.h:3602: Do not leave a blank line after "public:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3615: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3616: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3618: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3620: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3625: Do not leave a blank line after "private:" [whitespace/blank_line] [3] +src/descriptor.pb.h:3629: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3630: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3652: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3656: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3664: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3669: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3690: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3695: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3699: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3704: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3716: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3721: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3729: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3744: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3749: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3753: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3758: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3763: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3770: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3775: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3783: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3802: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3810: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3827: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3849: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3853: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3857: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3879: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3883: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3887: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3909: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3913: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3917: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3921: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3926: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3939: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3943: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3947: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3951: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3956: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3969: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3973: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3977: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3981: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3986: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:3999: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4003: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4007: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4011: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4016: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4036: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4055: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4077: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4080: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4082: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4084: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4092: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4099: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4121: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4126: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4130: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4135: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4140: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4147: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4152: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4160: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4186: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4210: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4238: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4262: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4283: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4288: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4292: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4297: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4309: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4314: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4322: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4333: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4337: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4345: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4350: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4363: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4367: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4371: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4375: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4380: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4393: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4397: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4405: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4410: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4423: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4427: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4431: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4435: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4440: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4453: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4457: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4461: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4465: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4470: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4483: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4487: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4491: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4495: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4500: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4520: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4539: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4557: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4561: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4565: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4569: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4574: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4595: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4603: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4650: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4655: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4659: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4664: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4676: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4681: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4689: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4731: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4735: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4756: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4760: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4778: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4783: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4787: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4792: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4795: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4797: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4804: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4809: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4811: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4817: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4832: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4837: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4841: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4846: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4851: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4858: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4863: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4865: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4871: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4886: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4891: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4893: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4895: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4900: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4903: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4905: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4912: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4917: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4919: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4925: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4947: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4964: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4969: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4973: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4978: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4981: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4983: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4990: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4995: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:4997: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5003: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5021: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5025: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5033: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5040: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5066: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5071: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5075: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5080: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5092: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5097: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5105: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5124: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5129: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5133: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5138: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5150: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5155: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5163: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5174: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5178: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5182: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5186: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5191: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5211: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5230: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5256: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5261: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5265: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5270: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5282: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5287: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5295: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5317: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5337: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5341: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5349: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5356: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5382: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5387: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5391: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5396: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5408: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5413: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5421: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5432: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5436: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5440: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5444: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5449: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5469: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5473: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5481: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5488: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5514: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5519: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5523: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5528: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5540: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5545: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5553: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5568: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5573: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5577: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5582: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5585: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5587: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5594: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5599: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5601: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5607: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5622: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5627: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5631: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5636: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5639: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5641: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5648: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5653: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5655: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5661: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5679: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5683: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5691: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5698: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5772: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5777: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5781: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5786: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5791: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5798: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5803: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5805: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5811: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5826: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5831: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5835: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5840: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5843: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5845: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5852: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5857: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5859: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5865: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5941: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5955: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5957: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5959: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5977: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5982: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5986: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5991: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:5996: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6003: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6008: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6016: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6151: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6156: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6160: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6165: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6170: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6177: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6182: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6184: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6190: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6205: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6210: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6214: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6219: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6224: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6231: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6236: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6238: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6244: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6255: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6259: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6263: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6267: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6272: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6385: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6389: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6393: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6397: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6402: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6430: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6461: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6479: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6565: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6569: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6573: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6577: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6582: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6647: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6651: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6655: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6659: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6664: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6705: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6709: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6713: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6717: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6722: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6763: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6767: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6771: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6775: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6780: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6821: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6825: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6829: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6833: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6838: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6859: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6864: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6866: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6868: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6873: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6876: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6878: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6885: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6890: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6892: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6898: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6937: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6941: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6945: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6949: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6954: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6971: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6976: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6978: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6980: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6985: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6988: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6990: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:6997: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7002: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7004: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7010: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7028: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7032: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7052: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7056: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7097: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7102: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7106: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7111: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7114: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7116: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7123: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7128: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7130: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7136: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7151: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7156: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7158: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7160: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7165: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7168: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7170: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7177: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7182: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7184: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7190: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7205: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7209: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7235: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7239: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7269: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7274: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7276: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7278: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7283: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7286: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7288: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7295: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7300: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7302: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7308: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7323: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7328: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7330: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7332: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7337: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7340: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7342: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7349: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7354: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7356: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7362: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7373: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7377: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7381: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7385: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7389: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7398: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7402: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7406: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7407: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7432: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7436: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7440: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7444: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7449: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7466: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7470: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7474: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7500: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7505: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7507: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7509: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7514: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7517: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7519: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7526: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7531: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7533: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7539: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7561: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7585: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7602: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7606: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7610: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7614: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7619: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7682: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7684: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7687: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7689: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7692: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7694: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7697: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7699: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7702: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor.pb.h:7704: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor_unittest.cc:43: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:44: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:45: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:46: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:47: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:48: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:49: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:50: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:51: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:52: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:53: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:55: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:56: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:57: "google/protobuf/stubs/logging.h" already included at src/descriptor_unittest.cc:56 [build/include] [4] +src/descriptor_unittest.cc:58: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:59: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:60: Found C system header after C++ system header. Should be: descriptor_unittest.h, c system, c++ system, other. [build/include_order] [4] +src/descriptor_unittest.cc:734: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:735: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:822: Extra space after ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:823: Extra space after ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:825: Extra space after ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:841: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:846: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:851: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1281: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1282: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1450: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1451: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1643: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1644: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1675: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1676: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1677: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1681: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1682: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1694: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1695: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1783: You don't need a ; after a } [readability/braces] [4] +src/descriptor_unittest.cc:1828: You don't need a ; after a } [readability/braces] [4] +src/descriptor_unittest.cc:1831: Extra space after ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1832: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1833: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1836: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1837: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1847: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:1946: You don't need a ; after a } [readability/braces] [4] +src/descriptor_unittest.cc:1961: You don't need a ; after a } [readability/braces] [4] +src/descriptor_unittest.cc:1950: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1953: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1954: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1955: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1959: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1968: You don't need a ; after a } [readability/braces] [4] +src/descriptor_unittest.cc:1974: You don't need a ; after a } [readability/braces] [4] +src/descriptor_unittest.cc:1971: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:1972: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2047: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2048: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2049: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2050: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2051: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2052: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2053: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2054: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2055: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2056: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2057: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2058: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2059: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2060: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2063: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2064: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2072: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2073: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2074: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2075: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2076: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2077: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2078: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2079: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2080: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2081: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2082: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2083: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2084: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2085: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2088: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2089: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2097: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2098: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2099: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2100: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2101: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2102: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2103: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2104: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2105: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2106: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2107: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2108: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2109: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2110: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2113: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2114: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2122: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2123: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2124: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2125: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2126: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2127: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2128: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2129: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2130: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2131: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2132: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2133: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2134: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2135: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2138: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2139: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2147: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2148: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2149: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2150: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2151: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2152: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2153: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2154: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2155: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2164: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2165: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2166: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2167: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2168: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2169: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2170: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2171: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2172: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2173: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2174: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2175: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2176: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2177: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2180: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2181: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2189: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2190: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2191: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2192: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2193: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2194: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2195: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2196: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2197: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2198: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2199: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2200: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2201: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2202: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2205: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2206: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2255: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2256: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2259: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2261: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2263: Extra space before ) [whitespace/parens] [2] +src/descriptor_unittest.cc:2296: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2298: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2302: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2304: Extra space after ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2304: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2307: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2321: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2322: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2325: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2327: Extra space after ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2327: Extra space before ( in function call [whitespace/parens] [4] +src/descriptor_unittest.cc:2383: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/descriptor_unittest.cc:2781: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor_unittest.cc:3038: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor_unittest.cc:3120: Missing space after , [whitespace/comma] [3] +src/descriptor_unittest.cc:4475: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/descriptor_unittest.cc:4489: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/descriptor_unittest.cc:4502: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/descriptor_unittest.cc:4516: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/descriptor_unittest.cc:4548: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/descriptor_unittest.cc:4984: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor_unittest.cc:4990: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/descriptor_unittest.cc:5125: Closing ) should be moved to the previous line [whitespace/parens] [2] +src/descriptor_unittest.cc:5929: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] +src/descriptor_unittest.cc:5968: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] +src/descriptor_unittest.cc:6486: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3] + diff --git a/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor.pb.cc b/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor.pb.cc new file mode 100644 index 00000000000..4d5c4d99d40 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor.pb.cc @@ -0,0 +1,15168 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/descriptor.proto + +#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace google { +namespace protobuf { + +namespace { + +const ::google::protobuf::Descriptor* FileDescriptorSet_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FileDescriptorSet_reflection_ = NULL; +const ::google::protobuf::Descriptor* FileDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FileDescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* DescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DescriptorProto_ExtensionRange_reflection_ = NULL; +const ::google::protobuf::Descriptor* DescriptorProto_ReservedRange_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + DescriptorProto_ReservedRange_reflection_ = NULL; +const ::google::protobuf::Descriptor* FieldDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FieldDescriptorProto_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor_ = NULL; +const ::google::protobuf::Descriptor* OneofDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + OneofDescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* EnumDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EnumDescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* EnumValueDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EnumValueDescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* ServiceDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ServiceDescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* MethodDescriptorProto_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MethodDescriptorProto_reflection_ = NULL; +const ::google::protobuf::Descriptor* FileOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FileOptions_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor_ = NULL; +const ::google::protobuf::Descriptor* MessageOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MessageOptions_reflection_ = NULL; +const ::google::protobuf::Descriptor* FieldOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + FieldOptions_reflection_ = NULL; +const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor_ = NULL; +const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor_ = NULL; +const ::google::protobuf::Descriptor* EnumOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EnumOptions_reflection_ = NULL; +const ::google::protobuf::Descriptor* EnumValueOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + EnumValueOptions_reflection_ = NULL; +const ::google::protobuf::Descriptor* ServiceOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + ServiceOptions_reflection_ = NULL; +const ::google::protobuf::Descriptor* MethodOptions_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + MethodOptions_reflection_ = NULL; +const ::google::protobuf::Descriptor* UninterpretedOption_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + UninterpretedOption_reflection_ = NULL; +const ::google::protobuf::Descriptor* UninterpretedOption_NamePart_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + UninterpretedOption_NamePart_reflection_ = NULL; +const ::google::protobuf::Descriptor* SourceCodeInfo_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SourceCodeInfo_reflection_ = NULL; +const ::google::protobuf::Descriptor* SourceCodeInfo_Location_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + SourceCodeInfo_Location_reflection_ = NULL; +const ::google::protobuf::Descriptor* GeneratedCodeInfo_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + GeneratedCodeInfo_reflection_ = NULL; +const ::google::protobuf::Descriptor* GeneratedCodeInfo_Annotation_descriptor_ = NULL; +const ::google::protobuf::internal::GeneratedMessageReflection* + GeneratedCodeInfo_Annotation_reflection_ = NULL; + +} // namespace + + +void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto() { + protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + const ::google::protobuf::FileDescriptor* file = + ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName( + "google/protobuf/descriptor.proto"); + GOOGLE_CHECK(file != NULL); + FileDescriptorSet_descriptor_ = file->message_type(0); + static const int FileDescriptorSet_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, file_), + }; + FileDescriptorSet_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FileDescriptorSet_descriptor_, + FileDescriptorSet::default_instance_, + FileDescriptorSet_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _has_bits_[0]), + -1, + -1, + sizeof(FileDescriptorSet), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorSet, _internal_metadata_), + -1); + FileDescriptorProto_descriptor_ = file->message_type(1); + static const int FileDescriptorProto_offsets_[12] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, public_dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, weak_dependency_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, message_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, enum_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, service_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, source_code_info_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, syntax_), + }; + FileDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FileDescriptorProto_descriptor_, + FileDescriptorProto::default_instance_, + FileDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(FileDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileDescriptorProto, _internal_metadata_), + -1); + DescriptorProto_descriptor_ = file->message_type(2); + static const int DescriptorProto_offsets_[10] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, field_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, nested_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, enum_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, extension_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, oneof_decl_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_range_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, reserved_name_), + }; + DescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DescriptorProto_descriptor_, + DescriptorProto::default_instance_, + DescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(DescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto, _internal_metadata_), + -1); + DescriptorProto_ExtensionRange_descriptor_ = DescriptorProto_descriptor_->nested_type(0); + static const int DescriptorProto_ExtensionRange_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, end_), + }; + DescriptorProto_ExtensionRange_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DescriptorProto_ExtensionRange_descriptor_, + DescriptorProto_ExtensionRange::default_instance_, + DescriptorProto_ExtensionRange_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _has_bits_[0]), + -1, + -1, + sizeof(DescriptorProto_ExtensionRange), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ExtensionRange, _internal_metadata_), + -1); + DescriptorProto_ReservedRange_descriptor_ = DescriptorProto_descriptor_->nested_type(1); + static const int DescriptorProto_ReservedRange_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, start_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, end_), + }; + DescriptorProto_ReservedRange_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + DescriptorProto_ReservedRange_descriptor_, + DescriptorProto_ReservedRange::default_instance_, + DescriptorProto_ReservedRange_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _has_bits_[0]), + -1, + -1, + sizeof(DescriptorProto_ReservedRange), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DescriptorProto_ReservedRange, _internal_metadata_), + -1); + FieldDescriptorProto_descriptor_ = file->message_type(3); + static const int FieldDescriptorProto_offsets_[10] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, label_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, type_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, extendee_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, default_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, oneof_index_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, json_name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, options_), + }; + FieldDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FieldDescriptorProto_descriptor_, + FieldDescriptorProto::default_instance_, + FieldDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(FieldDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldDescriptorProto, _internal_metadata_), + -1); + FieldDescriptorProto_Type_descriptor_ = FieldDescriptorProto_descriptor_->enum_type(0); + FieldDescriptorProto_Label_descriptor_ = FieldDescriptorProto_descriptor_->enum_type(1); + OneofDescriptorProto_descriptor_ = file->message_type(4); + static const int OneofDescriptorProto_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, name_), + }; + OneofDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + OneofDescriptorProto_descriptor_, + OneofDescriptorProto::default_instance_, + OneofDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(OneofDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(OneofDescriptorProto, _internal_metadata_), + -1); + EnumDescriptorProto_descriptor_ = file->message_type(5); + static const int EnumDescriptorProto_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, options_), + }; + EnumDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + EnumDescriptorProto_descriptor_, + EnumDescriptorProto::default_instance_, + EnumDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(EnumDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumDescriptorProto, _internal_metadata_), + -1); + EnumValueDescriptorProto_descriptor_ = file->message_type(6); + static const int EnumValueDescriptorProto_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, number_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, options_), + }; + EnumValueDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + EnumValueDescriptorProto_descriptor_, + EnumValueDescriptorProto::default_instance_, + EnumValueDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(EnumValueDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueDescriptorProto, _internal_metadata_), + -1); + ServiceDescriptorProto_descriptor_ = file->message_type(7); + static const int ServiceDescriptorProto_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, method_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, options_), + }; + ServiceDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ServiceDescriptorProto_descriptor_, + ServiceDescriptorProto::default_instance_, + ServiceDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(ServiceDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceDescriptorProto, _internal_metadata_), + -1); + MethodDescriptorProto_descriptor_ = file->message_type(8); + static const int MethodDescriptorProto_offsets_[6] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, input_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, output_type_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, options_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, client_streaming_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, server_streaming_), + }; + MethodDescriptorProto_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + MethodDescriptorProto_descriptor_, + MethodDescriptorProto::default_instance_, + MethodDescriptorProto_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _has_bits_[0]), + -1, + -1, + sizeof(MethodDescriptorProto), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodDescriptorProto, _internal_metadata_), + -1); + FileOptions_descriptor_ = file->message_type(9); + static const int FileOptions_offsets_[15] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_outer_classname_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_multiple_files_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generate_equals_and_hash_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_string_check_utf8_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, optimize_for_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, go_package_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, java_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, py_generic_services_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, cc_enable_arenas_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, objc_class_prefix_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, csharp_namespace_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, uninterpreted_option_), + }; + FileOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FileOptions_descriptor_, + FileOptions::default_instance_, + FileOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _extensions_), + sizeof(FileOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FileOptions, _internal_metadata_), + -1); + FileOptions_OptimizeMode_descriptor_ = FileOptions_descriptor_->enum_type(0); + MessageOptions_descriptor_ = file->message_type(10); + static const int MessageOptions_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, message_set_wire_format_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, no_standard_descriptor_accessor_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, map_entry_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, uninterpreted_option_), + }; + MessageOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + MessageOptions_descriptor_, + MessageOptions::default_instance_, + MessageOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _extensions_), + sizeof(MessageOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MessageOptions, _internal_metadata_), + -1); + FieldOptions_descriptor_ = file->message_type(11); + static const int FieldOptions_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, ctype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, packed_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, jstype_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, lazy_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, weak_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, uninterpreted_option_), + }; + FieldOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + FieldOptions_descriptor_, + FieldOptions::default_instance_, + FieldOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _extensions_), + sizeof(FieldOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FieldOptions, _internal_metadata_), + -1); + FieldOptions_CType_descriptor_ = FieldOptions_descriptor_->enum_type(0); + FieldOptions_JSType_descriptor_ = FieldOptions_descriptor_->enum_type(1); + EnumOptions_descriptor_ = file->message_type(12); + static const int EnumOptions_offsets_[3] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, allow_alias_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, uninterpreted_option_), + }; + EnumOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + EnumOptions_descriptor_, + EnumOptions::default_instance_, + EnumOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _extensions_), + sizeof(EnumOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumOptions, _internal_metadata_), + -1); + EnumValueOptions_descriptor_ = file->message_type(13); + static const int EnumValueOptions_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, uninterpreted_option_), + }; + EnumValueOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + EnumValueOptions_descriptor_, + EnumValueOptions::default_instance_, + EnumValueOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _extensions_), + sizeof(EnumValueOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(EnumValueOptions, _internal_metadata_), + -1); + ServiceOptions_descriptor_ = file->message_type(14); + static const int ServiceOptions_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, uninterpreted_option_), + }; + ServiceOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + ServiceOptions_descriptor_, + ServiceOptions::default_instance_, + ServiceOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _extensions_), + sizeof(ServiceOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServiceOptions, _internal_metadata_), + -1); + MethodOptions_descriptor_ = file->message_type(15); + static const int MethodOptions_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, deprecated_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, uninterpreted_option_), + }; + MethodOptions_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + MethodOptions_descriptor_, + MethodOptions::default_instance_, + MethodOptions_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _has_bits_[0]), + -1, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _extensions_), + sizeof(MethodOptions), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(MethodOptions, _internal_metadata_), + -1); + UninterpretedOption_descriptor_ = file->message_type(16); + static const int UninterpretedOption_offsets_[7] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, name_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, identifier_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, positive_int_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, negative_int_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, double_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, string_value_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, aggregate_value_), + }; + UninterpretedOption_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + UninterpretedOption_descriptor_, + UninterpretedOption::default_instance_, + UninterpretedOption_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _has_bits_[0]), + -1, + -1, + sizeof(UninterpretedOption), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption, _internal_metadata_), + -1); + UninterpretedOption_NamePart_descriptor_ = UninterpretedOption_descriptor_->nested_type(0); + static const int UninterpretedOption_NamePart_offsets_[2] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, name_part_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, is_extension_), + }; + UninterpretedOption_NamePart_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + UninterpretedOption_NamePart_descriptor_, + UninterpretedOption_NamePart::default_instance_, + UninterpretedOption_NamePart_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _has_bits_[0]), + -1, + -1, + sizeof(UninterpretedOption_NamePart), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(UninterpretedOption_NamePart, _internal_metadata_), + -1); + SourceCodeInfo_descriptor_ = file->message_type(17); + static const int SourceCodeInfo_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, location_), + }; + SourceCodeInfo_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SourceCodeInfo_descriptor_, + SourceCodeInfo::default_instance_, + SourceCodeInfo_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _has_bits_[0]), + -1, + -1, + sizeof(SourceCodeInfo), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo, _internal_metadata_), + -1); + SourceCodeInfo_Location_descriptor_ = SourceCodeInfo_descriptor_->nested_type(0); + static const int SourceCodeInfo_Location_offsets_[5] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, span_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_comments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, trailing_comments_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, leading_detached_comments_), + }; + SourceCodeInfo_Location_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + SourceCodeInfo_Location_descriptor_, + SourceCodeInfo_Location::default_instance_, + SourceCodeInfo_Location_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _has_bits_[0]), + -1, + -1, + sizeof(SourceCodeInfo_Location), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SourceCodeInfo_Location, _internal_metadata_), + -1); + GeneratedCodeInfo_descriptor_ = file->message_type(18); + static const int GeneratedCodeInfo_offsets_[1] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, annotation_), + }; + GeneratedCodeInfo_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + GeneratedCodeInfo_descriptor_, + GeneratedCodeInfo::default_instance_, + GeneratedCodeInfo_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _has_bits_[0]), + -1, + -1, + sizeof(GeneratedCodeInfo), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo, _internal_metadata_), + -1); + GeneratedCodeInfo_Annotation_descriptor_ = GeneratedCodeInfo_descriptor_->nested_type(0); + static const int GeneratedCodeInfo_Annotation_offsets_[4] = { + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, path_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, source_file_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, begin_), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, end_), + }; + GeneratedCodeInfo_Annotation_reflection_ = + ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection( + GeneratedCodeInfo_Annotation_descriptor_, + GeneratedCodeInfo_Annotation::default_instance_, + GeneratedCodeInfo_Annotation_offsets_, + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _has_bits_[0]), + -1, + -1, + sizeof(GeneratedCodeInfo_Annotation), + GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(GeneratedCodeInfo_Annotation, _internal_metadata_), + -1); +} + +namespace { + +GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_); +inline void protobuf_AssignDescriptorsOnce() { + ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_, + &protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto); +} + +void protobuf_RegisterTypes(const ::std::string&) { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FileDescriptorSet_descriptor_, &FileDescriptorSet::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FileDescriptorProto_descriptor_, &FileDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DescriptorProto_descriptor_, &DescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DescriptorProto_ExtensionRange_descriptor_, &DescriptorProto_ExtensionRange::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + DescriptorProto_ReservedRange_descriptor_, &DescriptorProto_ReservedRange::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FieldDescriptorProto_descriptor_, &FieldDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + OneofDescriptorProto_descriptor_, &OneofDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EnumDescriptorProto_descriptor_, &EnumDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EnumValueDescriptorProto_descriptor_, &EnumValueDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ServiceDescriptorProto_descriptor_, &ServiceDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MethodDescriptorProto_descriptor_, &MethodDescriptorProto::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FileOptions_descriptor_, &FileOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MessageOptions_descriptor_, &MessageOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + FieldOptions_descriptor_, &FieldOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EnumOptions_descriptor_, &EnumOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + EnumValueOptions_descriptor_, &EnumValueOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + ServiceOptions_descriptor_, &ServiceOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + MethodOptions_descriptor_, &MethodOptions::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + UninterpretedOption_descriptor_, &UninterpretedOption::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + UninterpretedOption_NamePart_descriptor_, &UninterpretedOption_NamePart::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SourceCodeInfo_descriptor_, &SourceCodeInfo::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + SourceCodeInfo_Location_descriptor_, &SourceCodeInfo_Location::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + GeneratedCodeInfo_descriptor_, &GeneratedCodeInfo::default_instance()); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage( + GeneratedCodeInfo_Annotation_descriptor_, &GeneratedCodeInfo_Annotation::default_instance()); +} + +} // namespace + +void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto() { + delete FileDescriptorSet::default_instance_; + delete FileDescriptorSet_reflection_; + delete FileDescriptorProto::default_instance_; + delete FileDescriptorProto_reflection_; + delete DescriptorProto::default_instance_; + delete DescriptorProto_reflection_; + delete DescriptorProto_ExtensionRange::default_instance_; + delete DescriptorProto_ExtensionRange_reflection_; + delete DescriptorProto_ReservedRange::default_instance_; + delete DescriptorProto_ReservedRange_reflection_; + delete FieldDescriptorProto::default_instance_; + delete FieldDescriptorProto_reflection_; + delete OneofDescriptorProto::default_instance_; + delete OneofDescriptorProto_reflection_; + delete EnumDescriptorProto::default_instance_; + delete EnumDescriptorProto_reflection_; + delete EnumValueDescriptorProto::default_instance_; + delete EnumValueDescriptorProto_reflection_; + delete ServiceDescriptorProto::default_instance_; + delete ServiceDescriptorProto_reflection_; + delete MethodDescriptorProto::default_instance_; + delete MethodDescriptorProto_reflection_; + delete FileOptions::default_instance_; + delete FileOptions_reflection_; + delete MessageOptions::default_instance_; + delete MessageOptions_reflection_; + delete FieldOptions::default_instance_; + delete FieldOptions_reflection_; + delete EnumOptions::default_instance_; + delete EnumOptions_reflection_; + delete EnumValueOptions::default_instance_; + delete EnumValueOptions_reflection_; + delete ServiceOptions::default_instance_; + delete ServiceOptions_reflection_; + delete MethodOptions::default_instance_; + delete MethodOptions_reflection_; + delete UninterpretedOption::default_instance_; + delete UninterpretedOption_reflection_; + delete UninterpretedOption_NamePart::default_instance_; + delete UninterpretedOption_NamePart_reflection_; + delete SourceCodeInfo::default_instance_; + delete SourceCodeInfo_reflection_; + delete SourceCodeInfo_Location::default_instance_; + delete SourceCodeInfo_Location_reflection_; + delete GeneratedCodeInfo::default_instance_; + delete GeneratedCodeInfo_reflection_; + delete GeneratedCodeInfo_Annotation::default_instance_; + delete GeneratedCodeInfo_Annotation_reflection_; +} + +void protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto() { + static bool already_here = false; + if (already_here) return; + already_here = true; + GOOGLE_PROTOBUF_VERIFY_VERSION; + + ::google::protobuf::DescriptorPool::InternalAddGeneratedFile( + "\n google/protobuf/descriptor.proto\022\017goog" + "le.protobuf\"G\n\021FileDescriptorSet\0222\n\004file" + "\030\001 \003(\0132$.google.protobuf.FileDescriptorP" + "roto\"\333\003\n\023FileDescriptorProto\022\014\n\004name\030\001 \001" + "(\t\022\017\n\007package\030\002 \001(\t\022\022\n\ndependency\030\003 \003(\t\022" + "\031\n\021public_dependency\030\n \003(\005\022\027\n\017weak_depen" + "dency\030\013 \003(\005\0226\n\014message_type\030\004 \003(\0132 .goog" + "le.protobuf.DescriptorProto\0227\n\tenum_type" + "\030\005 \003(\0132$.google.protobuf.EnumDescriptorP" + "roto\0228\n\007service\030\006 \003(\0132\'.google.protobuf." + "ServiceDescriptorProto\0228\n\textension\030\007 \003(" + "\0132%.google.protobuf.FieldDescriptorProto" + "\022-\n\007options\030\010 \001(\0132\034.google.protobuf.File" + "Options\0229\n\020source_code_info\030\t \001(\0132\037.goog" + "le.protobuf.SourceCodeInfo\022\016\n\006syntax\030\014 \001" + "(\t\"\360\004\n\017DescriptorProto\022\014\n\004name\030\001 \001(\t\0224\n\005" + "field\030\002 \003(\0132%.google.protobuf.FieldDescr" + "iptorProto\0228\n\textension\030\006 \003(\0132%.google.p" + "rotobuf.FieldDescriptorProto\0225\n\013nested_t" + "ype\030\003 \003(\0132 .google.protobuf.DescriptorPr" + "oto\0227\n\tenum_type\030\004 \003(\0132$.google.protobuf" + ".EnumDescriptorProto\022H\n\017extension_range\030" + "\005 \003(\0132/.google.protobuf.DescriptorProto." + "ExtensionRange\0229\n\noneof_decl\030\010 \003(\0132%.goo" + "gle.protobuf.OneofDescriptorProto\0220\n\007opt" + "ions\030\007 \001(\0132\037.google.protobuf.MessageOpti" + "ons\022F\n\016reserved_range\030\t \003(\0132..google.pro" + "tobuf.DescriptorProto.ReservedRange\022\025\n\rr" + "eserved_name\030\n \003(\t\032,\n\016ExtensionRange\022\r\n\005" + "start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\032+\n\rReservedRang" + "e\022\r\n\005start\030\001 \001(\005\022\013\n\003end\030\002 \001(\005\"\274\005\n\024FieldD" + "escriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006number\030\003" + " \001(\005\022:\n\005label\030\004 \001(\0162+.google.protobuf.Fi" + "eldDescriptorProto.Label\0228\n\004type\030\005 \001(\0162*" + ".google.protobuf.FieldDescriptorProto.Ty" + "pe\022\021\n\ttype_name\030\006 \001(\t\022\020\n\010extendee\030\002 \001(\t\022" + "\025\n\rdefault_value\030\007 \001(\t\022\023\n\013oneof_index\030\t " + "\001(\005\022\021\n\tjson_name\030\n \001(\t\022.\n\007options\030\010 \001(\0132" + "\035.google.protobuf.FieldOptions\"\266\002\n\004Type\022" + "\017\n\013TYPE_DOUBLE\020\001\022\016\n\nTYPE_FLOAT\020\002\022\016\n\nTYPE" + "_INT64\020\003\022\017\n\013TYPE_UINT64\020\004\022\016\n\nTYPE_INT32\020" + "\005\022\020\n\014TYPE_FIXED64\020\006\022\020\n\014TYPE_FIXED32\020\007\022\r\n" + "\tTYPE_BOOL\020\010\022\017\n\013TYPE_STRING\020\t\022\016\n\nTYPE_GR" + "OUP\020\n\022\020\n\014TYPE_MESSAGE\020\013\022\016\n\nTYPE_BYTES\020\014\022" + "\017\n\013TYPE_UINT32\020\r\022\r\n\tTYPE_ENUM\020\016\022\021\n\rTYPE_" + "SFIXED32\020\017\022\021\n\rTYPE_SFIXED64\020\020\022\017\n\013TYPE_SI" + "NT32\020\021\022\017\n\013TYPE_SINT64\020\022\"C\n\005Label\022\022\n\016LABE" + "L_OPTIONAL\020\001\022\022\n\016LABEL_REQUIRED\020\002\022\022\n\016LABE" + "L_REPEATED\020\003\"$\n\024OneofDescriptorProto\022\014\n\004" + "name\030\001 \001(\t\"\214\001\n\023EnumDescriptorProto\022\014\n\004na" + "me\030\001 \001(\t\0228\n\005value\030\002 \003(\0132).google.protobu" + "f.EnumValueDescriptorProto\022-\n\007options\030\003 " + "\001(\0132\034.google.protobuf.EnumOptions\"l\n\030Enu" + "mValueDescriptorProto\022\014\n\004name\030\001 \001(\t\022\016\n\006n" + "umber\030\002 \001(\005\0222\n\007options\030\003 \001(\0132!.google.pr" + "otobuf.EnumValueOptions\"\220\001\n\026ServiceDescr" + "iptorProto\022\014\n\004name\030\001 \001(\t\0226\n\006method\030\002 \003(\013" + "2&.google.protobuf.MethodDescriptorProto" + "\0220\n\007options\030\003 \001(\0132\037.google.protobuf.Serv" + "iceOptions\"\301\001\n\025MethodDescriptorProto\022\014\n\004" + "name\030\001 \001(\t\022\022\n\ninput_type\030\002 \001(\t\022\023\n\013output" + "_type\030\003 \001(\t\022/\n\007options\030\004 \001(\0132\036.google.pr" + "otobuf.MethodOptions\022\037\n\020client_streaming" + "\030\005 \001(\010:\005false\022\037\n\020server_streaming\030\006 \001(\010:" + "\005false\"\207\005\n\013FileOptions\022\024\n\014java_package\030\001" + " \001(\t\022\034\n\024java_outer_classname\030\010 \001(\t\022\"\n\023ja" + "va_multiple_files\030\n \001(\010:\005false\022,\n\035java_g" + "enerate_equals_and_hash\030\024 \001(\010:\005false\022%\n\026" + "java_string_check_utf8\030\033 \001(\010:\005false\022F\n\014o" + "ptimize_for\030\t \001(\0162).google.protobuf.File" + "Options.OptimizeMode:\005SPEED\022\022\n\ngo_packag" + "e\030\013 \001(\t\022\"\n\023cc_generic_services\030\020 \001(\010:\005fa" + "lse\022$\n\025java_generic_services\030\021 \001(\010:\005fals" + "e\022\"\n\023py_generic_services\030\022 \001(\010:\005false\022\031\n" + "\ndeprecated\030\027 \001(\010:\005false\022\037\n\020cc_enable_ar" + "enas\030\037 \001(\010:\005false\022\031\n\021objc_class_prefix\030$" + " \001(\t\022\030\n\020csharp_namespace\030% \001(\t\022C\n\024uninte" + "rpreted_option\030\347\007 \003(\0132$.google.protobuf." + "UninterpretedOption\":\n\014OptimizeMode\022\t\n\005S" + "PEED\020\001\022\r\n\tCODE_SIZE\020\002\022\020\n\014LITE_RUNTIME\020\003*" + "\t\010\350\007\020\200\200\200\200\002J\004\010&\020\'\"\346\001\n\016MessageOptions\022&\n\027m" + "essage_set_wire_format\030\001 \001(\010:\005false\022.\n\037n" + "o_standard_descriptor_accessor\030\002 \001(\010:\005fa" + "lse\022\031\n\ndeprecated\030\003 \001(\010:\005false\022\021\n\tmap_en" + "try\030\007 \001(\010\022C\n\024uninterpreted_option\030\347\007 \003(\013" + "2$.google.protobuf.UninterpretedOption*\t" + "\010\350\007\020\200\200\200\200\002\"\230\003\n\014FieldOptions\022:\n\005ctype\030\001 \001(" + "\0162#.google.protobuf.FieldOptions.CType:\006" + "STRING\022\016\n\006packed\030\002 \001(\010\022\?\n\006jstype\030\006 \001(\0162$" + ".google.protobuf.FieldOptions.JSType:\tJS" + "_NORMAL\022\023\n\004lazy\030\005 \001(\010:\005false\022\031\n\ndeprecat" + "ed\030\003 \001(\010:\005false\022\023\n\004weak\030\n \001(\010:\005false\022C\n\024" + "uninterpreted_option\030\347\007 \003(\0132$.google.pro" + "tobuf.UninterpretedOption\"/\n\005CType\022\n\n\006ST" + "RING\020\000\022\010\n\004CORD\020\001\022\020\n\014STRING_PIECE\020\002\"5\n\006JS" + "Type\022\r\n\tJS_NORMAL\020\000\022\r\n\tJS_STRING\020\001\022\r\n\tJS" + "_NUMBER\020\002*\t\010\350\007\020\200\200\200\200\002\"\215\001\n\013EnumOptions\022\023\n\013" + "allow_alias\030\002 \001(\010\022\031\n\ndeprecated\030\003 \001(\010:\005f" + "alse\022C\n\024uninterpreted_option\030\347\007 \003(\0132$.go" + "ogle.protobuf.UninterpretedOption*\t\010\350\007\020\200" + "\200\200\200\002\"}\n\020EnumValueOptions\022\031\n\ndeprecated\030\001" + " \001(\010:\005false\022C\n\024uninterpreted_option\030\347\007 \003" + "(\0132$.google.protobuf.UninterpretedOption" + "*\t\010\350\007\020\200\200\200\200\002\"{\n\016ServiceOptions\022\031\n\ndepreca" + "ted\030! \001(\010:\005false\022C\n\024uninterpreted_option" + "\030\347\007 \003(\0132$.google.protobuf.UninterpretedO" + "ption*\t\010\350\007\020\200\200\200\200\002\"z\n\rMethodOptions\022\031\n\ndep" + "recated\030! \001(\010:\005false\022C\n\024uninterpreted_op" + "tion\030\347\007 \003(\0132$.google.protobuf.Uninterpre" + "tedOption*\t\010\350\007\020\200\200\200\200\002\"\236\002\n\023UninterpretedOp" + "tion\022;\n\004name\030\002 \003(\0132-.google.protobuf.Uni" + "nterpretedOption.NamePart\022\030\n\020identifier_" + "value\030\003 \001(\t\022\032\n\022positive_int_value\030\004 \001(\004\022" + "\032\n\022negative_int_value\030\005 \001(\003\022\024\n\014double_va" + "lue\030\006 \001(\001\022\024\n\014string_value\030\007 \001(\014\022\027\n\017aggre" + "gate_value\030\010 \001(\t\0323\n\010NamePart\022\021\n\tname_par" + "t\030\001 \002(\t\022\024\n\014is_extension\030\002 \002(\010\"\325\001\n\016Source" + "CodeInfo\022:\n\010location\030\001 \003(\0132(.google.prot" + "obuf.SourceCodeInfo.Location\032\206\001\n\010Locatio" + "n\022\020\n\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n" + "\020leading_comments\030\003 \001(\t\022\031\n\021trailing_comm" + "ents\030\004 \001(\t\022!\n\031leading_detached_comments\030" + "\006 \003(\t\"\247\001\n\021GeneratedCodeInfo\022A\n\nannotatio" + "n\030\001 \003(\0132-.google.protobuf.GeneratedCodeI" + "nfo.Annotation\032O\n\nAnnotation\022\020\n\004path\030\001 \003" + "(\005B\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005begin\030\003 \001" + "(\005\022\013\n\003end\030\004 \001(\005BX\n\023com.google.protobufB\020" + "DescriptorProtosH\001Z\ndescriptor\242\002\003GPB\252\002\032G" + "oogle.Protobuf.Reflection", 5145); + ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( + "google/protobuf/descriptor.proto", &protobuf_RegisterTypes); + FileDescriptorSet::default_instance_ = new FileDescriptorSet(); + FileDescriptorProto::default_instance_ = new FileDescriptorProto(); + DescriptorProto::default_instance_ = new DescriptorProto(); + DescriptorProto_ExtensionRange::default_instance_ = new DescriptorProto_ExtensionRange(); + DescriptorProto_ReservedRange::default_instance_ = new DescriptorProto_ReservedRange(); + FieldDescriptorProto::default_instance_ = new FieldDescriptorProto(); + OneofDescriptorProto::default_instance_ = new OneofDescriptorProto(); + EnumDescriptorProto::default_instance_ = new EnumDescriptorProto(); + EnumValueDescriptorProto::default_instance_ = new EnumValueDescriptorProto(); + ServiceDescriptorProto::default_instance_ = new ServiceDescriptorProto(); + MethodDescriptorProto::default_instance_ = new MethodDescriptorProto(); + FileOptions::default_instance_ = new FileOptions(); + MessageOptions::default_instance_ = new MessageOptions(); + FieldOptions::default_instance_ = new FieldOptions(); + EnumOptions::default_instance_ = new EnumOptions(); + EnumValueOptions::default_instance_ = new EnumValueOptions(); + ServiceOptions::default_instance_ = new ServiceOptions(); + MethodOptions::default_instance_ = new MethodOptions(); + UninterpretedOption::default_instance_ = new UninterpretedOption(); + UninterpretedOption_NamePart::default_instance_ = new UninterpretedOption_NamePart(); + SourceCodeInfo::default_instance_ = new SourceCodeInfo(); + SourceCodeInfo_Location::default_instance_ = new SourceCodeInfo_Location(); + GeneratedCodeInfo::default_instance_ = new GeneratedCodeInfo(); + GeneratedCodeInfo_Annotation::default_instance_ = new GeneratedCodeInfo_Annotation(); + FileDescriptorSet::default_instance_->InitAsDefaultInstance(); + FileDescriptorProto::default_instance_->InitAsDefaultInstance(); + DescriptorProto::default_instance_->InitAsDefaultInstance(); + DescriptorProto_ExtensionRange::default_instance_->InitAsDefaultInstance(); + DescriptorProto_ReservedRange::default_instance_->InitAsDefaultInstance(); + FieldDescriptorProto::default_instance_->InitAsDefaultInstance(); + OneofDescriptorProto::default_instance_->InitAsDefaultInstance(); + EnumDescriptorProto::default_instance_->InitAsDefaultInstance(); + EnumValueDescriptorProto::default_instance_->InitAsDefaultInstance(); + ServiceDescriptorProto::default_instance_->InitAsDefaultInstance(); + MethodDescriptorProto::default_instance_->InitAsDefaultInstance(); + FileOptions::default_instance_->InitAsDefaultInstance(); + MessageOptions::default_instance_->InitAsDefaultInstance(); + FieldOptions::default_instance_->InitAsDefaultInstance(); + EnumOptions::default_instance_->InitAsDefaultInstance(); + EnumValueOptions::default_instance_->InitAsDefaultInstance(); + ServiceOptions::default_instance_->InitAsDefaultInstance(); + MethodOptions::default_instance_->InitAsDefaultInstance(); + UninterpretedOption::default_instance_->InitAsDefaultInstance(); + UninterpretedOption_NamePart::default_instance_->InitAsDefaultInstance(); + SourceCodeInfo::default_instance_->InitAsDefaultInstance(); + SourceCodeInfo_Location::default_instance_->InitAsDefaultInstance(); + GeneratedCodeInfo::default_instance_->InitAsDefaultInstance(); + GeneratedCodeInfo_Annotation::default_instance_->InitAsDefaultInstance(); + ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto); +} + +// Force AddDescriptors() to be called at static initialization time. +struct StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto { + StaticDescriptorInitializer_google_2fprotobuf_2fdescriptor_2eproto() { + protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + } +} static_descriptor_initializer_google_2fprotobuf_2fdescriptor_2eproto_; + +namespace { + +static void MergeFromFail(int line) GOOGLE_ATTRIBUTE_COLD; +static void MergeFromFail(int line) { + GOOGLE_CHECK(false) << __FILE__ << ":" << line; +} + +} // namespace + + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FileDescriptorSet::kFileFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FileDescriptorSet::FileDescriptorSet() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorSet) +} + +void FileDescriptorSet::InitAsDefaultInstance() { +} + +FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorSet) +} + +void FileDescriptorSet::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FileDescriptorSet::~FileDescriptorSet() { + // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorSet) + SharedDtor(); +} + +void FileDescriptorSet::SharedDtor() { + if (this != default_instance_) { + } +} + +void FileDescriptorSet::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FileDescriptorSet::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FileDescriptorSet_descriptor_; +} + +const FileDescriptorSet& FileDescriptorSet::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +FileDescriptorSet* FileDescriptorSet::default_instance_ = NULL; + +FileDescriptorSet* FileDescriptorSet::New(::google::protobuf::Arena* arena) const { + FileDescriptorSet* n = new FileDescriptorSet; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FileDescriptorSet::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorSet) + file_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FileDescriptorSet::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorSet) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.FileDescriptorProto file = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_file())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_file; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorSet) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorSet) + return false; +#undef DO_ +} + +void FileDescriptorSet::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorSet) + // repeated .google.protobuf.FileDescriptorProto file = 1; + for (unsigned int i = 0, n = this->file_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->file(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorSet) +} + +::google::protobuf::uint8* FileDescriptorSet::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorSet) + // repeated .google.protobuf.FileDescriptorProto file = 1; + for (unsigned int i = 0, n = this->file_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->file(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorSet) + return target; +} + +int FileDescriptorSet::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorSet) + int total_size = 0; + + // repeated .google.protobuf.FileDescriptorProto file = 1; + total_size += 1 * this->file_size(); + for (int i = 0; i < this->file_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->file(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FileDescriptorSet::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorSet) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FileDescriptorSet* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorSet) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorSet) + MergeFrom(*source); + } +} + +void FileDescriptorSet::MergeFrom(const FileDescriptorSet& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorSet) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + file_.MergeFrom(from.file_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FileDescriptorSet::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorSet) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FileDescriptorSet::CopyFrom(const FileDescriptorSet& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileDescriptorSet) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FileDescriptorSet::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->file())) return false; + return true; +} + +void FileDescriptorSet::Swap(FileDescriptorSet* other) { + if (other == this) return; + InternalSwap(other); +} +void FileDescriptorSet::InternalSwap(FileDescriptorSet* other) { + file_.UnsafeArenaSwap(&other->file_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FileDescriptorSet::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FileDescriptorSet_descriptor_; + metadata.reflection = FileDescriptorSet_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FileDescriptorSet + +// repeated .google.protobuf.FileDescriptorProto file = 1; +int FileDescriptorSet::file_size() const { + return file_.size(); +} +void FileDescriptorSet::clear_file() { + file_.Clear(); +} +const ::google::protobuf::FileDescriptorProto& FileDescriptorSet::file(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file) + return file_.Get(index); +} +::google::protobuf::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file) + return file_.Mutable(index); +} +::google::protobuf::FileDescriptorProto* FileDescriptorSet::add_file() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file) + return file_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* +FileDescriptorSet::mutable_file() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file) + return &file_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& +FileDescriptorSet::file() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file) + return file_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FileDescriptorProto::kNameFieldNumber; +const int FileDescriptorProto::kPackageFieldNumber; +const int FileDescriptorProto::kDependencyFieldNumber; +const int FileDescriptorProto::kPublicDependencyFieldNumber; +const int FileDescriptorProto::kWeakDependencyFieldNumber; +const int FileDescriptorProto::kMessageTypeFieldNumber; +const int FileDescriptorProto::kEnumTypeFieldNumber; +const int FileDescriptorProto::kServiceFieldNumber; +const int FileDescriptorProto::kExtensionFieldNumber; +const int FileDescriptorProto::kOptionsFieldNumber; +const int FileDescriptorProto::kSourceCodeInfoFieldNumber; +const int FileDescriptorProto::kSyntaxFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FileDescriptorProto::FileDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FileDescriptorProto) +} + +void FileDescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::FileOptions*>(&::google::protobuf::FileOptions::default_instance()); + source_code_info_ = const_cast< ::google::protobuf::SourceCodeInfo*>(&::google::protobuf::SourceCodeInfo::default_instance()); +} + +FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FileDescriptorProto) +} + +void FileDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; + source_code_info_ = NULL; + syntax_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FileDescriptorProto::~FileDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.FileDescriptorProto) + SharedDtor(); +} + +void FileDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + syntax_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + delete source_code_info_; + } +} + +void FileDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FileDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FileDescriptorProto_descriptor_; +} + +const FileDescriptorProto& FileDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +FileDescriptorProto* FileDescriptorProto::default_instance_ = NULL; + +FileDescriptorProto* FileDescriptorProto::New(::google::protobuf::Arena* arena) const { + FileDescriptorProto* n = new FileDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FileDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FileDescriptorProto) + if (_has_bits_[0 / 32] & 3u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_package()) { + package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + if (_has_bits_[8 / 32] & 3584u) { + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::FileOptions::Clear(); + } + if (has_source_code_info()) { + if (source_code_info_ != NULL) source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); + } + if (has_syntax()) { + syntax_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + dependency_.Clear(); + public_dependency_.Clear(); + weak_dependency_.Clear(); + message_type_.Clear(); + enum_type_.Clear(); + service_.Clear(); + extension_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FileDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FileDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_package; + break; + } + + // optional string package = 2; + case 2: { + if (tag == 18) { + parse_package: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_package())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->package().data(), this->package().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.package"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_dependency; + break; + } + + // repeated string dependency = 3; + case 3: { + if (tag == 26) { + parse_dependency: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_dependency())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->dependency(this->dependency_size() - 1).data(), + this->dependency(this->dependency_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.dependency"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_dependency; + if (input->ExpectTag(34)) goto parse_message_type; + break; + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + case 4: { + if (tag == 34) { + parse_message_type: + DO_(input->IncrementRecursionDepth()); + parse_loop_message_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_message_type())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_loop_message_type; + if (input->ExpectTag(42)) goto parse_loop_enum_type; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + case 5: { + if (tag == 42) { + DO_(input->IncrementRecursionDepth()); + parse_loop_enum_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_enum_type())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_loop_enum_type; + if (input->ExpectTag(50)) goto parse_loop_service; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + case 6: { + if (tag == 50) { + DO_(input->IncrementRecursionDepth()); + parse_loop_service: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_service())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_loop_service; + if (input->ExpectTag(58)) goto parse_loop_extension; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + case 7: { + if (tag == 58) { + DO_(input->IncrementRecursionDepth()); + parse_loop_extension: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_extension())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_loop_extension; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(66)) goto parse_options; + break; + } + + // optional .google.protobuf.FileOptions options = 8; + case 8: { + if (tag == 66) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_source_code_info; + break; + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + case 9: { + if (tag == 74) { + parse_source_code_info: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_source_code_info())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_public_dependency; + break; + } + + // repeated int32 public_dependency = 10; + case 10: { + if (tag == 80) { + parse_public_dependency: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 80, input, this->mutable_public_dependency()))); + } else if (tag == 82) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_public_dependency()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_public_dependency; + if (input->ExpectTag(88)) goto parse_weak_dependency; + break; + } + + // repeated int32 weak_dependency = 11; + case 11: { + if (tag == 88) { + parse_weak_dependency: + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 88, input, this->mutable_weak_dependency()))); + } else if (tag == 90) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_weak_dependency()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(88)) goto parse_weak_dependency; + if (input->ExpectTag(98)) goto parse_syntax; + break; + } + + // optional string syntax = 12; + case 12: { + if (tag == 98) { + parse_syntax: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_syntax())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->syntax().data(), this->syntax().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileDescriptorProto.syntax"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FileDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FileDescriptorProto) + return false; +#undef DO_ +} + +void FileDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FileDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string package = 2; + if (has_package()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->package().data(), this->package().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.package"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->package(), output); + } + + // repeated string dependency = 3; + for (int i = 0; i < this->dependency_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->dependency(i).data(), this->dependency(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.dependency"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 3, this->dependency(i), output); + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + for (unsigned int i = 0, n = this->message_type_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->message_type(i), output); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + for (unsigned int i = 0, n = this->enum_type_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->enum_type(i), output); + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + for (unsigned int i = 0, n = this->service_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->service(i), output); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + for (unsigned int i = 0, n = this->extension_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, this->extension(i), output); + } + + // optional .google.protobuf.FileOptions options = 8; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *this->options_, output); + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + if (has_source_code_info()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, *this->source_code_info_, output); + } + + // repeated int32 public_dependency = 10; + for (int i = 0; i < this->public_dependency_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 10, this->public_dependency(i), output); + } + + // repeated int32 weak_dependency = 11; + for (int i = 0; i < this->weak_dependency_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32( + 11, this->weak_dependency(i), output); + } + + // optional string syntax = 12; + if (has_syntax()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->syntax().data(), this->syntax().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.syntax"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 12, this->syntax(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FileDescriptorProto) +} + +::google::protobuf::uint8* FileDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string package = 2; + if (has_package()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->package().data(), this->package().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.package"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->package(), target); + } + + // repeated string dependency = 3; + for (int i = 0; i < this->dependency_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->dependency(i).data(), this->dependency(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.dependency"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(3, this->dependency(i), target); + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + for (unsigned int i = 0, n = this->message_type_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->message_type(i), target); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + for (unsigned int i = 0, n = this->enum_type_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->enum_type(i), target); + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + for (unsigned int i = 0, n = this->service_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->service(i), target); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + for (unsigned int i = 0, n = this->extension_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, this->extension(i), target); + } + + // optional .google.protobuf.FileOptions options = 8; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, *this->options_, target); + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + if (has_source_code_info()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, *this->source_code_info_, target); + } + + // repeated int32 public_dependency = 10; + for (int i = 0; i < this->public_dependency_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(10, this->public_dependency(i), target); + } + + // repeated int32 weak_dependency = 11; + for (int i = 0; i < this->weak_dependency_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArray(11, this->weak_dependency(i), target); + } + + // optional string syntax = 12; + if (has_syntax()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->syntax().data(), this->syntax().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileDescriptorProto.syntax"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 12, this->syntax(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileDescriptorProto) + return target; +} + +int FileDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileDescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string package = 2; + if (has_package()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->package()); + } + + } + if (_has_bits_[9 / 32] & 3584u) { + // optional .google.protobuf.FileOptions options = 8; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + if (has_source_code_info()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->source_code_info_); + } + + // optional string syntax = 12; + if (has_syntax()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->syntax()); + } + + } + // repeated string dependency = 3; + total_size += 1 * this->dependency_size(); + for (int i = 0; i < this->dependency_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->dependency(i)); + } + + // repeated int32 public_dependency = 10; + { + int data_size = 0; + for (int i = 0; i < this->public_dependency_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->public_dependency(i)); + } + total_size += 1 * this->public_dependency_size() + data_size; + } + + // repeated int32 weak_dependency = 11; + { + int data_size = 0; + for (int i = 0; i < this->weak_dependency_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->weak_dependency(i)); + } + total_size += 1 * this->weak_dependency_size() + data_size; + } + + // repeated .google.protobuf.DescriptorProto message_type = 4; + total_size += 1 * this->message_type_size(); + for (int i = 0; i < this->message_type_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->message_type(i)); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + total_size += 1 * this->enum_type_size(); + for (int i = 0; i < this->enum_type_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->enum_type(i)); + } + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + total_size += 1 * this->service_size(); + for (int i = 0; i < this->service_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->service(i)); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + total_size += 1 * this->extension_size(); + for (int i = 0; i < this->extension_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FileDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FileDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileDescriptorProto) + MergeFrom(*source); + } +} + +void FileDescriptorProto::MergeFrom(const FileDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + dependency_.MergeFrom(from.dependency_); + public_dependency_.MergeFrom(from.public_dependency_); + weak_dependency_.MergeFrom(from.weak_dependency_); + message_type_.MergeFrom(from.message_type_); + enum_type_.MergeFrom(from.enum_type_); + service_.MergeFrom(from.service_); + extension_.MergeFrom(from.extension_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_package()) { + set_has_package(); + package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.package_); + } + } + if (from._has_bits_[9 / 32] & (0xffu << (9 % 32))) { + if (from.has_options()) { + mutable_options()->::google::protobuf::FileOptions::MergeFrom(from.options()); + } + if (from.has_source_code_info()) { + mutable_source_code_info()->::google::protobuf::SourceCodeInfo::MergeFrom(from.source_code_info()); + } + if (from.has_syntax()) { + set_has_syntax(); + syntax_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.syntax_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FileDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FileDescriptorProto::CopyFrom(const FileDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FileDescriptorProto::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->message_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->service())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false; + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void FileDescriptorProto::Swap(FileDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void FileDescriptorProto::InternalSwap(FileDescriptorProto* other) { + name_.Swap(&other->name_); + package_.Swap(&other->package_); + dependency_.UnsafeArenaSwap(&other->dependency_); + public_dependency_.UnsafeArenaSwap(&other->public_dependency_); + weak_dependency_.UnsafeArenaSwap(&other->weak_dependency_); + message_type_.UnsafeArenaSwap(&other->message_type_); + enum_type_.UnsafeArenaSwap(&other->enum_type_); + service_.UnsafeArenaSwap(&other->service_); + extension_.UnsafeArenaSwap(&other->extension_); + std::swap(options_, other->options_); + std::swap(source_code_info_, other->source_code_info_); + syntax_.Swap(&other->syntax_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FileDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FileDescriptorProto_descriptor_; + metadata.reflection = FileDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FileDescriptorProto + +// optional string name = 1; +bool FileDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void FileDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void FileDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void FileDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& FileDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name) +} + void FileDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.name) +} + void FileDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.name) +} + ::std::string* FileDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name) +} + +// optional string package = 2; +bool FileDescriptorProto::has_package() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void FileDescriptorProto::set_has_package() { + _has_bits_[0] |= 0x00000002u; +} +void FileDescriptorProto::clear_has_package() { + _has_bits_[0] &= ~0x00000002u; +} +void FileDescriptorProto::clear_package() { + package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_package(); +} + const ::std::string& FileDescriptorProto::package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package) + return package_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileDescriptorProto::set_package(const ::std::string& value) { + set_has_package(); + package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package) +} + void FileDescriptorProto::set_package(const char* value) { + set_has_package(); + package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.package) +} + void FileDescriptorProto::set_package(const char* value, size_t size) { + set_has_package(); + package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.package) +} + ::std::string* FileDescriptorProto::mutable_package() { + set_has_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.package) + return package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileDescriptorProto::release_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package) + clear_has_package(); + return package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileDescriptorProto::set_allocated_package(::std::string* package) { + if (package != NULL) { + set_has_package(); + } else { + clear_has_package(); + } + package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package) +} + +// repeated string dependency = 3; +int FileDescriptorProto::dependency_size() const { + return dependency_.size(); +} +void FileDescriptorProto::clear_dependency() { + dependency_.Clear(); +} + const ::std::string& FileDescriptorProto::dependency(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency) + return dependency_.Get(index); +} + ::std::string* FileDescriptorProto::mutable_dependency(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.dependency) + return dependency_.Mutable(index); +} + void FileDescriptorProto::set_dependency(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) + dependency_.Mutable(index)->assign(value); +} + void FileDescriptorProto::set_dependency(int index, const char* value) { + dependency_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) +} + void FileDescriptorProto::set_dependency(int index, const char* value, size_t size) { + dependency_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.dependency) +} + ::std::string* FileDescriptorProto::add_dependency() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.FileDescriptorProto.dependency) + return dependency_.Add(); +} + void FileDescriptorProto::add_dependency(const ::std::string& value) { + dependency_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) +} + void FileDescriptorProto::add_dependency(const char* value) { + dependency_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) +} + void FileDescriptorProto::add_dependency(const char* value, size_t size) { + dependency_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.FileDescriptorProto.dependency) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +FileDescriptorProto::dependency() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.dependency) + return dependency_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +FileDescriptorProto::mutable_dependency() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.dependency) + return &dependency_; +} + +// repeated int32 public_dependency = 10; +int FileDescriptorProto::public_dependency_size() const { + return public_dependency_.size(); +} +void FileDescriptorProto::clear_public_dependency() { + public_dependency_.Clear(); +} + ::google::protobuf::int32 FileDescriptorProto::public_dependency(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency) + return public_dependency_.Get(index); +} + void FileDescriptorProto::set_public_dependency(int index, ::google::protobuf::int32 value) { + public_dependency_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.public_dependency) +} + void FileDescriptorProto::add_public_dependency(::google::protobuf::int32 value) { + public_dependency_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.public_dependency) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +FileDescriptorProto::public_dependency() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.public_dependency) + return public_dependency_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +FileDescriptorProto::mutable_public_dependency() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.public_dependency) + return &public_dependency_; +} + +// repeated int32 weak_dependency = 11; +int FileDescriptorProto::weak_dependency_size() const { + return weak_dependency_.size(); +} +void FileDescriptorProto::clear_weak_dependency() { + weak_dependency_.Clear(); +} + ::google::protobuf::int32 FileDescriptorProto::weak_dependency(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency) + return weak_dependency_.Get(index); +} + void FileDescriptorProto::set_weak_dependency(int index, ::google::protobuf::int32 value) { + weak_dependency_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.weak_dependency) +} + void FileDescriptorProto::add_weak_dependency(::google::protobuf::int32 value) { + weak_dependency_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.weak_dependency) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +FileDescriptorProto::weak_dependency() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.weak_dependency) + return weak_dependency_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +FileDescriptorProto::mutable_weak_dependency() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.weak_dependency) + return &weak_dependency_; +} + +// repeated .google.protobuf.DescriptorProto message_type = 4; +int FileDescriptorProto::message_type_size() const { + return message_type_.size(); +} +void FileDescriptorProto::clear_message_type() { + message_type_.Clear(); +} +const ::google::protobuf::DescriptorProto& FileDescriptorProto::message_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.message_type) + return message_type_.Get(index); +} +::google::protobuf::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.message_type) + return message_type_.Mutable(index); +} +::google::protobuf::DescriptorProto* FileDescriptorProto::add_message_type() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.message_type) + return message_type_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* +FileDescriptorProto::mutable_message_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.message_type) + return &message_type_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& +FileDescriptorProto::message_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.message_type) + return message_type_; +} + +// repeated .google.protobuf.EnumDescriptorProto enum_type = 5; +int FileDescriptorProto::enum_type_size() const { + return enum_type_.size(); +} +void FileDescriptorProto::clear_enum_type() { + enum_type_.Clear(); +} +const ::google::protobuf::EnumDescriptorProto& FileDescriptorProto::enum_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_.Get(index); +} +::google::protobuf::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_.Mutable(index); +} +::google::protobuf::EnumDescriptorProto* FileDescriptorProto::add_enum_type() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* +FileDescriptorProto::mutable_enum_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.enum_type) + return &enum_type_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& +FileDescriptorProto::enum_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_; +} + +// repeated .google.protobuf.ServiceDescriptorProto service = 6; +int FileDescriptorProto::service_size() const { + return service_.size(); +} +void FileDescriptorProto::clear_service() { + service_.Clear(); +} +const ::google::protobuf::ServiceDescriptorProto& FileDescriptorProto::service(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service) + return service_.Get(index); +} +::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.service) + return service_.Mutable(index); +} +::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::add_service() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.service) + return service_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >* +FileDescriptorProto::mutable_service() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.service) + return &service_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >& +FileDescriptorProto::service() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.service) + return service_; +} + +// repeated .google.protobuf.FieldDescriptorProto extension = 7; +int FileDescriptorProto::extension_size() const { + return extension_.size(); +} +void FileDescriptorProto::clear_extension() { + extension_.Clear(); +} +const ::google::protobuf::FieldDescriptorProto& FileDescriptorProto::extension(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension) + return extension_.Get(index); +} +::google::protobuf::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.extension) + return extension_.Mutable(index); +} +::google::protobuf::FieldDescriptorProto* FileDescriptorProto::add_extension() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.extension) + return extension_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* +FileDescriptorProto::mutable_extension() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.extension) + return &extension_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& +FileDescriptorProto::extension() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.extension) + return extension_; +} + +// optional .google.protobuf.FileOptions options = 8; +bool FileDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void FileDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000200u; +} +void FileDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000200u; +} +void FileDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::FileOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::FileOptions& FileDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::FileOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options) + return options_; +} +::google::protobuf::FileOptions* FileDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options) + clear_has_options(); + ::google::protobuf::FileOptions* temp = options_; + options_ = NULL; + return temp; +} +void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options) +} + +// optional .google.protobuf.SourceCodeInfo source_code_info = 9; +bool FileDescriptorProto::has_source_code_info() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void FileDescriptorProto::set_has_source_code_info() { + _has_bits_[0] |= 0x00000400u; +} +void FileDescriptorProto::clear_has_source_code_info() { + _has_bits_[0] &= ~0x00000400u; +} +void FileDescriptorProto::clear_source_code_info() { + if (source_code_info_ != NULL) source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); + clear_has_source_code_info(); +} +const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_code_info() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.source_code_info) + return source_code_info_ != NULL ? *source_code_info_ : *default_instance_->source_code_info_; +} +::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() { + set_has_source_code_info(); + if (source_code_info_ == NULL) { + source_code_info_ = new ::google::protobuf::SourceCodeInfo; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info) + return source_code_info_; +} +::google::protobuf::SourceCodeInfo* FileDescriptorProto::release_source_code_info() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info) + clear_has_source_code_info(); + ::google::protobuf::SourceCodeInfo* temp = source_code_info_; + source_code_info_ = NULL; + return temp; +} +void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) { + delete source_code_info_; + source_code_info_ = source_code_info; + if (source_code_info) { + set_has_source_code_info(); + } else { + clear_has_source_code_info(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) +} + +// optional string syntax = 12; +bool FileDescriptorProto::has_syntax() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void FileDescriptorProto::set_has_syntax() { + _has_bits_[0] |= 0x00000800u; +} +void FileDescriptorProto::clear_has_syntax() { + _has_bits_[0] &= ~0x00000800u; +} +void FileDescriptorProto::clear_syntax() { + syntax_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_syntax(); +} + const ::std::string& FileDescriptorProto::syntax() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax) + return syntax_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileDescriptorProto::set_syntax(const ::std::string& value) { + set_has_syntax(); + syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax) +} + void FileDescriptorProto::set_syntax(const char* value) { + set_has_syntax(); + syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.syntax) +} + void FileDescriptorProto::set_syntax(const char* value, size_t size) { + set_has_syntax(); + syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.syntax) +} + ::std::string* FileDescriptorProto::mutable_syntax() { + set_has_syntax(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.syntax) + return syntax_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileDescriptorProto::release_syntax() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax) + clear_has_syntax(); + return syntax_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { + if (syntax != NULL) { + set_has_syntax(); + } else { + clear_has_syntax(); + } + syntax_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DescriptorProto_ExtensionRange::kStartFieldNumber; +const int DescriptorProto_ExtensionRange::kEndFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ExtensionRange) +} + +void DescriptorProto_ExtensionRange::InitAsDefaultInstance() { +} + +DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ExtensionRange) +} + +void DescriptorProto_ExtensionRange::SharedCtor() { + _cached_size_ = 0; + start_ = 0; + end_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DescriptorProto_ExtensionRange::~DescriptorProto_ExtensionRange() { + // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ExtensionRange) + SharedDtor(); +} + +void DescriptorProto_ExtensionRange::SharedDtor() { + if (this != default_instance_) { + } +} + +void DescriptorProto_ExtensionRange::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DescriptorProto_ExtensionRange::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DescriptorProto_ExtensionRange_descriptor_; +} + +const DescriptorProto_ExtensionRange& DescriptorProto_ExtensionRange::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::default_instance_ = NULL; + +DescriptorProto_ExtensionRange* DescriptorProto_ExtensionRange::New(::google::protobuf::Arena* arena) const { + DescriptorProto_ExtensionRange* n = new DescriptorProto_ExtensionRange; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DescriptorProto_ExtensionRange::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ExtensionRange) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(DescriptorProto_ExtensionRange, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(start_, end_); + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DescriptorProto_ExtensionRange::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ExtensionRange) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 start = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &start_))); + set_has_start(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_end; + break; + } + + // optional int32 end = 2; + case 2: { + if (tag == 16) { + parse_end: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_))); + set_has_end(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto.ExtensionRange) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ExtensionRange) + return false; +#undef DO_ +} + +void DescriptorProto_ExtensionRange::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ExtensionRange) + // optional int32 start = 1; + if (has_start()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); + } + + // optional int32 end = 2; + if (has_end()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ExtensionRange) +} + +::google::protobuf::uint8* DescriptorProto_ExtensionRange::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ExtensionRange) + // optional int32 start = 1; + if (has_start()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); + } + + // optional int32 end = 2; + if (has_end()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ExtensionRange) + return target; +} + +int DescriptorProto_ExtensionRange::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ExtensionRange) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional int32 start = 1; + if (has_start()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->start()); + } + + // optional int32 end = 2; + if (has_end()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->end()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DescriptorProto_ExtensionRange::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DescriptorProto_ExtensionRange* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ExtensionRange) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ExtensionRange) + MergeFrom(*source); + } +} + +void DescriptorProto_ExtensionRange::MergeFrom(const DescriptorProto_ExtensionRange& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ExtensionRange) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_start()) { + set_start(from.start()); + } + if (from.has_end()) { + set_end(from.end()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void DescriptorProto_ExtensionRange::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DescriptorProto_ExtensionRange::CopyFrom(const DescriptorProto_ExtensionRange& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto.ExtensionRange) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DescriptorProto_ExtensionRange::IsInitialized() const { + + return true; +} + +void DescriptorProto_ExtensionRange::Swap(DescriptorProto_ExtensionRange* other) { + if (other == this) return; + InternalSwap(other); +} +void DescriptorProto_ExtensionRange::InternalSwap(DescriptorProto_ExtensionRange* other) { + std::swap(start_, other->start_); + std::swap(end_, other->end_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DescriptorProto_ExtensionRange::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DescriptorProto_ExtensionRange_descriptor_; + metadata.reflection = DescriptorProto_ExtensionRange_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DescriptorProto_ReservedRange::kStartFieldNumber; +const int DescriptorProto_ReservedRange::kEndFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DescriptorProto_ReservedRange::DescriptorProto_ReservedRange() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto.ReservedRange) +} + +void DescriptorProto_ReservedRange::InitAsDefaultInstance() { +} + +DescriptorProto_ReservedRange::DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto.ReservedRange) +} + +void DescriptorProto_ReservedRange::SharedCtor() { + _cached_size_ = 0; + start_ = 0; + end_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DescriptorProto_ReservedRange::~DescriptorProto_ReservedRange() { + // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto.ReservedRange) + SharedDtor(); +} + +void DescriptorProto_ReservedRange::SharedDtor() { + if (this != default_instance_) { + } +} + +void DescriptorProto_ReservedRange::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DescriptorProto_ReservedRange::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DescriptorProto_ReservedRange_descriptor_; +} + +const DescriptorProto_ReservedRange& DescriptorProto_ReservedRange::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +DescriptorProto_ReservedRange* DescriptorProto_ReservedRange::default_instance_ = NULL; + +DescriptorProto_ReservedRange* DescriptorProto_ReservedRange::New(::google::protobuf::Arena* arena) const { + DescriptorProto_ReservedRange* n = new DescriptorProto_ReservedRange; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DescriptorProto_ReservedRange::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto.ReservedRange) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(DescriptorProto_ReservedRange, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(start_, end_); + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DescriptorProto_ReservedRange::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto.ReservedRange) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional int32 start = 1; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &start_))); + set_has_start(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_end; + break; + } + + // optional int32 end = 2; + case 2: { + if (tag == 16) { + parse_end: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_))); + set_has_end(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto.ReservedRange) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto.ReservedRange) + return false; +#undef DO_ +} + +void DescriptorProto_ReservedRange::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto.ReservedRange) + // optional int32 start = 1; + if (has_start()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->start(), output); + } + + // optional int32 end = 2; + if (has_end()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->end(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto.ReservedRange) +} + +::google::protobuf::uint8* DescriptorProto_ReservedRange::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto.ReservedRange) + // optional int32 start = 1; + if (has_start()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->start(), target); + } + + // optional int32 end = 2; + if (has_end()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->end(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto.ReservedRange) + return target; +} + +int DescriptorProto_ReservedRange::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto.ReservedRange) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional int32 start = 1; + if (has_start()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->start()); + } + + // optional int32 end = 2; + if (has_end()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->end()); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DescriptorProto_ReservedRange::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto.ReservedRange) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DescriptorProto_ReservedRange* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto.ReservedRange) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto.ReservedRange) + MergeFrom(*source); + } +} + +void DescriptorProto_ReservedRange::MergeFrom(const DescriptorProto_ReservedRange& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto.ReservedRange) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_start()) { + set_start(from.start()); + } + if (from.has_end()) { + set_end(from.end()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void DescriptorProto_ReservedRange::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto.ReservedRange) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DescriptorProto_ReservedRange::CopyFrom(const DescriptorProto_ReservedRange& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto.ReservedRange) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DescriptorProto_ReservedRange::IsInitialized() const { + + return true; +} + +void DescriptorProto_ReservedRange::Swap(DescriptorProto_ReservedRange* other) { + if (other == this) return; + InternalSwap(other); +} +void DescriptorProto_ReservedRange::InternalSwap(DescriptorProto_ReservedRange* other) { + std::swap(start_, other->start_); + std::swap(end_, other->end_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DescriptorProto_ReservedRange::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DescriptorProto_ReservedRange_descriptor_; + metadata.reflection = DescriptorProto_ReservedRange_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int DescriptorProto::kNameFieldNumber; +const int DescriptorProto::kFieldFieldNumber; +const int DescriptorProto::kExtensionFieldNumber; +const int DescriptorProto::kNestedTypeFieldNumber; +const int DescriptorProto::kEnumTypeFieldNumber; +const int DescriptorProto::kExtensionRangeFieldNumber; +const int DescriptorProto::kOneofDeclFieldNumber; +const int DescriptorProto::kOptionsFieldNumber; +const int DescriptorProto::kReservedRangeFieldNumber; +const int DescriptorProto::kReservedNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +DescriptorProto::DescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.DescriptorProto) +} + +void DescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::MessageOptions*>(&::google::protobuf::MessageOptions::default_instance()); +} + +DescriptorProto::DescriptorProto(const DescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.DescriptorProto) +} + +void DescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +DescriptorProto::~DescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.DescriptorProto) + SharedDtor(); +} + +void DescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + } +} + +void DescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* DescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return DescriptorProto_descriptor_; +} + +const DescriptorProto& DescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +DescriptorProto* DescriptorProto::default_instance_ = NULL; + +DescriptorProto* DescriptorProto::New(::google::protobuf::Arena* arena) const { + DescriptorProto* n = new DescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void DescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.DescriptorProto) + if (_has_bits_[0 / 32] & 129u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::MessageOptions::Clear(); + } + } + field_.Clear(); + extension_.Clear(); + nested_type_.Clear(); + enum_type_.Clear(); + extension_range_.Clear(); + oneof_decl_.Clear(); + reserved_range_.Clear(); + reserved_name_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool DescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.DescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.DescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_field; + break; + } + + // repeated .google.protobuf.FieldDescriptorProto field = 2; + case 2: { + if (tag == 18) { + parse_field: + DO_(input->IncrementRecursionDepth()); + parse_loop_field: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_field())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_field; + if (input->ExpectTag(26)) goto parse_loop_nested_type; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + case 3: { + if (tag == 26) { + DO_(input->IncrementRecursionDepth()); + parse_loop_nested_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_nested_type())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_loop_nested_type; + if (input->ExpectTag(34)) goto parse_loop_enum_type; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + case 4: { + if (tag == 34) { + DO_(input->IncrementRecursionDepth()); + parse_loop_enum_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_enum_type())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_loop_enum_type; + if (input->ExpectTag(42)) goto parse_loop_extension_range; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + case 5: { + if (tag == 42) { + DO_(input->IncrementRecursionDepth()); + parse_loop_extension_range: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_extension_range())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(42)) goto parse_loop_extension_range; + if (input->ExpectTag(50)) goto parse_loop_extension; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + case 6: { + if (tag == 50) { + DO_(input->IncrementRecursionDepth()); + parse_loop_extension: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_extension())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_loop_extension; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(58)) goto parse_options; + break; + } + + // optional .google.protobuf.MessageOptions options = 7; + case 7: { + if (tag == 58) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_oneof_decl; + break; + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + case 8: { + if (tag == 66) { + parse_oneof_decl: + DO_(input->IncrementRecursionDepth()); + parse_loop_oneof_decl: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_oneof_decl())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_loop_oneof_decl; + if (input->ExpectTag(74)) goto parse_loop_reserved_range; + input->UnsafeDecrementRecursionDepth(); + break; + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + case 9: { + if (tag == 74) { + DO_(input->IncrementRecursionDepth()); + parse_loop_reserved_range: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_reserved_range())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(74)) goto parse_loop_reserved_range; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(82)) goto parse_reserved_name; + break; + } + + // repeated string reserved_name = 10; + case 10: { + if (tag == 82) { + parse_reserved_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_reserved_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(this->reserved_name_size() - 1).data(), + this->reserved_name(this->reserved_name_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.DescriptorProto.reserved_name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_reserved_name; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.DescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.DescriptorProto) + return false; +#undef DO_ +} + +void DescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.DescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .google.protobuf.FieldDescriptorProto field = 2; + for (unsigned int i = 0, n = this->field_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->field(i), output); + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + for (unsigned int i = 0, n = this->nested_type_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, this->nested_type(i), output); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + for (unsigned int i = 0, n = this->enum_type_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, this->enum_type(i), output); + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + for (unsigned int i = 0, n = this->extension_range_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 5, this->extension_range(i), output); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + for (unsigned int i = 0, n = this->extension_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 6, this->extension(i), output); + } + + // optional .google.protobuf.MessageOptions options = 7; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 7, *this->options_, output); + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + for (unsigned int i = 0, n = this->oneof_decl_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, this->oneof_decl(i), output); + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + for (unsigned int i = 0, n = this->reserved_range_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 9, this->reserved_range(i), output); + } + + // repeated string reserved_name = 10; + for (int i = 0; i < this->reserved_name_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(i).data(), this->reserved_name(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.reserved_name"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 10, this->reserved_name(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.DescriptorProto) +} + +::google::protobuf::uint8* DescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.DescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .google.protobuf.FieldDescriptorProto field = 2; + for (unsigned int i = 0, n = this->field_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->field(i), target); + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + for (unsigned int i = 0, n = this->nested_type_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, this->nested_type(i), target); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + for (unsigned int i = 0, n = this->enum_type_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, this->enum_type(i), target); + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + for (unsigned int i = 0, n = this->extension_range_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 5, this->extension_range(i), target); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + for (unsigned int i = 0, n = this->extension_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 6, this->extension(i), target); + } + + // optional .google.protobuf.MessageOptions options = 7; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 7, *this->options_, target); + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + for (unsigned int i = 0, n = this->oneof_decl_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, this->oneof_decl(i), target); + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + for (unsigned int i = 0, n = this->reserved_range_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 9, this->reserved_range(i), target); + } + + // repeated string reserved_name = 10; + for (int i = 0; i < this->reserved_name_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->reserved_name(i).data(), this->reserved_name(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.DescriptorProto.reserved_name"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(10, this->reserved_name(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.DescriptorProto) + return target; +} + +int DescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.DescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 129u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .google.protobuf.MessageOptions options = 7; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + } + // repeated .google.protobuf.FieldDescriptorProto field = 2; + total_size += 1 * this->field_size(); + for (int i = 0; i < this->field_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->field(i)); + } + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + total_size += 1 * this->extension_size(); + for (int i = 0; i < this->extension_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension(i)); + } + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + total_size += 1 * this->nested_type_size(); + for (int i = 0; i < this->nested_type_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->nested_type(i)); + } + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + total_size += 1 * this->enum_type_size(); + for (int i = 0; i < this->enum_type_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->enum_type(i)); + } + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + total_size += 1 * this->extension_range_size(); + for (int i = 0; i < this->extension_range_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->extension_range(i)); + } + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + total_size += 1 * this->oneof_decl_size(); + for (int i = 0; i < this->oneof_decl_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->oneof_decl(i)); + } + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + total_size += 1 * this->reserved_range_size(); + for (int i = 0; i < this->reserved_range_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->reserved_range(i)); + } + + // repeated string reserved_name = 10; + total_size += 1 * this->reserved_name_size(); + for (int i = 0; i < this->reserved_name_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->reserved_name(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void DescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.DescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const DescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.DescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.DescriptorProto) + MergeFrom(*source); + } +} + +void DescriptorProto::MergeFrom(const DescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.DescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + field_.MergeFrom(from.field_); + extension_.MergeFrom(from.extension_); + nested_type_.MergeFrom(from.nested_type_); + enum_type_.MergeFrom(from.enum_type_); + extension_range_.MergeFrom(from.extension_range_); + oneof_decl_.MergeFrom(from.oneof_decl_); + reserved_range_.MergeFrom(from.reserved_range_); + reserved_name_.MergeFrom(from.reserved_name_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_options()) { + mutable_options()->::google::protobuf::MessageOptions::MergeFrom(from.options()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void DescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.DescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void DescriptorProto::CopyFrom(const DescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.DescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool DescriptorProto::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->field())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->extension())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->nested_type())) return false; + if (!::google::protobuf::internal::AllAreInitialized(this->enum_type())) return false; + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void DescriptorProto::Swap(DescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void DescriptorProto::InternalSwap(DescriptorProto* other) { + name_.Swap(&other->name_); + field_.UnsafeArenaSwap(&other->field_); + extension_.UnsafeArenaSwap(&other->extension_); + nested_type_.UnsafeArenaSwap(&other->nested_type_); + enum_type_.UnsafeArenaSwap(&other->enum_type_); + extension_range_.UnsafeArenaSwap(&other->extension_range_); + oneof_decl_.UnsafeArenaSwap(&other->oneof_decl_); + std::swap(options_, other->options_); + reserved_range_.UnsafeArenaSwap(&other->reserved_range_); + reserved_name_.UnsafeArenaSwap(&other->reserved_name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata DescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = DescriptorProto_descriptor_; + metadata.reflection = DescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// DescriptorProto_ExtensionRange + +// optional int32 start = 1; +bool DescriptorProto_ExtensionRange::has_start() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void DescriptorProto_ExtensionRange::set_has_start() { + _has_bits_[0] |= 0x00000001u; +} +void DescriptorProto_ExtensionRange::clear_has_start() { + _has_bits_[0] &= ~0x00000001u; +} +void DescriptorProto_ExtensionRange::clear_start() { + start_ = 0; + clear_has_start(); +} + ::google::protobuf::int32 DescriptorProto_ExtensionRange::start() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start) + return start_; +} + void DescriptorProto_ExtensionRange::set_start(::google::protobuf::int32 value) { + set_has_start(); + start_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.start) +} + +// optional int32 end = 2; +bool DescriptorProto_ExtensionRange::has_end() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void DescriptorProto_ExtensionRange::set_has_end() { + _has_bits_[0] |= 0x00000002u; +} +void DescriptorProto_ExtensionRange::clear_has_end() { + _has_bits_[0] &= ~0x00000002u; +} +void DescriptorProto_ExtensionRange::clear_end() { + end_ = 0; + clear_has_end(); +} + ::google::protobuf::int32 DescriptorProto_ExtensionRange::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end) + return end_; +} + void DescriptorProto_ExtensionRange::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.end) +} + +// ------------------------------------------------------------------- + +// DescriptorProto_ReservedRange + +// optional int32 start = 1; +bool DescriptorProto_ReservedRange::has_start() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void DescriptorProto_ReservedRange::set_has_start() { + _has_bits_[0] |= 0x00000001u; +} +void DescriptorProto_ReservedRange::clear_has_start() { + _has_bits_[0] &= ~0x00000001u; +} +void DescriptorProto_ReservedRange::clear_start() { + start_ = 0; + clear_has_start(); +} + ::google::protobuf::int32 DescriptorProto_ReservedRange::start() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start) + return start_; +} + void DescriptorProto_ReservedRange::set_start(::google::protobuf::int32 value) { + set_has_start(); + start_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.start) +} + +// optional int32 end = 2; +bool DescriptorProto_ReservedRange::has_end() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void DescriptorProto_ReservedRange::set_has_end() { + _has_bits_[0] |= 0x00000002u; +} +void DescriptorProto_ReservedRange::clear_has_end() { + _has_bits_[0] &= ~0x00000002u; +} +void DescriptorProto_ReservedRange::clear_end() { + end_ = 0; + clear_has_end(); +} + ::google::protobuf::int32 DescriptorProto_ReservedRange::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end) + return end_; +} + void DescriptorProto_ReservedRange::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.end) +} + +// ------------------------------------------------------------------- + +// DescriptorProto + +// optional string name = 1; +bool DescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void DescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void DescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void DescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& DescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void DescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name) +} + void DescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.name) +} + void DescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.name) +} + ::std::string* DescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* DescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void DescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name) +} + +// repeated .google.protobuf.FieldDescriptorProto field = 2; +int DescriptorProto::field_size() const { + return field_.size(); +} +void DescriptorProto::clear_field() { + field_.Clear(); +} +const ::google::protobuf::FieldDescriptorProto& DescriptorProto::field(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field) + return field_.Get(index); +} +::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_field(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.field) + return field_.Mutable(index); +} +::google::protobuf::FieldDescriptorProto* DescriptorProto::add_field() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.field) + return field_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* +DescriptorProto::mutable_field() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.field) + return &field_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& +DescriptorProto::field() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.field) + return field_; +} + +// repeated .google.protobuf.FieldDescriptorProto extension = 6; +int DescriptorProto::extension_size() const { + return extension_.size(); +} +void DescriptorProto::clear_extension() { + extension_.Clear(); +} +const ::google::protobuf::FieldDescriptorProto& DescriptorProto::extension(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension) + return extension_.Get(index); +} +::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension) + return extension_.Mutable(index); +} +::google::protobuf::FieldDescriptorProto* DescriptorProto::add_extension() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension) + return extension_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* +DescriptorProto::mutable_extension() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension) + return &extension_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& +DescriptorProto::extension() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension) + return extension_; +} + +// repeated .google.protobuf.DescriptorProto nested_type = 3; +int DescriptorProto::nested_type_size() const { + return nested_type_.size(); +} +void DescriptorProto::clear_nested_type() { + nested_type_.Clear(); +} +const ::google::protobuf::DescriptorProto& DescriptorProto::nested_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.nested_type) + return nested_type_.Get(index); +} +::google::protobuf::DescriptorProto* DescriptorProto::mutable_nested_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.nested_type) + return nested_type_.Mutable(index); +} +::google::protobuf::DescriptorProto* DescriptorProto::add_nested_type() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.nested_type) + return nested_type_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* +DescriptorProto::mutable_nested_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.nested_type) + return &nested_type_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& +DescriptorProto::nested_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.nested_type) + return nested_type_; +} + +// repeated .google.protobuf.EnumDescriptorProto enum_type = 4; +int DescriptorProto::enum_type_size() const { + return enum_type_.size(); +} +void DescriptorProto::clear_enum_type() { + enum_type_.Clear(); +} +const ::google::protobuf::EnumDescriptorProto& DescriptorProto::enum_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.enum_type) + return enum_type_.Get(index); +} +::google::protobuf::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.enum_type) + return enum_type_.Mutable(index); +} +::google::protobuf::EnumDescriptorProto* DescriptorProto::add_enum_type() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.enum_type) + return enum_type_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* +DescriptorProto::mutable_enum_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.enum_type) + return &enum_type_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& +DescriptorProto::enum_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.enum_type) + return enum_type_; +} + +// repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; +int DescriptorProto::extension_range_size() const { + return extension_range_.size(); +} +void DescriptorProto::clear_extension_range() { + extension_range_.Clear(); +} +const ::google::protobuf::DescriptorProto_ExtensionRange& DescriptorProto::extension_range(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension_range) + return extension_range_.Get(index); +} +::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension_range) + return extension_range_.Mutable(index); +} +::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension_range) + return extension_range_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >* +DescriptorProto::mutable_extension_range() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension_range) + return &extension_range_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >& +DescriptorProto::extension_range() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension_range) + return extension_range_; +} + +// repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; +int DescriptorProto::oneof_decl_size() const { + return oneof_decl_.size(); +} +void DescriptorProto::clear_oneof_decl() { + oneof_decl_.Clear(); +} +const ::google::protobuf::OneofDescriptorProto& DescriptorProto::oneof_decl(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_.Get(index); +} +::google::protobuf::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_.Mutable(index); +} +::google::protobuf::OneofDescriptorProto* DescriptorProto::add_oneof_decl() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >* +DescriptorProto::mutable_oneof_decl() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.oneof_decl) + return &oneof_decl_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >& +DescriptorProto::oneof_decl() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_; +} + +// optional .google.protobuf.MessageOptions options = 7; +bool DescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void DescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000080u; +} +void DescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000080u; +} +void DescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::MessageOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::MessageOptions& DescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::MessageOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options) + return options_; +} +::google::protobuf::MessageOptions* DescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options) + clear_has_options(); + ::google::protobuf::MessageOptions* temp = options_; + options_ = NULL; + return temp; +} +void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options) +} + +// repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; +int DescriptorProto::reserved_range_size() const { + return reserved_range_.size(); +} +void DescriptorProto::clear_reserved_range() { + reserved_range_.Clear(); +} +const ::google::protobuf::DescriptorProto_ReservedRange& DescriptorProto::reserved_range(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_.Get(index); +} +::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_.Mutable(index); +} +::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >* +DescriptorProto::mutable_reserved_range() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_range) + return &reserved_range_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >& +DescriptorProto::reserved_range() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_; +} + +// repeated string reserved_name = 10; +int DescriptorProto::reserved_name_size() const { + return reserved_name_.size(); +} +void DescriptorProto::clear_reserved_name() { + reserved_name_.Clear(); +} + const ::std::string& DescriptorProto::reserved_name(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_.Get(index); +} + ::std::string* DescriptorProto::mutable_reserved_name(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_.Mutable(index); +} + void DescriptorProto::set_reserved_name(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) + reserved_name_.Mutable(index)->assign(value); +} + void DescriptorProto::set_reserved_name(int index, const char* value) { + reserved_name_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) +} + void DescriptorProto::set_reserved_name(int index, const char* value, size_t size) { + reserved_name_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name) +} + ::std::string* DescriptorProto::add_reserved_name() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_.Add(); +} + void DescriptorProto::add_reserved_name(const ::std::string& value) { + reserved_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) +} + void DescriptorProto::add_reserved_name(const char* value) { + reserved_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) +} + void DescriptorProto::add_reserved_name(const char* value, size_t size) { + reserved_name_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.DescriptorProto.reserved_name) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +DescriptorProto::reserved_name() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +DescriptorProto::mutable_reserved_name() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_name) + return &reserved_name_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FieldDescriptorProto_Type_descriptor_; +} +bool FieldDescriptorProto_Type_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_DOUBLE; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FLOAT; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_INT32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_FIXED32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BOOL; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_STRING; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_GROUP; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_MESSAGE; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_BYTES; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_UINT32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_ENUM; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SFIXED64; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT32; +const FieldDescriptorProto_Type FieldDescriptorProto::TYPE_SINT64; +const FieldDescriptorProto_Type FieldDescriptorProto::Type_MIN; +const FieldDescriptorProto_Type FieldDescriptorProto::Type_MAX; +const int FieldDescriptorProto::Type_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FieldDescriptorProto_Label_descriptor_; +} +bool FieldDescriptorProto_Label_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_OPTIONAL; +const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REQUIRED; +const FieldDescriptorProto_Label FieldDescriptorProto::LABEL_REPEATED; +const FieldDescriptorProto_Label FieldDescriptorProto::Label_MIN; +const FieldDescriptorProto_Label FieldDescriptorProto::Label_MAX; +const int FieldDescriptorProto::Label_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FieldDescriptorProto::kNameFieldNumber; +const int FieldDescriptorProto::kNumberFieldNumber; +const int FieldDescriptorProto::kLabelFieldNumber; +const int FieldDescriptorProto::kTypeFieldNumber; +const int FieldDescriptorProto::kTypeNameFieldNumber; +const int FieldDescriptorProto::kExtendeeFieldNumber; +const int FieldDescriptorProto::kDefaultValueFieldNumber; +const int FieldDescriptorProto::kOneofIndexFieldNumber; +const int FieldDescriptorProto::kJsonNameFieldNumber; +const int FieldDescriptorProto::kOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FieldDescriptorProto::FieldDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FieldDescriptorProto) +} + +void FieldDescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::FieldOptions*>(&::google::protobuf::FieldOptions::default_instance()); +} + +FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldDescriptorProto) +} + +void FieldDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + number_ = 0; + label_ = 1; + type_ = 1; + type_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extendee_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + oneof_index_ = 0; + json_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FieldDescriptorProto::~FieldDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.FieldDescriptorProto) + SharedDtor(); +} + +void FieldDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + type_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + extendee_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + default_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + json_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + } +} + +void FieldDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FieldDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FieldDescriptorProto_descriptor_; +} + +const FieldDescriptorProto& FieldDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +FieldDescriptorProto* FieldDescriptorProto::default_instance_ = NULL; + +FieldDescriptorProto* FieldDescriptorProto::New(::google::protobuf::Arena* arena) const { + FieldDescriptorProto* n = new FieldDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FieldDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FieldDescriptorProto) + if (_has_bits_[0 / 32] & 255u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + number_ = 0; + label_ = 1; + type_ = 1; + if (has_type_name()) { + type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_extendee()) { + extendee_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_default_value()) { + default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + oneof_index_ = 0; + } + if (_has_bits_[8 / 32] & 768u) { + if (has_json_name()) { + json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::FieldOptions::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FieldDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FieldDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_extendee; + break; + } + + // optional string extendee = 2; + case 2: { + if (tag == 18) { + parse_extendee: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_extendee())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->extendee().data(), this->extendee().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.extendee"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_number; + break; + } + + // optional int32 number = 3; + case 3: { + if (tag == 24) { + parse_number: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &number_))); + set_has_number(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_label; + break; + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + case 4: { + if (tag == 32) { + parse_label: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FieldDescriptorProto_Label_IsValid(value)) { + set_label(static_cast< ::google::protobuf::FieldDescriptorProto_Label >(value)); + } else { + mutable_unknown_fields()->AddVarint(4, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_type; + break; + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + case 5: { + if (tag == 40) { + parse_type: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FieldDescriptorProto_Type_IsValid(value)) { + set_type(static_cast< ::google::protobuf::FieldDescriptorProto_Type >(value)); + } else { + mutable_unknown_fields()->AddVarint(5, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_type_name; + break; + } + + // optional string type_name = 6; + case 6: { + if (tag == 50) { + parse_type_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_type_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type_name().data(), this->type_name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.type_name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_default_value; + break; + } + + // optional string default_value = 7; + case 7: { + if (tag == 58) { + parse_default_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_default_value())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->default_value().data(), this->default_value().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.default_value"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_options; + break; + } + + // optional .google.protobuf.FieldOptions options = 8; + case 8: { + if (tag == 66) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_oneof_index; + break; + } + + // optional int32 oneof_index = 9; + case 9: { + if (tag == 72) { + parse_oneof_index: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &oneof_index_))); + set_has_oneof_index(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(82)) goto parse_json_name; + break; + } + + // optional string json_name = 10; + case 10: { + if (tag == 82) { + parse_json_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_json_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->json_name().data(), this->json_name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FieldDescriptorProto.json_name"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FieldDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FieldDescriptorProto) + return false; +#undef DO_ +} + +void FieldDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FieldDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string extendee = 2; + if (has_extendee()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->extendee().data(), this->extendee().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.extendee"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->extendee(), output); + } + + // optional int32 number = 3; + if (has_number()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->number(), output); + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + if (has_label()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 4, this->label(), output); + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + if (has_type()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 5, this->type(), output); + } + + // optional string type_name = 6; + if (has_type_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type_name().data(), this->type_name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.type_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 6, this->type_name(), output); + } + + // optional string default_value = 7; + if (has_default_value()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->default_value().data(), this->default_value().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.default_value"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 7, this->default_value(), output); + } + + // optional .google.protobuf.FieldOptions options = 8; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 8, *this->options_, output); + } + + // optional int32 oneof_index = 9; + if (has_oneof_index()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(9, this->oneof_index(), output); + } + + // optional string json_name = 10; + if (has_json_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->json_name().data(), this->json_name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.json_name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 10, this->json_name(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FieldDescriptorProto) +} + +::google::protobuf::uint8* FieldDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string extendee = 2; + if (has_extendee()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->extendee().data(), this->extendee().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.extendee"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->extendee(), target); + } + + // optional int32 number = 3; + if (has_number()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->number(), target); + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + if (has_label()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 4, this->label(), target); + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + if (has_type()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 5, this->type(), target); + } + + // optional string type_name = 6; + if (has_type_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->type_name().data(), this->type_name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.type_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 6, this->type_name(), target); + } + + // optional string default_value = 7; + if (has_default_value()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->default_value().data(), this->default_value().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.default_value"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 7, this->default_value(), target); + } + + // optional .google.protobuf.FieldOptions options = 8; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 8, *this->options_, target); + } + + // optional int32 oneof_index = 9; + if (has_oneof_index()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(9, this->oneof_index(), target); + } + + // optional string json_name = 10; + if (has_json_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->json_name().data(), this->json_name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FieldDescriptorProto.json_name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 10, this->json_name(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldDescriptorProto) + return target; +} + +int FieldDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldDescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional int32 number = 3; + if (has_number()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->number()); + } + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + if (has_label()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->label()); + } + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + if (has_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->type()); + } + + // optional string type_name = 6; + if (has_type_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->type_name()); + } + + // optional string extendee = 2; + if (has_extendee()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->extendee()); + } + + // optional string default_value = 7; + if (has_default_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->default_value()); + } + + // optional int32 oneof_index = 9; + if (has_oneof_index()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->oneof_index()); + } + + } + if (_has_bits_[8 / 32] & 768u) { + // optional string json_name = 10; + if (has_json_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->json_name()); + } + + // optional .google.protobuf.FieldOptions options = 8; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FieldDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FieldDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldDescriptorProto) + MergeFrom(*source); + } +} + +void FieldDescriptorProto::MergeFrom(const FieldDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_number()) { + set_number(from.number()); + } + if (from.has_label()) { + set_label(from.label()); + } + if (from.has_type()) { + set_type(from.type()); + } + if (from.has_type_name()) { + set_has_type_name(); + type_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.type_name_); + } + if (from.has_extendee()) { + set_has_extendee(); + extendee_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.extendee_); + } + if (from.has_default_value()) { + set_has_default_value(); + default_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.default_value_); + } + if (from.has_oneof_index()) { + set_oneof_index(from.oneof_index()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_json_name()) { + set_has_json_name(); + json_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.json_name_); + } + if (from.has_options()) { + mutable_options()->::google::protobuf::FieldOptions::MergeFrom(from.options()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FieldDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FieldDescriptorProto::CopyFrom(const FieldDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FieldDescriptorProto::IsInitialized() const { + + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void FieldDescriptorProto::Swap(FieldDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void FieldDescriptorProto::InternalSwap(FieldDescriptorProto* other) { + name_.Swap(&other->name_); + std::swap(number_, other->number_); + std::swap(label_, other->label_); + std::swap(type_, other->type_); + type_name_.Swap(&other->type_name_); + extendee_.Swap(&other->extendee_); + default_value_.Swap(&other->default_value_); + std::swap(oneof_index_, other->oneof_index_); + json_name_.Swap(&other->json_name_); + std::swap(options_, other->options_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata FieldDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FieldDescriptorProto_descriptor_; + metadata.reflection = FieldDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FieldDescriptorProto + +// optional string name = 1; +bool FieldDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void FieldDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void FieldDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void FieldDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& FieldDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name) +} + void FieldDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.name) +} + void FieldDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.name) +} + ::std::string* FieldDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FieldDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name) +} + +// optional int32 number = 3; +bool FieldDescriptorProto::has_number() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void FieldDescriptorProto::set_has_number() { + _has_bits_[0] |= 0x00000002u; +} +void FieldDescriptorProto::clear_has_number() { + _has_bits_[0] &= ~0x00000002u; +} +void FieldDescriptorProto::clear_number() { + number_ = 0; + clear_has_number(); +} + ::google::protobuf::int32 FieldDescriptorProto::number() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number) + return number_; +} + void FieldDescriptorProto::set_number(::google::protobuf::int32 value) { + set_has_number(); + number_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.number) +} + +// optional .google.protobuf.FieldDescriptorProto.Label label = 4; +bool FieldDescriptorProto::has_label() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void FieldDescriptorProto::set_has_label() { + _has_bits_[0] |= 0x00000004u; +} +void FieldDescriptorProto::clear_has_label() { + _has_bits_[0] &= ~0x00000004u; +} +void FieldDescriptorProto::clear_label() { + label_ = 1; + clear_has_label(); +} + ::google::protobuf::FieldDescriptorProto_Label FieldDescriptorProto::label() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.label) + return static_cast< ::google::protobuf::FieldDescriptorProto_Label >(label_); +} + void FieldDescriptorProto::set_label(::google::protobuf::FieldDescriptorProto_Label value) { + assert(::google::protobuf::FieldDescriptorProto_Label_IsValid(value)); + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.label) +} + +// optional .google.protobuf.FieldDescriptorProto.Type type = 5; +bool FieldDescriptorProto::has_type() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void FieldDescriptorProto::set_has_type() { + _has_bits_[0] |= 0x00000008u; +} +void FieldDescriptorProto::clear_has_type() { + _has_bits_[0] &= ~0x00000008u; +} +void FieldDescriptorProto::clear_type() { + type_ = 1; + clear_has_type(); +} + ::google::protobuf::FieldDescriptorProto_Type FieldDescriptorProto::type() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type) + return static_cast< ::google::protobuf::FieldDescriptorProto_Type >(type_); +} + void FieldDescriptorProto::set_type(::google::protobuf::FieldDescriptorProto_Type value) { + assert(::google::protobuf::FieldDescriptorProto_Type_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type) +} + +// optional string type_name = 6; +bool FieldDescriptorProto::has_type_name() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void FieldDescriptorProto::set_has_type_name() { + _has_bits_[0] |= 0x00000010u; +} +void FieldDescriptorProto::clear_has_type_name() { + _has_bits_[0] &= ~0x00000010u; +} +void FieldDescriptorProto::clear_type_name() { + type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type_name(); +} + const ::std::string& FieldDescriptorProto::type_name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name) + return type_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_type_name(const ::std::string& value) { + set_has_type_name(); + type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type_name) +} + void FieldDescriptorProto::set_type_name(const char* value) { + set_has_type_name(); + type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.type_name) +} + void FieldDescriptorProto::set_type_name(const char* value, size_t size) { + set_has_type_name(); + type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.type_name) +} + ::std::string* FieldDescriptorProto::mutable_type_name() { + set_has_type_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.type_name) + return type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FieldDescriptorProto::release_type_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name) + clear_has_type_name(); + return type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) { + if (type_name != NULL) { + set_has_type_name(); + } else { + clear_has_type_name(); + } + type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name) +} + +// optional string extendee = 2; +bool FieldDescriptorProto::has_extendee() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void FieldDescriptorProto::set_has_extendee() { + _has_bits_[0] |= 0x00000020u; +} +void FieldDescriptorProto::clear_has_extendee() { + _has_bits_[0] &= ~0x00000020u; +} +void FieldDescriptorProto::clear_extendee() { + extendee_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_extendee(); +} + const ::std::string& FieldDescriptorProto::extendee() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee) + return extendee_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_extendee(const ::std::string& value) { + set_has_extendee(); + extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee) +} + void FieldDescriptorProto::set_extendee(const char* value) { + set_has_extendee(); + extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.extendee) +} + void FieldDescriptorProto::set_extendee(const char* value, size_t size) { + set_has_extendee(); + extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.extendee) +} + ::std::string* FieldDescriptorProto::mutable_extendee() { + set_has_extendee(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.extendee) + return extendee_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FieldDescriptorProto::release_extendee() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee) + clear_has_extendee(); + return extendee_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) { + if (extendee != NULL) { + set_has_extendee(); + } else { + clear_has_extendee(); + } + extendee_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee) +} + +// optional string default_value = 7; +bool FieldDescriptorProto::has_default_value() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void FieldDescriptorProto::set_has_default_value() { + _has_bits_[0] |= 0x00000040u; +} +void FieldDescriptorProto::clear_has_default_value() { + _has_bits_[0] &= ~0x00000040u; +} +void FieldDescriptorProto::clear_default_value() { + default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_default_value(); +} + const ::std::string& FieldDescriptorProto::default_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value) + return default_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_default_value(const ::std::string& value) { + set_has_default_value(); + default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.default_value) +} + void FieldDescriptorProto::set_default_value(const char* value) { + set_has_default_value(); + default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.default_value) +} + void FieldDescriptorProto::set_default_value(const char* value, size_t size) { + set_has_default_value(); + default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.default_value) +} + ::std::string* FieldDescriptorProto::mutable_default_value() { + set_has_default_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.default_value) + return default_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FieldDescriptorProto::release_default_value() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value) + clear_has_default_value(); + return default_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) { + if (default_value != NULL) { + set_has_default_value(); + } else { + clear_has_default_value(); + } + default_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value) +} + +// optional int32 oneof_index = 9; +bool FieldDescriptorProto::has_oneof_index() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void FieldDescriptorProto::set_has_oneof_index() { + _has_bits_[0] |= 0x00000080u; +} +void FieldDescriptorProto::clear_has_oneof_index() { + _has_bits_[0] &= ~0x00000080u; +} +void FieldDescriptorProto::clear_oneof_index() { + oneof_index_ = 0; + clear_has_oneof_index(); +} + ::google::protobuf::int32 FieldDescriptorProto::oneof_index() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index) + return oneof_index_; +} + void FieldDescriptorProto::set_oneof_index(::google::protobuf::int32 value) { + set_has_oneof_index(); + oneof_index_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.oneof_index) +} + +// optional string json_name = 10; +bool FieldDescriptorProto::has_json_name() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void FieldDescriptorProto::set_has_json_name() { + _has_bits_[0] |= 0x00000100u; +} +void FieldDescriptorProto::clear_has_json_name() { + _has_bits_[0] &= ~0x00000100u; +} +void FieldDescriptorProto::clear_json_name() { + json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_json_name(); +} + const ::std::string& FieldDescriptorProto::json_name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name) + return json_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_json_name(const ::std::string& value) { + set_has_json_name(); + json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.json_name) +} + void FieldDescriptorProto::set_json_name(const char* value) { + set_has_json_name(); + json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.json_name) +} + void FieldDescriptorProto::set_json_name(const char* value, size_t size) { + set_has_json_name(); + json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.json_name) +} + ::std::string* FieldDescriptorProto::mutable_json_name() { + set_has_json_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.json_name) + return json_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FieldDescriptorProto::release_json_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name) + clear_has_json_name(); + return json_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) { + if (json_name != NULL) { + set_has_json_name(); + } else { + clear_has_json_name(); + } + json_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name) +} + +// optional .google.protobuf.FieldOptions options = 8; +bool FieldDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void FieldDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000200u; +} +void FieldDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000200u; +} +void FieldDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::FieldOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::FieldOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options) + return options_; +} +::google::protobuf::FieldOptions* FieldDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options) + clear_has_options(); + ::google::protobuf::FieldOptions* temp = options_; + options_ = NULL; + return temp; +} +void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int OneofDescriptorProto::kNameFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +OneofDescriptorProto::OneofDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.OneofDescriptorProto) +} + +void OneofDescriptorProto::InitAsDefaultInstance() { +} + +OneofDescriptorProto::OneofDescriptorProto(const OneofDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.OneofDescriptorProto) +} + +void OneofDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +OneofDescriptorProto::~OneofDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.OneofDescriptorProto) + SharedDtor(); +} + +void OneofDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void OneofDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* OneofDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return OneofDescriptorProto_descriptor_; +} + +const OneofDescriptorProto& OneofDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +OneofDescriptorProto* OneofDescriptorProto::default_instance_ = NULL; + +OneofDescriptorProto* OneofDescriptorProto::New(::google::protobuf::Arena* arena) const { + OneofDescriptorProto* n = new OneofDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void OneofDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.OneofDescriptorProto) + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool OneofDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.OneofDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.OneofDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.OneofDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.OneofDescriptorProto) + return false; +#undef DO_ +} + +void OneofDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.OneofDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.OneofDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.OneofDescriptorProto) +} + +::google::protobuf::uint8* OneofDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.OneofDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.OneofDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.OneofDescriptorProto) + return target; +} + +int OneofDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.OneofDescriptorProto) + int total_size = 0; + + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void OneofDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.OneofDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const OneofDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.OneofDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.OneofDescriptorProto) + MergeFrom(*source); + } +} + +void OneofDescriptorProto::MergeFrom(const OneofDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.OneofDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void OneofDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.OneofDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void OneofDescriptorProto::CopyFrom(const OneofDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.OneofDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool OneofDescriptorProto::IsInitialized() const { + + return true; +} + +void OneofDescriptorProto::Swap(OneofDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void OneofDescriptorProto::InternalSwap(OneofDescriptorProto* other) { + name_.Swap(&other->name_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata OneofDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = OneofDescriptorProto_descriptor_; + metadata.reflection = OneofDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// OneofDescriptorProto + +// optional string name = 1; +bool OneofDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void OneofDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void OneofDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void OneofDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& OneofDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void OneofDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name) +} + void OneofDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.OneofDescriptorProto.name) +} + void OneofDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.OneofDescriptorProto.name) +} + ::std::string* OneofDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* OneofDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void OneofDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EnumDescriptorProto::kNameFieldNumber; +const int EnumDescriptorProto::kValueFieldNumber; +const int EnumDescriptorProto::kOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EnumDescriptorProto::EnumDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.EnumDescriptorProto) +} + +void EnumDescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::EnumOptions*>(&::google::protobuf::EnumOptions::default_instance()); +} + +EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumDescriptorProto) +} + +void EnumDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EnumDescriptorProto::~EnumDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.EnumDescriptorProto) + SharedDtor(); +} + +void EnumDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + } +} + +void EnumDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EnumDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EnumDescriptorProto_descriptor_; +} + +const EnumDescriptorProto& EnumDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +EnumDescriptorProto* EnumDescriptorProto::default_instance_ = NULL; + +EnumDescriptorProto* EnumDescriptorProto::New(::google::protobuf::Arena* arena) const { + EnumDescriptorProto* n = new EnumDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void EnumDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.EnumDescriptorProto) + if (_has_bits_[0 / 32] & 5u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::EnumOptions::Clear(); + } + } + value_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool EnumDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.EnumDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.EnumDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_value; + break; + } + + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + case 2: { + if (tag == 18) { + parse_value: + DO_(input->IncrementRecursionDepth()); + parse_loop_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_value())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_value; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(26)) goto parse_options; + break; + } + + // optional .google.protobuf.EnumOptions options = 3; + case 3: { + if (tag == 26) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.EnumDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.EnumDescriptorProto) + return false; +#undef DO_ +} + +void EnumDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.EnumDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.EnumDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + for (unsigned int i = 0, n = this->value_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->value(i), output); + } + + // optional .google.protobuf.EnumOptions options = 3; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->options_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.EnumDescriptorProto) +} + +::google::protobuf::uint8* EnumDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.EnumDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + for (unsigned int i = 0, n = this->value_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->value(i), target); + } + + // optional .google.protobuf.EnumOptions options = 3; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, *this->options_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumDescriptorProto) + return target; +} + +int EnumDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumDescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 5u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .google.protobuf.EnumOptions options = 3; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + } + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + total_size += 1 * this->value_size(); + for (int i = 0; i < this->value_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->value(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EnumDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const EnumDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumDescriptorProto) + MergeFrom(*source); + } +} + +void EnumDescriptorProto::MergeFrom(const EnumDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + value_.MergeFrom(from.value_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_options()) { + mutable_options()->::google::protobuf::EnumOptions::MergeFrom(from.options()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void EnumDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EnumDescriptorProto::CopyFrom(const EnumDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EnumDescriptorProto::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->value())) return false; + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void EnumDescriptorProto::Swap(EnumDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void EnumDescriptorProto::InternalSwap(EnumDescriptorProto* other) { + name_.Swap(&other->name_); + value_.UnsafeArenaSwap(&other->value_); + std::swap(options_, other->options_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata EnumDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EnumDescriptorProto_descriptor_; + metadata.reflection = EnumDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EnumDescriptorProto + +// optional string name = 1; +bool EnumDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void EnumDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void EnumDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void EnumDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& EnumDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void EnumDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name) +} + void EnumDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.name) +} + void EnumDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.name) +} + ::std::string* EnumDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* EnumDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void EnumDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name) +} + +// repeated .google.protobuf.EnumValueDescriptorProto value = 2; +int EnumDescriptorProto::value_size() const { + return value_.size(); +} +void EnumDescriptorProto::clear_value() { + value_.Clear(); +} +const ::google::protobuf::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value) + return value_.Get(index); +} +::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.value) + return value_.Mutable(index); +} +::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::add_value() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.value) + return value_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >* +EnumDescriptorProto::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.value) + return &value_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& +EnumDescriptorProto::value() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.value) + return value_; +} + +// optional .google.protobuf.EnumOptions options = 3; +bool EnumDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void EnumDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000004u; +} +void EnumDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000004u; +} +void EnumDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::EnumOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::EnumOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options) + return options_; +} +::google::protobuf::EnumOptions* EnumDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options) + clear_has_options(); + ::google::protobuf::EnumOptions* temp = options_; + options_ = NULL; + return temp; +} +void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EnumValueDescriptorProto::kNameFieldNumber; +const int EnumValueDescriptorProto::kNumberFieldNumber; +const int EnumValueDescriptorProto::kOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EnumValueDescriptorProto::EnumValueDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.EnumValueDescriptorProto) +} + +void EnumValueDescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::EnumValueOptions*>(&::google::protobuf::EnumValueOptions::default_instance()); +} + +EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValueDescriptorProto) +} + +void EnumValueDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + number_ = 0; + options_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EnumValueDescriptorProto::~EnumValueDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.EnumValueDescriptorProto) + SharedDtor(); +} + +void EnumValueDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + } +} + +void EnumValueDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EnumValueDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EnumValueDescriptorProto_descriptor_; +} + +const EnumValueDescriptorProto& EnumValueDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +EnumValueDescriptorProto* EnumValueDescriptorProto::default_instance_ = NULL; + +EnumValueDescriptorProto* EnumValueDescriptorProto::New(::google::protobuf::Arena* arena) const { + EnumValueDescriptorProto* n = new EnumValueDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void EnumValueDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValueDescriptorProto) + if (_has_bits_[0 / 32] & 7u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + number_ = 0; + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::EnumValueOptions::Clear(); + } + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool EnumValueDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.EnumValueDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.EnumValueDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_number; + break; + } + + // optional int32 number = 2; + case 2: { + if (tag == 16) { + parse_number: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &number_))); + set_has_number(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_options; + break; + } + + // optional .google.protobuf.EnumValueOptions options = 3; + case 3: { + if (tag == 26) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.EnumValueDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.EnumValueDescriptorProto) + return false; +#undef DO_ +} + +void EnumValueDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValueDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.EnumValueDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional int32 number = 2; + if (has_number()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->number(), output); + } + + // optional .google.protobuf.EnumValueOptions options = 3; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->options_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValueDescriptorProto) +} + +::google::protobuf::uint8* EnumValueDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.EnumValueDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional int32 number = 2; + if (has_number()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->number(), target); + } + + // optional .google.protobuf.EnumValueOptions options = 3; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, *this->options_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValueDescriptorProto) + return target; +} + +int EnumValueDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumValueDescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 7u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional int32 number = 2; + if (has_number()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->number()); + } + + // optional .google.protobuf.EnumValueOptions options = 3; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EnumValueDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumValueDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const EnumValueDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValueDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumValueDescriptorProto) + MergeFrom(*source); + } +} + +void EnumValueDescriptorProto::MergeFrom(const EnumValueDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValueDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_number()) { + set_number(from.number()); + } + if (from.has_options()) { + mutable_options()->::google::protobuf::EnumValueOptions::MergeFrom(from.options()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void EnumValueDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumValueDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EnumValueDescriptorProto::CopyFrom(const EnumValueDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumValueDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EnumValueDescriptorProto::IsInitialized() const { + + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void EnumValueDescriptorProto::Swap(EnumValueDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void EnumValueDescriptorProto::InternalSwap(EnumValueDescriptorProto* other) { + name_.Swap(&other->name_); + std::swap(number_, other->number_); + std::swap(options_, other->options_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata EnumValueDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EnumValueDescriptorProto_descriptor_; + metadata.reflection = EnumValueDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EnumValueDescriptorProto + +// optional string name = 1; +bool EnumValueDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void EnumValueDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void EnumValueDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void EnumValueDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& EnumValueDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void EnumValueDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name) +} + void EnumValueDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValueDescriptorProto.name) +} + void EnumValueDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValueDescriptorProto.name) +} + ::std::string* EnumValueDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* EnumValueDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name) +} + +// optional int32 number = 2; +bool EnumValueDescriptorProto::has_number() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void EnumValueDescriptorProto::set_has_number() { + _has_bits_[0] |= 0x00000002u; +} +void EnumValueDescriptorProto::clear_has_number() { + _has_bits_[0] &= ~0x00000002u; +} +void EnumValueDescriptorProto::clear_number() { + number_ = 0; + clear_has_number(); +} + ::google::protobuf::int32 EnumValueDescriptorProto::number() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number) + return number_; +} + void EnumValueDescriptorProto::set_number(::google::protobuf::int32 value) { + set_has_number(); + number_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.number) +} + +// optional .google.protobuf.EnumValueOptions options = 3; +bool EnumValueDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void EnumValueDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000004u; +} +void EnumValueDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000004u; +} +void EnumValueDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::EnumValueOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::EnumValueOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options) + return options_; +} +::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options) + clear_has_options(); + ::google::protobuf::EnumValueOptions* temp = options_; + options_ = NULL; + return temp; +} +void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ServiceDescriptorProto::kNameFieldNumber; +const int ServiceDescriptorProto::kMethodFieldNumber; +const int ServiceDescriptorProto::kOptionsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ServiceDescriptorProto::ServiceDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.ServiceDescriptorProto) +} + +void ServiceDescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::ServiceOptions*>(&::google::protobuf::ServiceOptions::default_instance()); +} + +ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.ServiceDescriptorProto) +} + +void ServiceDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ServiceDescriptorProto::~ServiceDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.ServiceDescriptorProto) + SharedDtor(); +} + +void ServiceDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + } +} + +void ServiceDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ServiceDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ServiceDescriptorProto_descriptor_; +} + +const ServiceDescriptorProto& ServiceDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +ServiceDescriptorProto* ServiceDescriptorProto::default_instance_ = NULL; + +ServiceDescriptorProto* ServiceDescriptorProto::New(::google::protobuf::Arena* arena) const { + ServiceDescriptorProto* n = new ServiceDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ServiceDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.ServiceDescriptorProto) + if (_has_bits_[0 / 32] & 5u) { + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::ServiceOptions::Clear(); + } + } + method_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ServiceDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.ServiceDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.ServiceDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_method; + break; + } + + // repeated .google.protobuf.MethodDescriptorProto method = 2; + case 2: { + if (tag == 18) { + parse_method: + DO_(input->IncrementRecursionDepth()); + parse_loop_method: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_method())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_method; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(26)) goto parse_options; + break; + } + + // optional .google.protobuf.ServiceOptions options = 3; + case 3: { + if (tag == 26) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.ServiceDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.ServiceDescriptorProto) + return false; +#undef DO_ +} + +void ServiceDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.ServiceDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.ServiceDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // repeated .google.protobuf.MethodDescriptorProto method = 2; + for (unsigned int i = 0, n = this->method_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->method(i), output); + } + + // optional .google.protobuf.ServiceOptions options = 3; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 3, *this->options_, output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.ServiceDescriptorProto) +} + +::google::protobuf::uint8* ServiceDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.ServiceDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // repeated .google.protobuf.MethodDescriptorProto method = 2; + for (unsigned int i = 0, n = this->method_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->method(i), target); + } + + // optional .google.protobuf.ServiceOptions options = 3; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 3, *this->options_, target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ServiceDescriptorProto) + return target; +} + +int ServiceDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.ServiceDescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 5u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional .google.protobuf.ServiceOptions options = 3; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + } + // repeated .google.protobuf.MethodDescriptorProto method = 2; + total_size += 1 * this->method_size(); + for (int i = 0; i < this->method_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->method(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ServiceDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ServiceDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ServiceDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ServiceDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ServiceDescriptorProto) + MergeFrom(*source); + } +} + +void ServiceDescriptorProto::MergeFrom(const ServiceDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ServiceDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + method_.MergeFrom(from.method_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_options()) { + mutable_options()->::google::protobuf::ServiceOptions::MergeFrom(from.options()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ServiceDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ServiceDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ServiceDescriptorProto::CopyFrom(const ServiceDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ServiceDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ServiceDescriptorProto::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->method())) return false; + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void ServiceDescriptorProto::Swap(ServiceDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void ServiceDescriptorProto::InternalSwap(ServiceDescriptorProto* other) { + name_.Swap(&other->name_); + method_.UnsafeArenaSwap(&other->method_); + std::swap(options_, other->options_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata ServiceDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ServiceDescriptorProto_descriptor_; + metadata.reflection = ServiceDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ServiceDescriptorProto + +// optional string name = 1; +bool ServiceDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ServiceDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void ServiceDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void ServiceDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& ServiceDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServiceDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name) +} + void ServiceDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.ServiceDescriptorProto.name) +} + void ServiceDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.ServiceDescriptorProto.name) +} + ::std::string* ServiceDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* ServiceDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void ServiceDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name) +} + +// repeated .google.protobuf.MethodDescriptorProto method = 2; +int ServiceDescriptorProto::method_size() const { + return method_.size(); +} +void ServiceDescriptorProto::clear_method() { + method_.Clear(); +} +const ::google::protobuf::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method) + return method_.Get(index); +} +::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.method) + return method_.Mutable(index); +} +::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::add_method() { + // @@protoc_insertion_point(field_add:google.protobuf.ServiceDescriptorProto.method) + return method_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >* +ServiceDescriptorProto::mutable_method() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceDescriptorProto.method) + return &method_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >& +ServiceDescriptorProto::method() const { + // @@protoc_insertion_point(field_list:google.protobuf.ServiceDescriptorProto.method) + return method_; +} + +// optional .google.protobuf.ServiceOptions options = 3; +bool ServiceDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void ServiceDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000004u; +} +void ServiceDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000004u; +} +void ServiceDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::ServiceOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::ServiceOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options) + return options_; +} +::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options) + clear_has_options(); + ::google::protobuf::ServiceOptions* temp = options_; + options_ = NULL; + return temp; +} +void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MethodDescriptorProto::kNameFieldNumber; +const int MethodDescriptorProto::kInputTypeFieldNumber; +const int MethodDescriptorProto::kOutputTypeFieldNumber; +const int MethodDescriptorProto::kOptionsFieldNumber; +const int MethodDescriptorProto::kClientStreamingFieldNumber; +const int MethodDescriptorProto::kServerStreamingFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MethodDescriptorProto::MethodDescriptorProto() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.MethodDescriptorProto) +} + +void MethodDescriptorProto::InitAsDefaultInstance() { + options_ = const_cast< ::google::protobuf::MethodOptions*>(&::google::protobuf::MethodOptions::default_instance()); +} + +MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.MethodDescriptorProto) +} + +void MethodDescriptorProto::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + input_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_type_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + options_ = NULL; + client_streaming_ = false; + server_streaming_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MethodDescriptorProto::~MethodDescriptorProto() { + // @@protoc_insertion_point(destructor:google.protobuf.MethodDescriptorProto) + SharedDtor(); +} + +void MethodDescriptorProto::SharedDtor() { + name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + input_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + output_type_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + delete options_; + } +} + +void MethodDescriptorProto::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MethodDescriptorProto::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MethodDescriptorProto_descriptor_; +} + +const MethodDescriptorProto& MethodDescriptorProto::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +MethodDescriptorProto* MethodDescriptorProto::default_instance_ = NULL; + +MethodDescriptorProto* MethodDescriptorProto::New(::google::protobuf::Arena* arena) const { + MethodDescriptorProto* n = new MethodDescriptorProto; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void MethodDescriptorProto::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.MethodDescriptorProto) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(MethodDescriptorProto, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 63u) { + ZR_(client_streaming_, server_streaming_); + if (has_name()) { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_input_type()) { + input_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_output_type()) { + output_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_options()) { + if (options_ != NULL) options_->::google::protobuf::MethodOptions::Clear(); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool MethodDescriptorProto::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.MethodDescriptorProto) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string name = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.MethodDescriptorProto.name"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_input_type; + break; + } + + // optional string input_type = 2; + case 2: { + if (tag == 18) { + parse_input_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_input_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->input_type().data(), this->input_type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.MethodDescriptorProto.input_type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_output_type; + break; + } + + // optional string output_type = 3; + case 3: { + if (tag == 26) { + parse_output_type: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_output_type())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_type().data(), this->output_type().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.MethodDescriptorProto.output_type"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_options; + break; + } + + // optional .google.protobuf.MethodOptions options = 4; + case 4: { + if (tag == 34) { + parse_options: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( + input, mutable_options())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_client_streaming; + break; + } + + // optional bool client_streaming = 5 [default = false]; + case 5: { + if (tag == 40) { + parse_client_streaming: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &client_streaming_))); + set_has_client_streaming(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_server_streaming; + break; + } + + // optional bool server_streaming = 6 [default = false]; + case 6: { + if (tag == 48) { + parse_server_streaming: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &server_streaming_))); + set_has_server_streaming(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.MethodDescriptorProto) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.MethodDescriptorProto) + return false; +#undef DO_ +} + +void MethodDescriptorProto::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.MethodDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.MethodDescriptorProto.name"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name(), output); + } + + // optional string input_type = 2; + if (has_input_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->input_type().data(), this->input_type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.MethodDescriptorProto.input_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->input_type(), output); + } + + // optional string output_type = 3; + if (has_output_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_type().data(), this->output_type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.MethodDescriptorProto.output_type"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->output_type(), output); + } + + // optional .google.protobuf.MethodOptions options = 4; + if (has_options()) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 4, *this->options_, output); + } + + // optional bool client_streaming = 5 [default = false]; + if (has_client_streaming()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->client_streaming(), output); + } + + // optional bool server_streaming = 6 [default = false]; + if (has_server_streaming()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->server_streaming(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.MethodDescriptorProto) +} + +::google::protobuf::uint8* MethodDescriptorProto::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodDescriptorProto) + // optional string name = 1; + if (has_name()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name().data(), this->name().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.MethodDescriptorProto.name"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name(), target); + } + + // optional string input_type = 2; + if (has_input_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->input_type().data(), this->input_type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.MethodDescriptorProto.input_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->input_type(), target); + } + + // optional string output_type = 3; + if (has_output_type()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->output_type().data(), this->output_type().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.MethodDescriptorProto.output_type"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->output_type(), target); + } + + // optional .google.protobuf.MethodOptions options = 4; + if (has_options()) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 4, *this->options_, target); + } + + // optional bool client_streaming = 5 [default = false]; + if (has_client_streaming()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->client_streaming(), target); + } + + // optional bool server_streaming = 6 [default = false]; + if (has_server_streaming()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->server_streaming(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MethodDescriptorProto) + return target; +} + +int MethodDescriptorProto::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.MethodDescriptorProto) + int total_size = 0; + + if (_has_bits_[0 / 32] & 63u) { + // optional string name = 1; + if (has_name()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name()); + } + + // optional string input_type = 2; + if (has_input_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->input_type()); + } + + // optional string output_type = 3; + if (has_output_type()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->output_type()); + } + + // optional .google.protobuf.MethodOptions options = 4; + if (has_options()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + *this->options_); + } + + // optional bool client_streaming = 5 [default = false]; + if (has_client_streaming()) { + total_size += 1 + 1; + } + + // optional bool server_streaming = 6 [default = false]; + if (has_server_streaming()) { + total_size += 1 + 1; + } + + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MethodDescriptorProto::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.MethodDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const MethodDescriptorProto* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MethodDescriptorProto) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.MethodDescriptorProto) + MergeFrom(*source); + } +} + +void MethodDescriptorProto::MergeFrom(const MethodDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.MethodDescriptorProto) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name()) { + set_has_name(); + name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_); + } + if (from.has_input_type()) { + set_has_input_type(); + input_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.input_type_); + } + if (from.has_output_type()) { + set_has_output_type(); + output_type_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.output_type_); + } + if (from.has_options()) { + mutable_options()->::google::protobuf::MethodOptions::MergeFrom(from.options()); + } + if (from.has_client_streaming()) { + set_client_streaming(from.client_streaming()); + } + if (from.has_server_streaming()) { + set_server_streaming(from.server_streaming()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void MethodDescriptorProto::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.MethodDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MethodDescriptorProto::CopyFrom(const MethodDescriptorProto& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.MethodDescriptorProto) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MethodDescriptorProto::IsInitialized() const { + + if (has_options()) { + if (!this->options_->IsInitialized()) return false; + } + return true; +} + +void MethodDescriptorProto::Swap(MethodDescriptorProto* other) { + if (other == this) return; + InternalSwap(other); +} +void MethodDescriptorProto::InternalSwap(MethodDescriptorProto* other) { + name_.Swap(&other->name_); + input_type_.Swap(&other->input_type_); + output_type_.Swap(&other->output_type_); + std::swap(options_, other->options_); + std::swap(client_streaming_, other->client_streaming_); + std::swap(server_streaming_, other->server_streaming_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata MethodDescriptorProto::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MethodDescriptorProto_descriptor_; + metadata.reflection = MethodDescriptorProto_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// MethodDescriptorProto + +// optional string name = 1; +bool MethodDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void MethodDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +void MethodDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +void MethodDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} + const ::std::string& MethodDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void MethodDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name) +} + void MethodDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.name) +} + void MethodDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.name) +} + ::std::string* MethodDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* MethodDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void MethodDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name) +} + +// optional string input_type = 2; +bool MethodDescriptorProto::has_input_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void MethodDescriptorProto::set_has_input_type() { + _has_bits_[0] |= 0x00000002u; +} +void MethodDescriptorProto::clear_has_input_type() { + _has_bits_[0] &= ~0x00000002u; +} +void MethodDescriptorProto::clear_input_type() { + input_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_input_type(); +} + const ::std::string& MethodDescriptorProto::input_type() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type) + return input_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void MethodDescriptorProto::set_input_type(const ::std::string& value) { + set_has_input_type(); + input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.input_type) +} + void MethodDescriptorProto::set_input_type(const char* value) { + set_has_input_type(); + input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.input_type) +} + void MethodDescriptorProto::set_input_type(const char* value, size_t size) { + set_has_input_type(); + input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.input_type) +} + ::std::string* MethodDescriptorProto::mutable_input_type() { + set_has_input_type(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.input_type) + return input_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* MethodDescriptorProto::release_input_type() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type) + clear_has_input_type(); + return input_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) { + if (input_type != NULL) { + set_has_input_type(); + } else { + clear_has_input_type(); + } + input_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type) +} + +// optional string output_type = 3; +bool MethodDescriptorProto::has_output_type() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void MethodDescriptorProto::set_has_output_type() { + _has_bits_[0] |= 0x00000004u; +} +void MethodDescriptorProto::clear_has_output_type() { + _has_bits_[0] &= ~0x00000004u; +} +void MethodDescriptorProto::clear_output_type() { + output_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_type(); +} + const ::std::string& MethodDescriptorProto::output_type() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type) + return output_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void MethodDescriptorProto::set_output_type(const ::std::string& value) { + set_has_output_type(); + output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.output_type) +} + void MethodDescriptorProto::set_output_type(const char* value) { + set_has_output_type(); + output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.output_type) +} + void MethodDescriptorProto::set_output_type(const char* value, size_t size) { + set_has_output_type(); + output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.output_type) +} + ::std::string* MethodDescriptorProto::mutable_output_type() { + set_has_output_type(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.output_type) + return output_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* MethodDescriptorProto::release_output_type() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type) + clear_has_output_type(); + return output_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) { + if (output_type != NULL) { + set_has_output_type(); + } else { + clear_has_output_type(); + } + output_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type) +} + +// optional .google.protobuf.MethodOptions options = 4; +bool MethodDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void MethodDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000008u; +} +void MethodDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000008u; +} +void MethodDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::MethodOptions::Clear(); + clear_has_options(); +} +const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::MethodOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options) + return options_; +} +::google::protobuf::MethodOptions* MethodDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options) + clear_has_options(); + ::google::protobuf::MethodOptions* temp = options_; + options_ = NULL; + return temp; +} +void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options) +} + +// optional bool client_streaming = 5 [default = false]; +bool MethodDescriptorProto::has_client_streaming() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void MethodDescriptorProto::set_has_client_streaming() { + _has_bits_[0] |= 0x00000010u; +} +void MethodDescriptorProto::clear_has_client_streaming() { + _has_bits_[0] &= ~0x00000010u; +} +void MethodDescriptorProto::clear_client_streaming() { + client_streaming_ = false; + clear_has_client_streaming(); +} + bool MethodDescriptorProto::client_streaming() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.client_streaming) + return client_streaming_; +} + void MethodDescriptorProto::set_client_streaming(bool value) { + set_has_client_streaming(); + client_streaming_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.client_streaming) +} + +// optional bool server_streaming = 6 [default = false]; +bool MethodDescriptorProto::has_server_streaming() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void MethodDescriptorProto::set_has_server_streaming() { + _has_bits_[0] |= 0x00000020u; +} +void MethodDescriptorProto::clear_has_server_streaming() { + _has_bits_[0] &= ~0x00000020u; +} +void MethodDescriptorProto::clear_server_streaming() { + server_streaming_ = false; + clear_has_server_streaming(); +} + bool MethodDescriptorProto::server_streaming() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.server_streaming) + return server_streaming_; +} + void MethodDescriptorProto::set_server_streaming(bool value) { + set_has_server_streaming(); + server_streaming_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.server_streaming) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FileOptions_OptimizeMode_descriptor_; +} +bool FileOptions_OptimizeMode_IsValid(int value) { + switch(value) { + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FileOptions_OptimizeMode FileOptions::SPEED; +const FileOptions_OptimizeMode FileOptions::CODE_SIZE; +const FileOptions_OptimizeMode FileOptions::LITE_RUNTIME; +const FileOptions_OptimizeMode FileOptions::OptimizeMode_MIN; +const FileOptions_OptimizeMode FileOptions::OptimizeMode_MAX; +const int FileOptions::OptimizeMode_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FileOptions::kJavaPackageFieldNumber; +const int FileOptions::kJavaOuterClassnameFieldNumber; +const int FileOptions::kJavaMultipleFilesFieldNumber; +const int FileOptions::kJavaGenerateEqualsAndHashFieldNumber; +const int FileOptions::kJavaStringCheckUtf8FieldNumber; +const int FileOptions::kOptimizeForFieldNumber; +const int FileOptions::kGoPackageFieldNumber; +const int FileOptions::kCcGenericServicesFieldNumber; +const int FileOptions::kJavaGenericServicesFieldNumber; +const int FileOptions::kPyGenericServicesFieldNumber; +const int FileOptions::kDeprecatedFieldNumber; +const int FileOptions::kCcEnableArenasFieldNumber; +const int FileOptions::kObjcClassPrefixFieldNumber; +const int FileOptions::kCsharpNamespaceFieldNumber; +const int FileOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FileOptions::FileOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FileOptions) +} + +void FileOptions::InitAsDefaultInstance() { +} + +FileOptions::FileOptions(const FileOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FileOptions) +} + +void FileOptions::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + java_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + java_outer_classname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + java_multiple_files_ = false; + java_generate_equals_and_hash_ = false; + java_string_check_utf8_ = false; + optimize_for_ = 1; + go_package_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + cc_generic_services_ = false; + java_generic_services_ = false; + py_generic_services_ = false; + deprecated_ = false; + cc_enable_arenas_ = false; + objc_class_prefix_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + csharp_namespace_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FileOptions::~FileOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.FileOptions) + SharedDtor(); +} + +void FileOptions::SharedDtor() { + java_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + java_outer_classname_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + go_package_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + objc_class_prefix_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + csharp_namespace_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void FileOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FileOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FileOptions_descriptor_; +} + +const FileOptions& FileOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +FileOptions* FileOptions::default_instance_ = NULL; + +FileOptions* FileOptions::New(::google::protobuf::Arena* arena) const { + FileOptions* n = new FileOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FileOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FileOptions) + _extensions_.Clear(); +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(FileOptions, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 255u) { + ZR_(java_multiple_files_, cc_generic_services_); + if (has_java_package()) { + java_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_java_outer_classname()) { + java_outer_classname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + optimize_for_ = 1; + if (has_go_package()) { + go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + if (_has_bits_[8 / 32] & 16128u) { + ZR_(java_generic_services_, cc_enable_arenas_); + if (has_objc_class_prefix()) { + objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_csharp_namespace()) { + csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FileOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FileOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional string java_package = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_java_package())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->java_package().data(), this->java_package().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.java_package"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_java_outer_classname; + break; + } + + // optional string java_outer_classname = 8; + case 8: { + if (tag == 66) { + parse_java_outer_classname: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_java_outer_classname())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->java_outer_classname().data(), this->java_outer_classname().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.java_outer_classname"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(72)) goto parse_optimize_for; + break; + } + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + case 9: { + if (tag == 72) { + parse_optimize_for: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FileOptions_OptimizeMode_IsValid(value)) { + set_optimize_for(static_cast< ::google::protobuf::FileOptions_OptimizeMode >(value)); + } else { + mutable_unknown_fields()->AddVarint(9, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_java_multiple_files; + break; + } + + // optional bool java_multiple_files = 10 [default = false]; + case 10: { + if (tag == 80) { + parse_java_multiple_files: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &java_multiple_files_))); + set_has_java_multiple_files(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(90)) goto parse_go_package; + break; + } + + // optional string go_package = 11; + case 11: { + if (tag == 90) { + parse_go_package: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_go_package())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->go_package().data(), this->go_package().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.go_package"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(128)) goto parse_cc_generic_services; + break; + } + + // optional bool cc_generic_services = 16 [default = false]; + case 16: { + if (tag == 128) { + parse_cc_generic_services: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cc_generic_services_))); + set_has_cc_generic_services(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(136)) goto parse_java_generic_services; + break; + } + + // optional bool java_generic_services = 17 [default = false]; + case 17: { + if (tag == 136) { + parse_java_generic_services: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &java_generic_services_))); + set_has_java_generic_services(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(144)) goto parse_py_generic_services; + break; + } + + // optional bool py_generic_services = 18 [default = false]; + case 18: { + if (tag == 144) { + parse_py_generic_services: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &py_generic_services_))); + set_has_py_generic_services(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(160)) goto parse_java_generate_equals_and_hash; + break; + } + + // optional bool java_generate_equals_and_hash = 20 [default = false]; + case 20: { + if (tag == 160) { + parse_java_generate_equals_and_hash: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &java_generate_equals_and_hash_))); + set_has_java_generate_equals_and_hash(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(184)) goto parse_deprecated; + break; + } + + // optional bool deprecated = 23 [default = false]; + case 23: { + if (tag == 184) { + parse_deprecated: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(216)) goto parse_java_string_check_utf8; + break; + } + + // optional bool java_string_check_utf8 = 27 [default = false]; + case 27: { + if (tag == 216) { + parse_java_string_check_utf8: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &java_string_check_utf8_))); + set_has_java_string_check_utf8(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(248)) goto parse_cc_enable_arenas; + break; + } + + // optional bool cc_enable_arenas = 31 [default = false]; + case 31: { + if (tag == 248) { + parse_cc_enable_arenas: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &cc_enable_arenas_))); + set_has_cc_enable_arenas(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(290)) goto parse_objc_class_prefix; + break; + } + + // optional string objc_class_prefix = 36; + case 36: { + if (tag == 290) { + parse_objc_class_prefix: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_objc_class_prefix())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->objc_class_prefix().data(), this->objc_class_prefix().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.objc_class_prefix"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(298)) goto parse_csharp_namespace; + break; + } + + // optional string csharp_namespace = 37; + case 37: { + if (tag == 298) { + parse_csharp_namespace: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_csharp_namespace())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->csharp_namespace().data(), this->csharp_namespace().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.FileOptions.csharp_namespace"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FileOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FileOptions) + return false; +#undef DO_ +} + +void FileOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FileOptions) + // optional string java_package = 1; + if (has_java_package()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->java_package().data(), this->java_package().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.java_package"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->java_package(), output); + } + + // optional string java_outer_classname = 8; + if (has_java_outer_classname()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->java_outer_classname().data(), this->java_outer_classname().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.java_outer_classname"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 8, this->java_outer_classname(), output); + } + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + if (has_optimize_for()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 9, this->optimize_for(), output); + } + + // optional bool java_multiple_files = 10 [default = false]; + if (has_java_multiple_files()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->java_multiple_files(), output); + } + + // optional string go_package = 11; + if (has_go_package()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->go_package().data(), this->go_package().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.go_package"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 11, this->go_package(), output); + } + + // optional bool cc_generic_services = 16 [default = false]; + if (has_cc_generic_services()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(16, this->cc_generic_services(), output); + } + + // optional bool java_generic_services = 17 [default = false]; + if (has_java_generic_services()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(17, this->java_generic_services(), output); + } + + // optional bool py_generic_services = 18 [default = false]; + if (has_py_generic_services()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(18, this->py_generic_services(), output); + } + + // optional bool java_generate_equals_and_hash = 20 [default = false]; + if (has_java_generate_equals_and_hash()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(20, this->java_generate_equals_and_hash(), output); + } + + // optional bool deprecated = 23 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(23, this->deprecated(), output); + } + + // optional bool java_string_check_utf8 = 27 [default = false]; + if (has_java_string_check_utf8()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(27, this->java_string_check_utf8(), output); + } + + // optional bool cc_enable_arenas = 31 [default = false]; + if (has_cc_enable_arenas()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(31, this->cc_enable_arenas(), output); + } + + // optional string objc_class_prefix = 36; + if (has_objc_class_prefix()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->objc_class_prefix().data(), this->objc_class_prefix().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.objc_class_prefix"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 36, this->objc_class_prefix(), output); + } + + // optional string csharp_namespace = 37; + if (has_csharp_namespace()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->csharp_namespace().data(), this->csharp_namespace().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.csharp_namespace"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 37, this->csharp_namespace(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FileOptions) +} + +::google::protobuf::uint8* FileOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FileOptions) + // optional string java_package = 1; + if (has_java_package()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->java_package().data(), this->java_package().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.java_package"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->java_package(), target); + } + + // optional string java_outer_classname = 8; + if (has_java_outer_classname()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->java_outer_classname().data(), this->java_outer_classname().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.java_outer_classname"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 8, this->java_outer_classname(), target); + } + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + if (has_optimize_for()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 9, this->optimize_for(), target); + } + + // optional bool java_multiple_files = 10 [default = false]; + if (has_java_multiple_files()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->java_multiple_files(), target); + } + + // optional string go_package = 11; + if (has_go_package()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->go_package().data(), this->go_package().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.go_package"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 11, this->go_package(), target); + } + + // optional bool cc_generic_services = 16 [default = false]; + if (has_cc_generic_services()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(16, this->cc_generic_services(), target); + } + + // optional bool java_generic_services = 17 [default = false]; + if (has_java_generic_services()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(17, this->java_generic_services(), target); + } + + // optional bool py_generic_services = 18 [default = false]; + if (has_py_generic_services()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(18, this->py_generic_services(), target); + } + + // optional bool java_generate_equals_and_hash = 20 [default = false]; + if (has_java_generate_equals_and_hash()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(20, this->java_generate_equals_and_hash(), target); + } + + // optional bool deprecated = 23 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(23, this->deprecated(), target); + } + + // optional bool java_string_check_utf8 = 27 [default = false]; + if (has_java_string_check_utf8()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(27, this->java_string_check_utf8(), target); + } + + // optional bool cc_enable_arenas = 31 [default = false]; + if (has_cc_enable_arenas()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(31, this->cc_enable_arenas(), target); + } + + // optional string objc_class_prefix = 36; + if (has_objc_class_prefix()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->objc_class_prefix().data(), this->objc_class_prefix().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.objc_class_prefix"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 36, this->objc_class_prefix(), target); + } + + // optional string csharp_namespace = 37; + if (has_csharp_namespace()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->csharp_namespace().data(), this->csharp_namespace().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.FileOptions.csharp_namespace"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 37, this->csharp_namespace(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FileOptions) + return target; +} + +int FileOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FileOptions) + int total_size = 0; + + if (_has_bits_[0 / 32] & 255u) { + // optional string java_package = 1; + if (has_java_package()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->java_package()); + } + + // optional string java_outer_classname = 8; + if (has_java_outer_classname()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->java_outer_classname()); + } + + // optional bool java_multiple_files = 10 [default = false]; + if (has_java_multiple_files()) { + total_size += 1 + 1; + } + + // optional bool java_generate_equals_and_hash = 20 [default = false]; + if (has_java_generate_equals_and_hash()) { + total_size += 2 + 1; + } + + // optional bool java_string_check_utf8 = 27 [default = false]; + if (has_java_string_check_utf8()) { + total_size += 2 + 1; + } + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + if (has_optimize_for()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->optimize_for()); + } + + // optional string go_package = 11; + if (has_go_package()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->go_package()); + } + + // optional bool cc_generic_services = 16 [default = false]; + if (has_cc_generic_services()) { + total_size += 2 + 1; + } + + } + if (_has_bits_[8 / 32] & 16128u) { + // optional bool java_generic_services = 17 [default = false]; + if (has_java_generic_services()) { + total_size += 2 + 1; + } + + // optional bool py_generic_services = 18 [default = false]; + if (has_py_generic_services()) { + total_size += 2 + 1; + } + + // optional bool deprecated = 23 [default = false]; + if (has_deprecated()) { + total_size += 2 + 1; + } + + // optional bool cc_enable_arenas = 31 [default = false]; + if (has_cc_enable_arenas()) { + total_size += 2 + 1; + } + + // optional string objc_class_prefix = 36; + if (has_objc_class_prefix()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->objc_class_prefix()); + } + + // optional string csharp_namespace = 37; + if (has_csharp_namespace()) { + total_size += 2 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->csharp_namespace()); + } + + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FileOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FileOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FileOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FileOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FileOptions) + MergeFrom(*source); + } +} + +void FileOptions::MergeFrom(const FileOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FileOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_java_package()) { + set_has_java_package(); + java_package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_package_); + } + if (from.has_java_outer_classname()) { + set_has_java_outer_classname(); + java_outer_classname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.java_outer_classname_); + } + if (from.has_java_multiple_files()) { + set_java_multiple_files(from.java_multiple_files()); + } + if (from.has_java_generate_equals_and_hash()) { + set_java_generate_equals_and_hash(from.java_generate_equals_and_hash()); + } + if (from.has_java_string_check_utf8()) { + set_java_string_check_utf8(from.java_string_check_utf8()); + } + if (from.has_optimize_for()) { + set_optimize_for(from.optimize_for()); + } + if (from.has_go_package()) { + set_has_go_package(); + go_package_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.go_package_); + } + if (from.has_cc_generic_services()) { + set_cc_generic_services(from.cc_generic_services()); + } + } + if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) { + if (from.has_java_generic_services()) { + set_java_generic_services(from.java_generic_services()); + } + if (from.has_py_generic_services()) { + set_py_generic_services(from.py_generic_services()); + } + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + if (from.has_cc_enable_arenas()) { + set_cc_enable_arenas(from.cc_enable_arenas()); + } + if (from.has_objc_class_prefix()) { + set_has_objc_class_prefix(); + objc_class_prefix_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.objc_class_prefix_); + } + if (from.has_csharp_namespace()) { + set_has_csharp_namespace(); + csharp_namespace_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.csharp_namespace_); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FileOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FileOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FileOptions::CopyFrom(const FileOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FileOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FileOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void FileOptions::Swap(FileOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void FileOptions::InternalSwap(FileOptions* other) { + java_package_.Swap(&other->java_package_); + java_outer_classname_.Swap(&other->java_outer_classname_); + std::swap(java_multiple_files_, other->java_multiple_files_); + std::swap(java_generate_equals_and_hash_, other->java_generate_equals_and_hash_); + std::swap(java_string_check_utf8_, other->java_string_check_utf8_); + std::swap(optimize_for_, other->optimize_for_); + go_package_.Swap(&other->go_package_); + std::swap(cc_generic_services_, other->cc_generic_services_); + std::swap(java_generic_services_, other->java_generic_services_); + std::swap(py_generic_services_, other->py_generic_services_); + std::swap(deprecated_, other->deprecated_); + std::swap(cc_enable_arenas_, other->cc_enable_arenas_); + objc_class_prefix_.Swap(&other->objc_class_prefix_); + csharp_namespace_.Swap(&other->csharp_namespace_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata FileOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FileOptions_descriptor_; + metadata.reflection = FileOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FileOptions + +// optional string java_package = 1; +bool FileOptions::has_java_package() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void FileOptions::set_has_java_package() { + _has_bits_[0] |= 0x00000001u; +} +void FileOptions::clear_has_java_package() { + _has_bits_[0] &= ~0x00000001u; +} +void FileOptions::clear_java_package() { + java_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_java_package(); +} + const ::std::string& FileOptions::java_package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package) + return java_package_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_java_package(const ::std::string& value) { + set_has_java_package(); + java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_package) +} + void FileOptions::set_java_package(const char* value) { + set_has_java_package(); + java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_package) +} + void FileOptions::set_java_package(const char* value, size_t size) { + set_has_java_package(); + java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_package) +} + ::std::string* FileOptions::mutable_java_package() { + set_has_java_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_package) + return java_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileOptions::release_java_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package) + clear_has_java_package(); + return java_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_allocated_java_package(::std::string* java_package) { + if (java_package != NULL) { + set_has_java_package(); + } else { + clear_has_java_package(); + } + java_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package) +} + +// optional string java_outer_classname = 8; +bool FileOptions::has_java_outer_classname() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void FileOptions::set_has_java_outer_classname() { + _has_bits_[0] |= 0x00000002u; +} +void FileOptions::clear_has_java_outer_classname() { + _has_bits_[0] &= ~0x00000002u; +} +void FileOptions::clear_java_outer_classname() { + java_outer_classname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_java_outer_classname(); +} + const ::std::string& FileOptions::java_outer_classname() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname) + return java_outer_classname_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_java_outer_classname(const ::std::string& value) { + set_has_java_outer_classname(); + java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_outer_classname) +} + void FileOptions::set_java_outer_classname(const char* value) { + set_has_java_outer_classname(); + java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_outer_classname) +} + void FileOptions::set_java_outer_classname(const char* value, size_t size) { + set_has_java_outer_classname(); + java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_outer_classname) +} + ::std::string* FileOptions::mutable_java_outer_classname() { + set_has_java_outer_classname(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_outer_classname) + return java_outer_classname_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileOptions::release_java_outer_classname() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname) + clear_has_java_outer_classname(); + return java_outer_classname_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) { + if (java_outer_classname != NULL) { + set_has_java_outer_classname(); + } else { + clear_has_java_outer_classname(); + } + java_outer_classname_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname) +} + +// optional bool java_multiple_files = 10 [default = false]; +bool FileOptions::has_java_multiple_files() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void FileOptions::set_has_java_multiple_files() { + _has_bits_[0] |= 0x00000004u; +} +void FileOptions::clear_has_java_multiple_files() { + _has_bits_[0] &= ~0x00000004u; +} +void FileOptions::clear_java_multiple_files() { + java_multiple_files_ = false; + clear_has_java_multiple_files(); +} + bool FileOptions::java_multiple_files() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files) + return java_multiple_files_; +} + void FileOptions::set_java_multiple_files(bool value) { + set_has_java_multiple_files(); + java_multiple_files_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_multiple_files) +} + +// optional bool java_generate_equals_and_hash = 20 [default = false]; +bool FileOptions::has_java_generate_equals_and_hash() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void FileOptions::set_has_java_generate_equals_and_hash() { + _has_bits_[0] |= 0x00000008u; +} +void FileOptions::clear_has_java_generate_equals_and_hash() { + _has_bits_[0] &= ~0x00000008u; +} +void FileOptions::clear_java_generate_equals_and_hash() { + java_generate_equals_and_hash_ = false; + clear_has_java_generate_equals_and_hash(); +} + bool FileOptions::java_generate_equals_and_hash() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash) + return java_generate_equals_and_hash_; +} + void FileOptions::set_java_generate_equals_and_hash(bool value) { + set_has_java_generate_equals_and_hash(); + java_generate_equals_and_hash_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generate_equals_and_hash) +} + +// optional bool java_string_check_utf8 = 27 [default = false]; +bool FileOptions::has_java_string_check_utf8() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void FileOptions::set_has_java_string_check_utf8() { + _has_bits_[0] |= 0x00000010u; +} +void FileOptions::clear_has_java_string_check_utf8() { + _has_bits_[0] &= ~0x00000010u; +} +void FileOptions::clear_java_string_check_utf8() { + java_string_check_utf8_ = false; + clear_has_java_string_check_utf8(); +} + bool FileOptions::java_string_check_utf8() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8) + return java_string_check_utf8_; +} + void FileOptions::set_java_string_check_utf8(bool value) { + set_has_java_string_check_utf8(); + java_string_check_utf8_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_string_check_utf8) +} + +// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; +bool FileOptions::has_optimize_for() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void FileOptions::set_has_optimize_for() { + _has_bits_[0] |= 0x00000020u; +} +void FileOptions::clear_has_optimize_for() { + _has_bits_[0] &= ~0x00000020u; +} +void FileOptions::clear_optimize_for() { + optimize_for_ = 1; + clear_has_optimize_for(); +} + ::google::protobuf::FileOptions_OptimizeMode FileOptions::optimize_for() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.optimize_for) + return static_cast< ::google::protobuf::FileOptions_OptimizeMode >(optimize_for_); +} + void FileOptions::set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value) { + assert(::google::protobuf::FileOptions_OptimizeMode_IsValid(value)); + set_has_optimize_for(); + optimize_for_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.optimize_for) +} + +// optional string go_package = 11; +bool FileOptions::has_go_package() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void FileOptions::set_has_go_package() { + _has_bits_[0] |= 0x00000040u; +} +void FileOptions::clear_has_go_package() { + _has_bits_[0] &= ~0x00000040u; +} +void FileOptions::clear_go_package() { + go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_go_package(); +} + const ::std::string& FileOptions::go_package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package) + return go_package_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_go_package(const ::std::string& value) { + set_has_go_package(); + go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.go_package) +} + void FileOptions::set_go_package(const char* value) { + set_has_go_package(); + go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.go_package) +} + void FileOptions::set_go_package(const char* value, size_t size) { + set_has_go_package(); + go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.go_package) +} + ::std::string* FileOptions::mutable_go_package() { + set_has_go_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.go_package) + return go_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileOptions::release_go_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package) + clear_has_go_package(); + return go_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_allocated_go_package(::std::string* go_package) { + if (go_package != NULL) { + set_has_go_package(); + } else { + clear_has_go_package(); + } + go_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package) +} + +// optional bool cc_generic_services = 16 [default = false]; +bool FileOptions::has_cc_generic_services() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +void FileOptions::set_has_cc_generic_services() { + _has_bits_[0] |= 0x00000080u; +} +void FileOptions::clear_has_cc_generic_services() { + _has_bits_[0] &= ~0x00000080u; +} +void FileOptions::clear_cc_generic_services() { + cc_generic_services_ = false; + clear_has_cc_generic_services(); +} + bool FileOptions::cc_generic_services() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services) + return cc_generic_services_; +} + void FileOptions::set_cc_generic_services(bool value) { + set_has_cc_generic_services(); + cc_generic_services_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_generic_services) +} + +// optional bool java_generic_services = 17 [default = false]; +bool FileOptions::has_java_generic_services() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +void FileOptions::set_has_java_generic_services() { + _has_bits_[0] |= 0x00000100u; +} +void FileOptions::clear_has_java_generic_services() { + _has_bits_[0] &= ~0x00000100u; +} +void FileOptions::clear_java_generic_services() { + java_generic_services_ = false; + clear_has_java_generic_services(); +} + bool FileOptions::java_generic_services() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services) + return java_generic_services_; +} + void FileOptions::set_java_generic_services(bool value) { + set_has_java_generic_services(); + java_generic_services_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generic_services) +} + +// optional bool py_generic_services = 18 [default = false]; +bool FileOptions::has_py_generic_services() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +void FileOptions::set_has_py_generic_services() { + _has_bits_[0] |= 0x00000200u; +} +void FileOptions::clear_has_py_generic_services() { + _has_bits_[0] &= ~0x00000200u; +} +void FileOptions::clear_py_generic_services() { + py_generic_services_ = false; + clear_has_py_generic_services(); +} + bool FileOptions::py_generic_services() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services) + return py_generic_services_; +} + void FileOptions::set_py_generic_services(bool value) { + set_has_py_generic_services(); + py_generic_services_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services) +} + +// optional bool deprecated = 23 [default = false]; +bool FileOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +void FileOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000400u; +} +void FileOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000400u; +} +void FileOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool FileOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated) + return deprecated_; +} + void FileOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.deprecated) +} + +// optional bool cc_enable_arenas = 31 [default = false]; +bool FileOptions::has_cc_enable_arenas() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +void FileOptions::set_has_cc_enable_arenas() { + _has_bits_[0] |= 0x00000800u; +} +void FileOptions::clear_has_cc_enable_arenas() { + _has_bits_[0] &= ~0x00000800u; +} +void FileOptions::clear_cc_enable_arenas() { + cc_enable_arenas_ = false; + clear_has_cc_enable_arenas(); +} + bool FileOptions::cc_enable_arenas() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas) + return cc_enable_arenas_; +} + void FileOptions::set_cc_enable_arenas(bool value) { + set_has_cc_enable_arenas(); + cc_enable_arenas_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_enable_arenas) +} + +// optional string objc_class_prefix = 36; +bool FileOptions::has_objc_class_prefix() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +void FileOptions::set_has_objc_class_prefix() { + _has_bits_[0] |= 0x00001000u; +} +void FileOptions::clear_has_objc_class_prefix() { + _has_bits_[0] &= ~0x00001000u; +} +void FileOptions::clear_objc_class_prefix() { + objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_objc_class_prefix(); +} + const ::std::string& FileOptions::objc_class_prefix() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix) + return objc_class_prefix_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_objc_class_prefix(const ::std::string& value) { + set_has_objc_class_prefix(); + objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix) +} + void FileOptions::set_objc_class_prefix(const char* value) { + set_has_objc_class_prefix(); + objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.objc_class_prefix) +} + void FileOptions::set_objc_class_prefix(const char* value, size_t size) { + set_has_objc_class_prefix(); + objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.objc_class_prefix) +} + ::std::string* FileOptions::mutable_objc_class_prefix() { + set_has_objc_class_prefix(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.objc_class_prefix) + return objc_class_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileOptions::release_objc_class_prefix() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix) + clear_has_objc_class_prefix(); + return objc_class_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_class_prefix) { + if (objc_class_prefix != NULL) { + set_has_objc_class_prefix(); + } else { + clear_has_objc_class_prefix(); + } + objc_class_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix) +} + +// optional string csharp_namespace = 37; +bool FileOptions::has_csharp_namespace() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +void FileOptions::set_has_csharp_namespace() { + _has_bits_[0] |= 0x00002000u; +} +void FileOptions::clear_has_csharp_namespace() { + _has_bits_[0] &= ~0x00002000u; +} +void FileOptions::clear_csharp_namespace() { + csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_csharp_namespace(); +} + const ::std::string& FileOptions::csharp_namespace() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace) + return csharp_namespace_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_csharp_namespace(const ::std::string& value) { + set_has_csharp_namespace(); + csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace) +} + void FileOptions::set_csharp_namespace(const char* value) { + set_has_csharp_namespace(); + csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.csharp_namespace) +} + void FileOptions::set_csharp_namespace(const char* value, size_t size) { + set_has_csharp_namespace(); + csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.csharp_namespace) +} + ::std::string* FileOptions::mutable_csharp_namespace() { + set_has_csharp_namespace(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.csharp_namespace) + return csharp_namespace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* FileOptions::release_csharp_namespace() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace) + clear_has_csharp_namespace(); + return csharp_namespace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) { + if (csharp_namespace != NULL) { + set_has_csharp_namespace(); + } else { + clear_has_csharp_namespace(); + } + csharp_namespace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int FileOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void FileOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& FileOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* FileOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +FileOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +FileOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MessageOptions::kMessageSetWireFormatFieldNumber; +const int MessageOptions::kNoStandardDescriptorAccessorFieldNumber; +const int MessageOptions::kDeprecatedFieldNumber; +const int MessageOptions::kMapEntryFieldNumber; +const int MessageOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MessageOptions::MessageOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.MessageOptions) +} + +void MessageOptions::InitAsDefaultInstance() { +} + +MessageOptions::MessageOptions(const MessageOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.MessageOptions) +} + +void MessageOptions::SharedCtor() { + _cached_size_ = 0; + message_set_wire_format_ = false; + no_standard_descriptor_accessor_ = false; + deprecated_ = false; + map_entry_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MessageOptions::~MessageOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.MessageOptions) + SharedDtor(); +} + +void MessageOptions::SharedDtor() { + if (this != default_instance_) { + } +} + +void MessageOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MessageOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MessageOptions_descriptor_; +} + +const MessageOptions& MessageOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +MessageOptions* MessageOptions::default_instance_ = NULL; + +MessageOptions* MessageOptions::New(::google::protobuf::Arena* arena) const { + MessageOptions* n = new MessageOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void MessageOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.MessageOptions) + _extensions_.Clear(); +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(MessageOptions, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(message_set_wire_format_, map_entry_); + +#undef ZR_HELPER_ +#undef ZR_ + + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool MessageOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.MessageOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool message_set_wire_format = 1 [default = false]; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &message_set_wire_format_))); + set_has_message_set_wire_format(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_no_standard_descriptor_accessor; + break; + } + + // optional bool no_standard_descriptor_accessor = 2 [default = false]; + case 2: { + if (tag == 16) { + parse_no_standard_descriptor_accessor: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &no_standard_descriptor_accessor_))); + set_has_no_standard_descriptor_accessor(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_deprecated; + break; + } + + // optional bool deprecated = 3 [default = false]; + case 3: { + if (tag == 24) { + parse_deprecated: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(56)) goto parse_map_entry; + break; + } + + // optional bool map_entry = 7; + case 7: { + if (tag == 56) { + parse_map_entry: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &map_entry_))); + set_has_map_entry(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.MessageOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.MessageOptions) + return false; +#undef DO_ +} + +void MessageOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.MessageOptions) + // optional bool message_set_wire_format = 1 [default = false]; + if (has_message_set_wire_format()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->message_set_wire_format(), output); + } + + // optional bool no_standard_descriptor_accessor = 2 [default = false]; + if (has_no_standard_descriptor_accessor()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->no_standard_descriptor_accessor(), output); + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output); + } + + // optional bool map_entry = 7; + if (has_map_entry()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(7, this->map_entry(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.MessageOptions) +} + +::google::protobuf::uint8* MessageOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MessageOptions) + // optional bool message_set_wire_format = 1 [default = false]; + if (has_message_set_wire_format()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->message_set_wire_format(), target); + } + + // optional bool no_standard_descriptor_accessor = 2 [default = false]; + if (has_no_standard_descriptor_accessor()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->no_standard_descriptor_accessor(), target); + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target); + } + + // optional bool map_entry = 7; + if (has_map_entry()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(7, this->map_entry(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MessageOptions) + return target; +} + +int MessageOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.MessageOptions) + int total_size = 0; + + if (_has_bits_[0 / 32] & 15u) { + // optional bool message_set_wire_format = 1 [default = false]; + if (has_message_set_wire_format()) { + total_size += 1 + 1; + } + + // optional bool no_standard_descriptor_accessor = 2 [default = false]; + if (has_no_standard_descriptor_accessor()) { + total_size += 1 + 1; + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + total_size += 1 + 1; + } + + // optional bool map_entry = 7; + if (has_map_entry()) { + total_size += 1 + 1; + } + + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MessageOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.MessageOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const MessageOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MessageOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.MessageOptions) + MergeFrom(*source); + } +} + +void MessageOptions::MergeFrom(const MessageOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.MessageOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_message_set_wire_format()) { + set_message_set_wire_format(from.message_set_wire_format()); + } + if (from.has_no_standard_descriptor_accessor()) { + set_no_standard_descriptor_accessor(from.no_standard_descriptor_accessor()); + } + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + if (from.has_map_entry()) { + set_map_entry(from.map_entry()); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void MessageOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.MessageOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MessageOptions::CopyFrom(const MessageOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.MessageOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MessageOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void MessageOptions::Swap(MessageOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void MessageOptions::InternalSwap(MessageOptions* other) { + std::swap(message_set_wire_format_, other->message_set_wire_format_); + std::swap(no_standard_descriptor_accessor_, other->no_standard_descriptor_accessor_); + std::swap(deprecated_, other->deprecated_); + std::swap(map_entry_, other->map_entry_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata MessageOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MessageOptions_descriptor_; + metadata.reflection = MessageOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// MessageOptions + +// optional bool message_set_wire_format = 1 [default = false]; +bool MessageOptions::has_message_set_wire_format() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void MessageOptions::set_has_message_set_wire_format() { + _has_bits_[0] |= 0x00000001u; +} +void MessageOptions::clear_has_message_set_wire_format() { + _has_bits_[0] &= ~0x00000001u; +} +void MessageOptions::clear_message_set_wire_format() { + message_set_wire_format_ = false; + clear_has_message_set_wire_format(); +} + bool MessageOptions::message_set_wire_format() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format) + return message_set_wire_format_; +} + void MessageOptions::set_message_set_wire_format(bool value) { + set_has_message_set_wire_format(); + message_set_wire_format_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.message_set_wire_format) +} + +// optional bool no_standard_descriptor_accessor = 2 [default = false]; +bool MessageOptions::has_no_standard_descriptor_accessor() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void MessageOptions::set_has_no_standard_descriptor_accessor() { + _has_bits_[0] |= 0x00000002u; +} +void MessageOptions::clear_has_no_standard_descriptor_accessor() { + _has_bits_[0] &= ~0x00000002u; +} +void MessageOptions::clear_no_standard_descriptor_accessor() { + no_standard_descriptor_accessor_ = false; + clear_has_no_standard_descriptor_accessor(); +} + bool MessageOptions::no_standard_descriptor_accessor() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor) + return no_standard_descriptor_accessor_; +} + void MessageOptions::set_no_standard_descriptor_accessor(bool value) { + set_has_no_standard_descriptor_accessor(); + no_standard_descriptor_accessor_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.no_standard_descriptor_accessor) +} + +// optional bool deprecated = 3 [default = false]; +bool MessageOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void MessageOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000004u; +} +void MessageOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000004u; +} +void MessageOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool MessageOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated) + return deprecated_; +} + void MessageOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.deprecated) +} + +// optional bool map_entry = 7; +bool MessageOptions::has_map_entry() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void MessageOptions::set_has_map_entry() { + _has_bits_[0] |= 0x00000008u; +} +void MessageOptions::clear_has_map_entry() { + _has_bits_[0] &= ~0x00000008u; +} +void MessageOptions::clear_map_entry() { + map_entry_ = false; + clear_has_map_entry(); +} + bool MessageOptions::map_entry() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry) + return map_entry_; +} + void MessageOptions::set_map_entry(bool value) { + set_has_map_entry(); + map_entry_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.map_entry) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int MessageOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void MessageOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& MessageOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* MessageOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +MessageOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.MessageOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +MessageOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FieldOptions_CType_descriptor_; +} +bool FieldOptions_CType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldOptions_CType FieldOptions::STRING; +const FieldOptions_CType FieldOptions::CORD; +const FieldOptions_CType FieldOptions::STRING_PIECE; +const FieldOptions_CType FieldOptions::CType_MIN; +const FieldOptions_CType FieldOptions::CType_MAX; +const int FieldOptions::CType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor() { + protobuf_AssignDescriptorsOnce(); + return FieldOptions_JSType_descriptor_; +} +bool FieldOptions_JSType_IsValid(int value) { + switch(value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const FieldOptions_JSType FieldOptions::JS_NORMAL; +const FieldOptions_JSType FieldOptions::JS_STRING; +const FieldOptions_JSType FieldOptions::JS_NUMBER; +const FieldOptions_JSType FieldOptions::JSType_MIN; +const FieldOptions_JSType FieldOptions::JSType_MAX; +const int FieldOptions::JSType_ARRAYSIZE; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int FieldOptions::kCtypeFieldNumber; +const int FieldOptions::kPackedFieldNumber; +const int FieldOptions::kJstypeFieldNumber; +const int FieldOptions::kLazyFieldNumber; +const int FieldOptions::kDeprecatedFieldNumber; +const int FieldOptions::kWeakFieldNumber; +const int FieldOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +FieldOptions::FieldOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.FieldOptions) +} + +void FieldOptions::InitAsDefaultInstance() { +} + +FieldOptions::FieldOptions(const FieldOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.FieldOptions) +} + +void FieldOptions::SharedCtor() { + _cached_size_ = 0; + ctype_ = 0; + packed_ = false; + jstype_ = 0; + lazy_ = false; + deprecated_ = false; + weak_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +FieldOptions::~FieldOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.FieldOptions) + SharedDtor(); +} + +void FieldOptions::SharedDtor() { + if (this != default_instance_) { + } +} + +void FieldOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* FieldOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return FieldOptions_descriptor_; +} + +const FieldOptions& FieldOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +FieldOptions* FieldOptions::default_instance_ = NULL; + +FieldOptions* FieldOptions::New(::google::protobuf::Arena* arena) const { + FieldOptions* n = new FieldOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void FieldOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.FieldOptions) + _extensions_.Clear(); +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(FieldOptions, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 63u) { + ZR_(ctype_, jstype_); + ZR_(packed_, weak_); + } + +#undef ZR_HELPER_ +#undef ZR_ + + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool FieldOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.FieldOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + case 1: { + if (tag == 8) { + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FieldOptions_CType_IsValid(value)) { + set_ctype(static_cast< ::google::protobuf::FieldOptions_CType >(value)); + } else { + mutable_unknown_fields()->AddVarint(1, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_packed; + break; + } + + // optional bool packed = 2; + case 2: { + if (tag == 16) { + parse_packed: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &packed_))); + set_has_packed(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_deprecated; + break; + } + + // optional bool deprecated = 3 [default = false]; + case 3: { + if (tag == 24) { + parse_deprecated: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_lazy; + break; + } + + // optional bool lazy = 5 [default = false]; + case 5: { + if (tag == 40) { + parse_lazy: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &lazy_))); + set_has_lazy(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(48)) goto parse_jstype; + break; + } + + // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + case 6: { + if (tag == 48) { + parse_jstype: + int value; + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( + input, &value))); + if (::google::protobuf::FieldOptions_JSType_IsValid(value)) { + set_jstype(static_cast< ::google::protobuf::FieldOptions_JSType >(value)); + } else { + mutable_unknown_fields()->AddVarint(6, value); + } + } else { + goto handle_unusual; + } + if (input->ExpectTag(80)) goto parse_weak; + break; + } + + // optional bool weak = 10 [default = false]; + case 10: { + if (tag == 80) { + parse_weak: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &weak_))); + set_has_weak(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.FieldOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.FieldOptions) + return false; +#undef DO_ +} + +void FieldOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.FieldOptions) + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + if (has_ctype()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 1, this->ctype(), output); + } + + // optional bool packed = 2; + if (has_packed()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->packed(), output); + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output); + } + + // optional bool lazy = 5 [default = false]; + if (has_lazy()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(5, this->lazy(), output); + } + + // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + if (has_jstype()) { + ::google::protobuf::internal::WireFormatLite::WriteEnum( + 6, this->jstype(), output); + } + + // optional bool weak = 10 [default = false]; + if (has_weak()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(10, this->weak(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.FieldOptions) +} + +::google::protobuf::uint8* FieldOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldOptions) + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + if (has_ctype()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 1, this->ctype(), target); + } + + // optional bool packed = 2; + if (has_packed()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->packed(), target); + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target); + } + + // optional bool lazy = 5 [default = false]; + if (has_lazy()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(5, this->lazy(), target); + } + + // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + if (has_jstype()) { + target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray( + 6, this->jstype(), target); + } + + // optional bool weak = 10 [default = false]; + if (has_weak()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(10, this->weak(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.FieldOptions) + return target; +} + +int FieldOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.FieldOptions) + int total_size = 0; + + if (_has_bits_[0 / 32] & 63u) { + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + if (has_ctype()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->ctype()); + } + + // optional bool packed = 2; + if (has_packed()) { + total_size += 1 + 1; + } + + // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + if (has_jstype()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::EnumSize(this->jstype()); + } + + // optional bool lazy = 5 [default = false]; + if (has_lazy()) { + total_size += 1 + 1; + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + total_size += 1 + 1; + } + + // optional bool weak = 10 [default = false]; + if (has_weak()) { + total_size += 1 + 1; + } + + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void FieldOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.FieldOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const FieldOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.FieldOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.FieldOptions) + MergeFrom(*source); + } +} + +void FieldOptions::MergeFrom(const FieldOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.FieldOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_ctype()) { + set_ctype(from.ctype()); + } + if (from.has_packed()) { + set_packed(from.packed()); + } + if (from.has_jstype()) { + set_jstype(from.jstype()); + } + if (from.has_lazy()) { + set_lazy(from.lazy()); + } + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + if (from.has_weak()) { + set_weak(from.weak()); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void FieldOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.FieldOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void FieldOptions::CopyFrom(const FieldOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.FieldOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool FieldOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void FieldOptions::Swap(FieldOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void FieldOptions::InternalSwap(FieldOptions* other) { + std::swap(ctype_, other->ctype_); + std::swap(packed_, other->packed_); + std::swap(jstype_, other->jstype_); + std::swap(lazy_, other->lazy_); + std::swap(deprecated_, other->deprecated_); + std::swap(weak_, other->weak_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata FieldOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = FieldOptions_descriptor_; + metadata.reflection = FieldOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// FieldOptions + +// optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; +bool FieldOptions::has_ctype() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void FieldOptions::set_has_ctype() { + _has_bits_[0] |= 0x00000001u; +} +void FieldOptions::clear_has_ctype() { + _has_bits_[0] &= ~0x00000001u; +} +void FieldOptions::clear_ctype() { + ctype_ = 0; + clear_has_ctype(); +} + ::google::protobuf::FieldOptions_CType FieldOptions::ctype() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype) + return static_cast< ::google::protobuf::FieldOptions_CType >(ctype_); +} + void FieldOptions::set_ctype(::google::protobuf::FieldOptions_CType value) { + assert(::google::protobuf::FieldOptions_CType_IsValid(value)); + set_has_ctype(); + ctype_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.ctype) +} + +// optional bool packed = 2; +bool FieldOptions::has_packed() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void FieldOptions::set_has_packed() { + _has_bits_[0] |= 0x00000002u; +} +void FieldOptions::clear_has_packed() { + _has_bits_[0] &= ~0x00000002u; +} +void FieldOptions::clear_packed() { + packed_ = false; + clear_has_packed(); +} + bool FieldOptions::packed() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed) + return packed_; +} + void FieldOptions::set_packed(bool value) { + set_has_packed(); + packed_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.packed) +} + +// optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; +bool FieldOptions::has_jstype() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void FieldOptions::set_has_jstype() { + _has_bits_[0] |= 0x00000004u; +} +void FieldOptions::clear_has_jstype() { + _has_bits_[0] &= ~0x00000004u; +} +void FieldOptions::clear_jstype() { + jstype_ = 0; + clear_has_jstype(); +} + ::google::protobuf::FieldOptions_JSType FieldOptions::jstype() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype) + return static_cast< ::google::protobuf::FieldOptions_JSType >(jstype_); +} + void FieldOptions::set_jstype(::google::protobuf::FieldOptions_JSType value) { + assert(::google::protobuf::FieldOptions_JSType_IsValid(value)); + set_has_jstype(); + jstype_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.jstype) +} + +// optional bool lazy = 5 [default = false]; +bool FieldOptions::has_lazy() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void FieldOptions::set_has_lazy() { + _has_bits_[0] |= 0x00000008u; +} +void FieldOptions::clear_has_lazy() { + _has_bits_[0] &= ~0x00000008u; +} +void FieldOptions::clear_lazy() { + lazy_ = false; + clear_has_lazy(); +} + bool FieldOptions::lazy() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy) + return lazy_; +} + void FieldOptions::set_lazy(bool value) { + set_has_lazy(); + lazy_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.lazy) +} + +// optional bool deprecated = 3 [default = false]; +bool FieldOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void FieldOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000010u; +} +void FieldOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000010u; +} +void FieldOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool FieldOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated) + return deprecated_; +} + void FieldOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.deprecated) +} + +// optional bool weak = 10 [default = false]; +bool FieldOptions::has_weak() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void FieldOptions::set_has_weak() { + _has_bits_[0] |= 0x00000020u; +} +void FieldOptions::clear_has_weak() { + _has_bits_[0] &= ~0x00000020u; +} +void FieldOptions::clear_weak() { + weak_ = false; + clear_has_weak(); +} + bool FieldOptions::weak() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak) + return weak_; +} + void FieldOptions::set_weak(bool value) { + set_has_weak(); + weak_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.weak) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int FieldOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void FieldOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& FieldOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* FieldOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +FieldOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +FieldOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EnumOptions::kAllowAliasFieldNumber; +const int EnumOptions::kDeprecatedFieldNumber; +const int EnumOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EnumOptions::EnumOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.EnumOptions) +} + +void EnumOptions::InitAsDefaultInstance() { +} + +EnumOptions::EnumOptions(const EnumOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumOptions) +} + +void EnumOptions::SharedCtor() { + _cached_size_ = 0; + allow_alias_ = false; + deprecated_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EnumOptions::~EnumOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.EnumOptions) + SharedDtor(); +} + +void EnumOptions::SharedDtor() { + if (this != default_instance_) { + } +} + +void EnumOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EnumOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EnumOptions_descriptor_; +} + +const EnumOptions& EnumOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +EnumOptions* EnumOptions::default_instance_ = NULL; + +EnumOptions* EnumOptions::New(::google::protobuf::Arena* arena) const { + EnumOptions* n = new EnumOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void EnumOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.EnumOptions) + _extensions_.Clear(); +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(EnumOptions, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + ZR_(allow_alias_, deprecated_); + +#undef ZR_HELPER_ +#undef ZR_ + + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool EnumOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.EnumOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool allow_alias = 2; + case 2: { + if (tag == 16) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &allow_alias_))); + set_has_allow_alias(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_deprecated; + break; + } + + // optional bool deprecated = 3 [default = false]; + case 3: { + if (tag == 24) { + parse_deprecated: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.EnumOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.EnumOptions) + return false; +#undef DO_ +} + +void EnumOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.EnumOptions) + // optional bool allow_alias = 2; + if (has_allow_alias()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->allow_alias(), output); + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(3, this->deprecated(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.EnumOptions) +} + +::google::protobuf::uint8* EnumOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumOptions) + // optional bool allow_alias = 2; + if (has_allow_alias()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->allow_alias(), target); + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(3, this->deprecated(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumOptions) + return target; +} + +int EnumOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumOptions) + int total_size = 0; + + if (_has_bits_[0 / 32] & 3u) { + // optional bool allow_alias = 2; + if (has_allow_alias()) { + total_size += 1 + 1; + } + + // optional bool deprecated = 3 [default = false]; + if (has_deprecated()) { + total_size += 1 + 1; + } + + } + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EnumOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const EnumOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumOptions) + MergeFrom(*source); + } +} + +void EnumOptions::MergeFrom(const EnumOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_allow_alias()) { + set_allow_alias(from.allow_alias()); + } + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void EnumOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EnumOptions::CopyFrom(const EnumOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EnumOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void EnumOptions::Swap(EnumOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void EnumOptions::InternalSwap(EnumOptions* other) { + std::swap(allow_alias_, other->allow_alias_); + std::swap(deprecated_, other->deprecated_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata EnumOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EnumOptions_descriptor_; + metadata.reflection = EnumOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EnumOptions + +// optional bool allow_alias = 2; +bool EnumOptions::has_allow_alias() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void EnumOptions::set_has_allow_alias() { + _has_bits_[0] |= 0x00000001u; +} +void EnumOptions::clear_has_allow_alias() { + _has_bits_[0] &= ~0x00000001u; +} +void EnumOptions::clear_allow_alias() { + allow_alias_ = false; + clear_has_allow_alias(); +} + bool EnumOptions::allow_alias() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias) + return allow_alias_; +} + void EnumOptions::set_allow_alias(bool value) { + set_has_allow_alias(); + allow_alias_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.allow_alias) +} + +// optional bool deprecated = 3 [default = false]; +bool EnumOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void EnumOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000002u; +} +void EnumOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000002u; +} +void EnumOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool EnumOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated) + return deprecated_; +} + void EnumOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int EnumOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void EnumOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& EnumOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* EnumOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +EnumOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +EnumOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int EnumValueOptions::kDeprecatedFieldNumber; +const int EnumValueOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +EnumValueOptions::EnumValueOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.EnumValueOptions) +} + +void EnumValueOptions::InitAsDefaultInstance() { +} + +EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.EnumValueOptions) +} + +void EnumValueOptions::SharedCtor() { + _cached_size_ = 0; + deprecated_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +EnumValueOptions::~EnumValueOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.EnumValueOptions) + SharedDtor(); +} + +void EnumValueOptions::SharedDtor() { + if (this != default_instance_) { + } +} + +void EnumValueOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* EnumValueOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return EnumValueOptions_descriptor_; +} + +const EnumValueOptions& EnumValueOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +EnumValueOptions* EnumValueOptions::default_instance_ = NULL; + +EnumValueOptions* EnumValueOptions::New(::google::protobuf::Arena* arena) const { + EnumValueOptions* n = new EnumValueOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void EnumValueOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.EnumValueOptions) + _extensions_.Clear(); + deprecated_ = false; + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool EnumValueOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.EnumValueOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool deprecated = 1 [default = false]; + case 1: { + if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.EnumValueOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.EnumValueOptions) + return false; +#undef DO_ +} + +void EnumValueOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.EnumValueOptions) + // optional bool deprecated = 1 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(1, this->deprecated(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.EnumValueOptions) +} + +::google::protobuf::uint8* EnumValueOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.EnumValueOptions) + // optional bool deprecated = 1 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(1, this->deprecated(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.EnumValueOptions) + return target; +} + +int EnumValueOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.EnumValueOptions) + int total_size = 0; + + // optional bool deprecated = 1 [default = false]; + if (has_deprecated()) { + total_size += 1 + 1; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void EnumValueOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.EnumValueOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const EnumValueOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.EnumValueOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.EnumValueOptions) + MergeFrom(*source); + } +} + +void EnumValueOptions::MergeFrom(const EnumValueOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.EnumValueOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void EnumValueOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.EnumValueOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void EnumValueOptions::CopyFrom(const EnumValueOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.EnumValueOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool EnumValueOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void EnumValueOptions::Swap(EnumValueOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void EnumValueOptions::InternalSwap(EnumValueOptions* other) { + std::swap(deprecated_, other->deprecated_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata EnumValueOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = EnumValueOptions_descriptor_; + metadata.reflection = EnumValueOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// EnumValueOptions + +// optional bool deprecated = 1 [default = false]; +bool EnumValueOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void EnumValueOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000001u; +} +void EnumValueOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000001u; +} +void EnumValueOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool EnumValueOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated) + return deprecated_; +} + void EnumValueOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int EnumValueOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void EnumValueOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& EnumValueOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +EnumValueOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValueOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +EnumValueOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int ServiceOptions::kDeprecatedFieldNumber; +const int ServiceOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +ServiceOptions::ServiceOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.ServiceOptions) +} + +void ServiceOptions::InitAsDefaultInstance() { +} + +ServiceOptions::ServiceOptions(const ServiceOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.ServiceOptions) +} + +void ServiceOptions::SharedCtor() { + _cached_size_ = 0; + deprecated_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +ServiceOptions::~ServiceOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.ServiceOptions) + SharedDtor(); +} + +void ServiceOptions::SharedDtor() { + if (this != default_instance_) { + } +} + +void ServiceOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* ServiceOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return ServiceOptions_descriptor_; +} + +const ServiceOptions& ServiceOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +ServiceOptions* ServiceOptions::default_instance_ = NULL; + +ServiceOptions* ServiceOptions::New(::google::protobuf::Arena* arena) const { + ServiceOptions* n = new ServiceOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void ServiceOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.ServiceOptions) + _extensions_.Clear(); + deprecated_ = false; + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool ServiceOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.ServiceOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool deprecated = 33 [default = false]; + case 33: { + if (tag == 264) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.ServiceOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.ServiceOptions) + return false; +#undef DO_ +} + +void ServiceOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.ServiceOptions) + // optional bool deprecated = 33 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(33, this->deprecated(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.ServiceOptions) +} + +::google::protobuf::uint8* ServiceOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.ServiceOptions) + // optional bool deprecated = 33 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(33, this->deprecated(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.ServiceOptions) + return target; +} + +int ServiceOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.ServiceOptions) + int total_size = 0; + + // optional bool deprecated = 33 [default = false]; + if (has_deprecated()) { + total_size += 2 + 1; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void ServiceOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.ServiceOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const ServiceOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.ServiceOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.ServiceOptions) + MergeFrom(*source); + } +} + +void ServiceOptions::MergeFrom(const ServiceOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.ServiceOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void ServiceOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.ServiceOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void ServiceOptions::CopyFrom(const ServiceOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.ServiceOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool ServiceOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void ServiceOptions::Swap(ServiceOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void ServiceOptions::InternalSwap(ServiceOptions* other) { + std::swap(deprecated_, other->deprecated_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata ServiceOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = ServiceOptions_descriptor_; + metadata.reflection = ServiceOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// ServiceOptions + +// optional bool deprecated = 33 [default = false]; +bool ServiceOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void ServiceOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000001u; +} +void ServiceOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000001u; +} +void ServiceOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool ServiceOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated) + return deprecated_; +} + void ServiceOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.ServiceOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int ServiceOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void ServiceOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& ServiceOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* ServiceOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +ServiceOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +ServiceOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int MethodOptions::kDeprecatedFieldNumber; +const int MethodOptions::kUninterpretedOptionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +MethodOptions::MethodOptions() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.MethodOptions) +} + +void MethodOptions::InitAsDefaultInstance() { +} + +MethodOptions::MethodOptions(const MethodOptions& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.MethodOptions) +} + +void MethodOptions::SharedCtor() { + _cached_size_ = 0; + deprecated_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +MethodOptions::~MethodOptions() { + // @@protoc_insertion_point(destructor:google.protobuf.MethodOptions) + SharedDtor(); +} + +void MethodOptions::SharedDtor() { + if (this != default_instance_) { + } +} + +void MethodOptions::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* MethodOptions::descriptor() { + protobuf_AssignDescriptorsOnce(); + return MethodOptions_descriptor_; +} + +const MethodOptions& MethodOptions::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +MethodOptions* MethodOptions::default_instance_ = NULL; + +MethodOptions* MethodOptions::New(::google::protobuf::Arena* arena) const { + MethodOptions* n = new MethodOptions; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void MethodOptions::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.MethodOptions) + _extensions_.Clear(); + deprecated_ = false; + uninterpreted_option_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool MethodOptions::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.MethodOptions) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // optional bool deprecated = 33 [default = false]; + case 33: { + if (tag == 264) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &deprecated_))); + set_has_deprecated(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_uninterpreted_option; + break; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + case 999: { + if (tag == 7994) { + parse_uninterpreted_option: + DO_(input->IncrementRecursionDepth()); + parse_loop_uninterpreted_option: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_uninterpreted_option())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(7994)) goto parse_loop_uninterpreted_option; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + if ((8000u <= tag)) { + DO_(_extensions_.ParseField(tag, input, default_instance_, + mutable_unknown_fields())); + continue; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.MethodOptions) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.MethodOptions) + return false; +#undef DO_ +} + +void MethodOptions::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.MethodOptions) + // optional bool deprecated = 33 [default = false]; + if (has_deprecated()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(33, this->deprecated(), output); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 999, this->uninterpreted_option(i), output); + } + + // Extension range [1000, 536870912) + _extensions_.SerializeWithCachedSizes( + 1000, 536870912, output); + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.MethodOptions) +} + +::google::protobuf::uint8* MethodOptions::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.MethodOptions) + // optional bool deprecated = 33 [default = false]; + if (has_deprecated()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(33, this->deprecated(), target); + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + for (unsigned int i = 0, n = this->uninterpreted_option_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 999, this->uninterpreted_option(i), target); + } + + // Extension range [1000, 536870912) + target = _extensions_.SerializeWithCachedSizesToArray( + 1000, 536870912, target); + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.MethodOptions) + return target; +} + +int MethodOptions::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.MethodOptions) + int total_size = 0; + + // optional bool deprecated = 33 [default = false]; + if (has_deprecated()) { + total_size += 2 + 1; + } + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + total_size += 2 * this->uninterpreted_option_size(); + for (int i = 0; i < this->uninterpreted_option_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->uninterpreted_option(i)); + } + + total_size += _extensions_.ByteSize(); + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void MethodOptions::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.MethodOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const MethodOptions* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.MethodOptions) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.MethodOptions) + MergeFrom(*source); + } +} + +void MethodOptions::MergeFrom(const MethodOptions& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.MethodOptions) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + uninterpreted_option_.MergeFrom(from.uninterpreted_option_); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_deprecated()) { + set_deprecated(from.deprecated()); + } + } + _extensions_.MergeFrom(from._extensions_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void MethodOptions::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.MethodOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MethodOptions::CopyFrom(const MethodOptions& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.MethodOptions) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MethodOptions::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->uninterpreted_option())) return false; + + if (!_extensions_.IsInitialized()) return false; return true; +} + +void MethodOptions::Swap(MethodOptions* other) { + if (other == this) return; + InternalSwap(other); +} +void MethodOptions::InternalSwap(MethodOptions* other) { + std::swap(deprecated_, other->deprecated_); + uninterpreted_option_.UnsafeArenaSwap(&other->uninterpreted_option_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); + _extensions_.Swap(&other->_extensions_); +} + +::google::protobuf::Metadata MethodOptions::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = MethodOptions_descriptor_; + metadata.reflection = MethodOptions_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// MethodOptions + +// optional bool deprecated = 33 [default = false]; +bool MethodOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void MethodOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000001u; +} +void MethodOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000001u; +} +void MethodOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} + bool MethodOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated) + return deprecated_; +} + void MethodOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +int MethodOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +void MethodOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +const ::google::protobuf::UninterpretedOption& MethodOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +::google::protobuf::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +::google::protobuf::UninterpretedOption* MethodOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +MethodOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option) + return &uninterpreted_option_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +MethodOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int UninterpretedOption_NamePart::kNamePartFieldNumber; +const int UninterpretedOption_NamePart::kIsExtensionFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +UninterpretedOption_NamePart::UninterpretedOption_NamePart() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption.NamePart) +} + +void UninterpretedOption_NamePart::InitAsDefaultInstance() { +} + +UninterpretedOption_NamePart::UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.UninterpretedOption.NamePart) +} + +void UninterpretedOption_NamePart::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + name_part_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + is_extension_ = false; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +UninterpretedOption_NamePart::~UninterpretedOption_NamePart() { + // @@protoc_insertion_point(destructor:google.protobuf.UninterpretedOption.NamePart) + SharedDtor(); +} + +void UninterpretedOption_NamePart::SharedDtor() { + name_part_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void UninterpretedOption_NamePart::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* UninterpretedOption_NamePart::descriptor() { + protobuf_AssignDescriptorsOnce(); + return UninterpretedOption_NamePart_descriptor_; +} + +const UninterpretedOption_NamePart& UninterpretedOption_NamePart::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +UninterpretedOption_NamePart* UninterpretedOption_NamePart::default_instance_ = NULL; + +UninterpretedOption_NamePart* UninterpretedOption_NamePart::New(::google::protobuf::Arena* arena) const { + UninterpretedOption_NamePart* n = new UninterpretedOption_NamePart; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void UninterpretedOption_NamePart::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.UninterpretedOption.NamePart) + if (_has_bits_[0 / 32] & 3u) { + if (has_name_part()) { + name_part_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + is_extension_ = false; + } + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool UninterpretedOption_NamePart::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.UninterpretedOption.NamePart) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // required string name_part = 1; + case 1: { + if (tag == 10) { + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_name_part())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name_part().data(), this->name_part().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.UninterpretedOption.NamePart.name_part"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(16)) goto parse_is_extension; + break; + } + + // required bool is_extension = 2; + case 2: { + if (tag == 16) { + parse_is_extension: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( + input, &is_extension_))); + set_has_is_extension(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.UninterpretedOption.NamePart) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.UninterpretedOption.NamePart) + return false; +#undef DO_ +} + +void UninterpretedOption_NamePart::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.UninterpretedOption.NamePart) + // required string name_part = 1; + if (has_name_part()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name_part().data(), this->name_part().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.UninterpretedOption.NamePart.name_part"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 1, this->name_part(), output); + } + + // required bool is_extension = 2; + if (has_is_extension()) { + ::google::protobuf::internal::WireFormatLite::WriteBool(2, this->is_extension(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.UninterpretedOption.NamePart) +} + +::google::protobuf::uint8* UninterpretedOption_NamePart::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption.NamePart) + // required string name_part = 1; + if (has_name_part()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->name_part().data(), this->name_part().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.UninterpretedOption.NamePart.name_part"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 1, this->name_part(), target); + } + + // required bool is_extension = 2; + if (has_is_extension()) { + target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(2, this->is_extension(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.UninterpretedOption.NamePart) + return target; +} + +int UninterpretedOption_NamePart::RequiredFieldsByteSizeFallback() const { +// @@protoc_insertion_point(required_fields_byte_size_fallback_start:google.protobuf.UninterpretedOption.NamePart) + int total_size = 0; + + if (has_name_part()) { + // required string name_part = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name_part()); + } + + if (has_is_extension()) { + // required bool is_extension = 2; + total_size += 1 + 1; + } + + return total_size; +} +int UninterpretedOption_NamePart::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.UninterpretedOption.NamePart) + int total_size = 0; + + if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) { // All required fields are present. + // required string name_part = 1; + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->name_part()); + + // required bool is_extension = 2; + total_size += 1 + 1; + + } else { + total_size += RequiredFieldsByteSizeFallback(); + } + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void UninterpretedOption_NamePart::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.UninterpretedOption.NamePart) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const UninterpretedOption_NamePart* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UninterpretedOption.NamePart) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.UninterpretedOption.NamePart) + MergeFrom(*source); + } +} + +void UninterpretedOption_NamePart::MergeFrom(const UninterpretedOption_NamePart& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.UninterpretedOption.NamePart) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) { + if (from.has_name_part()) { + set_has_name_part(); + name_part_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_part_); + } + if (from.has_is_extension()) { + set_is_extension(from.is_extension()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void UninterpretedOption_NamePart::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.UninterpretedOption.NamePart) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void UninterpretedOption_NamePart::CopyFrom(const UninterpretedOption_NamePart& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.UninterpretedOption.NamePart) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool UninterpretedOption_NamePart::IsInitialized() const { + if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false; + + return true; +} + +void UninterpretedOption_NamePart::Swap(UninterpretedOption_NamePart* other) { + if (other == this) return; + InternalSwap(other); +} +void UninterpretedOption_NamePart::InternalSwap(UninterpretedOption_NamePart* other) { + name_part_.Swap(&other->name_part_); + std::swap(is_extension_, other->is_extension_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata UninterpretedOption_NamePart::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = UninterpretedOption_NamePart_descriptor_; + metadata.reflection = UninterpretedOption_NamePart_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int UninterpretedOption::kNameFieldNumber; +const int UninterpretedOption::kIdentifierValueFieldNumber; +const int UninterpretedOption::kPositiveIntValueFieldNumber; +const int UninterpretedOption::kNegativeIntValueFieldNumber; +const int UninterpretedOption::kDoubleValueFieldNumber; +const int UninterpretedOption::kStringValueFieldNumber; +const int UninterpretedOption::kAggregateValueFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +UninterpretedOption::UninterpretedOption() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.UninterpretedOption) +} + +void UninterpretedOption::InitAsDefaultInstance() { +} + +UninterpretedOption::UninterpretedOption(const UninterpretedOption& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.UninterpretedOption) +} + +void UninterpretedOption::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + identifier_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + positive_int_value_ = GOOGLE_ULONGLONG(0); + negative_int_value_ = GOOGLE_LONGLONG(0); + double_value_ = 0; + string_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + aggregate_value_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +UninterpretedOption::~UninterpretedOption() { + // @@protoc_insertion_point(destructor:google.protobuf.UninterpretedOption) + SharedDtor(); +} + +void UninterpretedOption::SharedDtor() { + identifier_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + string_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + aggregate_value_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void UninterpretedOption::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* UninterpretedOption::descriptor() { + protobuf_AssignDescriptorsOnce(); + return UninterpretedOption_descriptor_; +} + +const UninterpretedOption& UninterpretedOption::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +UninterpretedOption* UninterpretedOption::default_instance_ = NULL; + +UninterpretedOption* UninterpretedOption::New(::google::protobuf::Arena* arena) const { + UninterpretedOption* n = new UninterpretedOption; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void UninterpretedOption::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.UninterpretedOption) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(UninterpretedOption, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 126u) { + ZR_(positive_int_value_, double_value_); + if (has_identifier_value()) { + identifier_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_string_value()) { + string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_aggregate_value()) { + aggregate_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + name_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool UninterpretedOption::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.UninterpretedOption) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + case 2: { + if (tag == 18) { + DO_(input->IncrementRecursionDepth()); + parse_loop_name: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_name())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_loop_name; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectTag(26)) goto parse_identifier_value; + break; + } + + // optional string identifier_value = 3; + case 3: { + if (tag == 26) { + parse_identifier_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_identifier_value())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->identifier_value().data(), this->identifier_value().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.UninterpretedOption.identifier_value"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_positive_int_value; + break; + } + + // optional uint64 positive_int_value = 4; + case 4: { + if (tag == 32) { + parse_positive_int_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>( + input, &positive_int_value_))); + set_has_positive_int_value(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(40)) goto parse_negative_int_value; + break; + } + + // optional int64 negative_int_value = 5; + case 5: { + if (tag == 40) { + parse_negative_int_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int64, ::google::protobuf::internal::WireFormatLite::TYPE_INT64>( + input, &negative_int_value_))); + set_has_negative_int_value(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(49)) goto parse_double_value; + break; + } + + // optional double double_value = 6; + case 6: { + if (tag == 49) { + parse_double_value: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + double, ::google::protobuf::internal::WireFormatLite::TYPE_DOUBLE>( + input, &double_value_))); + set_has_double_value(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(58)) goto parse_string_value; + break; + } + + // optional bytes string_value = 7; + case 7: { + if (tag == 58) { + parse_string_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( + input, this->mutable_string_value())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(66)) goto parse_aggregate_value; + break; + } + + // optional string aggregate_value = 8; + case 8: { + if (tag == 66) { + parse_aggregate_value: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_aggregate_value())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->aggregate_value().data(), this->aggregate_value().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.UninterpretedOption.aggregate_value"); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.UninterpretedOption) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.UninterpretedOption) + return false; +#undef DO_ +} + +void UninterpretedOption::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.UninterpretedOption) + // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + for (unsigned int i = 0, n = this->name_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 2, this->name(i), output); + } + + // optional string identifier_value = 3; + if (has_identifier_value()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->identifier_value().data(), this->identifier_value().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.UninterpretedOption.identifier_value"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->identifier_value(), output); + } + + // optional uint64 positive_int_value = 4; + if (has_positive_int_value()) { + ::google::protobuf::internal::WireFormatLite::WriteUInt64(4, this->positive_int_value(), output); + } + + // optional int64 negative_int_value = 5; + if (has_negative_int_value()) { + ::google::protobuf::internal::WireFormatLite::WriteInt64(5, this->negative_int_value(), output); + } + + // optional double double_value = 6; + if (has_double_value()) { + ::google::protobuf::internal::WireFormatLite::WriteDouble(6, this->double_value(), output); + } + + // optional bytes string_value = 7; + if (has_string_value()) { + ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased( + 7, this->string_value(), output); + } + + // optional string aggregate_value = 8; + if (has_aggregate_value()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->aggregate_value().data(), this->aggregate_value().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.UninterpretedOption.aggregate_value"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 8, this->aggregate_value(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.UninterpretedOption) +} + +::google::protobuf::uint8* UninterpretedOption::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.UninterpretedOption) + // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + for (unsigned int i = 0, n = this->name_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 2, this->name(i), target); + } + + // optional string identifier_value = 3; + if (has_identifier_value()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->identifier_value().data(), this->identifier_value().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.UninterpretedOption.identifier_value"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->identifier_value(), target); + } + + // optional uint64 positive_int_value = 4; + if (has_positive_int_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(4, this->positive_int_value(), target); + } + + // optional int64 negative_int_value = 5; + if (has_negative_int_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt64ToArray(5, this->negative_int_value(), target); + } + + // optional double double_value = 6; + if (has_double_value()) { + target = ::google::protobuf::internal::WireFormatLite::WriteDoubleToArray(6, this->double_value(), target); + } + + // optional bytes string_value = 7; + if (has_string_value()) { + target = + ::google::protobuf::internal::WireFormatLite::WriteBytesToArray( + 7, this->string_value(), target); + } + + // optional string aggregate_value = 8; + if (has_aggregate_value()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->aggregate_value().data(), this->aggregate_value().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.UninterpretedOption.aggregate_value"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 8, this->aggregate_value(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.UninterpretedOption) + return target; +} + +int UninterpretedOption::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.UninterpretedOption) + int total_size = 0; + + if (_has_bits_[1 / 32] & 126u) { + // optional string identifier_value = 3; + if (has_identifier_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->identifier_value()); + } + + // optional uint64 positive_int_value = 4; + if (has_positive_int_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::UInt64Size( + this->positive_int_value()); + } + + // optional int64 negative_int_value = 5; + if (has_negative_int_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int64Size( + this->negative_int_value()); + } + + // optional double double_value = 6; + if (has_double_value()) { + total_size += 1 + 8; + } + + // optional bytes string_value = 7; + if (has_string_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::BytesSize( + this->string_value()); + } + + // optional string aggregate_value = 8; + if (has_aggregate_value()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->aggregate_value()); + } + + } + // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + total_size += 1 * this->name_size(); + for (int i = 0; i < this->name_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->name(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void UninterpretedOption::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.UninterpretedOption) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const UninterpretedOption* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.UninterpretedOption) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.UninterpretedOption) + MergeFrom(*source); + } +} + +void UninterpretedOption::MergeFrom(const UninterpretedOption& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.UninterpretedOption) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + name_.MergeFrom(from.name_); + if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (from.has_identifier_value()) { + set_has_identifier_value(); + identifier_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.identifier_value_); + } + if (from.has_positive_int_value()) { + set_positive_int_value(from.positive_int_value()); + } + if (from.has_negative_int_value()) { + set_negative_int_value(from.negative_int_value()); + } + if (from.has_double_value()) { + set_double_value(from.double_value()); + } + if (from.has_string_value()) { + set_has_string_value(); + string_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.string_value_); + } + if (from.has_aggregate_value()) { + set_has_aggregate_value(); + aggregate_value_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aggregate_value_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void UninterpretedOption::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.UninterpretedOption) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void UninterpretedOption::CopyFrom(const UninterpretedOption& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.UninterpretedOption) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool UninterpretedOption::IsInitialized() const { + + if (!::google::protobuf::internal::AllAreInitialized(this->name())) return false; + return true; +} + +void UninterpretedOption::Swap(UninterpretedOption* other) { + if (other == this) return; + InternalSwap(other); +} +void UninterpretedOption::InternalSwap(UninterpretedOption* other) { + name_.UnsafeArenaSwap(&other->name_); + identifier_value_.Swap(&other->identifier_value_); + std::swap(positive_int_value_, other->positive_int_value_); + std::swap(negative_int_value_, other->negative_int_value_); + std::swap(double_value_, other->double_value_); + string_value_.Swap(&other->string_value_); + aggregate_value_.Swap(&other->aggregate_value_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata UninterpretedOption::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = UninterpretedOption_descriptor_; + metadata.reflection = UninterpretedOption_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// UninterpretedOption_NamePart + +// required string name_part = 1; +bool UninterpretedOption_NamePart::has_name_part() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +void UninterpretedOption_NamePart::set_has_name_part() { + _has_bits_[0] |= 0x00000001u; +} +void UninterpretedOption_NamePart::clear_has_name_part() { + _has_bits_[0] &= ~0x00000001u; +} +void UninterpretedOption_NamePart::clear_name_part() { + name_part_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name_part(); +} + const ::std::string& UninterpretedOption_NamePart::name_part() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part) + return name_part_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) { + set_has_name_part(); + name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.name_part) +} + void UninterpretedOption_NamePart::set_name_part(const char* value) { + set_has_name_part(); + name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.NamePart.name_part) +} + void UninterpretedOption_NamePart::set_name_part(const char* value, size_t size) { + set_has_name_part(); + name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.NamePart.name_part) +} + ::std::string* UninterpretedOption_NamePart::mutable_name_part() { + set_has_name_part(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.NamePart.name_part) + return name_part_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* UninterpretedOption_NamePart::release_name_part() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part) + clear_has_name_part(); + return name_part_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) { + if (name_part != NULL) { + set_has_name_part(); + } else { + clear_has_name_part(); + } + name_part_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part) +} + +// required bool is_extension = 2; +bool UninterpretedOption_NamePart::has_is_extension() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void UninterpretedOption_NamePart::set_has_is_extension() { + _has_bits_[0] |= 0x00000002u; +} +void UninterpretedOption_NamePart::clear_has_is_extension() { + _has_bits_[0] &= ~0x00000002u; +} +void UninterpretedOption_NamePart::clear_is_extension() { + is_extension_ = false; + clear_has_is_extension(); +} + bool UninterpretedOption_NamePart::is_extension() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.is_extension) + return is_extension_; +} + void UninterpretedOption_NamePart::set_is_extension(bool value) { + set_has_is_extension(); + is_extension_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.is_extension) +} + +// ------------------------------------------------------------------- + +// UninterpretedOption + +// repeated .google.protobuf.UninterpretedOption.NamePart name = 2; +int UninterpretedOption::name_size() const { + return name_.size(); +} +void UninterpretedOption::clear_name() { + name_.Clear(); +} +const ::google::protobuf::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name) + return name_.Get(index); +} +::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.name) + return name_.Mutable(index); +} +::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::add_name() { + // @@protoc_insertion_point(field_add:google.protobuf.UninterpretedOption.name) + return name_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >* +UninterpretedOption::mutable_name() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.UninterpretedOption.name) + return &name_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >& +UninterpretedOption::name() const { + // @@protoc_insertion_point(field_list:google.protobuf.UninterpretedOption.name) + return name_; +} + +// optional string identifier_value = 3; +bool UninterpretedOption::has_identifier_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void UninterpretedOption::set_has_identifier_value() { + _has_bits_[0] |= 0x00000002u; +} +void UninterpretedOption::clear_has_identifier_value() { + _has_bits_[0] &= ~0x00000002u; +} +void UninterpretedOption::clear_identifier_value() { + identifier_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_identifier_value(); +} + const ::std::string& UninterpretedOption::identifier_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value) + return identifier_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption::set_identifier_value(const ::std::string& value) { + set_has_identifier_value(); + identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.identifier_value) +} + void UninterpretedOption::set_identifier_value(const char* value) { + set_has_identifier_value(); + identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.identifier_value) +} + void UninterpretedOption::set_identifier_value(const char* value, size_t size) { + set_has_identifier_value(); + identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.identifier_value) +} + ::std::string* UninterpretedOption::mutable_identifier_value() { + set_has_identifier_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.identifier_value) + return identifier_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* UninterpretedOption::release_identifier_value() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value) + clear_has_identifier_value(); + return identifier_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) { + if (identifier_value != NULL) { + set_has_identifier_value(); + } else { + clear_has_identifier_value(); + } + identifier_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value) +} + +// optional uint64 positive_int_value = 4; +bool UninterpretedOption::has_positive_int_value() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void UninterpretedOption::set_has_positive_int_value() { + _has_bits_[0] |= 0x00000004u; +} +void UninterpretedOption::clear_has_positive_int_value() { + _has_bits_[0] &= ~0x00000004u; +} +void UninterpretedOption::clear_positive_int_value() { + positive_int_value_ = GOOGLE_ULONGLONG(0); + clear_has_positive_int_value(); +} + ::google::protobuf::uint64 UninterpretedOption::positive_int_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.positive_int_value) + return positive_int_value_; +} + void UninterpretedOption::set_positive_int_value(::google::protobuf::uint64 value) { + set_has_positive_int_value(); + positive_int_value_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.positive_int_value) +} + +// optional int64 negative_int_value = 5; +bool UninterpretedOption::has_negative_int_value() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void UninterpretedOption::set_has_negative_int_value() { + _has_bits_[0] |= 0x00000008u; +} +void UninterpretedOption::clear_has_negative_int_value() { + _has_bits_[0] &= ~0x00000008u; +} +void UninterpretedOption::clear_negative_int_value() { + negative_int_value_ = GOOGLE_LONGLONG(0); + clear_has_negative_int_value(); +} + ::google::protobuf::int64 UninterpretedOption::negative_int_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.negative_int_value) + return negative_int_value_; +} + void UninterpretedOption::set_negative_int_value(::google::protobuf::int64 value) { + set_has_negative_int_value(); + negative_int_value_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.negative_int_value) +} + +// optional double double_value = 6; +bool UninterpretedOption::has_double_value() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +void UninterpretedOption::set_has_double_value() { + _has_bits_[0] |= 0x00000010u; +} +void UninterpretedOption::clear_has_double_value() { + _has_bits_[0] &= ~0x00000010u; +} +void UninterpretedOption::clear_double_value() { + double_value_ = 0; + clear_has_double_value(); +} + double UninterpretedOption::double_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.double_value) + return double_value_; +} + void UninterpretedOption::set_double_value(double value) { + set_has_double_value(); + double_value_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.double_value) +} + +// optional bytes string_value = 7; +bool UninterpretedOption::has_string_value() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +void UninterpretedOption::set_has_string_value() { + _has_bits_[0] |= 0x00000020u; +} +void UninterpretedOption::clear_has_string_value() { + _has_bits_[0] &= ~0x00000020u; +} +void UninterpretedOption::clear_string_value() { + string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_string_value(); +} + const ::std::string& UninterpretedOption::string_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value) + return string_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption::set_string_value(const ::std::string& value) { + set_has_string_value(); + string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.string_value) +} + void UninterpretedOption::set_string_value(const char* value) { + set_has_string_value(); + string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.string_value) +} + void UninterpretedOption::set_string_value(const void* value, size_t size) { + set_has_string_value(); + string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.string_value) +} + ::std::string* UninterpretedOption::mutable_string_value() { + set_has_string_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.string_value) + return string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* UninterpretedOption::release_string_value() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value) + clear_has_string_value(); + return string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption::set_allocated_string_value(::std::string* string_value) { + if (string_value != NULL) { + set_has_string_value(); + } else { + clear_has_string_value(); + } + string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value) +} + +// optional string aggregate_value = 8; +bool UninterpretedOption::has_aggregate_value() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +void UninterpretedOption::set_has_aggregate_value() { + _has_bits_[0] |= 0x00000040u; +} +void UninterpretedOption::clear_has_aggregate_value() { + _has_bits_[0] &= ~0x00000040u; +} +void UninterpretedOption::clear_aggregate_value() { + aggregate_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_aggregate_value(); +} + const ::std::string& UninterpretedOption::aggregate_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value) + return aggregate_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption::set_aggregate_value(const ::std::string& value) { + set_has_aggregate_value(); + aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.aggregate_value) +} + void UninterpretedOption::set_aggregate_value(const char* value) { + set_has_aggregate_value(); + aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.aggregate_value) +} + void UninterpretedOption::set_aggregate_value(const char* value, size_t size) { + set_has_aggregate_value(); + aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.aggregate_value) +} + ::std::string* UninterpretedOption::mutable_aggregate_value() { + set_has_aggregate_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.aggregate_value) + return aggregate_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* UninterpretedOption::release_aggregate_value() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value) + clear_has_aggregate_value(); + return aggregate_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) { + if (aggregate_value != NULL) { + set_has_aggregate_value(); + } else { + clear_has_aggregate_value(); + } + aggregate_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value) +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SourceCodeInfo_Location::kPathFieldNumber; +const int SourceCodeInfo_Location::kSpanFieldNumber; +const int SourceCodeInfo_Location::kLeadingCommentsFieldNumber; +const int SourceCodeInfo_Location::kTrailingCommentsFieldNumber; +const int SourceCodeInfo_Location::kLeadingDetachedCommentsFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SourceCodeInfo_Location::SourceCodeInfo_Location() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo.Location) +} + +void SourceCodeInfo_Location::InitAsDefaultInstance() { +} + +SourceCodeInfo_Location::SourceCodeInfo_Location(const SourceCodeInfo_Location& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceCodeInfo.Location) +} + +void SourceCodeInfo_Location::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + leading_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + trailing_comments_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SourceCodeInfo_Location::~SourceCodeInfo_Location() { + // @@protoc_insertion_point(destructor:google.protobuf.SourceCodeInfo.Location) + SharedDtor(); +} + +void SourceCodeInfo_Location::SharedDtor() { + leading_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + trailing_comments_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void SourceCodeInfo_Location::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SourceCodeInfo_Location::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SourceCodeInfo_Location_descriptor_; +} + +const SourceCodeInfo_Location& SourceCodeInfo_Location::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +SourceCodeInfo_Location* SourceCodeInfo_Location::default_instance_ = NULL; + +SourceCodeInfo_Location* SourceCodeInfo_Location::New(::google::protobuf::Arena* arena) const { + SourceCodeInfo_Location* n = new SourceCodeInfo_Location; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SourceCodeInfo_Location::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.SourceCodeInfo.Location) + if (_has_bits_[0 / 32] & 12u) { + if (has_leading_comments()) { + leading_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + if (has_trailing_comments()) { + trailing_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + path_.Clear(); + span_.Clear(); + leading_detached_comments_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SourceCodeInfo_Location::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.SourceCodeInfo.Location) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 path = 1 [packed = true]; + case 1: { + if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_path()))); + } else if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10, input, this->mutable_path()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_span; + break; + } + + // repeated int32 span = 2 [packed = true]; + case 2: { + if (tag == 18) { + parse_span: + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_span()))); + } else if (tag == 16) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 18, input, this->mutable_span()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(26)) goto parse_leading_comments; + break; + } + + // optional string leading_comments = 3; + case 3: { + if (tag == 26) { + parse_leading_comments: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_leading_comments())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->leading_comments().data(), this->leading_comments().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.SourceCodeInfo.Location.leading_comments"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(34)) goto parse_trailing_comments; + break; + } + + // optional string trailing_comments = 4; + case 4: { + if (tag == 34) { + parse_trailing_comments: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_trailing_comments())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->trailing_comments().data(), this->trailing_comments().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.SourceCodeInfo.Location.trailing_comments"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_leading_detached_comments; + break; + } + + // repeated string leading_detached_comments = 6; + case 6: { + if (tag == 50) { + parse_leading_detached_comments: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->add_leading_detached_comments())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->leading_detached_comments(this->leading_detached_comments_size() - 1).data(), + this->leading_detached_comments(this->leading_detached_comments_size() - 1).length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.SourceCodeInfo.Location.leading_detached_comments"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(50)) goto parse_leading_detached_comments; + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.SourceCodeInfo.Location) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.SourceCodeInfo.Location) + return false; +#undef DO_ +} + +void SourceCodeInfo_Location::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.SourceCodeInfo.Location) + // repeated int32 path = 1 [packed = true]; + if (this->path_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_path_cached_byte_size_); + } + for (int i = 0; i < this->path_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->path(i), output); + } + + // repeated int32 span = 2 [packed = true]; + if (this->span_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_span_cached_byte_size_); + } + for (int i = 0; i < this->span_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->span(i), output); + } + + // optional string leading_comments = 3; + if (has_leading_comments()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->leading_comments().data(), this->leading_comments().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.SourceCodeInfo.Location.leading_comments"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 3, this->leading_comments(), output); + } + + // optional string trailing_comments = 4; + if (has_trailing_comments()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->trailing_comments().data(), this->trailing_comments().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.SourceCodeInfo.Location.trailing_comments"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 4, this->trailing_comments(), output); + } + + // repeated string leading_detached_comments = 6; + for (int i = 0; i < this->leading_detached_comments_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->leading_detached_comments(i).data(), this->leading_detached_comments(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.SourceCodeInfo.Location.leading_detached_comments"); + ::google::protobuf::internal::WireFormatLite::WriteString( + 6, this->leading_detached_comments(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.SourceCodeInfo.Location) +} + +::google::protobuf::uint8* SourceCodeInfo_Location::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo.Location) + // repeated int32 path = 1 [packed = true]; + if (this->path_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _path_cached_byte_size_, target); + } + for (int i = 0; i < this->path_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->path(i), target); + } + + // repeated int32 span = 2 [packed = true]; + if (this->span_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 2, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _span_cached_byte_size_, target); + } + for (int i = 0; i < this->span_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->span(i), target); + } + + // optional string leading_comments = 3; + if (has_leading_comments()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->leading_comments().data(), this->leading_comments().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.SourceCodeInfo.Location.leading_comments"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 3, this->leading_comments(), target); + } + + // optional string trailing_comments = 4; + if (has_trailing_comments()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->trailing_comments().data(), this->trailing_comments().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.SourceCodeInfo.Location.trailing_comments"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 4, this->trailing_comments(), target); + } + + // repeated string leading_detached_comments = 6; + for (int i = 0; i < this->leading_detached_comments_size(); i++) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->leading_detached_comments(i).data(), this->leading_detached_comments(i).length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.SourceCodeInfo.Location.leading_detached_comments"); + target = ::google::protobuf::internal::WireFormatLite:: + WriteStringToArray(6, this->leading_detached_comments(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceCodeInfo.Location) + return target; +} + +int SourceCodeInfo_Location::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceCodeInfo.Location) + int total_size = 0; + + if (_has_bits_[2 / 32] & 12u) { + // optional string leading_comments = 3; + if (has_leading_comments()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->leading_comments()); + } + + // optional string trailing_comments = 4; + if (has_trailing_comments()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->trailing_comments()); + } + + } + // repeated int32 path = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->path_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->path(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _path_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated int32 span = 2 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->span_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->span(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _span_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + // repeated string leading_detached_comments = 6; + total_size += 1 * this->leading_detached_comments_size(); + for (int i = 0; i < this->leading_detached_comments_size(); i++) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this->leading_detached_comments(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SourceCodeInfo_Location::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.SourceCodeInfo.Location) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SourceCodeInfo_Location* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceCodeInfo.Location) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.SourceCodeInfo.Location) + MergeFrom(*source); + } +} + +void SourceCodeInfo_Location::MergeFrom(const SourceCodeInfo_Location& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceCodeInfo.Location) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + path_.MergeFrom(from.path_); + span_.MergeFrom(from.span_); + leading_detached_comments_.MergeFrom(from.leading_detached_comments_); + if (from._has_bits_[2 / 32] & (0xffu << (2 % 32))) { + if (from.has_leading_comments()) { + set_has_leading_comments(); + leading_comments_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.leading_comments_); + } + if (from.has_trailing_comments()) { + set_has_trailing_comments(); + trailing_comments_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.trailing_comments_); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SourceCodeInfo_Location::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.SourceCodeInfo.Location) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SourceCodeInfo_Location::CopyFrom(const SourceCodeInfo_Location& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.SourceCodeInfo.Location) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SourceCodeInfo_Location::IsInitialized() const { + + return true; +} + +void SourceCodeInfo_Location::Swap(SourceCodeInfo_Location* other) { + if (other == this) return; + InternalSwap(other); +} +void SourceCodeInfo_Location::InternalSwap(SourceCodeInfo_Location* other) { + path_.UnsafeArenaSwap(&other->path_); + span_.UnsafeArenaSwap(&other->span_); + leading_comments_.Swap(&other->leading_comments_); + trailing_comments_.Swap(&other->trailing_comments_); + leading_detached_comments_.UnsafeArenaSwap(&other->leading_detached_comments_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SourceCodeInfo_Location::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SourceCodeInfo_Location_descriptor_; + metadata.reflection = SourceCodeInfo_Location_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int SourceCodeInfo::kLocationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +SourceCodeInfo::SourceCodeInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.SourceCodeInfo) +} + +void SourceCodeInfo::InitAsDefaultInstance() { +} + +SourceCodeInfo::SourceCodeInfo(const SourceCodeInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.SourceCodeInfo) +} + +void SourceCodeInfo::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +SourceCodeInfo::~SourceCodeInfo() { + // @@protoc_insertion_point(destructor:google.protobuf.SourceCodeInfo) + SharedDtor(); +} + +void SourceCodeInfo::SharedDtor() { + if (this != default_instance_) { + } +} + +void SourceCodeInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* SourceCodeInfo::descriptor() { + protobuf_AssignDescriptorsOnce(); + return SourceCodeInfo_descriptor_; +} + +const SourceCodeInfo& SourceCodeInfo::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +SourceCodeInfo* SourceCodeInfo::default_instance_ = NULL; + +SourceCodeInfo* SourceCodeInfo::New(::google::protobuf::Arena* arena) const { + SourceCodeInfo* n = new SourceCodeInfo; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void SourceCodeInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.SourceCodeInfo) + location_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool SourceCodeInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.SourceCodeInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.SourceCodeInfo.Location location = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_location: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_location())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_location; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.SourceCodeInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.SourceCodeInfo) + return false; +#undef DO_ +} + +void SourceCodeInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.SourceCodeInfo) + // repeated .google.protobuf.SourceCodeInfo.Location location = 1; + for (unsigned int i = 0, n = this->location_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->location(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.SourceCodeInfo) +} + +::google::protobuf::uint8* SourceCodeInfo::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.SourceCodeInfo) + // repeated .google.protobuf.SourceCodeInfo.Location location = 1; + for (unsigned int i = 0, n = this->location_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->location(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.SourceCodeInfo) + return target; +} + +int SourceCodeInfo::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.SourceCodeInfo) + int total_size = 0; + + // repeated .google.protobuf.SourceCodeInfo.Location location = 1; + total_size += 1 * this->location_size(); + for (int i = 0; i < this->location_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->location(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void SourceCodeInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.SourceCodeInfo) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const SourceCodeInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.SourceCodeInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.SourceCodeInfo) + MergeFrom(*source); + } +} + +void SourceCodeInfo::MergeFrom(const SourceCodeInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.SourceCodeInfo) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + location_.MergeFrom(from.location_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void SourceCodeInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.SourceCodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SourceCodeInfo::CopyFrom(const SourceCodeInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.SourceCodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SourceCodeInfo::IsInitialized() const { + + return true; +} + +void SourceCodeInfo::Swap(SourceCodeInfo* other) { + if (other == this) return; + InternalSwap(other); +} +void SourceCodeInfo::InternalSwap(SourceCodeInfo* other) { + location_.UnsafeArenaSwap(&other->location_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata SourceCodeInfo::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = SourceCodeInfo_descriptor_; + metadata.reflection = SourceCodeInfo_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// SourceCodeInfo_Location + +// repeated int32 path = 1 [packed = true]; +int SourceCodeInfo_Location::path_size() const { + return path_.size(); +} +void SourceCodeInfo_Location::clear_path() { + path_.Clear(); +} + ::google::protobuf::int32 SourceCodeInfo_Location::path(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path) + return path_.Get(index); +} + void SourceCodeInfo_Location::set_path(int index, ::google::protobuf::int32 value) { + path_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.path) +} + void SourceCodeInfo_Location::add_path(::google::protobuf::int32 value) { + path_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.path) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SourceCodeInfo_Location::path() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.path) + return path_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SourceCodeInfo_Location::mutable_path() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.path) + return &path_; +} + +// repeated int32 span = 2 [packed = true]; +int SourceCodeInfo_Location::span_size() const { + return span_.size(); +} +void SourceCodeInfo_Location::clear_span() { + span_.Clear(); +} + ::google::protobuf::int32 SourceCodeInfo_Location::span(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span) + return span_.Get(index); +} + void SourceCodeInfo_Location::set_span(int index, ::google::protobuf::int32 value) { + span_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.span) +} + void SourceCodeInfo_Location::add_span(::google::protobuf::int32 value) { + span_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.span) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SourceCodeInfo_Location::span() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.span) + return span_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SourceCodeInfo_Location::mutable_span() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.span) + return &span_; +} + +// optional string leading_comments = 3; +bool SourceCodeInfo_Location::has_leading_comments() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void SourceCodeInfo_Location::set_has_leading_comments() { + _has_bits_[0] |= 0x00000004u; +} +void SourceCodeInfo_Location::clear_has_leading_comments() { + _has_bits_[0] &= ~0x00000004u; +} +void SourceCodeInfo_Location::clear_leading_comments() { + leading_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_leading_comments(); +} + const ::std::string& SourceCodeInfo_Location::leading_comments() const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments) + return leading_comments_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) { + set_has_leading_comments(); + leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_comments) +} + void SourceCodeInfo_Location::set_leading_comments(const char* value) { + set_has_leading_comments(); + leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_comments) +} + void SourceCodeInfo_Location::set_leading_comments(const char* value, size_t size) { + set_has_leading_comments(); + leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_comments) +} + ::std::string* SourceCodeInfo_Location::mutable_leading_comments() { + set_has_leading_comments(); + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_comments) + return leading_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SourceCodeInfo_Location::release_leading_comments() { + // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments) + clear_has_leading_comments(); + return leading_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) { + if (leading_comments != NULL) { + set_has_leading_comments(); + } else { + clear_has_leading_comments(); + } + leading_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments) +} + +// optional string trailing_comments = 4; +bool SourceCodeInfo_Location::has_trailing_comments() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void SourceCodeInfo_Location::set_has_trailing_comments() { + _has_bits_[0] |= 0x00000008u; +} +void SourceCodeInfo_Location::clear_has_trailing_comments() { + _has_bits_[0] &= ~0x00000008u; +} +void SourceCodeInfo_Location::clear_trailing_comments() { + trailing_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_trailing_comments(); +} + const ::std::string& SourceCodeInfo_Location::trailing_comments() const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments) + return trailing_comments_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) { + set_has_trailing_comments(); + trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} + void SourceCodeInfo_Location::set_trailing_comments(const char* value) { + set_has_trailing_comments(); + trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} + void SourceCodeInfo_Location::set_trailing_comments(const char* value, size_t size) { + set_has_trailing_comments(); + trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} + ::std::string* SourceCodeInfo_Location::mutable_trailing_comments() { + set_has_trailing_comments(); + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.trailing_comments) + return trailing_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* SourceCodeInfo_Location::release_trailing_comments() { + // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) + clear_has_trailing_comments(); + return trailing_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) { + if (trailing_comments != NULL) { + set_has_trailing_comments(); + } else { + clear_has_trailing_comments(); + } + trailing_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} + +// repeated string leading_detached_comments = 6; +int SourceCodeInfo_Location::leading_detached_comments_size() const { + return leading_detached_comments_.size(); +} +void SourceCodeInfo_Location::clear_leading_detached_comments() { + leading_detached_comments_.Clear(); +} + const ::std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_.Get(index); +} + ::std::string* SourceCodeInfo_Location::mutable_leading_detached_comments(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_.Mutable(index); +} + void SourceCodeInfo_Location::set_leading_detached_comments(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + leading_detached_comments_.Mutable(index)->assign(value); +} + void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { + leading_detached_comments_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} + void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value, size_t size) { + leading_detached_comments_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} + ::std::string* SourceCodeInfo_Location::add_leading_detached_comments() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_.Add(); +} + void SourceCodeInfo_Location::add_leading_detached_comments(const ::std::string& value) { + leading_detached_comments_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} + void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { + leading_detached_comments_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} + void SourceCodeInfo_Location::add_leading_detached_comments(const char* value, size_t size) { + leading_detached_comments_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} + const ::google::protobuf::RepeatedPtrField< ::std::string>& +SourceCodeInfo_Location::leading_detached_comments() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_; +} + ::google::protobuf::RepeatedPtrField< ::std::string>* +SourceCodeInfo_Location::mutable_leading_detached_comments() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return &leading_detached_comments_; +} + +// ------------------------------------------------------------------- + +// SourceCodeInfo + +// repeated .google.protobuf.SourceCodeInfo.Location location = 1; +int SourceCodeInfo::location_size() const { + return location_.size(); +} +void SourceCodeInfo::clear_location() { + location_.Clear(); +} +const ::google::protobuf::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location) + return location_.Get(index); +} +::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.location) + return location_.Mutable(index); +} +::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::add_location() { + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.location) + return location_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >* +SourceCodeInfo::mutable_location() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.location) + return &location_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >& +SourceCodeInfo::location() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.location) + return location_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// =================================================================== + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GeneratedCodeInfo_Annotation::kPathFieldNumber; +const int GeneratedCodeInfo_Annotation::kSourceFileFieldNumber; +const int GeneratedCodeInfo_Annotation::kBeginFieldNumber; +const int GeneratedCodeInfo_Annotation::kEndFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo.Annotation) +} + +void GeneratedCodeInfo_Annotation::InitAsDefaultInstance() { +} + +GeneratedCodeInfo_Annotation::GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.GeneratedCodeInfo.Annotation) +} + +void GeneratedCodeInfo_Annotation::SharedCtor() { + ::google::protobuf::internal::GetEmptyString(); + _cached_size_ = 0; + source_file_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + begin_ = 0; + end_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +GeneratedCodeInfo_Annotation::~GeneratedCodeInfo_Annotation() { + // @@protoc_insertion_point(destructor:google.protobuf.GeneratedCodeInfo.Annotation) + SharedDtor(); +} + +void GeneratedCodeInfo_Annotation::SharedDtor() { + source_file_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + if (this != default_instance_) { + } +} + +void GeneratedCodeInfo_Annotation::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* GeneratedCodeInfo_Annotation::descriptor() { + protobuf_AssignDescriptorsOnce(); + return GeneratedCodeInfo_Annotation_descriptor_; +} + +const GeneratedCodeInfo_Annotation& GeneratedCodeInfo_Annotation::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +GeneratedCodeInfo_Annotation* GeneratedCodeInfo_Annotation::default_instance_ = NULL; + +GeneratedCodeInfo_Annotation* GeneratedCodeInfo_Annotation::New(::google::protobuf::Arena* arena) const { + GeneratedCodeInfo_Annotation* n = new GeneratedCodeInfo_Annotation; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void GeneratedCodeInfo_Annotation::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.GeneratedCodeInfo.Annotation) +#if defined(__clang__) +#define ZR_HELPER_(f) \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \ + __builtin_offsetof(GeneratedCodeInfo_Annotation, f) \ + _Pragma("clang diagnostic pop") +#else +#define ZR_HELPER_(f) reinterpret_cast(\ + &reinterpret_cast(16)->f) +#endif + +#define ZR_(first, last) do {\ + ::memset(&first, 0,\ + ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\ +} while (0) + + if (_has_bits_[0 / 32] & 14u) { + ZR_(begin_, end_); + if (has_source_file()) { + source_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + } + } + +#undef ZR_HELPER_ +#undef ZR_ + + path_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool GeneratedCodeInfo_Annotation::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.GeneratedCodeInfo.Annotation) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated int32 path = 1 [packed = true]; + case 1: { + if (tag == 10) { + DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, this->mutable_path()))); + } else if (tag == 8) { + DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + 1, 10, input, this->mutable_path()))); + } else { + goto handle_unusual; + } + if (input->ExpectTag(18)) goto parse_source_file; + break; + } + + // optional string source_file = 2; + case 2: { + if (tag == 18) { + parse_source_file: + DO_(::google::protobuf::internal::WireFormatLite::ReadString( + input, this->mutable_source_file())); + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source_file().data(), this->source_file().length(), + ::google::protobuf::internal::WireFormat::PARSE, + "google.protobuf.GeneratedCodeInfo.Annotation.source_file"); + } else { + goto handle_unusual; + } + if (input->ExpectTag(24)) goto parse_begin; + break; + } + + // optional int32 begin = 3; + case 3: { + if (tag == 24) { + parse_begin: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &begin_))); + set_has_begin(); + } else { + goto handle_unusual; + } + if (input->ExpectTag(32)) goto parse_end; + break; + } + + // optional int32 end = 4; + case 4: { + if (tag == 32) { + parse_end: + DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< + ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( + input, &end_))); + set_has_end(); + } else { + goto handle_unusual; + } + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.GeneratedCodeInfo.Annotation) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.GeneratedCodeInfo.Annotation) + return false; +#undef DO_ +} + +void GeneratedCodeInfo_Annotation::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.GeneratedCodeInfo.Annotation) + // repeated int32 path = 1 [packed = true]; + if (this->path_size() > 0) { + ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output); + output->WriteVarint32(_path_cached_byte_size_); + } + for (int i = 0; i < this->path_size(); i++) { + ::google::protobuf::internal::WireFormatLite::WriteInt32NoTag( + this->path(i), output); + } + + // optional string source_file = 2; + if (has_source_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source_file().data(), this->source_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.GeneratedCodeInfo.Annotation.source_file"); + ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased( + 2, this->source_file(), output); + } + + // optional int32 begin = 3; + if (has_begin()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->begin(), output); + } + + // optional int32 end = 4; + if (has_end()) { + ::google::protobuf::internal::WireFormatLite::WriteInt32(4, this->end(), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.GeneratedCodeInfo.Annotation) +} + +::google::protobuf::uint8* GeneratedCodeInfo_Annotation::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo.Annotation) + // repeated int32 path = 1 [packed = true]; + if (this->path_size() > 0) { + target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray( + 1, + ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, + target); + target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray( + _path_cached_byte_size_, target); + } + for (int i = 0; i < this->path_size(); i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32NoTagToArray(this->path(i), target); + } + + // optional string source_file = 2; + if (has_source_file()) { + ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( + this->source_file().data(), this->source_file().length(), + ::google::protobuf::internal::WireFormat::SERIALIZE, + "google.protobuf.GeneratedCodeInfo.Annotation.source_file"); + target = + ::google::protobuf::internal::WireFormatLite::WriteStringToArray( + 2, this->source_file(), target); + } + + // optional int32 begin = 3; + if (has_begin()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->begin(), target); + } + + // optional int32 end = 4; + if (has_end()) { + target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(4, this->end(), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.GeneratedCodeInfo.Annotation) + return target; +} + +int GeneratedCodeInfo_Annotation::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.GeneratedCodeInfo.Annotation) + int total_size = 0; + + if (_has_bits_[1 / 32] & 14u) { + // optional string source_file = 2; + if (has_source_file()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::StringSize( + this->source_file()); + } + + // optional int32 begin = 3; + if (has_begin()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->begin()); + } + + // optional int32 end = 4; + if (has_end()) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size( + this->end()); + } + + } + // repeated int32 path = 1 [packed = true]; + { + int data_size = 0; + for (int i = 0; i < this->path_size(); i++) { + data_size += ::google::protobuf::internal::WireFormatLite:: + Int32Size(this->path(i)); + } + if (data_size > 0) { + total_size += 1 + + ::google::protobuf::internal::WireFormatLite::Int32Size(data_size); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _path_cached_byte_size_ = data_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + total_size += data_size; + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void GeneratedCodeInfo_Annotation::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.GeneratedCodeInfo.Annotation) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const GeneratedCodeInfo_Annotation* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.GeneratedCodeInfo.Annotation) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.GeneratedCodeInfo.Annotation) + MergeFrom(*source); + } +} + +void GeneratedCodeInfo_Annotation::MergeFrom(const GeneratedCodeInfo_Annotation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.GeneratedCodeInfo.Annotation) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + path_.MergeFrom(from.path_); + if (from._has_bits_[1 / 32] & (0xffu << (1 % 32))) { + if (from.has_source_file()) { + set_has_source_file(); + source_file_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.source_file_); + } + if (from.has_begin()) { + set_begin(from.begin()); + } + if (from.has_end()) { + set_end(from.end()); + } + } + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void GeneratedCodeInfo_Annotation::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.GeneratedCodeInfo.Annotation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GeneratedCodeInfo_Annotation::CopyFrom(const GeneratedCodeInfo_Annotation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.GeneratedCodeInfo.Annotation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GeneratedCodeInfo_Annotation::IsInitialized() const { + + return true; +} + +void GeneratedCodeInfo_Annotation::Swap(GeneratedCodeInfo_Annotation* other) { + if (other == this) return; + InternalSwap(other); +} +void GeneratedCodeInfo_Annotation::InternalSwap(GeneratedCodeInfo_Annotation* other) { + path_.UnsafeArenaSwap(&other->path_); + source_file_.Swap(&other->source_file_); + std::swap(begin_, other->begin_); + std::swap(end_, other->end_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata GeneratedCodeInfo_Annotation::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = GeneratedCodeInfo_Annotation_descriptor_; + metadata.reflection = GeneratedCodeInfo_Annotation_reflection_; + return metadata; +} + + +// ------------------------------------------------------------------- + +#if !defined(_MSC_VER) || _MSC_VER >= 1900 +const int GeneratedCodeInfo::kAnnotationFieldNumber; +#endif // !defined(_MSC_VER) || _MSC_VER >= 1900 + +GeneratedCodeInfo::GeneratedCodeInfo() + : ::google::protobuf::Message(), _internal_metadata_(NULL) { + SharedCtor(); + // @@protoc_insertion_point(constructor:google.protobuf.GeneratedCodeInfo) +} + +void GeneratedCodeInfo::InitAsDefaultInstance() { +} + +GeneratedCodeInfo::GeneratedCodeInfo(const GeneratedCodeInfo& from) + : ::google::protobuf::Message(), + _internal_metadata_(NULL) { + SharedCtor(); + MergeFrom(from); + // @@protoc_insertion_point(copy_constructor:google.protobuf.GeneratedCodeInfo) +} + +void GeneratedCodeInfo::SharedCtor() { + _cached_size_ = 0; + ::memset(_has_bits_, 0, sizeof(_has_bits_)); +} + +GeneratedCodeInfo::~GeneratedCodeInfo() { + // @@protoc_insertion_point(destructor:google.protobuf.GeneratedCodeInfo) + SharedDtor(); +} + +void GeneratedCodeInfo::SharedDtor() { + if (this != default_instance_) { + } +} + +void GeneratedCodeInfo::SetCachedSize(int size) const { + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); +} +const ::google::protobuf::Descriptor* GeneratedCodeInfo::descriptor() { + protobuf_AssignDescriptorsOnce(); + return GeneratedCodeInfo_descriptor_; +} + +const GeneratedCodeInfo& GeneratedCodeInfo::default_instance() { + if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + return *default_instance_; +} + +GeneratedCodeInfo* GeneratedCodeInfo::default_instance_ = NULL; + +GeneratedCodeInfo* GeneratedCodeInfo::New(::google::protobuf::Arena* arena) const { + GeneratedCodeInfo* n = new GeneratedCodeInfo; + if (arena != NULL) { + arena->Own(n); + } + return n; +} + +void GeneratedCodeInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:google.protobuf.GeneratedCodeInfo) + annotation_.Clear(); + ::memset(_has_bits_, 0, sizeof(_has_bits_)); + if (_internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->Clear(); + } +} + +bool GeneratedCodeInfo::MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input) { +#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure + ::google::protobuf::uint32 tag; + // @@protoc_insertion_point(parse_start:google.protobuf.GeneratedCodeInfo) + for (;;) { + ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); + tag = p.first; + if (!p.second) goto handle_unusual; + switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { + // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + case 1: { + if (tag == 10) { + DO_(input->IncrementRecursionDepth()); + parse_loop_annotation: + DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth( + input, add_annotation())); + } else { + goto handle_unusual; + } + if (input->ExpectTag(10)) goto parse_loop_annotation; + input->UnsafeDecrementRecursionDepth(); + if (input->ExpectAtEnd()) goto success; + break; + } + + default: { + handle_unusual: + if (tag == 0 || + ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == + ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { + goto success; + } + DO_(::google::protobuf::internal::WireFormat::SkipField( + input, tag, mutable_unknown_fields())); + break; + } + } + } +success: + // @@protoc_insertion_point(parse_success:google.protobuf.GeneratedCodeInfo) + return true; +failure: + // @@protoc_insertion_point(parse_failure:google.protobuf.GeneratedCodeInfo) + return false; +#undef DO_ +} + +void GeneratedCodeInfo::SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const { + // @@protoc_insertion_point(serialize_start:google.protobuf.GeneratedCodeInfo) + // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + for (unsigned int i = 0, n = this->annotation_size(); i < n; i++) { + ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray( + 1, this->annotation(i), output); + } + + if (_internal_metadata_.have_unknown_fields()) { + ::google::protobuf::internal::WireFormat::SerializeUnknownFields( + unknown_fields(), output); + } + // @@protoc_insertion_point(serialize_end:google.protobuf.GeneratedCodeInfo) +} + +::google::protobuf::uint8* GeneratedCodeInfo::SerializeWithCachedSizesToArray( + ::google::protobuf::uint8* target) const { + // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.GeneratedCodeInfo) + // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + for (unsigned int i = 0, n = this->annotation_size(); i < n; i++) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteMessageNoVirtualToArray( + 1, this->annotation(i), target); + } + + if (_internal_metadata_.have_unknown_fields()) { + target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( + unknown_fields(), target); + } + // @@protoc_insertion_point(serialize_to_array_end:google.protobuf.GeneratedCodeInfo) + return target; +} + +int GeneratedCodeInfo::ByteSize() const { +// @@protoc_insertion_point(message_byte_size_start:google.protobuf.GeneratedCodeInfo) + int total_size = 0; + + // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + total_size += 1 * this->annotation_size(); + for (int i = 0; i < this->annotation_size(); i++) { + total_size += + ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual( + this->annotation(i)); + } + + if (_internal_metadata_.have_unknown_fields()) { + total_size += + ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize( + unknown_fields()); + } + GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN(); + _cached_size_ = total_size; + GOOGLE_SAFE_CONCURRENT_WRITES_END(); + return total_size; +} + +void GeneratedCodeInfo::MergeFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:google.protobuf.GeneratedCodeInfo) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + const GeneratedCodeInfo* source = + ::google::protobuf::internal::DynamicCastToGenerated( + &from); + if (source == NULL) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:google.protobuf.GeneratedCodeInfo) + ::google::protobuf::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:google.protobuf.GeneratedCodeInfo) + MergeFrom(*source); + } +} + +void GeneratedCodeInfo::MergeFrom(const GeneratedCodeInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:google.protobuf.GeneratedCodeInfo) + if (GOOGLE_PREDICT_FALSE(&from == this)) MergeFromFail(__LINE__); + annotation_.MergeFrom(from.annotation_); + if (from._internal_metadata_.have_unknown_fields()) { + mutable_unknown_fields()->MergeFrom(from.unknown_fields()); + } +} + +void GeneratedCodeInfo::CopyFrom(const ::google::protobuf::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:google.protobuf.GeneratedCodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GeneratedCodeInfo::CopyFrom(const GeneratedCodeInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:google.protobuf.GeneratedCodeInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GeneratedCodeInfo::IsInitialized() const { + + return true; +} + +void GeneratedCodeInfo::Swap(GeneratedCodeInfo* other) { + if (other == this) return; + InternalSwap(other); +} +void GeneratedCodeInfo::InternalSwap(GeneratedCodeInfo* other) { + annotation_.UnsafeArenaSwap(&other->annotation_); + std::swap(_has_bits_[0], other->_has_bits_[0]); + _internal_metadata_.Swap(&other->_internal_metadata_); + std::swap(_cached_size_, other->_cached_size_); +} + +::google::protobuf::Metadata GeneratedCodeInfo::GetMetadata() const { + protobuf_AssignDescriptorsOnce(); + ::google::protobuf::Metadata metadata; + metadata.descriptor = GeneratedCodeInfo_descriptor_; + metadata.reflection = GeneratedCodeInfo_reflection_; + return metadata; +} + +#if PROTOBUF_INLINE_NOT_IN_HEADERS +// GeneratedCodeInfo_Annotation + +// repeated int32 path = 1 [packed = true]; +int GeneratedCodeInfo_Annotation::path_size() const { + return path_.size(); +} +void GeneratedCodeInfo_Annotation::clear_path() { + path_.Clear(); +} + ::google::protobuf::int32 GeneratedCodeInfo_Annotation::path(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path) + return path_.Get(index); +} + void GeneratedCodeInfo_Annotation::set_path(int index, ::google::protobuf::int32 value) { + path_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.path) +} + void GeneratedCodeInfo_Annotation::add_path(::google::protobuf::int32 value) { + path_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.Annotation.path) +} + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +GeneratedCodeInfo_Annotation::path() const { + // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.Annotation.path) + return path_; +} + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +GeneratedCodeInfo_Annotation::mutable_path() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.Annotation.path) + return &path_; +} + +// optional string source_file = 2; +bool GeneratedCodeInfo_Annotation::has_source_file() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +void GeneratedCodeInfo_Annotation::set_has_source_file() { + _has_bits_[0] |= 0x00000002u; +} +void GeneratedCodeInfo_Annotation::clear_has_source_file() { + _has_bits_[0] &= ~0x00000002u; +} +void GeneratedCodeInfo_Annotation::clear_source_file() { + source_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source_file(); +} + const ::std::string& GeneratedCodeInfo_Annotation::source_file() const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + return source_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void GeneratedCodeInfo_Annotation::set_source_file(const ::std::string& value) { + set_has_source_file(); + source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} + void GeneratedCodeInfo_Annotation::set_source_file(const char* value) { + set_has_source_file(); + source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} + void GeneratedCodeInfo_Annotation::set_source_file(const char* value, size_t size) { + set_has_source_file(); + source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} + ::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { + set_has_source_file(); + // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + return source_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + ::std::string* GeneratedCodeInfo_Annotation::release_source_file() { + // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + clear_has_source_file(); + return source_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} + void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) { + if (source_file != NULL) { + set_has_source_file(); + } else { + clear_has_source_file(); + } + source_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} + +// optional int32 begin = 3; +bool GeneratedCodeInfo_Annotation::has_begin() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +void GeneratedCodeInfo_Annotation::set_has_begin() { + _has_bits_[0] |= 0x00000004u; +} +void GeneratedCodeInfo_Annotation::clear_has_begin() { + _has_bits_[0] &= ~0x00000004u; +} +void GeneratedCodeInfo_Annotation::clear_begin() { + begin_ = 0; + clear_has_begin(); +} + ::google::protobuf::int32 GeneratedCodeInfo_Annotation::begin() const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin) + return begin_; +} + void GeneratedCodeInfo_Annotation::set_begin(::google::protobuf::int32 value) { + set_has_begin(); + begin_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.begin) +} + +// optional int32 end = 4; +bool GeneratedCodeInfo_Annotation::has_end() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +void GeneratedCodeInfo_Annotation::set_has_end() { + _has_bits_[0] |= 0x00000008u; +} +void GeneratedCodeInfo_Annotation::clear_has_end() { + _has_bits_[0] &= ~0x00000008u; +} +void GeneratedCodeInfo_Annotation::clear_end() { + end_ = 0; + clear_has_end(); +} + ::google::protobuf::int32 GeneratedCodeInfo_Annotation::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end) + return end_; +} + void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.end) +} + +// ------------------------------------------------------------------- + +// GeneratedCodeInfo + +// repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; +int GeneratedCodeInfo::annotation_size() const { + return annotation_.size(); +} +void GeneratedCodeInfo::clear_annotation() { + annotation_.Clear(); +} +const ::google::protobuf::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_.Get(index); +} +::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_.Mutable(index); +} +::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() { + // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_.Add(); +} +::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >* +GeneratedCodeInfo::mutable_annotation() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.annotation) + return &annotation_; +} +const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >& +GeneratedCodeInfo::annotation() const { + // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_; +} + +#endif // PROTOBUF_INLINE_NOT_IN_HEADERS + +// @@protoc_insertion_point(namespace_scope) + +} // namespace protobuf +} // namespace google + +// @@protoc_insertion_point(global_scope) diff --git a/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor.pb.h b/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor.pb.h new file mode 100644 index 00000000000..92a0a3a763f --- /dev/null +++ b/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor.pb.h @@ -0,0 +1,7714 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/protobuf/descriptor.proto + +#ifndef PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED +#define PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 3000000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace google { +namespace protobuf { + +// Internal implementation detail -- do not call these. +void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); +void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); +void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + +class DescriptorProto; +class DescriptorProto_ExtensionRange; +class DescriptorProto_ReservedRange; +class EnumDescriptorProto; +class EnumOptions; +class EnumValueDescriptorProto; +class EnumValueOptions; +class FieldDescriptorProto; +class FieldOptions; +class FileDescriptorProto; +class FileDescriptorSet; +class FileOptions; +class GeneratedCodeInfo; +class GeneratedCodeInfo_Annotation; +class MessageOptions; +class MethodDescriptorProto; +class MethodOptions; +class OneofDescriptorProto; +class ServiceDescriptorProto; +class ServiceOptions; +class SourceCodeInfo; +class SourceCodeInfo_Location; +class UninterpretedOption; +class UninterpretedOption_NamePart; + +enum FieldDescriptorProto_Type { + FieldDescriptorProto_Type_TYPE_DOUBLE = 1, + FieldDescriptorProto_Type_TYPE_FLOAT = 2, + FieldDescriptorProto_Type_TYPE_INT64 = 3, + FieldDescriptorProto_Type_TYPE_UINT64 = 4, + FieldDescriptorProto_Type_TYPE_INT32 = 5, + FieldDescriptorProto_Type_TYPE_FIXED64 = 6, + FieldDescriptorProto_Type_TYPE_FIXED32 = 7, + FieldDescriptorProto_Type_TYPE_BOOL = 8, + FieldDescriptorProto_Type_TYPE_STRING = 9, + FieldDescriptorProto_Type_TYPE_GROUP = 10, + FieldDescriptorProto_Type_TYPE_MESSAGE = 11, + FieldDescriptorProto_Type_TYPE_BYTES = 12, + FieldDescriptorProto_Type_TYPE_UINT32 = 13, + FieldDescriptorProto_Type_TYPE_ENUM = 14, + FieldDescriptorProto_Type_TYPE_SFIXED32 = 15, + FieldDescriptorProto_Type_TYPE_SFIXED64 = 16, + FieldDescriptorProto_Type_TYPE_SINT32 = 17, + FieldDescriptorProto_Type_TYPE_SINT64 = 18 +}; +LIBPROTOBUF_EXPORT bool FieldDescriptorProto_Type_IsValid(int value); +const FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MIN = FieldDescriptorProto_Type_TYPE_DOUBLE; +const FieldDescriptorProto_Type FieldDescriptorProto_Type_Type_MAX = FieldDescriptorProto_Type_TYPE_SINT64; +const int FieldDescriptorProto_Type_Type_ARRAYSIZE = FieldDescriptorProto_Type_Type_MAX + 1; + +LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Type_descriptor(); +inline const ::std::string& FieldDescriptorProto_Type_Name(FieldDescriptorProto_Type value) { + return ::google::protobuf::internal::NameOfEnum( + FieldDescriptorProto_Type_descriptor(), value); +} +inline bool FieldDescriptorProto_Type_Parse( + const ::std::string& name, FieldDescriptorProto_Type* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FieldDescriptorProto_Type_descriptor(), name, value); +} +enum FieldDescriptorProto_Label { + FieldDescriptorProto_Label_LABEL_OPTIONAL = 1, + FieldDescriptorProto_Label_LABEL_REQUIRED = 2, + FieldDescriptorProto_Label_LABEL_REPEATED = 3 +}; +LIBPROTOBUF_EXPORT bool FieldDescriptorProto_Label_IsValid(int value); +const FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MIN = FieldDescriptorProto_Label_LABEL_OPTIONAL; +const FieldDescriptorProto_Label FieldDescriptorProto_Label_Label_MAX = FieldDescriptorProto_Label_LABEL_REPEATED; +const int FieldDescriptorProto_Label_Label_ARRAYSIZE = FieldDescriptorProto_Label_Label_MAX + 1; + +LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldDescriptorProto_Label_descriptor(); +inline const ::std::string& FieldDescriptorProto_Label_Name(FieldDescriptorProto_Label value) { + return ::google::protobuf::internal::NameOfEnum( + FieldDescriptorProto_Label_descriptor(), value); +} +inline bool FieldDescriptorProto_Label_Parse( + const ::std::string& name, FieldDescriptorProto_Label* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FieldDescriptorProto_Label_descriptor(), name, value); +} +enum FileOptions_OptimizeMode { + FileOptions_OptimizeMode_SPEED = 1, + FileOptions_OptimizeMode_CODE_SIZE = 2, + FileOptions_OptimizeMode_LITE_RUNTIME = 3 +}; +LIBPROTOBUF_EXPORT bool FileOptions_OptimizeMode_IsValid(int value); +const FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MIN = FileOptions_OptimizeMode_SPEED; +const FileOptions_OptimizeMode FileOptions_OptimizeMode_OptimizeMode_MAX = FileOptions_OptimizeMode_LITE_RUNTIME; +const int FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE = FileOptions_OptimizeMode_OptimizeMode_MAX + 1; + +LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FileOptions_OptimizeMode_descriptor(); +inline const ::std::string& FileOptions_OptimizeMode_Name(FileOptions_OptimizeMode value) { + return ::google::protobuf::internal::NameOfEnum( + FileOptions_OptimizeMode_descriptor(), value); +} +inline bool FileOptions_OptimizeMode_Parse( + const ::std::string& name, FileOptions_OptimizeMode* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FileOptions_OptimizeMode_descriptor(), name, value); +} +enum FieldOptions_CType { + FieldOptions_CType_STRING = 0, + FieldOptions_CType_CORD = 1, + FieldOptions_CType_STRING_PIECE = 2 +}; +LIBPROTOBUF_EXPORT bool FieldOptions_CType_IsValid(int value); +const FieldOptions_CType FieldOptions_CType_CType_MIN = FieldOptions_CType_STRING; +const FieldOptions_CType FieldOptions_CType_CType_MAX = FieldOptions_CType_STRING_PIECE; +const int FieldOptions_CType_CType_ARRAYSIZE = FieldOptions_CType_CType_MAX + 1; + +LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldOptions_CType_descriptor(); +inline const ::std::string& FieldOptions_CType_Name(FieldOptions_CType value) { + return ::google::protobuf::internal::NameOfEnum( + FieldOptions_CType_descriptor(), value); +} +inline bool FieldOptions_CType_Parse( + const ::std::string& name, FieldOptions_CType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FieldOptions_CType_descriptor(), name, value); +} +enum FieldOptions_JSType { + FieldOptions_JSType_JS_NORMAL = 0, + FieldOptions_JSType_JS_STRING = 1, + FieldOptions_JSType_JS_NUMBER = 2 +}; +LIBPROTOBUF_EXPORT bool FieldOptions_JSType_IsValid(int value); +const FieldOptions_JSType FieldOptions_JSType_JSType_MIN = FieldOptions_JSType_JS_NORMAL; +const FieldOptions_JSType FieldOptions_JSType_JSType_MAX = FieldOptions_JSType_JS_NUMBER; +const int FieldOptions_JSType_JSType_ARRAYSIZE = FieldOptions_JSType_JSType_MAX + 1; + +LIBPROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor* FieldOptions_JSType_descriptor(); +inline const ::std::string& FieldOptions_JSType_Name(FieldOptions_JSType value) { + return ::google::protobuf::internal::NameOfEnum( + FieldOptions_JSType_descriptor(), value); +} +inline bool FieldOptions_JSType_Parse( + const ::std::string& name, FieldOptions_JSType* value) { + return ::google::protobuf::internal::ParseNamedEnum( + FieldOptions_JSType_descriptor(), name, value); +} +// =================================================================== + +class LIBPROTOBUF_EXPORT FileDescriptorSet : public ::google::protobuf::Message { + public: + FileDescriptorSet(); + virtual ~FileDescriptorSet(); + + FileDescriptorSet(const FileDescriptorSet& from); + + inline FileDescriptorSet& operator=(const FileDescriptorSet& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FileDescriptorSet& default_instance(); + + void Swap(FileDescriptorSet* other); + + // implements Message ---------------------------------------------- + + inline FileDescriptorSet* New() const { return New(NULL); } + + FileDescriptorSet* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FileDescriptorSet& from); + void MergeFrom(const FileDescriptorSet& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FileDescriptorSet* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.FileDescriptorProto file = 1; + int file_size() const; + void clear_file(); + static const int kFileFieldNumber = 1; + const ::google::protobuf::FileDescriptorProto& file(int index) const; + ::google::protobuf::FileDescriptorProto* mutable_file(int index); + ::google::protobuf::FileDescriptorProto* add_file(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* + mutable_file(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& + file() const; + + // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorSet) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto > file_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static FileDescriptorSet* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT FileDescriptorProto : public ::google::protobuf::Message { + public: + FileDescriptorProto(); + virtual ~FileDescriptorProto(); + + FileDescriptorProto(const FileDescriptorProto& from); + + inline FileDescriptorProto& operator=(const FileDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FileDescriptorProto& default_instance(); + + void Swap(FileDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline FileDescriptorProto* New() const { return New(NULL); } + + FileDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FileDescriptorProto& from); + void MergeFrom(const FileDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FileDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional string package = 2; + bool has_package() const; + void clear_package(); + static const int kPackageFieldNumber = 2; + const ::std::string& package() const; + void set_package(const ::std::string& value); + void set_package(const char* value); + void set_package(const char* value, size_t size); + ::std::string* mutable_package(); + ::std::string* release_package(); + void set_allocated_package(::std::string* package); + + // repeated string dependency = 3; + int dependency_size() const; + void clear_dependency(); + static const int kDependencyFieldNumber = 3; + const ::std::string& dependency(int index) const; + ::std::string* mutable_dependency(int index); + void set_dependency(int index, const ::std::string& value); + void set_dependency(int index, const char* value); + void set_dependency(int index, const char* value, size_t size); + ::std::string* add_dependency(); + void add_dependency(const ::std::string& value); + void add_dependency(const char* value); + void add_dependency(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& dependency() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_dependency(); + + // repeated int32 public_dependency = 10; + int public_dependency_size() const; + void clear_public_dependency(); + static const int kPublicDependencyFieldNumber = 10; + ::google::protobuf::int32 public_dependency(int index) const; + void set_public_dependency(int index, ::google::protobuf::int32 value); + void add_public_dependency(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + public_dependency() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_public_dependency(); + + // repeated int32 weak_dependency = 11; + int weak_dependency_size() const; + void clear_weak_dependency(); + static const int kWeakDependencyFieldNumber = 11; + ::google::protobuf::int32 weak_dependency(int index) const; + void set_weak_dependency(int index, ::google::protobuf::int32 value); + void add_weak_dependency(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + weak_dependency() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_weak_dependency(); + + // repeated .google.protobuf.DescriptorProto message_type = 4; + int message_type_size() const; + void clear_message_type(); + static const int kMessageTypeFieldNumber = 4; + const ::google::protobuf::DescriptorProto& message_type(int index) const; + ::google::protobuf::DescriptorProto* mutable_message_type(int index); + ::google::protobuf::DescriptorProto* add_message_type(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* + mutable_message_type(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& + message_type() const; + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 5; + int enum_type_size() const; + void clear_enum_type(); + static const int kEnumTypeFieldNumber = 5; + const ::google::protobuf::EnumDescriptorProto& enum_type(int index) const; + ::google::protobuf::EnumDescriptorProto* mutable_enum_type(int index); + ::google::protobuf::EnumDescriptorProto* add_enum_type(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* + mutable_enum_type(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& + enum_type() const; + + // repeated .google.protobuf.ServiceDescriptorProto service = 6; + int service_size() const; + void clear_service(); + static const int kServiceFieldNumber = 6; + const ::google::protobuf::ServiceDescriptorProto& service(int index) const; + ::google::protobuf::ServiceDescriptorProto* mutable_service(int index); + ::google::protobuf::ServiceDescriptorProto* add_service(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >* + mutable_service(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >& + service() const; + + // repeated .google.protobuf.FieldDescriptorProto extension = 7; + int extension_size() const; + void clear_extension(); + static const int kExtensionFieldNumber = 7; + const ::google::protobuf::FieldDescriptorProto& extension(int index) const; + ::google::protobuf::FieldDescriptorProto* mutable_extension(int index); + ::google::protobuf::FieldDescriptorProto* add_extension(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* + mutable_extension(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& + extension() const; + + // optional .google.protobuf.FileOptions options = 8; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 8; + const ::google::protobuf::FileOptions& options() const; + ::google::protobuf::FileOptions* mutable_options(); + ::google::protobuf::FileOptions* release_options(); + void set_allocated_options(::google::protobuf::FileOptions* options); + + // optional .google.protobuf.SourceCodeInfo source_code_info = 9; + bool has_source_code_info() const; + void clear_source_code_info(); + static const int kSourceCodeInfoFieldNumber = 9; + const ::google::protobuf::SourceCodeInfo& source_code_info() const; + ::google::protobuf::SourceCodeInfo* mutable_source_code_info(); + ::google::protobuf::SourceCodeInfo* release_source_code_info(); + void set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info); + + // optional string syntax = 12; + bool has_syntax() const; + void clear_syntax(); + static const int kSyntaxFieldNumber = 12; + const ::std::string& syntax() const; + void set_syntax(const ::std::string& value); + void set_syntax(const char* value); + void set_syntax(const char* value, size_t size); + ::std::string* mutable_syntax(); + ::std::string* release_syntax(); + void set_allocated_syntax(::std::string* syntax); + + // @@protoc_insertion_point(class_scope:google.protobuf.FileDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_package(); + inline void clear_has_package(); + inline void set_has_options(); + inline void clear_has_options(); + inline void set_has_source_code_info(); + inline void clear_has_source_code_info(); + inline void set_has_syntax(); + inline void clear_has_syntax(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr package_; + ::google::protobuf::RepeatedPtrField< ::std::string> dependency_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > public_dependency_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > weak_dependency_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto > message_type_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto > enum_type_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto > service_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > extension_; + ::google::protobuf::FileOptions* options_; + ::google::protobuf::SourceCodeInfo* source_code_info_; + ::google::protobuf::internal::ArenaStringPtr syntax_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static FileDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT DescriptorProto_ExtensionRange : public ::google::protobuf::Message { + public: + DescriptorProto_ExtensionRange(); + virtual ~DescriptorProto_ExtensionRange(); + + DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from); + + inline DescriptorProto_ExtensionRange& operator=(const DescriptorProto_ExtensionRange& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DescriptorProto_ExtensionRange& default_instance(); + + void Swap(DescriptorProto_ExtensionRange* other); + + // implements Message ---------------------------------------------- + + inline DescriptorProto_ExtensionRange* New() const { return New(NULL); } + + DescriptorProto_ExtensionRange* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DescriptorProto_ExtensionRange& from); + void MergeFrom(const DescriptorProto_ExtensionRange& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DescriptorProto_ExtensionRange* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 start = 1; + bool has_start() const; + void clear_start(); + static const int kStartFieldNumber = 1; + ::google::protobuf::int32 start() const; + void set_start(::google::protobuf::int32 value); + + // optional int32 end = 2; + bool has_end() const; + void clear_end(); + static const int kEndFieldNumber = 2; + ::google::protobuf::int32 end() const; + void set_end(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ExtensionRange) + private: + inline void set_has_start(); + inline void clear_has_start(); + inline void set_has_end(); + inline void clear_has_end(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 start_; + ::google::protobuf::int32 end_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static DescriptorProto_ExtensionRange* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT DescriptorProto_ReservedRange : public ::google::protobuf::Message { + public: + DescriptorProto_ReservedRange(); + virtual ~DescriptorProto_ReservedRange(); + + DescriptorProto_ReservedRange(const DescriptorProto_ReservedRange& from); + + inline DescriptorProto_ReservedRange& operator=(const DescriptorProto_ReservedRange& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DescriptorProto_ReservedRange& default_instance(); + + void Swap(DescriptorProto_ReservedRange* other); + + // implements Message ---------------------------------------------- + + inline DescriptorProto_ReservedRange* New() const { return New(NULL); } + + DescriptorProto_ReservedRange* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DescriptorProto_ReservedRange& from); + void MergeFrom(const DescriptorProto_ReservedRange& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DescriptorProto_ReservedRange* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 start = 1; + bool has_start() const; + void clear_start(); + static const int kStartFieldNumber = 1; + ::google::protobuf::int32 start() const; + void set_start(::google::protobuf::int32 value); + + // optional int32 end = 2; + bool has_end() const; + void clear_end(); + static const int kEndFieldNumber = 2; + ::google::protobuf::int32 end() const; + void set_end(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto.ReservedRange) + private: + inline void set_has_start(); + inline void clear_has_start(); + inline void set_has_end(); + inline void clear_has_end(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::int32 start_; + ::google::protobuf::int32 end_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static DescriptorProto_ReservedRange* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT DescriptorProto : public ::google::protobuf::Message { + public: + DescriptorProto(); + virtual ~DescriptorProto(); + + DescriptorProto(const DescriptorProto& from); + + inline DescriptorProto& operator=(const DescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const DescriptorProto& default_instance(); + + void Swap(DescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline DescriptorProto* New() const { return New(NULL); } + + DescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const DescriptorProto& from); + void MergeFrom(const DescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(DescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef DescriptorProto_ExtensionRange ExtensionRange; + typedef DescriptorProto_ReservedRange ReservedRange; + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // repeated .google.protobuf.FieldDescriptorProto field = 2; + int field_size() const; + void clear_field(); + static const int kFieldFieldNumber = 2; + const ::google::protobuf::FieldDescriptorProto& field(int index) const; + ::google::protobuf::FieldDescriptorProto* mutable_field(int index); + ::google::protobuf::FieldDescriptorProto* add_field(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* + mutable_field(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& + field() const; + + // repeated .google.protobuf.FieldDescriptorProto extension = 6; + int extension_size() const; + void clear_extension(); + static const int kExtensionFieldNumber = 6; + const ::google::protobuf::FieldDescriptorProto& extension(int index) const; + ::google::protobuf::FieldDescriptorProto* mutable_extension(int index); + ::google::protobuf::FieldDescriptorProto* add_extension(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* + mutable_extension(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& + extension() const; + + // repeated .google.protobuf.DescriptorProto nested_type = 3; + int nested_type_size() const; + void clear_nested_type(); + static const int kNestedTypeFieldNumber = 3; + const ::google::protobuf::DescriptorProto& nested_type(int index) const; + ::google::protobuf::DescriptorProto* mutable_nested_type(int index); + ::google::protobuf::DescriptorProto* add_nested_type(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* + mutable_nested_type(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& + nested_type() const; + + // repeated .google.protobuf.EnumDescriptorProto enum_type = 4; + int enum_type_size() const; + void clear_enum_type(); + static const int kEnumTypeFieldNumber = 4; + const ::google::protobuf::EnumDescriptorProto& enum_type(int index) const; + ::google::protobuf::EnumDescriptorProto* mutable_enum_type(int index); + ::google::protobuf::EnumDescriptorProto* add_enum_type(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* + mutable_enum_type(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& + enum_type() const; + + // repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + int extension_range_size() const; + void clear_extension_range(); + static const int kExtensionRangeFieldNumber = 5; + const ::google::protobuf::DescriptorProto_ExtensionRange& extension_range(int index) const; + ::google::protobuf::DescriptorProto_ExtensionRange* mutable_extension_range(int index); + ::google::protobuf::DescriptorProto_ExtensionRange* add_extension_range(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >* + mutable_extension_range(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >& + extension_range() const; + + // repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; + int oneof_decl_size() const; + void clear_oneof_decl(); + static const int kOneofDeclFieldNumber = 8; + const ::google::protobuf::OneofDescriptorProto& oneof_decl(int index) const; + ::google::protobuf::OneofDescriptorProto* mutable_oneof_decl(int index); + ::google::protobuf::OneofDescriptorProto* add_oneof_decl(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >* + mutable_oneof_decl(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >& + oneof_decl() const; + + // optional .google.protobuf.MessageOptions options = 7; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 7; + const ::google::protobuf::MessageOptions& options() const; + ::google::protobuf::MessageOptions* mutable_options(); + ::google::protobuf::MessageOptions* release_options(); + void set_allocated_options(::google::protobuf::MessageOptions* options); + + // repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + int reserved_range_size() const; + void clear_reserved_range(); + static const int kReservedRangeFieldNumber = 9; + const ::google::protobuf::DescriptorProto_ReservedRange& reserved_range(int index) const; + ::google::protobuf::DescriptorProto_ReservedRange* mutable_reserved_range(int index); + ::google::protobuf::DescriptorProto_ReservedRange* add_reserved_range(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >* + mutable_reserved_range(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >& + reserved_range() const; + + // repeated string reserved_name = 10; + int reserved_name_size() const; + void clear_reserved_name(); + static const int kReservedNameFieldNumber = 10; + const ::std::string& reserved_name(int index) const; + ::std::string* mutable_reserved_name(int index); + void set_reserved_name(int index, const ::std::string& value); + void set_reserved_name(int index, const char* value); + void set_reserved_name(int index, const char* value, size_t size); + ::std::string* add_reserved_name(); + void add_reserved_name(const ::std::string& value); + void add_reserved_name(const char* value); + void add_reserved_name(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& reserved_name() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_reserved_name(); + + // @@protoc_insertion_point(class_scope:google.protobuf.DescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_options(); + inline void clear_has_options(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > field_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto > extension_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto > nested_type_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto > enum_type_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange > extension_range_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto > oneof_decl_; + ::google::protobuf::MessageOptions* options_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange > reserved_range_; + ::google::protobuf::RepeatedPtrField< ::std::string> reserved_name_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static DescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT FieldDescriptorProto : public ::google::protobuf::Message { + public: + FieldDescriptorProto(); + virtual ~FieldDescriptorProto(); + + FieldDescriptorProto(const FieldDescriptorProto& from); + + inline FieldDescriptorProto& operator=(const FieldDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FieldDescriptorProto& default_instance(); + + void Swap(FieldDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline FieldDescriptorProto* New() const { return New(NULL); } + + FieldDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FieldDescriptorProto& from); + void MergeFrom(const FieldDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FieldDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef FieldDescriptorProto_Type Type; + static const Type TYPE_DOUBLE = + FieldDescriptorProto_Type_TYPE_DOUBLE; + static const Type TYPE_FLOAT = + FieldDescriptorProto_Type_TYPE_FLOAT; + static const Type TYPE_INT64 = + FieldDescriptorProto_Type_TYPE_INT64; + static const Type TYPE_UINT64 = + FieldDescriptorProto_Type_TYPE_UINT64; + static const Type TYPE_INT32 = + FieldDescriptorProto_Type_TYPE_INT32; + static const Type TYPE_FIXED64 = + FieldDescriptorProto_Type_TYPE_FIXED64; + static const Type TYPE_FIXED32 = + FieldDescriptorProto_Type_TYPE_FIXED32; + static const Type TYPE_BOOL = + FieldDescriptorProto_Type_TYPE_BOOL; + static const Type TYPE_STRING = + FieldDescriptorProto_Type_TYPE_STRING; + static const Type TYPE_GROUP = + FieldDescriptorProto_Type_TYPE_GROUP; + static const Type TYPE_MESSAGE = + FieldDescriptorProto_Type_TYPE_MESSAGE; + static const Type TYPE_BYTES = + FieldDescriptorProto_Type_TYPE_BYTES; + static const Type TYPE_UINT32 = + FieldDescriptorProto_Type_TYPE_UINT32; + static const Type TYPE_ENUM = + FieldDescriptorProto_Type_TYPE_ENUM; + static const Type TYPE_SFIXED32 = + FieldDescriptorProto_Type_TYPE_SFIXED32; + static const Type TYPE_SFIXED64 = + FieldDescriptorProto_Type_TYPE_SFIXED64; + static const Type TYPE_SINT32 = + FieldDescriptorProto_Type_TYPE_SINT32; + static const Type TYPE_SINT64 = + FieldDescriptorProto_Type_TYPE_SINT64; + static inline bool Type_IsValid(int value) { + return FieldDescriptorProto_Type_IsValid(value); + } + static const Type Type_MIN = + FieldDescriptorProto_Type_Type_MIN; + static const Type Type_MAX = + FieldDescriptorProto_Type_Type_MAX; + static const int Type_ARRAYSIZE = + FieldDescriptorProto_Type_Type_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Type_descriptor() { + return FieldDescriptorProto_Type_descriptor(); + } + static inline const ::std::string& Type_Name(Type value) { + return FieldDescriptorProto_Type_Name(value); + } + static inline bool Type_Parse(const ::std::string& name, + Type* value) { + return FieldDescriptorProto_Type_Parse(name, value); + } + + typedef FieldDescriptorProto_Label Label; + static const Label LABEL_OPTIONAL = + FieldDescriptorProto_Label_LABEL_OPTIONAL; + static const Label LABEL_REQUIRED = + FieldDescriptorProto_Label_LABEL_REQUIRED; + static const Label LABEL_REPEATED = + FieldDescriptorProto_Label_LABEL_REPEATED; + static inline bool Label_IsValid(int value) { + return FieldDescriptorProto_Label_IsValid(value); + } + static const Label Label_MIN = + FieldDescriptorProto_Label_Label_MIN; + static const Label Label_MAX = + FieldDescriptorProto_Label_Label_MAX; + static const int Label_ARRAYSIZE = + FieldDescriptorProto_Label_Label_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + Label_descriptor() { + return FieldDescriptorProto_Label_descriptor(); + } + static inline const ::std::string& Label_Name(Label value) { + return FieldDescriptorProto_Label_Name(value); + } + static inline bool Label_Parse(const ::std::string& name, + Label* value) { + return FieldDescriptorProto_Label_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional int32 number = 3; + bool has_number() const; + void clear_number(); + static const int kNumberFieldNumber = 3; + ::google::protobuf::int32 number() const; + void set_number(::google::protobuf::int32 value); + + // optional .google.protobuf.FieldDescriptorProto.Label label = 4; + bool has_label() const; + void clear_label(); + static const int kLabelFieldNumber = 4; + ::google::protobuf::FieldDescriptorProto_Label label() const; + void set_label(::google::protobuf::FieldDescriptorProto_Label value); + + // optional .google.protobuf.FieldDescriptorProto.Type type = 5; + bool has_type() const; + void clear_type(); + static const int kTypeFieldNumber = 5; + ::google::protobuf::FieldDescriptorProto_Type type() const; + void set_type(::google::protobuf::FieldDescriptorProto_Type value); + + // optional string type_name = 6; + bool has_type_name() const; + void clear_type_name(); + static const int kTypeNameFieldNumber = 6; + const ::std::string& type_name() const; + void set_type_name(const ::std::string& value); + void set_type_name(const char* value); + void set_type_name(const char* value, size_t size); + ::std::string* mutable_type_name(); + ::std::string* release_type_name(); + void set_allocated_type_name(::std::string* type_name); + + // optional string extendee = 2; + bool has_extendee() const; + void clear_extendee(); + static const int kExtendeeFieldNumber = 2; + const ::std::string& extendee() const; + void set_extendee(const ::std::string& value); + void set_extendee(const char* value); + void set_extendee(const char* value, size_t size); + ::std::string* mutable_extendee(); + ::std::string* release_extendee(); + void set_allocated_extendee(::std::string* extendee); + + // optional string default_value = 7; + bool has_default_value() const; + void clear_default_value(); + static const int kDefaultValueFieldNumber = 7; + const ::std::string& default_value() const; + void set_default_value(const ::std::string& value); + void set_default_value(const char* value); + void set_default_value(const char* value, size_t size); + ::std::string* mutable_default_value(); + ::std::string* release_default_value(); + void set_allocated_default_value(::std::string* default_value); + + // optional int32 oneof_index = 9; + bool has_oneof_index() const; + void clear_oneof_index(); + static const int kOneofIndexFieldNumber = 9; + ::google::protobuf::int32 oneof_index() const; + void set_oneof_index(::google::protobuf::int32 value); + + // optional string json_name = 10; + bool has_json_name() const; + void clear_json_name(); + static const int kJsonNameFieldNumber = 10; + const ::std::string& json_name() const; + void set_json_name(const ::std::string& value); + void set_json_name(const char* value); + void set_json_name(const char* value, size_t size); + ::std::string* mutable_json_name(); + ::std::string* release_json_name(); + void set_allocated_json_name(::std::string* json_name); + + // optional .google.protobuf.FieldOptions options = 8; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 8; + const ::google::protobuf::FieldOptions& options() const; + ::google::protobuf::FieldOptions* mutable_options(); + ::google::protobuf::FieldOptions* release_options(); + void set_allocated_options(::google::protobuf::FieldOptions* options); + + // @@protoc_insertion_point(class_scope:google.protobuf.FieldDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_number(); + inline void clear_has_number(); + inline void set_has_label(); + inline void clear_has_label(); + inline void set_has_type(); + inline void clear_has_type(); + inline void set_has_type_name(); + inline void clear_has_type_name(); + inline void set_has_extendee(); + inline void clear_has_extendee(); + inline void set_has_default_value(); + inline void clear_has_default_value(); + inline void set_has_oneof_index(); + inline void clear_has_oneof_index(); + inline void set_has_json_name(); + inline void clear_has_json_name(); + inline void set_has_options(); + inline void clear_has_options(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::int32 number_; + int label_; + ::google::protobuf::internal::ArenaStringPtr type_name_; + ::google::protobuf::internal::ArenaStringPtr extendee_; + int type_; + ::google::protobuf::int32 oneof_index_; + ::google::protobuf::internal::ArenaStringPtr default_value_; + ::google::protobuf::internal::ArenaStringPtr json_name_; + ::google::protobuf::FieldOptions* options_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static FieldDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT OneofDescriptorProto : public ::google::protobuf::Message { + public: + OneofDescriptorProto(); + virtual ~OneofDescriptorProto(); + + OneofDescriptorProto(const OneofDescriptorProto& from); + + inline OneofDescriptorProto& operator=(const OneofDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const OneofDescriptorProto& default_instance(); + + void Swap(OneofDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline OneofDescriptorProto* New() const { return New(NULL); } + + OneofDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const OneofDescriptorProto& from); + void MergeFrom(const OneofDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(OneofDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // @@protoc_insertion_point(class_scope:google.protobuf.OneofDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static OneofDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT EnumDescriptorProto : public ::google::protobuf::Message { + public: + EnumDescriptorProto(); + virtual ~EnumDescriptorProto(); + + EnumDescriptorProto(const EnumDescriptorProto& from); + + inline EnumDescriptorProto& operator=(const EnumDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumDescriptorProto& default_instance(); + + void Swap(EnumDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline EnumDescriptorProto* New() const { return New(NULL); } + + EnumDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EnumDescriptorProto& from); + void MergeFrom(const EnumDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EnumDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // repeated .google.protobuf.EnumValueDescriptorProto value = 2; + int value_size() const; + void clear_value(); + static const int kValueFieldNumber = 2; + const ::google::protobuf::EnumValueDescriptorProto& value(int index) const; + ::google::protobuf::EnumValueDescriptorProto* mutable_value(int index); + ::google::protobuf::EnumValueDescriptorProto* add_value(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >* + mutable_value(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& + value() const; + + // optional .google.protobuf.EnumOptions options = 3; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 3; + const ::google::protobuf::EnumOptions& options() const; + ::google::protobuf::EnumOptions* mutable_options(); + ::google::protobuf::EnumOptions* release_options(); + void set_allocated_options(::google::protobuf::EnumOptions* options); + + // @@protoc_insertion_point(class_scope:google.protobuf.EnumDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_options(); + inline void clear_has_options(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto > value_; + ::google::protobuf::EnumOptions* options_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static EnumDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT EnumValueDescriptorProto : public ::google::protobuf::Message { + public: + EnumValueDescriptorProto(); + virtual ~EnumValueDescriptorProto(); + + EnumValueDescriptorProto(const EnumValueDescriptorProto& from); + + inline EnumValueDescriptorProto& operator=(const EnumValueDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumValueDescriptorProto& default_instance(); + + void Swap(EnumValueDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline EnumValueDescriptorProto* New() const { return New(NULL); } + + EnumValueDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EnumValueDescriptorProto& from); + void MergeFrom(const EnumValueDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EnumValueDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional int32 number = 2; + bool has_number() const; + void clear_number(); + static const int kNumberFieldNumber = 2; + ::google::protobuf::int32 number() const; + void set_number(::google::protobuf::int32 value); + + // optional .google.protobuf.EnumValueOptions options = 3; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 3; + const ::google::protobuf::EnumValueOptions& options() const; + ::google::protobuf::EnumValueOptions* mutable_options(); + ::google::protobuf::EnumValueOptions* release_options(); + void set_allocated_options(::google::protobuf::EnumValueOptions* options); + + // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_number(); + inline void clear_has_number(); + inline void set_has_options(); + inline void clear_has_options(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::EnumValueOptions* options_; + ::google::protobuf::int32 number_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static EnumValueDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT ServiceDescriptorProto : public ::google::protobuf::Message { + public: + ServiceDescriptorProto(); + virtual ~ServiceDescriptorProto(); + + ServiceDescriptorProto(const ServiceDescriptorProto& from); + + inline ServiceDescriptorProto& operator=(const ServiceDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ServiceDescriptorProto& default_instance(); + + void Swap(ServiceDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline ServiceDescriptorProto* New() const { return New(NULL); } + + ServiceDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ServiceDescriptorProto& from); + void MergeFrom(const ServiceDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ServiceDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // repeated .google.protobuf.MethodDescriptorProto method = 2; + int method_size() const; + void clear_method(); + static const int kMethodFieldNumber = 2; + const ::google::protobuf::MethodDescriptorProto& method(int index) const; + ::google::protobuf::MethodDescriptorProto* mutable_method(int index); + ::google::protobuf::MethodDescriptorProto* add_method(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >* + mutable_method(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >& + method() const; + + // optional .google.protobuf.ServiceOptions options = 3; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 3; + const ::google::protobuf::ServiceOptions& options() const; + ::google::protobuf::ServiceOptions* mutable_options(); + ::google::protobuf::ServiceOptions* release_options(); + void set_allocated_options(::google::protobuf::ServiceOptions* options); + + // @@protoc_insertion_point(class_scope:google.protobuf.ServiceDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_options(); + inline void clear_has_options(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto > method_; + ::google::protobuf::ServiceOptions* options_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static ServiceDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT MethodDescriptorProto : public ::google::protobuf::Message { + public: + MethodDescriptorProto(); + virtual ~MethodDescriptorProto(); + + MethodDescriptorProto(const MethodDescriptorProto& from); + + inline MethodDescriptorProto& operator=(const MethodDescriptorProto& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MethodDescriptorProto& default_instance(); + + void Swap(MethodDescriptorProto* other); + + // implements Message ---------------------------------------------- + + inline MethodDescriptorProto* New() const { return New(NULL); } + + MethodDescriptorProto* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MethodDescriptorProto& from); + void MergeFrom(const MethodDescriptorProto& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MethodDescriptorProto* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional string name = 1; + bool has_name() const; + void clear_name(); + static const int kNameFieldNumber = 1; + const ::std::string& name() const; + void set_name(const ::std::string& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + ::std::string* mutable_name(); + ::std::string* release_name(); + void set_allocated_name(::std::string* name); + + // optional string input_type = 2; + bool has_input_type() const; + void clear_input_type(); + static const int kInputTypeFieldNumber = 2; + const ::std::string& input_type() const; + void set_input_type(const ::std::string& value); + void set_input_type(const char* value); + void set_input_type(const char* value, size_t size); + ::std::string* mutable_input_type(); + ::std::string* release_input_type(); + void set_allocated_input_type(::std::string* input_type); + + // optional string output_type = 3; + bool has_output_type() const; + void clear_output_type(); + static const int kOutputTypeFieldNumber = 3; + const ::std::string& output_type() const; + void set_output_type(const ::std::string& value); + void set_output_type(const char* value); + void set_output_type(const char* value, size_t size); + ::std::string* mutable_output_type(); + ::std::string* release_output_type(); + void set_allocated_output_type(::std::string* output_type); + + // optional .google.protobuf.MethodOptions options = 4; + bool has_options() const; + void clear_options(); + static const int kOptionsFieldNumber = 4; + const ::google::protobuf::MethodOptions& options() const; + ::google::protobuf::MethodOptions* mutable_options(); + ::google::protobuf::MethodOptions* release_options(); + void set_allocated_options(::google::protobuf::MethodOptions* options); + + // optional bool client_streaming = 5 [default = false]; + bool has_client_streaming() const; + void clear_client_streaming(); + static const int kClientStreamingFieldNumber = 5; + bool client_streaming() const; + void set_client_streaming(bool value); + + // optional bool server_streaming = 6 [default = false]; + bool has_server_streaming() const; + void clear_server_streaming(); + static const int kServerStreamingFieldNumber = 6; + bool server_streaming() const; + void set_server_streaming(bool value); + + // @@protoc_insertion_point(class_scope:google.protobuf.MethodDescriptorProto) + private: + inline void set_has_name(); + inline void clear_has_name(); + inline void set_has_input_type(); + inline void clear_has_input_type(); + inline void set_has_output_type(); + inline void clear_has_output_type(); + inline void set_has_options(); + inline void clear_has_options(); + inline void set_has_client_streaming(); + inline void clear_has_client_streaming(); + inline void set_has_server_streaming(); + inline void clear_has_server_streaming(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_; + ::google::protobuf::internal::ArenaStringPtr input_type_; + ::google::protobuf::internal::ArenaStringPtr output_type_; + ::google::protobuf::MethodOptions* options_; + bool client_streaming_; + bool server_streaming_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static MethodDescriptorProto* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT FileOptions : public ::google::protobuf::Message { + public: + FileOptions(); + virtual ~FileOptions(); + + FileOptions(const FileOptions& from); + + inline FileOptions& operator=(const FileOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FileOptions& default_instance(); + + void Swap(FileOptions* other); + + // implements Message ---------------------------------------------- + + inline FileOptions* New() const { return New(NULL); } + + FileOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FileOptions& from); + void MergeFrom(const FileOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FileOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef FileOptions_OptimizeMode OptimizeMode; + static const OptimizeMode SPEED = + FileOptions_OptimizeMode_SPEED; + static const OptimizeMode CODE_SIZE = + FileOptions_OptimizeMode_CODE_SIZE; + static const OptimizeMode LITE_RUNTIME = + FileOptions_OptimizeMode_LITE_RUNTIME; + static inline bool OptimizeMode_IsValid(int value) { + return FileOptions_OptimizeMode_IsValid(value); + } + static const OptimizeMode OptimizeMode_MIN = + FileOptions_OptimizeMode_OptimizeMode_MIN; + static const OptimizeMode OptimizeMode_MAX = + FileOptions_OptimizeMode_OptimizeMode_MAX; + static const int OptimizeMode_ARRAYSIZE = + FileOptions_OptimizeMode_OptimizeMode_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + OptimizeMode_descriptor() { + return FileOptions_OptimizeMode_descriptor(); + } + static inline const ::std::string& OptimizeMode_Name(OptimizeMode value) { + return FileOptions_OptimizeMode_Name(value); + } + static inline bool OptimizeMode_Parse(const ::std::string& name, + OptimizeMode* value) { + return FileOptions_OptimizeMode_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional string java_package = 1; + bool has_java_package() const; + void clear_java_package(); + static const int kJavaPackageFieldNumber = 1; + const ::std::string& java_package() const; + void set_java_package(const ::std::string& value); + void set_java_package(const char* value); + void set_java_package(const char* value, size_t size); + ::std::string* mutable_java_package(); + ::std::string* release_java_package(); + void set_allocated_java_package(::std::string* java_package); + + // optional string java_outer_classname = 8; + bool has_java_outer_classname() const; + void clear_java_outer_classname(); + static const int kJavaOuterClassnameFieldNumber = 8; + const ::std::string& java_outer_classname() const; + void set_java_outer_classname(const ::std::string& value); + void set_java_outer_classname(const char* value); + void set_java_outer_classname(const char* value, size_t size); + ::std::string* mutable_java_outer_classname(); + ::std::string* release_java_outer_classname(); + void set_allocated_java_outer_classname(::std::string* java_outer_classname); + + // optional bool java_multiple_files = 10 [default = false]; + bool has_java_multiple_files() const; + void clear_java_multiple_files(); + static const int kJavaMultipleFilesFieldNumber = 10; + bool java_multiple_files() const; + void set_java_multiple_files(bool value); + + // optional bool java_generate_equals_and_hash = 20 [default = false]; + bool has_java_generate_equals_and_hash() const; + void clear_java_generate_equals_and_hash(); + static const int kJavaGenerateEqualsAndHashFieldNumber = 20; + bool java_generate_equals_and_hash() const; + void set_java_generate_equals_and_hash(bool value); + + // optional bool java_string_check_utf8 = 27 [default = false]; + bool has_java_string_check_utf8() const; + void clear_java_string_check_utf8(); + static const int kJavaStringCheckUtf8FieldNumber = 27; + bool java_string_check_utf8() const; + void set_java_string_check_utf8(bool value); + + // optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; + bool has_optimize_for() const; + void clear_optimize_for(); + static const int kOptimizeForFieldNumber = 9; + ::google::protobuf::FileOptions_OptimizeMode optimize_for() const; + void set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value); + + // optional string go_package = 11; + bool has_go_package() const; + void clear_go_package(); + static const int kGoPackageFieldNumber = 11; + const ::std::string& go_package() const; + void set_go_package(const ::std::string& value); + void set_go_package(const char* value); + void set_go_package(const char* value, size_t size); + ::std::string* mutable_go_package(); + ::std::string* release_go_package(); + void set_allocated_go_package(::std::string* go_package); + + // optional bool cc_generic_services = 16 [default = false]; + bool has_cc_generic_services() const; + void clear_cc_generic_services(); + static const int kCcGenericServicesFieldNumber = 16; + bool cc_generic_services() const; + void set_cc_generic_services(bool value); + + // optional bool java_generic_services = 17 [default = false]; + bool has_java_generic_services() const; + void clear_java_generic_services(); + static const int kJavaGenericServicesFieldNumber = 17; + bool java_generic_services() const; + void set_java_generic_services(bool value); + + // optional bool py_generic_services = 18 [default = false]; + bool has_py_generic_services() const; + void clear_py_generic_services(); + static const int kPyGenericServicesFieldNumber = 18; + bool py_generic_services() const; + void set_py_generic_services(bool value); + + // optional bool deprecated = 23 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 23; + bool deprecated() const; + void set_deprecated(bool value); + + // optional bool cc_enable_arenas = 31 [default = false]; + bool has_cc_enable_arenas() const; + void clear_cc_enable_arenas(); + static const int kCcEnableArenasFieldNumber = 31; + bool cc_enable_arenas() const; + void set_cc_enable_arenas(bool value); + + // optional string objc_class_prefix = 36; + bool has_objc_class_prefix() const; + void clear_objc_class_prefix(); + static const int kObjcClassPrefixFieldNumber = 36; + const ::std::string& objc_class_prefix() const; + void set_objc_class_prefix(const ::std::string& value); + void set_objc_class_prefix(const char* value); + void set_objc_class_prefix(const char* value, size_t size); + ::std::string* mutable_objc_class_prefix(); + ::std::string* release_objc_class_prefix(); + void set_allocated_objc_class_prefix(::std::string* objc_class_prefix); + + // optional string csharp_namespace = 37; + bool has_csharp_namespace() const; + void clear_csharp_namespace(); + static const int kCsharpNamespaceFieldNumber = 37; + const ::std::string& csharp_namespace() const; + void set_csharp_namespace(const ::std::string& value); + void set_csharp_namespace(const char* value); + void set_csharp_namespace(const char* value, size_t size); + ::std::string* mutable_csharp_namespace(); + ::std::string* release_csharp_namespace(); + void set_allocated_csharp_namespace(::std::string* csharp_namespace); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FileOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.FileOptions) + private: + inline void set_has_java_package(); + inline void clear_has_java_package(); + inline void set_has_java_outer_classname(); + inline void clear_has_java_outer_classname(); + inline void set_has_java_multiple_files(); + inline void clear_has_java_multiple_files(); + inline void set_has_java_generate_equals_and_hash(); + inline void clear_has_java_generate_equals_and_hash(); + inline void set_has_java_string_check_utf8(); + inline void clear_has_java_string_check_utf8(); + inline void set_has_optimize_for(); + inline void clear_has_optimize_for(); + inline void set_has_go_package(); + inline void clear_has_go_package(); + inline void set_has_cc_generic_services(); + inline void clear_has_cc_generic_services(); + inline void set_has_java_generic_services(); + inline void clear_has_java_generic_services(); + inline void set_has_py_generic_services(); + inline void clear_has_py_generic_services(); + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + inline void set_has_cc_enable_arenas(); + inline void clear_has_cc_enable_arenas(); + inline void set_has_objc_class_prefix(); + inline void clear_has_objc_class_prefix(); + inline void set_has_csharp_namespace(); + inline void clear_has_csharp_namespace(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr java_package_; + ::google::protobuf::internal::ArenaStringPtr java_outer_classname_; + bool java_multiple_files_; + bool java_generate_equals_and_hash_; + bool java_string_check_utf8_; + bool cc_generic_services_; + int optimize_for_; + ::google::protobuf::internal::ArenaStringPtr go_package_; + ::google::protobuf::internal::ArenaStringPtr objc_class_prefix_; + ::google::protobuf::internal::ArenaStringPtr csharp_namespace_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool java_generic_services_; + bool py_generic_services_; + bool deprecated_; + bool cc_enable_arenas_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static FileOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT MessageOptions : public ::google::protobuf::Message { + public: + MessageOptions(); + virtual ~MessageOptions(); + + MessageOptions(const MessageOptions& from); + + inline MessageOptions& operator=(const MessageOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MessageOptions& default_instance(); + + void Swap(MessageOptions* other); + + // implements Message ---------------------------------------------- + + inline MessageOptions* New() const { return New(NULL); } + + MessageOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MessageOptions& from); + void MergeFrom(const MessageOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MessageOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool message_set_wire_format = 1 [default = false]; + bool has_message_set_wire_format() const; + void clear_message_set_wire_format(); + static const int kMessageSetWireFormatFieldNumber = 1; + bool message_set_wire_format() const; + void set_message_set_wire_format(bool value); + + // optional bool no_standard_descriptor_accessor = 2 [default = false]; + bool has_no_standard_descriptor_accessor() const; + void clear_no_standard_descriptor_accessor(); + static const int kNoStandardDescriptorAccessorFieldNumber = 2; + bool no_standard_descriptor_accessor() const; + void set_no_standard_descriptor_accessor(bool value); + + // optional bool deprecated = 3 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 3; + bool deprecated() const; + void set_deprecated(bool value); + + // optional bool map_entry = 7; + bool has_map_entry() const; + void clear_map_entry(); + static const int kMapEntryFieldNumber = 7; + bool map_entry() const; + void set_map_entry(bool value); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MessageOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.MessageOptions) + private: + inline void set_has_message_set_wire_format(); + inline void clear_has_message_set_wire_format(); + inline void set_has_no_standard_descriptor_accessor(); + inline void clear_has_no_standard_descriptor_accessor(); + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + inline void set_has_map_entry(); + inline void clear_has_map_entry(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool message_set_wire_format_; + bool no_standard_descriptor_accessor_; + bool deprecated_; + bool map_entry_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static MessageOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT FieldOptions : public ::google::protobuf::Message { + public: + FieldOptions(); + virtual ~FieldOptions(); + + FieldOptions(const FieldOptions& from); + + inline FieldOptions& operator=(const FieldOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FieldOptions& default_instance(); + + void Swap(FieldOptions* other); + + // implements Message ---------------------------------------------- + + inline FieldOptions* New() const { return New(NULL); } + + FieldOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FieldOptions& from); + void MergeFrom(const FieldOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(FieldOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef FieldOptions_CType CType; + static const CType STRING = + FieldOptions_CType_STRING; + static const CType CORD = + FieldOptions_CType_CORD; + static const CType STRING_PIECE = + FieldOptions_CType_STRING_PIECE; + static inline bool CType_IsValid(int value) { + return FieldOptions_CType_IsValid(value); + } + static const CType CType_MIN = + FieldOptions_CType_CType_MIN; + static const CType CType_MAX = + FieldOptions_CType_CType_MAX; + static const int CType_ARRAYSIZE = + FieldOptions_CType_CType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + CType_descriptor() { + return FieldOptions_CType_descriptor(); + } + static inline const ::std::string& CType_Name(CType value) { + return FieldOptions_CType_Name(value); + } + static inline bool CType_Parse(const ::std::string& name, + CType* value) { + return FieldOptions_CType_Parse(name, value); + } + + typedef FieldOptions_JSType JSType; + static const JSType JS_NORMAL = + FieldOptions_JSType_JS_NORMAL; + static const JSType JS_STRING = + FieldOptions_JSType_JS_STRING; + static const JSType JS_NUMBER = + FieldOptions_JSType_JS_NUMBER; + static inline bool JSType_IsValid(int value) { + return FieldOptions_JSType_IsValid(value); + } + static const JSType JSType_MIN = + FieldOptions_JSType_JSType_MIN; + static const JSType JSType_MAX = + FieldOptions_JSType_JSType_MAX; + static const int JSType_ARRAYSIZE = + FieldOptions_JSType_JSType_ARRAYSIZE; + static inline const ::google::protobuf::EnumDescriptor* + JSType_descriptor() { + return FieldOptions_JSType_descriptor(); + } + static inline const ::std::string& JSType_Name(JSType value) { + return FieldOptions_JSType_Name(value); + } + static inline bool JSType_Parse(const ::std::string& name, + JSType* value) { + return FieldOptions_JSType_Parse(name, value); + } + + // accessors ------------------------------------------------------- + + // optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; + bool has_ctype() const; + void clear_ctype(); + static const int kCtypeFieldNumber = 1; + ::google::protobuf::FieldOptions_CType ctype() const; + void set_ctype(::google::protobuf::FieldOptions_CType value); + + // optional bool packed = 2; + bool has_packed() const; + void clear_packed(); + static const int kPackedFieldNumber = 2; + bool packed() const; + void set_packed(bool value); + + // optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; + bool has_jstype() const; + void clear_jstype(); + static const int kJstypeFieldNumber = 6; + ::google::protobuf::FieldOptions_JSType jstype() const; + void set_jstype(::google::protobuf::FieldOptions_JSType value); + + // optional bool lazy = 5 [default = false]; + bool has_lazy() const; + void clear_lazy(); + static const int kLazyFieldNumber = 5; + bool lazy() const; + void set_lazy(bool value); + + // optional bool deprecated = 3 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 3; + bool deprecated() const; + void set_deprecated(bool value); + + // optional bool weak = 10 [default = false]; + bool has_weak() const; + void clear_weak(); + static const int kWeakFieldNumber = 10; + bool weak() const; + void set_weak(bool value); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(FieldOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.FieldOptions) + private: + inline void set_has_ctype(); + inline void clear_has_ctype(); + inline void set_has_packed(); + inline void clear_has_packed(); + inline void set_has_jstype(); + inline void clear_has_jstype(); + inline void set_has_lazy(); + inline void clear_has_lazy(); + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + inline void set_has_weak(); + inline void clear_has_weak(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + int ctype_; + int jstype_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool packed_; + bool lazy_; + bool deprecated_; + bool weak_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static FieldOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT EnumOptions : public ::google::protobuf::Message { + public: + EnumOptions(); + virtual ~EnumOptions(); + + EnumOptions(const EnumOptions& from); + + inline EnumOptions& operator=(const EnumOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumOptions& default_instance(); + + void Swap(EnumOptions* other); + + // implements Message ---------------------------------------------- + + inline EnumOptions* New() const { return New(NULL); } + + EnumOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EnumOptions& from); + void MergeFrom(const EnumOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EnumOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool allow_alias = 2; + bool has_allow_alias() const; + void clear_allow_alias(); + static const int kAllowAliasFieldNumber = 2; + bool allow_alias() const; + void set_allow_alias(bool value); + + // optional bool deprecated = 3 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 3; + bool deprecated() const; + void set_deprecated(bool value); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.EnumOptions) + private: + inline void set_has_allow_alias(); + inline void clear_has_allow_alias(); + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool allow_alias_; + bool deprecated_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static EnumOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT EnumValueOptions : public ::google::protobuf::Message { + public: + EnumValueOptions(); + virtual ~EnumValueOptions(); + + EnumValueOptions(const EnumValueOptions& from); + + inline EnumValueOptions& operator=(const EnumValueOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const EnumValueOptions& default_instance(); + + void Swap(EnumValueOptions* other); + + // implements Message ---------------------------------------------- + + inline EnumValueOptions* New() const { return New(NULL); } + + EnumValueOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const EnumValueOptions& from); + void MergeFrom(const EnumValueOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(EnumValueOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool deprecated = 1 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 1; + bool deprecated() const; + void set_deprecated(bool value); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(EnumValueOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.EnumValueOptions) + private: + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool deprecated_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static EnumValueOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT ServiceOptions : public ::google::protobuf::Message { + public: + ServiceOptions(); + virtual ~ServiceOptions(); + + ServiceOptions(const ServiceOptions& from); + + inline ServiceOptions& operator=(const ServiceOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ServiceOptions& default_instance(); + + void Swap(ServiceOptions* other); + + // implements Message ---------------------------------------------- + + inline ServiceOptions* New() const { return New(NULL); } + + ServiceOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ServiceOptions& from); + void MergeFrom(const ServiceOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(ServiceOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool deprecated = 33 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 33; + bool deprecated() const; + void set_deprecated(bool value); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(ServiceOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.ServiceOptions) + private: + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool deprecated_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static ServiceOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT MethodOptions : public ::google::protobuf::Message { + public: + MethodOptions(); + virtual ~MethodOptions(); + + MethodOptions(const MethodOptions& from); + + inline MethodOptions& operator=(const MethodOptions& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const MethodOptions& default_instance(); + + void Swap(MethodOptions* other); + + // implements Message ---------------------------------------------- + + inline MethodOptions* New() const { return New(NULL); } + + MethodOptions* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const MethodOptions& from); + void MergeFrom(const MethodOptions& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(MethodOptions* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional bool deprecated = 33 [default = false]; + bool has_deprecated() const; + void clear_deprecated(); + static const int kDeprecatedFieldNumber = 33; + bool deprecated() const; + void set_deprecated(bool value); + + // repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; + int uninterpreted_option_size() const; + void clear_uninterpreted_option(); + static const int kUninterpretedOptionFieldNumber = 999; + const ::google::protobuf::UninterpretedOption& uninterpreted_option(int index) const; + ::google::protobuf::UninterpretedOption* mutable_uninterpreted_option(int index); + ::google::protobuf::UninterpretedOption* add_uninterpreted_option(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* + mutable_uninterpreted_option(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& + uninterpreted_option() const; + + GOOGLE_PROTOBUF_EXTENSION_ACCESSORS(MethodOptions) + // @@protoc_insertion_point(class_scope:google.protobuf.MethodOptions) + private: + inline void set_has_deprecated(); + inline void clear_has_deprecated(); + + ::google::protobuf::internal::ExtensionSet _extensions_; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption > uninterpreted_option_; + bool deprecated_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static MethodOptions* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT UninterpretedOption_NamePart : public ::google::protobuf::Message { + public: + UninterpretedOption_NamePart(); + virtual ~UninterpretedOption_NamePart(); + + UninterpretedOption_NamePart(const UninterpretedOption_NamePart& from); + + inline UninterpretedOption_NamePart& operator=(const UninterpretedOption_NamePart& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const UninterpretedOption_NamePart& default_instance(); + + void Swap(UninterpretedOption_NamePart* other); + + // implements Message ---------------------------------------------- + + inline UninterpretedOption_NamePart* New() const { return New(NULL); } + + UninterpretedOption_NamePart* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const UninterpretedOption_NamePart& from); + void MergeFrom(const UninterpretedOption_NamePart& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(UninterpretedOption_NamePart* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string name_part = 1; + bool has_name_part() const; + void clear_name_part(); + static const int kNamePartFieldNumber = 1; + const ::std::string& name_part() const; + void set_name_part(const ::std::string& value); + void set_name_part(const char* value); + void set_name_part(const char* value, size_t size); + ::std::string* mutable_name_part(); + ::std::string* release_name_part(); + void set_allocated_name_part(::std::string* name_part); + + // required bool is_extension = 2; + bool has_is_extension() const; + void clear_is_extension(); + static const int kIsExtensionFieldNumber = 2; + bool is_extension() const; + void set_is_extension(bool value); + + // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption.NamePart) + private: + inline void set_has_name_part(); + inline void clear_has_name_part(); + inline void set_has_is_extension(); + inline void clear_has_is_extension(); + + // helper for ByteSize() + int RequiredFieldsByteSizeFallback() const; + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::internal::ArenaStringPtr name_part_; + bool is_extension_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static UninterpretedOption_NamePart* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT UninterpretedOption : public ::google::protobuf::Message { + public: + UninterpretedOption(); + virtual ~UninterpretedOption(); + + UninterpretedOption(const UninterpretedOption& from); + + inline UninterpretedOption& operator=(const UninterpretedOption& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const UninterpretedOption& default_instance(); + + void Swap(UninterpretedOption* other); + + // implements Message ---------------------------------------------- + + inline UninterpretedOption* New() const { return New(NULL); } + + UninterpretedOption* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const UninterpretedOption& from); + void MergeFrom(const UninterpretedOption& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(UninterpretedOption* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef UninterpretedOption_NamePart NamePart; + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.UninterpretedOption.NamePart name = 2; + int name_size() const; + void clear_name(); + static const int kNameFieldNumber = 2; + const ::google::protobuf::UninterpretedOption_NamePart& name(int index) const; + ::google::protobuf::UninterpretedOption_NamePart* mutable_name(int index); + ::google::protobuf::UninterpretedOption_NamePart* add_name(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >* + mutable_name(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >& + name() const; + + // optional string identifier_value = 3; + bool has_identifier_value() const; + void clear_identifier_value(); + static const int kIdentifierValueFieldNumber = 3; + const ::std::string& identifier_value() const; + void set_identifier_value(const ::std::string& value); + void set_identifier_value(const char* value); + void set_identifier_value(const char* value, size_t size); + ::std::string* mutable_identifier_value(); + ::std::string* release_identifier_value(); + void set_allocated_identifier_value(::std::string* identifier_value); + + // optional uint64 positive_int_value = 4; + bool has_positive_int_value() const; + void clear_positive_int_value(); + static const int kPositiveIntValueFieldNumber = 4; + ::google::protobuf::uint64 positive_int_value() const; + void set_positive_int_value(::google::protobuf::uint64 value); + + // optional int64 negative_int_value = 5; + bool has_negative_int_value() const; + void clear_negative_int_value(); + static const int kNegativeIntValueFieldNumber = 5; + ::google::protobuf::int64 negative_int_value() const; + void set_negative_int_value(::google::protobuf::int64 value); + + // optional double double_value = 6; + bool has_double_value() const; + void clear_double_value(); + static const int kDoubleValueFieldNumber = 6; + double double_value() const; + void set_double_value(double value); + + // optional bytes string_value = 7; + bool has_string_value() const; + void clear_string_value(); + static const int kStringValueFieldNumber = 7; + const ::std::string& string_value() const; + void set_string_value(const ::std::string& value); + void set_string_value(const char* value); + void set_string_value(const void* value, size_t size); + ::std::string* mutable_string_value(); + ::std::string* release_string_value(); + void set_allocated_string_value(::std::string* string_value); + + // optional string aggregate_value = 8; + bool has_aggregate_value() const; + void clear_aggregate_value(); + static const int kAggregateValueFieldNumber = 8; + const ::std::string& aggregate_value() const; + void set_aggregate_value(const ::std::string& value); + void set_aggregate_value(const char* value); + void set_aggregate_value(const char* value, size_t size); + ::std::string* mutable_aggregate_value(); + ::std::string* release_aggregate_value(); + void set_allocated_aggregate_value(::std::string* aggregate_value); + + // @@protoc_insertion_point(class_scope:google.protobuf.UninterpretedOption) + private: + inline void set_has_identifier_value(); + inline void clear_has_identifier_value(); + inline void set_has_positive_int_value(); + inline void clear_has_positive_int_value(); + inline void set_has_negative_int_value(); + inline void clear_has_negative_int_value(); + inline void set_has_double_value(); + inline void clear_has_double_value(); + inline void set_has_string_value(); + inline void clear_has_string_value(); + inline void set_has_aggregate_value(); + inline void clear_has_aggregate_value(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart > name_; + ::google::protobuf::internal::ArenaStringPtr identifier_value_; + ::google::protobuf::uint64 positive_int_value_; + ::google::protobuf::int64 negative_int_value_; + double double_value_; + ::google::protobuf::internal::ArenaStringPtr string_value_; + ::google::protobuf::internal::ArenaStringPtr aggregate_value_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static UninterpretedOption* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT SourceCodeInfo_Location : public ::google::protobuf::Message { + public: + SourceCodeInfo_Location(); + virtual ~SourceCodeInfo_Location(); + + SourceCodeInfo_Location(const SourceCodeInfo_Location& from); + + inline SourceCodeInfo_Location& operator=(const SourceCodeInfo_Location& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SourceCodeInfo_Location& default_instance(); + + void Swap(SourceCodeInfo_Location* other); + + // implements Message ---------------------------------------------- + + inline SourceCodeInfo_Location* New() const { return New(NULL); } + + SourceCodeInfo_Location* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SourceCodeInfo_Location& from); + void MergeFrom(const SourceCodeInfo_Location& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SourceCodeInfo_Location* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 path = 1 [packed = true]; + int path_size() const; + void clear_path(); + static const int kPathFieldNumber = 1; + ::google::protobuf::int32 path(int index) const; + void set_path(int index, ::google::protobuf::int32 value); + void add_path(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + path() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_path(); + + // repeated int32 span = 2 [packed = true]; + int span_size() const; + void clear_span(); + static const int kSpanFieldNumber = 2; + ::google::protobuf::int32 span(int index) const; + void set_span(int index, ::google::protobuf::int32 value); + void add_span(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + span() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_span(); + + // optional string leading_comments = 3; + bool has_leading_comments() const; + void clear_leading_comments(); + static const int kLeadingCommentsFieldNumber = 3; + const ::std::string& leading_comments() const; + void set_leading_comments(const ::std::string& value); + void set_leading_comments(const char* value); + void set_leading_comments(const char* value, size_t size); + ::std::string* mutable_leading_comments(); + ::std::string* release_leading_comments(); + void set_allocated_leading_comments(::std::string* leading_comments); + + // optional string trailing_comments = 4; + bool has_trailing_comments() const; + void clear_trailing_comments(); + static const int kTrailingCommentsFieldNumber = 4; + const ::std::string& trailing_comments() const; + void set_trailing_comments(const ::std::string& value); + void set_trailing_comments(const char* value); + void set_trailing_comments(const char* value, size_t size); + ::std::string* mutable_trailing_comments(); + ::std::string* release_trailing_comments(); + void set_allocated_trailing_comments(::std::string* trailing_comments); + + // repeated string leading_detached_comments = 6; + int leading_detached_comments_size() const; + void clear_leading_detached_comments(); + static const int kLeadingDetachedCommentsFieldNumber = 6; + const ::std::string& leading_detached_comments(int index) const; + ::std::string* mutable_leading_detached_comments(int index); + void set_leading_detached_comments(int index, const ::std::string& value); + void set_leading_detached_comments(int index, const char* value); + void set_leading_detached_comments(int index, const char* value, size_t size); + ::std::string* add_leading_detached_comments(); + void add_leading_detached_comments(const ::std::string& value); + void add_leading_detached_comments(const char* value); + void add_leading_detached_comments(const char* value, size_t size); + const ::google::protobuf::RepeatedPtrField< ::std::string>& leading_detached_comments() const; + ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_leading_detached_comments(); + + // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo.Location) + private: + inline void set_has_leading_comments(); + inline void clear_has_leading_comments(); + inline void set_has_trailing_comments(); + inline void clear_has_trailing_comments(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > path_; + mutable int _path_cached_byte_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > span_; + mutable int _span_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr leading_comments_; + ::google::protobuf::internal::ArenaStringPtr trailing_comments_; + ::google::protobuf::RepeatedPtrField< ::std::string> leading_detached_comments_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static SourceCodeInfo_Location* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT SourceCodeInfo : public ::google::protobuf::Message { + public: + SourceCodeInfo(); + virtual ~SourceCodeInfo(); + + SourceCodeInfo(const SourceCodeInfo& from); + + inline SourceCodeInfo& operator=(const SourceCodeInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const SourceCodeInfo& default_instance(); + + void Swap(SourceCodeInfo* other); + + // implements Message ---------------------------------------------- + + inline SourceCodeInfo* New() const { return New(NULL); } + + SourceCodeInfo* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const SourceCodeInfo& from); + void MergeFrom(const SourceCodeInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(SourceCodeInfo* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef SourceCodeInfo_Location Location; + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.SourceCodeInfo.Location location = 1; + int location_size() const; + void clear_location(); + static const int kLocationFieldNumber = 1; + const ::google::protobuf::SourceCodeInfo_Location& location(int index) const; + ::google::protobuf::SourceCodeInfo_Location* mutable_location(int index); + ::google::protobuf::SourceCodeInfo_Location* add_location(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >* + mutable_location(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >& + location() const; + + // @@protoc_insertion_point(class_scope:google.protobuf.SourceCodeInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location > location_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static SourceCodeInfo* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT GeneratedCodeInfo_Annotation : public ::google::protobuf::Message { + public: + GeneratedCodeInfo_Annotation(); + virtual ~GeneratedCodeInfo_Annotation(); + + GeneratedCodeInfo_Annotation(const GeneratedCodeInfo_Annotation& from); + + inline GeneratedCodeInfo_Annotation& operator=(const GeneratedCodeInfo_Annotation& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const GeneratedCodeInfo_Annotation& default_instance(); + + void Swap(GeneratedCodeInfo_Annotation* other); + + // implements Message ---------------------------------------------- + + inline GeneratedCodeInfo_Annotation* New() const { return New(NULL); } + + GeneratedCodeInfo_Annotation* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const GeneratedCodeInfo_Annotation& from); + void MergeFrom(const GeneratedCodeInfo_Annotation& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(GeneratedCodeInfo_Annotation* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // repeated int32 path = 1 [packed = true]; + int path_size() const; + void clear_path(); + static const int kPathFieldNumber = 1; + ::google::protobuf::int32 path(int index) const; + void set_path(int index, ::google::protobuf::int32 value); + void add_path(::google::protobuf::int32 value); + const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& + path() const; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* + mutable_path(); + + // optional string source_file = 2; + bool has_source_file() const; + void clear_source_file(); + static const int kSourceFileFieldNumber = 2; + const ::std::string& source_file() const; + void set_source_file(const ::std::string& value); + void set_source_file(const char* value); + void set_source_file(const char* value, size_t size); + ::std::string* mutable_source_file(); + ::std::string* release_source_file(); + void set_allocated_source_file(::std::string* source_file); + + // optional int32 begin = 3; + bool has_begin() const; + void clear_begin(); + static const int kBeginFieldNumber = 3; + ::google::protobuf::int32 begin() const; + void set_begin(::google::protobuf::int32 value); + + // optional int32 end = 4; + bool has_end() const; + void clear_end(); + static const int kEndFieldNumber = 4; + ::google::protobuf::int32 end() const; + void set_end(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo.Annotation) + private: + inline void set_has_source_file(); + inline void clear_has_source_file(); + inline void set_has_begin(); + inline void clear_has_begin(); + inline void set_has_end(); + inline void clear_has_end(); + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedField< ::google::protobuf::int32 > path_; + mutable int _path_cached_byte_size_; + ::google::protobuf::internal::ArenaStringPtr source_file_; + ::google::protobuf::int32 begin_; + ::google::protobuf::int32 end_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static GeneratedCodeInfo_Annotation* default_instance_; +}; +// ------------------------------------------------------------------- + +class LIBPROTOBUF_EXPORT GeneratedCodeInfo : public ::google::protobuf::Message { + public: + GeneratedCodeInfo(); + virtual ~GeneratedCodeInfo(); + + GeneratedCodeInfo(const GeneratedCodeInfo& from); + + inline GeneratedCodeInfo& operator=(const GeneratedCodeInfo& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _internal_metadata_.unknown_fields(); + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return _internal_metadata_.mutable_unknown_fields(); + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const GeneratedCodeInfo& default_instance(); + + void Swap(GeneratedCodeInfo* other); + + // implements Message ---------------------------------------------- + + inline GeneratedCodeInfo* New() const { return New(NULL); } + + GeneratedCodeInfo* New(::google::protobuf::Arena* arena) const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const GeneratedCodeInfo& from); + void MergeFrom(const GeneratedCodeInfo& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + void InternalSwap(GeneratedCodeInfo* other); + private: + inline ::google::protobuf::Arena* GetArenaNoVirtual() const { + return _internal_metadata_.arena(); + } + inline void* MaybeArenaPtr() const { + return _internal_metadata_.raw_arena_ptr(); + } + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + typedef GeneratedCodeInfo_Annotation Annotation; + + // accessors ------------------------------------------------------- + + // repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + int annotation_size() const; + void clear_annotation(); + static const int kAnnotationFieldNumber = 1; + const ::google::protobuf::GeneratedCodeInfo_Annotation& annotation(int index) const; + ::google::protobuf::GeneratedCodeInfo_Annotation* mutable_annotation(int index); + ::google::protobuf::GeneratedCodeInfo_Annotation* add_annotation(); + ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >* + mutable_annotation(); + const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >& + annotation() const; + + // @@protoc_insertion_point(class_scope:google.protobuf.GeneratedCodeInfo) + private: + + ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; + ::google::protobuf::uint32 _has_bits_[1]; + mutable int _cached_size_; + ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation > annotation_; + friend void LIBPROTOBUF_EXPORT protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_AssignDesc_google_2fprotobuf_2fdescriptor_2eproto(); + friend void protobuf_ShutdownFile_google_2fprotobuf_2fdescriptor_2eproto(); + + void InitAsDefaultInstance(); + static GeneratedCodeInfo* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +#if !PROTOBUF_INLINE_NOT_IN_HEADERS +// FileDescriptorSet + +// repeated .google.protobuf.FileDescriptorProto file = 1; +inline int FileDescriptorSet::file_size() const { + return file_.size(); +} +inline void FileDescriptorSet::clear_file() { + file_.Clear(); +} +inline const ::google::protobuf::FileDescriptorProto& FileDescriptorSet::file(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorSet.file) + return file_.Get(index); +} +inline ::google::protobuf::FileDescriptorProto* FileDescriptorSet::mutable_file(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorSet.file) + return file_.Mutable(index); +} +inline ::google::protobuf::FileDescriptorProto* FileDescriptorSet::add_file() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorSet.file) + return file_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >* +FileDescriptorSet::mutable_file() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorSet.file) + return &file_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FileDescriptorProto >& +FileDescriptorSet::file() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorSet.file) + return file_; +} + +// ------------------------------------------------------------------- + +// FileDescriptorProto + +// optional string name = 1; +inline bool FileDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FileDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void FileDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FileDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& FileDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.name) +} +inline void FileDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.name) +} +inline void FileDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.name) +} +inline ::std::string* FileDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.name) +} + +// optional string package = 2; +inline bool FileDescriptorProto::has_package() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FileDescriptorProto::set_has_package() { + _has_bits_[0] |= 0x00000002u; +} +inline void FileDescriptorProto::clear_has_package() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FileDescriptorProto::clear_package() { + package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_package(); +} +inline const ::std::string& FileDescriptorProto::package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.package) + return package_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileDescriptorProto::set_package(const ::std::string& value) { + set_has_package(); + package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.package) +} +inline void FileDescriptorProto::set_package(const char* value) { + set_has_package(); + package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.package) +} +inline void FileDescriptorProto::set_package(const char* value, size_t size) { + set_has_package(); + package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.package) +} +inline ::std::string* FileDescriptorProto::mutable_package() { + set_has_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.package) + return package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileDescriptorProto::release_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.package) + clear_has_package(); + return package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileDescriptorProto::set_allocated_package(::std::string* package) { + if (package != NULL) { + set_has_package(); + } else { + clear_has_package(); + } + package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), package); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.package) +} + +// repeated string dependency = 3; +inline int FileDescriptorProto::dependency_size() const { + return dependency_.size(); +} +inline void FileDescriptorProto::clear_dependency() { + dependency_.Clear(); +} +inline const ::std::string& FileDescriptorProto::dependency(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.dependency) + return dependency_.Get(index); +} +inline ::std::string* FileDescriptorProto::mutable_dependency(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.dependency) + return dependency_.Mutable(index); +} +inline void FileDescriptorProto::set_dependency(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.dependency) + dependency_.Mutable(index)->assign(value); +} +inline void FileDescriptorProto::set_dependency(int index, const char* value) { + dependency_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.dependency) +} +inline void FileDescriptorProto::set_dependency(int index, const char* value, size_t size) { + dependency_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.dependency) +} +inline ::std::string* FileDescriptorProto::add_dependency() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.FileDescriptorProto.dependency) + return dependency_.Add(); +} +inline void FileDescriptorProto::add_dependency(const ::std::string& value) { + dependency_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.dependency) +} +inline void FileDescriptorProto::add_dependency(const char* value) { + dependency_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:google.protobuf.FileDescriptorProto.dependency) +} +inline void FileDescriptorProto::add_dependency(const char* value, size_t size) { + dependency_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.FileDescriptorProto.dependency) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +FileDescriptorProto::dependency() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.dependency) + return dependency_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +FileDescriptorProto::mutable_dependency() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.dependency) + return &dependency_; +} + +// repeated int32 public_dependency = 10; +inline int FileDescriptorProto::public_dependency_size() const { + return public_dependency_.size(); +} +inline void FileDescriptorProto::clear_public_dependency() { + public_dependency_.Clear(); +} +inline ::google::protobuf::int32 FileDescriptorProto::public_dependency(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.public_dependency) + return public_dependency_.Get(index); +} +inline void FileDescriptorProto::set_public_dependency(int index, ::google::protobuf::int32 value) { + public_dependency_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.public_dependency) +} +inline void FileDescriptorProto::add_public_dependency(::google::protobuf::int32 value) { + public_dependency_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.public_dependency) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +FileDescriptorProto::public_dependency() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.public_dependency) + return public_dependency_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +FileDescriptorProto::mutable_public_dependency() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.public_dependency) + return &public_dependency_; +} + +// repeated int32 weak_dependency = 11; +inline int FileDescriptorProto::weak_dependency_size() const { + return weak_dependency_.size(); +} +inline void FileDescriptorProto::clear_weak_dependency() { + weak_dependency_.Clear(); +} +inline ::google::protobuf::int32 FileDescriptorProto::weak_dependency(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.weak_dependency) + return weak_dependency_.Get(index); +} +inline void FileDescriptorProto::set_weak_dependency(int index, ::google::protobuf::int32 value) { + weak_dependency_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.weak_dependency) +} +inline void FileDescriptorProto::add_weak_dependency(::google::protobuf::int32 value) { + weak_dependency_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.weak_dependency) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +FileDescriptorProto::weak_dependency() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.weak_dependency) + return weak_dependency_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +FileDescriptorProto::mutable_weak_dependency() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.weak_dependency) + return &weak_dependency_; +} + +// repeated .google.protobuf.DescriptorProto message_type = 4; +inline int FileDescriptorProto::message_type_size() const { + return message_type_.size(); +} +inline void FileDescriptorProto::clear_message_type() { + message_type_.Clear(); +} +inline const ::google::protobuf::DescriptorProto& FileDescriptorProto::message_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.message_type) + return message_type_.Get(index); +} +inline ::google::protobuf::DescriptorProto* FileDescriptorProto::mutable_message_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.message_type) + return message_type_.Mutable(index); +} +inline ::google::protobuf::DescriptorProto* FileDescriptorProto::add_message_type() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.message_type) + return message_type_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* +FileDescriptorProto::mutable_message_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.message_type) + return &message_type_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& +FileDescriptorProto::message_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.message_type) + return message_type_; +} + +// repeated .google.protobuf.EnumDescriptorProto enum_type = 5; +inline int FileDescriptorProto::enum_type_size() const { + return enum_type_.size(); +} +inline void FileDescriptorProto::clear_enum_type() { + enum_type_.Clear(); +} +inline const ::google::protobuf::EnumDescriptorProto& FileDescriptorProto::enum_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_.Get(index); +} +inline ::google::protobuf::EnumDescriptorProto* FileDescriptorProto::mutable_enum_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_.Mutable(index); +} +inline ::google::protobuf::EnumDescriptorProto* FileDescriptorProto::add_enum_type() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* +FileDescriptorProto::mutable_enum_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.enum_type) + return &enum_type_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& +FileDescriptorProto::enum_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.enum_type) + return enum_type_; +} + +// repeated .google.protobuf.ServiceDescriptorProto service = 6; +inline int FileDescriptorProto::service_size() const { + return service_.size(); +} +inline void FileDescriptorProto::clear_service() { + service_.Clear(); +} +inline const ::google::protobuf::ServiceDescriptorProto& FileDescriptorProto::service(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.service) + return service_.Get(index); +} +inline ::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::mutable_service(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.service) + return service_.Mutable(index); +} +inline ::google::protobuf::ServiceDescriptorProto* FileDescriptorProto::add_service() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.service) + return service_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >* +FileDescriptorProto::mutable_service() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.service) + return &service_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::ServiceDescriptorProto >& +FileDescriptorProto::service() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.service) + return service_; +} + +// repeated .google.protobuf.FieldDescriptorProto extension = 7; +inline int FileDescriptorProto::extension_size() const { + return extension_.size(); +} +inline void FileDescriptorProto::clear_extension() { + extension_.Clear(); +} +inline const ::google::protobuf::FieldDescriptorProto& FileDescriptorProto::extension(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.extension) + return extension_.Get(index); +} +inline ::google::protobuf::FieldDescriptorProto* FileDescriptorProto::mutable_extension(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.extension) + return extension_.Mutable(index); +} +inline ::google::protobuf::FieldDescriptorProto* FileDescriptorProto::add_extension() { + // @@protoc_insertion_point(field_add:google.protobuf.FileDescriptorProto.extension) + return extension_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* +FileDescriptorProto::mutable_extension() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileDescriptorProto.extension) + return &extension_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& +FileDescriptorProto::extension() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileDescriptorProto.extension) + return extension_; +} + +// optional .google.protobuf.FileOptions options = 8; +inline bool FileDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void FileDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000200u; +} +inline void FileDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000200u; +} +inline void FileDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::FileOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::FileOptions& FileDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::FileOptions* FileDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::FileOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.options) + return options_; +} +inline ::google::protobuf::FileOptions* FileDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.options) + clear_has_options(); + ::google::protobuf::FileOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void FileDescriptorProto::set_allocated_options(::google::protobuf::FileOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.options) +} + +// optional .google.protobuf.SourceCodeInfo source_code_info = 9; +inline bool FileDescriptorProto::has_source_code_info() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void FileDescriptorProto::set_has_source_code_info() { + _has_bits_[0] |= 0x00000400u; +} +inline void FileDescriptorProto::clear_has_source_code_info() { + _has_bits_[0] &= ~0x00000400u; +} +inline void FileDescriptorProto::clear_source_code_info() { + if (source_code_info_ != NULL) source_code_info_->::google::protobuf::SourceCodeInfo::Clear(); + clear_has_source_code_info(); +} +inline const ::google::protobuf::SourceCodeInfo& FileDescriptorProto::source_code_info() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.source_code_info) + return source_code_info_ != NULL ? *source_code_info_ : *default_instance_->source_code_info_; +} +inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::mutable_source_code_info() { + set_has_source_code_info(); + if (source_code_info_ == NULL) { + source_code_info_ = new ::google::protobuf::SourceCodeInfo; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.source_code_info) + return source_code_info_; +} +inline ::google::protobuf::SourceCodeInfo* FileDescriptorProto::release_source_code_info() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.source_code_info) + clear_has_source_code_info(); + ::google::protobuf::SourceCodeInfo* temp = source_code_info_; + source_code_info_ = NULL; + return temp; +} +inline void FileDescriptorProto::set_allocated_source_code_info(::google::protobuf::SourceCodeInfo* source_code_info) { + delete source_code_info_; + source_code_info_ = source_code_info; + if (source_code_info) { + set_has_source_code_info(); + } else { + clear_has_source_code_info(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.source_code_info) +} + +// optional string syntax = 12; +inline bool FileDescriptorProto::has_syntax() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void FileDescriptorProto::set_has_syntax() { + _has_bits_[0] |= 0x00000800u; +} +inline void FileDescriptorProto::clear_has_syntax() { + _has_bits_[0] &= ~0x00000800u; +} +inline void FileDescriptorProto::clear_syntax() { + syntax_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_syntax(); +} +inline const ::std::string& FileDescriptorProto::syntax() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileDescriptorProto.syntax) + return syntax_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileDescriptorProto::set_syntax(const ::std::string& value) { + set_has_syntax(); + syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileDescriptorProto.syntax) +} +inline void FileDescriptorProto::set_syntax(const char* value) { + set_has_syntax(); + syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileDescriptorProto.syntax) +} +inline void FileDescriptorProto::set_syntax(const char* value, size_t size) { + set_has_syntax(); + syntax_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileDescriptorProto.syntax) +} +inline ::std::string* FileDescriptorProto::mutable_syntax() { + set_has_syntax(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileDescriptorProto.syntax) + return syntax_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileDescriptorProto::release_syntax() { + // @@protoc_insertion_point(field_release:google.protobuf.FileDescriptorProto.syntax) + clear_has_syntax(); + return syntax_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileDescriptorProto::set_allocated_syntax(::std::string* syntax) { + if (syntax != NULL) { + set_has_syntax(); + } else { + clear_has_syntax(); + } + syntax_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), syntax); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileDescriptorProto.syntax) +} + +// ------------------------------------------------------------------- + +// DescriptorProto_ExtensionRange + +// optional int32 start = 1; +inline bool DescriptorProto_ExtensionRange::has_start() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DescriptorProto_ExtensionRange::set_has_start() { + _has_bits_[0] |= 0x00000001u; +} +inline void DescriptorProto_ExtensionRange::clear_has_start() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DescriptorProto_ExtensionRange::clear_start() { + start_ = 0; + clear_has_start(); +} +inline ::google::protobuf::int32 DescriptorProto_ExtensionRange::start() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.start) + return start_; +} +inline void DescriptorProto_ExtensionRange::set_start(::google::protobuf::int32 value) { + set_has_start(); + start_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.start) +} + +// optional int32 end = 2; +inline bool DescriptorProto_ExtensionRange::has_end() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DescriptorProto_ExtensionRange::set_has_end() { + _has_bits_[0] |= 0x00000002u; +} +inline void DescriptorProto_ExtensionRange::clear_has_end() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DescriptorProto_ExtensionRange::clear_end() { + end_ = 0; + clear_has_end(); +} +inline ::google::protobuf::int32 DescriptorProto_ExtensionRange::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ExtensionRange.end) + return end_; +} +inline void DescriptorProto_ExtensionRange::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ExtensionRange.end) +} + +// ------------------------------------------------------------------- + +// DescriptorProto_ReservedRange + +// optional int32 start = 1; +inline bool DescriptorProto_ReservedRange::has_start() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DescriptorProto_ReservedRange::set_has_start() { + _has_bits_[0] |= 0x00000001u; +} +inline void DescriptorProto_ReservedRange::clear_has_start() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DescriptorProto_ReservedRange::clear_start() { + start_ = 0; + clear_has_start(); +} +inline ::google::protobuf::int32 DescriptorProto_ReservedRange::start() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.start) + return start_; +} +inline void DescriptorProto_ReservedRange::set_start(::google::protobuf::int32 value) { + set_has_start(); + start_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.start) +} + +// optional int32 end = 2; +inline bool DescriptorProto_ReservedRange::has_end() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void DescriptorProto_ReservedRange::set_has_end() { + _has_bits_[0] |= 0x00000002u; +} +inline void DescriptorProto_ReservedRange::clear_has_end() { + _has_bits_[0] &= ~0x00000002u; +} +inline void DescriptorProto_ReservedRange::clear_end() { + end_ = 0; + clear_has_end(); +} +inline ::google::protobuf::int32 DescriptorProto_ReservedRange::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.ReservedRange.end) + return end_; +} +inline void DescriptorProto_ReservedRange::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.ReservedRange.end) +} + +// ------------------------------------------------------------------- + +// DescriptorProto + +// optional string name = 1; +inline bool DescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void DescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void DescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void DescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& DescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.name) +} +inline void DescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.name) +} +inline void DescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.name) +} +inline ::std::string* DescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* DescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void DescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.name) +} + +// repeated .google.protobuf.FieldDescriptorProto field = 2; +inline int DescriptorProto::field_size() const { + return field_.size(); +} +inline void DescriptorProto::clear_field() { + field_.Clear(); +} +inline const ::google::protobuf::FieldDescriptorProto& DescriptorProto::field(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.field) + return field_.Get(index); +} +inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_field(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.field) + return field_.Mutable(index); +} +inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::add_field() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.field) + return field_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* +DescriptorProto::mutable_field() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.field) + return &field_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& +DescriptorProto::field() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.field) + return field_; +} + +// repeated .google.protobuf.FieldDescriptorProto extension = 6; +inline int DescriptorProto::extension_size() const { + return extension_.size(); +} +inline void DescriptorProto::clear_extension() { + extension_.Clear(); +} +inline const ::google::protobuf::FieldDescriptorProto& DescriptorProto::extension(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension) + return extension_.Get(index); +} +inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::mutable_extension(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension) + return extension_.Mutable(index); +} +inline ::google::protobuf::FieldDescriptorProto* DescriptorProto::add_extension() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension) + return extension_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >* +DescriptorProto::mutable_extension() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension) + return &extension_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::FieldDescriptorProto >& +DescriptorProto::extension() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension) + return extension_; +} + +// repeated .google.protobuf.DescriptorProto nested_type = 3; +inline int DescriptorProto::nested_type_size() const { + return nested_type_.size(); +} +inline void DescriptorProto::clear_nested_type() { + nested_type_.Clear(); +} +inline const ::google::protobuf::DescriptorProto& DescriptorProto::nested_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.nested_type) + return nested_type_.Get(index); +} +inline ::google::protobuf::DescriptorProto* DescriptorProto::mutable_nested_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.nested_type) + return nested_type_.Mutable(index); +} +inline ::google::protobuf::DescriptorProto* DescriptorProto::add_nested_type() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.nested_type) + return nested_type_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >* +DescriptorProto::mutable_nested_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.nested_type) + return &nested_type_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto >& +DescriptorProto::nested_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.nested_type) + return nested_type_; +} + +// repeated .google.protobuf.EnumDescriptorProto enum_type = 4; +inline int DescriptorProto::enum_type_size() const { + return enum_type_.size(); +} +inline void DescriptorProto::clear_enum_type() { + enum_type_.Clear(); +} +inline const ::google::protobuf::EnumDescriptorProto& DescriptorProto::enum_type(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.enum_type) + return enum_type_.Get(index); +} +inline ::google::protobuf::EnumDescriptorProto* DescriptorProto::mutable_enum_type(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.enum_type) + return enum_type_.Mutable(index); +} +inline ::google::protobuf::EnumDescriptorProto* DescriptorProto::add_enum_type() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.enum_type) + return enum_type_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >* +DescriptorProto::mutable_enum_type() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.enum_type) + return &enum_type_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumDescriptorProto >& +DescriptorProto::enum_type() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.enum_type) + return enum_type_; +} + +// repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; +inline int DescriptorProto::extension_range_size() const { + return extension_range_.size(); +} +inline void DescriptorProto::clear_extension_range() { + extension_range_.Clear(); +} +inline const ::google::protobuf::DescriptorProto_ExtensionRange& DescriptorProto::extension_range(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.extension_range) + return extension_range_.Get(index); +} +inline ::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::mutable_extension_range(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.extension_range) + return extension_range_.Mutable(index); +} +inline ::google::protobuf::DescriptorProto_ExtensionRange* DescriptorProto::add_extension_range() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.extension_range) + return extension_range_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >* +DescriptorProto::mutable_extension_range() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.extension_range) + return &extension_range_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ExtensionRange >& +DescriptorProto::extension_range() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.extension_range) + return extension_range_; +} + +// repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8; +inline int DescriptorProto::oneof_decl_size() const { + return oneof_decl_.size(); +} +inline void DescriptorProto::clear_oneof_decl() { + oneof_decl_.Clear(); +} +inline const ::google::protobuf::OneofDescriptorProto& DescriptorProto::oneof_decl(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_.Get(index); +} +inline ::google::protobuf::OneofDescriptorProto* DescriptorProto::mutable_oneof_decl(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_.Mutable(index); +} +inline ::google::protobuf::OneofDescriptorProto* DescriptorProto::add_oneof_decl() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >* +DescriptorProto::mutable_oneof_decl() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.oneof_decl) + return &oneof_decl_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::OneofDescriptorProto >& +DescriptorProto::oneof_decl() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.oneof_decl) + return oneof_decl_; +} + +// optional .google.protobuf.MessageOptions options = 7; +inline bool DescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void DescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000080u; +} +inline void DescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000080u; +} +inline void DescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::MessageOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::MessageOptions& DescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::MessageOptions* DescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::MessageOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.options) + return options_; +} +inline ::google::protobuf::MessageOptions* DescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.DescriptorProto.options) + clear_has_options(); + ::google::protobuf::MessageOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void DescriptorProto::set_allocated_options(::google::protobuf::MessageOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.DescriptorProto.options) +} + +// repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; +inline int DescriptorProto::reserved_range_size() const { + return reserved_range_.size(); +} +inline void DescriptorProto::clear_reserved_range() { + reserved_range_.Clear(); +} +inline const ::google::protobuf::DescriptorProto_ReservedRange& DescriptorProto::reserved_range(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_.Get(index); +} +inline ::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::mutable_reserved_range(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_.Mutable(index); +} +inline ::google::protobuf::DescriptorProto_ReservedRange* DescriptorProto::add_reserved_range() { + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >* +DescriptorProto::mutable_reserved_range() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_range) + return &reserved_range_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::DescriptorProto_ReservedRange >& +DescriptorProto::reserved_range() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_range) + return reserved_range_; +} + +// repeated string reserved_name = 10; +inline int DescriptorProto::reserved_name_size() const { + return reserved_name_.size(); +} +inline void DescriptorProto::clear_reserved_name() { + reserved_name_.Clear(); +} +inline const ::std::string& DescriptorProto::reserved_name(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_.Get(index); +} +inline ::std::string* DescriptorProto::mutable_reserved_name(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_.Mutable(index); +} +inline void DescriptorProto::set_reserved_name(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.DescriptorProto.reserved_name) + reserved_name_.Mutable(index)->assign(value); +} +inline void DescriptorProto::set_reserved_name(int index, const char* value) { + reserved_name_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:google.protobuf.DescriptorProto.reserved_name) +} +inline void DescriptorProto::set_reserved_name(int index, const char* value, size_t size) { + reserved_name_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.DescriptorProto.reserved_name) +} +inline ::std::string* DescriptorProto::add_reserved_name() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_.Add(); +} +inline void DescriptorProto::add_reserved_name(const ::std::string& value) { + reserved_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.DescriptorProto.reserved_name) +} +inline void DescriptorProto::add_reserved_name(const char* value) { + reserved_name_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:google.protobuf.DescriptorProto.reserved_name) +} +inline void DescriptorProto::add_reserved_name(const char* value, size_t size) { + reserved_name_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.DescriptorProto.reserved_name) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +DescriptorProto::reserved_name() const { + // @@protoc_insertion_point(field_list:google.protobuf.DescriptorProto.reserved_name) + return reserved_name_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +DescriptorProto::mutable_reserved_name() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.DescriptorProto.reserved_name) + return &reserved_name_; +} + +// ------------------------------------------------------------------- + +// FieldDescriptorProto + +// optional string name = 1; +inline bool FieldDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FieldDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void FieldDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FieldDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& FieldDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.name) +} +inline void FieldDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.name) +} +inline void FieldDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.name) +} +inline ::std::string* FieldDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FieldDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.name) +} + +// optional int32 number = 3; +inline bool FieldDescriptorProto::has_number() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FieldDescriptorProto::set_has_number() { + _has_bits_[0] |= 0x00000002u; +} +inline void FieldDescriptorProto::clear_has_number() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FieldDescriptorProto::clear_number() { + number_ = 0; + clear_has_number(); +} +inline ::google::protobuf::int32 FieldDescriptorProto::number() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.number) + return number_; +} +inline void FieldDescriptorProto::set_number(::google::protobuf::int32 value) { + set_has_number(); + number_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.number) +} + +// optional .google.protobuf.FieldDescriptorProto.Label label = 4; +inline bool FieldDescriptorProto::has_label() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void FieldDescriptorProto::set_has_label() { + _has_bits_[0] |= 0x00000004u; +} +inline void FieldDescriptorProto::clear_has_label() { + _has_bits_[0] &= ~0x00000004u; +} +inline void FieldDescriptorProto::clear_label() { + label_ = 1; + clear_has_label(); +} +inline ::google::protobuf::FieldDescriptorProto_Label FieldDescriptorProto::label() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.label) + return static_cast< ::google::protobuf::FieldDescriptorProto_Label >(label_); +} +inline void FieldDescriptorProto::set_label(::google::protobuf::FieldDescriptorProto_Label value) { + assert(::google::protobuf::FieldDescriptorProto_Label_IsValid(value)); + set_has_label(); + label_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.label) +} + +// optional .google.protobuf.FieldDescriptorProto.Type type = 5; +inline bool FieldDescriptorProto::has_type() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void FieldDescriptorProto::set_has_type() { + _has_bits_[0] |= 0x00000008u; +} +inline void FieldDescriptorProto::clear_has_type() { + _has_bits_[0] &= ~0x00000008u; +} +inline void FieldDescriptorProto::clear_type() { + type_ = 1; + clear_has_type(); +} +inline ::google::protobuf::FieldDescriptorProto_Type FieldDescriptorProto::type() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type) + return static_cast< ::google::protobuf::FieldDescriptorProto_Type >(type_); +} +inline void FieldDescriptorProto::set_type(::google::protobuf::FieldDescriptorProto_Type value) { + assert(::google::protobuf::FieldDescriptorProto_Type_IsValid(value)); + set_has_type(); + type_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type) +} + +// optional string type_name = 6; +inline bool FieldDescriptorProto::has_type_name() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void FieldDescriptorProto::set_has_type_name() { + _has_bits_[0] |= 0x00000010u; +} +inline void FieldDescriptorProto::clear_has_type_name() { + _has_bits_[0] &= ~0x00000010u; +} +inline void FieldDescriptorProto::clear_type_name() { + type_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_type_name(); +} +inline const ::std::string& FieldDescriptorProto::type_name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.type_name) + return type_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_type_name(const ::std::string& value) { + set_has_type_name(); + type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.type_name) +} +inline void FieldDescriptorProto::set_type_name(const char* value) { + set_has_type_name(); + type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.type_name) +} +inline void FieldDescriptorProto::set_type_name(const char* value, size_t size) { + set_has_type_name(); + type_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.type_name) +} +inline ::std::string* FieldDescriptorProto::mutable_type_name() { + set_has_type_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.type_name) + return type_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FieldDescriptorProto::release_type_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.type_name) + clear_has_type_name(); + return type_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_allocated_type_name(::std::string* type_name) { + if (type_name != NULL) { + set_has_type_name(); + } else { + clear_has_type_name(); + } + type_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), type_name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.type_name) +} + +// optional string extendee = 2; +inline bool FieldDescriptorProto::has_extendee() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void FieldDescriptorProto::set_has_extendee() { + _has_bits_[0] |= 0x00000020u; +} +inline void FieldDescriptorProto::clear_has_extendee() { + _has_bits_[0] &= ~0x00000020u; +} +inline void FieldDescriptorProto::clear_extendee() { + extendee_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_extendee(); +} +inline const ::std::string& FieldDescriptorProto::extendee() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.extendee) + return extendee_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_extendee(const ::std::string& value) { + set_has_extendee(); + extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.extendee) +} +inline void FieldDescriptorProto::set_extendee(const char* value) { + set_has_extendee(); + extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.extendee) +} +inline void FieldDescriptorProto::set_extendee(const char* value, size_t size) { + set_has_extendee(); + extendee_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.extendee) +} +inline ::std::string* FieldDescriptorProto::mutable_extendee() { + set_has_extendee(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.extendee) + return extendee_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FieldDescriptorProto::release_extendee() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.extendee) + clear_has_extendee(); + return extendee_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_allocated_extendee(::std::string* extendee) { + if (extendee != NULL) { + set_has_extendee(); + } else { + clear_has_extendee(); + } + extendee_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), extendee); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.extendee) +} + +// optional string default_value = 7; +inline bool FieldDescriptorProto::has_default_value() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void FieldDescriptorProto::set_has_default_value() { + _has_bits_[0] |= 0x00000040u; +} +inline void FieldDescriptorProto::clear_has_default_value() { + _has_bits_[0] &= ~0x00000040u; +} +inline void FieldDescriptorProto::clear_default_value() { + default_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_default_value(); +} +inline const ::std::string& FieldDescriptorProto::default_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.default_value) + return default_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_default_value(const ::std::string& value) { + set_has_default_value(); + default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.default_value) +} +inline void FieldDescriptorProto::set_default_value(const char* value) { + set_has_default_value(); + default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.default_value) +} +inline void FieldDescriptorProto::set_default_value(const char* value, size_t size) { + set_has_default_value(); + default_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.default_value) +} +inline ::std::string* FieldDescriptorProto::mutable_default_value() { + set_has_default_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.default_value) + return default_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FieldDescriptorProto::release_default_value() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.default_value) + clear_has_default_value(); + return default_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_allocated_default_value(::std::string* default_value) { + if (default_value != NULL) { + set_has_default_value(); + } else { + clear_has_default_value(); + } + default_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), default_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.default_value) +} + +// optional int32 oneof_index = 9; +inline bool FieldDescriptorProto::has_oneof_index() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void FieldDescriptorProto::set_has_oneof_index() { + _has_bits_[0] |= 0x00000080u; +} +inline void FieldDescriptorProto::clear_has_oneof_index() { + _has_bits_[0] &= ~0x00000080u; +} +inline void FieldDescriptorProto::clear_oneof_index() { + oneof_index_ = 0; + clear_has_oneof_index(); +} +inline ::google::protobuf::int32 FieldDescriptorProto::oneof_index() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.oneof_index) + return oneof_index_; +} +inline void FieldDescriptorProto::set_oneof_index(::google::protobuf::int32 value) { + set_has_oneof_index(); + oneof_index_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.oneof_index) +} + +// optional string json_name = 10; +inline bool FieldDescriptorProto::has_json_name() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void FieldDescriptorProto::set_has_json_name() { + _has_bits_[0] |= 0x00000100u; +} +inline void FieldDescriptorProto::clear_has_json_name() { + _has_bits_[0] &= ~0x00000100u; +} +inline void FieldDescriptorProto::clear_json_name() { + json_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_json_name(); +} +inline const ::std::string& FieldDescriptorProto::json_name() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.json_name) + return json_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_json_name(const ::std::string& value) { + set_has_json_name(); + json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FieldDescriptorProto.json_name) +} +inline void FieldDescriptorProto::set_json_name(const char* value) { + set_has_json_name(); + json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FieldDescriptorProto.json_name) +} +inline void FieldDescriptorProto::set_json_name(const char* value, size_t size) { + set_has_json_name(); + json_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FieldDescriptorProto.json_name) +} +inline ::std::string* FieldDescriptorProto::mutable_json_name() { + set_has_json_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.json_name) + return json_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FieldDescriptorProto::release_json_name() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.json_name) + clear_has_json_name(); + return json_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FieldDescriptorProto::set_allocated_json_name(::std::string* json_name) { + if (json_name != NULL) { + set_has_json_name(); + } else { + clear_has_json_name(); + } + json_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), json_name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.json_name) +} + +// optional .google.protobuf.FieldOptions options = 8; +inline bool FieldDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void FieldDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000200u; +} +inline void FieldDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000200u; +} +inline void FieldDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::FieldOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::FieldOptions& FieldDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::FieldOptions* FieldDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::FieldOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldDescriptorProto.options) + return options_; +} +inline ::google::protobuf::FieldOptions* FieldDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.FieldDescriptorProto.options) + clear_has_options(); + ::google::protobuf::FieldOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void FieldDescriptorProto::set_allocated_options(::google::protobuf::FieldOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FieldDescriptorProto.options) +} + +// ------------------------------------------------------------------- + +// OneofDescriptorProto + +// optional string name = 1; +inline bool OneofDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void OneofDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void OneofDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void OneofDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& OneofDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.OneofDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OneofDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.OneofDescriptorProto.name) +} +inline void OneofDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.OneofDescriptorProto.name) +} +inline void OneofDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.OneofDescriptorProto.name) +} +inline ::std::string* OneofDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.OneofDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* OneofDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.OneofDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void OneofDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.OneofDescriptorProto.name) +} + +// ------------------------------------------------------------------- + +// EnumDescriptorProto + +// optional string name = 1; +inline bool EnumDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EnumDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void EnumDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EnumDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& EnumDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EnumDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.EnumDescriptorProto.name) +} +inline void EnumDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.EnumDescriptorProto.name) +} +inline void EnumDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumDescriptorProto.name) +} +inline ::std::string* EnumDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EnumDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EnumDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.name) +} + +// repeated .google.protobuf.EnumValueDescriptorProto value = 2; +inline int EnumDescriptorProto::value_size() const { + return value_.size(); +} +inline void EnumDescriptorProto::clear_value() { + value_.Clear(); +} +inline const ::google::protobuf::EnumValueDescriptorProto& EnumDescriptorProto::value(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.value) + return value_.Get(index); +} +inline ::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::mutable_value(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.value) + return value_.Mutable(index); +} +inline ::google::protobuf::EnumValueDescriptorProto* EnumDescriptorProto::add_value() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumDescriptorProto.value) + return value_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >* +EnumDescriptorProto::mutable_value() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumDescriptorProto.value) + return &value_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::EnumValueDescriptorProto >& +EnumDescriptorProto::value() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumDescriptorProto.value) + return value_; +} + +// optional .google.protobuf.EnumOptions options = 3; +inline bool EnumDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void EnumDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000004u; +} +inline void EnumDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000004u; +} +inline void EnumDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::EnumOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::EnumOptions& EnumDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::EnumOptions* EnumDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::EnumOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumDescriptorProto.options) + return options_; +} +inline ::google::protobuf::EnumOptions* EnumDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumDescriptorProto.options) + clear_has_options(); + ::google::protobuf::EnumOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void EnumDescriptorProto::set_allocated_options(::google::protobuf::EnumOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumDescriptorProto.options) +} + +// ------------------------------------------------------------------- + +// EnumValueDescriptorProto + +// optional string name = 1; +inline bool EnumValueDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EnumValueDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void EnumValueDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EnumValueDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& EnumValueDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EnumValueDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.name) +} +inline void EnumValueDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.EnumValueDescriptorProto.name) +} +inline void EnumValueDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.EnumValueDescriptorProto.name) +} +inline ::std::string* EnumValueDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* EnumValueDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void EnumValueDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.name) +} + +// optional int32 number = 2; +inline bool EnumValueDescriptorProto::has_number() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void EnumValueDescriptorProto::set_has_number() { + _has_bits_[0] |= 0x00000002u; +} +inline void EnumValueDescriptorProto::clear_has_number() { + _has_bits_[0] &= ~0x00000002u; +} +inline void EnumValueDescriptorProto::clear_number() { + number_ = 0; + clear_has_number(); +} +inline ::google::protobuf::int32 EnumValueDescriptorProto::number() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.number) + return number_; +} +inline void EnumValueDescriptorProto::set_number(::google::protobuf::int32 value) { + set_has_number(); + number_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumValueDescriptorProto.number) +} + +// optional .google.protobuf.EnumValueOptions options = 3; +inline bool EnumValueDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void EnumValueDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000004u; +} +inline void EnumValueDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000004u; +} +inline void EnumValueDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::EnumValueOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::EnumValueOptions& EnumValueDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::EnumValueOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueDescriptorProto.options) + return options_; +} +inline ::google::protobuf::EnumValueOptions* EnumValueDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.EnumValueDescriptorProto.options) + clear_has_options(); + ::google::protobuf::EnumValueOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void EnumValueDescriptorProto::set_allocated_options(::google::protobuf::EnumValueOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.EnumValueDescriptorProto.options) +} + +// ------------------------------------------------------------------- + +// ServiceDescriptorProto + +// optional string name = 1; +inline bool ServiceDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ServiceDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void ServiceDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ServiceDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& ServiceDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServiceDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.ServiceDescriptorProto.name) +} +inline void ServiceDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.ServiceDescriptorProto.name) +} +inline void ServiceDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.ServiceDescriptorProto.name) +} +inline ::std::string* ServiceDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* ServiceDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void ServiceDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.name) +} + +// repeated .google.protobuf.MethodDescriptorProto method = 2; +inline int ServiceDescriptorProto::method_size() const { + return method_.size(); +} +inline void ServiceDescriptorProto::clear_method() { + method_.Clear(); +} +inline const ::google::protobuf::MethodDescriptorProto& ServiceDescriptorProto::method(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.method) + return method_.Get(index); +} +inline ::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::mutable_method(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.method) + return method_.Mutable(index); +} +inline ::google::protobuf::MethodDescriptorProto* ServiceDescriptorProto::add_method() { + // @@protoc_insertion_point(field_add:google.protobuf.ServiceDescriptorProto.method) + return method_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >* +ServiceDescriptorProto::mutable_method() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceDescriptorProto.method) + return &method_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::MethodDescriptorProto >& +ServiceDescriptorProto::method() const { + // @@protoc_insertion_point(field_list:google.protobuf.ServiceDescriptorProto.method) + return method_; +} + +// optional .google.protobuf.ServiceOptions options = 3; +inline bool ServiceDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ServiceDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000004u; +} +inline void ServiceDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ServiceDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::ServiceOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::ServiceOptions& ServiceDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::ServiceOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceDescriptorProto.options) + return options_; +} +inline ::google::protobuf::ServiceOptions* ServiceDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.ServiceDescriptorProto.options) + clear_has_options(); + ::google::protobuf::ServiceOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void ServiceDescriptorProto::set_allocated_options(::google::protobuf::ServiceOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.ServiceDescriptorProto.options) +} + +// ------------------------------------------------------------------- + +// MethodDescriptorProto + +// optional string name = 1; +inline bool MethodDescriptorProto::has_name() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MethodDescriptorProto::set_has_name() { + _has_bits_[0] |= 0x00000001u; +} +inline void MethodDescriptorProto::clear_has_name() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MethodDescriptorProto::clear_name() { + name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name(); +} +inline const ::std::string& MethodDescriptorProto::name() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.name) + return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MethodDescriptorProto::set_name(const ::std::string& value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.name) +} +inline void MethodDescriptorProto::set_name(const char* value) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.name) +} +inline void MethodDescriptorProto::set_name(const char* value, size_t size) { + set_has_name(); + name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.name) +} +inline ::std::string* MethodDescriptorProto::mutable_name() { + set_has_name(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.name) + return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MethodDescriptorProto::release_name() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.name) + clear_has_name(); + return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MethodDescriptorProto::set_allocated_name(::std::string* name) { + if (name != NULL) { + set_has_name(); + } else { + clear_has_name(); + } + name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.name) +} + +// optional string input_type = 2; +inline bool MethodDescriptorProto::has_input_type() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MethodDescriptorProto::set_has_input_type() { + _has_bits_[0] |= 0x00000002u; +} +inline void MethodDescriptorProto::clear_has_input_type() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MethodDescriptorProto::clear_input_type() { + input_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_input_type(); +} +inline const ::std::string& MethodDescriptorProto::input_type() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.input_type) + return input_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MethodDescriptorProto::set_input_type(const ::std::string& value) { + set_has_input_type(); + input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.input_type) +} +inline void MethodDescriptorProto::set_input_type(const char* value) { + set_has_input_type(); + input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.input_type) +} +inline void MethodDescriptorProto::set_input_type(const char* value, size_t size) { + set_has_input_type(); + input_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.input_type) +} +inline ::std::string* MethodDescriptorProto::mutable_input_type() { + set_has_input_type(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.input_type) + return input_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MethodDescriptorProto::release_input_type() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.input_type) + clear_has_input_type(); + return input_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MethodDescriptorProto::set_allocated_input_type(::std::string* input_type) { + if (input_type != NULL) { + set_has_input_type(); + } else { + clear_has_input_type(); + } + input_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), input_type); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.input_type) +} + +// optional string output_type = 3; +inline bool MethodDescriptorProto::has_output_type() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MethodDescriptorProto::set_has_output_type() { + _has_bits_[0] |= 0x00000004u; +} +inline void MethodDescriptorProto::clear_has_output_type() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MethodDescriptorProto::clear_output_type() { + output_type_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_output_type(); +} +inline const ::std::string& MethodDescriptorProto::output_type() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.output_type) + return output_type_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MethodDescriptorProto::set_output_type(const ::std::string& value) { + set_has_output_type(); + output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.output_type) +} +inline void MethodDescriptorProto::set_output_type(const char* value) { + set_has_output_type(); + output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.MethodDescriptorProto.output_type) +} +inline void MethodDescriptorProto::set_output_type(const char* value, size_t size) { + set_has_output_type(); + output_type_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.MethodDescriptorProto.output_type) +} +inline ::std::string* MethodDescriptorProto::mutable_output_type() { + set_has_output_type(); + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.output_type) + return output_type_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* MethodDescriptorProto::release_output_type() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.output_type) + clear_has_output_type(); + return output_type_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void MethodDescriptorProto::set_allocated_output_type(::std::string* output_type) { + if (output_type != NULL) { + set_has_output_type(); + } else { + clear_has_output_type(); + } + output_type_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), output_type); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.output_type) +} + +// optional .google.protobuf.MethodOptions options = 4; +inline bool MethodDescriptorProto::has_options() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void MethodDescriptorProto::set_has_options() { + _has_bits_[0] |= 0x00000008u; +} +inline void MethodDescriptorProto::clear_has_options() { + _has_bits_[0] &= ~0x00000008u; +} +inline void MethodDescriptorProto::clear_options() { + if (options_ != NULL) options_->::google::protobuf::MethodOptions::Clear(); + clear_has_options(); +} +inline const ::google::protobuf::MethodOptions& MethodDescriptorProto::options() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.options) + return options_ != NULL ? *options_ : *default_instance_->options_; +} +inline ::google::protobuf::MethodOptions* MethodDescriptorProto::mutable_options() { + set_has_options(); + if (options_ == NULL) { + options_ = new ::google::protobuf::MethodOptions; + } + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodDescriptorProto.options) + return options_; +} +inline ::google::protobuf::MethodOptions* MethodDescriptorProto::release_options() { + // @@protoc_insertion_point(field_release:google.protobuf.MethodDescriptorProto.options) + clear_has_options(); + ::google::protobuf::MethodOptions* temp = options_; + options_ = NULL; + return temp; +} +inline void MethodDescriptorProto::set_allocated_options(::google::protobuf::MethodOptions* options) { + delete options_; + options_ = options; + if (options) { + set_has_options(); + } else { + clear_has_options(); + } + // @@protoc_insertion_point(field_set_allocated:google.protobuf.MethodDescriptorProto.options) +} + +// optional bool client_streaming = 5 [default = false]; +inline bool MethodDescriptorProto::has_client_streaming() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void MethodDescriptorProto::set_has_client_streaming() { + _has_bits_[0] |= 0x00000010u; +} +inline void MethodDescriptorProto::clear_has_client_streaming() { + _has_bits_[0] &= ~0x00000010u; +} +inline void MethodDescriptorProto::clear_client_streaming() { + client_streaming_ = false; + clear_has_client_streaming(); +} +inline bool MethodDescriptorProto::client_streaming() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.client_streaming) + return client_streaming_; +} +inline void MethodDescriptorProto::set_client_streaming(bool value) { + set_has_client_streaming(); + client_streaming_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.client_streaming) +} + +// optional bool server_streaming = 6 [default = false]; +inline bool MethodDescriptorProto::has_server_streaming() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void MethodDescriptorProto::set_has_server_streaming() { + _has_bits_[0] |= 0x00000020u; +} +inline void MethodDescriptorProto::clear_has_server_streaming() { + _has_bits_[0] &= ~0x00000020u; +} +inline void MethodDescriptorProto::clear_server_streaming() { + server_streaming_ = false; + clear_has_server_streaming(); +} +inline bool MethodDescriptorProto::server_streaming() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodDescriptorProto.server_streaming) + return server_streaming_; +} +inline void MethodDescriptorProto::set_server_streaming(bool value) { + set_has_server_streaming(); + server_streaming_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MethodDescriptorProto.server_streaming) +} + +// ------------------------------------------------------------------- + +// FileOptions + +// optional string java_package = 1; +inline bool FileOptions::has_java_package() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FileOptions::set_has_java_package() { + _has_bits_[0] |= 0x00000001u; +} +inline void FileOptions::clear_has_java_package() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FileOptions::clear_java_package() { + java_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_java_package(); +} +inline const ::std::string& FileOptions::java_package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_package) + return java_package_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_java_package(const ::std::string& value) { + set_has_java_package(); + java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_package) +} +inline void FileOptions::set_java_package(const char* value) { + set_has_java_package(); + java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_package) +} +inline void FileOptions::set_java_package(const char* value, size_t size) { + set_has_java_package(); + java_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_package) +} +inline ::std::string* FileOptions::mutable_java_package() { + set_has_java_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_package) + return java_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileOptions::release_java_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_package) + clear_has_java_package(); + return java_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_allocated_java_package(::std::string* java_package) { + if (java_package != NULL) { + set_has_java_package(); + } else { + clear_has_java_package(); + } + java_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_package); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_package) +} + +// optional string java_outer_classname = 8; +inline bool FileOptions::has_java_outer_classname() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FileOptions::set_has_java_outer_classname() { + _has_bits_[0] |= 0x00000002u; +} +inline void FileOptions::clear_has_java_outer_classname() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FileOptions::clear_java_outer_classname() { + java_outer_classname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_java_outer_classname(); +} +inline const ::std::string& FileOptions::java_outer_classname() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_outer_classname) + return java_outer_classname_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_java_outer_classname(const ::std::string& value) { + set_has_java_outer_classname(); + java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_outer_classname) +} +inline void FileOptions::set_java_outer_classname(const char* value) { + set_has_java_outer_classname(); + java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.java_outer_classname) +} +inline void FileOptions::set_java_outer_classname(const char* value, size_t size) { + set_has_java_outer_classname(); + java_outer_classname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.java_outer_classname) +} +inline ::std::string* FileOptions::mutable_java_outer_classname() { + set_has_java_outer_classname(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.java_outer_classname) + return java_outer_classname_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileOptions::release_java_outer_classname() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.java_outer_classname) + clear_has_java_outer_classname(); + return java_outer_classname_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_allocated_java_outer_classname(::std::string* java_outer_classname) { + if (java_outer_classname != NULL) { + set_has_java_outer_classname(); + } else { + clear_has_java_outer_classname(); + } + java_outer_classname_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), java_outer_classname); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.java_outer_classname) +} + +// optional bool java_multiple_files = 10 [default = false]; +inline bool FileOptions::has_java_multiple_files() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void FileOptions::set_has_java_multiple_files() { + _has_bits_[0] |= 0x00000004u; +} +inline void FileOptions::clear_has_java_multiple_files() { + _has_bits_[0] &= ~0x00000004u; +} +inline void FileOptions::clear_java_multiple_files() { + java_multiple_files_ = false; + clear_has_java_multiple_files(); +} +inline bool FileOptions::java_multiple_files() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_multiple_files) + return java_multiple_files_; +} +inline void FileOptions::set_java_multiple_files(bool value) { + set_has_java_multiple_files(); + java_multiple_files_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_multiple_files) +} + +// optional bool java_generate_equals_and_hash = 20 [default = false]; +inline bool FileOptions::has_java_generate_equals_and_hash() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void FileOptions::set_has_java_generate_equals_and_hash() { + _has_bits_[0] |= 0x00000008u; +} +inline void FileOptions::clear_has_java_generate_equals_and_hash() { + _has_bits_[0] &= ~0x00000008u; +} +inline void FileOptions::clear_java_generate_equals_and_hash() { + java_generate_equals_and_hash_ = false; + clear_has_java_generate_equals_and_hash(); +} +inline bool FileOptions::java_generate_equals_and_hash() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generate_equals_and_hash) + return java_generate_equals_and_hash_; +} +inline void FileOptions::set_java_generate_equals_and_hash(bool value) { + set_has_java_generate_equals_and_hash(); + java_generate_equals_and_hash_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generate_equals_and_hash) +} + +// optional bool java_string_check_utf8 = 27 [default = false]; +inline bool FileOptions::has_java_string_check_utf8() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void FileOptions::set_has_java_string_check_utf8() { + _has_bits_[0] |= 0x00000010u; +} +inline void FileOptions::clear_has_java_string_check_utf8() { + _has_bits_[0] &= ~0x00000010u; +} +inline void FileOptions::clear_java_string_check_utf8() { + java_string_check_utf8_ = false; + clear_has_java_string_check_utf8(); +} +inline bool FileOptions::java_string_check_utf8() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_string_check_utf8) + return java_string_check_utf8_; +} +inline void FileOptions::set_java_string_check_utf8(bool value) { + set_has_java_string_check_utf8(); + java_string_check_utf8_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_string_check_utf8) +} + +// optional .google.protobuf.FileOptions.OptimizeMode optimize_for = 9 [default = SPEED]; +inline bool FileOptions::has_optimize_for() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void FileOptions::set_has_optimize_for() { + _has_bits_[0] |= 0x00000020u; +} +inline void FileOptions::clear_has_optimize_for() { + _has_bits_[0] &= ~0x00000020u; +} +inline void FileOptions::clear_optimize_for() { + optimize_for_ = 1; + clear_has_optimize_for(); +} +inline ::google::protobuf::FileOptions_OptimizeMode FileOptions::optimize_for() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.optimize_for) + return static_cast< ::google::protobuf::FileOptions_OptimizeMode >(optimize_for_); +} +inline void FileOptions::set_optimize_for(::google::protobuf::FileOptions_OptimizeMode value) { + assert(::google::protobuf::FileOptions_OptimizeMode_IsValid(value)); + set_has_optimize_for(); + optimize_for_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.optimize_for) +} + +// optional string go_package = 11; +inline bool FileOptions::has_go_package() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void FileOptions::set_has_go_package() { + _has_bits_[0] |= 0x00000040u; +} +inline void FileOptions::clear_has_go_package() { + _has_bits_[0] &= ~0x00000040u; +} +inline void FileOptions::clear_go_package() { + go_package_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_go_package(); +} +inline const ::std::string& FileOptions::go_package() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.go_package) + return go_package_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_go_package(const ::std::string& value) { + set_has_go_package(); + go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.go_package) +} +inline void FileOptions::set_go_package(const char* value) { + set_has_go_package(); + go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.go_package) +} +inline void FileOptions::set_go_package(const char* value, size_t size) { + set_has_go_package(); + go_package_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.go_package) +} +inline ::std::string* FileOptions::mutable_go_package() { + set_has_go_package(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.go_package) + return go_package_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileOptions::release_go_package() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.go_package) + clear_has_go_package(); + return go_package_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_allocated_go_package(::std::string* go_package) { + if (go_package != NULL) { + set_has_go_package(); + } else { + clear_has_go_package(); + } + go_package_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), go_package); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.go_package) +} + +// optional bool cc_generic_services = 16 [default = false]; +inline bool FileOptions::has_cc_generic_services() const { + return (_has_bits_[0] & 0x00000080u) != 0; +} +inline void FileOptions::set_has_cc_generic_services() { + _has_bits_[0] |= 0x00000080u; +} +inline void FileOptions::clear_has_cc_generic_services() { + _has_bits_[0] &= ~0x00000080u; +} +inline void FileOptions::clear_cc_generic_services() { + cc_generic_services_ = false; + clear_has_cc_generic_services(); +} +inline bool FileOptions::cc_generic_services() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_generic_services) + return cc_generic_services_; +} +inline void FileOptions::set_cc_generic_services(bool value) { + set_has_cc_generic_services(); + cc_generic_services_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_generic_services) +} + +// optional bool java_generic_services = 17 [default = false]; +inline bool FileOptions::has_java_generic_services() const { + return (_has_bits_[0] & 0x00000100u) != 0; +} +inline void FileOptions::set_has_java_generic_services() { + _has_bits_[0] |= 0x00000100u; +} +inline void FileOptions::clear_has_java_generic_services() { + _has_bits_[0] &= ~0x00000100u; +} +inline void FileOptions::clear_java_generic_services() { + java_generic_services_ = false; + clear_has_java_generic_services(); +} +inline bool FileOptions::java_generic_services() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.java_generic_services) + return java_generic_services_; +} +inline void FileOptions::set_java_generic_services(bool value) { + set_has_java_generic_services(); + java_generic_services_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.java_generic_services) +} + +// optional bool py_generic_services = 18 [default = false]; +inline bool FileOptions::has_py_generic_services() const { + return (_has_bits_[0] & 0x00000200u) != 0; +} +inline void FileOptions::set_has_py_generic_services() { + _has_bits_[0] |= 0x00000200u; +} +inline void FileOptions::clear_has_py_generic_services() { + _has_bits_[0] &= ~0x00000200u; +} +inline void FileOptions::clear_py_generic_services() { + py_generic_services_ = false; + clear_has_py_generic_services(); +} +inline bool FileOptions::py_generic_services() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.py_generic_services) + return py_generic_services_; +} +inline void FileOptions::set_py_generic_services(bool value) { + set_has_py_generic_services(); + py_generic_services_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.py_generic_services) +} + +// optional bool deprecated = 23 [default = false]; +inline bool FileOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000400u) != 0; +} +inline void FileOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000400u; +} +inline void FileOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000400u; +} +inline void FileOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool FileOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.deprecated) + return deprecated_; +} +inline void FileOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.deprecated) +} + +// optional bool cc_enable_arenas = 31 [default = false]; +inline bool FileOptions::has_cc_enable_arenas() const { + return (_has_bits_[0] & 0x00000800u) != 0; +} +inline void FileOptions::set_has_cc_enable_arenas() { + _has_bits_[0] |= 0x00000800u; +} +inline void FileOptions::clear_has_cc_enable_arenas() { + _has_bits_[0] &= ~0x00000800u; +} +inline void FileOptions::clear_cc_enable_arenas() { + cc_enable_arenas_ = false; + clear_has_cc_enable_arenas(); +} +inline bool FileOptions::cc_enable_arenas() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.cc_enable_arenas) + return cc_enable_arenas_; +} +inline void FileOptions::set_cc_enable_arenas(bool value) { + set_has_cc_enable_arenas(); + cc_enable_arenas_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.cc_enable_arenas) +} + +// optional string objc_class_prefix = 36; +inline bool FileOptions::has_objc_class_prefix() const { + return (_has_bits_[0] & 0x00001000u) != 0; +} +inline void FileOptions::set_has_objc_class_prefix() { + _has_bits_[0] |= 0x00001000u; +} +inline void FileOptions::clear_has_objc_class_prefix() { + _has_bits_[0] &= ~0x00001000u; +} +inline void FileOptions::clear_objc_class_prefix() { + objc_class_prefix_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_objc_class_prefix(); +} +inline const ::std::string& FileOptions::objc_class_prefix() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.objc_class_prefix) + return objc_class_prefix_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_objc_class_prefix(const ::std::string& value) { + set_has_objc_class_prefix(); + objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.objc_class_prefix) +} +inline void FileOptions::set_objc_class_prefix(const char* value) { + set_has_objc_class_prefix(); + objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.objc_class_prefix) +} +inline void FileOptions::set_objc_class_prefix(const char* value, size_t size) { + set_has_objc_class_prefix(); + objc_class_prefix_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.objc_class_prefix) +} +inline ::std::string* FileOptions::mutable_objc_class_prefix() { + set_has_objc_class_prefix(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.objc_class_prefix) + return objc_class_prefix_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileOptions::release_objc_class_prefix() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.objc_class_prefix) + clear_has_objc_class_prefix(); + return objc_class_prefix_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_allocated_objc_class_prefix(::std::string* objc_class_prefix) { + if (objc_class_prefix != NULL) { + set_has_objc_class_prefix(); + } else { + clear_has_objc_class_prefix(); + } + objc_class_prefix_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), objc_class_prefix); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.objc_class_prefix) +} + +// optional string csharp_namespace = 37; +inline bool FileOptions::has_csharp_namespace() const { + return (_has_bits_[0] & 0x00002000u) != 0; +} +inline void FileOptions::set_has_csharp_namespace() { + _has_bits_[0] |= 0x00002000u; +} +inline void FileOptions::clear_has_csharp_namespace() { + _has_bits_[0] &= ~0x00002000u; +} +inline void FileOptions::clear_csharp_namespace() { + csharp_namespace_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_csharp_namespace(); +} +inline const ::std::string& FileOptions::csharp_namespace() const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.csharp_namespace) + return csharp_namespace_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_csharp_namespace(const ::std::string& value) { + set_has_csharp_namespace(); + csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.FileOptions.csharp_namespace) +} +inline void FileOptions::set_csharp_namespace(const char* value) { + set_has_csharp_namespace(); + csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.FileOptions.csharp_namespace) +} +inline void FileOptions::set_csharp_namespace(const char* value, size_t size) { + set_has_csharp_namespace(); + csharp_namespace_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.FileOptions.csharp_namespace) +} +inline ::std::string* FileOptions::mutable_csharp_namespace() { + set_has_csharp_namespace(); + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.csharp_namespace) + return csharp_namespace_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* FileOptions::release_csharp_namespace() { + // @@protoc_insertion_point(field_release:google.protobuf.FileOptions.csharp_namespace) + clear_has_csharp_namespace(); + return csharp_namespace_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void FileOptions::set_allocated_csharp_namespace(::std::string* csharp_namespace) { + if (csharp_namespace != NULL) { + set_has_csharp_namespace(); + } else { + clear_has_csharp_namespace(); + } + csharp_namespace_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), csharp_namespace); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.FileOptions.csharp_namespace) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int FileOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void FileOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& FileOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* FileOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* FileOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +FileOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FileOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +FileOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.FileOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// MessageOptions + +// optional bool message_set_wire_format = 1 [default = false]; +inline bool MessageOptions::has_message_set_wire_format() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MessageOptions::set_has_message_set_wire_format() { + _has_bits_[0] |= 0x00000001u; +} +inline void MessageOptions::clear_has_message_set_wire_format() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MessageOptions::clear_message_set_wire_format() { + message_set_wire_format_ = false; + clear_has_message_set_wire_format(); +} +inline bool MessageOptions::message_set_wire_format() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.message_set_wire_format) + return message_set_wire_format_; +} +inline void MessageOptions::set_message_set_wire_format(bool value) { + set_has_message_set_wire_format(); + message_set_wire_format_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.message_set_wire_format) +} + +// optional bool no_standard_descriptor_accessor = 2 [default = false]; +inline bool MessageOptions::has_no_standard_descriptor_accessor() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void MessageOptions::set_has_no_standard_descriptor_accessor() { + _has_bits_[0] |= 0x00000002u; +} +inline void MessageOptions::clear_has_no_standard_descriptor_accessor() { + _has_bits_[0] &= ~0x00000002u; +} +inline void MessageOptions::clear_no_standard_descriptor_accessor() { + no_standard_descriptor_accessor_ = false; + clear_has_no_standard_descriptor_accessor(); +} +inline bool MessageOptions::no_standard_descriptor_accessor() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.no_standard_descriptor_accessor) + return no_standard_descriptor_accessor_; +} +inline void MessageOptions::set_no_standard_descriptor_accessor(bool value) { + set_has_no_standard_descriptor_accessor(); + no_standard_descriptor_accessor_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.no_standard_descriptor_accessor) +} + +// optional bool deprecated = 3 [default = false]; +inline bool MessageOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void MessageOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000004u; +} +inline void MessageOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000004u; +} +inline void MessageOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool MessageOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.deprecated) + return deprecated_; +} +inline void MessageOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.deprecated) +} + +// optional bool map_entry = 7; +inline bool MessageOptions::has_map_entry() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void MessageOptions::set_has_map_entry() { + _has_bits_[0] |= 0x00000008u; +} +inline void MessageOptions::clear_has_map_entry() { + _has_bits_[0] &= ~0x00000008u; +} +inline void MessageOptions::clear_map_entry() { + map_entry_ = false; + clear_has_map_entry(); +} +inline bool MessageOptions::map_entry() const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.map_entry) + return map_entry_; +} +inline void MessageOptions::set_map_entry(bool value) { + set_has_map_entry(); + map_entry_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MessageOptions.map_entry) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int MessageOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void MessageOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& MessageOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* MessageOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* MessageOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +MessageOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.MessageOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +MessageOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.MessageOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// FieldOptions + +// optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING]; +inline bool FieldOptions::has_ctype() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FieldOptions::set_has_ctype() { + _has_bits_[0] |= 0x00000001u; +} +inline void FieldOptions::clear_has_ctype() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FieldOptions::clear_ctype() { + ctype_ = 0; + clear_has_ctype(); +} +inline ::google::protobuf::FieldOptions_CType FieldOptions::ctype() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.ctype) + return static_cast< ::google::protobuf::FieldOptions_CType >(ctype_); +} +inline void FieldOptions::set_ctype(::google::protobuf::FieldOptions_CType value) { + assert(::google::protobuf::FieldOptions_CType_IsValid(value)); + set_has_ctype(); + ctype_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.ctype) +} + +// optional bool packed = 2; +inline bool FieldOptions::has_packed() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FieldOptions::set_has_packed() { + _has_bits_[0] |= 0x00000002u; +} +inline void FieldOptions::clear_has_packed() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FieldOptions::clear_packed() { + packed_ = false; + clear_has_packed(); +} +inline bool FieldOptions::packed() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.packed) + return packed_; +} +inline void FieldOptions::set_packed(bool value) { + set_has_packed(); + packed_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.packed) +} + +// optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL]; +inline bool FieldOptions::has_jstype() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void FieldOptions::set_has_jstype() { + _has_bits_[0] |= 0x00000004u; +} +inline void FieldOptions::clear_has_jstype() { + _has_bits_[0] &= ~0x00000004u; +} +inline void FieldOptions::clear_jstype() { + jstype_ = 0; + clear_has_jstype(); +} +inline ::google::protobuf::FieldOptions_JSType FieldOptions::jstype() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.jstype) + return static_cast< ::google::protobuf::FieldOptions_JSType >(jstype_); +} +inline void FieldOptions::set_jstype(::google::protobuf::FieldOptions_JSType value) { + assert(::google::protobuf::FieldOptions_JSType_IsValid(value)); + set_has_jstype(); + jstype_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.jstype) +} + +// optional bool lazy = 5 [default = false]; +inline bool FieldOptions::has_lazy() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void FieldOptions::set_has_lazy() { + _has_bits_[0] |= 0x00000008u; +} +inline void FieldOptions::clear_has_lazy() { + _has_bits_[0] &= ~0x00000008u; +} +inline void FieldOptions::clear_lazy() { + lazy_ = false; + clear_has_lazy(); +} +inline bool FieldOptions::lazy() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.lazy) + return lazy_; +} +inline void FieldOptions::set_lazy(bool value) { + set_has_lazy(); + lazy_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.lazy) +} + +// optional bool deprecated = 3 [default = false]; +inline bool FieldOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void FieldOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000010u; +} +inline void FieldOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000010u; +} +inline void FieldOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool FieldOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.deprecated) + return deprecated_; +} +inline void FieldOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.deprecated) +} + +// optional bool weak = 10 [default = false]; +inline bool FieldOptions::has_weak() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void FieldOptions::set_has_weak() { + _has_bits_[0] |= 0x00000020u; +} +inline void FieldOptions::clear_has_weak() { + _has_bits_[0] &= ~0x00000020u; +} +inline void FieldOptions::clear_weak() { + weak_ = false; + clear_has_weak(); +} +inline bool FieldOptions::weak() const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.weak) + return weak_; +} +inline void FieldOptions::set_weak(bool value) { + set_has_weak(); + weak_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.FieldOptions.weak) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int FieldOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void FieldOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& FieldOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* FieldOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* FieldOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +FieldOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.FieldOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +FieldOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.FieldOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// EnumOptions + +// optional bool allow_alias = 2; +inline bool EnumOptions::has_allow_alias() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EnumOptions::set_has_allow_alias() { + _has_bits_[0] |= 0x00000001u; +} +inline void EnumOptions::clear_has_allow_alias() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EnumOptions::clear_allow_alias() { + allow_alias_ = false; + clear_has_allow_alias(); +} +inline bool EnumOptions::allow_alias() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.allow_alias) + return allow_alias_; +} +inline void EnumOptions::set_allow_alias(bool value) { + set_has_allow_alias(); + allow_alias_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.allow_alias) +} + +// optional bool deprecated = 3 [default = false]; +inline bool EnumOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void EnumOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000002u; +} +inline void EnumOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000002u; +} +inline void EnumOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool EnumOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.deprecated) + return deprecated_; +} +inline void EnumOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int EnumOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void EnumOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& EnumOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* EnumOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* EnumOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +EnumOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +EnumOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// EnumValueOptions + +// optional bool deprecated = 1 [default = false]; +inline bool EnumValueOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void EnumValueOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000001u; +} +inline void EnumValueOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000001u; +} +inline void EnumValueOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool EnumValueOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.deprecated) + return deprecated_; +} +inline void EnumValueOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.EnumValueOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int EnumValueOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void EnumValueOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& EnumValueOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* EnumValueOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* EnumValueOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +EnumValueOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.EnumValueOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +EnumValueOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.EnumValueOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// ServiceOptions + +// optional bool deprecated = 33 [default = false]; +inline bool ServiceOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ServiceOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000001u; +} +inline void ServiceOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ServiceOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool ServiceOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.deprecated) + return deprecated_; +} +inline void ServiceOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.ServiceOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int ServiceOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void ServiceOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& ServiceOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* ServiceOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* ServiceOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +ServiceOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.ServiceOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +ServiceOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.ServiceOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// MethodOptions + +// optional bool deprecated = 33 [default = false]; +inline bool MethodOptions::has_deprecated() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void MethodOptions::set_has_deprecated() { + _has_bits_[0] |= 0x00000001u; +} +inline void MethodOptions::clear_has_deprecated() { + _has_bits_[0] &= ~0x00000001u; +} +inline void MethodOptions::clear_deprecated() { + deprecated_ = false; + clear_has_deprecated(); +} +inline bool MethodOptions::deprecated() const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.deprecated) + return deprecated_; +} +inline void MethodOptions::set_deprecated(bool value) { + set_has_deprecated(); + deprecated_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.MethodOptions.deprecated) +} + +// repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999; +inline int MethodOptions::uninterpreted_option_size() const { + return uninterpreted_option_.size(); +} +inline void MethodOptions::clear_uninterpreted_option() { + uninterpreted_option_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption& MethodOptions::uninterpreted_option(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_.Get(index); +} +inline ::google::protobuf::UninterpretedOption* MethodOptions::mutable_uninterpreted_option(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption* MethodOptions::add_uninterpreted_option() { + // @@protoc_insertion_point(field_add:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >* +MethodOptions::mutable_uninterpreted_option() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.MethodOptions.uninterpreted_option) + return &uninterpreted_option_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption >& +MethodOptions::uninterpreted_option() const { + // @@protoc_insertion_point(field_list:google.protobuf.MethodOptions.uninterpreted_option) + return uninterpreted_option_; +} + +// ------------------------------------------------------------------- + +// UninterpretedOption_NamePart + +// required string name_part = 1; +inline bool UninterpretedOption_NamePart::has_name_part() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void UninterpretedOption_NamePart::set_has_name_part() { + _has_bits_[0] |= 0x00000001u; +} +inline void UninterpretedOption_NamePart::clear_has_name_part() { + _has_bits_[0] &= ~0x00000001u; +} +inline void UninterpretedOption_NamePart::clear_name_part() { + name_part_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_name_part(); +} +inline const ::std::string& UninterpretedOption_NamePart::name_part() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.name_part) + return name_part_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption_NamePart::set_name_part(const ::std::string& value) { + set_has_name_part(); + name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.name_part) +} +inline void UninterpretedOption_NamePart::set_name_part(const char* value) { + set_has_name_part(); + name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.NamePart.name_part) +} +inline void UninterpretedOption_NamePart::set_name_part(const char* value, size_t size) { + set_has_name_part(); + name_part_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.NamePart.name_part) +} +inline ::std::string* UninterpretedOption_NamePart::mutable_name_part() { + set_has_name_part(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.NamePart.name_part) + return name_part_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* UninterpretedOption_NamePart::release_name_part() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.NamePart.name_part) + clear_has_name_part(); + return name_part_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption_NamePart::set_allocated_name_part(::std::string* name_part) { + if (name_part != NULL) { + set_has_name_part(); + } else { + clear_has_name_part(); + } + name_part_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name_part); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.NamePart.name_part) +} + +// required bool is_extension = 2; +inline bool UninterpretedOption_NamePart::has_is_extension() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void UninterpretedOption_NamePart::set_has_is_extension() { + _has_bits_[0] |= 0x00000002u; +} +inline void UninterpretedOption_NamePart::clear_has_is_extension() { + _has_bits_[0] &= ~0x00000002u; +} +inline void UninterpretedOption_NamePart::clear_is_extension() { + is_extension_ = false; + clear_has_is_extension(); +} +inline bool UninterpretedOption_NamePart::is_extension() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.NamePart.is_extension) + return is_extension_; +} +inline void UninterpretedOption_NamePart::set_is_extension(bool value) { + set_has_is_extension(); + is_extension_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.NamePart.is_extension) +} + +// ------------------------------------------------------------------- + +// UninterpretedOption + +// repeated .google.protobuf.UninterpretedOption.NamePart name = 2; +inline int UninterpretedOption::name_size() const { + return name_.size(); +} +inline void UninterpretedOption::clear_name() { + name_.Clear(); +} +inline const ::google::protobuf::UninterpretedOption_NamePart& UninterpretedOption::name(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.name) + return name_.Get(index); +} +inline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::mutable_name(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.name) + return name_.Mutable(index); +} +inline ::google::protobuf::UninterpretedOption_NamePart* UninterpretedOption::add_name() { + // @@protoc_insertion_point(field_add:google.protobuf.UninterpretedOption.name) + return name_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >* +UninterpretedOption::mutable_name() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.UninterpretedOption.name) + return &name_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::UninterpretedOption_NamePart >& +UninterpretedOption::name() const { + // @@protoc_insertion_point(field_list:google.protobuf.UninterpretedOption.name) + return name_; +} + +// optional string identifier_value = 3; +inline bool UninterpretedOption::has_identifier_value() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void UninterpretedOption::set_has_identifier_value() { + _has_bits_[0] |= 0x00000002u; +} +inline void UninterpretedOption::clear_has_identifier_value() { + _has_bits_[0] &= ~0x00000002u; +} +inline void UninterpretedOption::clear_identifier_value() { + identifier_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_identifier_value(); +} +inline const ::std::string& UninterpretedOption::identifier_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.identifier_value) + return identifier_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption::set_identifier_value(const ::std::string& value) { + set_has_identifier_value(); + identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.identifier_value) +} +inline void UninterpretedOption::set_identifier_value(const char* value) { + set_has_identifier_value(); + identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.identifier_value) +} +inline void UninterpretedOption::set_identifier_value(const char* value, size_t size) { + set_has_identifier_value(); + identifier_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.identifier_value) +} +inline ::std::string* UninterpretedOption::mutable_identifier_value() { + set_has_identifier_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.identifier_value) + return identifier_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* UninterpretedOption::release_identifier_value() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.identifier_value) + clear_has_identifier_value(); + return identifier_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption::set_allocated_identifier_value(::std::string* identifier_value) { + if (identifier_value != NULL) { + set_has_identifier_value(); + } else { + clear_has_identifier_value(); + } + identifier_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), identifier_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.identifier_value) +} + +// optional uint64 positive_int_value = 4; +inline bool UninterpretedOption::has_positive_int_value() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void UninterpretedOption::set_has_positive_int_value() { + _has_bits_[0] |= 0x00000004u; +} +inline void UninterpretedOption::clear_has_positive_int_value() { + _has_bits_[0] &= ~0x00000004u; +} +inline void UninterpretedOption::clear_positive_int_value() { + positive_int_value_ = GOOGLE_ULONGLONG(0); + clear_has_positive_int_value(); +} +inline ::google::protobuf::uint64 UninterpretedOption::positive_int_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.positive_int_value) + return positive_int_value_; +} +inline void UninterpretedOption::set_positive_int_value(::google::protobuf::uint64 value) { + set_has_positive_int_value(); + positive_int_value_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.positive_int_value) +} + +// optional int64 negative_int_value = 5; +inline bool UninterpretedOption::has_negative_int_value() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void UninterpretedOption::set_has_negative_int_value() { + _has_bits_[0] |= 0x00000008u; +} +inline void UninterpretedOption::clear_has_negative_int_value() { + _has_bits_[0] &= ~0x00000008u; +} +inline void UninterpretedOption::clear_negative_int_value() { + negative_int_value_ = GOOGLE_LONGLONG(0); + clear_has_negative_int_value(); +} +inline ::google::protobuf::int64 UninterpretedOption::negative_int_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.negative_int_value) + return negative_int_value_; +} +inline void UninterpretedOption::set_negative_int_value(::google::protobuf::int64 value) { + set_has_negative_int_value(); + negative_int_value_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.negative_int_value) +} + +// optional double double_value = 6; +inline bool UninterpretedOption::has_double_value() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void UninterpretedOption::set_has_double_value() { + _has_bits_[0] |= 0x00000010u; +} +inline void UninterpretedOption::clear_has_double_value() { + _has_bits_[0] &= ~0x00000010u; +} +inline void UninterpretedOption::clear_double_value() { + double_value_ = 0; + clear_has_double_value(); +} +inline double UninterpretedOption::double_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.double_value) + return double_value_; +} +inline void UninterpretedOption::set_double_value(double value) { + set_has_double_value(); + double_value_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.double_value) +} + +// optional bytes string_value = 7; +inline bool UninterpretedOption::has_string_value() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void UninterpretedOption::set_has_string_value() { + _has_bits_[0] |= 0x00000020u; +} +inline void UninterpretedOption::clear_has_string_value() { + _has_bits_[0] &= ~0x00000020u; +} +inline void UninterpretedOption::clear_string_value() { + string_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_string_value(); +} +inline const ::std::string& UninterpretedOption::string_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.string_value) + return string_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption::set_string_value(const ::std::string& value) { + set_has_string_value(); + string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.string_value) +} +inline void UninterpretedOption::set_string_value(const char* value) { + set_has_string_value(); + string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.string_value) +} +inline void UninterpretedOption::set_string_value(const void* value, size_t size) { + set_has_string_value(); + string_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.string_value) +} +inline ::std::string* UninterpretedOption::mutable_string_value() { + set_has_string_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.string_value) + return string_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* UninterpretedOption::release_string_value() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.string_value) + clear_has_string_value(); + return string_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption::set_allocated_string_value(::std::string* string_value) { + if (string_value != NULL) { + set_has_string_value(); + } else { + clear_has_string_value(); + } + string_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), string_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.string_value) +} + +// optional string aggregate_value = 8; +inline bool UninterpretedOption::has_aggregate_value() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void UninterpretedOption::set_has_aggregate_value() { + _has_bits_[0] |= 0x00000040u; +} +inline void UninterpretedOption::clear_has_aggregate_value() { + _has_bits_[0] &= ~0x00000040u; +} +inline void UninterpretedOption::clear_aggregate_value() { + aggregate_value_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_aggregate_value(); +} +inline const ::std::string& UninterpretedOption::aggregate_value() const { + // @@protoc_insertion_point(field_get:google.protobuf.UninterpretedOption.aggregate_value) + return aggregate_value_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption::set_aggregate_value(const ::std::string& value) { + set_has_aggregate_value(); + aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.UninterpretedOption.aggregate_value) +} +inline void UninterpretedOption::set_aggregate_value(const char* value) { + set_has_aggregate_value(); + aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.UninterpretedOption.aggregate_value) +} +inline void UninterpretedOption::set_aggregate_value(const char* value, size_t size) { + set_has_aggregate_value(); + aggregate_value_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.UninterpretedOption.aggregate_value) +} +inline ::std::string* UninterpretedOption::mutable_aggregate_value() { + set_has_aggregate_value(); + // @@protoc_insertion_point(field_mutable:google.protobuf.UninterpretedOption.aggregate_value) + return aggregate_value_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* UninterpretedOption::release_aggregate_value() { + // @@protoc_insertion_point(field_release:google.protobuf.UninterpretedOption.aggregate_value) + clear_has_aggregate_value(); + return aggregate_value_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void UninterpretedOption::set_allocated_aggregate_value(::std::string* aggregate_value) { + if (aggregate_value != NULL) { + set_has_aggregate_value(); + } else { + clear_has_aggregate_value(); + } + aggregate_value_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aggregate_value); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.UninterpretedOption.aggregate_value) +} + +// ------------------------------------------------------------------- + +// SourceCodeInfo_Location + +// repeated int32 path = 1 [packed = true]; +inline int SourceCodeInfo_Location::path_size() const { + return path_.size(); +} +inline void SourceCodeInfo_Location::clear_path() { + path_.Clear(); +} +inline ::google::protobuf::int32 SourceCodeInfo_Location::path(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.path) + return path_.Get(index); +} +inline void SourceCodeInfo_Location::set_path(int index, ::google::protobuf::int32 value) { + path_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.path) +} +inline void SourceCodeInfo_Location::add_path(::google::protobuf::int32 value) { + path_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.path) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SourceCodeInfo_Location::path() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.path) + return path_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SourceCodeInfo_Location::mutable_path() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.path) + return &path_; +} + +// repeated int32 span = 2 [packed = true]; +inline int SourceCodeInfo_Location::span_size() const { + return span_.size(); +} +inline void SourceCodeInfo_Location::clear_span() { + span_.Clear(); +} +inline ::google::protobuf::int32 SourceCodeInfo_Location::span(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.span) + return span_.Get(index); +} +inline void SourceCodeInfo_Location::set_span(int index, ::google::protobuf::int32 value) { + span_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.span) +} +inline void SourceCodeInfo_Location::add_span(::google::protobuf::int32 value) { + span_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.span) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +SourceCodeInfo_Location::span() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.span) + return span_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +SourceCodeInfo_Location::mutable_span() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.span) + return &span_; +} + +// optional string leading_comments = 3; +inline bool SourceCodeInfo_Location::has_leading_comments() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void SourceCodeInfo_Location::set_has_leading_comments() { + _has_bits_[0] |= 0x00000004u; +} +inline void SourceCodeInfo_Location::clear_has_leading_comments() { + _has_bits_[0] &= ~0x00000004u; +} +inline void SourceCodeInfo_Location::clear_leading_comments() { + leading_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_leading_comments(); +} +inline const ::std::string& SourceCodeInfo_Location::leading_comments() const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_comments) + return leading_comments_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SourceCodeInfo_Location::set_leading_comments(const ::std::string& value) { + set_has_leading_comments(); + leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_comments) +} +inline void SourceCodeInfo_Location::set_leading_comments(const char* value) { + set_has_leading_comments(); + leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_comments) +} +inline void SourceCodeInfo_Location::set_leading_comments(const char* value, size_t size) { + set_has_leading_comments(); + leading_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_comments) +} +inline ::std::string* SourceCodeInfo_Location::mutable_leading_comments() { + set_has_leading_comments(); + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_comments) + return leading_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SourceCodeInfo_Location::release_leading_comments() { + // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.leading_comments) + clear_has_leading_comments(); + return leading_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SourceCodeInfo_Location::set_allocated_leading_comments(::std::string* leading_comments) { + if (leading_comments != NULL) { + set_has_leading_comments(); + } else { + clear_has_leading_comments(); + } + leading_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), leading_comments); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.leading_comments) +} + +// optional string trailing_comments = 4; +inline bool SourceCodeInfo_Location::has_trailing_comments() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void SourceCodeInfo_Location::set_has_trailing_comments() { + _has_bits_[0] |= 0x00000008u; +} +inline void SourceCodeInfo_Location::clear_has_trailing_comments() { + _has_bits_[0] &= ~0x00000008u; +} +inline void SourceCodeInfo_Location::clear_trailing_comments() { + trailing_comments_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_trailing_comments(); +} +inline const ::std::string& SourceCodeInfo_Location::trailing_comments() const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.trailing_comments) + return trailing_comments_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SourceCodeInfo_Location::set_trailing_comments(const ::std::string& value) { + set_has_trailing_comments(); + trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} +inline void SourceCodeInfo_Location::set_trailing_comments(const char* value) { + set_has_trailing_comments(); + trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} +inline void SourceCodeInfo_Location::set_trailing_comments(const char* value, size_t size) { + set_has_trailing_comments(); + trailing_comments_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} +inline ::std::string* SourceCodeInfo_Location::mutable_trailing_comments() { + set_has_trailing_comments(); + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.trailing_comments) + return trailing_comments_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* SourceCodeInfo_Location::release_trailing_comments() { + // @@protoc_insertion_point(field_release:google.protobuf.SourceCodeInfo.Location.trailing_comments) + clear_has_trailing_comments(); + return trailing_comments_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void SourceCodeInfo_Location::set_allocated_trailing_comments(::std::string* trailing_comments) { + if (trailing_comments != NULL) { + set_has_trailing_comments(); + } else { + clear_has_trailing_comments(); + } + trailing_comments_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), trailing_comments); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.SourceCodeInfo.Location.trailing_comments) +} + +// repeated string leading_detached_comments = 6; +inline int SourceCodeInfo_Location::leading_detached_comments_size() const { + return leading_detached_comments_.size(); +} +inline void SourceCodeInfo_Location::clear_leading_detached_comments() { + leading_detached_comments_.Clear(); +} +inline const ::std::string& SourceCodeInfo_Location::leading_detached_comments(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_.Get(index); +} +inline ::std::string* SourceCodeInfo_Location::mutable_leading_detached_comments(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_.Mutable(index); +} +inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const ::std::string& value) { + // @@protoc_insertion_point(field_set:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + leading_detached_comments_.Mutable(index)->assign(value); +} +inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value) { + leading_detached_comments_.Mutable(index)->assign(value); + // @@protoc_insertion_point(field_set_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +inline void SourceCodeInfo_Location::set_leading_detached_comments(int index, const char* value, size_t size) { + leading_detached_comments_.Mutable(index)->assign( + reinterpret_cast(value), size); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +inline ::std::string* SourceCodeInfo_Location::add_leading_detached_comments() { + // @@protoc_insertion_point(field_add_mutable:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_.Add(); +} +inline void SourceCodeInfo_Location::add_leading_detached_comments(const ::std::string& value) { + leading_detached_comments_.Add()->assign(value); + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value) { + leading_detached_comments_.Add()->assign(value); + // @@protoc_insertion_point(field_add_char:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +inline void SourceCodeInfo_Location::add_leading_detached_comments(const char* value, size_t size) { + leading_detached_comments_.Add()->assign(reinterpret_cast(value), size); + // @@protoc_insertion_point(field_add_pointer:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) +} +inline const ::google::protobuf::RepeatedPtrField< ::std::string>& +SourceCodeInfo_Location::leading_detached_comments() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return leading_detached_comments_; +} +inline ::google::protobuf::RepeatedPtrField< ::std::string>* +SourceCodeInfo_Location::mutable_leading_detached_comments() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.Location.leading_detached_comments) + return &leading_detached_comments_; +} + +// ------------------------------------------------------------------- + +// SourceCodeInfo + +// repeated .google.protobuf.SourceCodeInfo.Location location = 1; +inline int SourceCodeInfo::location_size() const { + return location_.size(); +} +inline void SourceCodeInfo::clear_location() { + location_.Clear(); +} +inline const ::google::protobuf::SourceCodeInfo_Location& SourceCodeInfo::location(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.SourceCodeInfo.location) + return location_.Get(index); +} +inline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::mutable_location(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.SourceCodeInfo.location) + return location_.Mutable(index); +} +inline ::google::protobuf::SourceCodeInfo_Location* SourceCodeInfo::add_location() { + // @@protoc_insertion_point(field_add:google.protobuf.SourceCodeInfo.location) + return location_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >* +SourceCodeInfo::mutable_location() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.SourceCodeInfo.location) + return &location_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::SourceCodeInfo_Location >& +SourceCodeInfo::location() const { + // @@protoc_insertion_point(field_list:google.protobuf.SourceCodeInfo.location) + return location_; +} + +// ------------------------------------------------------------------- + +// GeneratedCodeInfo_Annotation + +// repeated int32 path = 1 [packed = true]; +inline int GeneratedCodeInfo_Annotation::path_size() const { + return path_.size(); +} +inline void GeneratedCodeInfo_Annotation::clear_path() { + path_.Clear(); +} +inline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::path(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.path) + return path_.Get(index); +} +inline void GeneratedCodeInfo_Annotation::set_path(int index, ::google::protobuf::int32 value) { + path_.Set(index, value); + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.path) +} +inline void GeneratedCodeInfo_Annotation::add_path(::google::protobuf::int32 value) { + path_.Add(value); + // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.Annotation.path) +} +inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >& +GeneratedCodeInfo_Annotation::path() const { + // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.Annotation.path) + return path_; +} +inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >* +GeneratedCodeInfo_Annotation::mutable_path() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.Annotation.path) + return &path_; +} + +// optional string source_file = 2; +inline bool GeneratedCodeInfo_Annotation::has_source_file() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void GeneratedCodeInfo_Annotation::set_has_source_file() { + _has_bits_[0] |= 0x00000002u; +} +inline void GeneratedCodeInfo_Annotation::clear_has_source_file() { + _has_bits_[0] &= ~0x00000002u; +} +inline void GeneratedCodeInfo_Annotation::clear_source_file() { + source_file_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); + clear_has_source_file(); +} +inline const ::std::string& GeneratedCodeInfo_Annotation::source_file() const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + return source_file_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void GeneratedCodeInfo_Annotation::set_source_file(const ::std::string& value) { + set_has_source_file(); + source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value); + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} +inline void GeneratedCodeInfo_Annotation::set_source_file(const char* value) { + set_has_source_file(); + source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); + // @@protoc_insertion_point(field_set_char:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} +inline void GeneratedCodeInfo_Annotation::set_source_file(const char* value, size_t size) { + set_has_source_file(); + source_file_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), + ::std::string(reinterpret_cast(value), size)); + // @@protoc_insertion_point(field_set_pointer:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} +inline ::std::string* GeneratedCodeInfo_Annotation::mutable_source_file() { + set_has_source_file(); + // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + return source_file_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline ::std::string* GeneratedCodeInfo_Annotation::release_source_file() { + // @@protoc_insertion_point(field_release:google.protobuf.GeneratedCodeInfo.Annotation.source_file) + clear_has_source_file(); + return source_file_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited()); +} +inline void GeneratedCodeInfo_Annotation::set_allocated_source_file(::std::string* source_file) { + if (source_file != NULL) { + set_has_source_file(); + } else { + clear_has_source_file(); + } + source_file_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), source_file); + // @@protoc_insertion_point(field_set_allocated:google.protobuf.GeneratedCodeInfo.Annotation.source_file) +} + +// optional int32 begin = 3; +inline bool GeneratedCodeInfo_Annotation::has_begin() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void GeneratedCodeInfo_Annotation::set_has_begin() { + _has_bits_[0] |= 0x00000004u; +} +inline void GeneratedCodeInfo_Annotation::clear_has_begin() { + _has_bits_[0] &= ~0x00000004u; +} +inline void GeneratedCodeInfo_Annotation::clear_begin() { + begin_ = 0; + clear_has_begin(); +} +inline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::begin() const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.begin) + return begin_; +} +inline void GeneratedCodeInfo_Annotation::set_begin(::google::protobuf::int32 value) { + set_has_begin(); + begin_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.begin) +} + +// optional int32 end = 4; +inline bool GeneratedCodeInfo_Annotation::has_end() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void GeneratedCodeInfo_Annotation::set_has_end() { + _has_bits_[0] |= 0x00000008u; +} +inline void GeneratedCodeInfo_Annotation::clear_has_end() { + _has_bits_[0] &= ~0x00000008u; +} +inline void GeneratedCodeInfo_Annotation::clear_end() { + end_ = 0; + clear_has_end(); +} +inline ::google::protobuf::int32 GeneratedCodeInfo_Annotation::end() const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.Annotation.end) + return end_; +} +inline void GeneratedCodeInfo_Annotation::set_end(::google::protobuf::int32 value) { + set_has_end(); + end_ = value; + // @@protoc_insertion_point(field_set:google.protobuf.GeneratedCodeInfo.Annotation.end) +} + +// ------------------------------------------------------------------- + +// GeneratedCodeInfo + +// repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; +inline int GeneratedCodeInfo::annotation_size() const { + return annotation_.size(); +} +inline void GeneratedCodeInfo::clear_annotation() { + annotation_.Clear(); +} +inline const ::google::protobuf::GeneratedCodeInfo_Annotation& GeneratedCodeInfo::annotation(int index) const { + // @@protoc_insertion_point(field_get:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_.Get(index); +} +inline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::mutable_annotation(int index) { + // @@protoc_insertion_point(field_mutable:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_.Mutable(index); +} +inline ::google::protobuf::GeneratedCodeInfo_Annotation* GeneratedCodeInfo::add_annotation() { + // @@protoc_insertion_point(field_add:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_.Add(); +} +inline ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >* +GeneratedCodeInfo::mutable_annotation() { + // @@protoc_insertion_point(field_mutable_list:google.protobuf.GeneratedCodeInfo.annotation) + return &annotation_; +} +inline const ::google::protobuf::RepeatedPtrField< ::google::protobuf::GeneratedCodeInfo_Annotation >& +GeneratedCodeInfo::annotation() const { + // @@protoc_insertion_point(field_list:google.protobuf.GeneratedCodeInfo.annotation) + return annotation_; +} + +#endif // !PROTOBUF_INLINE_NOT_IN_HEADERS +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace protobuf +} // namespace google + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> struct is_proto_enum< ::google::protobuf::FieldDescriptorProto_Type> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldDescriptorProto_Type>() { + return ::google::protobuf::FieldDescriptorProto_Type_descriptor(); +} +template <> struct is_proto_enum< ::google::protobuf::FieldDescriptorProto_Label> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldDescriptorProto_Label>() { + return ::google::protobuf::FieldDescriptorProto_Label_descriptor(); +} +template <> struct is_proto_enum< ::google::protobuf::FileOptions_OptimizeMode> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FileOptions_OptimizeMode>() { + return ::google::protobuf::FileOptions_OptimizeMode_descriptor(); +} +template <> struct is_proto_enum< ::google::protobuf::FieldOptions_CType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldOptions_CType>() { + return ::google::protobuf::FieldOptions_CType_descriptor(); +} +template <> struct is_proto_enum< ::google::protobuf::FieldOptions_JSType> : ::google::protobuf::internal::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::google::protobuf::FieldOptions_JSType>() { + return ::google::protobuf::FieldOptions_JSType_descriptor(); +} + +} // namespace protobuf +} // namespace google +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_google_2fprotobuf_2fdescriptor_2eproto__INCLUDED diff --git a/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor_unittest.cc b/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor_unittest.cc new file mode 100644 index 00000000000..f937b9eac25 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/protobuf-sample/src/descriptor_unittest.cc @@ -0,0 +1,6613 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 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. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// This file makes extensive use of RFC 3092. :) + +#include +#ifndef _SHARED_PTR_H +#include +#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace google { +namespace protobuf { + +// Can't use an anonymous namespace here due to brokenness of Tru64 compiler. +namespace descriptor_unittest { + +// Some helpers to make assembling descriptors faster. +DescriptorProto* AddMessage(FileDescriptorProto* file, const string& name) { + DescriptorProto* result = file->add_message_type(); + result->set_name(name); + return result; +} + +DescriptorProto* AddNestedMessage(DescriptorProto* parent, const string& name) { + DescriptorProto* result = parent->add_nested_type(); + result->set_name(name); + return result; +} + +EnumDescriptorProto* AddEnum(FileDescriptorProto* file, const string& name) { + EnumDescriptorProto* result = file->add_enum_type(); + result->set_name(name); + return result; +} + +EnumDescriptorProto* AddNestedEnum(DescriptorProto* parent, + const string& name) { + EnumDescriptorProto* result = parent->add_enum_type(); + result->set_name(name); + return result; +} + +ServiceDescriptorProto* AddService(FileDescriptorProto* file, + const string& name) { + ServiceDescriptorProto* result = file->add_service(); + result->set_name(name); + return result; +} + +FieldDescriptorProto* AddField(DescriptorProto* parent, + const string& name, int number, + FieldDescriptorProto::Label label, + FieldDescriptorProto::Type type) { + FieldDescriptorProto* result = parent->add_field(); + result->set_name(name); + result->set_number(number); + result->set_label(label); + result->set_type(type); + return result; +} + +FieldDescriptorProto* AddExtension(FileDescriptorProto* file, + const string& extendee, + const string& name, int number, + FieldDescriptorProto::Label label, + FieldDescriptorProto::Type type) { + FieldDescriptorProto* result = file->add_extension(); + result->set_name(name); + result->set_number(number); + result->set_label(label); + result->set_type(type); + result->set_extendee(extendee); + return result; +} + +FieldDescriptorProto* AddNestedExtension(DescriptorProto* parent, + const string& extendee, + const string& name, int number, + FieldDescriptorProto::Label label, + FieldDescriptorProto::Type type) { + FieldDescriptorProto* result = parent->add_extension(); + result->set_name(name); + result->set_number(number); + result->set_label(label); + result->set_type(type); + result->set_extendee(extendee); + return result; +} + +DescriptorProto::ExtensionRange* AddExtensionRange(DescriptorProto* parent, + int start, int end) { + DescriptorProto::ExtensionRange* result = parent->add_extension_range(); + result->set_start(start); + result->set_end(end); + return result; +} + +DescriptorProto::ReservedRange* AddReservedRange(DescriptorProto* parent, + int start, int end) { + DescriptorProto::ReservedRange* result = parent->add_reserved_range(); + result->set_start(start); + result->set_end(end); + return result; +} + +EnumValueDescriptorProto* AddEnumValue(EnumDescriptorProto* enum_proto, + const string& name, int number) { + EnumValueDescriptorProto* result = enum_proto->add_value(); + result->set_name(name); + result->set_number(number); + return result; +} + +MethodDescriptorProto* AddMethod(ServiceDescriptorProto* service, + const string& name, + const string& input_type, + const string& output_type) { + MethodDescriptorProto* result = service->add_method(); + result->set_name(name); + result->set_input_type(input_type); + result->set_output_type(output_type); + return result; +} + +// Empty enums technically aren't allowed. We need to insert a dummy value +// into them. +void AddEmptyEnum(FileDescriptorProto* file, const string& name) { + AddEnumValue(AddEnum(file, name), name + "_DUMMY", 1); +} + +class MockErrorCollector : public DescriptorPool::ErrorCollector { + public: + MockErrorCollector() {} + ~MockErrorCollector() {} + + string text_; + string warning_text_; + + // implements ErrorCollector --------------------------------------- + void AddError(const string& filename, + const string& element_name, const Message* descriptor, + ErrorLocation location, const string& message) { + const char* location_name = NULL; + switch (location) { + case NAME : location_name = "NAME" ; break; + case NUMBER : location_name = "NUMBER" ; break; + case TYPE : location_name = "TYPE" ; break; + case EXTENDEE : location_name = "EXTENDEE" ; break; + case DEFAULT_VALUE: location_name = "DEFAULT_VALUE"; break; + case OPTION_NAME : location_name = "OPTION_NAME" ; break; + case OPTION_VALUE : location_name = "OPTION_VALUE" ; break; + case INPUT_TYPE : location_name = "INPUT_TYPE" ; break; + case OUTPUT_TYPE : location_name = "OUTPUT_TYPE" ; break; + case OTHER : location_name = "OTHER" ; break; + } + + strings::SubstituteAndAppend( + &text_, "$0: $1: $2: $3\n", + filename, element_name, location_name, message); + } + + // implements ErrorCollector --------------------------------------- + void AddWarning(const string& filename, const string& element_name, + const Message* descriptor, ErrorLocation location, + const string& message) { + const char* location_name = NULL; + switch (location) { + case NAME : location_name = "NAME" ; break; + case NUMBER : location_name = "NUMBER" ; break; + case TYPE : location_name = "TYPE" ; break; + case EXTENDEE : location_name = "EXTENDEE" ; break; + case DEFAULT_VALUE: location_name = "DEFAULT_VALUE"; break; + case OPTION_NAME : location_name = "OPTION_NAME" ; break; + case OPTION_VALUE : location_name = "OPTION_VALUE" ; break; + case INPUT_TYPE : location_name = "INPUT_TYPE" ; break; + case OUTPUT_TYPE : location_name = "OUTPUT_TYPE" ; break; + case OTHER : location_name = "OTHER" ; break; + } + + strings::SubstituteAndAppend( + &warning_text_, "$0: $1: $2: $3\n", + filename, element_name, location_name, message); + } +}; + +// =================================================================== + +// Test simple files. +class FileDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // // in "foo.proto" + // message FooMessage { extensions 1; } + // enum FooEnum {FOO_ENUM_VALUE = 1;} + // service FooService {} + // extend FooMessage { optional int32 foo_extension = 1; } + // + // // in "bar.proto" + // package bar_package; + // message BarMessage { extensions 1; } + // enum BarEnum {BAR_ENUM_VALUE = 1;} + // service BarService {} + // extend BarMessage { optional int32 bar_extension = 1; } + // + // Also, we have an empty file "baz.proto". This file's purpose is to + // make sure that even though it has the same package as foo.proto, + // searching it for members of foo.proto won't work. + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + AddExtensionRange(AddMessage(&foo_file, "FooMessage"), 1, 2); + AddEnumValue(AddEnum(&foo_file, "FooEnum"), "FOO_ENUM_VALUE", 1); + AddService(&foo_file, "FooService"); + AddExtension(&foo_file, "FooMessage", "foo_extension", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + + FileDescriptorProto bar_file; + bar_file.set_name("bar.proto"); + bar_file.set_package("bar_package"); + bar_file.add_dependency("foo.proto"); + AddExtensionRange(AddMessage(&bar_file, "BarMessage"), 1, 2); + AddEnumValue(AddEnum(&bar_file, "BarEnum"), "BAR_ENUM_VALUE", 1); + AddService(&bar_file, "BarService"); + AddExtension(&bar_file, "bar_package.BarMessage", "bar_extension", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + + FileDescriptorProto baz_file; + baz_file.set_name("baz.proto"); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + bar_file_ = pool_.BuildFile(bar_file); + ASSERT_TRUE(bar_file_ != NULL); + + baz_file_ = pool_.BuildFile(baz_file); + ASSERT_TRUE(baz_file_ != NULL); + + ASSERT_EQ(1, foo_file_->message_type_count()); + foo_message_ = foo_file_->message_type(0); + ASSERT_EQ(1, foo_file_->enum_type_count()); + foo_enum_ = foo_file_->enum_type(0); + ASSERT_EQ(1, foo_enum_->value_count()); + foo_enum_value_ = foo_enum_->value(0); + ASSERT_EQ(1, foo_file_->service_count()); + foo_service_ = foo_file_->service(0); + ASSERT_EQ(1, foo_file_->extension_count()); + foo_extension_ = foo_file_->extension(0); + + ASSERT_EQ(1, bar_file_->message_type_count()); + bar_message_ = bar_file_->message_type(0); + ASSERT_EQ(1, bar_file_->enum_type_count()); + bar_enum_ = bar_file_->enum_type(0); + ASSERT_EQ(1, bar_enum_->value_count()); + bar_enum_value_ = bar_enum_->value(0); + ASSERT_EQ(1, bar_file_->service_count()); + bar_service_ = bar_file_->service(0); + ASSERT_EQ(1, bar_file_->extension_count()); + bar_extension_ = bar_file_->extension(0); + } + + DescriptorPool pool_; + + const FileDescriptor* foo_file_; + const FileDescriptor* bar_file_; + const FileDescriptor* baz_file_; + + const Descriptor* foo_message_; + const EnumDescriptor* foo_enum_; + const EnumValueDescriptor* foo_enum_value_; + const ServiceDescriptor* foo_service_; + const FieldDescriptor* foo_extension_; + + const Descriptor* bar_message_; + const EnumDescriptor* bar_enum_; + const EnumValueDescriptor* bar_enum_value_; + const ServiceDescriptor* bar_service_; + const FieldDescriptor* bar_extension_; +}; + +TEST_F(FileDescriptorTest, Name) { + EXPECT_EQ("foo.proto", foo_file_->name()); + EXPECT_EQ("bar.proto", bar_file_->name()); + EXPECT_EQ("baz.proto", baz_file_->name()); +} + +TEST_F(FileDescriptorTest, Package) { + EXPECT_EQ("", foo_file_->package()); + EXPECT_EQ("bar_package", bar_file_->package()); +} + +TEST_F(FileDescriptorTest, Dependencies) { + EXPECT_EQ(0, foo_file_->dependency_count()); + EXPECT_EQ(1, bar_file_->dependency_count()); + EXPECT_EQ(foo_file_, bar_file_->dependency(0)); +} + +TEST_F(FileDescriptorTest, FindMessageTypeByName) { + EXPECT_EQ(foo_message_, foo_file_->FindMessageTypeByName("FooMessage")); + EXPECT_EQ(bar_message_, bar_file_->FindMessageTypeByName("BarMessage")); + + EXPECT_TRUE(foo_file_->FindMessageTypeByName("BarMessage") == NULL); + EXPECT_TRUE(bar_file_->FindMessageTypeByName("FooMessage") == NULL); + EXPECT_TRUE(baz_file_->FindMessageTypeByName("FooMessage") == NULL); + + EXPECT_TRUE(foo_file_->FindMessageTypeByName("NoSuchMessage") == NULL); + EXPECT_TRUE(foo_file_->FindMessageTypeByName("FooEnum") == NULL); +} + +TEST_F(FileDescriptorTest, FindEnumTypeByName) { + EXPECT_EQ(foo_enum_, foo_file_->FindEnumTypeByName("FooEnum")); + EXPECT_EQ(bar_enum_, bar_file_->FindEnumTypeByName("BarEnum")); + + EXPECT_TRUE(foo_file_->FindEnumTypeByName("BarEnum") == NULL); + EXPECT_TRUE(bar_file_->FindEnumTypeByName("FooEnum") == NULL); + EXPECT_TRUE(baz_file_->FindEnumTypeByName("FooEnum") == NULL); + + EXPECT_TRUE(foo_file_->FindEnumTypeByName("NoSuchEnum") == NULL); + EXPECT_TRUE(foo_file_->FindEnumTypeByName("FooMessage") == NULL); +} + +TEST_F(FileDescriptorTest, FindEnumValueByName) { + EXPECT_EQ(foo_enum_value_, foo_file_->FindEnumValueByName("FOO_ENUM_VALUE")); + EXPECT_EQ(bar_enum_value_, bar_file_->FindEnumValueByName("BAR_ENUM_VALUE")); + + EXPECT_TRUE(foo_file_->FindEnumValueByName("BAR_ENUM_VALUE") == NULL); + EXPECT_TRUE(bar_file_->FindEnumValueByName("FOO_ENUM_VALUE") == NULL); + EXPECT_TRUE(baz_file_->FindEnumValueByName("FOO_ENUM_VALUE") == NULL); + + EXPECT_TRUE(foo_file_->FindEnumValueByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(foo_file_->FindEnumValueByName("FooMessage") == NULL); +} + +TEST_F(FileDescriptorTest, FindServiceByName) { + EXPECT_EQ(foo_service_, foo_file_->FindServiceByName("FooService")); + EXPECT_EQ(bar_service_, bar_file_->FindServiceByName("BarService")); + + EXPECT_TRUE(foo_file_->FindServiceByName("BarService") == NULL); + EXPECT_TRUE(bar_file_->FindServiceByName("FooService") == NULL); + EXPECT_TRUE(baz_file_->FindServiceByName("FooService") == NULL); + + EXPECT_TRUE(foo_file_->FindServiceByName("NoSuchService") == NULL); + EXPECT_TRUE(foo_file_->FindServiceByName("FooMessage") == NULL); +} + +TEST_F(FileDescriptorTest, FindExtensionByName) { + EXPECT_EQ(foo_extension_, foo_file_->FindExtensionByName("foo_extension")); + EXPECT_EQ(bar_extension_, bar_file_->FindExtensionByName("bar_extension")); + + EXPECT_TRUE(foo_file_->FindExtensionByName("bar_extension") == NULL); + EXPECT_TRUE(bar_file_->FindExtensionByName("foo_extension") == NULL); + EXPECT_TRUE(baz_file_->FindExtensionByName("foo_extension") == NULL); + + EXPECT_TRUE(foo_file_->FindExtensionByName("no_such_extension") == NULL); + EXPECT_TRUE(foo_file_->FindExtensionByName("FooMessage") == NULL); +} + +TEST_F(FileDescriptorTest, FindExtensionByNumber) { + EXPECT_EQ(foo_extension_, pool_.FindExtensionByNumber(foo_message_, 1)); + EXPECT_EQ(bar_extension_, pool_.FindExtensionByNumber(bar_message_, 1)); + + EXPECT_TRUE(pool_.FindExtensionByNumber(foo_message_, 2) == NULL); +} + +TEST_F(FileDescriptorTest, BuildAgain) { + // Test that if te call BuildFile again on the same input we get the same + // FileDescriptor back. + FileDescriptorProto file; + foo_file_->CopyTo(&file); + EXPECT_EQ(foo_file_, pool_.BuildFile(file)); + + // But if we change the file then it won't work. + file.set_package("some.other.package"); + EXPECT_TRUE(pool_.BuildFile(file) == NULL); +} + +TEST_F(FileDescriptorTest, BuildAgainWithSyntax) { + // Test that if te call BuildFile again on the same input we get the same + // FileDescriptor back even if syntax param is specified. + FileDescriptorProto proto_syntax2; + proto_syntax2.set_name("foo_syntax2"); + proto_syntax2.set_syntax("proto2"); + + const FileDescriptor* proto2_descriptor = pool_.BuildFile(proto_syntax2); + EXPECT_TRUE(proto2_descriptor != NULL); + EXPECT_EQ(proto2_descriptor, pool_.BuildFile(proto_syntax2)); + + FileDescriptorProto implicit_proto2; + implicit_proto2.set_name("foo_implicit_syntax2"); + + const FileDescriptor* implicit_proto2_descriptor = + pool_.BuildFile(implicit_proto2); + EXPECT_TRUE(implicit_proto2_descriptor != NULL); + // We get the same FileDescriptor back if syntax param is explicitly + // specified. + implicit_proto2.set_syntax("proto2"); + EXPECT_EQ(implicit_proto2_descriptor, pool_.BuildFile(implicit_proto2)); + + FileDescriptorProto proto_syntax3; + proto_syntax3.set_name("foo_syntax3"); + proto_syntax3.set_syntax("proto3"); + + const FileDescriptor* proto3_descriptor = pool_.BuildFile(proto_syntax3); + EXPECT_TRUE(proto3_descriptor != NULL); + EXPECT_EQ(proto3_descriptor, pool_.BuildFile(proto_syntax3)); +} + +TEST_F(FileDescriptorTest, Syntax) { + FileDescriptorProto proto; + proto.set_name("foo"); + // Enable the test when we also populate the syntax for proto2. +#if 0 + { + proto.set_syntax("proto2"); + DescriptorPool pool; + const FileDescriptor* file = pool.BuildFile(proto); + EXPECT_TRUE(file != NULL); + EXPECT_EQ(FileDescriptor::SYNTAX_PROTO2, file->syntax()); + FileDescriptorProto other; + file->CopyTo(&other); + EXPECT_EQ("proto2", other.syntax()); + } +#endif + { + proto.set_syntax("proto3"); + DescriptorPool pool; + const FileDescriptor* file = pool.BuildFile(proto); + EXPECT_TRUE(file != NULL); + EXPECT_EQ(FileDescriptor::SYNTAX_PROTO3, file->syntax()); + FileDescriptorProto other; + file->CopyTo(&other); + EXPECT_EQ("proto3", other.syntax()); + } +} + +// =================================================================== + +// Test simple flat messages and fields. +class DescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // // in "foo.proto" + // message TestForeign {} + // enum TestEnum {} + // + // message TestMessage { + // required string foo = 1; + // optional TestEnum bar = 6; + // repeated TestForeign baz = 500000000; + // optional group qux = 15 {} + // } + // + // // in "bar.proto" + // package corge.grault; + // message TestMessage2 { + // required string foo = 1; + // required string bar = 2; + // required string quux = 6; + // } + // + // // in "map.proto" + // message TestMessage3 { + // map map_int32_int32 = 1; + // } + // + // // in "json.proto" + // message TestMessage4 { + // optional int32 field_name1 = 1; + // optional int32 fieldName2 = 2; + // optional int32 FieldName3 = 3; + // optional int32 _field_name4 = 4; + // optional int32 FIELD_NAME5 = 5; + // optional int32 field_name6 = 6 [json_name = "@type"]; + // } + // + // We cheat and use TestForeign as the type for qux rather than create + // an actual nested type. + // + // Since all primitive types (including string) use the same building + // code, there's no need to test each one individually. + // + // TestMessage2 is primarily here to test FindFieldByName and friends. + // All messages created from the same DescriptorPool share the same lookup + // table, so we need to insure that they don't interfere. + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + AddMessage(&foo_file, "TestForeign"); + AddEmptyEnum(&foo_file, "TestEnum"); + + DescriptorProto* message = AddMessage(&foo_file, "TestMessage"); + AddField(message, "foo", 1, + FieldDescriptorProto::LABEL_REQUIRED, + FieldDescriptorProto::TYPE_STRING); + AddField(message, "bar", 6, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_ENUM) + ->set_type_name("TestEnum"); + AddField(message, "baz", 500000000, + FieldDescriptorProto::LABEL_REPEATED, + FieldDescriptorProto::TYPE_MESSAGE) + ->set_type_name("TestForeign"); + AddField(message, "qux", 15, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_GROUP) + ->set_type_name("TestForeign"); + + FileDescriptorProto bar_file; + bar_file.set_name("bar.proto"); + bar_file.set_package("corge.grault"); + + DescriptorProto* message2 = AddMessage(&bar_file, "TestMessage2"); + AddField(message2, "foo", 1, + FieldDescriptorProto::LABEL_REQUIRED, + FieldDescriptorProto::TYPE_STRING); + AddField(message2, "bar", 2, + FieldDescriptorProto::LABEL_REQUIRED, + FieldDescriptorProto::TYPE_STRING); + AddField(message2, "quux", 6, + FieldDescriptorProto::LABEL_REQUIRED, + FieldDescriptorProto::TYPE_STRING); + + FileDescriptorProto map_file; + map_file.set_name("map.proto"); + DescriptorProto* message3 = AddMessage(&map_file, "TestMessage3"); + + DescriptorProto* entry = AddNestedMessage(message3, "MapInt32Int32Entry"); + AddField(entry, "key", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(entry, "value", 2, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + entry->mutable_options()->set_map_entry(true); + + AddField(message3, "map_int32_int32", 1, + FieldDescriptorProto::LABEL_REPEATED, + FieldDescriptorProto::TYPE_MESSAGE) + ->set_type_name("MapInt32Int32Entry"); + + FileDescriptorProto json_file; + json_file.set_name("json.proto"); + json_file.set_syntax("proto3"); + DescriptorProto* message4 = AddMessage(&json_file, "TestMessage4"); + AddField(message4, "field_name1", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message4, "fieldName2", 2, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message4, "FieldName3", 3, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message4, "_field_name4", 4, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message4, "FIELD_NAME5", 5, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message4, "field_name6", 6, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32) + ->set_json_name("@type"); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + bar_file_ = pool_.BuildFile(bar_file); + ASSERT_TRUE(bar_file_ != NULL); + + map_file_ = pool_.BuildFile(map_file); + ASSERT_TRUE(map_file_ != NULL); + + json_file_ = pool_.BuildFile(json_file); + ASSERT_TRUE(json_file_ != NULL); + + ASSERT_EQ(1, foo_file_->enum_type_count()); + enum_ = foo_file_->enum_type(0); + + ASSERT_EQ(2, foo_file_->message_type_count()); + foreign_ = foo_file_->message_type(0); + message_ = foo_file_->message_type(1); + + ASSERT_EQ(4, message_->field_count()); + foo_ = message_->field(0); + bar_ = message_->field(1); + baz_ = message_->field(2); + qux_ = message_->field(3); + + ASSERT_EQ(1, bar_file_->message_type_count()); + message2_ = bar_file_->message_type(0); + + ASSERT_EQ(3, message2_->field_count()); + foo2_ = message2_->field(0); + bar2_ = message2_->field(1); + quux2_ = message2_->field(2); + + ASSERT_EQ(1, map_file_->message_type_count()); + message3_ = map_file_->message_type(0); + + ASSERT_EQ(1, message3_->field_count()); + map_ = message3_->field(0); + + ASSERT_EQ(1, json_file_->message_type_count()); + message4_ = json_file_->message_type(0); + } + + void CopyWithJsonName(const Descriptor* message, DescriptorProto* proto) { + message->CopyTo(proto); + message->CopyJsonNameTo(proto); + } + + DescriptorPool pool_; + + const FileDescriptor* foo_file_; + const FileDescriptor* bar_file_; + const FileDescriptor* map_file_; + const FileDescriptor* json_file_; + + const Descriptor* message_; + const Descriptor* message2_; + const Descriptor* message3_; + const Descriptor* message4_; + const Descriptor* foreign_; + const EnumDescriptor* enum_; + + const FieldDescriptor* foo_; + const FieldDescriptor* bar_; + const FieldDescriptor* baz_; + const FieldDescriptor* qux_; + + const FieldDescriptor* foo2_; + const FieldDescriptor* bar2_; + const FieldDescriptor* quux2_; + + const FieldDescriptor* map_; +}; + +TEST_F(DescriptorTest, Name) { + EXPECT_EQ("TestMessage", message_->name()); + EXPECT_EQ("TestMessage", message_->full_name()); + EXPECT_EQ(foo_file_, message_->file()); + + EXPECT_EQ("TestMessage2", message2_->name()); + EXPECT_EQ("corge.grault.TestMessage2", message2_->full_name()); + EXPECT_EQ(bar_file_, message2_->file()); +} + +TEST_F(DescriptorTest, ContainingType) { + EXPECT_TRUE(message_->containing_type() == NULL); + EXPECT_TRUE(message2_->containing_type() == NULL); +} + +TEST_F(DescriptorTest, FieldsByIndex) { + ASSERT_EQ(4, message_->field_count()); + EXPECT_EQ(foo_, message_->field(0)); + EXPECT_EQ(bar_, message_->field(1)); + EXPECT_EQ(baz_, message_->field(2)); + EXPECT_EQ(qux_, message_->field(3)); +} + +TEST_F(DescriptorTest, FindFieldByName) { + // All messages in the same DescriptorPool share a single lookup table for + // fields. So, in addition to testing that FindFieldByName finds the fields + // of the message, we need to test that it does *not* find the fields of + // *other* messages. + + EXPECT_EQ(foo_, message_->FindFieldByName("foo")); + EXPECT_EQ(bar_, message_->FindFieldByName("bar")); + EXPECT_EQ(baz_, message_->FindFieldByName("baz")); + EXPECT_EQ(qux_, message_->FindFieldByName("qux")); + EXPECT_TRUE(message_->FindFieldByName("no_such_field") == NULL); + EXPECT_TRUE(message_->FindFieldByName("quux") == NULL); + + EXPECT_EQ(foo2_ , message2_->FindFieldByName("foo" )); + EXPECT_EQ(bar2_ , message2_->FindFieldByName("bar" )); + EXPECT_EQ(quux2_, message2_->FindFieldByName("quux")); + EXPECT_TRUE(message2_->FindFieldByName("baz") == NULL); + EXPECT_TRUE(message2_->FindFieldByName("qux") == NULL); +} + +TEST_F(DescriptorTest, FindFieldByNumber) { + EXPECT_EQ(foo_, message_->FindFieldByNumber(1)); + EXPECT_EQ(bar_, message_->FindFieldByNumber(6)); + EXPECT_EQ(baz_, message_->FindFieldByNumber(500000000)); + EXPECT_EQ(qux_, message_->FindFieldByNumber(15)); + EXPECT_TRUE(message_->FindFieldByNumber(837592) == NULL); + EXPECT_TRUE(message_->FindFieldByNumber(2) == NULL); + + EXPECT_EQ(foo2_ , message2_->FindFieldByNumber(1)); + EXPECT_EQ(bar2_ , message2_->FindFieldByNumber(2)); + EXPECT_EQ(quux2_, message2_->FindFieldByNumber(6)); + EXPECT_TRUE(message2_->FindFieldByNumber(15) == NULL); + EXPECT_TRUE(message2_->FindFieldByNumber(500000000) == NULL); +} + +TEST_F(DescriptorTest, FieldName) { + EXPECT_EQ("foo", foo_->name()); + EXPECT_EQ("bar", bar_->name()); + EXPECT_EQ("baz", baz_->name()); + EXPECT_EQ("qux", qux_->name()); +} + +TEST_F(DescriptorTest, FieldFullName) { + EXPECT_EQ("TestMessage.foo", foo_->full_name()); + EXPECT_EQ("TestMessage.bar", bar_->full_name()); + EXPECT_EQ("TestMessage.baz", baz_->full_name()); + EXPECT_EQ("TestMessage.qux", qux_->full_name()); + + EXPECT_EQ("corge.grault.TestMessage2.foo", foo2_->full_name()); + EXPECT_EQ("corge.grault.TestMessage2.bar", bar2_->full_name()); + EXPECT_EQ("corge.grault.TestMessage2.quux", quux2_->full_name()); +} + +TEST_F(DescriptorTest, FieldJsonName) { + EXPECT_EQ("fieldName1", message4_->field(0)->json_name()); + EXPECT_EQ("fieldName2", message4_->field(1)->json_name()); + EXPECT_EQ("fieldName3", message4_->field(2)->json_name()); + EXPECT_EQ("fieldName4", message4_->field(3)->json_name()); + EXPECT_EQ("fIELDNAME5", message4_->field(4)->json_name()); + EXPECT_EQ("@type", message4_->field(5)->json_name()); + + DescriptorProto proto; + message4_->CopyTo(&proto); + ASSERT_EQ(6, proto.field_size()); + EXPECT_FALSE(proto.field(0).has_json_name()); + EXPECT_FALSE(proto.field(1).has_json_name()); + EXPECT_FALSE(proto.field(2).has_json_name()); + EXPECT_FALSE(proto.field(3).has_json_name()); + EXPECT_FALSE(proto.field(4).has_json_name()); + EXPECT_EQ("@type", proto.field(5).json_name()); + + proto.Clear(); + CopyWithJsonName(message4_, &proto); + ASSERT_EQ(6, proto.field_size()); + EXPECT_EQ("fieldName1", proto.field(0).json_name()); + EXPECT_EQ("fieldName2", proto.field(1).json_name()); + EXPECT_EQ("fieldName3", proto.field(2).json_name()); + EXPECT_EQ("fieldName4", proto.field(3).json_name()); + EXPECT_EQ("fIELDNAME5", proto.field(4).json_name()); + EXPECT_EQ("@type", proto.field(5).json_name()); +} + +TEST_F(DescriptorTest, FieldFile) { + EXPECT_EQ(foo_file_, foo_->file()); + EXPECT_EQ(foo_file_, bar_->file()); + EXPECT_EQ(foo_file_, baz_->file()); + EXPECT_EQ(foo_file_, qux_->file()); + + EXPECT_EQ(bar_file_, foo2_->file()); + EXPECT_EQ(bar_file_, bar2_->file()); + EXPECT_EQ(bar_file_, quux2_->file()); +} + +TEST_F(DescriptorTest, FieldIndex) { + EXPECT_EQ(0, foo_->index()); + EXPECT_EQ(1, bar_->index()); + EXPECT_EQ(2, baz_->index()); + EXPECT_EQ(3, qux_->index()); +} + +TEST_F(DescriptorTest, FieldNumber) { + EXPECT_EQ( 1, foo_->number()); + EXPECT_EQ( 6, bar_->number()); + EXPECT_EQ(500000000, baz_->number()); + EXPECT_EQ( 15, qux_->number()); +} + +TEST_F(DescriptorTest, FieldType) { + EXPECT_EQ(FieldDescriptor::TYPE_STRING , foo_->type()); + EXPECT_EQ(FieldDescriptor::TYPE_ENUM , bar_->type()); + EXPECT_EQ(FieldDescriptor::TYPE_MESSAGE, baz_->type()); + EXPECT_EQ(FieldDescriptor::TYPE_GROUP , qux_->type()); +} + +TEST_F(DescriptorTest, FieldLabel) { + EXPECT_EQ(FieldDescriptor::LABEL_REQUIRED, foo_->label()); + EXPECT_EQ(FieldDescriptor::LABEL_OPTIONAL, bar_->label()); + EXPECT_EQ(FieldDescriptor::LABEL_REPEATED, baz_->label()); + EXPECT_EQ(FieldDescriptor::LABEL_OPTIONAL, qux_->label()); + + EXPECT_TRUE (foo_->is_required()); + EXPECT_FALSE(foo_->is_optional()); + EXPECT_FALSE(foo_->is_repeated()); + + EXPECT_FALSE(bar_->is_required()); + EXPECT_TRUE (bar_->is_optional()); + EXPECT_FALSE(bar_->is_repeated()); + + EXPECT_FALSE(baz_->is_required()); + EXPECT_FALSE(baz_->is_optional()); + EXPECT_TRUE (baz_->is_repeated()); +} + +TEST_F(DescriptorTest, IsMap) { + EXPECT_TRUE(map_->is_map()); + EXPECT_FALSE(baz_->is_map()); + EXPECT_TRUE(map_->message_type()->options().map_entry()); +} + +TEST_F(DescriptorTest, FieldHasDefault) { + EXPECT_FALSE(foo_->has_default_value()); + EXPECT_FALSE(bar_->has_default_value()); + EXPECT_FALSE(baz_->has_default_value()); + EXPECT_FALSE(qux_->has_default_value()); +} + +TEST_F(DescriptorTest, FieldContainingType) { + EXPECT_EQ(message_, foo_->containing_type()); + EXPECT_EQ(message_, bar_->containing_type()); + EXPECT_EQ(message_, baz_->containing_type()); + EXPECT_EQ(message_, qux_->containing_type()); + + EXPECT_EQ(message2_, foo2_ ->containing_type()); + EXPECT_EQ(message2_, bar2_ ->containing_type()); + EXPECT_EQ(message2_, quux2_->containing_type()); +} + +TEST_F(DescriptorTest, FieldMessageType) { + EXPECT_TRUE(foo_->message_type() == NULL); + EXPECT_TRUE(bar_->message_type() == NULL); + + EXPECT_EQ(foreign_, baz_->message_type()); + EXPECT_EQ(foreign_, qux_->message_type()); +} + +TEST_F(DescriptorTest, FieldEnumType) { + EXPECT_TRUE(foo_->enum_type() == NULL); + EXPECT_TRUE(baz_->enum_type() == NULL); + EXPECT_TRUE(qux_->enum_type() == NULL); + + EXPECT_EQ(enum_, bar_->enum_type()); +} + +// =================================================================== + +// Test simple flat messages and fields. +class OneofDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // package garply; + // message TestOneof { + // optional int32 a = 1; + // oneof foo { + // string b = 2; + // TestOneof c = 3; + // } + // oneof bar { + // float d = 4; + // } + // } + + FileDescriptorProto baz_file; + baz_file.set_name("baz.proto"); + baz_file.set_package("garply"); + + DescriptorProto* oneof_message = AddMessage(&baz_file, "TestOneof"); + oneof_message->add_oneof_decl()->set_name("foo"); + oneof_message->add_oneof_decl()->set_name("bar"); + + AddField(oneof_message, "a", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(oneof_message, "b", 2, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_STRING); + oneof_message->mutable_field(1)->set_oneof_index(0); + AddField(oneof_message, "c", 3, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_MESSAGE); + oneof_message->mutable_field(2)->set_oneof_index(0); + oneof_message->mutable_field(2)->set_type_name("TestOneof"); + + AddField(oneof_message, "d", 4, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_FLOAT); + oneof_message->mutable_field(3)->set_oneof_index(1); + + // Build the descriptors and get the pointers. + baz_file_ = pool_.BuildFile(baz_file); + ASSERT_TRUE(baz_file_ != NULL); + + ASSERT_EQ(1, baz_file_->message_type_count()); + oneof_message_ = baz_file_->message_type(0); + + ASSERT_EQ(2, oneof_message_->oneof_decl_count()); + oneof_ = oneof_message_->oneof_decl(0); + oneof2_ = oneof_message_->oneof_decl(1); + + ASSERT_EQ(4, oneof_message_->field_count()); + a_ = oneof_message_->field(0); + b_ = oneof_message_->field(1); + c_ = oneof_message_->field(2); + d_ = oneof_message_->field(3); + } + + DescriptorPool pool_; + + const FileDescriptor* baz_file_; + + const Descriptor* oneof_message_; + + const OneofDescriptor* oneof_; + const OneofDescriptor* oneof2_; + const FieldDescriptor* a_; + const FieldDescriptor* b_; + const FieldDescriptor* c_; + const FieldDescriptor* d_; + const FieldDescriptor* e_; + const FieldDescriptor* f_; +}; + +TEST_F(OneofDescriptorTest, Normal) { + EXPECT_EQ("foo", oneof_->name()); + EXPECT_EQ("garply.TestOneof.foo", oneof_->full_name()); + EXPECT_EQ(0, oneof_->index()); + ASSERT_EQ(2, oneof_->field_count()); + EXPECT_EQ(b_, oneof_->field(0)); + EXPECT_EQ(c_, oneof_->field(1)); + EXPECT_TRUE(a_->containing_oneof() == NULL); + EXPECT_EQ(oneof_, b_->containing_oneof()); + EXPECT_EQ(oneof_, c_->containing_oneof()); +} + +TEST_F(OneofDescriptorTest, FindByName) { + EXPECT_EQ(oneof_, oneof_message_->FindOneofByName("foo")); + EXPECT_EQ(oneof2_, oneof_message_->FindOneofByName("bar")); + EXPECT_TRUE(oneof_message_->FindOneofByName("no_such_oneof") == NULL); +} + +// =================================================================== + +class StylizedFieldNamesTest : public testing::Test { + protected: + void SetUp() { + FileDescriptorProto file; + file.set_name("foo.proto"); + + AddExtensionRange(AddMessage(&file, "ExtendableMessage"), 1, 1000); + + DescriptorProto* message = AddMessage(&file, "TestMessage"); + AddField(message, "foo_foo", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message, "FooBar", 2, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message, "fooBaz", 3, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message, "fooFoo", 4, // Camel-case conflict with foo_foo. + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddField(message, "foobar", 5, // Lower-case conflict with FooBar. + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + + AddNestedExtension(message, "ExtendableMessage", "bar_foo", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddNestedExtension(message, "ExtendableMessage", "BarBar", 2, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddNestedExtension(message, "ExtendableMessage", "BarBaz", 3, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddNestedExtension(message, "ExtendableMessage", "barFoo", 4, // Conflict + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddNestedExtension(message, "ExtendableMessage", "barbar", 5, // Conflict + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + + AddExtension(&file, "ExtendableMessage", "baz_foo", 11, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddExtension(&file, "ExtendableMessage", "BazBar", 12, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddExtension(&file, "ExtendableMessage", "BazBaz", 13, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddExtension(&file, "ExtendableMessage", "bazFoo", 14, // Conflict + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddExtension(&file, "ExtendableMessage", "bazbar", 15, // Conflict + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + + file_ = pool_.BuildFile(file); + ASSERT_TRUE(file_ != NULL); + ASSERT_EQ(2, file_->message_type_count()); + message_ = file_->message_type(1); + ASSERT_EQ("TestMessage", message_->name()); + ASSERT_EQ(5, message_->field_count()); + ASSERT_EQ(5, message_->extension_count()); + ASSERT_EQ(5, file_->extension_count()); + } + + DescriptorPool pool_; + const FileDescriptor* file_; + const Descriptor* message_; +}; + +TEST_F(StylizedFieldNamesTest, LowercaseName) { + EXPECT_EQ("foo_foo", message_->field(0)->lowercase_name()); + EXPECT_EQ("foobar" , message_->field(1)->lowercase_name()); + EXPECT_EQ("foobaz" , message_->field(2)->lowercase_name()); + EXPECT_EQ("foofoo" , message_->field(3)->lowercase_name()); + EXPECT_EQ("foobar" , message_->field(4)->lowercase_name()); + + EXPECT_EQ("bar_foo", message_->extension(0)->lowercase_name()); + EXPECT_EQ("barbar" , message_->extension(1)->lowercase_name()); + EXPECT_EQ("barbaz" , message_->extension(2)->lowercase_name()); + EXPECT_EQ("barfoo" , message_->extension(3)->lowercase_name()); + EXPECT_EQ("barbar" , message_->extension(4)->lowercase_name()); + + EXPECT_EQ("baz_foo", file_->extension(0)->lowercase_name()); + EXPECT_EQ("bazbar" , file_->extension(1)->lowercase_name()); + EXPECT_EQ("bazbaz" , file_->extension(2)->lowercase_name()); + EXPECT_EQ("bazfoo" , file_->extension(3)->lowercase_name()); + EXPECT_EQ("bazbar" , file_->extension(4)->lowercase_name()); +} + +TEST_F(StylizedFieldNamesTest, CamelcaseName) { + EXPECT_EQ("fooFoo", message_->field(0)->camelcase_name()); + EXPECT_EQ("fooBar", message_->field(1)->camelcase_name()); + EXPECT_EQ("fooBaz", message_->field(2)->camelcase_name()); + EXPECT_EQ("fooFoo", message_->field(3)->camelcase_name()); + EXPECT_EQ("foobar", message_->field(4)->camelcase_name()); + + EXPECT_EQ("barFoo", message_->extension(0)->camelcase_name()); + EXPECT_EQ("barBar", message_->extension(1)->camelcase_name()); + EXPECT_EQ("barBaz", message_->extension(2)->camelcase_name()); + EXPECT_EQ("barFoo", message_->extension(3)->camelcase_name()); + EXPECT_EQ("barbar", message_->extension(4)->camelcase_name()); + + EXPECT_EQ("bazFoo", file_->extension(0)->camelcase_name()); + EXPECT_EQ("bazBar", file_->extension(1)->camelcase_name()); + EXPECT_EQ("bazBaz", file_->extension(2)->camelcase_name()); + EXPECT_EQ("bazFoo", file_->extension(3)->camelcase_name()); + EXPECT_EQ("bazbar", file_->extension(4)->camelcase_name()); +} + +TEST_F(StylizedFieldNamesTest, FindByLowercaseName) { + EXPECT_EQ(message_->field(0), + message_->FindFieldByLowercaseName("foo_foo")); + EXPECT_EQ(message_->field(1), + message_->FindFieldByLowercaseName("foobar")); + EXPECT_EQ(message_->field(2), + message_->FindFieldByLowercaseName("foobaz")); + EXPECT_TRUE(message_->FindFieldByLowercaseName("FooBar") == NULL); + EXPECT_TRUE(message_->FindFieldByLowercaseName("fooBaz") == NULL); + EXPECT_TRUE(message_->FindFieldByLowercaseName("bar_foo") == NULL); + EXPECT_TRUE(message_->FindFieldByLowercaseName("nosuchfield") == NULL); + + EXPECT_EQ(message_->extension(0), + message_->FindExtensionByLowercaseName("bar_foo")); + EXPECT_EQ(message_->extension(1), + message_->FindExtensionByLowercaseName("barbar")); + EXPECT_EQ(message_->extension(2), + message_->FindExtensionByLowercaseName("barbaz")); + EXPECT_TRUE(message_->FindExtensionByLowercaseName("BarBar") == NULL); + EXPECT_TRUE(message_->FindExtensionByLowercaseName("barBaz") == NULL); + EXPECT_TRUE(message_->FindExtensionByLowercaseName("foo_foo") == NULL); + EXPECT_TRUE(message_->FindExtensionByLowercaseName("nosuchfield") == NULL); + + EXPECT_EQ(file_->extension(0), + file_->FindExtensionByLowercaseName("baz_foo")); + EXPECT_EQ(file_->extension(1), + file_->FindExtensionByLowercaseName("bazbar")); + EXPECT_EQ(file_->extension(2), + file_->FindExtensionByLowercaseName("bazbaz")); + EXPECT_TRUE(file_->FindExtensionByLowercaseName("BazBar") == NULL); + EXPECT_TRUE(file_->FindExtensionByLowercaseName("bazBaz") == NULL); + EXPECT_TRUE(file_->FindExtensionByLowercaseName("nosuchfield") == NULL); +} + +TEST_F(StylizedFieldNamesTest, FindByCamelcaseName) { + EXPECT_EQ(message_->field(0), + message_->FindFieldByCamelcaseName("fooFoo")); + EXPECT_EQ(message_->field(1), + message_->FindFieldByCamelcaseName("fooBar")); + EXPECT_EQ(message_->field(2), + message_->FindFieldByCamelcaseName("fooBaz")); + EXPECT_TRUE(message_->FindFieldByCamelcaseName("foo_foo") == NULL); + EXPECT_TRUE(message_->FindFieldByCamelcaseName("FooBar") == NULL); + EXPECT_TRUE(message_->FindFieldByCamelcaseName("barFoo") == NULL); + EXPECT_TRUE(message_->FindFieldByCamelcaseName("nosuchfield") == NULL); + + EXPECT_EQ(message_->extension(0), + message_->FindExtensionByCamelcaseName("barFoo")); + EXPECT_EQ(message_->extension(1), + message_->FindExtensionByCamelcaseName("barBar")); + EXPECT_EQ(message_->extension(2), + message_->FindExtensionByCamelcaseName("barBaz")); + EXPECT_TRUE(message_->FindExtensionByCamelcaseName("bar_foo") == NULL); + EXPECT_TRUE(message_->FindExtensionByCamelcaseName("BarBar") == NULL); + EXPECT_TRUE(message_->FindExtensionByCamelcaseName("fooFoo") == NULL); + EXPECT_TRUE(message_->FindExtensionByCamelcaseName("nosuchfield") == NULL); + + EXPECT_EQ(file_->extension(0), + file_->FindExtensionByCamelcaseName("bazFoo")); + EXPECT_EQ(file_->extension(1), + file_->FindExtensionByCamelcaseName("bazBar")); + EXPECT_EQ(file_->extension(2), + file_->FindExtensionByCamelcaseName("bazBaz")); + EXPECT_TRUE(file_->FindExtensionByCamelcaseName("baz_foo") == NULL); + EXPECT_TRUE(file_->FindExtensionByCamelcaseName("BazBar") == NULL); + EXPECT_TRUE(file_->FindExtensionByCamelcaseName("nosuchfield") == NULL); +} + +// =================================================================== + +// Test enum descriptors. +class EnumDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // // in "foo.proto" + // enum TestEnum { + // FOO = 1; + // BAR = 2; + // } + // + // // in "bar.proto" + // package corge.grault; + // enum TestEnum2 { + // FOO = 1; + // BAZ = 3; + // } + // + // TestEnum2 is primarily here to test FindValueByName and friends. + // All enums created from the same DescriptorPool share the same lookup + // table, so we need to insure that they don't interfere. + + // TestEnum + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + + EnumDescriptorProto* enum_proto = AddEnum(&foo_file, "TestEnum"); + AddEnumValue(enum_proto, "FOO", 1); + AddEnumValue(enum_proto, "BAR", 2); + + // TestEnum2 + FileDescriptorProto bar_file; + bar_file.set_name("bar.proto"); + bar_file.set_package("corge.grault"); + + EnumDescriptorProto* enum2_proto = AddEnum(&bar_file, "TestEnum2"); + AddEnumValue(enum2_proto, "FOO", 1); + AddEnumValue(enum2_proto, "BAZ", 3); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + bar_file_ = pool_.BuildFile(bar_file); + ASSERT_TRUE(bar_file_ != NULL); + + ASSERT_EQ(1, foo_file_->enum_type_count()); + enum_ = foo_file_->enum_type(0); + + ASSERT_EQ(2, enum_->value_count()); + foo_ = enum_->value(0); + bar_ = enum_->value(1); + + ASSERT_EQ(1, bar_file_->enum_type_count()); + enum2_ = bar_file_->enum_type(0); + + ASSERT_EQ(2, enum2_->value_count()); + foo2_ = enum2_->value(0); + baz2_ = enum2_->value(1); + } + + DescriptorPool pool_; + + const FileDescriptor* foo_file_; + const FileDescriptor* bar_file_; + + const EnumDescriptor* enum_; + const EnumDescriptor* enum2_; + + const EnumValueDescriptor* foo_; + const EnumValueDescriptor* bar_; + + const EnumValueDescriptor* foo2_; + const EnumValueDescriptor* baz2_; +}; + +TEST_F(EnumDescriptorTest, Name) { + EXPECT_EQ("TestEnum", enum_->name()); + EXPECT_EQ("TestEnum", enum_->full_name()); + EXPECT_EQ(foo_file_, enum_->file()); + + EXPECT_EQ("TestEnum2", enum2_->name()); + EXPECT_EQ("corge.grault.TestEnum2", enum2_->full_name()); + EXPECT_EQ(bar_file_, enum2_->file()); +} + +TEST_F(EnumDescriptorTest, ContainingType) { + EXPECT_TRUE(enum_->containing_type() == NULL); + EXPECT_TRUE(enum2_->containing_type() == NULL); +} + +TEST_F(EnumDescriptorTest, ValuesByIndex) { + ASSERT_EQ(2, enum_->value_count()); + EXPECT_EQ(foo_, enum_->value(0)); + EXPECT_EQ(bar_, enum_->value(1)); +} + +TEST_F(EnumDescriptorTest, FindValueByName) { + EXPECT_EQ(foo_ , enum_ ->FindValueByName("FOO")); + EXPECT_EQ(bar_ , enum_ ->FindValueByName("BAR")); + EXPECT_EQ(foo2_, enum2_->FindValueByName("FOO")); + EXPECT_EQ(baz2_, enum2_->FindValueByName("BAZ")); + + EXPECT_TRUE(enum_ ->FindValueByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(enum_ ->FindValueByName("BAZ" ) == NULL); + EXPECT_TRUE(enum2_->FindValueByName("BAR" ) == NULL); +} + +TEST_F(EnumDescriptorTest, FindValueByNumber) { + EXPECT_EQ(foo_ , enum_ ->FindValueByNumber(1)); + EXPECT_EQ(bar_ , enum_ ->FindValueByNumber(2)); + EXPECT_EQ(foo2_, enum2_->FindValueByNumber(1)); + EXPECT_EQ(baz2_, enum2_->FindValueByNumber(3)); + + EXPECT_TRUE(enum_ ->FindValueByNumber(416) == NULL); + EXPECT_TRUE(enum_ ->FindValueByNumber(3) == NULL); + EXPECT_TRUE(enum2_->FindValueByNumber(2) == NULL); +} + +TEST_F(EnumDescriptorTest, ValueName) { + EXPECT_EQ("FOO", foo_->name()); + EXPECT_EQ("BAR", bar_->name()); +} + +TEST_F(EnumDescriptorTest, ValueFullName) { + EXPECT_EQ("FOO", foo_->full_name()); + EXPECT_EQ("BAR", bar_->full_name()); + EXPECT_EQ("corge.grault.FOO", foo2_->full_name()); + EXPECT_EQ("corge.grault.BAZ", baz2_->full_name()); +} + +TEST_F(EnumDescriptorTest, ValueIndex) { + EXPECT_EQ(0, foo_->index()); + EXPECT_EQ(1, bar_->index()); +} + +TEST_F(EnumDescriptorTest, ValueNumber) { + EXPECT_EQ(1, foo_->number()); + EXPECT_EQ(2, bar_->number()); +} + +TEST_F(EnumDescriptorTest, ValueType) { + EXPECT_EQ(enum_ , foo_ ->type()); + EXPECT_EQ(enum_ , bar_ ->type()); + EXPECT_EQ(enum2_, foo2_->type()); + EXPECT_EQ(enum2_, baz2_->type()); +} + +// =================================================================== + +// Test service descriptors. +class ServiceDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following messages and service: + // // in "foo.proto" + // message FooRequest {} + // message FooResponse {} + // message BarRequest {} + // message BarResponse {} + // message BazRequest {} + // message BazResponse {} + // + // service TestService { + // rpc Foo(FooRequest) returns (FooResponse); + // rpc Bar(BarRequest) returns (BarResponse); + // } + // + // // in "bar.proto" + // package corge.grault + // service TestService2 { + // rpc Foo(FooRequest) returns (FooResponse); + // rpc Baz(BazRequest) returns (BazResponse); + // } + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + + AddMessage(&foo_file, "FooRequest"); + AddMessage(&foo_file, "FooResponse"); + AddMessage(&foo_file, "BarRequest"); + AddMessage(&foo_file, "BarResponse"); + AddMessage(&foo_file, "BazRequest"); + AddMessage(&foo_file, "BazResponse"); + + ServiceDescriptorProto* service = AddService(&foo_file, "TestService"); + AddMethod(service, "Foo", "FooRequest", "FooResponse"); + AddMethod(service, "Bar", "BarRequest", "BarResponse"); + + FileDescriptorProto bar_file; + bar_file.set_name("bar.proto"); + bar_file.set_package("corge.grault"); + bar_file.add_dependency("foo.proto"); + + ServiceDescriptorProto* service2 = AddService(&bar_file, "TestService2"); + AddMethod(service2, "Foo", "FooRequest", "FooResponse"); + AddMethod(service2, "Baz", "BazRequest", "BazResponse"); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + bar_file_ = pool_.BuildFile(bar_file); + ASSERT_TRUE(bar_file_ != NULL); + + ASSERT_EQ(6, foo_file_->message_type_count()); + foo_request_ = foo_file_->message_type(0); + foo_response_ = foo_file_->message_type(1); + bar_request_ = foo_file_->message_type(2); + bar_response_ = foo_file_->message_type(3); + baz_request_ = foo_file_->message_type(4); + baz_response_ = foo_file_->message_type(5); + + ASSERT_EQ(1, foo_file_->service_count()); + service_ = foo_file_->service(0); + + ASSERT_EQ(2, service_->method_count()); + foo_ = service_->method(0); + bar_ = service_->method(1); + + ASSERT_EQ(1, bar_file_->service_count()); + service2_ = bar_file_->service(0); + + ASSERT_EQ(2, service2_->method_count()); + foo2_ = service2_->method(0); + baz2_ = service2_->method(1); + } + + DescriptorPool pool_; + + const FileDescriptor* foo_file_; + const FileDescriptor* bar_file_; + + const Descriptor* foo_request_; + const Descriptor* foo_response_; + const Descriptor* bar_request_; + const Descriptor* bar_response_; + const Descriptor* baz_request_; + const Descriptor* baz_response_; + + const ServiceDescriptor* service_; + const ServiceDescriptor* service2_; + + const MethodDescriptor* foo_; + const MethodDescriptor* bar_; + + const MethodDescriptor* foo2_; + const MethodDescriptor* baz2_; +}; + +TEST_F(ServiceDescriptorTest, Name) { + EXPECT_EQ("TestService", service_->name()); + EXPECT_EQ("TestService", service_->full_name()); + EXPECT_EQ(foo_file_, service_->file()); + + EXPECT_EQ("TestService2", service2_->name()); + EXPECT_EQ("corge.grault.TestService2", service2_->full_name()); + EXPECT_EQ(bar_file_, service2_->file()); +} + +TEST_F(ServiceDescriptorTest, MethodsByIndex) { + ASSERT_EQ(2, service_->method_count()); + EXPECT_EQ(foo_, service_->method(0)); + EXPECT_EQ(bar_, service_->method(1)); +} + +TEST_F(ServiceDescriptorTest, FindMethodByName) { + EXPECT_EQ(foo_ , service_ ->FindMethodByName("Foo")); + EXPECT_EQ(bar_ , service_ ->FindMethodByName("Bar")); + EXPECT_EQ(foo2_, service2_->FindMethodByName("Foo")); + EXPECT_EQ(baz2_, service2_->FindMethodByName("Baz")); + + EXPECT_TRUE(service_ ->FindMethodByName("NoSuchMethod") == NULL); + EXPECT_TRUE(service_ ->FindMethodByName("Baz" ) == NULL); + EXPECT_TRUE(service2_->FindMethodByName("Bar" ) == NULL); +} + +TEST_F(ServiceDescriptorTest, MethodName) { + EXPECT_EQ("Foo", foo_->name()); + EXPECT_EQ("Bar", bar_->name()); +} + +TEST_F(ServiceDescriptorTest, MethodFullName) { + EXPECT_EQ("TestService.Foo", foo_->full_name()); + EXPECT_EQ("TestService.Bar", bar_->full_name()); + EXPECT_EQ("corge.grault.TestService2.Foo", foo2_->full_name()); + EXPECT_EQ("corge.grault.TestService2.Baz", baz2_->full_name()); +} + +TEST_F(ServiceDescriptorTest, MethodIndex) { + EXPECT_EQ(0, foo_->index()); + EXPECT_EQ(1, bar_->index()); +} + +TEST_F(ServiceDescriptorTest, MethodParent) { + EXPECT_EQ(service_, foo_->service()); + EXPECT_EQ(service_, bar_->service()); +} + +TEST_F(ServiceDescriptorTest, MethodInputType) { + EXPECT_EQ(foo_request_, foo_->input_type()); + EXPECT_EQ(bar_request_, bar_->input_type()); +} + +TEST_F(ServiceDescriptorTest, MethodOutputType) { + EXPECT_EQ(foo_response_, foo_->output_type()); + EXPECT_EQ(bar_response_, bar_->output_type()); +} + +// =================================================================== + +// Test nested types. +class NestedDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // // in "foo.proto" + // message TestMessage { + // message Foo {} + // message Bar {} + // enum Baz { A = 1; } + // enum Qux { B = 1; } + // } + // + // // in "bar.proto" + // package corge.grault; + // message TestMessage2 { + // message Foo {} + // message Baz {} + // enum Qux { A = 1; } + // enum Quux { C = 1; } + // } + // + // TestMessage2 is primarily here to test FindNestedTypeByName and friends. + // All messages created from the same DescriptorPool share the same lookup + // table, so we need to insure that they don't interfere. + // + // We add enum values to the enums in order to test searching for enum + // values across a message's scope. + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + + DescriptorProto* message = AddMessage(&foo_file, "TestMessage"); + AddNestedMessage(message, "Foo"); + AddNestedMessage(message, "Bar"); + EnumDescriptorProto* baz = AddNestedEnum(message, "Baz"); + AddEnumValue(baz, "A", 1); + EnumDescriptorProto* qux = AddNestedEnum(message, "Qux"); + AddEnumValue(qux, "B", 1); + + FileDescriptorProto bar_file; + bar_file.set_name("bar.proto"); + bar_file.set_package("corge.grault"); + + DescriptorProto* message2 = AddMessage(&bar_file, "TestMessage2"); + AddNestedMessage(message2, "Foo"); + AddNestedMessage(message2, "Baz"); + EnumDescriptorProto* qux2 = AddNestedEnum(message2, "Qux"); + AddEnumValue(qux2, "A", 1); + EnumDescriptorProto* quux2 = AddNestedEnum(message2, "Quux"); + AddEnumValue(quux2, "C", 1); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + bar_file_ = pool_.BuildFile(bar_file); + ASSERT_TRUE(bar_file_ != NULL); + + ASSERT_EQ(1, foo_file_->message_type_count()); + message_ = foo_file_->message_type(0); + + ASSERT_EQ(2, message_->nested_type_count()); + foo_ = message_->nested_type(0); + bar_ = message_->nested_type(1); + + ASSERT_EQ(2, message_->enum_type_count()); + baz_ = message_->enum_type(0); + qux_ = message_->enum_type(1); + + ASSERT_EQ(1, baz_->value_count()); + a_ = baz_->value(0); + ASSERT_EQ(1, qux_->value_count()); + b_ = qux_->value(0); + + ASSERT_EQ(1, bar_file_->message_type_count()); + message2_ = bar_file_->message_type(0); + + ASSERT_EQ(2, message2_->nested_type_count()); + foo2_ = message2_->nested_type(0); + baz2_ = message2_->nested_type(1); + + ASSERT_EQ(2, message2_->enum_type_count()); + qux2_ = message2_->enum_type(0); + quux2_ = message2_->enum_type(1); + + ASSERT_EQ(1, qux2_->value_count()); + a2_ = qux2_->value(0); + ASSERT_EQ(1, quux2_->value_count()); + c2_ = quux2_->value(0); + } + + DescriptorPool pool_; + + const FileDescriptor* foo_file_; + const FileDescriptor* bar_file_; + + const Descriptor* message_; + const Descriptor* message2_; + + const Descriptor* foo_; + const Descriptor* bar_; + const EnumDescriptor* baz_; + const EnumDescriptor* qux_; + const EnumValueDescriptor* a_; + const EnumValueDescriptor* b_; + + const Descriptor* foo2_; + const Descriptor* baz2_; + const EnumDescriptor* qux2_; + const EnumDescriptor* quux2_; + const EnumValueDescriptor* a2_; + const EnumValueDescriptor* c2_; +}; + +TEST_F(NestedDescriptorTest, MessageName) { + EXPECT_EQ("Foo", foo_ ->name()); + EXPECT_EQ("Bar", bar_ ->name()); + EXPECT_EQ("Foo", foo2_->name()); + EXPECT_EQ("Baz", baz2_->name()); + + EXPECT_EQ("TestMessage.Foo", foo_->full_name()); + EXPECT_EQ("TestMessage.Bar", bar_->full_name()); + EXPECT_EQ("corge.grault.TestMessage2.Foo", foo2_->full_name()); + EXPECT_EQ("corge.grault.TestMessage2.Baz", baz2_->full_name()); +} + +TEST_F(NestedDescriptorTest, MessageContainingType) { + EXPECT_EQ(message_ , foo_ ->containing_type()); + EXPECT_EQ(message_ , bar_ ->containing_type()); + EXPECT_EQ(message2_, foo2_->containing_type()); + EXPECT_EQ(message2_, baz2_->containing_type()); +} + +TEST_F(NestedDescriptorTest, NestedMessagesByIndex) { + ASSERT_EQ(2, message_->nested_type_count()); + EXPECT_EQ(foo_, message_->nested_type(0)); + EXPECT_EQ(bar_, message_->nested_type(1)); +} + +TEST_F(NestedDescriptorTest, FindFieldByNameDoesntFindNestedTypes) { + EXPECT_TRUE(message_->FindFieldByName("Foo") == NULL); + EXPECT_TRUE(message_->FindFieldByName("Qux") == NULL); + EXPECT_TRUE(message_->FindExtensionByName("Foo") == NULL); + EXPECT_TRUE(message_->FindExtensionByName("Qux") == NULL); +} + +TEST_F(NestedDescriptorTest, FindNestedTypeByName) { + EXPECT_EQ(foo_ , message_ ->FindNestedTypeByName("Foo")); + EXPECT_EQ(bar_ , message_ ->FindNestedTypeByName("Bar")); + EXPECT_EQ(foo2_, message2_->FindNestedTypeByName("Foo")); + EXPECT_EQ(baz2_, message2_->FindNestedTypeByName("Baz")); + + EXPECT_TRUE(message_ ->FindNestedTypeByName("NoSuchType") == NULL); + EXPECT_TRUE(message_ ->FindNestedTypeByName("Baz" ) == NULL); + EXPECT_TRUE(message2_->FindNestedTypeByName("Bar" ) == NULL); + + EXPECT_TRUE(message_->FindNestedTypeByName("Qux") == NULL); +} + +TEST_F(NestedDescriptorTest, EnumName) { + EXPECT_EQ("Baz" , baz_ ->name()); + EXPECT_EQ("Qux" , qux_ ->name()); + EXPECT_EQ("Qux" , qux2_->name()); + EXPECT_EQ("Quux", quux2_->name()); + + EXPECT_EQ("TestMessage.Baz", baz_->full_name()); + EXPECT_EQ("TestMessage.Qux", qux_->full_name()); + EXPECT_EQ("corge.grault.TestMessage2.Qux" , qux2_ ->full_name()); + EXPECT_EQ("corge.grault.TestMessage2.Quux", quux2_->full_name()); +} + +TEST_F(NestedDescriptorTest, EnumContainingType) { + EXPECT_EQ(message_ , baz_ ->containing_type()); + EXPECT_EQ(message_ , qux_ ->containing_type()); + EXPECT_EQ(message2_, qux2_ ->containing_type()); + EXPECT_EQ(message2_, quux2_->containing_type()); +} + +TEST_F(NestedDescriptorTest, NestedEnumsByIndex) { + ASSERT_EQ(2, message_->nested_type_count()); + EXPECT_EQ(foo_, message_->nested_type(0)); + EXPECT_EQ(bar_, message_->nested_type(1)); +} + +TEST_F(NestedDescriptorTest, FindEnumTypeByName) { + EXPECT_EQ(baz_ , message_ ->FindEnumTypeByName("Baz" )); + EXPECT_EQ(qux_ , message_ ->FindEnumTypeByName("Qux" )); + EXPECT_EQ(qux2_ , message2_->FindEnumTypeByName("Qux" )); + EXPECT_EQ(quux2_, message2_->FindEnumTypeByName("Quux")); + + EXPECT_TRUE(message_ ->FindEnumTypeByName("NoSuchType") == NULL); + EXPECT_TRUE(message_ ->FindEnumTypeByName("Quux" ) == NULL); + EXPECT_TRUE(message2_->FindEnumTypeByName("Baz" ) == NULL); + + EXPECT_TRUE(message_->FindEnumTypeByName("Foo") == NULL); +} + +TEST_F(NestedDescriptorTest, FindEnumValueByName) { + EXPECT_EQ(a_ , message_ ->FindEnumValueByName("A")); + EXPECT_EQ(b_ , message_ ->FindEnumValueByName("B")); + EXPECT_EQ(a2_, message2_->FindEnumValueByName("A")); + EXPECT_EQ(c2_, message2_->FindEnumValueByName("C")); + + EXPECT_TRUE(message_ ->FindEnumValueByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(message_ ->FindEnumValueByName("C" ) == NULL); + EXPECT_TRUE(message2_->FindEnumValueByName("B" ) == NULL); + + EXPECT_TRUE(message_->FindEnumValueByName("Foo") == NULL); +} + +// =================================================================== + +// Test extensions. +class ExtensionDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // enum Baz {} + // message Qux {} + // + // message Foo { + // extensions 10 to 19; + // extensions 30 to 39; + // } + // extends Foo with optional int32 foo_int32 = 10; + // extends Foo with repeated TestEnum foo_enum = 19; + // message Bar { + // extends Foo with optional Qux foo_message = 30; + // // (using Qux as the group type) + // extends Foo with repeated group foo_group = 39; + // } + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + + AddEmptyEnum(&foo_file, "Baz"); + AddMessage(&foo_file, "Qux"); + + DescriptorProto* foo = AddMessage(&foo_file, "Foo"); + AddExtensionRange(foo, 10, 20); + AddExtensionRange(foo, 30, 40); + + AddExtension(&foo_file, "Foo", "foo_int32", 10, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + AddExtension(&foo_file, "Foo", "foo_enum", 19, + FieldDescriptorProto::LABEL_REPEATED, + FieldDescriptorProto::TYPE_ENUM) + ->set_type_name("Baz"); + + DescriptorProto* bar = AddMessage(&foo_file, "Bar"); + AddNestedExtension(bar, "Foo", "foo_message", 30, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_MESSAGE) + ->set_type_name("Qux"); + AddNestedExtension(bar, "Foo", "foo_group", 39, + FieldDescriptorProto::LABEL_REPEATED, + FieldDescriptorProto::TYPE_GROUP) + ->set_type_name("Qux"); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + ASSERT_EQ(1, foo_file_->enum_type_count()); + baz_ = foo_file_->enum_type(0); + + ASSERT_EQ(3, foo_file_->message_type_count()); + qux_ = foo_file_->message_type(0); + foo_ = foo_file_->message_type(1); + bar_ = foo_file_->message_type(2); + } + + DescriptorPool pool_; + + const FileDescriptor* foo_file_; + + const Descriptor* foo_; + const Descriptor* bar_; + const EnumDescriptor* baz_; + const Descriptor* qux_; +}; + +TEST_F(ExtensionDescriptorTest, ExtensionRanges) { + EXPECT_EQ(0, bar_->extension_range_count()); + ASSERT_EQ(2, foo_->extension_range_count()); + + EXPECT_EQ(10, foo_->extension_range(0)->start); + EXPECT_EQ(30, foo_->extension_range(1)->start); + + EXPECT_EQ(20, foo_->extension_range(0)->end); + EXPECT_EQ(40, foo_->extension_range(1)->end); +}; + +TEST_F(ExtensionDescriptorTest, Extensions) { + EXPECT_EQ(0, foo_->extension_count()); + ASSERT_EQ(2, foo_file_->extension_count()); + ASSERT_EQ(2, bar_->extension_count()); + + EXPECT_TRUE(foo_file_->extension(0)->is_extension()); + EXPECT_TRUE(foo_file_->extension(1)->is_extension()); + EXPECT_TRUE(bar_->extension(0)->is_extension()); + EXPECT_TRUE(bar_->extension(1)->is_extension()); + + EXPECT_EQ("foo_int32" , foo_file_->extension(0)->name()); + EXPECT_EQ("foo_enum" , foo_file_->extension(1)->name()); + EXPECT_EQ("foo_message", bar_->extension(0)->name()); + EXPECT_EQ("foo_group" , bar_->extension(1)->name()); + + EXPECT_EQ(10, foo_file_->extension(0)->number()); + EXPECT_EQ(19, foo_file_->extension(1)->number()); + EXPECT_EQ(30, bar_->extension(0)->number()); + EXPECT_EQ(39, bar_->extension(1)->number()); + + EXPECT_EQ(FieldDescriptor::TYPE_INT32 , foo_file_->extension(0)->type()); + EXPECT_EQ(FieldDescriptor::TYPE_ENUM , foo_file_->extension(1)->type()); + EXPECT_EQ(FieldDescriptor::TYPE_MESSAGE, bar_->extension(0)->type()); + EXPECT_EQ(FieldDescriptor::TYPE_GROUP , bar_->extension(1)->type()); + + EXPECT_EQ(baz_, foo_file_->extension(1)->enum_type()); + EXPECT_EQ(qux_, bar_->extension(0)->message_type()); + EXPECT_EQ(qux_, bar_->extension(1)->message_type()); + + EXPECT_EQ(FieldDescriptor::LABEL_OPTIONAL, foo_file_->extension(0)->label()); + EXPECT_EQ(FieldDescriptor::LABEL_REPEATED, foo_file_->extension(1)->label()); + EXPECT_EQ(FieldDescriptor::LABEL_OPTIONAL, bar_->extension(0)->label()); + EXPECT_EQ(FieldDescriptor::LABEL_REPEATED, bar_->extension(1)->label()); + + EXPECT_EQ(foo_, foo_file_->extension(0)->containing_type()); + EXPECT_EQ(foo_, foo_file_->extension(1)->containing_type()); + EXPECT_EQ(foo_, bar_->extension(0)->containing_type()); + EXPECT_EQ(foo_, bar_->extension(1)->containing_type()); + + EXPECT_TRUE(foo_file_->extension(0)->extension_scope() == NULL); + EXPECT_TRUE(foo_file_->extension(1)->extension_scope() == NULL); + EXPECT_EQ(bar_, bar_->extension(0)->extension_scope()); + EXPECT_EQ(bar_, bar_->extension(1)->extension_scope()); +}; + +TEST_F(ExtensionDescriptorTest, IsExtensionNumber) { + EXPECT_FALSE(foo_->IsExtensionNumber( 9)); + EXPECT_TRUE (foo_->IsExtensionNumber(10)); + EXPECT_TRUE (foo_->IsExtensionNumber(19)); + EXPECT_FALSE(foo_->IsExtensionNumber(20)); + EXPECT_FALSE(foo_->IsExtensionNumber(29)); + EXPECT_TRUE (foo_->IsExtensionNumber(30)); + EXPECT_TRUE (foo_->IsExtensionNumber(39)); + EXPECT_FALSE(foo_->IsExtensionNumber(40)); +} + +TEST_F(ExtensionDescriptorTest, FindExtensionByName) { + // Note that FileDescriptor::FindExtensionByName() is tested by + // FileDescriptorTest. + ASSERT_EQ(2, bar_->extension_count()); + + EXPECT_EQ(bar_->extension(0), bar_->FindExtensionByName("foo_message")); + EXPECT_EQ(bar_->extension(1), bar_->FindExtensionByName("foo_group" )); + + EXPECT_TRUE(bar_->FindExtensionByName("no_such_extension") == NULL); + EXPECT_TRUE(foo_->FindExtensionByName("foo_int32") == NULL); + EXPECT_TRUE(foo_->FindExtensionByName("foo_message") == NULL); +} + +TEST_F(ExtensionDescriptorTest, FindAllExtensions) { + vector extensions; + pool_.FindAllExtensions(foo_, &extensions); + ASSERT_EQ(4, extensions.size()); + EXPECT_EQ(10, extensions[0]->number()); + EXPECT_EQ(19, extensions[1]->number()); + EXPECT_EQ(30, extensions[2]->number()); + EXPECT_EQ(39, extensions[3]->number()); +} + +TEST_F(ExtensionDescriptorTest, DuplicateFieldNumber) { + DescriptorPool pool; + FileDescriptorProto file_proto; + // Add "google/protobuf/descriptor.proto". + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + // Add "foo.proto": + // import "google/protobuf/descriptor.proto"; + // extend google.protobuf.FieldOptions { + // optional int32 option1 = 1000; + // } + file_proto.Clear(); + file_proto.set_name("foo.proto"); + file_proto.add_dependency("google/protobuf/descriptor.proto"); + AddExtension(&file_proto, "google.protobuf.FieldOptions", "option1", 1000, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + // Add "bar.proto": + // import "google/protobuf/descriptor.proto"; + // extend google.protobuf.FieldOptions { + // optional int32 option2 = 1000; + // } + file_proto.Clear(); + file_proto.set_name("bar.proto"); + file_proto.add_dependency("google/protobuf/descriptor.proto"); + AddExtension(&file_proto, "google.protobuf.FieldOptions", "option2", 1000, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + // Currently we only generate a warning for conflicting extension numbers. + // TODO(xiaofeng): Change it to an error. + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); +} + +// =================================================================== + +// Test reserved fields. +class ReservedDescriptorTest : public testing::Test { + protected: + virtual void SetUp() { + // Build descriptors for the following definitions: + // + // message Foo { + // reserved 2, 9 to 11, 15; + // reserved "foo", "bar"; + // } + + FileDescriptorProto foo_file; + foo_file.set_name("foo.proto"); + + DescriptorProto* foo = AddMessage(&foo_file, "Foo"); + AddReservedRange(foo, 2, 3); + AddReservedRange(foo, 9, 12); + AddReservedRange(foo, 15, 16); + + foo->add_reserved_name("foo"); + foo->add_reserved_name("bar"); + + // Build the descriptors and get the pointers. + foo_file_ = pool_.BuildFile(foo_file); + ASSERT_TRUE(foo_file_ != NULL); + + ASSERT_EQ(1, foo_file_->message_type_count()); + foo_ = foo_file_->message_type(0); + } + + DescriptorPool pool_; + const FileDescriptor* foo_file_; + const Descriptor* foo_; +}; + +TEST_F(ReservedDescriptorTest, ReservedRanges) { + ASSERT_EQ(3, foo_->reserved_range_count()); + + EXPECT_EQ(2, foo_->reserved_range(0)->start); + EXPECT_EQ(3, foo_->reserved_range(0)->end); + + EXPECT_EQ(9, foo_->reserved_range(1)->start); + EXPECT_EQ(12, foo_->reserved_range(1)->end); + + EXPECT_EQ(15, foo_->reserved_range(2)->start); + EXPECT_EQ(16, foo_->reserved_range(2)->end); +}; + +TEST_F(ReservedDescriptorTest, IsReservedNumber) { + EXPECT_FALSE(foo_->IsReservedNumber(1)); + EXPECT_TRUE (foo_->IsReservedNumber(2)); + EXPECT_FALSE(foo_->IsReservedNumber(3)); + EXPECT_FALSE(foo_->IsReservedNumber(8)); + EXPECT_TRUE (foo_->IsReservedNumber(9)); + EXPECT_TRUE (foo_->IsReservedNumber(10)); + EXPECT_TRUE (foo_->IsReservedNumber(11)); + EXPECT_FALSE(foo_->IsReservedNumber(12)); + EXPECT_FALSE(foo_->IsReservedNumber(13)); + EXPECT_FALSE(foo_->IsReservedNumber(14)); + EXPECT_TRUE (foo_->IsReservedNumber(15)); + EXPECT_FALSE(foo_->IsReservedNumber(16)); +}; + +TEST_F(ReservedDescriptorTest, ReservedNames) { + ASSERT_EQ(2, foo_->reserved_name_count()); + + EXPECT_EQ("foo", foo_->reserved_name(0)); + EXPECT_EQ("bar", foo_->reserved_name(1)); +}; + +TEST_F(ReservedDescriptorTest, IsReservedName) { + EXPECT_TRUE (foo_->IsReservedName("foo")); + EXPECT_TRUE (foo_->IsReservedName("bar")); + EXPECT_FALSE(foo_->IsReservedName("baz")); +}; + +// =================================================================== + +class MiscTest : public testing::Test { + protected: + // Function which makes a field descriptor of the given type. + const FieldDescriptor* GetFieldDescriptorOfType(FieldDescriptor::Type type) { + FileDescriptorProto file_proto; + file_proto.set_name("foo.proto"); + AddEmptyEnum(&file_proto, "DummyEnum"); + + DescriptorProto* message = AddMessage(&file_proto, "TestMessage"); + FieldDescriptorProto* field = + AddField(message, "foo", 1, FieldDescriptorProto::LABEL_OPTIONAL, + static_cast(static_cast(type))); + + if (type == FieldDescriptor::TYPE_MESSAGE || + type == FieldDescriptor::TYPE_GROUP) { + field->set_type_name("TestMessage"); + } else if (type == FieldDescriptor::TYPE_ENUM) { + field->set_type_name("DummyEnum"); + } + + // Build the descriptors and get the pointers. + pool_.reset(new DescriptorPool()); + const FileDescriptor* file = pool_->BuildFile(file_proto); + + if (file != NULL && + file->message_type_count() == 1 && + file->message_type(0)->field_count() == 1) { + return file->message_type(0)->field(0); + } else { + return NULL; + } + } + + const char* GetTypeNameForFieldType(FieldDescriptor::Type type) { + const FieldDescriptor* field = GetFieldDescriptorOfType(type); + return field != NULL ? field->type_name() : ""; + } + + FieldDescriptor::CppType GetCppTypeForFieldType(FieldDescriptor::Type type) { + const FieldDescriptor* field = GetFieldDescriptorOfType(type); + return field != NULL ? field->cpp_type() : + static_cast(0); + } + + const char* GetCppTypeNameForFieldType(FieldDescriptor::Type type) { + const FieldDescriptor* field = GetFieldDescriptorOfType(type); + return field != NULL ? field->cpp_type_name() : ""; + } + + const Descriptor* GetMessageDescriptorForFieldType( + FieldDescriptor::Type type) { + const FieldDescriptor* field = GetFieldDescriptorOfType(type); + return field != NULL ? field->message_type() : NULL; + } + + const EnumDescriptor* GetEnumDescriptorForFieldType( + FieldDescriptor::Type type) { + const FieldDescriptor* field = GetFieldDescriptorOfType(type); + return field != NULL ? field->enum_type() : NULL; + } + + google::protobuf::scoped_ptr pool_; +}; + +TEST_F(MiscTest, TypeNames) { + // Test that correct type names are returned. + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_STREQ("double" , GetTypeNameForFieldType(FD::TYPE_DOUBLE )); + EXPECT_STREQ("float" , GetTypeNameForFieldType(FD::TYPE_FLOAT )); + EXPECT_STREQ("int64" , GetTypeNameForFieldType(FD::TYPE_INT64 )); + EXPECT_STREQ("uint64" , GetTypeNameForFieldType(FD::TYPE_UINT64 )); + EXPECT_STREQ("int32" , GetTypeNameForFieldType(FD::TYPE_INT32 )); + EXPECT_STREQ("fixed64" , GetTypeNameForFieldType(FD::TYPE_FIXED64 )); + EXPECT_STREQ("fixed32" , GetTypeNameForFieldType(FD::TYPE_FIXED32 )); + EXPECT_STREQ("bool" , GetTypeNameForFieldType(FD::TYPE_BOOL )); + EXPECT_STREQ("string" , GetTypeNameForFieldType(FD::TYPE_STRING )); + EXPECT_STREQ("group" , GetTypeNameForFieldType(FD::TYPE_GROUP )); + EXPECT_STREQ("message" , GetTypeNameForFieldType(FD::TYPE_MESSAGE )); + EXPECT_STREQ("bytes" , GetTypeNameForFieldType(FD::TYPE_BYTES )); + EXPECT_STREQ("uint32" , GetTypeNameForFieldType(FD::TYPE_UINT32 )); + EXPECT_STREQ("enum" , GetTypeNameForFieldType(FD::TYPE_ENUM )); + EXPECT_STREQ("sfixed32", GetTypeNameForFieldType(FD::TYPE_SFIXED32)); + EXPECT_STREQ("sfixed64", GetTypeNameForFieldType(FD::TYPE_SFIXED64)); + EXPECT_STREQ("sint32" , GetTypeNameForFieldType(FD::TYPE_SINT32 )); + EXPECT_STREQ("sint64" , GetTypeNameForFieldType(FD::TYPE_SINT64 )); +} + +TEST_F(MiscTest, StaticTypeNames) { + // Test that correct type names are returned. + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_STREQ("double" , FD::TypeName(FD::TYPE_DOUBLE )); + EXPECT_STREQ("float" , FD::TypeName(FD::TYPE_FLOAT )); + EXPECT_STREQ("int64" , FD::TypeName(FD::TYPE_INT64 )); + EXPECT_STREQ("uint64" , FD::TypeName(FD::TYPE_UINT64 )); + EXPECT_STREQ("int32" , FD::TypeName(FD::TYPE_INT32 )); + EXPECT_STREQ("fixed64" , FD::TypeName(FD::TYPE_FIXED64 )); + EXPECT_STREQ("fixed32" , FD::TypeName(FD::TYPE_FIXED32 )); + EXPECT_STREQ("bool" , FD::TypeName(FD::TYPE_BOOL )); + EXPECT_STREQ("string" , FD::TypeName(FD::TYPE_STRING )); + EXPECT_STREQ("group" , FD::TypeName(FD::TYPE_GROUP )); + EXPECT_STREQ("message" , FD::TypeName(FD::TYPE_MESSAGE )); + EXPECT_STREQ("bytes" , FD::TypeName(FD::TYPE_BYTES )); + EXPECT_STREQ("uint32" , FD::TypeName(FD::TYPE_UINT32 )); + EXPECT_STREQ("enum" , FD::TypeName(FD::TYPE_ENUM )); + EXPECT_STREQ("sfixed32", FD::TypeName(FD::TYPE_SFIXED32)); + EXPECT_STREQ("sfixed64", FD::TypeName(FD::TYPE_SFIXED64)); + EXPECT_STREQ("sint32" , FD::TypeName(FD::TYPE_SINT32 )); + EXPECT_STREQ("sint64" , FD::TypeName(FD::TYPE_SINT64 )); +} + +TEST_F(MiscTest, CppTypes) { + // Test that CPP types are assigned correctly. + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_EQ(FD::CPPTYPE_DOUBLE , GetCppTypeForFieldType(FD::TYPE_DOUBLE )); + EXPECT_EQ(FD::CPPTYPE_FLOAT , GetCppTypeForFieldType(FD::TYPE_FLOAT )); + EXPECT_EQ(FD::CPPTYPE_INT64 , GetCppTypeForFieldType(FD::TYPE_INT64 )); + EXPECT_EQ(FD::CPPTYPE_UINT64 , GetCppTypeForFieldType(FD::TYPE_UINT64 )); + EXPECT_EQ(FD::CPPTYPE_INT32 , GetCppTypeForFieldType(FD::TYPE_INT32 )); + EXPECT_EQ(FD::CPPTYPE_UINT64 , GetCppTypeForFieldType(FD::TYPE_FIXED64 )); + EXPECT_EQ(FD::CPPTYPE_UINT32 , GetCppTypeForFieldType(FD::TYPE_FIXED32 )); + EXPECT_EQ(FD::CPPTYPE_BOOL , GetCppTypeForFieldType(FD::TYPE_BOOL )); + EXPECT_EQ(FD::CPPTYPE_STRING , GetCppTypeForFieldType(FD::TYPE_STRING )); + EXPECT_EQ(FD::CPPTYPE_MESSAGE, GetCppTypeForFieldType(FD::TYPE_GROUP )); + EXPECT_EQ(FD::CPPTYPE_MESSAGE, GetCppTypeForFieldType(FD::TYPE_MESSAGE )); + EXPECT_EQ(FD::CPPTYPE_STRING , GetCppTypeForFieldType(FD::TYPE_BYTES )); + EXPECT_EQ(FD::CPPTYPE_UINT32 , GetCppTypeForFieldType(FD::TYPE_UINT32 )); + EXPECT_EQ(FD::CPPTYPE_ENUM , GetCppTypeForFieldType(FD::TYPE_ENUM )); + EXPECT_EQ(FD::CPPTYPE_INT32 , GetCppTypeForFieldType(FD::TYPE_SFIXED32)); + EXPECT_EQ(FD::CPPTYPE_INT64 , GetCppTypeForFieldType(FD::TYPE_SFIXED64)); + EXPECT_EQ(FD::CPPTYPE_INT32 , GetCppTypeForFieldType(FD::TYPE_SINT32 )); + EXPECT_EQ(FD::CPPTYPE_INT64 , GetCppTypeForFieldType(FD::TYPE_SINT64 )); +} + +TEST_F(MiscTest, CppTypeNames) { + // Test that correct CPP type names are returned. + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_STREQ("double" , GetCppTypeNameForFieldType(FD::TYPE_DOUBLE )); + EXPECT_STREQ("float" , GetCppTypeNameForFieldType(FD::TYPE_FLOAT )); + EXPECT_STREQ("int64" , GetCppTypeNameForFieldType(FD::TYPE_INT64 )); + EXPECT_STREQ("uint64" , GetCppTypeNameForFieldType(FD::TYPE_UINT64 )); + EXPECT_STREQ("int32" , GetCppTypeNameForFieldType(FD::TYPE_INT32 )); + EXPECT_STREQ("uint64" , GetCppTypeNameForFieldType(FD::TYPE_FIXED64 )); + EXPECT_STREQ("uint32" , GetCppTypeNameForFieldType(FD::TYPE_FIXED32 )); + EXPECT_STREQ("bool" , GetCppTypeNameForFieldType(FD::TYPE_BOOL )); + EXPECT_STREQ("string" , GetCppTypeNameForFieldType(FD::TYPE_STRING )); + EXPECT_STREQ("message", GetCppTypeNameForFieldType(FD::TYPE_GROUP )); + EXPECT_STREQ("message", GetCppTypeNameForFieldType(FD::TYPE_MESSAGE )); + EXPECT_STREQ("string" , GetCppTypeNameForFieldType(FD::TYPE_BYTES )); + EXPECT_STREQ("uint32" , GetCppTypeNameForFieldType(FD::TYPE_UINT32 )); + EXPECT_STREQ("enum" , GetCppTypeNameForFieldType(FD::TYPE_ENUM )); + EXPECT_STREQ("int32" , GetCppTypeNameForFieldType(FD::TYPE_SFIXED32)); + EXPECT_STREQ("int64" , GetCppTypeNameForFieldType(FD::TYPE_SFIXED64)); + EXPECT_STREQ("int32" , GetCppTypeNameForFieldType(FD::TYPE_SINT32 )); + EXPECT_STREQ("int64" , GetCppTypeNameForFieldType(FD::TYPE_SINT64 )); +} + +TEST_F(MiscTest, StaticCppTypeNames) { + // Test that correct CPP type names are returned. + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_STREQ("int32" , FD::CppTypeName(FD::CPPTYPE_INT32 )); + EXPECT_STREQ("int64" , FD::CppTypeName(FD::CPPTYPE_INT64 )); + EXPECT_STREQ("uint32" , FD::CppTypeName(FD::CPPTYPE_UINT32 )); + EXPECT_STREQ("uint64" , FD::CppTypeName(FD::CPPTYPE_UINT64 )); + EXPECT_STREQ("double" , FD::CppTypeName(FD::CPPTYPE_DOUBLE )); + EXPECT_STREQ("float" , FD::CppTypeName(FD::CPPTYPE_FLOAT )); + EXPECT_STREQ("bool" , FD::CppTypeName(FD::CPPTYPE_BOOL )); + EXPECT_STREQ("enum" , FD::CppTypeName(FD::CPPTYPE_ENUM )); + EXPECT_STREQ("string" , FD::CppTypeName(FD::CPPTYPE_STRING )); + EXPECT_STREQ("message", FD::CppTypeName(FD::CPPTYPE_MESSAGE)); +} + +TEST_F(MiscTest, MessageType) { + // Test that message_type() is NULL for non-aggregate fields + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_DOUBLE )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_FLOAT )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_INT64 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_UINT64 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_INT32 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_FIXED64 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_FIXED32 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_BOOL )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_STRING )); + EXPECT_TRUE(NULL != GetMessageDescriptorForFieldType(FD::TYPE_GROUP )); + EXPECT_TRUE(NULL != GetMessageDescriptorForFieldType(FD::TYPE_MESSAGE )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_BYTES )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_UINT32 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_ENUM )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_SFIXED32)); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_SFIXED64)); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_SINT32 )); + EXPECT_TRUE(NULL == GetMessageDescriptorForFieldType(FD::TYPE_SINT64 )); +} + +TEST_F(MiscTest, EnumType) { + // Test that enum_type() is NULL for non-enum fields + + typedef FieldDescriptor FD; // avoid ugly line wrapping + + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_DOUBLE )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_FLOAT )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_INT64 )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_UINT64 )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_INT32 )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_FIXED64 )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_FIXED32 )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_BOOL )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_STRING )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_GROUP )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_MESSAGE )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_BYTES )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_UINT32 )); + EXPECT_TRUE(NULL != GetEnumDescriptorForFieldType(FD::TYPE_ENUM )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_SFIXED32)); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_SFIXED64)); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_SINT32 )); + EXPECT_TRUE(NULL == GetEnumDescriptorForFieldType(FD::TYPE_SINT64 )); +} + + +TEST_F(MiscTest, DefaultValues) { + // Test that setting default values works. + FileDescriptorProto file_proto; + file_proto.set_name("foo.proto"); + + EnumDescriptorProto* enum_type_proto = AddEnum(&file_proto, "DummyEnum"); + AddEnumValue(enum_type_proto, "A", 1); + AddEnumValue(enum_type_proto, "B", 2); + + DescriptorProto* message_proto = AddMessage(&file_proto, "TestMessage"); + + typedef FieldDescriptorProto FD; // avoid ugly line wrapping + const FD::Label label = FD::LABEL_OPTIONAL; + + // Create fields of every CPP type with default values. + AddField(message_proto, "int32" , 1, label, FD::TYPE_INT32 ) + ->set_default_value("-1"); + AddField(message_proto, "int64" , 2, label, FD::TYPE_INT64 ) + ->set_default_value("-1000000000000"); + AddField(message_proto, "uint32", 3, label, FD::TYPE_UINT32) + ->set_default_value("42"); + AddField(message_proto, "uint64", 4, label, FD::TYPE_UINT64) + ->set_default_value("2000000000000"); + AddField(message_proto, "float" , 5, label, FD::TYPE_FLOAT ) + ->set_default_value("4.5"); + AddField(message_proto, "double", 6, label, FD::TYPE_DOUBLE) + ->set_default_value("10e100"); + AddField(message_proto, "bool" , 7, label, FD::TYPE_BOOL ) + ->set_default_value("true"); + AddField(message_proto, "string", 8, label, FD::TYPE_STRING) + ->set_default_value("hello"); + AddField(message_proto, "data" , 9, label, FD::TYPE_BYTES ) + ->set_default_value("\\001\\002\\003"); + + FieldDescriptorProto* enum_field = + AddField(message_proto, "enum", 10, label, FD::TYPE_ENUM); + enum_field->set_type_name("DummyEnum"); + enum_field->set_default_value("B"); + + // Strings are allowed to have empty defaults. (At one point, due to + // a bug, empty defaults for strings were rejected. Oops.) + AddField(message_proto, "empty_string", 11, label, FD::TYPE_STRING) + ->set_default_value(""); + + // Add a second set of fields with implicit defalut values. + AddField(message_proto, "implicit_int32" , 21, label, FD::TYPE_INT32 ); + AddField(message_proto, "implicit_int64" , 22, label, FD::TYPE_INT64 ); + AddField(message_proto, "implicit_uint32", 23, label, FD::TYPE_UINT32); + AddField(message_proto, "implicit_uint64", 24, label, FD::TYPE_UINT64); + AddField(message_proto, "implicit_float" , 25, label, FD::TYPE_FLOAT ); + AddField(message_proto, "implicit_double", 26, label, FD::TYPE_DOUBLE); + AddField(message_proto, "implicit_bool" , 27, label, FD::TYPE_BOOL ); + AddField(message_proto, "implicit_string", 28, label, FD::TYPE_STRING); + AddField(message_proto, "implicit_data" , 29, label, FD::TYPE_BYTES ); + AddField(message_proto, "implicit_enum" , 30, label, FD::TYPE_ENUM) + ->set_type_name("DummyEnum"); + + // Build it. + DescriptorPool pool; + const FileDescriptor* file = pool.BuildFile(file_proto); + ASSERT_TRUE(file != NULL); + + ASSERT_EQ(1, file->enum_type_count()); + const EnumDescriptor* enum_type = file->enum_type(0); + ASSERT_EQ(2, enum_type->value_count()); + const EnumValueDescriptor* enum_value_a = enum_type->value(0); + const EnumValueDescriptor* enum_value_b = enum_type->value(1); + + ASSERT_EQ(1, file->message_type_count()); + const Descriptor* message = file->message_type(0); + + ASSERT_EQ(21, message->field_count()); + + // Check the default values. + ASSERT_TRUE(message->field(0)->has_default_value()); + ASSERT_TRUE(message->field(1)->has_default_value()); + ASSERT_TRUE(message->field(2)->has_default_value()); + ASSERT_TRUE(message->field(3)->has_default_value()); + ASSERT_TRUE(message->field(4)->has_default_value()); + ASSERT_TRUE(message->field(5)->has_default_value()); + ASSERT_TRUE(message->field(6)->has_default_value()); + ASSERT_TRUE(message->field(7)->has_default_value()); + ASSERT_TRUE(message->field(8)->has_default_value()); + ASSERT_TRUE(message->field(9)->has_default_value()); + ASSERT_TRUE(message->field(10)->has_default_value()); + + EXPECT_EQ(-1 , message->field(0)->default_value_int32 ()); + EXPECT_EQ(-GOOGLE_ULONGLONG(1000000000000), + message->field(1)->default_value_int64 ()); + EXPECT_EQ(42 , message->field(2)->default_value_uint32()); + EXPECT_EQ(GOOGLE_ULONGLONG(2000000000000), + message->field(3)->default_value_uint64()); + EXPECT_EQ(4.5 , message->field(4)->default_value_float ()); + EXPECT_EQ(10e100 , message->field(5)->default_value_double()); + EXPECT_TRUE( message->field(6)->default_value_bool ()); + EXPECT_EQ("hello" , message->field(7)->default_value_string()); + EXPECT_EQ("\001\002\003" , message->field(8)->default_value_string()); + EXPECT_EQ(enum_value_b , message->field(9)->default_value_enum ()); + EXPECT_EQ("" , message->field(10)->default_value_string()); + + ASSERT_FALSE(message->field(11)->has_default_value()); + ASSERT_FALSE(message->field(12)->has_default_value()); + ASSERT_FALSE(message->field(13)->has_default_value()); + ASSERT_FALSE(message->field(14)->has_default_value()); + ASSERT_FALSE(message->field(15)->has_default_value()); + ASSERT_FALSE(message->field(16)->has_default_value()); + ASSERT_FALSE(message->field(17)->has_default_value()); + ASSERT_FALSE(message->field(18)->has_default_value()); + ASSERT_FALSE(message->field(19)->has_default_value()); + ASSERT_FALSE(message->field(20)->has_default_value()); + + EXPECT_EQ(0 , message->field(11)->default_value_int32 ()); + EXPECT_EQ(0 , message->field(12)->default_value_int64 ()); + EXPECT_EQ(0 , message->field(13)->default_value_uint32()); + EXPECT_EQ(0 , message->field(14)->default_value_uint64()); + EXPECT_EQ(0.0f , message->field(15)->default_value_float ()); + EXPECT_EQ(0.0 , message->field(16)->default_value_double()); + EXPECT_FALSE( message->field(17)->default_value_bool ()); + EXPECT_EQ("" , message->field(18)->default_value_string()); + EXPECT_EQ("" , message->field(19)->default_value_string()); + EXPECT_EQ(enum_value_a, message->field(20)->default_value_enum()); +} + +TEST_F(MiscTest, FieldOptions) { + // Try setting field options. + + FileDescriptorProto file_proto; + file_proto.set_name("foo.proto"); + + DescriptorProto* message_proto = AddMessage(&file_proto, "TestMessage"); + AddField(message_proto, "foo", 1, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + FieldDescriptorProto* bar_proto = + AddField(message_proto, "bar", 2, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + + FieldOptions* options = bar_proto->mutable_options(); + options->set_ctype(FieldOptions::CORD); + + // Build the descriptors and get the pointers. + DescriptorPool pool; + const FileDescriptor* file = pool.BuildFile(file_proto); + ASSERT_TRUE(file != NULL); + + ASSERT_EQ(1, file->message_type_count()); + const Descriptor* message = file->message_type(0); + + ASSERT_EQ(2, message->field_count()); + const FieldDescriptor* foo = message->field(0); + const FieldDescriptor* bar = message->field(1); + + // "foo" had no options set, so it should return the default options. + EXPECT_EQ(&FieldOptions::default_instance(), &foo->options()); + + // "bar" had options set. + EXPECT_NE(&FieldOptions::default_instance(), options); + EXPECT_TRUE(bar->options().has_ctype()); + EXPECT_EQ(FieldOptions::CORD, bar->options().ctype()); +} + +// =================================================================== +enum DescriptorPoolMode { + NO_DATABASE, + FALLBACK_DATABASE +}; + +class AllowUnknownDependenciesTest + : public testing::TestWithParam { + protected: + DescriptorPoolMode mode() { + return GetParam(); + } + + virtual void SetUp() { + FileDescriptorProto foo_proto, bar_proto; + + switch (mode()) { + case NO_DATABASE: + pool_.reset(new DescriptorPool); + break; + case FALLBACK_DATABASE: + pool_.reset(new DescriptorPool(&db_)); + break; + } + + pool_->AllowUnknownDependencies(); + + ASSERT_TRUE(TextFormat::ParseFromString( + "name: 'foo.proto'" + "dependency: 'bar.proto'" + "dependency: 'baz.proto'" + "message_type {" + " name: 'Foo'" + " field { name:'bar' number:1 label:LABEL_OPTIONAL type_name:'Bar' }" + " field { name:'baz' number:2 label:LABEL_OPTIONAL type_name:'Baz' }" + " field { name:'qux' number:3 label:LABEL_OPTIONAL" + " type_name: '.corge.Qux'" + " type: TYPE_ENUM" + " options {" + " uninterpreted_option {" + " name {" + " name_part: 'grault'" + " is_extension: true" + " }" + " positive_int_value: 1234" + " }" + " }" + " }" + "}", + &foo_proto)); + ASSERT_TRUE(TextFormat::ParseFromString( + "name: 'bar.proto'" + "message_type { name: 'Bar' }", + &bar_proto)); + + // Collect pointers to stuff. + bar_file_ = BuildFile(bar_proto); + ASSERT_TRUE(bar_file_ != NULL); + + ASSERT_EQ(1, bar_file_->message_type_count()); + bar_type_ = bar_file_->message_type(0); + + foo_file_ = BuildFile(foo_proto); + ASSERT_TRUE(foo_file_ != NULL); + + ASSERT_EQ(1, foo_file_->message_type_count()); + foo_type_ = foo_file_->message_type(0); + + ASSERT_EQ(3, foo_type_->field_count()); + bar_field_ = foo_type_->field(0); + baz_field_ = foo_type_->field(1); + qux_field_ = foo_type_->field(2); + } + + const FileDescriptor* BuildFile(const FileDescriptorProto& proto) { + switch (mode()) { + case NO_DATABASE: + return pool_->BuildFile(proto); + break; + case FALLBACK_DATABASE: { + EXPECT_TRUE(db_.Add(proto)); + return pool_->FindFileByName(proto.name()); + } + } + GOOGLE_LOG(FATAL) << "Can't get here."; + return NULL; + } + + const FileDescriptor* bar_file_; + const Descriptor* bar_type_; + const FileDescriptor* foo_file_; + const Descriptor* foo_type_; + const FieldDescriptor* bar_field_; + const FieldDescriptor* baz_field_; + const FieldDescriptor* qux_field_; + + SimpleDescriptorDatabase db_; // used if in FALLBACK_DATABASE mode. + google::protobuf::scoped_ptr pool_; +}; + +TEST_P(AllowUnknownDependenciesTest, PlaceholderFile) { + ASSERT_EQ(2, foo_file_->dependency_count()); + EXPECT_EQ(bar_file_, foo_file_->dependency(0)); + EXPECT_FALSE(bar_file_->is_placeholder()); + + const FileDescriptor* baz_file = foo_file_->dependency(1); + EXPECT_EQ("baz.proto", baz_file->name()); + EXPECT_EQ(0, baz_file->message_type_count()); + EXPECT_TRUE(baz_file->is_placeholder()); + + // Placeholder files should not be findable. + EXPECT_EQ(bar_file_, pool_->FindFileByName(bar_file_->name())); + EXPECT_TRUE(pool_->FindFileByName(baz_file->name()) == NULL); + + // Copy*To should not crash for placeholder files. + FileDescriptorProto baz_file_proto; + baz_file->CopyTo(&baz_file_proto); + baz_file->CopySourceCodeInfoTo(&baz_file_proto); + EXPECT_FALSE(baz_file_proto.has_source_code_info()); +} + +TEST_P(AllowUnknownDependenciesTest, PlaceholderTypes) { + ASSERT_EQ(FieldDescriptor::TYPE_MESSAGE, bar_field_->type()); + EXPECT_EQ(bar_type_, bar_field_->message_type()); + EXPECT_FALSE(bar_type_->is_placeholder()); + + ASSERT_EQ(FieldDescriptor::TYPE_MESSAGE, baz_field_->type()); + const Descriptor* baz_type = baz_field_->message_type(); + EXPECT_EQ("Baz", baz_type->name()); + EXPECT_EQ("Baz", baz_type->full_name()); + EXPECT_EQ(0, baz_type->extension_range_count()); + EXPECT_TRUE(baz_type->is_placeholder()); + + ASSERT_EQ(FieldDescriptor::TYPE_ENUM, qux_field_->type()); + const EnumDescriptor* qux_type = qux_field_->enum_type(); + EXPECT_EQ("Qux", qux_type->name()); + EXPECT_EQ("corge.Qux", qux_type->full_name()); + EXPECT_TRUE(qux_type->is_placeholder()); + + // Placeholder types should not be findable. + EXPECT_EQ(bar_type_, pool_->FindMessageTypeByName(bar_type_->full_name())); + EXPECT_TRUE(pool_->FindMessageTypeByName(baz_type->full_name()) == NULL); + EXPECT_TRUE(pool_->FindEnumTypeByName(qux_type->full_name()) == NULL); +} + +TEST_P(AllowUnknownDependenciesTest, CopyTo) { + // FieldDescriptor::CopyTo() should write non-fully-qualified type names + // for placeholder types which were not originally fully-qualified. + FieldDescriptorProto proto; + + // Bar is not a placeholder, so it is fully-qualified. + bar_field_->CopyTo(&proto); + EXPECT_EQ(".Bar", proto.type_name()); + EXPECT_EQ(FieldDescriptorProto::TYPE_MESSAGE, proto.type()); + + // Baz is an unqualified placeholder. + proto.Clear(); + baz_field_->CopyTo(&proto); + EXPECT_EQ("Baz", proto.type_name()); + EXPECT_FALSE(proto.has_type()); + + // Qux is a fully-qualified placeholder. + proto.Clear(); + qux_field_->CopyTo(&proto); + EXPECT_EQ(".corge.Qux", proto.type_name()); + EXPECT_EQ(FieldDescriptorProto::TYPE_ENUM, proto.type()); +} + +TEST_P(AllowUnknownDependenciesTest, CustomOptions) { + // Qux should still have the uninterpreted option attached. + ASSERT_EQ(1, qux_field_->options().uninterpreted_option_size()); + const UninterpretedOption& option = + qux_field_->options().uninterpreted_option(0); + ASSERT_EQ(1, option.name_size()); + EXPECT_EQ("grault", option.name(0).name_part()); +} + +TEST_P(AllowUnknownDependenciesTest, UnknownExtendee) { + // Test that we can extend an unknown type. This is slightly tricky because + // it means that the placeholder type must have an extension range. + + FileDescriptorProto extension_proto; + + ASSERT_TRUE(TextFormat::ParseFromString( + "name: 'extension.proto'" + "extension { extendee: 'UnknownType' name:'some_extension' number:123" + " label:LABEL_OPTIONAL type:TYPE_INT32 }", + &extension_proto)); + const FileDescriptor* file = BuildFile(extension_proto); + + ASSERT_TRUE(file != NULL); + + ASSERT_EQ(1, file->extension_count()); + const Descriptor* extendee = file->extension(0)->containing_type(); + EXPECT_EQ("UnknownType", extendee->name()); + EXPECT_TRUE(extendee->is_placeholder()); + ASSERT_EQ(1, extendee->extension_range_count()); + EXPECT_EQ(1, extendee->extension_range(0)->start); + EXPECT_EQ(FieldDescriptor::kMaxNumber + 1, extendee->extension_range(0)->end); +} + +TEST_P(AllowUnknownDependenciesTest, CustomOption) { + // Test that we can use a custom option without having parsed + // descriptor.proto. + + FileDescriptorProto option_proto; + + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"unknown_custom_options.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { " + " extendee: \"google.protobuf.FileOptions\" " + " name: \"some_option\" " + " number: 123456 " + " label: LABEL_OPTIONAL " + " type: TYPE_INT32 " + "} " + "options { " + " uninterpreted_option { " + " name { " + " name_part: \"some_option\" " + " is_extension: true " + " } " + " positive_int_value: 1234 " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"unknown_option\" " + " is_extension: true " + " } " + " positive_int_value: 1234 " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"optimize_for\" " + " is_extension: false " + " } " + " identifier_value: \"SPEED\" " + " } " + "}", + &option_proto)); + + const FileDescriptor* file = BuildFile(option_proto); + ASSERT_TRUE(file != NULL); + + // Verify that no extension options were set, but they were left as + // uninterpreted_options. + vector fields; + file->options().GetReflection()->ListFields(file->options(), &fields); + ASSERT_EQ(2, fields.size()); + EXPECT_TRUE(file->options().has_optimize_for()); + EXPECT_EQ(2, file->options().uninterpreted_option_size()); +} + +TEST_P(AllowUnknownDependenciesTest, + UndeclaredDependencyTriggersBuildOfDependency) { + // Crazy case: suppose foo.proto refers to a symbol without declaring the + // dependency that finds it. In the event that the pool is backed by a + // DescriptorDatabase, the pool will attempt to find the symbol in the + // database. If successful, it will build the undeclared dependency to verify + // that the file does indeed contain the symbol. If that file fails to build, + // then its descriptors must be rolled back. However, we still want foo.proto + // to build successfully, since we are allowing unknown dependencies. + + FileDescriptorProto undeclared_dep_proto; + // We make this file fail to build by giving it two fields with tag 1. + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"invalid_file_as_undeclared_dep.proto\" " + "package: \"undeclared\" " + "message_type: { " + " name: \"Quux\" " + " field { " + " name:'qux' number:1 label:LABEL_OPTIONAL type: TYPE_INT32 " + " }" + " field { " + " name:'quux' number:1 label:LABEL_OPTIONAL type: TYPE_INT64 " + " }" + "}", + &undeclared_dep_proto)); + // We can't use the BuildFile() helper because we don't actually want to build + // it into the descriptor pool in the fallback database case: it just needs to + // be sitting in the database so that it gets built during the building of + // test.proto below. + switch (mode()) { + case NO_DATABASE: { + ASSERT_TRUE(pool_->BuildFile(undeclared_dep_proto) == NULL); + break; + } + case FALLBACK_DATABASE: { + ASSERT_TRUE(db_.Add(undeclared_dep_proto)); + } + } + + FileDescriptorProto test_proto; + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"test.proto\" " + "message_type: { " + " name: \"Corge\" " + " field { " + " name:'quux' number:1 label: LABEL_OPTIONAL " + " type_name:'undeclared.Quux' type: TYPE_MESSAGE " + " }" + "}", + &test_proto)); + + const FileDescriptor* file = BuildFile(test_proto); + ASSERT_TRUE(file != NULL); + GOOGLE_LOG(INFO) << file->DebugString(); + + EXPECT_EQ(0, file->dependency_count()); + ASSERT_EQ(1, file->message_type_count()); + const Descriptor* corge_desc = file->message_type(0); + ASSERT_EQ("Corge", corge_desc->name()); + ASSERT_EQ(1, corge_desc->field_count()); + EXPECT_FALSE(corge_desc->is_placeholder()); + + const FieldDescriptor* quux_field = corge_desc->field(0); + ASSERT_EQ(FieldDescriptor::TYPE_MESSAGE, quux_field->type()); + ASSERT_EQ("Quux", quux_field->message_type()->name()); + ASSERT_EQ("undeclared.Quux", quux_field->message_type()->full_name()); + EXPECT_TRUE(quux_field->message_type()->is_placeholder()); + // The place holder type should not be findable. + ASSERT_TRUE(pool_->FindMessageTypeByName("undeclared.Quux") == NULL); +} + +INSTANTIATE_TEST_CASE_P(DatabaseSource, + AllowUnknownDependenciesTest, + testing::Values(NO_DATABASE, FALLBACK_DATABASE)); + +// =================================================================== + +TEST(CustomOptions, OptionLocations) { + const Descriptor* message = + protobuf_unittest::TestMessageWithCustomOptions::descriptor(); + const FileDescriptor* file = message->file(); + const FieldDescriptor* field = message->FindFieldByName("field1"); + const EnumDescriptor* enm = message->FindEnumTypeByName("AnEnum"); + // TODO(benjy): Support EnumValue options, once the compiler does. + const ServiceDescriptor* service = + file->FindServiceByName("TestServiceWithCustomOptions"); + const MethodDescriptor* method = service->FindMethodByName("Foo"); + + EXPECT_EQ(GOOGLE_LONGLONG(9876543210), + file->options().GetExtension(protobuf_unittest::file_opt1)); + EXPECT_EQ(-56, + message->options().GetExtension(protobuf_unittest::message_opt1)); + EXPECT_EQ(GOOGLE_LONGLONG(8765432109), + field->options().GetExtension(protobuf_unittest::field_opt1)); + EXPECT_EQ(42, // Check that we get the default for an option we don't set. + field->options().GetExtension(protobuf_unittest::field_opt2)); + EXPECT_EQ(-789, + enm->options().GetExtension(protobuf_unittest::enum_opt1)); + EXPECT_EQ(123, + enm->value(1)->options().GetExtension( + protobuf_unittest::enum_value_opt1)); + EXPECT_EQ(GOOGLE_LONGLONG(-9876543210), + service->options().GetExtension(protobuf_unittest::service_opt1)); + EXPECT_EQ(protobuf_unittest::METHODOPT1_VAL2, + method->options().GetExtension(protobuf_unittest::method_opt1)); + + // See that the regular options went through unscathed. + EXPECT_TRUE(message->options().has_message_set_wire_format()); + EXPECT_EQ(FieldOptions::CORD, field->options().ctype()); +} + +TEST(CustomOptions, OptionTypes) { + const MessageOptions* options = NULL; + + options = + &protobuf_unittest::CustomOptionMinIntegerValues::descriptor()->options(); + EXPECT_EQ(false , options->GetExtension(protobuf_unittest::bool_opt)); + EXPECT_EQ(kint32min, options->GetExtension(protobuf_unittest::int32_opt)); + EXPECT_EQ(kint64min, options->GetExtension(protobuf_unittest::int64_opt)); + EXPECT_EQ(0 , options->GetExtension(protobuf_unittest::uint32_opt)); + EXPECT_EQ(0 , options->GetExtension(protobuf_unittest::uint64_opt)); + EXPECT_EQ(kint32min, options->GetExtension(protobuf_unittest::sint32_opt)); + EXPECT_EQ(kint64min, options->GetExtension(protobuf_unittest::sint64_opt)); + EXPECT_EQ(0 , options->GetExtension(protobuf_unittest::fixed32_opt)); + EXPECT_EQ(0 , options->GetExtension(protobuf_unittest::fixed64_opt)); + EXPECT_EQ(kint32min, options->GetExtension(protobuf_unittest::sfixed32_opt)); + EXPECT_EQ(kint64min, options->GetExtension(protobuf_unittest::sfixed64_opt)); + + options = + &protobuf_unittest::CustomOptionMaxIntegerValues::descriptor()->options(); + EXPECT_EQ(true , options->GetExtension(protobuf_unittest::bool_opt)); + EXPECT_EQ(kint32max , options->GetExtension(protobuf_unittest::int32_opt)); + EXPECT_EQ(kint64max , options->GetExtension(protobuf_unittest::int64_opt)); + EXPECT_EQ(kuint32max, options->GetExtension(protobuf_unittest::uint32_opt)); + EXPECT_EQ(kuint64max, options->GetExtension(protobuf_unittest::uint64_opt)); + EXPECT_EQ(kint32max , options->GetExtension(protobuf_unittest::sint32_opt)); + EXPECT_EQ(kint64max , options->GetExtension(protobuf_unittest::sint64_opt)); + EXPECT_EQ(kuint32max, options->GetExtension(protobuf_unittest::fixed32_opt)); + EXPECT_EQ(kuint64max, options->GetExtension(protobuf_unittest::fixed64_opt)); + EXPECT_EQ(kint32max , options->GetExtension(protobuf_unittest::sfixed32_opt)); + EXPECT_EQ(kint64max , options->GetExtension(protobuf_unittest::sfixed64_opt)); + + options = + &protobuf_unittest::CustomOptionOtherValues::descriptor()->options(); + EXPECT_EQ(-100, options->GetExtension(protobuf_unittest::int32_opt)); + EXPECT_FLOAT_EQ(12.3456789, + options->GetExtension(protobuf_unittest::float_opt)); + EXPECT_DOUBLE_EQ(1.234567890123456789, + options->GetExtension(protobuf_unittest::double_opt)); + EXPECT_EQ("Hello, \"World\"", + options->GetExtension(protobuf_unittest::string_opt)); + + EXPECT_EQ(string("Hello\0World", 11), + options->GetExtension(protobuf_unittest::bytes_opt)); + + EXPECT_EQ(protobuf_unittest::DummyMessageContainingEnum::TEST_OPTION_ENUM_TYPE2, + options->GetExtension(protobuf_unittest::enum_opt)); + + options = + &protobuf_unittest::SettingRealsFromPositiveInts::descriptor()->options(); + EXPECT_FLOAT_EQ(12, options->GetExtension(protobuf_unittest::float_opt)); + EXPECT_DOUBLE_EQ(154, options->GetExtension(protobuf_unittest::double_opt)); + + options = + &protobuf_unittest::SettingRealsFromNegativeInts::descriptor()->options(); + EXPECT_FLOAT_EQ(-12, options->GetExtension(protobuf_unittest::float_opt)); + EXPECT_DOUBLE_EQ(-154, options->GetExtension(protobuf_unittest::double_opt)); +} + +TEST(CustomOptions, ComplexExtensionOptions) { + const MessageOptions* options = + &protobuf_unittest::VariousComplexOptions::descriptor()->options(); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt1).foo(), 42); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt1). + GetExtension(protobuf_unittest::quux), 324); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt1). + GetExtension(protobuf_unittest::corge).qux(), 876); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2).baz(), 987); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2). + GetExtension(protobuf_unittest::grault), 654); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2).bar().foo(), + 743); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2).bar(). + GetExtension(protobuf_unittest::quux), 1999); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2).bar(). + GetExtension(protobuf_unittest::corge).qux(), 2008); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2). + GetExtension(protobuf_unittest::garply).foo(), 741); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2). + GetExtension(protobuf_unittest::garply). + GetExtension(protobuf_unittest::quux), 1998); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2). + GetExtension(protobuf_unittest::garply). + GetExtension(protobuf_unittest::corge).qux(), 2121); + EXPECT_EQ(options->GetExtension( + protobuf_unittest::ComplexOptionType2::ComplexOptionType4::complex_opt4). + waldo(), 1971); + EXPECT_EQ(options->GetExtension(protobuf_unittest::complex_opt2). + fred().waldo(), 321); + EXPECT_EQ(9, options->GetExtension(protobuf_unittest::complex_opt3).qux()); + EXPECT_EQ(22, options->GetExtension(protobuf_unittest::complex_opt3). + complexoptiontype5().plugh()); + EXPECT_EQ(24, options->GetExtension(protobuf_unittest::complexopt6).xyzzy()); +} + +TEST(CustomOptions, OptionsFromOtherFile) { + // Test that to use a custom option, we only need to import the file + // defining the option; we do not also have to import descriptor.proto. + DescriptorPool pool; + + FileDescriptorProto file_proto; + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + protobuf_unittest::TestMessageWithCustomOptions::descriptor() + ->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"custom_options_import.proto\" " + "package: \"protobuf_unittest\" " + "dependency: \"google/protobuf/unittest_custom_options.proto\" " + "options { " + " uninterpreted_option { " + " name { " + " name_part: \"file_opt1\" " + " is_extension: true " + " } " + " positive_int_value: 1234 " + " } " + // Test a non-extension option too. (At one point this failed due to a + // bug.) + " uninterpreted_option { " + " name { " + " name_part: \"java_package\" " + " is_extension: false " + " } " + " string_value: \"foo\" " + " } " + // Test that enum-typed options still work too. (At one point this also + // failed due to a bug.) + " uninterpreted_option { " + " name { " + " name_part: \"optimize_for\" " + " is_extension: false " + " } " + " identifier_value: \"SPEED\" " + " } " + "}" + , + &file_proto)); + + const FileDescriptor* file = pool.BuildFile(file_proto); + ASSERT_TRUE(file != NULL); + EXPECT_EQ(1234, file->options().GetExtension(protobuf_unittest::file_opt1)); + EXPECT_TRUE(file->options().has_java_package()); + EXPECT_EQ("foo", file->options().java_package()); + EXPECT_TRUE(file->options().has_optimize_for()); + EXPECT_EQ(FileOptions::SPEED, file->options().optimize_for()); +} + +TEST(CustomOptions, MessageOptionThreeFieldsSet) { + // This tests a bug which previously existed in custom options parsing. The + // bug occurred when you defined a custom option with message type and then + // set three fields of that option on a single definition (see the example + // below). The bug is a bit hard to explain, so check the change history if + // you want to know more. + DescriptorPool pool; + + FileDescriptorProto file_proto; + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + protobuf_unittest::TestMessageWithCustomOptions::descriptor() + ->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + // The following represents the definition: + // + // import "google/protobuf/unittest_custom_options.proto" + // package protobuf_unittest; + // message Foo { + // option (complex_opt1).foo = 1234; + // option (complex_opt1).foo2 = 1234; + // option (complex_opt1).foo3 = 1234; + // } + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"custom_options_import.proto\" " + "package: \"protobuf_unittest\" " + "dependency: \"google/protobuf/unittest_custom_options.proto\" " + "message_type { " + " name: \"Foo\" " + " options { " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt1\" " + " is_extension: true " + " } " + " name { " + " name_part: \"foo\" " + " is_extension: false " + " } " + " positive_int_value: 1234 " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt1\" " + " is_extension: true " + " } " + " name { " + " name_part: \"foo2\" " + " is_extension: false " + " } " + " positive_int_value: 1234 " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt1\" " + " is_extension: true " + " } " + " name { " + " name_part: \"foo3\" " + " is_extension: false " + " } " + " positive_int_value: 1234 " + " } " + " } " + "}", + &file_proto)); + + const FileDescriptor* file = pool.BuildFile(file_proto); + ASSERT_TRUE(file != NULL); + ASSERT_EQ(1, file->message_type_count()); + + const MessageOptions& options = file->message_type(0)->options(); + EXPECT_EQ(1234, options.GetExtension(protobuf_unittest::complex_opt1).foo()); +} + +TEST(CustomOptions, MessageOptionRepeatedLeafFieldSet) { + // This test verifies that repeated fields in custom options can be + // given multiple values by repeating the option with a different value. + // This test checks repeated leaf values. Each repeated custom value + // appears in a different uninterpreted_option, which will be concatenated + // when they are merged into the final option value. + DescriptorPool pool; + + FileDescriptorProto file_proto; + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + protobuf_unittest::TestMessageWithCustomOptions::descriptor() + ->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + // The following represents the definition: + // + // import "google/protobuf/unittest_custom_options.proto" + // package protobuf_unittest; + // message Foo { + // option (complex_opt1).foo4 = 12; + // option (complex_opt1).foo4 = 34; + // option (complex_opt1).foo4 = 56; + // } + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"custom_options_import.proto\" " + "package: \"protobuf_unittest\" " + "dependency: \"google/protobuf/unittest_custom_options.proto\" " + "message_type { " + " name: \"Foo\" " + " options { " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt1\" " + " is_extension: true " + " } " + " name { " + " name_part: \"foo4\" " + " is_extension: false " + " } " + " positive_int_value: 12 " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt1\" " + " is_extension: true " + " } " + " name { " + " name_part: \"foo4\" " + " is_extension: false " + " } " + " positive_int_value: 34 " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt1\" " + " is_extension: true " + " } " + " name { " + " name_part: \"foo4\" " + " is_extension: false " + " } " + " positive_int_value: 56 " + " } " + " } " + "}", + &file_proto)); + + const FileDescriptor* file = pool.BuildFile(file_proto); + ASSERT_TRUE(file != NULL); + ASSERT_EQ(1, file->message_type_count()); + + const MessageOptions& options = file->message_type(0)->options(); + EXPECT_EQ(3, options.GetExtension(protobuf_unittest::complex_opt1).foo4_size()); + EXPECT_EQ(12, options.GetExtension(protobuf_unittest::complex_opt1).foo4(0)); + EXPECT_EQ(34, options.GetExtension(protobuf_unittest::complex_opt1).foo4(1)); + EXPECT_EQ(56, options.GetExtension(protobuf_unittest::complex_opt1).foo4(2)); +} + +TEST(CustomOptions, MessageOptionRepeatedMsgFieldSet) { + // This test verifies that repeated fields in custom options can be + // given multiple values by repeating the option with a different value. + // This test checks repeated message values. Each repeated custom value + // appears in a different uninterpreted_option, which will be concatenated + // when they are merged into the final option value. + DescriptorPool pool; + + FileDescriptorProto file_proto; + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + protobuf_unittest::TestMessageWithCustomOptions::descriptor() + ->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + // The following represents the definition: + // + // import "google/protobuf/unittest_custom_options.proto" + // package protobuf_unittest; + // message Foo { + // option (complex_opt2).barney = {waldo: 1}; + // option (complex_opt2).barney = {waldo: 10}; + // option (complex_opt2).barney = {waldo: 100}; + // } + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"custom_options_import.proto\" " + "package: \"protobuf_unittest\" " + "dependency: \"google/protobuf/unittest_custom_options.proto\" " + "message_type { " + " name: \"Foo\" " + " options { " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt2\" " + " is_extension: true " + " } " + " name { " + " name_part: \"barney\" " + " is_extension: false " + " } " + " aggregate_value: \"waldo: 1\" " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt2\" " + " is_extension: true " + " } " + " name { " + " name_part: \"barney\" " + " is_extension: false " + " } " + " aggregate_value: \"waldo: 10\" " + " } " + " uninterpreted_option { " + " name { " + " name_part: \"complex_opt2\" " + " is_extension: true " + " } " + " name { " + " name_part: \"barney\" " + " is_extension: false " + " } " + " aggregate_value: \"waldo: 100\" " + " } " + " } " + "}", + &file_proto)); + + const FileDescriptor* file = pool.BuildFile(file_proto); + ASSERT_TRUE(file != NULL); + ASSERT_EQ(1, file->message_type_count()); + + const MessageOptions& options = file->message_type(0)->options(); + EXPECT_EQ(3, options.GetExtension( + protobuf_unittest::complex_opt2).barney_size()); + EXPECT_EQ(1,options.GetExtension( + protobuf_unittest::complex_opt2).barney(0).waldo()); + EXPECT_EQ(10, options.GetExtension( + protobuf_unittest::complex_opt2).barney(1).waldo()); + EXPECT_EQ(100, options.GetExtension( + protobuf_unittest::complex_opt2).barney(2).waldo()); +} + +// Check that aggregate options were parsed and saved correctly in +// the appropriate descriptors. +TEST(CustomOptions, AggregateOptions) { + const Descriptor* msg = protobuf_unittest::AggregateMessage::descriptor(); + const FileDescriptor* file = msg->file(); + const FieldDescriptor* field = msg->FindFieldByName("fieldname"); + const EnumDescriptor* enumd = file->FindEnumTypeByName("AggregateEnum"); + const EnumValueDescriptor* enumv = enumd->FindValueByName("VALUE"); + const ServiceDescriptor* service = file->FindServiceByName( + "AggregateService"); + const MethodDescriptor* method = service->FindMethodByName("Method"); + + // Tests for the different types of data embedded in fileopt + const protobuf_unittest::Aggregate& file_options = + file->options().GetExtension(protobuf_unittest::fileopt); + EXPECT_EQ(100, file_options.i()); + EXPECT_EQ("FileAnnotation", file_options.s()); + EXPECT_EQ("NestedFileAnnotation", file_options.sub().s()); + EXPECT_EQ("FileExtensionAnnotation", + file_options.file().GetExtension(protobuf_unittest::fileopt).s()); + EXPECT_EQ("EmbeddedMessageSetElement", + file_options.mset().GetExtension( + protobuf_unittest::AggregateMessageSetElement + ::message_set_extension).s()); + + // Simple tests for all the other types of annotations + EXPECT_EQ("MessageAnnotation", + msg->options().GetExtension(protobuf_unittest::msgopt).s()); + EXPECT_EQ("FieldAnnotation", + field->options().GetExtension(protobuf_unittest::fieldopt).s()); + EXPECT_EQ("EnumAnnotation", + enumd->options().GetExtension(protobuf_unittest::enumopt).s()); + EXPECT_EQ("EnumValueAnnotation", + enumv->options().GetExtension(protobuf_unittest::enumvalopt).s()); + EXPECT_EQ("ServiceAnnotation", + service->options().GetExtension(protobuf_unittest::serviceopt).s()); + EXPECT_EQ("MethodAnnotation", + method->options().GetExtension(protobuf_unittest::methodopt).s()); +} + +TEST(CustomOptions, UnusedImportWarning) { + DescriptorPool pool; + + FileDescriptorProto file_proto; + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + protobuf_unittest::TestMessageWithCustomOptions::descriptor() + ->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + pool.AddUnusedImportTrackFile("custom_options_import.proto"); + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"custom_options_import.proto\" " + "package: \"protobuf_unittest\" " + "dependency: \"google/protobuf/unittest_custom_options.proto\" ", + &file_proto)); + + MockErrorCollector error_collector; + EXPECT_TRUE(pool.BuildFileCollectingErrors(file_proto, &error_collector)); + EXPECT_EQ("", error_collector.warning_text_); +} + +// Verifies that proto files can correctly be parsed, even if the +// custom options defined in the file are incompatible with those +// compiled in the binary. See http://b/19276250. +TEST(CustomOptions, OptionsWithRequiredEnums) { + DescriptorPool pool; + + FileDescriptorProto file_proto; + MessageOptions::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + // Create a new file descriptor proto containing a subset of the + // messages defined in google/protobuf/unittest_custom_options.proto. + file_proto.Clear(); + file_proto.set_name("unittest_custom_options.proto"); + file_proto.set_package("protobuf_unittest"); + file_proto.add_dependency("google/protobuf/descriptor.proto"); + + // Add the "required_enum_opt" extension. + FieldDescriptorProto* extension = file_proto.add_extension(); + protobuf_unittest::OldOptionType::descriptor()->file() + ->FindExtensionByName("required_enum_opt")->CopyTo(extension); + + // Add a test message that uses the "required_enum_opt" option. + DescriptorProto* test_message_type = file_proto.add_message_type(); + protobuf_unittest::TestMessageWithRequiredEnumOption::descriptor() + ->CopyTo(test_message_type); + + // Instruct the extension to use NewOptionType instead of + // OldOptionType, and add the descriptor of NewOptionType. + extension->set_type_name(".protobuf_unittest.NewOptionType"); + DescriptorProto* new_option_type = file_proto.add_message_type(); + protobuf_unittest::NewOptionType::descriptor() + ->CopyTo(new_option_type); + + // Replace the value of the "required_enum_opt" option used in the + // test message with an enum value that only exists in NewOptionType. + ASSERT_TRUE(TextFormat::ParseFromString( + "uninterpreted_option { " + " name { " + " name_part: 'required_enum_opt' " + " is_extension: true " + " } " + " aggregate_value: 'value: NEW_VALUE' " + "}", + test_message_type->mutable_options())); + + // Add the file descriptor to the pool. + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + // Find the test message. + const Descriptor* test_message = pool.FindMessageTypeByName( + "protobuf_unittest.TestMessageWithRequiredEnumOption"); + ASSERT_TRUE(test_message != NULL); + + const MessageOptions& options = test_message->options(); + // Extract the "required_enum_opt" option. Since the binary does not + // know that the extension was updated, this will still return an + // OldOptionType message. + ASSERT_TRUE( + options.HasExtension(protobuf_unittest::required_enum_opt)); + const protobuf_unittest::OldOptionType& old_enum_opt = + options.GetExtension(protobuf_unittest::required_enum_opt); + + // Confirm that the required enum field is missing. + EXPECT_FALSE(old_enum_opt.IsInitialized()); + EXPECT_FALSE(old_enum_opt.has_value()); + + string buf; + // Verify that the required enum field does show up when the option + // is re-parsed as a NewOptionType message; + protobuf_unittest::NewOptionType new_enum_opt; + EXPECT_TRUE(old_enum_opt.AppendPartialToString(&buf)); + EXPECT_TRUE(new_enum_opt.ParseFromString(buf)); + EXPECT_EQ(protobuf_unittest::NewOptionType::NEW_VALUE, new_enum_opt.value()); +} + +// =================================================================== + +class ValidationErrorTest : public testing::Test { + protected: + // Parse file_text as a FileDescriptorProto in text format and add it + // to the DescriptorPool. Expect no errors. + const FileDescriptor* BuildFile(const string& file_text) { + FileDescriptorProto file_proto; + EXPECT_TRUE(TextFormat::ParseFromString(file_text, &file_proto)); + return GOOGLE_CHECK_NOTNULL(pool_.BuildFile(file_proto)); + } + + // Parse file_text as a FileDescriptorProto in text format and add it + // to the DescriptorPool. Expect errors to be produced which match the + // given error text. + void BuildFileWithErrors(const string& file_text, + const string& expected_errors) { + FileDescriptorProto file_proto; + ASSERT_TRUE(TextFormat::ParseFromString(file_text, &file_proto)); + + MockErrorCollector error_collector; + EXPECT_TRUE( + pool_.BuildFileCollectingErrors(file_proto, &error_collector) == NULL); + EXPECT_EQ(expected_errors, error_collector.text_); + } + + // Parse file_text as a FileDescriptorProto in text format and add it + // to the DescriptorPool. Expect errors to be produced which match the + // given warning text. + void BuildFileWithWarnings(const string& file_text, + const string& expected_warnings) { + FileDescriptorProto file_proto; + ASSERT_TRUE(TextFormat::ParseFromString(file_text, &file_proto)); + + MockErrorCollector error_collector; + EXPECT_TRUE(pool_.BuildFileCollectingErrors(file_proto, &error_collector)); + EXPECT_EQ(expected_warnings, error_collector.warning_text_); + } + + // Builds some already-parsed file in our test pool. + void BuildFileInTestPool(const FileDescriptor* file) { + FileDescriptorProto file_proto; + file->CopyTo(&file_proto); + ASSERT_TRUE(pool_.BuildFile(file_proto) != NULL); + } + + // Build descriptor.proto in our test pool. This allows us to extend it in + // the test pool, so we can test custom options. + void BuildDescriptorMessagesInTestPool() { + BuildFileInTestPool(DescriptorProto::descriptor()->file()); + } + + DescriptorPool pool_; +}; + +TEST_F(ValidationErrorTest, AlreadyDefined) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" }" + "message_type { name: \"Foo\" }", + + "foo.proto: Foo: NAME: \"Foo\" is already defined.\n"); +} + +TEST_F(ValidationErrorTest, AlreadyDefinedInPackage) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "package: \"foo.bar\" " + "message_type { name: \"Foo\" }" + "message_type { name: \"Foo\" }", + + "foo.proto: foo.bar.Foo: NAME: \"Foo\" is already defined in " + "\"foo.bar\".\n"); +} + +TEST_F(ValidationErrorTest, AlreadyDefinedInOtherFile) { + BuildFile( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" }"); + + BuildFileWithErrors( + "name: \"bar.proto\" " + "message_type { name: \"Foo\" }", + + "bar.proto: Foo: NAME: \"Foo\" is already defined in file " + "\"foo.proto\".\n"); +} + +TEST_F(ValidationErrorTest, PackageAlreadyDefined) { + BuildFile( + "name: \"foo.proto\" " + "message_type { name: \"foo\" }"); + BuildFileWithErrors( + "name: \"bar.proto\" " + "package: \"foo.bar\"", + + "bar.proto: foo: NAME: \"foo\" is already defined (as something other " + "than a package) in file \"foo.proto\".\n"); +} + +TEST_F(ValidationErrorTest, EnumValueAlreadyDefinedInParent) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type { name: \"Foo\" value { name: \"FOO\" number: 1 } } " + "enum_type { name: \"Bar\" value { name: \"FOO\" number: 1 } } ", + + "foo.proto: FOO: NAME: \"FOO\" is already defined.\n" + "foo.proto: FOO: NAME: Note that enum values use C++ scoping rules, " + "meaning that enum values are siblings of their type, not children of " + "it. Therefore, \"FOO\" must be unique within the global scope, not " + "just within \"Bar\".\n"); +} + +TEST_F(ValidationErrorTest, EnumValueAlreadyDefinedInParentNonGlobal) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "package: \"pkg\" " + "enum_type { name: \"Foo\" value { name: \"FOO\" number: 1 } } " + "enum_type { name: \"Bar\" value { name: \"FOO\" number: 1 } } ", + + "foo.proto: pkg.FOO: NAME: \"FOO\" is already defined in \"pkg\".\n" + "foo.proto: pkg.FOO: NAME: Note that enum values use C++ scoping rules, " + "meaning that enum values are siblings of their type, not children of " + "it. Therefore, \"FOO\" must be unique within \"pkg\", not just within " + "\"Bar\".\n"); +} + +TEST_F(ValidationErrorTest, MissingName) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { }", + + "foo.proto: : NAME: Missing name.\n"); +} + +TEST_F(ValidationErrorTest, InvalidName) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"$\" }", + + "foo.proto: $: NAME: \"$\" is not a valid identifier.\n"); +} + +TEST_F(ValidationErrorTest, InvalidPackageName) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "package: \"foo.$\"", + + "foo.proto: foo.$: NAME: \"$\" is not a valid identifier.\n"); +} + +TEST_F(ValidationErrorTest, MissingFileName) { + BuildFileWithErrors( + "", + + ": : OTHER: Missing field: FileDescriptorProto.name.\n"); +} + +TEST_F(ValidationErrorTest, DupeDependency) { + BuildFile("name: \"foo.proto\""); + BuildFileWithErrors( + "name: \"bar.proto\" " + "dependency: \"foo.proto\" " + "dependency: \"foo.proto\" ", + + "bar.proto: bar.proto: OTHER: Import \"foo.proto\" was listed twice.\n"); +} + +TEST_F(ValidationErrorTest, UnknownDependency) { + BuildFileWithErrors( + "name: \"bar.proto\" " + "dependency: \"foo.proto\" ", + + "bar.proto: bar.proto: OTHER: Import \"foo.proto\" has not been loaded.\n"); +} + +TEST_F(ValidationErrorTest, InvalidPublicDependencyIndex) { + BuildFile("name: \"foo.proto\""); + BuildFileWithErrors( + "name: \"bar.proto\" " + "dependency: \"foo.proto\" " + "public_dependency: 1", + "bar.proto: bar.proto: OTHER: Invalid public dependency index.\n"); +} + +TEST_F(ValidationErrorTest, ForeignUnimportedPackageNoCrash) { + // Used to crash: If we depend on a non-existent file and then refer to a + // package defined in a file that we didn't import, and that package is + // nested within a parent package which this file is also in, and we don't + // include that parent package in the name (i.e. we do a relative lookup)... + // Yes, really. + BuildFile( + "name: 'foo.proto' " + "package: 'outer.foo' "); + BuildFileWithErrors( + "name: 'bar.proto' " + "dependency: 'baz.proto' " + "package: 'outer.bar' " + "message_type { " + " name: 'Bar' " + " field { name:'bar' number:1 label:LABEL_OPTIONAL type_name:'foo.Foo' }" + "}", + + "bar.proto: bar.proto: OTHER: Import \"baz.proto\" has not been loaded.\n" + "bar.proto: outer.bar.Bar.bar: TYPE: \"outer.foo\" seems to be defined in " + "\"foo.proto\", which is not imported by \"bar.proto\". To use it here, " + "please add the necessary import.\n"); +} + +TEST_F(ValidationErrorTest, DupeFile) { + BuildFile( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" }"); + // Note: We should *not* get redundant errors about "Foo" already being + // defined. + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" } " + // Add another type so that the files aren't identical (in which case there + // would be no error). + "enum_type { name: \"Bar\" }", + + "foo.proto: foo.proto: OTHER: A file with this name is already in the " + "pool.\n"); +} + +TEST_F(ValidationErrorTest, FieldInExtensionRange) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: 9 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name: \"bar\" number: 10 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name: \"baz\" number: 19 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name: \"qux\" number: 20 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " extension_range { start: 10 end: 20 }" + "}", + + "foo.proto: Foo.bar: NUMBER: Extension range 10 to 19 includes field " + "\"bar\" (10).\n" + "foo.proto: Foo.baz: NUMBER: Extension range 10 to 19 includes field " + "\"baz\" (19).\n"); +} + +TEST_F(ValidationErrorTest, OverlappingExtensionRanges) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension_range { start: 10 end: 20 }" + " extension_range { start: 20 end: 30 }" + " extension_range { start: 19 end: 21 }" + "}", + + "foo.proto: Foo: NUMBER: Extension range 19 to 20 overlaps with " + "already-defined range 10 to 19.\n" + "foo.proto: Foo: NUMBER: Extension range 19 to 20 overlaps with " + "already-defined range 20 to 29.\n"); +} + +TEST_F(ValidationErrorTest, ReservedFieldError) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: 15 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " reserved_range { start: 10 end: 20 }" + "}", + + "foo.proto: Foo.foo: NUMBER: Field \"foo\" uses reserved number 15.\n"); +} + +TEST_F(ValidationErrorTest, ReservedExtensionRangeError) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension_range { start: 10 end: 20 }" + " reserved_range { start: 5 end: 15 }" + "}", + + "foo.proto: Foo: NUMBER: Extension range 10 to 19" + " overlaps with reserved range 5 to 14.\n"); +} + +TEST_F(ValidationErrorTest, ReservedExtensionRangeAdjacent) { + BuildFile( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension_range { start: 10 end: 20 }" + " reserved_range { start: 5 end: 10 }" + "}"); +} + +TEST_F(ValidationErrorTest, ReservedRangeOverlap) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " reserved_range { start: 10 end: 20 }" + " reserved_range { start: 5 end: 15 }" + "}", + + "foo.proto: Foo: NUMBER: Reserved range 5 to 14" + " overlaps with already-defined range 10 to 19.\n"); +} + +TEST_F(ValidationErrorTest, ReservedNameError) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: 15 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name: \"bar\" number: 16 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name: \"baz\" number: 17 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " reserved_name: \"foo\"" + " reserved_name: \"bar\"" + "}", + + "foo.proto: Foo.foo: NAME: Field name \"foo\" is reserved.\n" + "foo.proto: Foo.bar: NAME: Field name \"bar\" is reserved.\n"); +} + +TEST_F(ValidationErrorTest, ReservedNameRedundant) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " reserved_name: \"foo\"" + " reserved_name: \"foo\"" + "}", + + "foo.proto: foo: NAME: Field name \"foo\" is reserved multiple times.\n"); +} + +TEST_F(ValidationErrorTest, ReservedFieldsDebugString) { + const FileDescriptor* file = BuildFile( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " reserved_name: \"foo\"" + " reserved_name: \"bar\"" + " reserved_range { start: 5 end: 6 }" + " reserved_range { start: 10 end: 20 }" + "}"); + + ASSERT_EQ( + "syntax = \"proto2\";\n\n" + "message Foo {\n" + " reserved 5, 10 to 19;\n" + " reserved \"foo\", \"bar\";\n" + "}\n\n", + file->DebugString()); +} + +TEST_F(ValidationErrorTest, InvalidDefaults) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + + // Invalid number. + " field { name: \"foo\" number: 1 label: LABEL_OPTIONAL type: TYPE_INT32" + " default_value: \"abc\" }" + + // Empty default value. + " field { name: \"bar\" number: 2 label: LABEL_OPTIONAL type: TYPE_INT32" + " default_value: \"\" }" + + // Invalid boolean. + " field { name: \"baz\" number: 3 label: LABEL_OPTIONAL type: TYPE_BOOL" + " default_value: \"abc\" }" + + // Messages can't have defaults. + " field { name: \"qux\" number: 4 label: LABEL_OPTIONAL type: TYPE_MESSAGE" + " default_value: \"abc\" type_name: \"Foo\" }" + + // Same thing, but we don't know that this field has message type until + // we look up the type name. + " field { name: \"quux\" number: 5 label: LABEL_OPTIONAL" + " default_value: \"abc\" type_name: \"Foo\" }" + + // Repeateds can't have defaults. + " field { name: \"corge\" number: 6 label: LABEL_REPEATED type: TYPE_INT32" + " default_value: \"1\" }" + "}", + + "foo.proto: Foo.foo: DEFAULT_VALUE: Couldn't parse default value \"abc\".\n" + "foo.proto: Foo.bar: DEFAULT_VALUE: Couldn't parse default value \"\".\n" + "foo.proto: Foo.baz: DEFAULT_VALUE: Boolean default must be true or " + "false.\n" + "foo.proto: Foo.qux: DEFAULT_VALUE: Messages can't have default values.\n" + "foo.proto: Foo.corge: DEFAULT_VALUE: Repeated fields can't have default " + "values.\n" + // This ends up being reported later because the error is detected at + // cross-linking time. + "foo.proto: Foo.quux: DEFAULT_VALUE: Messages can't have default " + "values.\n"); +} + +TEST_F(ValidationErrorTest, NegativeFieldNumber) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: -1 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + + "foo.proto: Foo.foo: NUMBER: Field numbers must be positive integers.\n"); +} + +TEST_F(ValidationErrorTest, HugeFieldNumber) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: 0x70000000 " + " label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + + "foo.proto: Foo.foo: NUMBER: Field numbers cannot be greater than " + "536870911.\n"); +} + +TEST_F(ValidationErrorTest, ReservedFieldNumber) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field {name:\"foo\" number: 18999 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field {name:\"bar\" number: 19000 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field {name:\"baz\" number: 19999 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field {name:\"qux\" number: 20000 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + + "foo.proto: Foo.bar: NUMBER: Field numbers 19000 through 19999 are " + "reserved for the protocol buffer library implementation.\n" + "foo.proto: Foo.baz: NUMBER: Field numbers 19000 through 19999 are " + "reserved for the protocol buffer library implementation.\n"); +} + +TEST_F(ValidationErrorTest, ExtensionMissingExtendee) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension { name: \"foo\" number: 1 label: LABEL_OPTIONAL" + " type_name: \"Foo\" }" + "}", + + "foo.proto: Foo.foo: EXTENDEE: FieldDescriptorProto.extendee not set for " + "extension field.\n"); +} + +TEST_F(ValidationErrorTest, NonExtensionWithExtendee) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Bar\"" + " extension_range { start: 1 end: 2 }" + "}" + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: 1 label: LABEL_OPTIONAL" + " type_name: \"Foo\" extendee: \"Bar\" }" + "}", + + "foo.proto: Foo.foo: EXTENDEE: FieldDescriptorProto.extendee set for " + "non-extension field.\n"); +} + +TEST_F(ValidationErrorTest, FieldOneofIndexTooLarge) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 1 }" + " field { name:\"dummy\" number:2 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " oneof_decl { name:\"bar\" }" + "}", + + "foo.proto: Foo.foo: OTHER: FieldDescriptorProto.oneof_index 1 is out of " + "range for type \"Foo\".\n"); +} + +TEST_F(ValidationErrorTest, FieldOneofIndexNegative) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: -1 }" + " field { name:\"dummy\" number:2 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " oneof_decl { name:\"bar\" }" + "}", + + "foo.proto: Foo.foo: OTHER: FieldDescriptorProto.oneof_index -1 is out of " + "range for type \"Foo\".\n"); +} + +TEST_F(ValidationErrorTest, OneofFieldsConsecutiveDefinition) { + // Fields belonging to the same oneof must be defined consecutively. + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo1\" number: 1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " field { name:\"bar\" number: 2 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name:\"foo2\" number: 3 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " oneof_decl { name:\"foos\" }" + "}", + + "foo.proto: Foo.bar: OTHER: Fields in the same oneof must be defined " + "consecutively. \"bar\" cannot be defined before the completion of the " + "\"foos\" oneof definition.\n"); + + // Prevent interleaved fields, which belong to different oneofs. + BuildFileWithErrors( + "name: \"foo2.proto\" " + "message_type {" + " name: \"Foo2\"" + " field { name:\"foo1\" number: 1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " field { name:\"bar1\" number: 2 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 1 }" + " field { name:\"foo2\" number: 3 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " field { name:\"bar2\" number: 4 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 1 }" + " oneof_decl { name:\"foos\" }" + " oneof_decl { name:\"bars\" }" + "}", + "foo2.proto: Foo2.bar1: OTHER: Fields in the same oneof must be defined " + "consecutively. \"bar1\" cannot be defined before the completion of the " + "\"foos\" oneof definition.\n" + "foo2.proto: Foo2.foo2: OTHER: Fields in the same oneof must be defined " + "consecutively. \"foo2\" cannot be defined before the completion of the " + "\"bars\" oneof definition.\n"); + + // Another case for normal fields and different oneof fields interleave. + BuildFileWithErrors( + "name: \"foo3.proto\" " + "message_type {" + " name: \"Foo3\"" + " field { name:\"foo1\" number: 1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " field { name:\"bar1\" number: 2 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 1 }" + " field { name:\"baz\" number: 3 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name:\"foo2\" number: 4 label:LABEL_OPTIONAL type:TYPE_INT32 " + " oneof_index: 0 }" + " oneof_decl { name:\"foos\" }" + " oneof_decl { name:\"bars\" }" + "}", + "foo3.proto: Foo3.baz: OTHER: Fields in the same oneof must be defined " + "consecutively. \"baz\" cannot be defined before the completion of the " + "\"foos\" oneof definition.\n"); +} + +TEST_F(ValidationErrorTest, FieldNumberConflict) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name: \"foo\" number: 1 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name: \"bar\" number: 1 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + + "foo.proto: Foo.bar: NUMBER: Field number 1 has already been used in " + "\"Foo\" by field \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, BadMessageSetExtensionType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"MessageSet\"" + " options { message_set_wire_format: true }" + " extension_range { start: 4 end: 5 }" + "}" + "message_type {" + " name: \"Foo\"" + " extension { name:\"foo\" number:4 label:LABEL_OPTIONAL type:TYPE_INT32" + " extendee: \"MessageSet\" }" + "}", + + "foo.proto: Foo.foo: TYPE: Extensions of MessageSets must be optional " + "messages.\n"); +} + +TEST_F(ValidationErrorTest, BadMessageSetExtensionLabel) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"MessageSet\"" + " options { message_set_wire_format: true }" + " extension_range { start: 4 end: 5 }" + "}" + "message_type {" + " name: \"Foo\"" + " extension { name:\"foo\" number:4 label:LABEL_REPEATED type:TYPE_MESSAGE" + " type_name: \"Foo\" extendee: \"MessageSet\" }" + "}", + + "foo.proto: Foo.foo: TYPE: Extensions of MessageSets must be optional " + "messages.\n"); +} + +TEST_F(ValidationErrorTest, FieldInMessageSet) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " options { message_set_wire_format: true }" + " field { name: \"foo\" number: 1 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + + "foo.proto: Foo.foo: NAME: MessageSets cannot have fields, only " + "extensions.\n"); +} + +TEST_F(ValidationErrorTest, NegativeExtensionRangeNumber) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension_range { start: -10 end: -1 }" + "}", + + "foo.proto: Foo: NUMBER: Extension numbers must be positive integers.\n"); +} + +TEST_F(ValidationErrorTest, HugeExtensionRangeNumber) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension_range { start: 1 end: 0x70000000 }" + "}", + + "foo.proto: Foo: NUMBER: Extension numbers cannot be greater than " + "536870911.\n"); +} + +TEST_F(ValidationErrorTest, ExtensionRangeEndBeforeStart) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension_range { start: 10 end: 10 }" + " extension_range { start: 10 end: 5 }" + "}", + + "foo.proto: Foo: NUMBER: Extension range end number must be greater than " + "start number.\n" + "foo.proto: Foo: NUMBER: Extension range end number must be greater than " + "start number.\n"); +} + +TEST_F(ValidationErrorTest, EmptyEnum) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type { name: \"Foo\" }" + // Also use the empty enum in a message to make sure there are no crashes + // during validation (possible if the code attempts to derive a default + // value for the field). + "message_type {" + " name: \"Bar\"" + " field { name: \"foo\" number: 1 label:LABEL_OPTIONAL type_name:\"Foo\" }" + " field { name: \"bar\" number: 2 label:LABEL_OPTIONAL type_name:\"Foo\" " + " default_value: \"NO_SUCH_VALUE\" }" + "}", + + "foo.proto: Foo: NAME: Enums must contain at least one value.\n" + "foo.proto: Bar.bar: DEFAULT_VALUE: Enum type \"Foo\" has no value named " + "\"NO_SUCH_VALUE\".\n"); +} + +TEST_F(ValidationErrorTest, UndefinedExtendee) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " extension { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_INT32" + " extendee: \"Bar\" }" + "}", + + "foo.proto: Foo.foo: EXTENDEE: \"Bar\" is not defined.\n"); +} + +TEST_F(ValidationErrorTest, NonMessageExtendee) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type { name: \"Bar\" value { name:\"DUMMY\" number:0 } }" + "message_type {" + " name: \"Foo\"" + " extension { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_INT32" + " extendee: \"Bar\" }" + "}", + + "foo.proto: Foo.foo: EXTENDEE: \"Bar\" is not a message type.\n"); +} + +TEST_F(ValidationErrorTest, NotAnExtensionNumber) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Bar\"" + "}" + "message_type {" + " name: \"Foo\"" + " extension { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_INT32" + " extendee: \"Bar\" }" + "}", + + "foo.proto: Foo.foo: NUMBER: \"Bar\" does not declare 1 as an extension " + "number.\n"); +} + +TEST_F(ValidationErrorTest, RequiredExtension) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Bar\"" + " extension_range { start: 1000 end: 10000 }" + "}" + "message_type {" + " name: \"Foo\"" + " extension {" + " name:\"foo\"" + " number:1000" + " label:LABEL_REQUIRED" + " type:TYPE_INT32" + " extendee: \"Bar\"" + " }" + "}", + + "foo.proto: Foo.foo: TYPE: Message extensions cannot have required " + "fields.\n"); +} + +TEST_F(ValidationErrorTest, UndefinedFieldType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}", + + "foo.proto: Foo.foo: TYPE: \"Bar\" is not defined.\n"); +} + +TEST_F(ValidationErrorTest, UndefinedFieldTypeWithDefault) { + // See b/12533582. Previously this failed because the default value was not + // accepted by the parser, which assumed an enum type, leading to an unclear + // error message. We want this input to yield a validation error instead, + // since the unknown type is the primary problem. + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"int\" " + " default_value:\"1\" }" + "}", + + "foo.proto: Foo.foo: TYPE: \"int\" is not defined.\n"); +} + +TEST_F(ValidationErrorTest, UndefinedNestedFieldType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " nested_type { name:\"Baz\" }" + " field { name:\"foo\" number:1" + " label:LABEL_OPTIONAL" + " type_name:\"Foo.Baz.Bar\" }" + "}", + + "foo.proto: Foo.foo: TYPE: \"Foo.Baz.Bar\" is not defined.\n"); +} + +TEST_F(ValidationErrorTest, FieldTypeDefinedInUndeclaredDependency) { + BuildFile( + "name: \"bar.proto\" " + "message_type { name: \"Bar\" } "); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}", + "foo.proto: Foo.foo: TYPE: \"Bar\" seems to be defined in \"bar.proto\", " + "which is not imported by \"foo.proto\". To use it here, please add the " + "necessary import.\n"); +} + +TEST_F(ValidationErrorTest, FieldTypeDefinedInIndirectDependency) { + // Test for hidden dependencies. + // + // // bar.proto + // message Bar{} + // + // // forward.proto + // import "bar.proto" + // + // // foo.proto + // import "forward.proto" + // message Foo { + // optional Bar foo = 1; // Error, needs to import bar.proto explicitly. + // } + // + BuildFile( + "name: \"bar.proto\" " + "message_type { name: \"Bar\" }"); + + BuildFile( + "name: \"forward.proto\"" + "dependency: \"bar.proto\""); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"forward.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}", + "foo.proto: Foo.foo: TYPE: \"Bar\" seems to be defined in \"bar.proto\", " + "which is not imported by \"foo.proto\". To use it here, please add the " + "necessary import.\n"); +} + +TEST_F(ValidationErrorTest, FieldTypeDefinedInPublicDependency) { + // Test for public dependencies. + // + // // bar.proto + // message Bar{} + // + // // forward.proto + // import public "bar.proto" + // + // // foo.proto + // import "forward.proto" + // message Foo { + // optional Bar foo = 1; // Correct. "bar.proto" is public imported into + // // forward.proto, so when "foo.proto" imports + // // "forward.proto", it imports "bar.proto" too. + // } + // + BuildFile( + "name: \"bar.proto\" " + "message_type { name: \"Bar\" }"); + + BuildFile( + "name: \"forward.proto\"" + "dependency: \"bar.proto\" " + "public_dependency: 0"); + + BuildFile( + "name: \"foo.proto\" " + "dependency: \"forward.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}"); +} + +TEST_F(ValidationErrorTest, FieldTypeDefinedInTransitivePublicDependency) { + // Test for public dependencies. + // + // // bar.proto + // message Bar{} + // + // // forward.proto + // import public "bar.proto" + // + // // forward2.proto + // import public "forward.proto" + // + // // foo.proto + // import "forward2.proto" + // message Foo { + // optional Bar foo = 1; // Correct, public imports are transitive. + // } + // + BuildFile( + "name: \"bar.proto\" " + "message_type { name: \"Bar\" }"); + + BuildFile( + "name: \"forward.proto\"" + "dependency: \"bar.proto\" " + "public_dependency: 0"); + + BuildFile( + "name: \"forward2.proto\"" + "dependency: \"forward.proto\" " + "public_dependency: 0"); + + BuildFile( + "name: \"foo.proto\" " + "dependency: \"forward2.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}"); +} + +TEST_F(ValidationErrorTest, + FieldTypeDefinedInPrivateDependencyOfPublicDependency) { + // Test for public dependencies. + // + // // bar.proto + // message Bar{} + // + // // forward.proto + // import "bar.proto" + // + // // forward2.proto + // import public "forward.proto" + // + // // foo.proto + // import "forward2.proto" + // message Foo { + // optional Bar foo = 1; // Error, the "bar.proto" is not public imported + // // into "forward.proto", so will not be imported + // // into either "forward2.proto" or "foo.proto". + // } + // + BuildFile( + "name: \"bar.proto\" " + "message_type { name: \"Bar\" }"); + + BuildFile( + "name: \"forward.proto\"" + "dependency: \"bar.proto\""); + + BuildFile( + "name: \"forward2.proto\"" + "dependency: \"forward.proto\" " + "public_dependency: 0"); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"forward2.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}", + "foo.proto: Foo.foo: TYPE: \"Bar\" seems to be defined in \"bar.proto\", " + "which is not imported by \"foo.proto\". To use it here, please add the " + "necessary import.\n"); +} + + +TEST_F(ValidationErrorTest, SearchMostLocalFirst) { + // The following should produce an error that Bar.Baz is resolved but + // not defined: + // message Bar { message Baz {} } + // message Foo { + // message Bar { + // // Placing "message Baz{}" here, or removing Foo.Bar altogether, + // // would fix the error. + // } + // optional Bar.Baz baz = 1; + // } + // An one point the lookup code incorrectly did not produce an error in this + // case, because when looking for Bar.Baz, it would try "Foo.Bar.Baz" first, + // fail, and ten try "Bar.Baz" and succeed, even though "Bar" should actually + // refer to the inner Bar, not the outer one. + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Bar\"" + " nested_type { name: \"Baz\" }" + "}" + "message_type {" + " name: \"Foo\"" + " nested_type { name: \"Bar\" }" + " field { name:\"baz\" number:1 label:LABEL_OPTIONAL" + " type_name:\"Bar.Baz\" }" + "}", + + "foo.proto: Foo.baz: TYPE: \"Bar.Baz\" is resolved to \"Foo.Bar.Baz\"," + " which is not defined. The innermost scope is searched first in name " + "resolution. Consider using a leading '.'(i.e., \".Bar.Baz\") to start " + "from the outermost scope.\n"); +} + +TEST_F(ValidationErrorTest, SearchMostLocalFirst2) { + // This test would find the most local "Bar" first, and does, but + // proceeds to find the outer one because the inner one's not an + // aggregate. + BuildFile( + "name: \"foo.proto\" " + "message_type {" + " name: \"Bar\"" + " nested_type { name: \"Baz\" }" + "}" + "message_type {" + " name: \"Foo\"" + " field { name: \"Bar\" number:1 type:TYPE_BYTES } " + " field { name:\"baz\" number:2 label:LABEL_OPTIONAL" + " type_name:\"Bar.Baz\" }" + "}"); +} + +TEST_F(ValidationErrorTest, PackageOriginallyDeclaredInTransitiveDependent) { + // Imagine we have the following: + // + // foo.proto: + // package foo.bar; + // bar.proto: + // package foo.bar; + // import "foo.proto"; + // message Bar {} + // baz.proto: + // package foo; + // import "bar.proto" + // message Baz { optional bar.Bar qux = 1; } + // + // When validating baz.proto, we will look up "bar.Bar". As part of this + // lookup, we first lookup "bar" then try to find "Bar" within it. "bar" + // should resolve to "foo.bar". Note, though, that "foo.bar" was originally + // defined in foo.proto, which is not a direct dependency of baz.proto. The + // implementation of FindSymbol() normally only returns symbols in direct + // dependencies, not indirect ones. This test insures that this does not + // prevent it from finding "foo.bar". + + BuildFile( + "name: \"foo.proto\" " + "package: \"foo.bar\" "); + BuildFile( + "name: \"bar.proto\" " + "package: \"foo.bar\" " + "dependency: \"foo.proto\" " + "message_type { name: \"Bar\" }"); + BuildFile( + "name: \"baz.proto\" " + "package: \"foo\" " + "dependency: \"bar.proto\" " + "message_type { " + " name: \"Baz\" " + " field { name:\"qux\" number:1 label:LABEL_OPTIONAL " + " type_name:\"bar.Bar\" }" + "}"); +} + +TEST_F(ValidationErrorTest, FieldTypeNotAType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL " + " type_name:\".Foo.bar\" }" + " field { name:\"bar\" number:2 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + + "foo.proto: Foo.foo: TYPE: \".Foo.bar\" is not a type.\n"); +} + +TEST_F(ValidationErrorTest, RelativeFieldTypeNotAType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " nested_type {" + " name: \"Bar\"" + " field { name:\"Baz\" number:2 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " }" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL " + " type_name:\"Bar.Baz\" }" + "}", + "foo.proto: Foo.foo: TYPE: \"Bar.Baz\" is not a type.\n"); +} + +TEST_F(ValidationErrorTest, FieldTypeMayBeItsName) { + BuildFile( + "name: \"foo.proto\" " + "message_type {" + " name: \"Bar\"" + "}" + "message_type {" + " name: \"Foo\"" + " field { name:\"Bar\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\" }" + "}"); +} + +TEST_F(ValidationErrorTest, EnumFieldTypeIsMessage) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Bar\" } " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_ENUM" + " type_name:\"Bar\" }" + "}", + + "foo.proto: Foo.foo: TYPE: \"Bar\" is not an enum type.\n"); +} + +TEST_F(ValidationErrorTest, MessageFieldTypeIsEnum) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type { name: \"Bar\" value { name:\"DUMMY\" number:0 } } " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_MESSAGE" + " type_name:\"Bar\" }" + "}", + + "foo.proto: Foo.foo: TYPE: \"Bar\" is not a message type.\n"); +} + +TEST_F(ValidationErrorTest, BadEnumDefaultValue) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type { name: \"Bar\" value { name:\"DUMMY\" number:0 } } " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\"" + " default_value:\"NO_SUCH_VALUE\" }" + "}", + + "foo.proto: Foo.foo: DEFAULT_VALUE: Enum type \"Bar\" has no value named " + "\"NO_SUCH_VALUE\".\n"); +} + +TEST_F(ValidationErrorTest, EnumDefaultValueIsInteger) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type { name: \"Bar\" value { name:\"DUMMY\" number:0 } } " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type_name:\"Bar\"" + " default_value:\"0\" }" + "}", + + "foo.proto: Foo.foo: DEFAULT_VALUE: Default value for an enum field must " + "be an identifier.\n"); +} + +TEST_F(ValidationErrorTest, PrimitiveWithTypeName) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_INT32" + " type_name:\"Foo\" }" + "}", + + "foo.proto: Foo.foo: TYPE: Field with primitive type has type_name.\n"); +} + +TEST_F(ValidationErrorTest, NonPrimitiveWithoutTypeName) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_MESSAGE }" + "}", + + "foo.proto: Foo.foo: TYPE: Field with message or enum type missing " + "type_name.\n"); +} + +TEST_F(ValidationErrorTest, OneofWithNoFields) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " oneof_decl { name:\"bar\" }" + "}", + + "foo.proto: Foo.bar: NAME: Oneof must have at least one field.\n"); +} + +TEST_F(ValidationErrorTest, OneofLabelMismatch) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"Foo\"" + " field { name:\"foo\" number:1 label:LABEL_REPEATED type:TYPE_INT32 " + " oneof_index:0 }" + " oneof_decl { name:\"bar\" }" + "}", + + "foo.proto: Foo.foo: NAME: Fields of oneofs must themselves have label " + "LABEL_OPTIONAL.\n"); +} + +TEST_F(ValidationErrorTest, InputTypeNotDefined) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" } " + "service {" + " name: \"TestService\"" + " method { name: \"A\" input_type: \"Bar\" output_type: \"Foo\" }" + "}", + + "foo.proto: TestService.A: INPUT_TYPE: \"Bar\" is not defined.\n" + ); +} + +TEST_F(ValidationErrorTest, InputTypeNotAMessage) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" } " + "enum_type { name: \"Bar\" value { name:\"DUMMY\" number:0 } } " + "service {" + " name: \"TestService\"" + " method { name: \"A\" input_type: \"Bar\" output_type: \"Foo\" }" + "}", + + "foo.proto: TestService.A: INPUT_TYPE: \"Bar\" is not a message type.\n" + ); +} + +TEST_F(ValidationErrorTest, OutputTypeNotDefined) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" } " + "service {" + " name: \"TestService\"" + " method { name: \"A\" input_type: \"Foo\" output_type: \"Bar\" }" + "}", + + "foo.proto: TestService.A: OUTPUT_TYPE: \"Bar\" is not defined.\n" + ); +} + +TEST_F(ValidationErrorTest, OutputTypeNotAMessage) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" } " + "enum_type { name: \"Bar\" value { name:\"DUMMY\" number:0 } } " + "service {" + " name: \"TestService\"" + " method { name: \"A\" input_type: \"Foo\" output_type: \"Bar\" }" + "}", + + "foo.proto: TestService.A: OUTPUT_TYPE: \"Bar\" is not a message type.\n" + ); +} + + +TEST_F(ValidationErrorTest, IllegalPackedField) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {\n" + " name: \"Foo\"" + " field { name:\"packed_string\" number:1 label:LABEL_REPEATED " + " type:TYPE_STRING " + " options { uninterpreted_option {" + " name { name_part: \"packed\" is_extension: false }" + " identifier_value: \"true\" }}}\n" + " field { name:\"packed_message\" number:3 label:LABEL_REPEATED " + " type_name: \"Foo\"" + " options { uninterpreted_option {" + " name { name_part: \"packed\" is_extension: false }" + " identifier_value: \"true\" }}}\n" + " field { name:\"optional_int32\" number: 4 label: LABEL_OPTIONAL " + " type:TYPE_INT32 " + " options { uninterpreted_option {" + " name { name_part: \"packed\" is_extension: false }" + " identifier_value: \"true\" }}}\n" + "}", + + "foo.proto: Foo.packed_string: TYPE: [packed = true] can only be " + "specified for repeated primitive fields.\n" + "foo.proto: Foo.packed_message: TYPE: [packed = true] can only be " + "specified for repeated primitive fields.\n" + "foo.proto: Foo.optional_int32: TYPE: [packed = true] can only be " + "specified for repeated primitive fields.\n" + ); +} + +TEST_F(ValidationErrorTest, OptionWrongType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { " + " name: \"TestMessage\" " + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_STRING " + " options { uninterpreted_option { name { name_part: \"ctype\" " + " is_extension: false }" + " positive_int_value: 1 }" + " }" + " }" + "}\n", + + "foo.proto: TestMessage.foo: OPTION_VALUE: Value must be identifier for " + "enum-valued option \"google.protobuf.FieldOptions.ctype\".\n"); +} + +TEST_F(ValidationErrorTest, OptionExtendsAtomicType) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { " + " name: \"TestMessage\" " + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_STRING " + " options { uninterpreted_option { name { name_part: \"ctype\" " + " is_extension: false }" + " name { name_part: \"foo\" " + " is_extension: true }" + " positive_int_value: 1 }" + " }" + " }" + "}\n", + + "foo.proto: TestMessage.foo: OPTION_NAME: Option \"ctype\" is an " + "atomic type, not a message.\n"); +} + +TEST_F(ValidationErrorTest, DupOption) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { " + " name: \"TestMessage\" " + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_UINT32 " + " options { uninterpreted_option { name { name_part: \"ctype\" " + " is_extension: false }" + " identifier_value: \"CORD\" }" + " uninterpreted_option { name { name_part: \"ctype\" " + " is_extension: false }" + " identifier_value: \"CORD\" }" + " }" + " }" + "}\n", + + "foo.proto: TestMessage.foo: OPTION_NAME: Option \"ctype\" was " + "already set.\n"); +} + +TEST_F(ValidationErrorTest, InvalidOptionName) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type { " + " name: \"TestMessage\" " + " field { name:\"foo\" number:1 label:LABEL_OPTIONAL type:TYPE_BOOL " + " options { uninterpreted_option { " + " name { name_part: \"uninterpreted_option\" " + " is_extension: false }" + " positive_int_value: 1 " + " }" + " }" + " }" + "}\n", + + "foo.proto: TestMessage.foo: OPTION_NAME: Option must not use " + "reserved name \"uninterpreted_option\".\n"); +} + +TEST_F(ValidationErrorTest, RepeatedMessageOption) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "message_type: { name: \"Bar\" field: { " + " name: \"foo\" number: 1 label: LABEL_OPTIONAL type: TYPE_INT32 } " + "} " + "extension { name: \"bar\" number: 7672757 label: LABEL_REPEATED " + " type: TYPE_MESSAGE type_name: \"Bar\" " + " extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"bar\" " + " is_extension: true } " + " name { name_part: \"foo\" " + " is_extension: false } " + " positive_int_value: 1 } }", + + "foo.proto: foo.proto: OPTION_NAME: Option field \"(bar)\" is a " + "repeated message. Repeated message options must be initialized " + "using an aggregate value.\n"); +} + +TEST_F(ValidationErrorTest, ResolveUndefinedOption) { + // The following should produce an eror that baz.bar is resolved but not + // defined. + // foo.proto: + // package baz + // import google/protobuf/descriptor.proto + // message Bar { optional int32 foo = 1; } + // extend FileOptions { optional Bar bar = 7672757; } + // + // qux.proto: + // package qux.baz + // option (baz.bar).foo = 1; + // + // Although "baz.bar" is already defined, the lookup code will try + // "qux.baz.bar", since it's the match from the innermost scope, which will + // cause a symbol not defined error. + BuildDescriptorMessagesInTestPool(); + + BuildFile( + "name: \"foo.proto\" " + "package: \"baz\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "message_type: { name: \"Bar\" field: { " + " name: \"foo\" number: 1 label: LABEL_OPTIONAL type: TYPE_INT32 } " + "} " + "extension { name: \"bar\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_MESSAGE type_name: \"Bar\" " + " extendee: \"google.protobuf.FileOptions\" }"); + + BuildFileWithErrors( + "name: \"qux.proto\" " + "package: \"qux.baz\" " + "options { uninterpreted_option { name { name_part: \"baz.bar\" " + " is_extension: true } " + " name { name_part: \"foo\" " + " is_extension: false } " + " positive_int_value: 1 } }", + + "qux.proto: qux.proto: OPTION_NAME: Option \"(baz.bar)\" is resolved to " + "\"(qux.baz.bar)\"," + " which is not defined. The innermost scope is searched first in name " + "resolution. Consider using a leading '.'(i.e., \"(.baz.bar)\") to start " + "from the outermost scope.\n"); +} + +TEST_F(ValidationErrorTest, UnknownOption) { + BuildFileWithErrors( + "name: \"qux.proto\" " + "package: \"qux.baz\" " + "options { uninterpreted_option { name { name_part: \"baaz.bar\" " + " is_extension: true } " + " name { name_part: \"foo\" " + " is_extension: false } " + " positive_int_value: 1 } }", + + "qux.proto: qux.proto: OPTION_NAME: Option \"(baaz.bar)\" unknown.\n"); +} + +TEST_F(ValidationErrorTest, CustomOptionConflictingFieldNumber) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo1\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FieldOptions\" }" + "extension { name: \"foo2\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FieldOptions\" }", + + "foo.proto: foo2: NUMBER: Extension number 7672757 has already been used " + "in \"google.protobuf.FieldOptions\" by extension \"foo1\".\n"); +} + +TEST_F(ValidationErrorTest, Int32OptionValueOutOfPositiveRange) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " positive_int_value: 0x80000000 } " + "}", + + "foo.proto: foo.proto: OPTION_VALUE: Value out of range " + "for int32 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, Int32OptionValueOutOfNegativeRange) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " negative_int_value: -0x80000001 } " + "}", + + "foo.proto: foo.proto: OPTION_VALUE: Value out of range " + "for int32 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, Int32OptionValueIsNotPositiveInt) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " string_value: \"5\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be integer " + "for int32 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, Int64OptionValueOutOfRange) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT64 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " positive_int_value: 0x8000000000000000 } " + "}", + + "foo.proto: foo.proto: OPTION_VALUE: Value out of range " + "for int64 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, Int64OptionValueIsNotPositiveInt) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_INT64 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " identifier_value: \"5\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be integer " + "for int64 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, UInt32OptionValueOutOfRange) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_UINT32 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " positive_int_value: 0x100000000 } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value out of range " + "for uint32 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, UInt32OptionValueIsNotPositiveInt) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_UINT32 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " double_value: -5.6 } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be non-negative integer " + "for uint32 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, UInt64OptionValueIsNotPositiveInt) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_UINT64 extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " negative_int_value: -5 } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be non-negative integer " + "for uint64 option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, FloatOptionValueIsNotNumber) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_FLOAT extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " string_value: \"bar\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be number " + "for float option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, DoubleOptionValueIsNotNumber) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_DOUBLE extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " string_value: \"bar\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be number " + "for double option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, BoolOptionValueIsNotTrueOrFalse) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_BOOL extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " identifier_value: \"bar\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be \"true\" or \"false\" " + "for boolean option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, EnumOptionValueIsNotIdentifier) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "enum_type { name: \"FooEnum\" value { name: \"BAR\" number: 1 } " + " value { name: \"BAZ\" number: 2 } }" + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_ENUM type_name: \"FooEnum\" " + " extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " string_value: \"QUUX\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be identifier for " + "enum-valued option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, EnumOptionValueIsNotEnumValueName) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "enum_type { name: \"FooEnum\" value { name: \"BAR\" number: 1 } " + " value { name: \"BAZ\" number: 2 } }" + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_ENUM type_name: \"FooEnum\" " + " extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " identifier_value: \"QUUX\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Enum type \"FooEnum\" has no value " + "named \"QUUX\" for option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, EnumOptionValueIsSiblingEnumValueName) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "enum_type { name: \"FooEnum1\" value { name: \"BAR\" number: 1 } " + " value { name: \"BAZ\" number: 2 } }" + "enum_type { name: \"FooEnum2\" value { name: \"QUX\" number: 1 } " + " value { name: \"QUUX\" number: 2 } }" + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_ENUM type_name: \"FooEnum1\" " + " extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " identifier_value: \"QUUX\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Enum type \"FooEnum1\" has no value " + "named \"QUUX\" for option \"foo\". This appears to be a value from a " + "sibling type.\n"); +} + +TEST_F(ValidationErrorTest, StringOptionValueIsNotString) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_STRING extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " identifier_value: \"QUUX\" } }", + + "foo.proto: foo.proto: OPTION_VALUE: Value must be quoted string for " + "string option \"foo\".\n"); +} + +TEST_F(ValidationErrorTest, DuplicateExtensionFieldNumber) { + BuildDescriptorMessagesInTestPool(); + + BuildFile( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"option1\" number: 1000 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FileOptions\" }"); + + BuildFileWithWarnings( + "name: \"bar.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "extension { name: \"option2\" number: 1000 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"google.protobuf.FileOptions\" }", + "bar.proto: option2: NUMBER: Extension number 1000 has already been used " + "in \"google.protobuf.FileOptions\" by extension \"option1\" defined in " + "foo.proto.\n"); +} + +// Helper function for tests that check for aggregate value parsing +// errors. The "value" argument is embedded inside the +// "uninterpreted_option" portion of the result. +static string EmbedAggregateValue(const char* value) { + return strings::Substitute( + "name: \"foo.proto\" " + "dependency: \"google/protobuf/descriptor.proto\" " + "message_type { name: \"Foo\" } " + "extension { name: \"foo\" number: 7672757 label: LABEL_OPTIONAL " + " type: TYPE_MESSAGE type_name: \"Foo\" " + " extendee: \"google.protobuf.FileOptions\" }" + "options { uninterpreted_option { name { name_part: \"foo\" " + " is_extension: true } " + " $0 } }", + value); +} + +TEST_F(ValidationErrorTest, AggregateValueNotFound) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + EmbedAggregateValue("string_value: \"\""), + "foo.proto: foo.proto: OPTION_VALUE: Option \"foo\" is a message. " + "To set the entire message, use syntax like " + "\"foo = { }\". To set fields within it, use " + "syntax like \"foo.foo = value\".\n"); +} + +TEST_F(ValidationErrorTest, AggregateValueParseError) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + EmbedAggregateValue("aggregate_value: \"1+2\""), + "foo.proto: foo.proto: OPTION_VALUE: Error while parsing option " + "value for \"foo\": Expected identifier.\n"); +} + +TEST_F(ValidationErrorTest, AggregateValueUnknownFields) { + BuildDescriptorMessagesInTestPool(); + + BuildFileWithErrors( + EmbedAggregateValue("aggregate_value: \"x:100\""), + "foo.proto: foo.proto: OPTION_VALUE: Error while parsing option " + "value for \"foo\": Message type \"Foo\" has no field named \"x\".\n"); +} + +TEST_F(ValidationErrorTest, NotLiteImportsLite) { + BuildFile( + "name: \"bar.proto\" " + "options { optimize_for: LITE_RUNTIME } "); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"bar.proto\" ", + + "foo.proto: foo.proto: OTHER: Files that do not use optimize_for = " + "LITE_RUNTIME cannot import files which do use this option. This file " + "is not lite, but it imports \"bar.proto\" which is.\n"); +} + +TEST_F(ValidationErrorTest, LiteExtendsNotLite) { + BuildFile( + "name: \"bar.proto\" " + "message_type: {" + " name: \"Bar\"" + " extension_range { start: 1 end: 1000 }" + "}"); + + BuildFileWithErrors( + "name: \"foo.proto\" " + "dependency: \"bar.proto\" " + "options { optimize_for: LITE_RUNTIME } " + "extension { name: \"ext\" number: 123 label: LABEL_OPTIONAL " + " type: TYPE_INT32 extendee: \"Bar\" }", + + "foo.proto: ext: EXTENDEE: Extensions to non-lite types can only be " + "declared in non-lite files. Note that you cannot extend a non-lite " + "type to contain a lite type, but the reverse is allowed.\n"); +} + +TEST_F(ValidationErrorTest, NoLiteServices) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "options {" + " optimize_for: LITE_RUNTIME" + " cc_generic_services: true" + " java_generic_services: true" + "} " + "service { name: \"Foo\" }", + + "foo.proto: Foo: NAME: Files with optimize_for = LITE_RUNTIME cannot " + "define services unless you set both options cc_generic_services and " + "java_generic_sevices to false.\n"); + + BuildFile( + "name: \"bar.proto\" " + "options {" + " optimize_for: LITE_RUNTIME" + " cc_generic_services: false" + " java_generic_services: false" + "} " + "service { name: \"Bar\" }"); +} + +TEST_F(ValidationErrorTest, RollbackAfterError) { + // Build a file which contains every kind of construct but references an + // undefined type. All these constructs will be added to the symbol table + // before the undefined type error is noticed. The DescriptorPool will then + // have to roll everything back. + BuildFileWithErrors( + "name: \"foo.proto\" " + "message_type {" + " name: \"TestMessage\"" + " field { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 }" + "} " + "enum_type {" + " name: \"TestEnum\"" + " value { name:\"BAR\" number:1 }" + "} " + "service {" + " name: \"TestService\"" + " method {" + " name: \"Baz\"" + " input_type: \"NoSuchType\"" // error + " output_type: \"TestMessage\"" + " }" + "}", + + "foo.proto: TestService.Baz: INPUT_TYPE: \"NoSuchType\" is not defined.\n" + ); + + // Make sure that if we build the same file again with the error fixed, + // it works. If the above rollback was incomplete, then some symbols will + // be left defined, and this second attempt will fail since it tries to + // re-define the same symbols. + BuildFile( + "name: \"foo.proto\" " + "message_type {" + " name: \"TestMessage\"" + " field { name:\"foo\" label:LABEL_OPTIONAL type:TYPE_INT32 number:1 }" + "} " + "enum_type {" + " name: \"TestEnum\"" + " value { name:\"BAR\" number:1 }" + "} " + "service {" + " name: \"TestService\"" + " method { name:\"Baz\"" + " input_type:\"TestMessage\"" + " output_type:\"TestMessage\" }" + "}"); +} + +TEST_F(ValidationErrorTest, ErrorsReportedToLogError) { + // Test that errors are reported to GOOGLE_LOG(ERROR) if no error collector is + // provided. + + FileDescriptorProto file_proto; + ASSERT_TRUE(TextFormat::ParseFromString( + "name: \"foo.proto\" " + "message_type { name: \"Foo\" } " + "message_type { name: \"Foo\" } ", + &file_proto)); + + vector errors; + + { + ScopedMemoryLog log; + EXPECT_TRUE(pool_.BuildFile(file_proto) == NULL); + errors = log.GetMessages(ERROR); + } + + ASSERT_EQ(2, errors.size()); + + EXPECT_EQ("Invalid proto descriptor for file \"foo.proto\":", errors[0]); + EXPECT_EQ(" Foo: \"Foo\" is already defined.", errors[1]); +} + +TEST_F(ValidationErrorTest, DisallowEnumAlias) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Bar\"" + " value { name:\"ENUM_A\" number:0 }" + " value { name:\"ENUM_B\" number:0 }" + "}", + "foo.proto: Bar: NUMBER: " + "\"ENUM_B\" uses the same enum value as \"ENUM_A\". " + "If this is intended, set 'option allow_alias = true;' to the enum " + "definition.\n"); +} + +TEST_F(ValidationErrorTest, AllowEnumAlias) { + BuildFile( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Bar\"" + " value { name:\"ENUM_A\" number:0 }" + " value { name:\"ENUM_B\" number:0 }" + " options { allow_alias: true }" + "}"); +} + +TEST_F(ValidationErrorTest, UnusedImportWarning) { + pool_.AddUnusedImportTrackFile("bar.proto"); + BuildFile( + "name: \"bar.proto\" " + "message_type { name: \"Bar\" }"); + + pool_.AddUnusedImportTrackFile("base.proto"); + BuildFile( + "name: \"base.proto\" " + "message_type { name: \"Base\" }"); + + pool_.AddUnusedImportTrackFile("baz.proto"); + BuildFile( + "name: \"baz.proto\" " + "message_type { name: \"Baz\" }"); + + pool_.AddUnusedImportTrackFile("public.proto"); + BuildFile( + "name: \"public.proto\" " + "dependency: \"bar.proto\"" + "public_dependency: 0"); + + // // forward.proto + // import "base.proto" // No warning: Base message is used. + // import "bar.proto" // Will log a warning. + // import public "baz.proto" // No warning: Do not track import public. + // import "public.proto" // No warning: public.proto has import public. + // message Forward { + // optional Base base = 1; + // } + // + pool_.AddUnusedImportTrackFile("forward.proto"); + BuildFileWithWarnings( + "name: \"forward.proto\"" + "dependency: \"base.proto\"" + "dependency: \"bar.proto\"" + "dependency: \"baz.proto\"" + "dependency: \"public.proto\"" + "public_dependency: 2 " + "message_type {" + " name: \"Forward\"" + " field { name:\"base\" number:1 label:LABEL_OPTIONAL type_name:\"Base\" }" + "}", + "forward.proto: bar.proto: OTHER: Import bar.proto but not used.\n"); +} + +namespace { +void FillValidMapEntry(FileDescriptorProto* file_proto) { + ASSERT_TRUE(TextFormat::ParseFromString( + "name: 'foo.proto' " + "message_type { " + " name: 'Foo' " + " field { " + " name: 'foo_map' number: 1 label:LABEL_REPEATED " + " type_name: 'FooMapEntry' " + " } " + " nested_type { " + " name: 'FooMapEntry' " + " options { map_entry: true } " + " field { " + " name: 'key' number: 1 type:TYPE_INT32 label:LABEL_OPTIONAL " + " } " + " field { " + " name: 'value' number: 2 type:TYPE_INT32 label:LABEL_OPTIONAL " + " } " + " } " + "} " + "message_type { " + " name: 'Bar' " + " extension_range { start: 1 end: 10 }" + "} ", + file_proto)); +} +static const char* kMapEntryErrorMessage = + "foo.proto: Foo.foo_map: OTHER: map_entry should not be set explicitly. " + "Use map instead.\n"; +static const char* kMapEntryKeyTypeErrorMessage = + "foo.proto: Foo.foo_map: TYPE: Key in map fields cannot be float/double, " + "bytes or message types.\n"; + +} // namespace + +TEST_F(ValidationErrorTest, MapEntryBase) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + BuildFile(file_proto.DebugString()); +} + +TEST_F(ValidationErrorTest, MapEntryExtensionRange) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "extension_range { " + " start: 10 end: 20 " + "} ", + file_proto.mutable_message_type(0)->mutable_nested_type(0)); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryExtension) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "extension { " + " name: 'foo_ext' extendee: '.Bar' number: 5" + "} ", + file_proto.mutable_message_type(0)->mutable_nested_type(0)); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryNestedType) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "nested_type { " + " name: 'Bar' " + "} ", + file_proto.mutable_message_type(0)->mutable_nested_type(0)); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryEnumTypes) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "enum_type { " + " name: 'BarEnum' " + " value { name: 'BAR_BAR' number:0 } " + "} ", + file_proto.mutable_message_type(0)->mutable_nested_type(0)); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryExtraField) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "field { " + " name: 'other_field' " + " label: LABEL_OPTIONAL " + " type: TYPE_INT32 " + " number: 3 " + "} ", + file_proto.mutable_message_type(0)->mutable_nested_type(0)); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryMessageName) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + file_proto.mutable_message_type(0)->mutable_nested_type(0)->set_name( + "OtherMapEntry"); + file_proto.mutable_message_type(0)->mutable_field(0)->set_type_name( + "OtherMapEntry"); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryNoneRepeatedMapEntry) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + file_proto.mutable_message_type(0)->mutable_field(0)->set_label( + FieldDescriptorProto::LABEL_OPTIONAL); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryDifferentContainingType) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + // Move the nested MapEntry message into the top level, which should not pass + // the validation. + file_proto.mutable_message_type()->AddAllocated( + file_proto.mutable_message_type(0)->mutable_nested_type()->ReleaseLast()); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyName) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->set_name("Key"); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyLabel) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->set_label(FieldDescriptorProto::LABEL_REQUIRED); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyNumber) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->set_number(3); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryValueName) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* value = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(1); + value->set_name("Value"); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryValueLabel) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* value = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(1); + value->set_label(FieldDescriptorProto::LABEL_REQUIRED); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryValueNumber) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* value = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(1); + value->set_number(3); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyTypeFloat) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->set_type(FieldDescriptorProto::TYPE_FLOAT); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryKeyTypeErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyTypeDouble) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->set_type(FieldDescriptorProto::TYPE_DOUBLE); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryKeyTypeErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyTypeBytes) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->set_type(FieldDescriptorProto::TYPE_BYTES); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryKeyTypeErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryKeyTypeEnum) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->clear_type(); + key->set_type_name("BarEnum"); + EnumDescriptorProto* enum_proto = file_proto.add_enum_type(); + enum_proto->set_name("BarEnum"); + EnumValueDescriptorProto* enum_value_proto = enum_proto->add_value(); + enum_value_proto->set_name("BAR_VALUE0"); + enum_value_proto->set_number(0); + BuildFileWithErrors(file_proto.DebugString(), + "foo.proto: Foo.foo_map: TYPE: Key in map fields cannot " + "be enum types.\n"); + // Enum keys are not allowed in proto3 as well. + // Get rid of extensions for proto3 to make it proto3 compatible. + file_proto.mutable_message_type()->RemoveLast(); + file_proto.set_syntax("proto3"); + BuildFileWithErrors(file_proto.DebugString(), + "foo.proto: Foo.foo_map: TYPE: Key in map fields cannot " + "be enum types.\n"); +} + + +TEST_F(ValidationErrorTest, MapEntryKeyTypeMessage) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + FieldDescriptorProto* key = file_proto.mutable_message_type(0) + ->mutable_nested_type(0) + ->mutable_field(0); + key->clear_type(); + key->set_type_name(".Bar"); + BuildFileWithErrors(file_proto.DebugString(), kMapEntryKeyTypeErrorMessage); +} + +TEST_F(ValidationErrorTest, MapEntryConflictsWithField) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "field { " + " name: 'FooMapEntry' " + " type: TYPE_INT32 " + " label: LABEL_OPTIONAL " + " number: 100 " + "}", + file_proto.mutable_message_type(0)); + BuildFileWithErrors( + file_proto.DebugString(), + "foo.proto: Foo.FooMapEntry: NAME: \"FooMapEntry\" is already defined in " + "\"Foo\".\n" + "foo.proto: Foo.foo_map: TYPE: \"FooMapEntry\" is not defined.\n" + "foo.proto: Foo: NAME: Expanded map entry type FooMapEntry conflicts " + "with an existing field.\n"); +} + +TEST_F(ValidationErrorTest, MapEntryConflictsWithMessage) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "nested_type { " + " name: 'FooMapEntry' " + "}", + file_proto.mutable_message_type(0)); + BuildFileWithErrors( + file_proto.DebugString(), + "foo.proto: Foo.FooMapEntry: NAME: \"FooMapEntry\" is already defined in " + "\"Foo\".\n" + "foo.proto: Foo: NAME: Expanded map entry type FooMapEntry conflicts " + "with an existing nested message type.\n"); +} + +TEST_F(ValidationErrorTest, MapEntryConflictsWithEnum) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "enum_type { " + " name: 'FooMapEntry' " + " value { name: 'ENTRY_FOO' number: 0 }" + "}", + file_proto.mutable_message_type(0)); + BuildFileWithErrors( + file_proto.DebugString(), + "foo.proto: Foo.FooMapEntry: NAME: \"FooMapEntry\" is already defined in " + "\"Foo\".\n" + "foo.proto: Foo: NAME: Expanded map entry type FooMapEntry conflicts " + "with an existing enum type.\n"); +} + +TEST_F(ValidationErrorTest, MapEntryConflictsWithOneof) { + FileDescriptorProto file_proto; + FillValidMapEntry(&file_proto); + TextFormat::MergeFromString( + "oneof_decl { " + " name: 'FooMapEntry' " + "}" + "field { " + " name: 'int_field' " + " type: TYPE_INT32 " + " label: LABEL_OPTIONAL " + " oneof_index: 0 " + " number: 100 " + "} ", + file_proto.mutable_message_type(0)); + BuildFileWithErrors( + file_proto.DebugString(), + "foo.proto: Foo.FooMapEntry: NAME: \"FooMapEntry\" is already defined in " + "\"Foo\".\n" + "foo.proto: Foo.foo_map: TYPE: \"FooMapEntry\" is not defined.\n" + "foo.proto: Foo: NAME: Expanded map entry type FooMapEntry conflicts " + "with an existing oneof type.\n"); +} + +TEST_F(ValidationErrorTest, MapEntryUsesNoneZeroEnumDefaultValue) { + BuildFileWithErrors( + "name: \"foo.proto\" " + "enum_type {" + " name: \"Bar\"" + " value { name:\"ENUM_A\" number:1 }" + " value { name:\"ENUM_B\" number:2 }" + "}" + "message_type {" + " name: 'Foo' " + " field { " + " name: 'foo_map' number: 1 label:LABEL_REPEATED " + " type_name: 'FooMapEntry' " + " } " + " nested_type { " + " name: 'FooMapEntry' " + " options { map_entry: true } " + " field { " + " name: 'key' number: 1 type:TYPE_INT32 label:LABEL_OPTIONAL " + " } " + " field { " + " name: 'value' number: 2 type_name:\"Bar\" label:LABEL_OPTIONAL " + " } " + " } " + "}", + "foo.proto: Foo.foo_map: " + "TYPE: Enum value in map must define 0 as the first value.\n"); +} + +TEST_F(ValidationErrorTest, Proto3RequiredFields) { + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " field { name:'foo' number:1 label:LABEL_REQUIRED type:TYPE_INT32 } " + "}", + "foo.proto: Foo.foo: OTHER: Required fields are not allowed in " + "proto3.\n"); + + // applied to nested types as well. + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " nested_type { " + " name : 'Bar' " + " field { name:'bar' number:1 label:LABEL_REQUIRED type:TYPE_INT32 } " + " } " + "}", + "foo.proto: Foo.Bar.bar: OTHER: Required fields are not allowed in " + "proto3.\n"); + + // optional and repeated fields are OK. + BuildFile( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " field { name:'foo' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 } " + " field { name:'bar' number:2 label:LABEL_REPEATED type:TYPE_INT32 } " + "}"); +} + +TEST_F(ValidationErrorTest, ValidateProto3DefaultValue) { + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " field { name:'foo' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " default_value: '1' }" + "}", + "foo.proto: Foo.foo: OTHER: Explicit default values are not allowed in " + "proto3.\n"); + + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " nested_type { " + " name : 'Bar' " + " field { name:'bar' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 " + " default_value: '1' }" + " } " + "}", + "foo.proto: Foo.Bar.bar: OTHER: Explicit default values are not allowed " + "in proto3.\n"); +} + +TEST_F(ValidationErrorTest, ValidateProto3ExtensionRange) { + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " field { name:'foo' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 } " + " extension_range { start:10 end:100 } " + "}", + "foo.proto: Foo: OTHER: Extension ranges are not allowed in " + "proto3.\n"); + + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " nested_type { " + " name : 'Bar' " + " field { name:'bar' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 } " + " extension_range { start:10 end:100 } " + " } " + "}", + "foo.proto: Foo.Bar: OTHER: Extension ranges are not allowed in " + "proto3.\n"); +} + +TEST_F(ValidationErrorTest, ValidateProto3MessageSetWireFormat) { + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " options { message_set_wire_format: true } " + "}", + "foo.proto: Foo: OTHER: MessageSet is not supported " + "in proto3.\n"); +} + +TEST_F(ValidationErrorTest, ValidateProto3Enum) { + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "enum_type { " + " name: 'FooEnum' " + " value { name: 'FOO_FOO' number:1 } " + "}", + "foo.proto: FooEnum: OTHER: The first enum value must be " + "zero in proto3.\n"); + + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " enum_type { " + " name: 'FooEnum' " + " value { name: 'FOO_FOO' number:1 } " + " } " + "}", + "foo.proto: Foo.FooEnum: OTHER: The first enum value must be " + "zero in proto3.\n"); + + // valid case. + BuildFile( + "name: 'foo.proto' " + "syntax: 'proto3' " + "enum_type { " + " name: 'FooEnum' " + " value { name: 'FOO_FOO' number:0 } " + "}"); +} + +TEST_F(ValidationErrorTest, ValidateProto3Group) { + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " nested_type { " + " name: 'FooGroup' " + " } " + " field { name:'foo_group' number: 1 label:LABEL_OPTIONAL " + " type: TYPE_GROUP type_name:'FooGroup' } " + "}", + "foo.proto: Foo.foo_group: TYPE: Groups are not supported in proto3 " + "syntax.\n"); +} + + +TEST_F(ValidationErrorTest, ValidateProto3EnumFromProto2) { + // Define an enum in a proto2 file. + BuildFile( + "name: 'foo.proto' " + "package: 'foo' " + "syntax: 'proto2' " + "enum_type { " + " name: 'FooEnum' " + " value { name: 'DEFAULT_OPTION' number:0 } " + "}"); + + // Now try to refer to it. (All tests in the fixture use the same pool, so we + // can refer to the enum above in this definition.) + BuildFileWithErrors( + "name: 'bar.proto' " + "dependency: 'foo.proto' " + "syntax: 'proto3' " + "message_type { " + " name: 'Foo' " + " field { name:'bar' number:1 label:LABEL_OPTIONAL type:TYPE_ENUM " + " type_name: 'foo.FooEnum' }" + "}", + "bar.proto: Foo.bar: TYPE: Enum type \"foo.FooEnum\" is not a proto3 " + "enum, but is used in \"Foo\" which is a proto3 message type.\n"); +} + +TEST_F(ValidationErrorTest, ValidateProto3Extension) { + // Valid for options. + DescriptorPool pool; + FileDescriptorProto file_proto; + // Add "google/protobuf/descriptor.proto". + FileDescriptorProto::descriptor()->file()->CopyTo(&file_proto); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + // Add "foo.proto": + // import "google/protobuf/descriptor.proto"; + // extend google.protobuf.FieldOptions { + // optional int32 option1 = 1000; + // } + file_proto.Clear(); + file_proto.set_name("foo.proto"); + file_proto.set_syntax("proto3"); + file_proto.add_dependency("google/protobuf/descriptor.proto"); + AddExtension(&file_proto, "google.protobuf.FieldOptions", "option1", 1000, + FieldDescriptorProto::LABEL_OPTIONAL, + FieldDescriptorProto::TYPE_INT32); + ASSERT_TRUE(pool.BuildFile(file_proto) != NULL); + + // Copy and change the package of the descriptor.proto + BuildFile( + "name: 'google.protobuf.proto' " + "syntax: 'proto2' " + "message_type { " + " name: 'Container' extension_range { start: 1 end: 1000 } " + "}"); + BuildFileWithErrors( + "name: 'bar.proto' " + "syntax: 'proto3' " + "dependency: 'google.protobuf.proto' " + "extension { " + " name: 'bar' number: 1 label: LABEL_OPTIONAL type: TYPE_INT32 " + " extendee: 'Container' " + "}", + "bar.proto: bar: OTHER: Extensions in proto3 are only allowed for " + "defining options.\n"); +} + +// Test that field names that may conflict in JSON is not allowed by protoc. +TEST_F(ValidationErrorTest, ValidateProto3JsonName) { + // The comparison is case-insensitive. + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type {" + " name: 'Foo'" + " field { name:'name' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name:'Name' number:2 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + "foo.proto: Foo: OTHER: The JSON camcel-case name of field \"Name\" " + "conflicts with field \"name\". This is not allowed in proto3.\n"); + // Underscores are ignored. + BuildFileWithErrors( + "name: 'foo.proto' " + "syntax: 'proto3' " + "message_type {" + " name: 'Foo'" + " field { name:'ab' number:1 label:LABEL_OPTIONAL type:TYPE_INT32 }" + " field { name:'_a__b_' number:2 label:LABEL_OPTIONAL type:TYPE_INT32 }" + "}", + "foo.proto: Foo: OTHER: The JSON camcel-case name of field \"_a__b_\" " + "conflicts with field \"ab\". This is not allowed in proto3.\n"); +} + +// =================================================================== +// DescriptorDatabase + +static void AddToDatabase(SimpleDescriptorDatabase* database, + const char* file_text) { + FileDescriptorProto file_proto; + EXPECT_TRUE(TextFormat::ParseFromString(file_text, &file_proto)); + database->Add(file_proto); +} + +class DatabaseBackedPoolTest : public testing::Test { + protected: + DatabaseBackedPoolTest() {} + + SimpleDescriptorDatabase database_; + + virtual void SetUp() { + AddToDatabase(&database_, + "name: 'foo.proto' " + "message_type { name:'Foo' extension_range { start: 1 end: 100 } } " + "enum_type { name:'TestEnum' value { name:'DUMMY' number:0 } } " + "service { name:'TestService' } "); + AddToDatabase(&database_, + "name: 'bar.proto' " + "dependency: 'foo.proto' " + "message_type { name:'Bar' } " + "extension { name:'foo_ext' extendee: '.Foo' number:5 " + " label:LABEL_OPTIONAL type:TYPE_INT32 } "); + // Baz has an undeclared dependency on Foo. + AddToDatabase(&database_, + "name: 'baz.proto' " + "message_type { " + " name:'Baz' " + " field { name:'foo' number:1 label:LABEL_OPTIONAL type_name:'Foo' } " + "}"); + } + + // We can't inject a file containing errors into a DescriptorPool, so we + // need an actual mock DescriptorDatabase to test errors. + class ErrorDescriptorDatabase : public DescriptorDatabase { + public: + ErrorDescriptorDatabase() {} + ~ErrorDescriptorDatabase() {} + + // implements DescriptorDatabase --------------------------------- + bool FindFileByName(const string& filename, + FileDescriptorProto* output) { + // error.proto and error2.proto cyclically import each other. + if (filename == "error.proto") { + output->Clear(); + output->set_name("error.proto"); + output->add_dependency("error2.proto"); + return true; + } else if (filename == "error2.proto") { + output->Clear(); + output->set_name("error2.proto"); + output->add_dependency("error.proto"); + return true; + } else { + return false; + } + } + bool FindFileContainingSymbol(const string& symbol_name, + FileDescriptorProto* output) { + return false; + } + bool FindFileContainingExtension(const string& containing_type, + int field_number, + FileDescriptorProto* output) { + return false; + } + }; + + // A DescriptorDatabase that counts how many times each method has been + // called and forwards to some other DescriptorDatabase. + class CallCountingDatabase : public DescriptorDatabase { + public: + CallCountingDatabase(DescriptorDatabase* wrapped_db) + : wrapped_db_(wrapped_db) { + Clear(); + } + ~CallCountingDatabase() {} + + DescriptorDatabase* wrapped_db_; + + int call_count_; + + void Clear() { + call_count_ = 0; + } + + // implements DescriptorDatabase --------------------------------- + bool FindFileByName(const string& filename, + FileDescriptorProto* output) { + ++call_count_; + return wrapped_db_->FindFileByName(filename, output); + } + bool FindFileContainingSymbol(const string& symbol_name, + FileDescriptorProto* output) { + ++call_count_; + return wrapped_db_->FindFileContainingSymbol(symbol_name, output); + } + bool FindFileContainingExtension(const string& containing_type, + int field_number, + FileDescriptorProto* output) { + ++call_count_; + return wrapped_db_->FindFileContainingExtension( + containing_type, field_number, output); + } + }; + + // A DescriptorDatabase which falsely always returns foo.proto when searching + // for any symbol or extension number. This shouldn't cause the + // DescriptorPool to reload foo.proto if it is already loaded. + class FalsePositiveDatabase : public DescriptorDatabase { + public: + FalsePositiveDatabase(DescriptorDatabase* wrapped_db) + : wrapped_db_(wrapped_db) {} + ~FalsePositiveDatabase() {} + + DescriptorDatabase* wrapped_db_; + + // implements DescriptorDatabase --------------------------------- + bool FindFileByName(const string& filename, + FileDescriptorProto* output) { + return wrapped_db_->FindFileByName(filename, output); + } + bool FindFileContainingSymbol(const string& symbol_name, + FileDescriptorProto* output) { + return FindFileByName("foo.proto", output); + } + bool FindFileContainingExtension(const string& containing_type, + int field_number, + FileDescriptorProto* output) { + return FindFileByName("foo.proto", output); + } + }; +}; + +TEST_F(DatabaseBackedPoolTest, FindFileByName) { + DescriptorPool pool(&database_); + + const FileDescriptor* foo = pool.FindFileByName("foo.proto"); + ASSERT_TRUE(foo != NULL); + EXPECT_EQ("foo.proto", foo->name()); + ASSERT_EQ(1, foo->message_type_count()); + EXPECT_EQ("Foo", foo->message_type(0)->name()); + + EXPECT_EQ(foo, pool.FindFileByName("foo.proto")); + + EXPECT_TRUE(pool.FindFileByName("no_such_file.proto") == NULL); +} + +TEST_F(DatabaseBackedPoolTest, FindDependencyBeforeDependent) { + DescriptorPool pool(&database_); + + const FileDescriptor* foo = pool.FindFileByName("foo.proto"); + ASSERT_TRUE(foo != NULL); + EXPECT_EQ("foo.proto", foo->name()); + ASSERT_EQ(1, foo->message_type_count()); + EXPECT_EQ("Foo", foo->message_type(0)->name()); + + const FileDescriptor* bar = pool.FindFileByName("bar.proto"); + ASSERT_TRUE(bar != NULL); + EXPECT_EQ("bar.proto", bar->name()); + ASSERT_EQ(1, bar->message_type_count()); + EXPECT_EQ("Bar", bar->message_type(0)->name()); + + ASSERT_EQ(1, bar->dependency_count()); + EXPECT_EQ(foo, bar->dependency(0)); +} + +TEST_F(DatabaseBackedPoolTest, FindDependentBeforeDependency) { + DescriptorPool pool(&database_); + + const FileDescriptor* bar = pool.FindFileByName("bar.proto"); + ASSERT_TRUE(bar != NULL); + EXPECT_EQ("bar.proto", bar->name()); + ASSERT_EQ(1, bar->message_type_count()); + ASSERT_EQ("Bar", bar->message_type(0)->name()); + + const FileDescriptor* foo = pool.FindFileByName("foo.proto"); + ASSERT_TRUE(foo != NULL); + EXPECT_EQ("foo.proto", foo->name()); + ASSERT_EQ(1, foo->message_type_count()); + ASSERT_EQ("Foo", foo->message_type(0)->name()); + + ASSERT_EQ(1, bar->dependency_count()); + EXPECT_EQ(foo, bar->dependency(0)); +} + +TEST_F(DatabaseBackedPoolTest, FindFileContainingSymbol) { + DescriptorPool pool(&database_); + + const FileDescriptor* file = pool.FindFileContainingSymbol("Foo"); + ASSERT_TRUE(file != NULL); + EXPECT_EQ("foo.proto", file->name()); + EXPECT_EQ(file, pool.FindFileByName("foo.proto")); + + EXPECT_TRUE(pool.FindFileContainingSymbol("NoSuchSymbol") == NULL); +} + +TEST_F(DatabaseBackedPoolTest, FindMessageTypeByName) { + DescriptorPool pool(&database_); + + const Descriptor* type = pool.FindMessageTypeByName("Foo"); + ASSERT_TRUE(type != NULL); + EXPECT_EQ("Foo", type->name()); + EXPECT_EQ(type->file(), pool.FindFileByName("foo.proto")); + + EXPECT_TRUE(pool.FindMessageTypeByName("NoSuchType") == NULL); +} + +TEST_F(DatabaseBackedPoolTest, FindExtensionByNumber) { + DescriptorPool pool(&database_); + + const Descriptor* foo = pool.FindMessageTypeByName("Foo"); + ASSERT_TRUE(foo != NULL); + + const FieldDescriptor* extension = pool.FindExtensionByNumber(foo, 5); + ASSERT_TRUE(extension != NULL); + EXPECT_EQ("foo_ext", extension->name()); + EXPECT_EQ(extension->file(), pool.FindFileByName("bar.proto")); + + EXPECT_TRUE(pool.FindExtensionByNumber(foo, 12) == NULL); +} + +TEST_F(DatabaseBackedPoolTest, FindAllExtensions) { + DescriptorPool pool(&database_); + + const Descriptor* foo = pool.FindMessageTypeByName("Foo"); + + for (int i = 0; i < 2; ++i) { + // Repeat the lookup twice, to check that we get consistent + // results despite the fallback database lookup mutating the pool. + vector extensions; + pool.FindAllExtensions(foo, &extensions); + ASSERT_EQ(1, extensions.size()); + EXPECT_EQ(5, extensions[0]->number()); + } +} + +TEST_F(DatabaseBackedPoolTest, ErrorWithoutErrorCollector) { + ErrorDescriptorDatabase error_database; + DescriptorPool pool(&error_database); + + vector errors; + + { + ScopedMemoryLog log; + EXPECT_TRUE(pool.FindFileByName("error.proto") == NULL); + errors = log.GetMessages(ERROR); + } + + EXPECT_FALSE(errors.empty()); +} + +TEST_F(DatabaseBackedPoolTest, ErrorWithErrorCollector) { + ErrorDescriptorDatabase error_database; + MockErrorCollector error_collector; + DescriptorPool pool(&error_database, &error_collector); + + EXPECT_TRUE(pool.FindFileByName("error.proto") == NULL); + EXPECT_EQ( + "error.proto: error.proto: OTHER: File recursively imports itself: " + "error.proto -> error2.proto -> error.proto\n" + "error2.proto: error2.proto: OTHER: Import \"error.proto\" was not " + "found or had errors.\n" + "error.proto: error.proto: OTHER: Import \"error2.proto\" was not " + "found or had errors.\n", + error_collector.text_); +} + +TEST_F(DatabaseBackedPoolTest, UndeclaredDependencyOnUnbuiltType) { + // Check that we find and report undeclared dependencies on types that exist + // in the descriptor database but that have not not been built yet. + MockErrorCollector error_collector; + DescriptorPool pool(&database_, &error_collector); + EXPECT_TRUE(pool.FindMessageTypeByName("Baz") == NULL); + EXPECT_EQ( + "baz.proto: Baz.foo: TYPE: \"Foo\" seems to be defined in \"foo.proto\", " + "which is not imported by \"baz.proto\". To use it here, please add " + "the necessary import.\n", + error_collector.text_); +} + +TEST_F(DatabaseBackedPoolTest, RollbackAfterError) { + // Make sure that all traces of bad types are removed from the pool. This used + // to be b/4529436, due to the fact that a symbol resolution failure could + // potentially cause another file to be recursively built, which would trigger + // a checkpoint _past_ possibly invalid symbols. + // Baz is defined in the database, but the file is invalid because it is + // missing a necessary import. + DescriptorPool pool(&database_); + EXPECT_TRUE(pool.FindMessageTypeByName("Baz") == NULL); + // Make sure that searching again for the file or the type fails. + EXPECT_TRUE(pool.FindFileByName("baz.proto") == NULL); + EXPECT_TRUE(pool.FindMessageTypeByName("Baz") == NULL); +} + +TEST_F(DatabaseBackedPoolTest, UnittestProto) { + // Try to load all of unittest.proto from a DescriptorDatabase. This should + // thoroughly test all paths through DescriptorBuilder to insure that there + // are no deadlocking problems when pool_->mutex_ is non-NULL. + const FileDescriptor* original_file = + protobuf_unittest::TestAllTypes::descriptor()->file(); + + DescriptorPoolDatabase database(*DescriptorPool::generated_pool()); + DescriptorPool pool(&database); + const FileDescriptor* file_from_database = + pool.FindFileByName(original_file->name()); + + ASSERT_TRUE(file_from_database != NULL); + + FileDescriptorProto original_file_proto; + original_file->CopyTo(&original_file_proto); + + FileDescriptorProto file_from_database_proto; + file_from_database->CopyTo(&file_from_database_proto); + + EXPECT_EQ(original_file_proto.DebugString(), + file_from_database_proto.DebugString()); + + // Also verify that CopyTo() did not omit any information. + EXPECT_EQ(original_file->DebugString(), + file_from_database->DebugString()); +} + +TEST_F(DatabaseBackedPoolTest, DoesntRetryDbUnnecessarily) { + // Searching for a child of an existing descriptor should never fall back + // to the DescriptorDatabase even if it isn't found, because we know all + // children are already loaded. + CallCountingDatabase call_counter(&database_); + DescriptorPool pool(&call_counter); + + const FileDescriptor* file = pool.FindFileByName("foo.proto"); + ASSERT_TRUE(file != NULL); + const Descriptor* foo = pool.FindMessageTypeByName("Foo"); + ASSERT_TRUE(foo != NULL); + const EnumDescriptor* test_enum = pool.FindEnumTypeByName("TestEnum"); + ASSERT_TRUE(test_enum != NULL); + const ServiceDescriptor* test_service = pool.FindServiceByName("TestService"); + ASSERT_TRUE(test_service != NULL); + + EXPECT_NE(0, call_counter.call_count_); + call_counter.Clear(); + + EXPECT_TRUE(foo->FindFieldByName("no_such_field") == NULL); + EXPECT_TRUE(foo->FindExtensionByName("no_such_extension") == NULL); + EXPECT_TRUE(foo->FindNestedTypeByName("NoSuchMessageType") == NULL); + EXPECT_TRUE(foo->FindEnumTypeByName("NoSuchEnumType") == NULL); + EXPECT_TRUE(foo->FindEnumValueByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(test_enum->FindValueByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(test_service->FindMethodByName("NoSuchMethod") == NULL); + + EXPECT_TRUE(file->FindMessageTypeByName("NoSuchMessageType") == NULL); + EXPECT_TRUE(file->FindEnumTypeByName("NoSuchEnumType") == NULL); + EXPECT_TRUE(file->FindEnumValueByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(file->FindServiceByName("NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(file->FindExtensionByName("no_such_extension") == NULL); + + EXPECT_TRUE(pool.FindFileContainingSymbol("Foo.no.such.field") == NULL); + EXPECT_TRUE(pool.FindFileContainingSymbol("Foo.no_such_field") == NULL); + EXPECT_TRUE(pool.FindMessageTypeByName("Foo.NoSuchMessageType") == NULL); + EXPECT_TRUE(pool.FindFieldByName("Foo.no_such_field") == NULL); + EXPECT_TRUE(pool.FindExtensionByName("Foo.no_such_extension") == NULL); + EXPECT_TRUE(pool.FindEnumTypeByName("Foo.NoSuchEnumType") == NULL); + EXPECT_TRUE(pool.FindEnumValueByName("Foo.NO_SUCH_VALUE") == NULL); + EXPECT_TRUE(pool.FindMethodByName("TestService.NoSuchMethod") == NULL); + + EXPECT_EQ(0, call_counter.call_count_); +} + +TEST_F(DatabaseBackedPoolTest, DoesntReloadFilesUncesessarily) { + // If FindFileContainingSymbol() or FindFileContainingExtension() return a + // file that is already in the DescriptorPool, it should not attempt to + // reload the file. + FalsePositiveDatabase false_positive_database(&database_); + MockErrorCollector error_collector; + DescriptorPool pool(&false_positive_database, &error_collector); + + // First make sure foo.proto is loaded. + const Descriptor* foo = pool.FindMessageTypeByName("Foo"); + ASSERT_TRUE(foo != NULL); + + // Try inducing false positives. + EXPECT_TRUE(pool.FindMessageTypeByName("NoSuchSymbol") == NULL); + EXPECT_TRUE(pool.FindExtensionByNumber(foo, 22) == NULL); + + // No errors should have been reported. (If foo.proto was incorrectly + // loaded multiple times, errors would have been reported.) + EXPECT_EQ("", error_collector.text_); +} + +// DescriptorDatabase that attempts to induce exponentially-bad performance +// in DescriptorPool. For every positive N, the database contains a file +// fileN.proto, which defines a message MessageN, which contains fields of +// type MessageK for all K in [0,N). Message0 is not defined anywhere +// (file0.proto exists, but is empty), so every other file and message type +// will fail to build. +// +// If the DescriptorPool is not careful to memoize errors, an attempt to +// build a descriptor for MessageN can require O(2^N) time. +class ExponentialErrorDatabase : public DescriptorDatabase { + public: + ExponentialErrorDatabase() {} + ~ExponentialErrorDatabase() {} + + // implements DescriptorDatabase --------------------------------- + bool FindFileByName(const string& filename, + FileDescriptorProto* output) { + int file_num = -1; + FullMatch(filename, "file", ".proto", &file_num); + if (file_num > -1) { + return PopulateFile(file_num, output); + } else { + return false; + } + } + bool FindFileContainingSymbol(const string& symbol_name, + FileDescriptorProto* output) { + int file_num = -1; + FullMatch(symbol_name, "Message", "", &file_num); + if (file_num > 0) { + return PopulateFile(file_num, output); + } else { + return false; + } + } + bool FindFileContainingExtension(const string& containing_type, + int field_number, + FileDescriptorProto* output) { + return false; + } + + private: + void FullMatch(const string& name, + const string& begin_with, + const string& end_with, + int* file_num) { + int begin_size = begin_with.size(); + int end_size = end_with.size(); + if (name.substr(0, begin_size) != begin_with || + name.substr(name.size()- end_size, end_size) != end_with) { + return; + } + safe_strto32(name.substr(begin_size, name.size() - end_size - begin_size), + file_num); + } + + bool PopulateFile(int file_num, FileDescriptorProto* output) { + using strings::Substitute; + GOOGLE_CHECK_GE(file_num, 0); + output->Clear(); + output->set_name(Substitute("file$0.proto", file_num)); + // file0.proto doesn't define Message0 + if (file_num > 0) { + DescriptorProto* message = output->add_message_type(); + message->set_name(Substitute("Message$0", file_num)); + for (int i = 0; i < file_num; ++i) { + output->add_dependency(Substitute("file$0.proto", i)); + FieldDescriptorProto* field = message->add_field(); + field->set_name(Substitute("field$0", i)); + field->set_number(i); + field->set_label(FieldDescriptorProto::LABEL_OPTIONAL); + field->set_type(FieldDescriptorProto::TYPE_MESSAGE); + field->set_type_name(Substitute("Message$0", i)); + } + } + return true; + } +}; + +TEST_F(DatabaseBackedPoolTest, DoesntReloadKnownBadFiles) { + ExponentialErrorDatabase error_database; + DescriptorPool pool(&error_database); + + GOOGLE_LOG(INFO) << "A timeout in this test probably indicates a real bug."; + + EXPECT_TRUE(pool.FindFileByName("file40.proto") == NULL); + EXPECT_TRUE(pool.FindMessageTypeByName("Message40") == NULL); +} + +TEST_F(DatabaseBackedPoolTest, DoesntFallbackOnWrongType) { + // If a lookup finds a symbol of the wrong type (e.g. we pass a type name + // to FindFieldByName()), we should fail fast, without checking the fallback + // database. + CallCountingDatabase call_counter(&database_); + DescriptorPool pool(&call_counter); + + const FileDescriptor* file = pool.FindFileByName("foo.proto"); + ASSERT_TRUE(file != NULL); + const Descriptor* foo = pool.FindMessageTypeByName("Foo"); + ASSERT_TRUE(foo != NULL); + const EnumDescriptor* test_enum = pool.FindEnumTypeByName("TestEnum"); + ASSERT_TRUE(test_enum != NULL); + + EXPECT_NE(0, call_counter.call_count_); + call_counter.Clear(); + + EXPECT_TRUE(pool.FindMessageTypeByName("TestEnum") == NULL); + EXPECT_TRUE(pool.FindFieldByName("Foo") == NULL); + EXPECT_TRUE(pool.FindExtensionByName("Foo") == NULL); + EXPECT_TRUE(pool.FindEnumTypeByName("Foo") == NULL); + EXPECT_TRUE(pool.FindEnumValueByName("Foo") == NULL); + EXPECT_TRUE(pool.FindServiceByName("Foo") == NULL); + EXPECT_TRUE(pool.FindMethodByName("Foo") == NULL); + + EXPECT_EQ(0, call_counter.call_count_); +} + +// =================================================================== + +class AbortingErrorCollector : public DescriptorPool::ErrorCollector { + public: + AbortingErrorCollector() {} + + virtual void AddError( + const string &filename, + const string &element_name, + const Message *message, + ErrorLocation location, + const string &error_message) { + GOOGLE_LOG(FATAL) << "AddError() called unexpectedly: " << filename << " [" + << element_name << "]: " << error_message; + } + private: + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AbortingErrorCollector); +}; + +// A source tree containing only one file. +class SingletonSourceTree : public compiler::SourceTree { + public: + SingletonSourceTree(const string& filename, const string& contents) + : filename_(filename), contents_(contents) {} + + virtual io::ZeroCopyInputStream* Open(const string& filename) { + return filename == filename_ ? + new io::ArrayInputStream(contents_.data(), contents_.size()) : NULL; + } + + private: + const string filename_; + const string contents_; + + GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SingletonSourceTree); +}; + +const char *const kSourceLocationTestInput = + "syntax = \"proto2\";\n" + "message A {\n" + " optional int32 a = 1;\n" + " message B {\n" + " required double b = 1;\n" + " }\n" + "}\n" + "enum Indecision {\n" + " YES = 1;\n" + " NO = 2;\n" + " MAYBE = 3;\n" + "}\n" + "service S {\n" + " rpc Method(A) returns (A.B);\n" + // Put an empty line here to make the source location range match. + "\n" + "}\n" + "message MessageWithExtensions {\n" + " extensions 1000 to max;\n" + "}\n" + "extend MessageWithExtensions {\n" + " optional int32 int32_extension = 1001;\n" + "}\n" + "message C {\n" + " extend MessageWithExtensions {\n" + " optional C message_extension = 1002;\n" + " }\n" + "}\n"; + +class SourceLocationTest : public testing::Test { + public: + SourceLocationTest() + : source_tree_("/test/test.proto", kSourceLocationTestInput), + db_(&source_tree_), + pool_(&db_, &collector_) {} + + static string PrintSourceLocation(const SourceLocation &loc) { + return strings::Substitute("$0:$1-$2:$3", + 1 + loc.start_line, + 1 + loc.start_column, + 1 + loc.end_line, + 1 + loc.end_column); + } + + private: + AbortingErrorCollector collector_; + SingletonSourceTree source_tree_; + compiler::SourceTreeDescriptorDatabase db_; + + protected: + DescriptorPool pool_; +}; + +// TODO(adonovan): implement support for option fields and for +// subparts of declarations. + +TEST_F(SourceLocationTest, GetSourceLocation) { + SourceLocation loc; + + const FileDescriptor *file_desc = + GOOGLE_CHECK_NOTNULL(pool_.FindFileByName("/test/test.proto")); + + const Descriptor *a_desc = file_desc->FindMessageTypeByName("A"); + EXPECT_TRUE(a_desc->GetSourceLocation(&loc)); + EXPECT_EQ("2:1-7:2", PrintSourceLocation(loc)); + + const Descriptor *a_b_desc = a_desc->FindNestedTypeByName("B"); + EXPECT_TRUE(a_b_desc->GetSourceLocation(&loc)); + EXPECT_EQ("4:3-6:4", PrintSourceLocation(loc)); + + const EnumDescriptor *e_desc = file_desc->FindEnumTypeByName("Indecision"); + EXPECT_TRUE(e_desc->GetSourceLocation(&loc)); + EXPECT_EQ("8:1-12:2", PrintSourceLocation(loc)); + + const EnumValueDescriptor *yes_desc = e_desc->FindValueByName("YES"); + EXPECT_TRUE(yes_desc->GetSourceLocation(&loc)); + EXPECT_EQ("9:3-9:13", PrintSourceLocation(loc)); + + const ServiceDescriptor *s_desc = file_desc->FindServiceByName("S"); + EXPECT_TRUE(s_desc->GetSourceLocation(&loc)); + EXPECT_EQ("13:1-16:2", PrintSourceLocation(loc)); + + const MethodDescriptor *m_desc = s_desc->FindMethodByName("Method"); + EXPECT_TRUE(m_desc->GetSourceLocation(&loc)); + EXPECT_EQ("14:3-14:31", PrintSourceLocation(loc)); + +} + +TEST_F(SourceLocationTest, ExtensionSourceLocation) { + SourceLocation loc; + + const FileDescriptor *file_desc = + GOOGLE_CHECK_NOTNULL(pool_.FindFileByName("/test/test.proto")); + + const FieldDescriptor *int32_extension_desc = + file_desc->FindExtensionByName("int32_extension"); + EXPECT_TRUE(int32_extension_desc->GetSourceLocation(&loc)); + EXPECT_EQ("21:3-21:41", PrintSourceLocation(loc)); + + const Descriptor *c_desc = file_desc->FindMessageTypeByName("C"); + EXPECT_TRUE(c_desc->GetSourceLocation(&loc)); + EXPECT_EQ("23:1-27:2", PrintSourceLocation(loc)); + + const FieldDescriptor *message_extension_desc = + c_desc->FindExtensionByName("message_extension"); + EXPECT_TRUE(message_extension_desc->GetSourceLocation(&loc)); + EXPECT_EQ("25:5-25:41", PrintSourceLocation(loc)); +} + +// Missing SourceCodeInfo doesn't cause crash: +TEST_F(SourceLocationTest, GetSourceLocation_MissingSourceCodeInfo) { + SourceLocation loc; + + const FileDescriptor *file_desc = + GOOGLE_CHECK_NOTNULL(pool_.FindFileByName("/test/test.proto")); + + FileDescriptorProto proto; + file_desc->CopyTo(&proto); // Note, this discards the SourceCodeInfo. + EXPECT_FALSE(proto.has_source_code_info()); + + DescriptorPool bad1_pool(&pool_); + const FileDescriptor* bad1_file_desc = + GOOGLE_CHECK_NOTNULL(bad1_pool.BuildFile(proto)); + const Descriptor *bad1_a_desc = bad1_file_desc->FindMessageTypeByName("A"); + EXPECT_FALSE(bad1_a_desc->GetSourceLocation(&loc)); +} + +// Corrupt SourceCodeInfo doesn't cause crash: +TEST_F(SourceLocationTest, GetSourceLocation_BogusSourceCodeInfo) { + SourceLocation loc; + + const FileDescriptor *file_desc = + GOOGLE_CHECK_NOTNULL(pool_.FindFileByName("/test/test.proto")); + + FileDescriptorProto proto; + file_desc->CopyTo(&proto); // Note, this discards the SourceCodeInfo. + EXPECT_FALSE(proto.has_source_code_info()); + SourceCodeInfo_Location *loc_msg = + proto.mutable_source_code_info()->add_location(); + loc_msg->add_path(1); + loc_msg->add_path(2); + loc_msg->add_path(3); + loc_msg->add_span(4); + loc_msg->add_span(5); + loc_msg->add_span(6); + + DescriptorPool bad2_pool(&pool_); + const FileDescriptor* bad2_file_desc = + GOOGLE_CHECK_NOTNULL(bad2_pool.BuildFile(proto)); + const Descriptor *bad2_a_desc = bad2_file_desc->FindMessageTypeByName("A"); + EXPECT_FALSE(bad2_a_desc->GetSourceLocation(&loc)); +} + +// =================================================================== + +const char* const kCopySourceCodeInfoToTestInput = + "syntax = \"proto2\";\n" + "message Foo {}\n"; + +// Required since source code information is not preserved by +// FileDescriptorTest. +class CopySourceCodeInfoToTest : public testing::Test { + public: + CopySourceCodeInfoToTest() + : source_tree_("/test/test.proto", kCopySourceCodeInfoToTestInput), + db_(&source_tree_), + pool_(&db_, &collector_) {} + + private: + AbortingErrorCollector collector_; + SingletonSourceTree source_tree_; + compiler::SourceTreeDescriptorDatabase db_; + + protected: + DescriptorPool pool_; +}; + +TEST_F(CopySourceCodeInfoToTest, CopyTo_DoesNotCopySourceCodeInfo) { + const FileDescriptor* file_desc = + GOOGLE_CHECK_NOTNULL(pool_.FindFileByName("/test/test.proto")); + FileDescriptorProto file_desc_proto; + ASSERT_FALSE(file_desc_proto.has_source_code_info()); + + file_desc->CopyTo(&file_desc_proto); + EXPECT_FALSE(file_desc_proto.has_source_code_info()); +} + +TEST_F(CopySourceCodeInfoToTest, CopySourceCodeInfoTo) { + const FileDescriptor* file_desc = + GOOGLE_CHECK_NOTNULL(pool_.FindFileByName("/test/test.proto")); + FileDescriptorProto file_desc_proto; + ASSERT_FALSE(file_desc_proto.has_source_code_info()); + + file_desc->CopySourceCodeInfoTo(&file_desc_proto); + const SourceCodeInfo& info = file_desc_proto.source_code_info(); + ASSERT_EQ(4, info.location_size()); + // Get the Foo message location + const SourceCodeInfo_Location& foo_location = info.location(2); + ASSERT_EQ(2, foo_location.path_size()); + EXPECT_EQ(FileDescriptorProto::kMessageTypeFieldNumber, foo_location.path(0)); + EXPECT_EQ(0, foo_location.path(1)); // Foo is the first message defined + ASSERT_EQ(3, foo_location.span_size()); // Foo spans one line + EXPECT_EQ(1, foo_location.span(0)); // Foo is declared on line 1 + EXPECT_EQ(0, foo_location.span(1)); // Foo starts at column 0 + EXPECT_EQ(14, foo_location.span(2)); // Foo ends on column 14 +} + +// =================================================================== + + +} // namespace descriptor_unittest +} // namespace protobuf +} // namespace google diff --git a/lib/cpplint_1.4.5/samples/silly-sample/filters.def b/lib/cpplint_1.4.5/samples/silly-sample/filters.def new file mode 100644 index 00000000000..748299f45c1 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/silly-sample/filters.def @@ -0,0 +1,28 @@ +--counting=toplevel --filter=-whitespace,-build/include_what_you_use src/*.cpp +1 +6 +Done processing src/sillycode.cpp +Category 'legal' errors found: 1 +Category 'readability' errors found: 5 +Category 'runtime' errors found: 12 +Total errors found: 18 + +src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] +src/sillycode.cpp:9: Is this a non-const reference? If so, make const or use a pointer: vector& v [runtime/references] [2] +src/sillycode.cpp:35: If/else bodies with multiple statements require braces [readability/braces] [4] +src/sillycode.cpp:61: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] +src/sillycode.cpp:71: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] +src/sillycode.cpp:80: Constructors callable with one argument should be marked explicit. [runtime/explicit] [5] +src/sillycode.cpp:113: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] +src/sillycode.cpp:113: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] +src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] +src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] +src/sillycode.cpp:166: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size. [runtime/arrays] [1] +src/sillycode.cpp:173: Static/global string variables are not permitted. [runtime/string] [4] +src/sillycode.cpp:194: If an else has a brace on one side, it should have it on both [readability/braces] [5] +src/sillycode.cpp:197: If an else has a brace on one side, it should have it on both [readability/braces] [5] +src/sillycode.cpp:203: Static/global string variables are not permitted. [runtime/string] [4] +src/sillycode.cpp:222: Static/global string variables are not permitted. [runtime/string] [4] +src/sillycode.cpp:223: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] +src/sillycode.cpp:238: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] + diff --git a/lib/cpplint_1.4.5/samples/silly-sample/simple.def b/lib/cpplint_1.4.5/samples/silly-sample/simple.def new file mode 100644 index 00000000000..c59869d8d4b --- /dev/null +++ b/lib/cpplint_1.4.5/samples/silly-sample/simple.def @@ -0,0 +1,113 @@ +src/*.cpp +1 +3 +Done processing src/sillycode.cpp +Total errors found: 106 + +src/sillycode.cpp:0: No copyright message found. You should have a line: "Copyright [year] " [legal/copyright] [5] +src/sillycode.cpp:3: public: should be indented +1 space inside class Date [whitespace/indent] [3] +src/sillycode.cpp:9: Is this a non-const reference? If so, make const or use a pointer: vector& v [runtime/references] [2] +src/sillycode.cpp:10: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:34: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:35: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:35: If/else bodies with multiple statements require braces [readability/braces] [4] +src/sillycode.cpp:44: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:44: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:50: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:55: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:55: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:59: public: should be indented +1 space inside class X [whitespace/indent] [3] +src/sillycode.cpp:60: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:60: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:61: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:61: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] +src/sillycode.cpp:69: public: should be indented +1 space inside class X2 [whitespace/indent] [3] +src/sillycode.cpp:70: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:71: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:71: Single-parameter constructors should be marked explicit. [runtime/explicit] [5] +src/sillycode.cpp:75: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:75: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:79: public: should be indented +1 space inside class X3 [whitespace/indent] [3] +src/sillycode.cpp:80: Constructors callable with one argument should be marked explicit. [runtime/explicit] [5] +src/sillycode.cpp:81: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:81: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/sillycode.cpp:89: public: should be indented +1 space inside class Foo [whitespace/indent] [3] +src/sillycode.cpp:95: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:105: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:106: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:106: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:108: public: should be indented +1 space inside class Vector2 [whitespace/indent] [3] +src/sillycode.cpp:113: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] +src/sillycode.cpp:113: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] +src/sillycode.cpp:114: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:115: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:115: Missing space after , [whitespace/comma] [3] +src/sillycode.cpp:117: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3] +src/sillycode.cpp:117: Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4] +src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& a [runtime/references] [2] +src/sillycode.cpp:118: Is this a non-const reference? If so, make const or use a pointer: N::X& b [runtime/references] [2] +src/sillycode.cpp:119: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:120: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:120: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:121: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:121: Missing space after , [whitespace/comma] [3] +src/sillycode.cpp:138: Missing spaces around = [whitespace/operators] [4] +src/sillycode.cpp:139: Missing spaces around = [whitespace/operators] [4] +src/sillycode.cpp:144: Missing spaces around = [whitespace/operators] [4] +src/sillycode.cpp:145: Missing spaces around = [whitespace/operators] [4] +src/sillycode.cpp:150: Missing spaces around = [whitespace/operators] [4] +src/sillycode.cpp:151: Missing spaces around = [whitespace/operators] [4] +src/sillycode.cpp:157: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:159: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:161: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:163: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:166: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:166: Do not use variable-length arrays. Use an appropriately named ('k' followed by CamelCase) compile-time constant for the size. [runtime/arrays] [1] +src/sillycode.cpp:170: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:173: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:173: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:173: Static/global string variables are not permitted. [runtime/string] [4] +src/sillycode.cpp:174: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:174: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:179: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:179: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:185: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:185: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:190: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:190: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:192: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:192: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:194: If an else has a brace on one side, it should have it on both [readability/braces] [5] +src/sillycode.cpp:197: An else should appear on the same line as the preceding } [whitespace/newline] [4] +src/sillycode.cpp:197: If an else has a brace on one side, it should have it on both [readability/braces] [5] +src/sillycode.cpp:203: Missing space before { [whitespace/braces] [5] +src/sillycode.cpp:203: Static/global string variables are not permitted. [runtime/string] [4] +src/sillycode.cpp:204: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:204: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:209: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:212: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/sillycode.cpp:213: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:213: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:214: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:214: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:215: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:215: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:220: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:220: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:222: Static/global string variables are not permitted. [runtime/string] [4] +src/sillycode.cpp:223: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:223: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] +src/sillycode.cpp:231: public: should be indented +1 space inside class derived2 [whitespace/indent] [3] +src/sillycode.cpp:236: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:238: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/sillycode.cpp:238: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:238: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] +src/sillycode.cpp:239: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/sillycode.cpp:239: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:248: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:249: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:252: Tab found; better to use spaces [whitespace/tab] [1] +src/sillycode.cpp:252: At least two spaces is best between code and comments [whitespace/comments] [2] +src/sillycode.cpp:255: Empty loop bodies should use {} or continue [whitespace/empty_loop_body] [5] +src/sillycode.cpp:255: At least two spaces is best between code and comments [whitespace/comments] [2] + diff --git a/lib/cpplint_1.4.5/samples/silly-sample/src/sillycode.cpp b/lib/cpplint_1.4.5/samples/silly-sample/src/sillycode.cpp new file mode 100644 index 00000000000..0f3915f147d --- /dev/null +++ b/lib/cpplint_1.4.5/samples/silly-sample/src/sillycode.cpp @@ -0,0 +1,257 @@ +class Date { + // ... +public: + Month month() const; // do + int month(); // don't + // ... +}; + +void do_something(vector& v) +{ + string val; + cin >> val; + // ... + int index = 0; // bad + for (int i = 0; i < v.size(); ++i) + if (v[i] == val) { + index = i; + break; + } + // ... +} + +struct X { + char ch; + int i; + string s; + char ch2; + + X& operator=(const X& a); + X(const X&); +}; + +X waste(const char* p) +{ + if (p == nullptr) throw Nullptr_error{}; + int n = strlen(p); + auto buf = new char[n]; + if (buf == nullptr) throw Allocation_error{}; + for (int i = 0; i < n; ++i) buf[i] = p[i]; + // ... manipulate buffer ... + X x; + x.ch = 'a'; + x.s = string(n); // give x.s space for *ps + for (int i = 0; i < x.s.size(); ++i) x.s[i] = buf[i]; // copy buf into x.s + delete buf; + return x; +} + +void driver() +{ + X x = waste("Typical argument"); + // ... +} + +class X { // BAD + int i; + string s; + int j; +public: + X() :i{666}, s{"qqq"} { } // j is uninitialized + X(int ii) :i{ii} {} // s is "" and j is uninitialized + // ... +}; + +class X2 { + int i {666}; + string s {"qqq"}; + int j {0}; +public: + X2() = default; // all members are initialized to their defaults + X2(int ii) :i{ii} {} // s and j initialized to their defaults + // ... +}; + +class X3 { // BAD: inexplicit, argument passing overhead + int i; + string s; + int j; +public: + X3(int ii = 666, const string& ss = "qqq", int jj = 0) + :i{ii}, s{ss}, j{jj} { } // all members are initialized to their defaults + // ... +}; + + +class Foo { + string s; + int i; +public: + Foo& operator=(Foo&& a); + // ... +}; + +Foo& Foo::operator=(Foo&& a) // OK, but there is a cost +{ + if (this == &a) return *this; // this line is redundant + s = std::move(a.s); + i = a.i; + return *this; +} + +template +class Vector2 { + // ... + Vector2(Vector2&& a) { *this = a; } // just use the copy + Vector2& operator=(Vector2&& a) { *this = a; } // just use the copy + //... +public: + T* elem; + int sz; +}; + +void f2(N::X& a, N::X& b) +{ + swap(a,b); // calls N::swap +} + +void f3(N::X& a, N::X& b) +{ + using std::swap; // make std::swap available + swap(a,b); // calls N::swap if it exists, otherwise std::swap +} + + +// webcolors.h (third party header) +#define RED 0xFF0000 +#define GREEN 0x00FF00 +#define BLUE 0x0000FF + +// productinfo.h +// The following define product subtypes based on color +#define RED 0 +#define PURPLE 1 +#define BLUE 2 + +int webby = BLUE; // webby==2; probably not what was desired + +enum class Webcolor { red=0xFF0000, green=0x00FF00, blue=0x0000FF }; +enum class Productinfo { red=0, purple=1, blue=2 }; + +int webby = blue; // error: be specific +Webcolor webby = Webcolor::blue; + +enum Webcolor { red=0xFF0000, green=0x00FF00, blue=0x0000FF }; +enum Productinfo { red=0, purple=1, blue=2 }; + +int webby = blue; // error, ambiguous: be specific +Webcolor webby = Webcolor::blue; + +enum class Webcolor { red=0xFF0000, green=0x00FF00, blue=0x0000FF }; +enum class Productinfo { red=0, purple=1, blue=2 }; + +int webby = blue; // error: blue undefined in this scope +Webcolor webby = Webcolor::blue; + + +void sink(unique_ptr); // consumes the widget + +void sink(widget*); // just uses the widget + +void thinko(const unique_ptr&); // usually not what you want + +void reseat(unique_ptr&); // "will" or "might" reseat pointer + +constexpr int max = 8*1024; +int buf[max]; // OK, but suspicious: uninitialized +f.read(buf, max); + +constexpr int max = 8*1024; +int buf[max] = {0}; // better in some situations +f.read(buf, max); + +string s; // s is default initialized to "" +cin >> s; // s expands to hold the string + + +error_code ec; +Value v = [&] { + auto p = get_value(); // get_value() returns a pair + ec = p.first; + return p.second; +}(); + +Value v = [] { + auto p = get_value(); // get_value() returns a pair + if (p.first) throw Bad_value{p.first}; + return p.second; +}(); + +SomeLargeType var; // ugly CaMeLcAsEvArIaBlE + +if (cond) // some non-trivial condition + Set(&var); +else if (cond2 || !cond3) { + var = Set2(3.14); +} +else { + var = 0; + for (auto& e : something) + var += e; +} + +string var = [&]{ + if (!in) return ""; // default + string s; + for (char c : in >> c) + s += toupper(c); + return s; +}(); // note () + +void use(int n) +{ + switch (n) { // good + case 0: // ... + case 7: // ... + } +} + +int n = numeric_limits::max(); +int m = n + 1; // bad + +std::string s = "hello world"; +double* p = (double*)(&s); // BAD + +class base { public: virtual ~base() = 0; }; + +class derived1 : public base { }; + +class derived2 : public base { + std::string s; +public: + std::string get_s() { return s; } +}; + +derived1 d1; +base* p = &d1; // ok, implicit conversion to pointer to base is fine + +derived2* p2 = (derived2*)(p); // BAD, tries to treat d1 as a derived2, which it is not +cout << p2.get_s(); // tries to access d1's nonexistent string member, instead sees arbitrary bytes near d1 + +void f(const int& i) { + (int&)(i) = 42; // BAD +} + +static int i = 0; +static const int j = 0; + +f(i); // silent side effect +f(j); // undefined behavior + + +auto x = m*v1 + vv; // multiply m with v1 and add the result to vv + +int i; +for (i = 0; i < max; ++i); // bug waiting to happen +if (i == j) + return i; diff --git a/lib/cpplint_1.4.5/samples/vlc-sample/COPYING b/lib/cpplint_1.4.5/samples/vlc-sample/COPYING new file mode 100644 index 00000000000..1f963da0d1c --- /dev/null +++ b/lib/cpplint_1.4.5/samples/vlc-sample/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + diff --git a/lib/cpplint_1.4.5/samples/vlc-sample/README.md b/lib/cpplint_1.4.5/samples/vlc-sample/README.md new file mode 100644 index 00000000000..f9177bcabc2 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/vlc-sample/README.md @@ -0,0 +1,3 @@ +# VLC sample + +code taken for regression testing from https://github.com/videolan/vlc diff --git a/lib/cpplint_1.4.5/samples/vlc-sample/simple.def b/lib/cpplint_1.4.5/samples/vlc-sample/simple.def new file mode 100644 index 00000000000..ac938d88d81 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/vlc-sample/simple.def @@ -0,0 +1,610 @@ +src/* +1 +5 +Done processing src/libvlc.c +Done processing src/libvlc.h +Done processing src/missing.c +Total errors found: 601 + +src/libvlc.c:41: Found C system header after other header. Should be: libvlc.h, c system, c++ system, other. [build/include_order] [4] +src/libvlc.c:47: Found C system header after other header. Should be: libvlc.h, c system, c++ system, other. [build/include_order] [4] +src/libvlc.c:48: Found C system header after other header. Should be: libvlc.h, c system, c++ system, other. [build/include_order] [4] +src/libvlc.c:49: Found C system header after other header. Should be: libvlc.h, c system, c++ system, other. [build/include_order] [4] +src/libvlc.c:50: Found C system header after other header. Should be: libvlc.h, c system, c++ system, other. [build/include_order] [4] +src/libvlc.c:71: Include the directory when naming .h files [build/include_subdir] [4] +src/libvlc.c:75: Found C system header after other header. Should be: libvlc.h, c system, c++ system, other. [build/include_order] [4] +src/libvlc.c:86: Extra space before [ [whitespace/braces] [5] +src/libvlc.c:86: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:86: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:86: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:92: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:93: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:98: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] +src/libvlc.c:99: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:100: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:103: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:107: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:107: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:120: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:122: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:123: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:138: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:141: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:142: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:143: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:147: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:153: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:158: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:159: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:160: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:161: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:161: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:163: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:163: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:170: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:171: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:172: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:173: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:183: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:183: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:184: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:186: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:187: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:190: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:191: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:195: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:196: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:197: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:198: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:199: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:205: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:206: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:207: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:208: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:209: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:209: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:210: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:211: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:216: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:216: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:217: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:218: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:219: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:219: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:220: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:221: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:222: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:222: Using C-style cast. Use static_cast(...) instead [readability/casting] [4] +src/libvlc.c:223: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:223: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:224: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:224: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:226: An else should appear on the same line as the preceding } [whitespace/newline] [4] +src/libvlc.c:227: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:229: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:229: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:232: An else should appear on the same line as the preceding } [whitespace/newline] [4] +src/libvlc.c:233: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:234: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:234: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:235: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:235: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:239: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:240: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:241: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:242: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:245: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:246: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:246: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:256: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:257: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:258: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:258: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:259: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:260: Missing space before ( in for( [whitespace/parens] [5] +src/libvlc.c:261: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:262: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:263: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:263: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:264: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:272: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:272: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:275: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:275: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:276: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:277: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:278: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:279: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:280: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:280: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:288: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:289: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:290: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:290: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:291: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:292: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:293: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:293: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:295: An else should appear on the same line as the preceding } [whitespace/newline] [4] +src/libvlc.c:296: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:296: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:296: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:297: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:297: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:301: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:301: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:301: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:303: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:304: Missing space before ( in for( [whitespace/parens] [5] +src/libvlc.c:305: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:307: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:307: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:308: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:313: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:314: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:314: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:316: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:316: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:317: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:318: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:319: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:319: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:326: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:327: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:329: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:330: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:331: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:331: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:333: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:333: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:337: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:337: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:338: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:338: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:341: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:341: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:342: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/libvlc.c:342: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:343: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:343: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:344: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:345: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:346: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:346: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:349: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:349: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:352: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:352: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:353: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:353: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:360: At least two spaces is best between code and comments [whitespace/comments] [2] +src/libvlc.c:362: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:364: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:364: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:369: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:369: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:377: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:377: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:378: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:378: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:381: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:381: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:384: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:384: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:387: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:387: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:390: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:390: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:391: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:391: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:394: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:394: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:399: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:399: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:400: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:401: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:402: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:402: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:403: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:404: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:405: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:405: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:406: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:406: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:407: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:407: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:408: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:408: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:409: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:409: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:410: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:410: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:413: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:413: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:417: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:417: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:418: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:419: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:420: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:420: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:421: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:422: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:422: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:424: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:424: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:430: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:430: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:431: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:431: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:433: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:434: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:436: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:437: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:438: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:438: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:442: An else should appear on the same line as the preceding } [whitespace/newline] [4] +src/libvlc.c:442: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:443: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:444: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:444: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:445: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:445: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:450: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:453: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:453: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:455: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:459: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:460: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:461: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:461: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:462: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:462: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:465: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:465: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:466: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:466: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:468: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:469: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:469: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:472: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:472: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:473: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:473: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:474: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:474: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:475: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:475: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:476: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:476: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:477: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:477: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:478: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:478: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:479: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:479: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:480: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:480: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:488: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:488: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:493: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:493: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:495: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:496: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:496: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:497: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:497: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:507: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:508: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:509: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:512: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:512: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:513: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:513: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:514: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:514: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:516: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:516: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:517: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:517: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:521: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:522: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:523: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:523: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:528: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:528: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:529: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:530: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:531: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:531: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:532: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:533: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:535: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:535: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:542: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:542: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:545: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:546: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:549: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:550: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.c:552: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:552: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:563: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:564: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:565: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:565: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:567: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:567: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:569: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:569: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:570: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:570: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:579: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:581: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:582: Missing space before ( in while( [whitespace/parens] [5] +src/libvlc.c:583: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:587: Missing space before ( in while( [whitespace/parens] [5] +src/libvlc.c:588: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:590: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:591: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:592: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:592: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:598: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:599: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:600: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:600: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:601: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:605: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:606: Extra space after ( [whitespace/parens] [2] +src/libvlc.c:606: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:607: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:608: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:608: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:618: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.c:624: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:624: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:625: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:627: Missing space before ( in if( [whitespace/parens] [5] +src/libvlc.c:629: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.c:629: Extra space before ) [whitespace/parens] [2] +src/libvlc.c:640: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:0: No #ifndef header guard found, suggested CPP variable is: SAMPLES_VLC_SAMPLE_SRC_LIBVLC_H_ [build/header_guard] [5] +src/libvlc.h:34: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:35: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:40: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:40: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:40: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:41: Extra space before [ [whitespace/braces] [5] +src/libvlc.h:41: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:41: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:41: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:45: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:45: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:58: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:58: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:60: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:62: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:66: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:68: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:68: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:84: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:86: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:90: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:90: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:91: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:91: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:111: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:123: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:124: Missing space after , [whitespace/comma] [3] +src/libvlc.h:125: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:140: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:149: At least two spaces is best between code and comments [whitespace/comments] [2] +src/libvlc.h:150: At least two spaces is best between code and comments [whitespace/comments] [2] +src/libvlc.h:151: At least two spaces is best between code and comments [whitespace/comments] [2] +src/libvlc.h:152: At least two spaces is best between code and comments [whitespace/comments] [2] +src/libvlc.h:153: At least two spaces is best between code and comments [whitespace/comments] [2] +src/libvlc.h:159: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:160: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:161: Using C-style cast. Use reinterpret_cast(...) instead [readability/casting] [4] +src/libvlc.h:166: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:166: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:168: Extra space after ( in function call [whitespace/parens] [4] +src/libvlc.h:168: Extra space before ) [whitespace/parens] [2] +src/libvlc.h:173: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:179: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:185: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:191: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:200: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/libvlc.h:222: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:223: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:224: Extra space before ( in function call [whitespace/parens] [4] +src/libvlc.h:224: Extra space before ) [whitespace/parens] [2] +src/missing.c:44: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:45: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:47: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:50: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:51: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:53: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:56: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:60: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:65: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:68: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:69: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:71: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:74: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:78: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:82: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:85: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:86: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:88: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:91: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:92: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:93: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:97: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:98: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:99: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:103: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:104: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:105: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:109: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:110: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:112: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:115: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:116: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:118: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:121: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:122: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:124: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:127: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:129: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:131: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:134: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:135: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:137: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:140: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:141: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:143: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:146: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:147: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:149: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:152: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:155: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:158: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:161: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:162: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:164: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:167: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:170: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:172: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:175: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:177: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:179: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:182: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:183: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:185: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:188: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:190: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:192: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:199: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:203: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:204: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:205: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:206: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:207: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:208: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:211: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:212: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:213: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:214: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:217: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:218: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:219: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:220: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:223: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:224: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:225: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:226: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:230: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:232: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:233: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:234: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:238: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:239: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:240: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:241: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:244: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:245: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:246: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:247: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:250: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:251: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:252: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:253: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:257: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:260: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:261: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:262: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:267: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:268: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:269: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:270: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:274: Extra space after ( in function call [whitespace/parens] [4] +src/missing.c:275: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:276: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:280: Extra space after ( in function call [whitespace/parens] [4] +src/missing.c:281: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:282: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:283: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:286: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:287: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:288: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:289: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:292: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:293: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:294: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:295: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:298: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/missing.c:298: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:299: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:300: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:301: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:304: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:306: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:307: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:308: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:311: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:312: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:313: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:314: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:317: Extra space after ( in function call [whitespace/parens] [4] +src/missing.c:318: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:319: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:320: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:323: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:324: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:325: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:326: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:329: Lines should be <= 80 characters long [whitespace/line_length] [2] +src/missing.c:329: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:332: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:333: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:334: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:335: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:338: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:341: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:342: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:343: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:351: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:352: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:353: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:354: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:355: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:358: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:359: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:360: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:361: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:364: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:365: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:366: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:367: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:368: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:369: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:372: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:373: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:374: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:375: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:376: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:379: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:380: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:381: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:382: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:385: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:386: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:387: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:391: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:392: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:393: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:394: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:399: Extra space before ( in function call [whitespace/parens] [4] +src/missing.c:400: { should almost always be at the end of the previous line [whitespace/braces] [4] +src/missing.c:401: Extra space before ( in function call [whitespace/parens] [4] + diff --git a/lib/cpplint_1.4.5/samples/vlc-sample/src/libvlc.c b/lib/cpplint_1.4.5/samples/vlc-sample/src/libvlc.c new file mode 100644 index 00000000000..651548511f8 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/vlc-sample/src/libvlc.c @@ -0,0 +1,648 @@ +/***************************************************************************** + * libvlc.c: libvlc instances creation and deletion, interfaces handling + ***************************************************************************** + * Copyright (C) 1998-2008 VLC authors and VideoLAN + * $Id: 3468e0e5b2ef424ac53c2ad6b69d2a3f8382cd28 $ + * + * Authors: Vincent Seguin + * Samuel Hocevar + * Gildas Bazin + * Derk-Jan Hartman + * Rémi Denis-Courmont + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +/** \file + * This file contains functions to create and destroy libvlc instances + */ + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include "../lib/libvlc_internal.h" +#include + +#include "modules/modules.h" +#include "config/configuration.h" +#include "playlist/preparser.h" + +#include /* sprintf() */ +#include +#include /* free() */ +#include + +#include "config/vlc_getopt.h" + +#ifdef HAVE_DBUS +/* used for one-instance mode */ +# include +#endif + + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "libvlc.h" +#include "playlist/playlist_internal.h" +#include "misc/variables.h" + +#include + +#ifdef __APPLE__ +# include +#endif + +#include + +/***************************************************************************** + * Local prototypes + *****************************************************************************/ +static void GetFilenames ( libvlc_int_t *, unsigned, const char *const [] ); + +/** + * Allocate a blank libvlc instance, also setting the exit handler. + * Vlc's threading system must have been initialized first + */ +libvlc_int_t * libvlc_InternalCreate( void ) +{ + libvlc_int_t *p_libvlc; + libvlc_priv_t *priv; + + /* Allocate a libvlc instance object */ + p_libvlc = vlc_custom_create( (vlc_object_t *)NULL, sizeof (*priv), + "libvlc" ); + if( p_libvlc == NULL ) + return NULL; + + priv = libvlc_priv (p_libvlc); + priv->playlist = NULL; + priv->p_vlm = NULL; + + vlc_ExitInit( &priv->exit ); + + return p_libvlc; +} + +/** + * Initialize a libvlc instance + * This function initializes a previously allocated libvlc instance: + * - CPU detection + * - gettext initialization + * - message queue, module bank and playlist initialization + * - configuration and commandline parsing + */ +int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, + const char *ppsz_argv[] ) +{ + libvlc_priv_t *priv = libvlc_priv (p_libvlc); + char * psz_modules = NULL; + char * psz_parser = NULL; + char * psz_control = NULL; + char *psz_val; + + /* System specific initialization code */ + system_Init(); + + vlc_LogPreinit(p_libvlc); + + /* Initialize the module bank and load the configuration of the + * core module. We need to do this at this stage to be able to display + * a short help if required by the user. (short help == core module + * options) */ + module_InitBank (); + + /* Get command line options that affect module loading. */ + if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, NULL ) ) + { + module_EndBank (false); + return VLC_EGENERIC; + } + + vlc_threads_setup (p_libvlc); + + /* Load the builtins and plugins into the module_bank. + * We have to do it before config_Load*() because this also gets the + * list of configuration options exported by each module and loads their + * default values. */ + size_t module_count = module_LoadPlugins (p_libvlc); + + /* + * Override default configuration with config file settings + */ + if( !var_InheritBool( p_libvlc, "ignore-config" ) ) + { + if( var_InheritBool( p_libvlc, "reset-config" ) ) + config_SaveConfigFile( p_libvlc ); /* Save default config */ + else + config_LoadConfigFile( p_libvlc ); + } + + /* + * Override configuration with command line settings + */ + int vlc_optind; + if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, &vlc_optind ) ) + { + vlc_LogDeinit (p_libvlc); + module_EndBank (true); + return VLC_EGENERIC; + } + + vlc_LogInit(p_libvlc); + + /* + * Support for gettext + */ +#if defined( ENABLE_NLS ) \ + && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) ) + vlc_bindtextdomain (PACKAGE_NAME); +#endif + /*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */ + msg_Dbg( p_libvlc, "translation test: code is \"%s\"", _("C") ); + + if (config_PrintHelp (VLC_OBJECT(p_libvlc))) + { + module_EndBank (true); + exit(0); + } + + if( module_count <= 1 ) + { + msg_Err( p_libvlc, "No plugins found! Check your VLC installation."); + vlc_LogDeinit (p_libvlc); + module_EndBank (true); + return VLC_ENOMOD; + } + +#ifdef HAVE_DAEMON + /* Check for daemon mode */ + if( var_InheritBool( p_libvlc, "daemon" ) ) + { + if( daemon( 1, 0) != 0 ) + { + msg_Err( p_libvlc, "Unable to fork vlc to daemon mode" ); + vlc_LogDeinit (p_libvlc); + module_EndBank (true); + return VLC_ENOMEM; + } + + /* lets check if we need to write the pidfile */ + char *pidfile = var_InheritString( p_libvlc, "pidfile" ); + if( pidfile != NULL ) + { + FILE *stream = vlc_fopen( pidfile, "w" ); + if( stream != NULL ) + { + fprintf( stream, "%d", (int)getpid() ); + fclose( stream ); + msg_Dbg( p_libvlc, "written PID file %s", pidfile ); + } + else + msg_Err( p_libvlc, "cannot write PID file %s: %s", + pidfile, vlc_strerror_c(errno) ); + free( pidfile ); + } + } + else + { + var_Create( p_libvlc, "pidfile", VLC_VAR_STRING ); + var_SetString( p_libvlc, "pidfile", "" ); + } +#endif + + if( libvlc_InternalDialogInit( p_libvlc ) != VLC_SUCCESS ) + { + vlc_LogDeinit (p_libvlc); + module_EndBank (true); + return VLC_ENOMEM; + } + if( libvlc_InternalKeystoreInit( p_libvlc ) != VLC_SUCCESS ) + msg_Warn( p_libvlc, "memory keystore init failed" ); + +/* FIXME: could be replaced by using Unix sockets */ +#ifdef HAVE_DBUS + +#define MPRIS_APPEND "/org/mpris/MediaPlayer2/TrackList/Append" +#define MPRIS_BUS_NAME "org.mpris.MediaPlayer2.vlc" +#define MPRIS_OBJECT_PATH "/org/mpris/MediaPlayer2" +#define MPRIS_TRACKLIST_INTERFACE "org.mpris.MediaPlayer2.TrackList" + + if( var_InheritBool( p_libvlc, "one-instance" ) + || ( var_InheritBool( p_libvlc, "one-instance-when-started-from-file" ) + && var_InheritBool( p_libvlc, "started-from-file" ) ) ) + { + for( int i = vlc_optind; i < i_argc; i++ ) + if( ppsz_argv[i][0] == ':' ) + { + msg_Err( p_libvlc, "item option %s incompatible with single instance", + ppsz_argv[i] ); + goto dbus_out; + } + + /* Initialise D-Bus interface, check for other instances */ + dbus_threads_init_default(); + + DBusError err; + dbus_error_init( &err ); + + /* connect to the session bus */ + DBusConnection *conn = dbus_bus_get( DBUS_BUS_SESSION, &err ); + if( conn == NULL ) + { + msg_Err( p_libvlc, "Failed to connect to D-Bus session daemon: %s", + err.message ); + dbus_error_free( &err ); + goto dbus_out; + } + + /* check if VLC is available on the bus + * if not: D-Bus control is not enabled on the other + * instance and we can't pass MRLs to it */ + /* FIXME: This check is totally brain-dead and buggy. */ + if( !dbus_bus_name_has_owner( conn, MPRIS_BUS_NAME, &err ) ) + { + dbus_connection_unref( conn ); + if( dbus_error_is_set( &err ) ) + { + msg_Err( p_libvlc, "D-Bus error: %s", err.message ); + } + else + msg_Dbg( p_libvlc, "No media player running. Continuing normally." ); + dbus_error_free( &err ); + goto dbus_out; + } + + const dbus_bool_t play = !var_InheritBool( p_libvlc, "playlist-enqueue" ); + + msg_Warn( p_libvlc, "media player running. Exiting..."); + for( int i = vlc_optind; i < i_argc; i++ ) + { + DBusMessage *msg = dbus_message_new_method_call( + MPRIS_BUS_NAME, MPRIS_OBJECT_PATH, MPRIS_TRACKLIST_INTERFACE, "AddTrack" ); + if( unlikely(msg == NULL) ) + continue; + + /* We need to resolve relative paths in this instance */ + char *mrl; + if( strstr( ppsz_argv[i], "://" ) ) + mrl = strdup( ppsz_argv[i] ); + else + mrl = vlc_path2uri( ppsz_argv[i], NULL ); + if( mrl == NULL ) + { + dbus_message_unref( msg ); + continue; + } + + const char *after_track = MPRIS_APPEND; + + /* append MRLs */ + if( !dbus_message_append_args( msg, DBUS_TYPE_STRING, &mrl, + DBUS_TYPE_OBJECT_PATH, &after_track, + DBUS_TYPE_BOOLEAN, &play, + DBUS_TYPE_INVALID ) ) + { + dbus_message_unref( msg ); + msg = NULL; + free( mrl ); + continue; + } + + msg_Dbg( p_libvlc, "Adds %s to the running media player", mrl ); + free( mrl ); + + /* send message and get a handle for a reply */ + DBusMessage *reply = dbus_connection_send_with_reply_and_block( conn, msg, -1, + &err ); + dbus_message_unref( msg ); + if( reply == NULL ) + { + msg_Err( p_libvlc, "D-Bus error: %s", err.message ); + continue; + } + dbus_message_unref( reply ); + } + /* we unreference the connection when we've finished with it */ + dbus_connection_unref( conn ); + exit( 0 ); + } +#undef MPRIS_APPEND +#undef MPRIS_BUS_NAME +#undef MPRIS_OBJECT_PATH +#undef MPRIS_TRACKLIST_INTERFACE +dbus_out: +#endif // HAVE_DBUS + + vlc_CPU_dump( VLC_OBJECT(p_libvlc) ); + + priv->b_stats = var_InheritBool( p_libvlc, "stats" ); + + /* + * Initialize hotkey handling + */ + priv->actions = vlc_InitActions( p_libvlc ); + + /* + * Meta data handling + */ + priv->parser = playlist_preparser_New(VLC_OBJECT(p_libvlc)); + + /* Create a variable for showing the fullscreen interface */ + var_Create( p_libvlc, "intf-toggle-fscontrol", VLC_VAR_BOOL ); + var_SetBool( p_libvlc, "intf-toggle-fscontrol", true ); + + /* Create a variable for the Boss Key */ + var_Create( p_libvlc, "intf-boss", VLC_VAR_VOID ); + + /* Create a variable for showing the main interface */ + var_Create( p_libvlc, "intf-show", VLC_VAR_BOOL ); + + /* Create a variable for showing the right click menu */ + var_Create( p_libvlc, "intf-popupmenu", VLC_VAR_BOOL ); + + /* variables for signalling creation of new files */ + var_Create( p_libvlc, "snapshot-file", VLC_VAR_STRING ); + var_Create( p_libvlc, "record-file", VLC_VAR_STRING ); + + /* some default internal settings */ + var_Create( p_libvlc, "window", VLC_VAR_STRING ); + /* NOTE: Because the playlist and interfaces start before this function + * returns control to the application (DESIGN BUG!), all these variables + * must be created (in place of libvlc_new()) and set to VLC defaults + * (in place of VLC main()) *here*. */ + var_Create( p_libvlc, "user-agent", VLC_VAR_STRING ); + var_SetString( p_libvlc, "user-agent", + "VLC media player (LibVLC "VERSION")" ); + var_Create( p_libvlc, "http-user-agent", VLC_VAR_STRING ); + var_SetString( p_libvlc, "http-user-agent", + "VLC/"PACKAGE_VERSION" LibVLC/"PACKAGE_VERSION ); + var_Create( p_libvlc, "app-icon-name", VLC_VAR_STRING ); + var_SetString( p_libvlc, "app-icon-name", PACKAGE_NAME ); + var_Create( p_libvlc, "app-id", VLC_VAR_STRING ); + var_SetString( p_libvlc, "app-id", "org.VideoLAN.VLC" ); + var_Create( p_libvlc, "app-version", VLC_VAR_STRING ); + var_SetString( p_libvlc, "app-version", PACKAGE_VERSION ); + + /* System specific configuration */ + system_Configure( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind ); + +#ifdef ENABLE_VLM + /* Initialize VLM if vlm-conf is specified */ + psz_parser = var_CreateGetNonEmptyString( p_libvlc, "vlm-conf" ); + if( psz_parser ) + { + priv->p_vlm = vlm_New( p_libvlc ); + if( !priv->p_vlm ) + msg_Err( p_libvlc, "VLM initialization failed" ); + } + free( psz_parser ); +#endif + + /* + * Load background interfaces + */ + psz_modules = var_CreateGetNonEmptyString( p_libvlc, "extraintf" ); + psz_control = var_CreateGetNonEmptyString( p_libvlc, "control" ); + + if( psz_modules && psz_control ) + { + char* psz_tmp; + if( asprintf( &psz_tmp, "%s:%s", psz_modules, psz_control ) != -1 ) + { + free( psz_modules ); + psz_modules = psz_tmp; + } + } + else if( psz_control ) + { + free( psz_modules ); + psz_modules = strdup( psz_control ); + } + + psz_parser = psz_modules; + while ( psz_parser && *psz_parser ) + { + char *psz_module, *psz_temp; + psz_module = psz_parser; + psz_parser = strchr( psz_module, ':' ); + if ( psz_parser ) + { + *psz_parser = '\0'; + psz_parser++; + } + if( asprintf( &psz_temp, "%s,none", psz_module ) != -1) + { + libvlc_InternalAddIntf( p_libvlc, psz_temp ); + free( psz_temp ); + } + } + free( psz_modules ); + free( psz_control ); + + if( var_InheritBool( p_libvlc, "network-synchronisation") ) + libvlc_InternalAddIntf( p_libvlc, "netsync,none" ); + +#ifdef __APPLE__ + var_Create( p_libvlc, "drawable-view-top", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-view-left", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-view-bottom", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-view-right", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-clip-top", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-clip-left", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-clip-bottom", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-clip-right", VLC_VAR_INTEGER ); + var_Create( p_libvlc, "drawable-nsobject", VLC_VAR_ADDRESS ); +#endif + + /* + * Get input filenames given as commandline arguments. + * We assume that the remaining parameters are filenames + * and their input options. + */ + GetFilenames( p_libvlc, i_argc - vlc_optind, ppsz_argv + vlc_optind ); + + /* + * Get --open argument + */ + psz_val = var_InheritString( p_libvlc, "open" ); + if ( psz_val != NULL ) + { + intf_InsertItem( p_libvlc, psz_val, 0, NULL, 0 ); + free( psz_val ); + } + + return VLC_SUCCESS; +} + +/** + * Cleanup a libvlc instance. The instance is not completely deallocated + * \param p_libvlc the instance to clean + */ +void libvlc_InternalCleanup( libvlc_int_t *p_libvlc ) +{ + libvlc_priv_t *priv = libvlc_priv (p_libvlc); + + /* Ask the interfaces to stop and destroy them */ + msg_Dbg( p_libvlc, "removing all interfaces" ); + libvlc_Quit( p_libvlc ); + intf_DestroyAll( p_libvlc ); + + libvlc_InternalDialogClean( p_libvlc ); + libvlc_InternalKeystoreClean( p_libvlc ); + +#ifdef ENABLE_VLM + /* Destroy VLM if created in libvlc_InternalInit */ + if( priv->p_vlm ) + { + vlm_Delete( priv->p_vlm ); + } +#endif + +#if !defined( _WIN32 ) && !defined( __OS2__ ) + char *pidfile = var_InheritString( p_libvlc, "pidfile" ); + if( pidfile != NULL ) + { + msg_Dbg( p_libvlc, "removing PID file %s", pidfile ); + if( unlink( pidfile ) ) + msg_Warn( p_libvlc, "cannot remove PID file %s: %s", + pidfile, vlc_strerror_c(errno) ); + free( pidfile ); + } +#endif + + if (priv->parser != NULL) + playlist_preparser_Delete(priv->parser); + + vlc_DeinitActions( p_libvlc, priv->actions ); + + /* Save the configuration */ + if( !var_InheritBool( p_libvlc, "ignore-config" ) ) + config_AutoSaveConfigFile( VLC_OBJECT(p_libvlc) ); + + /* Free module bank. It is refcounted, so we call this each time */ + vlc_LogDeinit (p_libvlc); + module_EndBank (true); +#if defined(_WIN32) || defined(__OS2__) + system_End( ); +#endif +} + +/** + * Destroy everything. + * This function requests the running threads to finish, waits for their + * termination, and destroys their structure. + * It stops the thread systems: no instance can run after this has run + * \param p_libvlc the instance to destroy + */ +void libvlc_InternalDestroy( libvlc_int_t *p_libvlc ) +{ + libvlc_priv_t *priv = libvlc_priv( p_libvlc ); + + vlc_ExitDestroy( &priv->exit ); + + assert( atomic_load(&(vlc_internals(p_libvlc)->refs)) == 1 ); + vlc_object_release( p_libvlc ); +} + +/***************************************************************************** + * GetFilenames: parse command line options which are not flags + ***************************************************************************** + * Parse command line for input files as well as their associated options. + * An option always follows its associated input and begins with a ":". + *****************************************************************************/ +static void GetFilenames( libvlc_int_t *p_vlc, unsigned n, + const char *const args[] ) +{ + while( n > 0 ) + { + /* Count the input options */ + unsigned i_options = 0; + + while( args[--n][0] == ':' ) + { + i_options++; + if( n == 0 ) + { + msg_Warn( p_vlc, "options %s without item", args[n] ); + return; /* syntax!? */ + } + } + + char *mrl = NULL; + if( strstr( args[n], "://" ) == NULL ) + { + mrl = vlc_path2uri( args[n], NULL ); + if( !mrl ) + continue; + } + + intf_InsertItem( p_vlc, (mrl != NULL) ? mrl : args[n], i_options, + ( i_options ? &args[n + 1] : NULL ), + VLC_INPUT_OPTION_TRUSTED ); + free( mrl ); + } +} + +/** + * Requests extraction of the meta data for an input item (a.k.a. preparsing). + * The actual extraction is asynchronous. + */ +int libvlc_MetaRequest(libvlc_int_t *libvlc, input_item_t *item, + input_item_meta_request_option_t i_options) +{ + libvlc_priv_t *priv = libvlc_priv(libvlc); + + if (unlikely(priv->parser == NULL)) + return VLC_ENOMEM; + + vlc_mutex_lock( &item->lock ); + if( item->i_preparse_depth == 0 ) + item->i_preparse_depth = 1; + if( i_options & META_REQUEST_OPTION_DO_INTERACT ) + item->b_preparse_interact = true; + vlc_mutex_unlock( &item->lock ); + playlist_preparser_Push(priv->parser, item, i_options); + return VLC_SUCCESS; +} + +/** + * Requests retrieving/downloading art for an input item. + * The retrieval is performed asynchronously. + */ +int libvlc_ArtRequest(libvlc_int_t *libvlc, input_item_t *item, + input_item_meta_request_option_t i_options) +{ + libvlc_priv_t *priv = libvlc_priv(libvlc); + + if (unlikely(priv->parser == NULL)) + return VLC_ENOMEM; + + playlist_preparser_fetcher_Push(priv->parser, item, i_options); + return VLC_SUCCESS; +} diff --git a/lib/cpplint_1.4.5/samples/vlc-sample/src/libvlc.h b/lib/cpplint_1.4.5/samples/vlc-sample/src/libvlc.h new file mode 100644 index 00000000000..1cfb3d57115 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/vlc-sample/src/libvlc.h @@ -0,0 +1,229 @@ +/***************************************************************************** + * libvlc.h: Internal libvlc generic/misc declaration + ***************************************************************************** + * Copyright (C) 1999, 2000, 2001, 2002 VLC authors and VideoLAN + * Copyright © 2006-2007 Rémi Denis-Courmont + * $Id: 21bdfdcfba26f0a50e775a077df02a1debe88ba6 $ + * + * Authors: Vincent Seguin + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#ifndef LIBVLC_LIBVLC_H +# define LIBVLC_LIBVLC_H 1 + +extern const char psz_vlc_changeset[]; + +typedef struct variable_t variable_t; + +/* Actions (hot keys) */ +struct vlc_actions; +struct vlc_actions *vlc_InitActions (libvlc_int_t *); +extern void vlc_DeinitActions (libvlc_int_t *, struct vlc_actions *); + +/* + * OS-specific initialization + */ +void system_Init ( void ); +void system_Configure ( libvlc_int_t *, int, const char *const [] ); +#if defined(_WIN32) || defined(__OS2__) +void system_End(void); +#ifndef __OS2__ +size_t EnumClockSource( vlc_object_t *, const char *, char ***, char *** ); +#endif +#endif +void vlc_CPU_init(void); +void vlc_CPU_dump(vlc_object_t *); + +/* + * Threads subsystem + */ + +/* This cannot be used as is from plugins yet: */ +int vlc_clone_detach (vlc_thread_t *, void *(*)(void *), void *, int); + +int vlc_set_priority( vlc_thread_t, int ); + +void vlc_threads_setup (libvlc_int_t *); + +void vlc_trace (const char *fn, const char *file, unsigned line); +#define vlc_backtrace() vlc_trace(__func__, __FILE__, __LINE__) + +#if (defined (LIBVLC_USE_PTHREAD) || defined(__ANDROID__)) && !defined (NDEBUG) +void vlc_assert_locked (vlc_mutex_t *); +#else +# define vlc_assert_locked( m ) (void)m +#endif + +/* + * Logging + */ +typedef struct vlc_logger_t vlc_logger_t; + +int vlc_LogPreinit(libvlc_int_t *); +int vlc_LogInit(libvlc_int_t *); +void vlc_LogDeinit(libvlc_int_t *); + +/* + * LibVLC exit event handling + */ +typedef struct vlc_exit +{ + vlc_mutex_t lock; + void (*handler) (void *); + void *opaque; +} vlc_exit_t; + +void vlc_ExitInit( vlc_exit_t * ); +void vlc_ExitDestroy( vlc_exit_t * ); + +/* + * LibVLC objects stuff + */ + +/** + * Creates a VLC object. + * + * Note that because the object name pointer must remain valid, potentially + * even after the destruction of the object (through the message queues), this + * function CANNOT be exported to plugins as is. In this case, the old + * vlc_object_create() must be used instead. + * + * @param p_this an existing VLC object + * @param i_size byte size of the object structure + * @param psz_type object type name + * @return the created object, or NULL. + */ +extern void * +vlc_custom_create (vlc_object_t *p_this, size_t i_size, const char *psz_type); +#define vlc_custom_create(o, s, n) \ + vlc_custom_create(VLC_OBJECT(o), s, n) + +/** + * Assign a name to an object for vlc_object_find_name(). + */ +extern int vlc_object_set_name(vlc_object_t *, const char *); +#define vlc_object_set_name(o, n) vlc_object_set_name(VLC_OBJECT(o), n) + +/* Types */ +typedef void (*vlc_destructor_t) (struct vlc_object_t *); +void vlc_object_set_destructor (vlc_object_t *, vlc_destructor_t); +#define vlc_object_set_destructor(a,b) \ + vlc_object_set_destructor (VLC_OBJECT(a), b) + +#define ZOOM_SECTION N_("Zoom") +#define ZOOM_QUARTER_KEY_TEXT N_("1:4 Quarter") +#define ZOOM_HALF_KEY_TEXT N_("1:2 Half") +#define ZOOM_ORIGINAL_KEY_TEXT N_("1:1 Original") +#define ZOOM_DOUBLE_KEY_TEXT N_("2:1 Double") + +/** + * Private LibVLC instance data. + */ +typedef struct vlc_dialog_provider vlc_dialog_provider; +typedef struct vlc_keystore vlc_keystore; + +typedef struct libvlc_priv_t +{ + libvlc_int_t public_data; + + /* Logging */ + bool b_stats; ///< Whether to collect stats + + /* Singleton objects */ + vlc_logger_t *logger; + vlm_t *p_vlm; ///< the VLM singleton (or NULL) + vlc_dialog_provider *p_dialog_provider; ///< dialog provider + vlc_keystore *p_memory_keystore; ///< memory keystore + struct playlist_t *playlist; ///< Playlist for interfaces + struct playlist_preparser_t *parser; ///< Input item meta data handler + struct vlc_actions *actions; ///< Hotkeys handler + + /* Exit callback */ + vlc_exit_t exit; +} libvlc_priv_t; + +static inline libvlc_priv_t *libvlc_priv (libvlc_int_t *libvlc) +{ + return (libvlc_priv_t *)libvlc; +} + +void intf_InsertItem(libvlc_int_t *, const char *mrl, unsigned optc, + const char * const *optv, unsigned flags); +void intf_DestroyAll( libvlc_int_t * ); + +#define libvlc_stats( o ) (libvlc_priv((VLC_OBJECT(o))->p_libvlc)->b_stats) + +/* + * Variables stuff + */ +void var_OptionParse (vlc_object_t *, const char *, bool trusted); + +/* + * Stats stuff + */ +enum +{ + STATS_COUNTER, + STATS_DERIVATIVE, +}; + +typedef struct counter_sample_t +{ + uint64_t value; + mtime_t date; +} counter_sample_t; + +typedef struct counter_t +{ + int i_compute_type; + int i_samples; + counter_sample_t ** pp_samples; + + mtime_t last_update; +} counter_t; + +enum +{ + STATS_INPUT_BITRATE, + STATS_READ_BYTES, + STATS_READ_PACKETS, + STATS_DEMUX_READ, + STATS_DEMUX_BITRATE, + STATS_DEMUX_CORRUPTED, + STATS_DEMUX_DISCONTINUITY, + STATS_PLAYED_ABUFFERS, + STATS_LOST_ABUFFERS, + STATS_DECODED_AUDIO, + STATS_DECODED_VIDEO, + STATS_DECODED_SUB, + STATS_CLIENT_CONNECTIONS, + STATS_ACTIVE_CONNECTIONS, + STATS_SOUT_SENT_PACKETS, + STATS_SOUT_SENT_BYTES, + STATS_SOUT_SEND_BITRATE, + STATS_DISPLAYED_PICTURES, + STATS_LOST_PICTURES, +}; + +counter_t * stats_CounterCreate (int); +void stats_Update (counter_t *, uint64_t, uint64_t *); +void stats_CounterClean (counter_t * ); + +void stats_ComputeInputStats(input_thread_t*, input_stats_t*); +void stats_ReinitInputStats(input_stats_t *); + +#endif diff --git a/lib/cpplint_1.4.5/samples/vlc-sample/src/missing.c b/lib/cpplint_1.4.5/samples/vlc-sample/src/missing.c new file mode 100644 index 00000000000..8ab85dd4693 --- /dev/null +++ b/lib/cpplint_1.4.5/samples/vlc-sample/src/missing.c @@ -0,0 +1,404 @@ +/***************************************************************************** + * missing.c: missing libvlccore symbols + ***************************************************************************** + * Copyright (C) 2008-2011 Rémi Denis-Courmont + * Copyright (C) 2009-2014 VLC authors and VideoLAN + * $Id: 692b9b5ecf59f496cc21528a91668f18e501b303 $ + * + * Authors: Rémi Denis-Courmont + * Pierre Ynard + * Toralf Niebuhr + * Felix Paul Kühne + * Jean-Paul Saman + * Antoine Cellerier + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +/** \file + * This file contains dummy replacement API for disabled features + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#ifndef ENABLE_HTTPD +# include + +char *httpd_ClientIP (const httpd_client_t *cl, char *psz_ip, int *port) +{ + (void) cl; (void) psz_ip; (void) port; + vlc_assert_unreachable (); +} + +httpd_file_sys_t *httpd_FileDelete (httpd_file_t *file) +{ + (void) file; + vlc_assert_unreachable (); +} + +httpd_file_t *httpd_FileNew (httpd_host_t *host, + const char *url, const char *content_type, + const char *login, const char *password, + httpd_file_callback_t cb, httpd_file_sys_t *data) +{ + (void) host; + (void) url; (void) content_type; + (void) login; (void) password; + (void) cb; (void) data; + vlc_assert_unreachable (); +} + +httpd_handler_sys_t *httpd_HandlerDelete (httpd_handler_t *handler) +{ + (void) handler; + vlc_assert_unreachable (); +} + +httpd_handler_t *httpd_HandlerNew (httpd_host_t *host, const char *url, + const char *login, const char *password, + httpd_handler_callback_t cb, + httpd_handler_sys_t *data) +{ + (void) host; (void) url; + (void) login; (void) password; + (void) cb; (void) data; + vlc_assert_unreachable (); +} + +void httpd_HostDelete (httpd_host_t *h) +{ + (void) h; + vlc_assert_unreachable (); +} + +httpd_host_t *vlc_http_HostNew (vlc_object_t *obj) +{ + msg_Err (obj, "HTTP server not compiled-in!"); + return NULL; +} + +httpd_host_t *vlc_https_HostNew (vlc_object_t *obj) +{ + msg_Err (obj, "HTTPS server not compiled-in!"); + return NULL; +} + +httpd_host_t *vlc_rtsp_HostNew (vlc_object_t *obj) +{ + msg_Err (obj, "RTSP server not compiled-in!"); + return NULL; +} + +void httpd_MsgAdd (httpd_message_t *m, const char *name, const char *fmt, ...) +{ + (void) m; (void) name; (void) fmt; + vlc_assert_unreachable (); +} + +const char *httpd_MsgGet (const httpd_message_t *m, const char *name) +{ + (void) m; (void) name; + vlc_assert_unreachable (); +} + +void httpd_RedirectDelete (httpd_redirect_t *r) +{ + (void) r; + vlc_assert_unreachable (); +} + +httpd_redirect_t *httpd_RedirectNew (httpd_host_t *host, + const char *dst, const char *src) +{ + (void) host; (void) dst; (void) src; + vlc_assert_unreachable (); +} + +char *httpd_ServerIP (const httpd_client_t *client, char *ip, int *port) +{ + (void) client; (void) ip; (void) port; + vlc_assert_unreachable (); +} + +void httpd_StreamDelete (httpd_stream_t *stream) +{ + (void) stream; + vlc_assert_unreachable (); +} + +int httpd_StreamHeader (httpd_stream_t *stream, uint8_t *data, int count) +{ + (void) stream; (void) data; (void) count; + vlc_assert_unreachable (); +} + +httpd_stream_t *httpd_StreamNew (httpd_host_t *host, + const char *url, const char *content_type, + const char *login, const char *password) +{ + (void) host; (void) url; (void) content_type; + (void) login; (void) password; + vlc_assert_unreachable (); +} + +int httpd_StreamSend (httpd_stream_t *stream, const block_t *p_block) +{ + (void) stream; (void) p_block; + vlc_assert_unreachable (); +} + +int httpd_StreamSetHTTPHeaders (httpd_stream_t * stream, + httpd_header * headers, + size_t i_headers) +{ + (void) stream; (void) headers; (void) i_headers; + vlc_assert_unreachable (); +} + +int httpd_UrlCatch (httpd_url_t *url, int request, httpd_callback_t cb, + httpd_callback_sys_t *data) +{ + (void) url; (void) request; (void) cb; (void) data; + vlc_assert_unreachable (); +} + +void httpd_UrlDelete (httpd_url_t *url) +{ + (void) url; + vlc_assert_unreachable (); +} + +httpd_url_t *httpd_UrlNew (httpd_host_t *host, const char *url, + const char *login, const char *password) +{ + (void) host; (void) url; (void) login; (void) password; + vlc_assert_unreachable (); +} +#endif /* !ENABLE_HTTPD */ + +#ifndef ENABLE_SOUT +# include + +char *sdp_AddMedia (char **sdp, const char *type, const char *protocol, + int dport, unsigned pt, bool bw_indep, unsigned bw, + const char *ptname, unsigned clockrate, unsigned channels, + const char *fmtp) +{ + VLC_UNUSED (sdp); VLC_UNUSED (type); VLC_UNUSED (protocol); + VLC_UNUSED (dport); VLC_UNUSED (pt); VLC_UNUSED (bw_indep); + VLC_UNUSED (bw); VLC_UNUSED (ptname); VLC_UNUSED (clockrate); + VLC_UNUSED (channels); VLC_UNUSED (fmtp); + assert (*sdp == NULL); +} + +char *sdp_AddAttribute (char **sdp, const char *name, const char *fmt, ...) +{ + VLC_UNUSED (sdp); VLC_UNUSED (name); VLC_UNUSED (fmt); + assert (*sdp == NULL); +} + +int sout_AccessOutControl (sout_access_out_t *out, int query, ...) +{ + VLC_UNUSED (out); VLC_UNUSED (query); + vlc_assert_unreachable (); +} + +void sout_AccessOutDelete (sout_access_out_t *out) +{ + VLC_UNUSED (out); + vlc_assert_unreachable (); +} + +#undef sout_AccessOutNew +sout_access_out_t *sout_AccessOutNew (vlc_object_t *obj, + const char *access, const char *name) +{ + VLC_UNUSED (access); VLC_UNUSED (name); + msg_Err (obj, "Output support not compiled-in!"); + return NULL; +} + +ssize_t sout_AccessOutRead (sout_access_out_t *out, block_t *block) +{ + VLC_UNUSED (out); VLC_UNUSED (block); + vlc_assert_unreachable (); +} + +int sout_AccessOutSeek (sout_access_out_t *out, off_t offset) +{ + VLC_UNUSED (out); VLC_UNUSED (offset); + vlc_assert_unreachable (); +} + +ssize_t sout_AccessOutWrite (sout_access_out_t *out, block_t *block) +{ + VLC_UNUSED (out); VLC_UNUSED (block); + vlc_assert_unreachable (); +} + +#undef sout_AnnounceRegisterSDP +session_descriptor_t *sout_AnnounceRegisterSDP (vlc_object_t *obj, + const char *sdp, + const char *dst) +{ + VLC_UNUSED (sdp); VLC_UNUSED (dst); + msg_Err (obj, "SDP export not compiled-in!"); + return NULL; +} + +#undef sout_AnnounceUnRegister +void sout_AnnounceUnRegister (vlc_object_t *obj, session_descriptor_t *d) +{ + VLC_UNUSED (obj); VLC_UNUSED (d); + vlc_assert_unreachable (); +} + +#undef sout_EncoderCreate +encoder_t *sout_EncoderCreate( vlc_object_t *p_this ) +{ + msg_Err (p_this, "Encoding support not compiled-in!"); + return NULL; +} + +sout_input_t *sout_MuxAddStream( sout_mux_t *mux, const es_format_t *fmt ) +{ + VLC_UNUSED (mux); VLC_UNUSED (fmt); + vlc_assert_unreachable (); +} + +void sout_MuxDelete (sout_mux_t *mux) +{ + VLC_UNUSED (mux); + vlc_assert_unreachable (); +} + +void sout_MuxDeleteStream (sout_mux_t *mux, sout_input_t *input) +{ + VLC_UNUSED (mux); VLC_UNUSED (input); + vlc_assert_unreachable (); +} + +int sout_MuxGetStream (sout_mux_t *p_mux, unsigned int i_blocks, mtime_t *pi_dts) +{ + VLC_UNUSED (p_mux); VLC_UNUSED (i_blocks); VLC_UNUSED (pi_dts); + vlc_assert_unreachable (); +} + +sout_mux_t *sout_MuxNew (sout_instance_t *instance, const char *mux, + sout_access_out_t *out) +{ + VLC_UNUSED (instance); VLC_UNUSED (mux); VLC_UNUSED (out); + vlc_assert_unreachable (); +} + +int sout_MuxSendBuffer (sout_mux_t *mux, sout_input_t *input, block_t *block) +{ + VLC_UNUSED (mux); VLC_UNUSED (input); VLC_UNUSED (block); + vlc_assert_unreachable (); +} + +void sout_MuxFlush( sout_mux_t *mux, sout_input_t *input ) +{ + VLC_UNUSED (mux); VLC_UNUSED (input); + vlc_assert_unreachable (); +} + +void sout_StreamChainDelete (sout_stream_t *p_first, sout_stream_t *p_last) +{ + VLC_UNUSED (p_first); VLC_UNUSED (p_last); + vlc_assert_unreachable (); +} + +sout_stream_t *sout_StreamChainNew (sout_instance_t *p_sout, const char *psz_chain, + sout_stream_t *p_next, + sout_stream_t **pp_last) +{ + VLC_UNUSED (p_sout); VLC_UNUSED (psz_chain); VLC_UNUSED (p_next); + VLC_UNUSED (pp_last); + vlc_assert_unreachable (); +} + +char *vlc_sdp_Start (vlc_object_t *obj, const char *cfg, + const struct sockaddr *src, size_t srclen, + const struct sockaddr *addr, size_t addrlen) +{ + VLC_UNUSED (obj); VLC_UNUSED (cfg); VLC_UNUSED (src); VLC_UNUSED (srclen); + VLC_UNUSED (addr); VLC_UNUSED (addrlen); + return NULL; +} +#endif /* !ENABLE_SOUT */ + +#ifndef ENABLE_VLM +# include + +int vlm_Control (vlm_t *vlm, int query, ...) +{ + VLC_UNUSED (query); + VLC_UNUSED (vlm); + vlc_assert_unreachable (); +} + +void vlm_Delete (vlm_t *vlm) +{ + VLC_UNUSED (vlm); + vlc_assert_unreachable (); +} + +int vlm_ExecuteCommand (vlm_t *vlm, const char *cmd, vlm_message_t **pm) +{ + VLC_UNUSED (vlm); + VLC_UNUSED (cmd); + VLC_UNUSED (pm); + vlc_assert_unreachable (); +} + +vlm_message_t *vlm_MessageAdd (vlm_message_t *a, vlm_message_t *b) +{ + VLC_UNUSED (a); + VLC_UNUSED (b); + vlc_assert_unreachable (); +} + +void vlm_MessageDelete (vlm_message_t *m) +{ + VLC_UNUSED (m); + vlc_assert_unreachable (); +} + +vlm_message_t *vlm_MessageSimpleNew (const char *a) +{ + VLC_UNUSED (a); + return NULL; +} + +vlm_message_t *vlm_MessageNew (const char *a, const char *fmt, ...) +{ + VLC_UNUSED (a); + VLC_UNUSED (fmt); + return vlm_MessageSimpleNew (a); +} + +#undef vlm_New +vlm_t *vlm_New (vlc_object_t *obj) +{ + msg_Err (obj, "VLM not compiled-in!"); + return NULL; +} +#endif /* !ENABLE_VLM */ diff --git a/lib/cpplint_1.4.5/setup.cfg b/lib/cpplint_1.4.5/setup.cfg new file mode 100644 index 00000000000..b2cd135793b --- /dev/null +++ b/lib/cpplint_1.4.5/setup.cfg @@ -0,0 +1,12 @@ +[aliases] +test = pytest +style = flake8 +ci = lint style test + +[tool:pytest] +python_files = *test.py +testpaths = . +# running with tox reports only 75% +addopts = --cov-fail-under=75 --cov=cpplint +filterwarnings = + ignore:.*:DeprecationWarning diff --git a/lib/cpplint_1.4.5/setup.py b/lib/cpplint_1.4.5/setup.py new file mode 100755 index 00000000000..81bc46be861 --- /dev/null +++ b/lib/cpplint_1.4.5/setup.py @@ -0,0 +1,87 @@ +#! /usr/bin/env python + +from setuptools import setup, Command +from subprocess import check_call +from distutils.spawn import find_executable +import cpplint as cpplint + +class Cmd(Command): + ''' + Superclass for other commands to run via setup.py, declared in setup.cfg. + These commands will auto-install setup_requires in a temporary folder. + ''' + user_options = [ + ('executable', 'e', 'The executable to use for the command') + ] + + def initialize_options(self): + self.executable = find_executable(self.executable) + + def finalize_options(self): + pass + + def execute(self, *k): + check_call((self.executable,) + k) + + +class Lint(Cmd): + '''run with python setup.py lint''' + description = 'Run linting of the code' + user_options = Cmd.user_options + [ + ('jobs', 'j', 'Use multiple processes to speed up the linting') + ] + executable = 'pylint' + + def run(self): + self.execute('cpplint.py') + +# some pip versions bark on comments (e.g. on travis) +def read_without_comments(filename): + with open(filename) as f: + return [l for l in f.read().splitlines() if not len(l) == 0 and not l.startswith('#')] + +test_required = read_without_comments('test-requirements') + +setup(name='cpplint', + version=cpplint.__VERSION__, + py_modules=['cpplint'], + # generate platform specific start script + entry_points={ + 'console_scripts': [ + 'cpplint = cpplint:main' + ] + }, + install_requires=[], + url='https://github.com/cpplint/cpplint', + download_url='https://github.com/cpplint/cpplint', + keywords=['lint', 'python', 'c++'], + maintainer='cpplint Developers', + maintainer_email='see_github@nospam.com', + classifiers=['Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: C++', + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Topic :: Software Development :: Quality Assurance', + 'License :: Freely Distributable'], + description='Automated checker to ensure C++ files follow Google\'s style guide', + long_description=open('README.rst').read(), + license='BSD-3-Clause', + setup_requires=[ + "pytest-runner" + ], + tests_require=test_required, + # extras_require allow pip install .[dev] + extras_require={ + 'test': test_required, + 'dev': read_without_comments('dev-requirements') + test_required + }, + cmdclass={ + 'lint': Lint + }) diff --git a/lib/cpplint_1.4.5/test-requirements b/lib/cpplint_1.4.5/test-requirements new file mode 100644 index 00000000000..66d769bf4c8 --- /dev/null +++ b/lib/cpplint_1.4.5/test-requirements @@ -0,0 +1,8 @@ +# minimal requirements to run python setup.py test +# 5.x requires python 3.5 +pytest>=4.6,<5.0 +pytest-cov +# freeze versions breaking python 2.7 on travis +pyparsing<3 +zipp<=0.5.1 +configparser<=3.7.4 diff --git a/lib/cpplint_1.4.5/tox.ini b/lib/cpplint_1.4.5/tox.ini new file mode 100644 index 00000000000..d187daab102 --- /dev/null +++ b/lib/cpplint_1.4.5/tox.ini @@ -0,0 +1,13 @@ +[tox] +envlist = py27, py34, py35, py36, pypy, pypy3 + +[testenv] +deps = + py36: flake8>=3.7.8 + py36: radon>=2.4.0 + py36: pylint>=1.8.4 + +commands = + {envpython} setup.py test + py36: {envpython} setup.py lint + py36: {envpython} setup.py style diff --git a/lib/cpplint_4.45/cppguide.html b/lib/cpplint_4.45/cppguide.html deleted file mode 100644 index f517fde0d8d..00000000000 --- a/lib/cpplint_4.45/cppguide.html +++ /dev/null @@ -1,5817 +0,0 @@ - - - - -Google C++ Style Guide - - - - -
-

Google C++ Style Guide

-
- -
- - - -

C++ is the main development language used by -many of Google's open-source projects. As every C++ -programmer knows, the language has many powerful features, but -this power brings with it complexity, which in turn can make -code more bug-prone and harder to read and maintain.

- -

The goal of this guide is to manage this complexity by -describing in detail the dos and don'ts of writing C++ code. -These rules exist to -keep the code base manageable while still allowing -coders to use C++ language features productively.

- -

Style, also known as readability, is what we call -the conventions that govern our C++ code. The term Style is a -bit of a misnomer, since these conventions cover far more than -just source file formatting.

- -

One way in which we keep the code base manageable is by -enforcing consistency. It is very -important that any -programmer be able to look at -another's code and quickly understand it. Maintaining a uniform -style and following conventions means that we can more easily -use "pattern-matching" to infer what various symbols are and -what invariants are true about them. Creating common, required -idioms and patterns makes code much easier to understand. In -some cases there might be good arguments for changing certain -style rules, but we nonetheless keep things as they are in -order to preserve consistency.

- -

Another issue this guide addresses is that of C++ feature -bloat. C++ is a huge language with many advanced features. In -some cases we constrain, or even ban, use of certain features. -We do this to keep code simple and to avoid the various common -errors and problems that these features can cause. This guide -lists these features and explains why their use is -restricted.

- -

Open-source projects -developed by Google conform to the requirements in this -guide.

- - - -

Note that this guide is not a C++ tutorial: we assume that -the reader is familiar with the language.

- - - -

Header Files

- -

In general, every .cc file should have an -associated .h file. There are some common -exceptions, such as unittests and -small .cc files containing just a -main() function.

- -

Correct use of header files can make a huge difference to -the readability, size and performance of your code.

- -

The following rules will guide you through the various -pitfalls of using header files.

- - -

Self-contained Headers

- -
-

Header files should be self-contained and end in .h. Files that -are meant for textual inclusion, but are not headers, should end in -.inc. Separate -inl.h headers are disallowed.

-
- -
-

All header files should be self-contained. In other -words, users and refactoring tools should not have to adhere to special -conditions in order to include the header. Specifically, a -header should have header guards, -should include all other headers it needs, and should not require any -particular symbols to be defined.

- -

There are rare cases where a file is not meant to be self-contained, but -instead is meant to be textually included at a specific point in the code. -Examples are files that need to be included multiple times or -platform-specific extensions that essentially are part of other headers. Such -files should use the file extension .inc.

- -

If a template or inline function is declared in a .h file, -define it in that same file. The definitions of these constructs must -be included into every .cc file that uses them, or the -program may fail to link in some build configurations. Do not move these -definitions to separate -inl.h files.

- -

As an exception, a function template that is explicitly -instantiated for all relevant sets of template arguments, or -that is a private member of a class, may -be defined in the only .cc file that -instantiates the template.

- -
- -

The #define Guard

- -
-

All header files should have #define guards to -prevent multiple inclusion. The format of the symbol name -should be -<PROJECT>_<PATH>_<FILE>_H_.

-
- -
- - - -

To guarantee uniqueness, they should -be based on the full path in a project's source tree. For -example, the file foo/src/bar/baz.h in -project foo should have the following -guard:

- -
#ifndef FOO_BAR_BAZ_H_
-#define FOO_BAR_BAZ_H_
-
-...
-
-#endif  // FOO_BAR_BAZ_H_
-
- - - - -
- -

Forward Declarations

- -
-

You may forward declare ordinary classes in order to avoid -unnecessary #includes.

-
- -
- -
-

A "forward declaration" is a declaration of a class, -function, or template without an associated definition. -#include lines can often be replaced with -forward declarations of whatever symbols are actually -used by the client code.

-
- -
-
    -
  • Unnecessary #includes force the - compiler to open more files and process more - input.
  • - -
  • They can also force your code to be recompiled more - often, due to changes in the header.
  • -
-
- -
-
    -
  • It can be difficult to determine the correct form - of a forward declaration in the presence of features - like templates, typedefs, default parameters, and using - declarations.
  • - -
  • It can be difficult to determine whether a forward - declaration or a full #include is needed - for a given piece of code, particularly when implicit - conversion operations are involved. In extreme cases, - replacing an #include with a forward - declaration can silently change the meaning of - code.
  • - -
  • Forward declaring multiple symbols from a header - can be more verbose than simply - #includeing the header.
  • - -
  • Forward declarations of functions and templates can - prevent the header owners from making - otherwise-compatible changes to their APIs; for - example, widening a parameter type, or adding a - template parameter with a default value.
  • -
  • Forward declaring symbols from namespace - std:: usually yields undefined - behavior.
  • - -
  • Structuring code to enable forward declarations - (e.g. using pointer members instead of object members) - can make the code slower and more complex.
  • - -
  • The practical efficiency benefits of forward - declarations are unproven.
  • -
-
- -
-
    -
  • When using a function declared in a header file, - always #include that header.
  • - -
  • When using a class template, prefer to - #include its header file.
  • - -
  • When using an ordinary class, relying on a forward - declaration is OK, but be wary of situations where a - forward declaration may be insufficient or incorrect; - when in doubt, just #include the - appropriate header.
  • - -
  • Do not replace data members with pointers just to - avoid an #include.
  • -
- -

Please see Names and Order -of Includes for rules about when to #include a header.

-
- -
- -

Inline Functions

- -
-

Define functions inline only when they are small, say, 10 -lines or less.

-
- -
- -
-

You can declare functions in a way that allows the compiler to expand -them inline rather than calling them through the usual -function call mechanism.

-
- -
-

Inlining a function can generate more efficient object -code, as long as the inlined function is small. Feel free -to inline accessors and mutators, and other short, -performance-critical functions.

-
- -
-

Overuse of inlining can actually make programs slower. -Depending on a function's size, inlining it can cause the -code size to increase or decrease. Inlining a very small -accessor function will usually decrease code size while -inlining a very large function can dramatically increase -code size. On modern processors smaller code usually runs -faster due to better use of the instruction cache.

-
- -
-

A decent rule of thumb is to not inline a function if -it is more than 10 lines long. Beware of destructors, -which are often longer than they appear because of -implicit member- and base-destructor calls!

- -

Another useful rule of thumb: it's typically not cost -effective to inline functions with loops or switch -statements (unless, in the common case, the loop or -switch statement is never executed).

- -

It is important to know that functions are not always -inlined even if they are declared as such; for example, -virtual and recursive functions are not normally inlined. -Usually recursive functions should not be inline. The -main reason for making a virtual function inline is to -place its definition in the class, either for convenience -or to document its behavior, e.g., for accessors and -mutators.

-
- -
- -

Function Parameter Ordering

- -
-

When defining a function, parameter order is: inputs, then -outputs.

-
- -
-

Parameters to C/C++ functions are either input to the -function, output from the function, or both. Input -parameters are usually values or const -references, while output and input/output parameters will -be non-const pointers. When ordering -function parameters, put all input-only parameters before -any output parameters. In particular, do not add new -parameters to the end of the function just because they -are new; place new input-only parameters before the -output parameters.

- -

This is not a hard-and-fast rule. Parameters that are -both input and output (often classes/structs) muddy the -waters, and, as always, consistency with related -functions may require you to bend the rule.

- -
- -

Names and Order of Includes

- -
-

Use standard order for readability and to avoid hidden -dependencies: Related header, C library, C++ library, other libraries' -.h, your project's .h.

-
- -
-

-All of a project's header files should be -listed as descendants of the project's source -directory without use of UNIX directory shortcuts -. (the current directory) or .. -(the parent directory). For example, - -google-awesome-project/src/base/logging.h -should be included as:

- -
#include "base/logging.h"
-
- -

In dir/foo.cc or -dir/foo_test.cc, whose main -purpose is to implement or test the stuff in -dir2/foo2.h, order your includes -as follows:

- -
    -
  1. dir2/foo2.h.
  2. - -
  3. C system files.
  4. - -
  5. C++ system files.
  6. - -
  7. Other libraries' .h - files.
  8. - -
  9. - Your project's .h - files.
  10. -
- -

With the preferred ordering, if -dir2/foo2.h omits any necessary -includes, the build of dir/foo.cc -or dir/foo_test.cc will break. -Thus, this rule ensures that build breaks show up first -for the people working on these files, not for innocent -people in other packages.

- -

dir/foo.cc and -dir2/foo2.h are usually in the same -directory (e.g. base/basictypes_test.cc and -base/basictypes.h), but may sometimes be in different -directories too.

- - - -

Within each section the includes should be ordered -alphabetically. Note that older code might not conform to -this rule and should be fixed when convenient.

- -

You should include all the headers that define the symbols you rely -upon (except in cases of forward -declaration). If you rely on symbols from bar.h, -don't count on the fact that you included foo.h which -(currently) includes bar.h: include bar.h -yourself, unless foo.h explicitly demonstrates its intent -to provide you the symbols of bar.h. However, any -includes present in the related header do not need to be included -again in the related cc (i.e., foo.cc can -rely on foo.h's includes).

- -

For example, the includes in - -google-awesome-project/src/foo/internal/fooserver.cc -might look like this:

- - -
#include "foo/server/fooserver.h"
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <hash_map>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/commandlineflags.h"
-#include "foo/server/bar.h"
-
- -

Sometimes, system-specific code needs -conditional includes. Such code can put conditional -includes after other includes. Of course, keep your -system-specific code small and localized. Example:

- -
#include "foo/public/fooserver.h"
-
-#include "base/port.h"  // For LANG_CXX11.
-
-#ifdef LANG_CXX11
-#include <initializer_list>
-#endif  // LANG_CXX11
-
- -
- -

Scoping

- -

Namespaces

- -
-

Unnamed namespaces in .cc files are -encouraged. With named namespaces, choose the name based on -the -project, and possibly its -path. Do not use a using-directive. -Do not use inline namespaces.

-
- -
- -
-

Namespaces subdivide the global scope -into distinct, named scopes, and so are useful for preventing -name collisions in the global scope.

-
- -
- -

Namespaces provide a (hierarchical) axis of naming, in -addition to the (also hierarchical) name axis provided by -classes.

- -

For example, if two different projects have a class -Foo in the global scope, these symbols may -collide at compile time or at runtime. If each project -places their code in a namespace, -project1::Foo and project2::Foo -are now distinct symbols that do not collide.

- -

Inline namespaces automatically place their names in -the enclosing scope. Consider the following snippet, for -example:

- -
namespace X {
-inline namespace Y {
-  void foo();
-}
-}
-
- -

The expressions X::Y::foo() and -X::foo() are interchangeable. Inline -namespaces are primarily intended for ABI compatibility -across versions.

-
- -
- -

Namespaces can be confusing, because they provide an -additional (hierarchical) axis of naming, in addition to -the (also hierarchical) name axis provided by -classes.

- -

Inline namespaces, in particular, can be confusing -because names aren't actually restricted to the namespace -where they are declared. They are only useful as part of -some larger versioning policy.

- -

Use of unnamed namespaces in header files can easily -cause violations of the C++ One Definition Rule -(ODR).

-
- -
- -

Use namespaces according to the policy described -below. Terminate namespaces with comments as shown in the -given examples.

-
- -

Unnamed Namespaces

- -
    -
  • -

    Unnamed namespaces are allowed and even encouraged - in .cc files, to avoid link time naming - conflicts:

    - -
    namespace {                           // This is in a .cc file.
    -
    -// The content of a namespace is not indented.
    -//
    -// This function is guaranteed not to generate a colliding symbol
    -// with other symbols at link time, and is only visible to
    -// callers in this .cc file.
    -bool UpdateInternals(Frobber* f, int newval) {
    -  ...
    -}
    -
    -}  // namespace
    -
    - -

    However, file-scope declarations that are - associated with a particular class may be declared in - that class as types, static data members or static - member functions rather than as members of an unnamed - namespace.

    -
  • - -
  • Do not use unnamed namespaces in .h - files.
  • -
- -

Named Namespaces

- -

Named namespaces should be used as follows:

- -
    -
  • -

    Namespaces wrap the entire source file after - includes, - - gflags definitions/declarations, and - forward declarations of classes from other namespaces:

    - -
    // In the .h file
    -namespace mynamespace {
    -
    -// All declarations are within the namespace scope.
    -// Notice the lack of indentation.
    -class MyClass {
    - public:
    -  ...
    -  void Foo();
    -};
    -
    -}  // namespace mynamespace
    -
    - -
    // In the .cc file
    -namespace mynamespace {
    -
    -// Definition of functions is within scope of the namespace.
    -void MyClass::Foo() {
    -  ...
    -}
    -
    -}  // namespace mynamespace
    -
    - -

    The typical .cc file might have more - complex detail, including the need to reference - classes in other namespaces.

    - - -
    #include "a.h"
    -
    -DEFINE_bool(someflag, false, "dummy flag");
    -
    -class C;  // Forward declaration of class C in the global namespace.
    -namespace a { class A; }  // Forward declaration of a::A.
    -
    -namespace b {
    -
    -...code for b...         // Code goes against the left margin.
    -
    -}  // namespace b
    -
    -
  • - - - -
  • Do not declare anything in namespace - std, not even forward declarations of - standard library classes. Declaring entities in - namespace std is undefined behavior, i.e., - not portable. To declare entities from the standard - library, include the appropriate header file.
  • - -
  • You may not use a using-directive - to make all names from a namespace available.

    - -
    // Forbidden -- This pollutes the namespace.
    -using namespace foo;
    -
    -
  • - -
  • You may use a using-declaration - anywhere in a .cc file, and in functions, - methods or classes in .h files.

    - -
    // OK in .cc files.
    -// Must be in a function, method or class in .h files.
    -using ::foo::bar;
    -
    -
  • - -
  • Namespace aliases are allowed anywhere in a - .cc file, anywhere inside the named namespace - that wraps an entire .h file, and in - functions and methods.

    - -
    // Shorten access to some commonly used names in .cc files.
    -namespace fbz = ::foo::bar::baz;
    -
    -// Shorten access to some commonly used names (in a .h file).
    -namespace librarian {
    -// The following alias is available to all files including
    -// this header (in namespace librarian):
    -// alias names should therefore be chosen consistently
    -// within a project.
    -namespace pd_s = ::pipeline_diagnostics::sidetable;
    -
    -inline void my_inline_function() {
    -  // namespace alias local to a function (or method).
    -  namespace fbz = ::foo::bar::baz;
    -  ...
    -}
    -}  // namespace librarian
    -
    - -

    Note that an alias in a .h file is visible to - everyone #including that file, so public headers - (those available outside a project) and headers - transitively #included by them, should avoid defining - aliases, as part of the general goal of keeping - public APIs as small as possible.

    -
  • - -
  • Do not use inline namespaces.
  • -
- - - - - - -
- -

Nested Classes

- -
-

Although you may use public nested classes when they are -part of an interface, consider a namespace -to keep declarations out of the global scope.

-
- -
- -
-

A class can define another class within it; this is also -called a member class.

- - -
class Foo {
-
- private:
-  // Bar is a member class, nested within Foo.
-  class Bar {
-    ...
-  };
-
-};
-
-
- -
-

This is useful when the nested (or member) class is only -used by the enclosing class; making it a member puts it -in the enclosing class scope rather than polluting the -outer scope with the class name. Nested classes can be -forward declared within the enclosing class and then -defined in the .cc file to avoid including -the nested class definition in the enclosing class -declaration, since the nested class definition is usually -only relevant to the implementation.

-
- -
-

Nested classes can be forward-declared only within the -definition of the enclosing class. Thus, any header file -manipulating a Foo::Bar* pointer will have -to include the full class declaration for -Foo.

-
- -
-

Do not make nested classes public unless they are -actually part of the interface, e.g., a class that holds a -set of options for some method.

-
- -
- -

Nonmember, Static Member, and Global Functions

- -
-

Prefer nonmember functions within a namespace or static -member functions to global functions; use completely global -functions rarely.

-
- -
- -
-

Nonmember and static member functions can be useful in - some situations. Putting nonmember functions in a - namespace avoids polluting the global namespace.

-
- -
-

Nonmember and static member functions may make more sense -as members of a new class, especially if they access -external resources or have significant dependencies.

-
- -
-

Sometimes it is useful, or even necessary, to define a -function not bound to a class instance. Such a function -can be either a static member or a nonmember function. -Nonmember functions should not depend on external -variables, and should nearly always exist in a namespace. -Rather than creating classes only to group static member -functions which do not share static data, use -namespaces instead.

- -

Functions defined in the same compilation unit as -production classes may introduce unnecessary coupling and -link-time dependencies when directly called from other -compilation units; static member functions are -particularly susceptible to this. Consider extracting a -new class, or placing the functions in a namespace -possibly in a separate library.

- -

If you must define a nonmember function and it is only -needed in its .cc file, use an unnamed -namespace or -static linkage (eg static int Foo() -{...}) to limit its scope.

-
- -
- -

Local Variables

- -
-

Place a function's variables in the narrowest scope -possible, and initialize variables in the declaration.

-
- -
- -

C++ allows you to declare variables anywhere in a -function. We encourage you to declare them in as local a -scope as possible, and as close to the first use as -possible. This makes it easier for the reader to find the -declaration and see what type the variable is and what it -was initialized to. In particular, initialization should -be used instead of declaration and assignment, e.g.:

- -
int i;
-i = f();      // Bad -- initialization separate from declaration.
-
- -
int j = g();  // Good -- declaration has initialization.
-
- -
vector<int> v;
-v.push_back(1);  // Prefer initializing using brace initialization.
-v.push_back(2);
-
- -
vector<int> v = {1, 2};  // Good -- v starts initialized.
-
- -

Variables needed for if, while -and for statements should normally be declared -within those statements, so that such variables are confined -to those scopes. E.g.:

- -
while (const char* p = strchr(str, '/')) str = p + 1;
-
- -

There is one caveat: if the variable is an object, its -constructor is invoked every time it enters scope and is -created, and its destructor is invoked every time it goes -out of scope.

- -
// Inefficient implementation:
-for (int i = 0; i < 1000000; ++i) {
-  Foo f;  // My ctor and dtor get called 1000000 times each.
-  f.DoSomething(i);
-}
-
- -

It may be more efficient to declare such a variable -used in a loop outside that loop:

- -
Foo f;  // My ctor and dtor get called once each.
-for (int i = 0; i < 1000000; ++i) {
-  f.DoSomething(i);
-}
-
- -
- -

Static and Global Variables

- -
-

Static or global variables of class type are forbidden: -they cause hard-to-find bugs due to indeterminate order of -construction and destruction. However, such variables are -allowed if they are constexpr: they have no -dynamic initialization or destruction.

-
- -
- -

Objects with static storage duration, including global -variables, static variables, static class member -variables, and function static variables, must be Plain -Old Data (POD): only ints, chars, floats, or pointers, or -arrays/structs of POD.

- -

The order in which class constructors and initializers -for static variables are called is only partially -specified in C++ and can even change from build to build, -which can cause bugs that are difficult to find. -Therefore in addition to banning globals of class type, -we do not allow static POD variables to be initialized -with the result of a function, unless that function (such -as getenv(), or getpid()) does not itself depend on any -other globals. (This prohibition does not apply to a static -variable within function scope, since its initialization -order is well-defined and does not occur until control -passes through its declaration.)

- -

Likewise, global and static variables are destroyed -when the program terminates, regardless of whether the -termination is by returning from main() or -by calling exit(). The order in which -destructors are called is defined to be the reverse of -the order in which the constructors were called. Since -constructor order is indeterminate, so is destructor -order. For example, at program-end time a static variable -might have been destroyed, but code still running -— perhaps in another thread -— tries to access it and fails. Or the -destructor for a static string variable -might be run prior to the destructor for another variable -that contains a reference to that string.

- -

One way to alleviate the destructor problem is to -terminate the program by calling -quick_exit() instead of exit(). -The difference is that quick_exit() does not -invoke destructors and does not invoke any handlers that -were registered by calling atexit(). If you -have a handler that needs to run when a program -terminates via quick_exit() (flushing logs, -for example), you can register it using -at_quick_exit(). (If you have a handler that -needs to run at both exit() and -quick_exit(), you need to register it in -both places.)

- -

As a result we only allow static variables to contain -POD data. This rule completely disallows -vector (use C arrays instead), or -string (use const char []).

- - - -

If you need a static or global -variable of a class type, consider initializing a pointer -(which will never be freed), from either your main() -function or from pthread_once(). Note that this must be a -raw pointer, not a "smart" pointer, since the smart -pointer's destructor will have the order-of-destructor -issue that we are trying to avoid.

- - - - - -
- -

Classes

- -

Classes are the fundamental unit of code in C++. Naturally, -we use them extensively. This section lists the main dos and -don'ts you should follow when writing a class.

- -

Doing Work in Constructors

- -
-

Avoid doing complex initialization in constructors (in -particular, initialization that can fail or that requires -virtual method calls).

-
- -
- -
-

It is possible to perform initialization in the body -of the constructor.

-
- -
-

Convenience in typing. No need to worry about whether the -class has been initialized or not.

-
- -
-

The problems with doing work in constructors are:

- -
    -
  • There is no easy way for constructors to signal - errors, short of using exceptions (which are - forbidden).
  • - -
  • If the work fails, we now have an object whose - initialization code failed, so it may be an - indeterminate state.
  • - -
  • If the work calls virtual functions, these calls - will not get dispatched to the subclass - implementations. Future modification to your class can - quietly introduce this problem even if your class is - not currently subclassed, causing much confusion.
  • - -
  • If someone creates a global variable of this type - (which is against the rules, but still), the - constructor code will be called before - main(), possibly breaking some implicit - assumptions in the constructor code. For instance, - - - gflags - will not yet have been initialized.
  • -
-
- - -
-

Constructors should never call virtual functions or -attempt to raise non-fatal failures. If your object requires -non-trivial initialization, consider using - a factory function or Init() -method.

-
- -
- -

Initialization

- -
-

If your class defines member variables, you must provide an -in-class initializer for every member variable or write a -constructor (which can be a default constructor). If you do -not declare any constructors yourself then the compiler -will generate a default constructor for you, which may -leave some fields uninitialized or initialized to -inappropriate values.

-
- -
- -
-

The default constructor is called when we -new a class object with no arguments. It is always -called when calling new[] (for arrays). In-class -member initialization means declaring a member variable using a -construction like int count_ = 17; or -string name_{"abc"};, as opposed to just -int count_; or string name_;.

-
- -
-

A user-defined default constructor is used to -initialize an object if no initializer is provided. It -can ensure that an object is always in a valid and usable -state as soon as it's constructed; it can also ensure -that an object is initially created in an obviously -"impossible" state, to aid debugging.

- -

In-class member initialization ensures that a member -variable will be initialized appropriately without having -to duplicate the initialization code in multiple -constructors. This can reduce bugs where you add a new -member variable, initialize it in one constructor, and -forget to put that initialization code in another -constructor.

-
- -
-

Explicitly defining a default constructor is extra -work for you, the code writer.

- -

In-class member initialization is potentially -confusing if a member variable is initialized as part of -its declaration and also initialized in a constructor, -since the value in the constructor will override the -value in the declaration.

-
- -
-

Use in-class member initialization for simple -initializations, especially when a member variable must -be initialized the same way in more than one -constructor.

- -

If your class defines member variables that aren't -initialized in-class, and if it has no other -constructors, you must define a default constructor (one -that takes no arguments). It should preferably initialize -the object in such a way that its internal state is -consistent and valid.

- -

The reason for this is that if you have no other -constructors and do not define a default constructor, the -compiler will generate one for you. This compiler -generated constructor may not initialize your object -sensibly.

- -

If your class inherits from an existing class but you -add no new member variables, you are not required to have -a default constructor.

-
- -
- -

Explicit Constructors

- -
-

Use the C++ keyword explicit for constructors -callable with one argument.

-
- -
- -
-

Normally, if a -constructor can be called with one argument, it can be used as a -conversion. For instance, if you define -Foo::Foo(string name) and then pass a string -to a function that expects a Foo, the -constructor will be called to convert the string into a -Foo and will pass the Foo to -your function for you. This can be convenient but is also -a source of trouble when things get converted and new -objects created without you meaning them to. Declaring a -constructor explicit prevents it from being -invoked implicitly as a conversion.

-

In addition to single-parameter constructors, this also -applies to constructors where every parameter after the -first has a default value, e.g., -Foo::Foo(string name, int id = 42).

-
- -
-

Avoids undesirable conversions.

-
- -
-

None.

-
- -
- -

We require all constructors that are callable with -a single argument to be -explicit. Always put explicit in front of -such constructors in the class definition: -explicit Foo(string name);

- -

Copy and move constructors are exceptions: they should not be -explicit. Classes that are intended to be transparent -wrappers around other classes are also exceptions. -Such exceptions should be clearly marked with -comments.

- -

Finally, constructors that take only a -std::initializer_list may be non-explicit. This permits -construction of your type from a braced initializer list, as in an assignment-style initialization, -function argument, or return statement. For example:

-
  MyType m = {1, 2};
-  MyType MakeMyType() { return {1, 2}; }
-  TakeMyType({1, 2});
-
-
- -
- -

Copyable and Movable Types

- -
-

Support copying and/or moving if it makes sense for your type. -Otherwise, disable the implicitly generated special -functions that perform copies and moves.

-
- -
- -
-

A copyable type allows its objects to be initialized or assigned -from any other object of the same type, without changing the value of the source. -For user-defined types, the copy behavior is defined by the copy -constructor and the copy-assignment operator. -string is an example of a copyable type.

- -

A movable type is one that can be initialized and assigned -from temporaries (all copyable types are therefore movable). -std::unique_ptr<int> is an example of a movable but not -copyable type. For user-defined types, the move behavior is defined by the move -constructor and the move-assignment operator.

- -

The copy/move constructors can be implicitly invoked by the compiler -in some situations, e.g. when passing objects by value.

-
- -
-

Objects of copyable and movable types can be passed and returned -by value, which makes APIs simpler, safer, and more general. -Unlike when passing pointers or references, there's no risk of -confusion over ownership, lifetime, mutability, and similar -issues, and no need to specify them in the contract. It also -prevents non-local interactions between the client and the -implementation, which makes them easier to understand and -maintain. Such objects can be used with generic -APIs that require pass-by-value, such as most containers.

- -

Copy/move constructors and assignment operators are usually -easier to define correctly than alternatives -like Clone(), CopyFrom() or Swap(), -because they can be generated by the compiler, either implicitly or -with = default. They are concise, and ensure -that all data members are copied. Copy and move -constructors are also generally more efficient, because they don't -require heap allocation or separate initialization and assignment -steps, and they're eligible for optimizations such as - - -copy elision.

- -

Move operations allow the implicit and efficient transfer of -resources out of rvalue objects. This allows a plainer coding style -in some cases.

-
- -
-

Many types do not need to be copyable, and providing copy -operations for them can be confusing, nonsensical, or outright -incorrect. Copy/assigment operations for base class types are -hazardous, because use of them can lead to -object -slicing. Defaulted or carelessly-implemented copy operations -can be incorrect, and the resulting bugs can be confusing and -difficult to diagnose.

- -

Copy constructors are invoked implicitly, which makes the -invocation easy to miss. This may cause confusion, particularly -for programmers used to languages where pass-by-reference is -conventional or mandatory. It may also encourage excessive -copying, which can cause performance problems.

- - -
- -
- -

Make your type copyable/movable if it will be useful, and if it -makes sense in the context of the rest of the API. -As a rule of thumb, if the behavior (including computational -complexity) of a copy isn't immediately obvious to users of your type, -your type shouldn't be copyable. If you choose to make it copyable, -define both copy operations (constructor and assignment). If your -type is copyable and a move operation is more efficient than a copy, -define both move operations (constructor and assignment). -If your type is not copyable, but the correctness of a move is obvious -to users of the type and its fields support it, you may make the type -move-only by defining both of the move operations. -

- -

Prefer to define copy and move operations with = default. -Defining non-default move operations currently requires a style -exception. Remember to review the correctness of any defaulted -operations as you would any other code. -

- -

Due to the risk of slicing, avoid providing an assignment -operator or public copy/move constructor for a class that's -intended to be derived from (and avoid deriving from a class -with such members). If your base class needs to be -copyable, provide a public virtual Clone() -method, and a protected copy constructor that derived classes -can use to implement it.

- -

If you do not want to support copy/move operations on -your type, explicitly disable them using = delete or -whatever -other mechanism your project uses. - -

-
- -

Delegating and Inheriting Constructors

- -
-

Use delegating and inheriting -constructors when they reduce code duplication.

-
- -
- -
- -

Delegating and inheriting constructors are two -different features, both introduced in C++11, for -reducing code duplication in constructors. Delegating -constructors allow one of a class's constructors to -forward work to one of the class's other constructors, -using a special variant of the initialization list -syntax. For example:

- -
X::X(const string& name) : name_(name) {
-  ...
-}
-
-X::X() : X("") { }
-
- -

Inheriting constructors allow a derived class to have -its base class's constructors available directly, just as -with any of the base class's other member functions, -instead of having to redeclare them. This is especially -useful if the base has multiple constructors. For -example:

- -
class Base {
- public:
-  Base();
-  Base(int n);
-  Base(const string& s);
-  ...
-};
-
-class Derived : public Base {
- public:
-  using Base::Base;  // Base's constructors are redeclared here.
-};
-
- -

This is especially useful when Derived's -constructors don't have to do anything more than calling -Base's constructors.

-
- -
-

Delegating and inheriting constructors reduce -verbosity and boilerplate, which can improve -readability.

- -

Delegating constructors are familiar to Java -programmers.

-
- -
-

It's possible to approximate the behavior of -delegating constructors by using a helper function.

- -

Inheriting constructors may be confusing if a derived -class introduces new member variables, since the base -class constructor doesn't know about them.

-
- -
-

Use delegating and inheriting constructors when they reduce -boilerplate and improve readability. -Be cautious about inheriting constructors when your derived class has -new member variables. Inheriting constructors may still be appropriate -in that case if you can use in-class member initialization -for the derived class's member variables.

-
- -
- -

Structs vs. Classes

- -
-

Use a struct only for passive objects that - carry data; everything else is a class.

-
- -
- -

The struct and class -keywords behave almost identically in C++. We add our own -semantic meanings to each keyword, so you should use the -appropriate keyword for the data-type you're -defining.

- -

structs should be used for passive -objects that carry data, and may have associated -constants, but lack any functionality other than -access/setting the data members. The accessing/setting of -fields is done by directly accessing the fields rather -than through method invocations. Methods should not -provide behavior but should only be used to set up the -data members, e.g., constructor, destructor, -Initialize(), Reset(), -Validate().

- -

If more functionality is required, a -class is more appropriate. If in doubt, make -it a class.

- -

For consistency with STL, you can use -struct instead of class for -functors and traits.

- -

Note that member variables in structs and classes have -different naming rules.

- -
- -

Inheritance

- -
-

Composition is often more appropriate than inheritance. -When using inheritance, make it public.

-
- -
- -
-

When a sub-class -inherits from a base class, it includes the definitions -of all the data and operations that the parent base class -defines. In practice, inheritance is used in two major -ways in C++: implementation inheritance, in which actual -code is inherited by the child, and -interface inheritance, in which -only method names are inherited.

-
- -
-

Implementation inheritance reduces code size by re-using -the base class code as it specializes an existing type. -Because inheritance is a compile-time declaration, you -and the compiler can understand the operation and detect -errors. Interface inheritance can be used to -programmatically enforce that a class expose a particular -API. Again, the compiler can detect errors, in this case, -when a class does not define a necessary method of the -API.

-
- -
-

For implementation inheritance, because the code -implementing a sub-class is spread between the base and -the sub-class, it can be more difficult to understand an -implementation. The sub-class cannot override functions -that are not virtual, so the sub-class cannot change -implementation. The base class may also define some data -members, so that specifies physical layout of the base -class.

-
- -
- -

All inheritance should be public. If you -want to do private inheritance, you should be including -an instance of the base class as a member instead.

- -

Do not overuse implementation inheritance. Composition -is often more appropriate. Try to restrict use of -inheritance to the "is-a" case: Bar -subclasses Foo if it can reasonably be said -that Bar "is a kind of" -Foo.

- -

Make your destructor virtual if -necessary. If your class has virtual methods, its -destructor should be virtual.

- -

Limit the use of protected to those -member functions that might need to be accessed from -subclasses. Note that data -members should be private.

- -

Explicitly annotate overrides of virtual functions -or virtual destructors with an override -or (less frequently) final specifier. -Older (pre-C++11) code will use the -virtual keyword as an inferior -alternative annotation. For clarity, use exactly one of -override, final, or -virtual when declaring an override. -Rationale: A function or destructor marked -override or final that is -not an override of a base class virtual function will -not compile, and this helps catch common errors. The -specifiers serve as documentation; if no specifier is -present, the reader has to check all ancestors of the -class in question to determine if the function or -destructor is virtual or not.

-
- -
- -

Multiple Inheritance

- -
-

Only very rarely is multiple implementation inheritance -actually useful. We allow multiple inheritance only when at -most one of the base classes has an implementation; all -other base classes must be pure -interface classes tagged with the -Interface suffix.

-
- -
- -
-

Multiple inheritance allows a sub-class to have more than -one base class. We distinguish between base classes that are -pure interfaces and those that have an -implementation.

-
- -
-

Multiple implementation inheritance may let you re-use -even more code than single inheritance (see Inheritance).

-
- -
-

Only very rarely is multiple implementation -inheritance actually useful. When multiple implementation -inheritance seems like the solution, you can usually find -a different, more explicit, and cleaner solution.

-
- -
-

Multiple inheritance is allowed only when all -superclasses, with the possible exception of the first one, -are pure interfaces. In order to -ensure that they remain pure interfaces, they must end with -the Interface suffix.

-
- -
-

There is an exception to -this rule on Windows.

-
- -
- -

Interfaces

- -
-

Classes that satisfy certain conditions are allowed, but -not required, to end with an Interface suffix.

-
- -
- -
-

A class is a pure interface if it meets the following -requirements:

- -
    -
  • It has only public pure virtual ("= - 0") methods and static methods (but see below - for destructor).
  • - -
  • It may not have non-static data members.
  • - -
  • It need not have any constructors defined. If a - constructor is provided, it must take no arguments and - it must be protected.
  • - -
  • If it is a subclass, it may only be derived from - classes that satisfy these conditions and are tagged - with the Interface suffix.
  • -
- -

An interface class can never be directly instantiated -because of the pure virtual method(s) it declares. To -make sure all implementations of the interface can be -destroyed correctly, the interface must also declare a -virtual destructor (in an exception to the first rule, -this should not be pure). See Stroustrup, The C++ -Programming Language, 3rd edition, section 12.4 -for details.

-
- -
-

Tagging a class with the Interface suffix -lets others know that they must not add implemented -methods or non static data members. This is particularly -important in the case of multiple inheritance. -Additionally, the interface concept is already -well-understood by Java programmers.

-
- -
-

The Interface suffix lengthens the class -name, which can make it harder to read and understand. -Also, the interface property may be considered an -implementation detail that shouldn't be exposed to -clients.

-
- -
-

A class may end -with Interface only if it meets the above -requirements. We do not require the converse, however: -classes that meet the above requirements are not required -to end with Interface.

-
- -
- -

Operator Overloading

- -
-

Do not overload operators except in rare, special -circumstances. Do not create user-defined literals.

-
- -
- -
-

A class can -define that operators such as + and -/ operate on the class as if it were a -built-in type. An overload of operator"" -allows the built-in literal syntax to be used to create -objects of class types.

-
- -
-

Operator overloading can make code appear more -intuitive because a class will behave in the same way as -built-in types (such as int). Overloaded -operators are more playful names for functions that are -less-colorfully named, such as Equals() or -Add().

- -

For some template functions to work correctly, you may -need to define operators.

- -

User-defined literals are a very concise notation for -creating objects of user-defined types.

-
- -
-

While operator overloading can make code more intuitive, -it has several drawbacks:

- -
    -
  • It can fool our intuition into thinking that - expensive operations are cheap, built-in - operations.
  • - -
  • It is much harder to find the call sites for - overloaded operators. Searching for - Equals() is much easier than searching for - relevant invocations of ==.
  • - -
  • Some operators work on pointers too, making it easy - to introduce bugs. Foo + 4 may do one - thing, while &Foo + 4 does something - totally different. The compiler does not complain for - either of these, making this very hard to debug.
  • - -
  • User-defined literals allow creating new syntactic - forms that are unfamiliar even to experienced C++ - programmers.
  • -
- -

Overloading also has surprising ramifications. For -instance, if a class overloads unary -operator&, it cannot safely be -forward-declared.

-
- -
-

In general, do not overload operators. You can define -ordinary functions like Equals() if -you need them. Likewise, avoid the dangerous unary -operator& at all costs, if there's any -possibility the class might be forward-declared.

- -

Do not overload operator"", i.e. do not -introduce user-defined literals.

- -

However, there may be rare cases where you need to -overload an operator to interoperate with templates or -"standard" C++ classes (such as -operator<<(ostream&, const T&) -for logging). These are acceptable if fully justified, but you should try to avoid these -whenever possible. In particular, do not overload -operator== or operator< just -so that your class can be used as a key in an STL -container; instead, you should create equality and -comparison functor types when declaring the -container.

- -

Some of the STL algorithms do require you to overload -operator==, and you may do so in these -cases, provided you document why.

- -

See also Copyable and Movable -Types and Function Overloading.

-
- -
- -

Access Control

- -
-

Make data members private, and provide access -to them through accessor functions as needed (for technical -reasons, we allow data members of a test fixture class to -be protected when using - - -Google -Test). Typically a variable would be called -foo_ and the accessor function -foo(). You may also want a mutator function -set_foo(). Exception: static -const data members (typically called -kFoo) need not be private.

-
- -
- -

The definitions of accessors are usually inlined in -the header file.

- -

See also Inheritance and -Function Names.

- -
- -

Declaration Order

- -
-

Use the specified order of declarations within a class: -public: before private:, methods -before data members (variables), etc.

-
- -
- -

Your class definition should start with its -public: section, followed by its -protected: section and then its -private: section. If any of these sections -are empty, omit them.

- -

Within each section, the declarations generally should -be in the following order:

- -
    -
  • Typedefs and Enums
  • - -
  • Constants (static const data - members)
  • - -
  • Constructors
  • - -
  • Destructor
  • - -
  • Methods, including static methods
  • - -
  • Data Members (except static const data - members)
  • -
- -

Friend declarations should always be in the private -section. If copying and assignment are disabled with a macro -such as DISALLOW_COPY_AND_ASSIGN, it should be -at the end of the private: section, and should be -the last thing in the class. See -Copyable and Movable Types.

- -

Method definitions in the corresponding -.cc file should be the same as the -declaration order, as much as possible.

- -

Do not put large method definitions inline in the -class definition. Usually, only trivial or -performance-critical, and very short, methods may be -defined inline. See Inline -Functions for more details.

- -
- -

Write Short Functions

- -
-

Prefer small and focused functions.

-
- -
-

We recognize that long functions are sometimes -appropriate, so no hard limit is placed on functions -length. If a function exceeds about 40 lines, think about -whether it can be broken up without harming the structure -of the program.

- -

Even if your long function works perfectly now, -someone modifying it in a few months may add new -behavior. This could result in bugs that are hard to -find. Keeping your functions short and simple makes it -easier for other people to read and modify your code.

- -

You could find long and complicated functions when -working with -some code. Do not be -intimidated by modifying existing code: if working with -such a function proves to be difficult, you find that -errors are hard to debug, or you want to use a piece of -it in several different contexts, consider breaking up -the function into smaller and more manageable pieces.

- -
- -

Google-Specific Magic

- - - -

There are various tricks and utilities that -we use to make C++ code more robust, and various ways we use -C++ that may differ from what you see elsewhere.

- - - -

Ownership and Smart Pointers

- -
-

Prefer to have single, fixed owners for dynamically -allocated objects. Prefer to transfer ownership with smart -pointers.

-
- -
- -
-

"Ownership" is a bookkeeping technique for managing -dynamically allocated memory (and other resources). The -owner of a dynamically allocated object is an object or -function that is responsible for ensuring that it is -deleted when no longer needed. Ownership can sometimes be -shared, in which case the last owner is typically -responsible for deleting it. Even when ownership is not -shared, it can be transferred from one piece of code to -another.

- -

"Smart" pointers are classes that act like pointers, -e.g. by overloading the * and --> operators. Some smart pointer types -can be used to automate ownership bookkeeping, to ensure -these responsibilities are met. - -std::unique_ptr is a smart pointer type -introduced in C++11, which expresses exclusive ownership -of a dynamically allocated object; the object is deleted -when the std::unique_ptr goes out of scope. -It cannot be copied, but can be moved to -represent ownership transfer. - -std::shared_ptr is a smart pointer type -that expresses shared ownership of -a dynamically allocated object. std::shared_ptrs -can be copied; ownership of the object is shared among -all copies, and the object is deleted when the last -std::shared_ptr is destroyed.

-
- -
-
    -
  • It's virtually impossible to manage dynamically - allocated memory without some sort of ownership - logic.
  • - -
  • Transferring ownership of an object can be cheaper - than copying it (if copying it is even possible).
  • - -
  • Transferring ownership can be simpler than - 'borrowing' a pointer or reference, because it reduces - the need to coordinate the lifetime of the object - between the two users.
  • - -
  • Smart pointers can improve readability by making - ownership logic explicit, self-documenting, and - unambiguous.
  • - -
  • Smart pointers can eliminate manual ownership - bookkeeping, simplifying the code and ruling out large - classes of errors.
  • - -
  • For const objects, shared ownership can be a simple - and efficient alternative to deep copying.
  • -
-
- -
-
    -
  • Ownership must be represented and transferred via - pointers (whether smart or plain). Pointer semantics - are more complicated than value semantics, especially - in APIs: you have to worry not just about ownership, - but also aliasing, lifetime, and mutability, among - other issues.
  • - -
  • The performance costs of value semantics are often - overestimated, so the performance benefits of ownership - transfer might not justify the readability and - complexity costs.
  • - -
  • APIs that transfer ownership force their clients - into a single memory management model.
  • - -
  • Code using smart pointers is less explicit about - where the resource releases take place.
  • - -
  • std::unique_ptr expresses ownership - transfer using C++11's move semantics, which are - relatively new and may confuse some programmers.
  • - -
  • Shared ownership can be a tempting alternative to - careful ownership design, obfuscating the design of a - system.
  • - -
  • Shared ownership requires explicit bookkeeping at - run-time, which can be costly.
  • - -
  • In some cases (e.g. cyclic references), objects - with shared ownership may never be deleted.
  • - -
  • Smart pointers are not perfect substitutes for - plain pointers.
  • -
-
- -
-

If dynamic allocation is necessary, prefer to keep -ownership with the code that allocated it. If other code -needs access to the object, consider passing it a copy, -or passing a pointer or reference without transferring -ownership. Prefer to use std::unique_ptr to -make ownership transfer explicit. For example:

- -
std::unique_ptr<Foo> FooFactory();
-void FooConsumer(std::unique_ptr<Foo> ptr);
-
- - - -

Do not design your code to use shared ownership -without a very good reason. One such reason is to avoid -expensive copy operations, but you should only do this if -the performance benefits are significant, and the -underlying object is immutable (i.e. -std::shared_ptr<const Foo>). If you -do use shared ownership, prefer to use -std::shared_ptr.

- -

Do not use scoped_ptr in new code unless -you need to be compatible with older versions of C++. -Never use std::auto_ptr. Instead, use -std::unique_ptr.

- - -
- -
- -

cpplint

- -
-

Use cpplint.py -to detect style errors.

-
- -
- -

cpplint.py -is a tool that reads a source file and identifies many -style errors. It is not perfect, and has both false -positives and false negatives, but it is still a valuable -tool. False positives can be ignored by putting // -NOLINT at the end of the line or -// NOLINTNEXTLINE in the previous line.

- - - -

Some projects have instructions on -how to run cpplint.py from their project -tools. If the project you are contributing to does not, -you can download - -cpplint.py separately.

- -
- - - -

Other C++ Features

- -

Reference Arguments

- -
-

All parameters passed by reference must be labeled -const.

-
- -
- -
-

In C, if a -function needs to modify a variable, the parameter must -use a pointer, eg int foo(int *pval). In -C++, the function can alternatively declare a reference -parameter: int foo(int &val).

-
- -
-

Defining a parameter as reference avoids ugly code like -(*pval)++. Necessary for some applications -like copy constructors. Makes it clear, unlike with -pointers, that a null pointer is not a possible -value.

-
- -
-

References can be confusing, as they have value syntax -but pointer semantics.

-
- -
-

Within function parameter lists all references must be -const:

- -
void Foo(const string &in, string *out);
-
- -

In fact it is a very strong convention in Google code -that input arguments are values or const -references while output arguments are pointers. Input -parameters may be const pointers, but we -never allow non-const reference parameters -except when required by convention, e.g., -swap().

- -

However, there are some instances where using -const T* is preferable to const -T& for input parameters. For example:

- -
    -
  • You want to pass in a null pointer.
  • - -
  • The function saves a pointer or reference to the - input.
  • -
- -

Remember that most of the time input -parameters are going to be specified as const -T&. Using const T* instead -communicates to the reader that the input is somehow -treated differently. So if you choose const -T* rather than const T&, do so -for a concrete reason; otherwise it will likely confuse -readers by making them look for an explanation that -doesn't exist.

-
- -
- -

Rvalue References

- -
-

Use rvalue references only to define move constructors and move -assignment operators. Do not -use std::forward. -

-
- -
- -
-

Rvalue references -are a type of reference that can only bind to temporary -objects. The syntax is similar to traditional reference -syntax. For example, void f(string&& -s); declares a function whose argument is an -rvalue reference to a string.

-
- -
-
    -
  • Defining a move constructor (a constructor taking - an rvalue reference to the class type) makes it - possible to move a value instead of copying it. If - v1 is a vector<string>, - for example, then auto v2(std::move(v1)) - will probably just result in some simple pointer - manipulation instead of copying a large amount of data. - In some cases this can result in a major performance - improvement.
  • - -
  • Rvalue references make it possible to write a - generic function wrapper that forwards its arguments to - another function, and works whether or not its - arguments are temporary objects.
  • - -
  • Rvalue references make it possible to implement - types that are movable but not copyable, which can be - useful for types that have no sensible definition of - copying but where you might still want to pass them as - function arguments, put them in containers, etc.
  • - -
  • std::move is necessary to make - effective use of some standard-library types, such as - std::unique_ptr.
  • -
-
- -
-
    -
  • Rvalue references are a relatively new feature - (introduced as part of C++11), and not yet widely - understood. Rules like reference collapsing, and - automatic synthesis of move constructors, are - complicated.
  • -
-
- -
-

Use rvalue references only to define move constructors and move -assignment operators, as described in -Copyable and Movable Types. -Do not use std::forward utility function. You may -use std::move to express moving a value from one object -to another rather than copying it.

-
- -
- -

Function Overloading

- -
-

Use overloaded functions (including constructors) only if a -reader looking at a call site can get a good idea of what -is happening without having to first figure out exactly -which overload is being called.

-
- -
- -
-

You may write a function that takes a const -string& and overload it with another that -takes const char*.

- -
class MyClass {
- public:
-  void Analyze(const string &text);
-  void Analyze(const char *text, size_t textlen);
-};
-
-
- -
-

Overloading can make code more intuitive by allowing an -identically-named function to take different arguments. -It may be necessary for templatized code, and it can be -convenient for Visitors.

-
- -
-

If a function is overloaded by the argument types alone, -a reader may have to understand C++'s complex matching -rules in order to tell what's going on. Also many people -are confused by the semantics of inheritance if a derived -class overrides only some of the variants of a -function.

-
- -
-

If you want to overload a function, consider qualifying -the name with some information about the arguments, e.g., -AppendString(), AppendInt() -rather than just Append().

-
- -
- -

Default Arguments

- -
-

We do not allow default function parameters, except in -limited situations as explained below. Simulate them with -function overloading instead, if appropriate.

-
- -
- -
-

Often you have a function that uses default values, but -occasionally you want to override the defaults. Default -parameters allow an easy way to do this without having to -define many functions for the rare exceptions. Compared -to overloading the function, default arguments have a -cleaner syntax, with less boilerplate and a clearer -distinction between 'required' and 'optional' -arguments.

-
- -
-

Function pointers are confusing in the presence of -default arguments, since the function signature often -doesn't match the call signature. Adding a default -argument to an existing function changes its type, which -can cause problems with code taking its address. Adding -function overloads avoids these problems. In addition, -default parameters may result in bulkier code since they -are replicated at every call-site -- as opposed to -overloaded functions, where "the default" appears only in -the function definition.

-
- -
-

While the cons above are not that onerous, they still -outweigh the (small) benefits of default arguments over -function overloading. So except as described below, we -require all arguments to be explicitly specified.

- -

One specific exception is when the function is a -static function (or in an unnamed namespace) in a .cc -file. In this case, the cons don't apply since the -function's use is so localized.

- -

In addition, default function parameters are allowed in -constructors. Most of the cons listed above don't apply to -constructors because it's impossible to take their address.

- -

Another specific exception is when default arguments -are used to simulate variable-length argument lists.

- - -
// Support up to 4 params by using a default empty AlphaNum.
-string StrCat(const AlphaNum &a,
-              const AlphaNum &b = gEmptyAlphaNum,
-              const AlphaNum &c = gEmptyAlphaNum,
-              const AlphaNum &d = gEmptyAlphaNum);
-
-
- -
- -

- Variable-Length Arrays and alloca()

- -
-

We do not allow variable-length arrays or -alloca().

-
- -
- -
-

Variable-length arrays have natural-looking syntax. Both -variable-length arrays and alloca() are very -efficient.

-
- -
-

Variable-length arrays and alloca are not part of -Standard C++. More importantly, they allocate a -data-dependent amount of stack space that can trigger -difficult-to-find memory overwriting bugs: "It ran fine -on my machine, but dies mysteriously in production".

-
- -
- - -

Use a safe allocator instead, such as -std::vector or -std::unique_ptr<T[]>.

-
- -
- -

Friends

- -
-

We allow use of friend classes and functions, -within reason.

-
- -
- -

Friends should usually be defined in the same file so -that the reader does not have to look in another file to -find uses of the private members of a class. A common use -of friend is to have a -FooBuilder class be a friend of -Foo so that it can construct the inner state -of Foo correctly, without exposing this -state to the world. In some cases it may be useful to -make a unittest class a friend of the class it tests.

- -

Friends extend, but do not break, the encapsulation -boundary of a class. In some cases this is better than -making a member public when you want to give only one -other class access to it. However, most classes should -interact with other classes solely through their public -members.

- -
- -

Exceptions

- -
-

We do not use C++ exceptions.

-
- -
- -
-
    -
  • Exceptions allow higher levels of an application to - decide how to handle "can't happen" failures in deeply - nested functions, without the obscuring and error-prone - bookkeeping of error codes.
  • - - - -
  • Exceptions are used by most other - modern languages. Using them in C++ would make it more - consistent with Python, Java, and the C++ that others - are familiar with.
  • - -
  • Some third-party C++ libraries use exceptions, and - turning them off internally makes it harder to - integrate with those libraries.
  • - -
  • Exceptions are the only way for a constructor to - fail. We can simulate this with a factory function or - an Init() method, but these require heap - allocation or a new "invalid" state, respectively.
  • - -
  • Exceptions are really handy in testing - frameworks.
  • -
-
- -
-
    -
  • When you add a throw statement to an - existing function, you must examine all of its - transitive callers. Either they must make at least the - basic exception safety guarantee, or they must never - catch the exception and be happy with the program - terminating as a result. For instance, if - f() calls g() calls - h(), and h throws an - exception that f catches, g - has to be careful or it may not clean up properly.
  • - -
  • More generally, exceptions make the control flow of - programs difficult to evaluate by looking at code: - functions may return in places you don't expect. This - causes maintainability and debugging difficulties. You - can minimize this cost via some rules on how and where - exceptions can be used, but at the cost of more that a - developer needs to know and understand.
  • - -
  • Exception safety requires both RAII and different - coding practices. Lots of supporting machinery is - needed to make writing correct exception-safe code - easy. Further, to avoid requiring readers to understand - the entire call graph, exception-safe code must isolate - logic that writes to persistent state into a "commit" - phase. This will have both benefits and costs (perhaps - where you're forced to obfuscate code to isolate the - commit). Allowing exceptions would force us to always - pay those costs even when they're not worth it.
  • - -
  • Turning on exceptions adds data to each binary - produced, increasing compile time (probably slightly) - and possibly increasing address space pressure. -
  • - -
  • The availability of exceptions may encourage - developers to throw them when they are not appropriate - or recover from them when it's not safe to do so. For - example, invalid user input should not cause exceptions - to be thrown. We would need to make the style guide - even longer to document these restrictions!
  • -
-
- -
-

On their face, the benefits of using exceptions -outweigh the costs, especially in new projects. However, -for existing code, the introduction of exceptions has -implications on all dependent code. If exceptions can be -propagated beyond a new project, it also becomes -problematic to integrate the new project into existing -exception-free code. Because most existing C++ code at -Google is not prepared to deal with exceptions, it is -comparatively difficult to adopt new code that generates -exceptions.

- -

Given that Google's existing code is not -exception-tolerant, the costs of using exceptions are -somewhat greater than the costs in a new project. The -conversion process would be slow and error-prone. We -don't believe that the available alternatives to -exceptions, such as error codes and assertions, introduce -a significant burden.

- -

Our advice against using exceptions is not predicated -on philosophical or moral grounds, but practical ones. - Because we'd like to use our open-source -projects at Google and it's difficult to do so if those -projects use exceptions, we need to advise against -exceptions in Google open-source projects as well. -Things would probably be different if we had to do it all -over again from scratch.

- -

This prohibition also applies to the exception-related -features added in C++11, such as noexcept, -std::exception_ptr, and -std::nested_exception.

- -

There is an exception to -this rule (no pun intended) for Windows code.

-
- -
- -

Run-Time Type -Information (RTTI)

- -
-

Avoid using Run Time Type Information (RTTI).

-
- -
- -
-

RTTI allows a -programmer to query the C++ class of an object at run -time. This is done by use of typeid or -dynamic_cast.

-
- -
-

Querying the type of an object at run-time frequently -means a design problem. Needing to know the type of an -object at runtime is often an indication that the design -of your class hierarchy is flawed.

- -

Undisciplined use of RTTI makes code hard to maintain. -It can lead to type-based decision trees or switch -statements scattered throughout the code, all of which -must be examined when making further changes.

-
- -
-

The standard alternatives to RTTI (described below) -require modification or redesign of the class hierarchy -in question. Sometimes such modifications are infeasible -or undesirable, particularly in widely-used or mature -code.

- -

RTTI can be useful in some unit tests. For example, it -is useful in tests of factory classes where the test has -to verify that a newly created object has the expected -dynamic type. It is also useful in managing the -relationship between objects and their mocks.

- -

RTTI is useful when considering multiple abstract -objects. Consider

- -
bool Base::Equal(Base* other) = 0;
-bool Derived::Equal(Base* other) {
-  Derived* that = dynamic_cast<Derived*>(other);
-  if (that == NULL)
-    return false;
-  ...
-}
-
-
- -
-

RTTI has legitimate uses but is prone to abuse, so you -must be careful when using it. You may use it freely in -unittests, but avoid it when possible in other code. In -particular, think twice before using RTTI in new code. If -you find yourself needing to write code that behaves -differently based on the class of an object, consider one -of the following alternatives to querying the type:

- -
    -
  • Virtual methods are the preferred way of executing - different code paths depending on a specific subclass - type. This puts the work within the object itself.
  • - -
  • If the work belongs outside the object and instead - in some processing code, consider a double-dispatch - solution, such as the Visitor design pattern. This - allows a facility outside the object itself to - determine the type of class using the built-in type - system.
  • -
- -

When the logic of a program guarantees that a given -instance of a base class is in fact an instance of a -particular derived class, then a -dynamic_cast may be used freely on the -object. Usually one -can use a static_cast as an alternative in -such situations.

- -

Decision trees based on type are a strong indication -that your code is on the wrong track.

- -
if (typeid(*data) == typeid(D1)) {
-  ...
-} else if (typeid(*data) == typeid(D2)) {
-  ...
-} else if (typeid(*data) == typeid(D3)) {
-...
-
- -

Code such as this usually breaks when additional -subclasses are added to the class hierarchy. Moreover, -when properties of a subclass change, it is difficult to -find and modify all the affected code segments.

- -

Do not hand-implement an RTTI-like workaround. The -arguments against RTTI apply just as much to workarounds -like class hierarchies with type tags. Moreover, -workarounds disguise your true intent.

-
- -
- -

Casting

- -
-

Use C++ casts like static_cast<>(). Do -not use other cast formats like int y = -(int)x; or int y = int(x);.

-
- -
- -
-

C++ introduced a -different cast system from C that distinguishes the types -of cast operations.

-
- -
-

The problem with C casts is the ambiguity of the -operation; sometimes you are doing a conversion -(e.g., (int)3.5) and sometimes you are doing -a cast (e.g., (int)"hello"); C++ -casts avoid this. Additionally C++ casts are more visible -when searching for them.

-
- -
-

The syntax is nasty.

-
- -
-

Do not use C-style casts. Instead, use these C++-style -casts.

- -
    - - -
  • Use static_cast as the equivalent of a - C-style cast that does value conversion, or when you need to explicitly up-cast a - pointer from a class to its superclass.
  • - -
  • Use const_cast to remove the - const qualifier (see const).
  • - - - - - -
  • Use reinterpret_cast to do unsafe - conversions of pointer types to and from integer and - other pointer types. Use this only if you know what you - are doing and you understand the aliasing issues. -
  • -
- -

See the -RTTI section for guidance on the use of -dynamic_cast.

-
- -
- -

Streams

- -
-

Use streams only for logging.

-
- -
- -
-

Streams are a replacement for printf() -and scanf().

-
- -
-

With streams, you do not need to know the type of the -object you are printing. You do not have problems with -format strings not matching the argument list. (Though -with gcc, you do not have that problem with -printf either.) Streams have automatic -constructors and destructors that open and close the -relevant files.

-
- -
-

Streams make it difficult to do functionality like -pread(). Some formatting (particularly the -common format string idiom %.*s) is -difficult if not impossible to do efficiently using -streams without using printf-like hacks. -Streams do not support operator reordering (the -%1$s directive), which is helpful for -internationalization.

-
- -
- - -

Do not use streams, except where -required by a logging interface. Use -printf-like routines instead.

- -

There are various pros and cons to using streams, but -in this case, as in many other cases, consistency trumps -the debate. Do not use streams in your code.

-
- -
-

Extended Discussion

- -

There has been debate on this issue, so this explains -the reasoning in greater depth. Recall the Only One Way -guiding principle: we want to make sure that whenever we -do a certain type of I/O, the code looks the same in all -those places. Because of this, we do not want to allow -users to decide between using streams or using -printf plus Read/Write/etc. Instead, we -should settle on one or the other. We made an exception -for logging because it is a pretty specialized -application, and for historical reasons.

- -

Proponents of streams have argued that streams are the -obvious choice of the two, but the issue is not actually -so clear. For every advantage of streams they point out, -there is an equivalent disadvantage. The biggest -advantage is that you do not need to know the type of the -object to be printing. This is a fair point. But, there -is a downside: you can easily use the wrong type, and the -compiler will not warn you. It is easy to make this kind -of mistake without knowing when using streams.

- -
cout << this;  // Prints the address
-cout << *this;  // Prints the contents
-
- -

The compiler does not generate an error because -<< has been overloaded. We discourage -overloading for just this reason.

- -

Some say printf formatting is ugly and -hard to read, but streams are often no better. Consider -the following two fragments, both with the same typo. -Which is easier to discover?

- - -
cerr << "Error connecting to '" << foo->bar()->hostname.first
-     << ":" << foo->bar()->hostname.second << ": " << strerror(errno);
-
-fprintf(stderr, "Error connecting to '%s:%u: %s",
-        foo->bar()->hostname.first, foo->bar()->hostname.second,
-        strerror(errno));
-
- -

And so on and so forth for any issue you might bring -up. (You could argue, "Things would be better with the -right wrappers," but if it is true for one scheme, is it -not also true for the other? Also, remember the goal is -to make the language smaller, not add yet more machinery -that someone has to learn.)

- -

Either path would yield different advantages and -disadvantages, and there is not a clearly superior -solution. The simplicity doctrine mandates we settle on -one of them though, and the majority decision was on -printf + -read/write.

-
- -
- -

Preincrement and Predecrement

- -
-

Use prefix form (++i) of the increment and -decrement operators with iterators and other template -objects.

-
- -
- -
-

When a variable -is incremented (++i or i++) or -decremented (--i or i--) and -the value of the expression is not used, one must decide -whether to preincrement (decrement) or postincrement -(decrement).

-
- -
-

When the return value is ignored, the "pre" form -(++i) is never less efficient than the -"post" form (i++), and is often more -efficient. This is because post-increment (or decrement) -requires a copy of i to be made, which is -the value of the expression. If i is an -iterator or other non-scalar type, copying i -could be expensive. Since the two types of increment -behave the same when the value is ignored, why not just -always pre-increment?

-
- -
-

The tradition developed, in C, of using post-increment -when the expression value is not used, especially in -for loops. Some find post-increment easier -to read, since the "subject" (i) precedes -the "verb" (++), just like in English.

-
- -
-

For simple scalar -(non-object) values there is no reason to prefer one form -and we allow either. For iterators and other template -types, use pre-increment.

-
- -
- -

Use of const

- -
-

Use const whenever it makes sense. With C++11, -constexpr is a better choice for some uses of -const.

-
- -
- -
-

Declared variables and parameters can be preceded -by the keyword const to indicate the variables -are not changed (e.g., const int foo). Class -functions can have the const qualifier to -indicate the function does not change the state of the -class member variables (e.g., class Foo { int -Bar(char c) const; };).

-
- -
-

Easier for people to understand how variables are being -used. Allows the compiler to do better type checking, -and, conceivably, generate better code. Helps people -convince themselves of program correctness because they -know the functions they call are limited in how they can -modify your variables. Helps people know what functions -are safe to use without locks in multi-threaded -programs.

-
- -
-

const is viral: if you pass a -const variable to a function, that function -must have const in its prototype (or the -variable will need a const_cast). This can -be a particular problem when calling library -functions.

-
- -
-

const variables, data members, methods -and arguments add a level of compile-time type checking; -it is better to detect errors as soon as possible. -Therefore we strongly recommend that you use -const whenever it makes sense to do so:

- -
    -
  • If a function does not modify an argument passed by - reference or by pointer, that argument should be - const.
  • - -
  • Declare methods to be const whenever - possible. Accessors should almost always be - const. Other methods should be const if - they do not modify any data members, do not call any - non-const methods, and do not return a - non-const pointer or - non-const reference to a data member.
  • - -
  • Consider making data members const - whenever they do not need to be modified after - construction.
  • -
- -

The mutable keyword is allowed but is -unsafe when used with threads, so thread safety should be -carefully considered first.

-
- -
-

Where to put the const

- -

Some people favor the form int const *foo -to const int* foo. They argue that this is -more readable because it's more consistent: it keeps the -rule that const always follows the object -it's describing. However, this consistency argument -doesn't apply in codebases with few deeply-nested pointer -expressions since most const expressions -have only one const, and it applies to the -underlying value. In such cases, there's no consistency -to maintain. Putting the const first is -arguably more readable, since it follows English in -putting the "adjective" (const) before the -"noun" (int).

- -

That said, while we encourage putting -const first, we do not require it. But be -consistent with the code around you!

-
- -
- -

Use of constexpr

- -
-

In C++11, use constexpr to define true -constants or to ensure constant initialization.

-
- -
- -
-

Some variables can be declared constexpr -to indicate the variables are true constants, i.e. fixed at -compilation/link time. Some functions and constructors -can be declared constexpr which enables them -to be used in defining a constexpr -variable.

-
- -
-

Use of constexpr enables definition of -constants with floating-point expressions rather than -just literals; definition of constants of user-defined -types; and definition of constants with function -calls.

-
- -
-

Prematurely marking something as constexpr may cause -migration problems if later on it has to be downgraded. -Current restrictions on what is allowed in constexpr -functions and constructors may invite obscure workarounds -in these definitions.

-
- -
-

constexpr definitions enable a more -robust specification of the constant parts of an -interface. Use constexpr to specify true -constants and the functions that support their -definitions. Avoid complexifying function definitions to -enable their use with constexpr. Do not use -constexpr to force inlining.

-
- -
- -

Integer Types

- -
-

Of the built-in C++ integer types, the only one used - is -int. If a program needs a variable of a -different size, use -a precise-width integer type from -<stdint.h>, such as -int16_t. If your variable represents a -value that could ever be greater than or equal to 2^31 -(2GiB), use a 64-bit type such as -int64_t. -Keep in mind that even if your value won't ever be too large -for an int, it may be used in intermediate -calculations which may require a larger type. When in doubt, -choose a larger type.

-
- -
- -
-

C++ does not specify the sizes of its integer types. -Typically people assume that short is 16 bits, -int is 32 bits, long is 32 bits -and long long is 64 bits.

-
- -
-

Uniformity of declaration.

-
- -
-

The sizes of integral types in C++ can vary based on -compiler and architecture.

-
- -
- -

-<stdint.h> defines types -like int16_t, uint32_t, -int64_t, etc. You should always use -those in preference to short, unsigned -long long and the like, when you need a guarantee -on the size of an integer. Of the C integer types, only -int should be used. When appropriate, you -are welcome to use standard types like -size_t and ptrdiff_t.

- -

We use int very often, for integers we -know are not going to be too big, e.g., loop counters. -Use plain old int for such things. You -should assume that an int is - -at least 32 bits, but don't -assume that it has more than 32 bits. If you need a 64-bit -integer type, use -int64_t -or -uint64_t.

- -

For integers we know can be "big", - use -int64_t. -

- -

You should not use the unsigned integer types such as -uint32_t, unless there is a valid -reason such as representing a bit pattern rather than a -number, or you need defined overflow modulo 2^N. In -particular, do not use unsigned types to say a number -will never be negative. Instead, use -assertions for this.

- - - -

If your code is a container that returns a size, be -sure to use a type that will accommodate any possible -usage of your container. When in doubt, use a larger type -rather than a smaller type.

- -

Use care when converting integer types. Integer -conversions and promotions can cause non-intuitive -behavior.

-
- -
- -

On Unsigned Integers

- -

Some people, including some textbook authors, -recommend using unsigned types to represent numbers that -are never negative. This is intended as a form of -self-documentation. However, in C, the advantages of such -documentation are outweighed by the real bugs it can -introduce. Consider:

- -
for (unsigned int i = foo.Length()-1; i >= 0; --i) ...
-
- -

This code will never terminate! Sometimes gcc will -notice this bug and warn you, but often it will not. -Equally bad bugs can occur when comparing signed and -unsigned variables. Basically, C's type-promotion scheme -causes unsigned types to behave differently than one -might expect.

- -

So, document that a variable is non-negative using -assertions. Don't use an unsigned -type.

-
- -
- -

64-bit Portability

- -
-

Code should be 64-bit and 32-bit friendly. Bear in mind -problems of printing, comparisons, and structure alignment.

-
- -
- -
    -
  • -

    printf() specifiers for some types - are not cleanly portable between 32-bit and 64-bit - systems. C99 defines some portable format specifiers. - Unfortunately, MSVC 7.1 does not understand some of - these specifiers and the standard is missing a few, - so we have to define our own ugly versions in some - cases (in the style of the standard include file - inttypes.h):

    - -
    -
    // printf macros for size_t, in the style of inttypes.h
    -#ifdef _LP64
    -#define __PRIS_PREFIX "z"
    -#else
    -#define __PRIS_PREFIX
    -#endif
    -
    -// Use these macros after a % in a printf format string
    -// to get correct 32/64 bit behavior, like this:
    -// size_t size = records.size();
    -// printf("%"PRIuS"\n", size);
    -
    -#define PRIdS __PRIS_PREFIX "d"
    -#define PRIxS __PRIS_PREFIX "x"
    -#define PRIuS __PRIS_PREFIX "u"
    -#define PRIXS __PRIS_PREFIX "X"
    -#define PRIoS __PRIS_PREFIX "o"
    -  
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeDO NOT useDO useNotes
    void * (or any pointer)%lx%p
    int64_t%qd, %lld%"PRId64"
    uint64_t%qu, %llu, - %llx%"PRIu64", - %"PRIx64"
    size_t%u%"PRIuS", %"PRIxS" - C99 specifies %zu
    ptrdiff_t%d%"PRIdS" - C99 specifies %td
    - -

    Note that the PRI* macros expand to - independent strings which are concatenated by the - compiler. Hence if you are using a non-constant - format string, you need to insert the value of the - macro into the format, rather than the name. It is - still possible, as usual, to include length - specifiers, etc., after the % when using - the PRI* macros. So, e.g. - printf("x = %30"PRIuS"\n", x) would - expand on 32-bit Linux to printf("x = %30" "u" - "\n", x), which the compiler will treat as - printf("x = %30u\n", x).

    - - -
  • - -
  • Remember that sizeof(void *) != - sizeof(int). Use intptr_t if - you want a pointer-sized integer.
  • - -
  • You may need to be careful with structure - alignments, particularly for structures being stored on - disk. Any class/structure with a - int64_t/uint64_t - member will by default end up being 8-byte aligned on a - 64-bit system. If you have such structures being shared - on disk between 32-bit and 64-bit code, you will need - to ensure that they are packed the same on both - architectures. - Most compilers offer a way to - alter structure alignment. For gcc, you can use - __attribute__((packed)). MSVC offers - #pragma pack() and - __declspec(align()).
  • - -
  • -

    Use the LL or ULL - suffixes as needed to create 64-bit constants. For - example:

    - - -
    int64_t my_value = 0x123456789LL;
    -uint64_t my_mask = 3ULL << 48;
    -
    -
  • - -
  • If you really need different code on 32-bit and - 64-bit systems, use #ifdef _LP64 to choose - between the code variants. (But please avoid this if - possible, and keep any such changes localized.)
  • -
- -
- -

Preprocessor Macros

- -
-

Be very cautious with macros. Prefer inline functions, -enums, and const variables to macros.

-
- -
- -

Macros mean that the code you see is not the same as -the code the compiler sees. This can introduce unexpected -behavior, especially since macros have global scope.

- -

Luckily, macros are not nearly as necessary in C++ as -they are in C. Instead of using a macro to inline -performance-critical code, use an inline function. -Instead of using a macro to store a constant, use a -const variable. Instead of using a macro to -"abbreviate" a long variable name, use a reference. -Instead of using a macro to conditionally compile code -... well, don't do that at all (except, of course, for -the #define guards to prevent double -inclusion of header files). It makes testing much more -difficult.

- -

Macros can do things these other techniques cannot, -and you do see them in the codebase, especially in the -lower-level libraries. And some of their special features -(like stringifying, concatenation, and so forth) are not -available through the language proper. But before using a -macro, consider carefully whether there's a non-macro way -to achieve the same result.

- -

The following usage pattern will avoid many problems -with macros; if you use macros, follow it whenever -possible:

- -
    -
  • Don't define macros in a .h file.
  • - -
  • #define macros right before you use - them, and #undef them right after.
  • - -
  • Do not just #undef an existing macro - before replacing it with your own; instead, pick a name - that's likely to be unique.
  • - -
  • Try not to use macros that expand to unbalanced C++ - constructs, or at least document that behavior - well.
  • - -
  • Prefer not using ## to generate - function/class/variable names.
  • -
- -
- -

0 and nullptr/NULL

- -
-

Use 0 for integers, 0.0 for -reals, nullptr (or NULL) for -pointers, and '\0' for chars.

-
- -
- -

Use 0 for integers and 0.0 -for reals. This is not controversial.

- -

For -pointers (address values), there is a choice between -0, NULL, and -nullptr. For projects that allow C++11 -features, use nullptr. For C++03 projects, -we prefer NULL because it looks like a -pointer. In fact, some C++ compilers provide special -definitions of NULL which enable them to -give useful warnings, particularly in situations where -sizeof(NULL) is not equal to -sizeof(0).

- -

Use '\0' for chars. This is the correct -type and also makes code more readable.

- -
- -

sizeof

- -
-

Prefer sizeof(varname) to -sizeof(type).

-
- -
- -

Use sizeof(varname) when you -take the size of a particular variable. -sizeof(varname) will update -appropriately if someone changes the variable type either -now or later. You may use -sizeof(type) for code unrelated -to any particular variable, such as code that manages an -external or internal data format where a variable of an -appropriate C++ type is not convenient.

- -
Struct data;
-memset(&data, 0, sizeof(data));
-
- -
memset(&data, 0, sizeof(Struct));
-
- -
if (raw_size < sizeof(int)) {
-  LOG(ERROR) << "compressed record not big enough for count: " << raw_size;
-  return false;
-}
-
- -
- -

auto

- -
-

Use auto to avoid type names that are just -clutter. Continue to use manifest type declarations when it -helps readability, and never use auto for -anything but local variables.

-
- -
- -
-

In C++11, a variable whose type is given as auto -will be given a type that matches that of the expression used to -initialize it. You can use auto either to -initialize a variable by copying, or to bind a -reference.

- -
vector<string> v;
-...
-auto s1 = v[0];  // Makes a copy of v[0].
-const auto& s2 = v[0];  // s2 is a reference to v[0].
-
-
- -
-

C++ type names can sometimes be long and cumbersome, -especially when they involve templates or namespaces. In -a statement like:

- -
sparse_hash_map<string, int>::iterator iter = m.find(val);
-
-
- -

the return type is hard to read, and obscures the -primary purpose of the statement. Changing it to:

- -
auto iter = m.find(val);
-
- -

makes it more readable.

- -

Without auto we are sometimes forced to -write a type name twice in the same expression, adding no -value for the reader, as in:

- -
diagnostics::ErrorStatus* status = new diagnostics::ErrorStatus("xyz");
-
- -

Using auto makes it easier to use -intermediate variables when appropriate, by reducing the -burden of writing their types explicitly.

- -
- -

Sometimes code is clearer when types are manifest, -especially when a variable's initialization depends on -things that were declared far away. In an expression -like:

- - -
auto i = x.Lookup(key);
-
- -

it may not be obvious what i's type is, -if x was declared hundreds of lines earlier.

- -

Programmers have to understand the difference between -auto and const auto& or -they'll get copies when they didn't mean to.

- -

The interaction between auto and C++11 -brace-initialization can be confusing. The -declarations:

- -
auto x(3);  // Note: parentheses.
-auto y{3};  // Note: curly braces.
-
- -

mean different things — -x is an int, while -y is a std::initializer_list<int>. -The same applies to other normally-invisible proxy types. -

- -

If an auto variable is used as part of an -interface, e.g. as a constant in a header, then a -programmer might change its type while only intending to -change its value, leading to a more radical API change -than intended.

-
- -
- -

auto is permitted, for local variables -only. Do not use auto for file-scope or -namespace-scope variables, or for class members. Never -initialize an auto-typed variable with -a braced initializer list. - -

The auto keyword is also used in an -unrelated C++11 feature: it's part of the syntax for a -new kind of function declaration with a trailing return -type. Trailing return types are permitted only in lambda -expressions.

-
- -
- -

Braced Initializer List

- -
-

You may use braced initializer lists.

-
- -
- -

In C++03, aggregate types (arrays and structs with no -constructor) could be initialized with braced initializer lists. -

- -
struct Point { int x; int y; };
-Point p = {1, 2};
-
- -

In C++11, this syntax was generalized, and any object type can now -be created with a braced initializer list, known as a -braced-init-list in the C++ grammar. Here are a few examples -of its use.

- -
// Vector takes a braced-init-list of elements.
-vector<string> v{"foo", "bar"};
-
-// Basically the same, ignoring some small technicalities.
-// You may choose to use either form.
-vector<string> v = {"foo", "bar"};
-
-// Usable with 'new' expressions.
-auto p = new vector<string>{"foo", "bar"};
-
-// A map can take a list of pairs. Nested braced-init-lists work.
-map<int, string> m = {{1, "one"}, {2, "2"}};
-
-// A braced-init-list can be implicitly converted to a return type.
-vector<int> test_function() { return {1, 2, 3}; }
-
-// Iterate over a braced-init-list.
-for (int i : {-1, -2, -3}) {}
-
-// Call a function using a braced-init-list.
-void TestFunction2(vector<int> v) {}
-TestFunction2({1, 2, 3});
-
- -

A user-defined type can also define a constructor and/or assignment operator -that take std::initializer_list<T>, which is automatically -created from braced-init-list:

- -
class MyType {
- public:
-  // std::initializer_list references the underlying init list.
-  // It should be passed by value.
-  MyType(std::initializer_list<int> init_list) {
-    for (int i : init_list) append(i);
-  }
-  MyType& operator=(std::initializer_list<int> init_list) {
-    clear();
-    for (int i : init_list) append(i);
-  }
-};
-MyType m{2, 3, 5, 7};
-
- -

Finally, brace initialization can also call ordinary -constructors of data types, even if they do not have -std::initializer_list<T> constructors.

- -
double d{1.23};
-// Calls ordinary constructor as long as MyOtherType has no
-// std::initializer_list constructor.
-class MyOtherType {
- public:
-  explicit MyOtherType(string);
-  MyOtherType(int, string);
-};
-MyOtherType m = {1, "b"};
-// If the constructor is explicit, you can't use the "= {}" form.
-MyOtherType m{"b"};
-
- -

Never assign a braced-init-list to an auto -local variable. In the single element case, what this -means can be confusing.

- -
auto d = {1.23};        // d is a std::initializer_list<double>
-
- -
auto d = double{1.23};  // Good -- d is a double, not a std::initializer_list.
-
- -

See Braced_Initializer_List_Format for formatting.

- -
- -

Lambda expressions

- -
-

Use lambda expressions where appropriate. Do not use -default lambda captures; write all captures explicitly.

-
- -
- -
- -

Lambda expressions are a concise way of creating anonymous -function objects. They're often useful when passing -functions as arguments. For example:

- -
std::sort(v.begin(), v.end(), [](int x, int y) {
-  return Weight(x) < Weight(y);
-});
-
- -

Lambdas were introduced in C++11 along with a set of utilities -for working with function objects, such as the polymorphic -wrapper std::function. -

-
- -
-
    -
  • Lambdas are much more concise than other ways of - defining function objects to be passed to STL - algorithms, which can be a readability - improvement.
  • - -
  • Lambdas, std::function, and - std::bind can be used in combination as a - general purpose callback mechanism; they make it easy - to write functions that take bound functions as - arguments.
  • -
-
- -
-
    -
  • Variable capture in lambdas can be tricky, and - might be a new source of dangling-pointer bugs.
  • - -
  • It's possible for use of lambdas to get out of - hand; very long nested anonymous functions can make - code harder to understand.
  • - - -
-
- -
-
    -
  • Use lambda expressions where appropriate, with formatting as -described below.
  • -
  • Do not use default captures; write all lambda captures explicitly. -For example, instead of [=](int x) { return x + n; } -you should write [n](int x) { return x + n; } so that -readers can see immediately that n is being captured -(by value).
  • -
  • Keep unnamed lambdas short. If a lambda body is more than -maybe five lines long, prefer to give the lambda a name, or to -use a named function instead of a lambda.
  • -
  • Specify the return type of the lambda explicitly if that will -make it more obvious to readers, as with -auto.
  • -
-
- -
- -

Template metaprogramming

-
-

Avoid complicated template programming.

-
- -
- -
-

Template metaprogramming refers to a family of techniques that -exploit the fact that the C++ template instantiation mechanism is -Turing complete and can be used to perform arbitrary compile-time -computation in the type domain.

-
- -
-

Template metaprogramming allows extremely flexible interfaces that -are type safe and high performance. Facilities like - -Google Test, -std::tuple, std::function, and -Boost.Spirit would be impossible without it.

-
- -
-

The techniques used in template metaprogramming are often obscure -to anyone but language experts. Code that uses templates in -complicated ways is often unreadable, and is hard to debug or -maintain.

- -

Template metaprogramming often leads to extremely poor compiler -time error messages: even if an interface is simple, the complicated -implementation details become visible when the user does something -wrong.

- -

Template metaprogramming interferes with large scale refactoring by -making the job of refactoring tools harder. First, the template code -is expanded in multiple contexts, and it's hard to verify that the -transformation makes sense in all of them. Second, some refactoring -tools work with an AST that only represents the structure of the code -after template expansion. It can be difficult to automatically work -back to the original source construct that needs to be -rewritten.

-
- -
-

Template metaprogramming sometimes allows cleaner and easier-to-use -interfaces than would be possible without it, but it's also often a -temptation to be overly clever. It's best used in a small number of -low level components where the extra maintenance burden is spread out -over a large number of uses.

- -

Think twice before using template metaprogramming or other -complicated template techniques; think about whether the average -member of your team will be able to understand your code well enough -to maintain it after you switch to another project, or whether a -non-C++ programmer or someone casually browsing the code base will be -able to understand the error messages or trace the flow of a function -they want to call. If you're using recursive template instantiations -or type lists or metafunctions or expression templates, or relying on -SFINAE or on the sizeof trick for detecting function -overload resolution, then there's a good chance you've gone too -far.

- -

If you use template metaprogramming, you should expect to put -considerable effort into minimizing and isolating the complexity. You -should hide metaprogramming as an implementation detail whenever -possible, so that user-facing headers are readable, and you should -make sure that tricky code is especially well commented. You should -carefully document how the code is used, and you should say something -about what the "generated" code looks like. Pay extra attention to the -error messages that the compiler emits when users make mistakes. The -error messages are part of your user interface, and your code should -be tweaked as necessary so that the error messages are understandable -and actionable from a user point of view.

- -
-
- - -

Boost

- -
-

Use only approved libraries from the Boost library -collection.

-
- -
- -
-

The - -Boost library collection is a popular collection of -peer-reviewed, free, open-source C++ libraries.

-
- -
-

Boost code is generally very high-quality, is widely -portable, and fills many important gaps in the C++ -standard library, such as type traits and better binders.

-
- -
-

Some Boost libraries encourage coding practices which can -hamper readability, such as metaprogramming and other -advanced template techniques, and an excessively -"functional" style of programming.

-
- -
- - - -
-

In order to maintain a high level of readability for -all contributors who might read and maintain code, we -only allow an approved subset of Boost features. -Currently, the following libraries are permitted:

- -
    -
  • - - Call Traits from boost/call_traits.hpp
  • - -
  • - Compressed Pair from boost/compressed_pair.hpp
  • - -
  • - The Boost Graph Library (BGL) from boost/graph, - except serialization (adj_list_serialize.hpp) and - parallel/distributed algorithms and data structures - (boost/graph/parallel/* and - boost/graph/distributed/*).
  • - -
  • - Property Map from boost/property_map, except - parallel/distributed property maps (boost/property_map/parallel/*).
  • - -
  • The part of - Iterator that deals with defining iterators: - boost/iterator/iterator_adaptor.hpp, - boost/iterator/iterator_facade.hpp, and - boost/function_output_iterator.hpp
  • - -
  • The part of - Polygon that deals with Voronoi diagram - construction and doesn't depend on the rest of - Polygon: - boost/polygon/voronoi_builder.hpp, - boost/polygon/voronoi_diagram.hpp, and - boost/polygon/voronoi_geometry_type.hpp
  • - -
  • - Bimap from boost/bimap
  • - -
  • - Statistical Distributions and Functions from - boost/math/distributions
  • - -
  • - Multi-index from boost/multi_index
  • - -
  • - Heap from boost/heap
  • - -
  • The flat containers from - Container: - boost/container/flat_map, and - boost/container/flat_set
  • -
- -

We are actively considering adding other Boost -features to the list, so this list may be expanded in -the future.

-
- -

The following libraries are permitted, but their use -is discouraged because they've been superseded by -standard libraries in C++11:

- - -
- -
- - - -

C++11

- -
-

Use libraries and language extensions from C++11 (formerly -known as C++0x) when appropriate. -Consider portability to other environments -before using C++11 features in your -project.

-
- -
- -
-

C++11 contains -significant changes both to the language and -libraries.

-
- -
-

C++11 was the official standard until august 2014, and -is supported by most C++ compilers. It standardizes -some common C++ extensions that we use already, allows -shorthands for some operations, and has some performance -and safety improvements.

-
- -
-

The C++11 standard is substantially more complex than -its predecessor (1,300 pages versus 800 pages), and is -unfamiliar to many developers. The long-term effects of -some features on code readability and maintenance are -unknown. We cannot predict when its various features will -be implemented uniformly by tools that may be of -interest, particularly in the case of projects that are -forced to use older versions of tools.

- -

As with Boost, some C++11 -extensions encourage coding practices that hamper -readability—for example by removing -checked redundancy (such as type names) that may be -helpful to readers, or by encouraging template -metaprogramming. Other extensions duplicate functionality -available through existing mechanisms, which may lead to confusion -and conversion costs.

- - -
- -
- -

C++11 features may be used unless specified otherwise. -In addition to what's described in the rest of the style -guide, the following C++11 features may not be used:

- -
    -
  • Functions (other than lambda functions) - with trailing return types, e.g. writing - auto foo() -> int; instead of int - foo();, because of a desire to preserve - stylistic consistency with the many existing function - declarations.
  • - - - - - - - - - - - -
  • Compile-time rational numbers - (<ratio>), because of concerns that - it's tied to a more template-heavy interface - style.
  • - -
  • The <cfenv> and - <fenv.h> headers, because many - compilers do not support those features reliably.
  • - - - -
  • Default lambda captures.
  • -
-
- -
- -

Naming

- -

The most important consistency rules are those that govern -naming. The style of a name immediately informs us what sort of -thing the named entity is: a type, a variable, a function, a -constant, a macro, etc., without requiring us to search for the -declaration of that entity. The pattern-matching engine in our -brains relies a great deal on these naming rules. -

- -

Naming rules are pretty arbitrary, but - we feel that -consistency is more important than individual preferences in this -area, so regardless of whether you find them sensible or not, -the rules are the rules.

- -

General Naming Rules

- -
-

Function names, variable names, and filenames should be -descriptive; eschew abbreviation.

-
- -
-

Give as descriptive a name as possible, within reason. -Do not worry about saving horizontal space as it is far -more important to make your code immediately -understandable by a new reader. Do not use abbreviations -that are ambiguous or unfamiliar to readers outside your -project, and do not abbreviate by deleting letters within -a word.

- -
int price_count_reader;    // No abbreviation.
-int num_errors;            // "num" is a widespread convention.
-int num_dns_connections;   // Most people know what "DNS" stands for.
-
- -
int n;                     // Meaningless.
-int nerr;                  // Ambiguous abbreviation.
-int n_comp_conns;          // Ambiguous abbreviation.
-int wgc_connections;       // Only your group knows what this stands for.
-int pc_reader;             // Lots of things can be abbreviated "pc".
-int cstmr_id;              // Deletes internal letters.
-
- -
- -

File Names

- -
-

Filenames should be all lowercase and can include -underscores (_) or dashes (-). -Follow the convention that your - -project uses. If there is no consistent -local pattern to follow, prefer "_".

-
- -
- -

Examples of acceptable file names:

- -
    -
  • my_useful_class.cc
  • -
  • my-useful-class.cc
  • -
  • myusefulclass.cc
  • -
  • myusefulclass_test.cc // _unittest and _regtest are deprecated.
  • -
- -

C++ files should end in .cc and header files should end in -.h. Files that rely on being textually included at specific points -should end in .inc (see also the section on -self-contained headers).

- -

Do not use filenames that already exist in -/usr/include, such as db.h.

- -

In general, make your filenames very specific. For -example, use http_server_logs.h rather than -logs.h. A very common case is to have a pair -of files called, e.g., foo_bar.h and -foo_bar.cc, defining a class called -FooBar.

- -

Inline functions must be in a .h file. If -your inline functions are very short, they should go -directly into your .h file.

- -
- -

Type Names

- -
-

Type names start with a capital letter and have a capital -letter for each new word, with no underscores: -MyExcitingClass, MyExcitingEnum.

-
- -
- -

The names of all types — classes, structs, typedefs, -and enums — have the same naming convention. Type names -should start with a capital letter and have a capital letter -for each new word. No underscores. For example:

- -
// classes and structs
-class UrlTable { ...
-class UrlTableTester { ...
-struct UrlTableProperties { ...
-
-// typedefs
-typedef hash_map<UrlTableProperties *, string> PropertiesMap;
-
-// enums
-enum UrlTableErrors { ...
-
- -
- -

Variable Names

- -
-

The names of variables and data members are all lowercase, with -underscores between words. Data members of classes (but not structs) -additionally have trailing underscores. For instance: -a_local_variable, a_struct_data_member, -a_class_data_member_.

-
- -
- -

Common Variable names

- -

For example:

- -
string table_name;  // OK - uses underscore.
-string tablename;   // OK - all lowercase.
-
- -
string tableName;   // Bad - mixed case.
-
- -

Class Data Members

- -

Data members of classes, both static and non-static, are -named like ordinary nonmember variables, but with a -trailing underscore.

- -
class TableInfo {
-  ...
- private:
-  string table_name_;  // OK - underscore at end.
-  string tablename_;   // OK.
-  static Pool<TableInfo>* pool_;  // OK.
-};
-
- -

Struct Data Members

- -

Data members of structs, both static and non-static, -are named like ordinary nonmember variables. They do not have -the trailing underscores that data members in classes have.

- -
struct UrlTableProperties {
-  string name;
-  int num_entries;
-  static Pool<UrlTableProperties>* pool;
-};
-
- - -

See Structs vs. -Classes for a discussion of when to use a struct -versus a class.

- -

Global Variables

- -

There are no special requirements for global -variables, which should be rare in any case, but if you -use one, consider prefixing it with g_ or -some other marker to easily distinguish it from local -variables.

- -
- -

Constant Names

- -
-

Use a k followed by mixed case, e.g., -kDaysInAWeek, for constants defined globally or within a class.

-
- -
- -

As a convenience to the reader, compile-time constants of global or class scope -follow a different naming convention from other variables. -Use a k followed by words with uppercase first letters:

- -
const int kDaysInAWeek = 7;
-
- -

This convention may optionally be used for compile-time constants of local scope; -otherwise the usual variable naming rules apply. - -

- -

Function Names

- -
-

Regular functions have mixed case; accessors and mutators -match the name of the variable: -MyExcitingFunction(), -MyExcitingMethod(), -my_exciting_member_variable(), -set_my_exciting_member_variable().

-
- -
- -

Regular Functions

- -

Functions should start with a capital letter and have -a capital letter for each new word. No underscores.

- -

If your function crashes upon an error, you should -append OrDie to the function name. This only applies to -functions which could be used by production code and to -errors that are reasonably likely to occur during normal -operation.

- -
AddTableEntry()
-DeleteUrl()
-OpenFileOrDie()
-
- -

Accessors and Mutators

- -

Accessors and mutators (get and set functions) should -match the name of the variable they are getting and -setting. This shows an excerpt of a class whose instance -variable is num_entries_.

- -
class MyClass {
- public:
-  ...
-  int num_entries() const { return num_entries_; }
-  void set_num_entries(int num_entries) { num_entries_ = num_entries; }
-
- private:
-  int num_entries_;
-};
-
- -

You may also use lowercase letters for other very -short inlined functions. For example if a function were -so cheap you would not cache the value if you were -calling it in a loop, then lowercase naming would be -acceptable.

- -
- -

Namespace Names

- -
- - -

Namespace names are all lower-case, -and based on project names and possibly their directory -structure: google_awesome_project.

-
- -
- -

See Namespaces for a -discussion of namespaces and how to name them.

- -
- -

Enumerator Names

- -
-

Enumerators should be named either like -constants or like -macros: either kEnumName or -ENUM_NAME.

-
- -
- -

Preferably, the individual enumerators should be named -like constants. However, it -is also acceptable to name them like -macros. The enumeration name, -UrlTableErrors (and -AlternateUrlTableErrors), is a type, and -therefore mixed case.

- -
enum UrlTableErrors {
-  kOK = 0,
-  kErrorOutOfMemory,
-  kErrorMalformedInput,
-};
-enum AlternateUrlTableErrors {
-  OK = 0,
-  OUT_OF_MEMORY = 1,
-  MALFORMED_INPUT = 2,
-};
-
- -

Until January 2009, the style was to name enum values -like macros. This caused -problems with name collisions between enum values and -macros. Hence, the change to prefer constant-style naming -was put in place. New code should prefer constant-style -naming if possible. However, there is no reason to change -old code to use constant-style names, unless the old -names are actually causing a compile-time problem.

- - - -
- -

Macro Names

- -
-

You're not really going to -define a macro, are you? If you do, they're like this: -MY_MACRO_THAT_SCARES_SMALL_CHILDREN.

-
- -
- -

Please see the description -of macros; in general macros should not be used. -However, if they are absolutely needed, then they should be -named with all capitals and underscores.

- -
#define ROUND(x) ...
-#define PI_ROUNDED 3.0
-
- -
- -

Exceptions to Naming Rules

- -
-

If you are naming something that is analogous to an -existing C or C++ entity then you can follow the existing -naming convention scheme.

-
- -
- -
-
bigopen()
-
function name, follows form of open()
- -
uint
-
typedef
- -
bigpos
-
struct or class, follows - form of pos
- -
sparse_hash_map
-
STL-like entity; follows STL naming conventions
- -
LONGLONG_MAX
-
a constant, as in INT_MAX
-
- -
- -

Comments

- -

Though a pain to write, comments are absolutely vital to -keeping our code readable. The following rules describe what -you should comment and where. But remember: while comments are -very important, the best code is self-documenting. Giving -sensible names to types and variables is much better than using -obscure names that you must then explain through comments.

- -

When writing your comments, write for your audience: the -next -contributor who will need to -understand your code. Be generous — the next -one may be you!

- -

Comment Style

- -
-

Use either the // or /* */ -syntax, as long as you are consistent.

-
- -
- -

You can use either the // or the /* -*/ syntax; however, // is -much more common. Be consistent with how you -comment and what style you use where.

- -
- -

File Comments

- -
-

Start each file with license -boilerplate, followed by a description of its -contents.

-
- -
- -

Legal Notice and Author -Line

- - - -

Every file should contain license -boilerplate. Choose the appropriate boilerplate for the -license used by the project (for example, Apache 2.0, -BSD, LGPL, GPL).

- -

If you make significant changes to a file with an -author line, consider deleting the author line.

- -

File Contents

- -

Every file should have a comment at the top describing -its contents.

- -

Generally a .h file will describe the -classes that are declared in the file with an overview of -what they are for and how they are used. A -.cc file should contain more information -about implementation details or discussions of tricky -algorithms. If you feel the implementation details or a -discussion of the algorithms would be useful for someone -reading the .h, feel free to put it there -instead, but mention in the .cc that the -documentation is in the .h file.

- -

Do not duplicate comments in both the .h -and the .cc. Duplicated comments -diverge.

- -
- -

Class Comments

- -
-

Every class definition should have an accompanying comment -that describes what it is for and how it should be used.

-
- -
- -
// Iterates over the contents of a GargantuanTable.  Sample usage:
-//    GargantuanTableIterator* iter = table->NewIterator();
-//    for (iter->Seek("foo"); !iter->done(); iter->Next()) {
-//      process(iter->key(), iter->value());
-//    }
-//    delete iter;
-class GargantuanTableIterator {
-  ...
-};
-
- -

If you have already described a class in detail in the -comments at the top of your file feel free to simply -state "See comment at top of file for a complete -description", but be sure to have some sort of -comment.

- -

Document the synchronization assumptions the class -makes, if any. If an instance of the class can be -accessed by multiple threads, take extra care to document -the rules and invariants surrounding multithreaded -use.

- -
- -

Function Comments

- -
-

Declaration comments describe use of the function; comments -at the definition of a function describe operation.

-
- -
- -

Function Declarations

- -

Every function declaration should have comments -immediately preceding it that describe what the function -does and how to use it. These comments should be -descriptive ("Opens the file") rather than imperative -("Open the file"); the comment describes the function, it -does not tell the function what to do. In general, these -comments do not describe how the function performs its -task. Instead, that should be left to comments in the -function definition.

- -

Types of things to mention in comments at the function -declaration:

- -
    -
  • What the inputs and outputs are.
  • - -
  • For class member functions: whether the object - remembers reference arguments beyond the duration of - the method call, and whether it will free them or - not.
  • - -
  • If the function allocates memory that the caller - must free.
  • - -
  • Whether any of the arguments can be a null - pointer.
  • - -
  • If there are any performance implications of how a - function is used.
  • - -
  • If the function is re-entrant. What are its - synchronization assumptions?
  • -
- -

Here is an example:

- -
// Returns an iterator for this table.  It is the client's
-// responsibility to delete the iterator when it is done with it,
-// and it must not use the iterator once the GargantuanTable object
-// on which the iterator was created has been deleted.
-//
-// The iterator is initially positioned at the beginning of the table.
-//
-// This method is equivalent to:
-//    Iterator* iter = table->NewIterator();
-//    iter->Seek("");
-//    return iter;
-// If you are going to immediately seek to another place in the
-// returned iterator, it will be faster to use NewIterator()
-// and avoid the extra seek.
-Iterator* GetIterator() const;
-
- -

However, do not be unnecessarily verbose or state the -completely obvious. Notice below that it is not necessary - to say "returns false otherwise" because this is -implied.

- -
// Returns true if the table cannot hold any more entries.
-bool IsTableFull();
-
- -

When commenting constructors and destructors, remember -that the person reading your code knows what constructors -and destructors are for, so comments that just say -something like "destroys this object" are not useful. -Document what constructors do with their arguments (for -example, if they take ownership of pointers), and what -cleanup the destructor does. If this is trivial, just -skip the comment. It is quite common for destructors not -to have a header comment.

- -

Function Definitions

- -

If there is anything tricky about how a function does -its job, the function definition should have an -explanatory comment. For example, in the definition -comment you might describe any coding tricks you use, -give an overview of the steps you go through, or explain -why you chose to implement the function in the way you -did rather than using a viable alternative. For instance, -you might mention why it must acquire a lock for the -first half of the function but why it is not needed for -the second half.

- -

Note you should not just repeat the comments -given with the function declaration, in the -.h file or wherever. It's okay to -recapitulate briefly what the function does, but the -focus of the comments should be on how it does it.

- -
- -

Variable Comments

- -
-

In general the actual name of the variable should be -descriptive enough to give a good idea of what the variable -is used for. In certain cases, more comments are required.

-
- -
- -

Class Data Members

- -

Each class data member (also called an instance -variable or member variable) should have a comment -describing what it is used for. If the variable can take -sentinel values with special meanings, such as a null -pointer or -1, document this. For example:

- - -
private:
- // Keeps track of the total number of entries in the table.
- // Used to ensure we do not go over the limit. -1 means
- // that we don't yet know how many entries the table has.
- int num_total_entries_;
-
- -

Global Variables

- -

As with data members, all global variables should have -a comment describing what they are and what they are used -for. For example:

- -
// The total number of tests cases that we run through in this regression test.
-const int kNumTestCases = 6;
-
- -
- -

Implementation Comments

- -
-

In your implementation you should have comments in tricky, -non-obvious, interesting, or important parts of your code.

-
- -
- -

Explanatory Comments

- -

Tricky or complicated code blocks should have comments -before them. Example:

- -
// Divide result by two, taking into account that x
-// contains the carry from the add.
-for (int i = 0; i < result->size(); i++) {
-  x = (x << 8) + (*result)[i];
-  (*result)[i] = x >> 1;
-  x &= 1;
-}
-
- -

Line Comments

- -

Also, lines that are non-obvious should get a comment -at the end of the line. These end-of-line comments should -be separated from the code by 2 spaces. Example:

- -
// If we have enough memory, mmap the data portion too.
-mmap_budget = max<int64>(0, mmap_budget - index_->length());
-if (mmap_budget >= data_size_ && !MmapData(mmap_chunk_bytes, mlock))
-  return;  // Error already logged.
-
- -

Note that there are both comments that describe what -the code is doing, and comments that mention that an -error has already been logged when the function -returns.

- -

If you have several comments on subsequent lines, it -can often be more readable to line them up:

- -
DoSomething();                  // Comment here so the comments line up.
-DoSomethingElseThatIsLonger();  // Two spaces between the code and the comment.
-{ // One space before comment when opening a new scope is allowed,
-  // thus the comment lines up with the following comments and code.
-  DoSomethingElse();  // Two spaces before line comments normally.
-}
-vector<string> list{// Comments in braced lists describe the next element ..
-                    "First item",
-                    // .. and should be aligned appropriately.
-                    "Second item"};
-DoSomething(); /* For trailing block comments, one space is fine. */
-
- -

nullptr/NULL, true/false, 1, 2, 3...

- -

When you pass in a null pointer, boolean, or literal -integer values to functions, you should consider adding a -comment about what they are, or make your code -self-documenting by using constants. For example, -compare:

- -
bool success = CalculateSomething(interesting_value,
-                                  10,
-                                  false,
-                                  NULL);  // What are these arguments??
-
- -

versus:

- -
bool success = CalculateSomething(interesting_value,
-                                  10,     // Default base value.
-                                  false,  // Not the first time we're calling this.
-                                  NULL);  // No callback.
-
- -

Or alternatively, constants or self-describing variables:

- -
const int kDefaultBaseValue = 10;
-const bool kFirstTimeCalling = false;
-Callback *null_callback = NULL;
-bool success = CalculateSomething(interesting_value,
-                                  kDefaultBaseValue,
-                                  kFirstTimeCalling,
-                                  null_callback);
-
- -

Don'ts

- -

Note that you should never describe the code -itself. Assume that the person reading the code knows C++ -better than you do, even though he or she does not know -what you are trying to do:

- -
// Now go through the b array and make sure that if i occurs,
-// the next element is i+1.
-...        // Geez.  What a useless comment.
-
- -
- -

Punctuation, Spelling and Grammar

- -
-

Pay attention to punctuation, spelling, and grammar; it is -easier to read well-written comments than badly written -ones.

-
- -
- -

Comments should be as readable as narrative text, with -proper capitalization and punctuation. In many cases, -complete sentences are more readable than sentence -fragments. Shorter comments, such as comments at the end -of a line of code, can sometimes be less formal, but you -should be consistent with your style.

- -

Although it can be frustrating to have a code reviewer -point out that you are using a comma when you should be -using a semicolon, it is very important that source code -maintain a high level of clarity and readability. Proper -punctuation, spelling, and grammar help with that -goal.

- -
- -

TODO Comments

- -
-

Use TODO comments for code that is temporary, -a short-term solution, or good-enough but not perfect.

-
- -
- -

TODOs should include the string -TODO in all caps, followed by the - -name, e-mail address, or other -identifier of the person - with the best context -about the problem referenced by the TODO. The -main purpose is to have a consistent TODO that -can be searched to find out how to get more details upon -request. A TODO is not a commitment that the -person referenced will fix the problem. Thus when you create -a TODO, it is almost always your - -name -that is given.

- - - -
-
// TODO(kl@gmail.com): Use a "*" here for concatenation operator.
-// TODO(Zeke) change this to use relations.
-
-
- -

If your TODO is of the form "At a future -date do something" make sure that you either include a -very specific date ("Fix by November 2005") or a very -specific event ("Remove this code when all clients can -handle XML responses.").

- -
- -

Deprecation Comments

- -
-

Mark deprecated interface points with DEPRECATED -comments.

-
- -
- -

You can mark an interface as deprecated by writing a -comment containing the word DEPRECATED in -all caps. The comment goes either before the declaration -of the interface or on the same line as the -declaration.

- - - -

After the word -DEPRECATED, write your name, e-mail address, -or other identifier in parentheses.

- -

A deprecation comment must include simple, clear -directions for people to fix their callsites. In C++, you -can implement a deprecated function as an inline function -that calls the new interface point.

- -

Marking an interface point DEPRECATED -will not magically cause any callsites to change. If you -want people to actually stop using the deprecated -facility, you will have to fix the callsites yourself or -recruit a crew to help you.

- -

New code should not contain calls to deprecated -interface points. Use the new interface point instead. If -you cannot understand the directions, find the person who -created the deprecation and ask them for help using the -new interface point.

- - - -
- -

Formatting

- -

Coding style and formatting are pretty arbitrary, but a - -project is much easier to follow -if everyone uses the same style. Individuals may not agree with every -aspect of the formatting rules, and some of the rules may take -some getting used to, but it is important that all - -project contributors follow the -style rules so that -they can all read and understand -everyone's code easily.

- - - -

To help you format code correctly, we've -created a - -settings file for emacs.

- -

Line Length

- -
-

Each line of text in your code should be at most 80 -characters long.

-
- -
- - - -

We recognize that this rule is -controversial, but so much existing code already adheres -to it, and we feel that consistency is important.

- -
-

Those who favor this rule -argue that it is rude to force them to resize -their windows and there is no need for anything longer. -Some folks are used to having several code windows -side-by-side, and thus don't have room to widen their -windows in any case. People set up their work environment -assuming a particular maximum window width, and 80 -columns has been the traditional standard. Why change -it?

-
- -
-

Proponents of change argue that a wider line can make -code more readable. The 80-column limit is an hidebound -throwback to 1960s mainframes; modern equipment has wide screens that -can easily show longer lines.

-
- -
-

80 characters is the maximum.

- -

If a comment line contains an example -command or a literal URL longer than 80 characters, that -line may be longer than 80 characters for ease of cut and -paste.

- -

A raw-string literal may have content -that exceeds 80 characters. Except for test code, such literals -should appear near top of a file.

- -

An #include statement with a -long path may exceed 80 columns.

- -

You needn't be concerned about -header guards that exceed -the maximum length.

-
- -
- -

Non-ASCII Characters

- -
-

Non-ASCII characters should be rare, and must use UTF-8 -formatting.

-
- -
- -

You shouldn't hard-code user-facing text in source, -even English, so use of non-ASCII characters should be -rare. However, in certain cases it is appropriate to -include such words in your code. For example, if your -code parses data files from foreign sources, it may be -appropriate to hard-code the non-ASCII string(s) used in -those data files as delimiters. More commonly, unittest -code (which does not need to be localized) might -contain non-ASCII strings. In such cases, you should use -UTF-8, since that is an encoding -understood by most tools able to handle more than just -ASCII.

- -

Hex encoding is also OK, and encouraged where it -enhances readability — for example, -"\xEF\xBB\xBF", or, even more simply, -u8"\uFEFF", is the Unicode zero-width -no-break space character, which would be invisible if -included in the source as straight UTF-8.

- -

Use the u8 prefix -to guarantee that a string literal containing -\uXXXX escape sequences is encoded as UTF-8. -Do not use it for strings containing non-ASCII characters -encoded as UTF-8, because that will produce incorrect -output if the compiler does not interpret the source file -as UTF-8.

- -

You shouldn't use the C++11 char16_t and -char32_t character types, since they're for -non-UTF-8 text. For similar reasons you also shouldn't -use wchar_t (unless you're writing code that -interacts with the Windows API, which uses -wchar_t extensively).

- -
- -

Spaces vs. Tabs

- -
-

Use only spaces, and indent 2 spaces at a time.

-
- -
- -

We use spaces for indentation. Do not use tabs in your -code. You should set your editor to emit spaces when you -hit the tab key.

- -
- -

Function Declarations and Definitions

- -
-

Return type on the same line as function name, parameters -on the same line if they fit. Wrap parameter lists which do -not fit on a single line as you would wrap arguments in a -function call.

-
- -
- -

Functions look like this:

- - -
ReturnType ClassName::FunctionName(Type par_name1, Type par_name2) {
-  DoSomething();
-  ...
-}
-
- -

If you have too much text to fit on one line:

- -
ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
-                                             Type par_name3) {
-  DoSomething();
-  ...
-}
-
- -

or if you cannot fit even the first parameter:

- -
ReturnType LongClassName::ReallyReallyReallyLongFunctionName(
-    Type par_name1,  // 4 space indent
-    Type par_name2,
-    Type par_name3) {
-  DoSomething();  // 2 space indent
-  ...
-}
-
- -

Some points to note:

- -
    -
  • If you cannot fit the return type and the function - name on a single line, break between them.
  • - -
  • If you break after the return type of a function - declaration or definition, do not indent.
  • - -
  • The open parenthesis is always on the same line as - the function name.
  • - -
  • There is never a space between the function name - and the open parenthesis.
  • - -
  • There is never a space between the parentheses and - the parameters.
  • - -
  • The open curly brace is always at the end of the - same line as the last parameter.
  • - -
  • The close curly brace is either on the last line by - itself or (if other style rules permit) on the same - line as the open curly brace.
  • - -
  • There should be a space between the close - parenthesis and the open curly brace.
  • - -
  • All parameters should be named, with identical - names in the declaration and implementation.
  • - -
  • All parameters should be aligned if possible.
  • - -
  • Default indentation is 2 spaces.
  • - -
  • Wrapped parameters have a 4 space indent.
  • -
- -

If some parameters are unused, comment out the -variable name in the function definition:

- -
// Always have named parameters in interfaces.
-class Shape {
- public:
-  virtual void Rotate(double radians) = 0;
-};
-
-// Always have named parameters in the declaration.
-class Circle : public Shape {
- public:
-  virtual void Rotate(double radians);
-};
-
-// Comment out unused named parameters in definitions.
-void Circle::Rotate(double /*radians*/) {}
-
- -
// Bad - if someone wants to implement later, it's not clear what the
-// variable means.
-void Circle::Rotate(double) {}
-
- -
- -

Lambda Expressions

- -
-

Format parameters and bodies as for any other function, and capture -lists like other comma-separated lists.

-
- -
-

For by-reference captures, do not leave a space between the -ampersand (&) and the variable name.

-
int x = 0;
-auto add_to_x = [&x](int n) { x += n; };
-
-

Short lambdas may be written inline as function arguments.

-
std::set<int> blacklist = {7, 8, 9};
-std::vector<int> digits = {3, 9, 1, 8, 4, 7, 1};
-digits.erase(std::remove_if(digits.begin(), digits.end(), [&blacklist](int i) {
-               return blacklist.find(i) != blacklist.end();
-             }),
-             digits.end());
-
- -
- -

Function Calls

- -
-

Either write the call all on a single line, wrap the -arguments at the parenthesis, or start the arguments on a new -line indented by four spaces and continue at that 4 space -indent. In the absence of other considerations, use the -minimum number of lines, including placing multiple arguments -on each line where appropriate.

-
- -
- -

Function calls have the following format:

-
bool retval = DoSomething(argument1, argument2, argument3);
-
- -

If the arguments do not all fit on one line, they -should be broken up onto multiple lines, with each -subsequent line aligned with the first argument. Do not -add spaces after the open paren or before the close -paren:

-
bool retval = DoSomething(averyveryveryverylongargument1,
-                          argument2, argument3);
-
- -

Arguments may optionally all be placed on subsequent -lines with a four space indent:

-
if (...) {
-  ...
-  ...
-  if (...) {
-    DoSomething(
-        argument1, argument2,  // 4 space indent
-        argument3, argument4);
-  }
-
- -

Put multiple arguments on a single line to reduce the -number of lines necessary for calling a function unless -there is a specific readability problem. Some find that -formatting with strictly one argument on each line is -more readable and simplifies editing of the arguments. -However, we prioritize for the reader over the ease of -editing arguments, and most readability problems are -better addressed with the following techniques.

- -

If having multiple arguments in a single line decreases -readability due to the complexity or confusing nature of the -expressions that make up some arguments, try creating -variables that capture those arguments in a descriptive name:

-
int my_heuristic = scores[x] * y + bases[x];
-bool retval = DoSomething(my_heuristic, x, y, z);
-
- -

Or put the confusing argument on its own line with -an explanatory comment:

-
bool retval = DoSomething(scores[x] * y + bases[x],  // Score heuristic.
-                          x, y, z);
-
- -

If there is still a case where one argument is -significantly more readable on its own line, then put it on -its own line. The decision should be specific to the argument -which is made more readable rather than a general policy.

- -

Sometimes arguments form a structure that is important -for readability. In those cases, feel free to format the -arguments according to that structure:

-
// Transform the widget by a 3x3 matrix.
-my_widget.Transform(x1, x2, x3,
-                    y1, y2, y3,
-                    z1, z2, z3);
-
- -
- -

Braced Initializer List Format

- -
-

Format a braced initializer list -exactly like you would format a function call in its place.

-
- -
- -

If the braced list follows a name (e.g. a type or -variable name), format as if the {} were the -parentheses of a function call with that name. If there -is no name, assume a zero-length name.

- -
// Examples of braced init list on a single line.
-return {foo, bar};
-functioncall({foo, bar});
-pair<int, int> p{foo, bar};
-
-// When you have to wrap.
-SomeFunction(
-    {"assume a zero-length name before {"},
-    some_other_function_parameter);
-SomeType variable{
-    some, other, values,
-    {"assume a zero-length name before {"},
-    SomeOtherType{
-        "Very long string requiring the surrounding breaks.",
-        some, other values},
-    SomeOtherType{"Slightly shorter string",
-                  some, other, values}};
-SomeType variable{
-    "This is too long to fit all in one line"};
-MyType m = {  // Here, you could also break before {.
-    superlongvariablename1,
-    superlongvariablename2,
-    {short, interior, list},
-    {interiorwrappinglist,
-     interiorwrappinglist2}};
-
- -
- -

Conditionals

- -
-

Prefer no spaces inside parentheses. The if -and else keywords belong on separate lines.

-
- -
- -

There are two acceptable formats for a basic -conditional statement. One includes spaces between the -parentheses and the condition, and one does not.

- -

The most common form is without spaces. Either is -fine, but be consistent. If you are modifying a -file, use the format that is already present. If you are -writing new code, use the format that the other files in -that directory or project use. If in doubt and you have -no personal preference, do not add the spaces.

- -
if (condition) {  // no spaces inside parentheses
-  ...  // 2 space indent.
-} else if (...) {  // The else goes on the same line as the closing brace.
-  ...
-} else {
-  ...
-}
-
- -

If you prefer you may add spaces inside the -parentheses:

- -
if ( condition ) {  // spaces inside parentheses - rare
-  ...  // 2 space indent.
-} else {  // The else goes on the same line as the closing brace.
-  ...
-}
-
- -

Note that in all cases you must have a space between -the if and the open parenthesis. You must -also have a space between the close parenthesis and the -curly brace, if you're using one.

- -
if(condition) {   // Bad - space missing after IF.
-if (condition){   // Bad - space missing before {.
-if(condition){    // Doubly bad.
-
- -
if (condition) {  // Good - proper space after IF and before {.
-
- -

Short conditional statements may be written on one -line if this enhances readability. You may use this only -when the line is brief and the statement does not use the -else clause.

- -
if (x == kFoo) return new Foo();
-if (x == kBar) return new Bar();
-
- -

This is not allowed when the if statement has an -else:

- -
// Not allowed - IF statement on one line when there is an ELSE clause
-if (x) DoThis();
-else DoThat();
-
- -

In general, curly braces are not required for -single-line statements, but they are allowed if you like -them; conditional or loop statements with complex -conditions or statements may be more readable with curly -braces. Some -projects require that an -if must always always have an accompanying -brace.

- -
if (condition)
-  DoSomething();  // 2 space indent.
-
-if (condition) {
-  DoSomething();  // 2 space indent.
-}
-
- -

However, if one part of an -if-else statement uses curly -braces, the other part must too:

- -
// Not allowed - curly on IF but not ELSE
-if (condition) {
-  foo;
-} else
-  bar;
-
-// Not allowed - curly on ELSE but not IF
-if (condition)
-  foo;
-else {
-  bar;
-}
-
- -
// Curly braces around both IF and ELSE required because
-// one of the clauses used braces.
-if (condition) {
-  foo;
-} else {
-  bar;
-}
-
- -
- -

Loops and Switch Statements

- -
-

Switch statements may use braces for blocks. Annotate -non-trivial fall-through between cases. -Braces are optional for single-statement loops. -Empty loop bodies should use {} or continue.

-
- -
- -

case blocks in switch -statements can have curly braces or not, depending on -your preference. If you do include curly braces they -should be placed as shown below.

- -

If not conditional on an enumerated value, switch -statements should always have a default case -(in the case of an enumerated value, the compiler will -warn you if any values are not handled). If the default -case should never execute, simply -assert:

- - - -
-
switch (var) {
-  case 0: {  // 2 space indent
-    ...      // 4 space indent
-    break;
-  }
-  case 1: {
-    ...
-    break;
-  }
-  default: {
-    assert(false);
-  }
-}
-
-
- - - - - -

Braces are optional for single-statement loops.

- -
for (int i = 0; i < kSomeNumber; ++i)
-  printf("I love you\n");
-
-for (int i = 0; i < kSomeNumber; ++i) {
-  printf("I take it back\n");
-}
-
- - -

Empty loop bodies should use {} or -continue, but not a single semicolon.

- -
while (condition) {
-  // Repeat test until it returns false.
-}
-for (int i = 0; i < kSomeNumber; ++i) {}  // Good - empty body.
-while (condition) continue;  // Good - continue indicates no logic.
-
- -
while (condition);  // Bad - looks like part of do/while loop.
-
- -
- -

Pointer and Reference Expressions

- -
-

No spaces around period or arrow. Pointer operators do not -have trailing spaces.

-
- -
- -

The following are examples of correctly-formatted -pointer and reference expressions:

- -
x = *p;
-p = &x;
-x = r.y;
-x = r->y;
-
- -

Note that:

- -
    -
  • There are no spaces around the period or arrow when - accessing a member.
  • - -
  • Pointer operators have no space after the - * or &.
  • -
- -

When declaring a pointer variable or argument, you may -place the asterisk adjacent to either the type or to the -variable name:

- -
// These are fine, space preceding.
-char *c;
-const string &str;
-
-// These are fine, space following.
-char* c;    // but remember to do "char* c, *d, *e, ...;"!
-const string& str;
-
- -
char * c;  // Bad - spaces on both sides of *
-const string & str;  // Bad - spaces on both sides of &
-
- -

You should do this consistently within a single -file, -so, when modifying an existing file, use the style in -that file.

- -
- -

Boolean Expressions

- -
-

When you have a boolean expression that is longer than the -standard line length, be -consistent in how you break up the lines.

-
- -
- -

In this example, the logical AND operator is always at -the end of the lines:

- -
if (this_one_thing > this_other_thing &&
-    a_third_thing == a_fourth_thing &&
-    yet_another && last_one) {
-  ...
-}
-
- -

Note that when the code wraps in this example, both of -the && logical AND operators are at -the end of the line. This is more common in Google code, -though wrapping all operators at the beginning of the -line is also allowed. Feel free to insert extra -parentheses judiciously because they can be very helpful -in increasing readability when used -appropriately. Also note that you should always use -the punctuation operators, such as -&& and ~, rather than -the word operators, such as and and -compl.

- -
- -

Return Values

- -
-

Do not needlessly surround the return -expression with parentheses.

-
- -
- -

Use parentheses in return expr; only -where you would use them in x = expr;.

- -
return result;                  // No parentheses in the simple case.
-// Parentheses OK to make a complex expression more readable.
-return (some_long_condition &&
-        another_condition);
-
- -
return (value);                // You wouldn't write var = (value);
-return(result);                // return is not a function!
-
- -
- - - -

Variable and Array Initialization

- -
-

Your choice of =, (), or -{}.

-
- -
- -

You may choose between =, -(), and {}; the following are -all correct:

- -
int x = 3;
-int x(3);
-int x{3};
-string name = "Some Name";
-string name("Some Name");
-string name{"Some Name"};
-
- -

Be careful when using a braced initialization list {...} -on a type with an std::initializer_list constructor. -A nonempty braced-init-list prefers the -std::initializer_list constructor whenever -possible. Note that empty braces {} are special, and -will call a default constructor if available. To force the -non-std::initializer_list constructor, use parentheses -instead of braces.

- -
vector<int> v(100, 1);  // A vector of 100 1s.
-vector<int> v{100, 1};  // A vector of 100, 1.
-
- -

Also, the brace form prevents narrowing of integral -types. This can prevent some types of programming -errors.

- -
int pi(3.14);  // OK -- pi == 3.
-int pi{3.14};  // Compile error: narrowing conversion.
-
- -
- -

Preprocessor Directives

- -
-

The hash mark that starts a preprocessor directive should -always be at the beginning of the line.

-
- -
- -

Even when preprocessor directives are within the body -of indented code, the directives should start at the -beginning of the line.

- -
// Good - directives at beginning of line
-  if (lopsided_score) {
-#if DISASTER_PENDING      // Correct -- Starts at beginning of line
-    DropEverything();
-# if NOTIFY               // OK but not required -- Spaces after #
-    NotifyClient();
-# endif
-#endif
-    BackToNormal();
-  }
-
- -
// Bad - indented directives
-  if (lopsided_score) {
-    #if DISASTER_PENDING  // Wrong!  The "#if" should be at beginning of line
-    DropEverything();
-    #endif                // Wrong!  Do not indent "#endif"
-    BackToNormal();
-  }
-
- -
- -

Class Format

- -
-

Sections in public, protected and -private order, each indented one space.

-
- -
- -

The basic format for a class declaration (lacking the -comments, see Class -Comments for a discussion of what comments are -needed) is:

- -
class MyClass : public OtherClass {
- public:      // Note the 1 space indent!
-  MyClass();  // Regular 2 space indent.
-  explicit MyClass(int var);
-  ~MyClass() {}
-
-  void SomeFunction();
-  void SomeFunctionThatDoesNothing() {
-  }
-
-  void set_some_var(int var) { some_var_ = var; }
-  int some_var() const { return some_var_; }
-
- private:
-  bool SomeInternalFunction();
-
-  int some_var_;
-  int some_other_var_;
-};
-
- -

Things to note:

- -
    -
  • Any base class name should be on the same line as - the subclass name, subject to the 80-column limit.
  • - -
  • The public:, protected:, - and private: keywords should be indented - one space.
  • - -
  • Except for the first instance, these keywords - should be preceded by a blank line. This rule is - optional in small classes.
  • - -
  • Do not leave a blank line after these - keywords.
  • - -
  • The public section should be first, - followed by the protected and finally the - private section.
  • - -
  • See Declaration - Order for rules on ordering declarations within - each of these sections.
  • -
- -
- -

Constructor Initializer Lists

- -
-

Constructor initializer lists can be all on one line or -with subsequent lines indented four spaces.

-
- -
- -

There are two acceptable formats for initializer -lists:

- -
// When it all fits on one line:
-MyClass::MyClass(int var) : some_var_(var), some_other_var_(var + 1) {}
-
- -

or

- -
// When it requires multiple lines, indent 4 spaces, putting the colon on
-// the first initializer line:
-MyClass::MyClass(int var)
-    : some_var_(var),             // 4 space indent
-      some_other_var_(var + 1) {  // lined up
-  ...
-  DoSomething();
-  ...
-}
-
- -
- -

Namespace Formatting

- -
-

The contents of namespaces are not indented.

-
- -
- -

Namespaces do not add an -extra level of indentation. For example, use:

- -
namespace {
-
-void foo() {  // Correct.  No extra indentation within namespace.
-  ...
-}
-
-}  // namespace
-
- -

Do not indent within a namespace:

- -
namespace {
-
-  // Wrong.  Indented when it should not be.
-  void foo() {
-    ...
-  }
-
-}  // namespace
-
- -

When declaring nested namespaces, put each namespace -on its own line.

- -
namespace foo {
-namespace bar {
-
- -
- -

Horizontal Whitespace

- -
-

Use of horizontal whitespace depends on location. Never put -trailing whitespace at the end of a line.

-
- -
- -

General

- -
void f(bool b) {  // Open braces should always have a space before them.
-  ...
-int i = 0;  // Semicolons usually have no space before them.
-// Spaces inside braces for braced-init-list are optional.  If you use them,
-// put them on both sides!
-int x[] = { 0 };
-int x[] = {0};
-
-// Spaces around the colon in inheritance and initializer lists.
-class Foo : public Bar {
- public:
-  // For inline function implementations, put spaces between the braces
-  // and the implementation itself.
-  Foo(int b) : Bar(), baz_(b) {}  // No spaces inside empty braces.
-  void Reset() { baz_ = 0; }  // Spaces separating braces from implementation.
-  ...
-
- -

Adding trailing whitespace can cause extra work for -others editing the same file, when they merge, as can -removing existing trailing whitespace. So: Don't -introduce trailing whitespace. Remove it if you're -already changing that line, or do it in a separate -clean-up -operation (preferably when no-one -else is working on the file).

- -

Loops and Conditionals

- -
if (b) {          // Space after the keyword in conditions and loops.
-} else {          // Spaces around else.
-}
-while (test) {}   // There is usually no space inside parentheses.
-switch (i) {
-for (int i = 0; i < 5; ++i) {
-// Loops and conditions may have spaces inside parentheses, but this
-// is rare.  Be consistent.
-switch ( i ) {
-if ( test ) {
-for ( int i = 0; i < 5; ++i ) {
-// For loops always have a space after the semicolon.  They may have a space
-// before the semicolon, but this is rare.
-for ( ; i < 5 ; ++i) {
-  ...
-
-// Range-based for loops always have a space before and after the colon.
-for (auto x : counts) {
-  ...
-}
-switch (i) {
-  case 1:         // No space before colon in a switch case.
-    ...
-  case 2: break;  // Use a space after a colon if there's code after it.
-
- -

Operators

- -
// Assignment operators always have spaces around them.
-x = 0;
-
-// Other binary operators usually have spaces around them, but it's
-// OK to remove spaces around factors.  Parentheses should have no
-// internal padding.
-v = w * x + y / z;
-v = w*x + y/z;
-v = w * (x + z);
-
-// No spaces separating unary operators and their arguments.
-x = -5;
-++x;
-if (x && !y)
-  ...
-
- -

Templates and Casts

- -
// No spaces inside the angle brackets (< and >), before
-// <, or between >( in a cast
-vector<string> x;
-y = static_cast<char*>(x);
-
-// Spaces between type and pointer are OK, but be consistent.
-vector<char *> x;
-set<list<string>> x;        // Permitted in C++11 code.
-set<list<string> > x;       // C++03 required a space in > >.
-
-// You may optionally use symmetric spacing in < <.
-set< list<string> > x;
-
- -
- -

Vertical Whitespace

- -
-

Minimize use of vertical whitespace.

-
- -
- -

This is more a principle than a rule: don't use blank -lines when you don't have to. In particular, don't put -more than one or two blank lines between functions, -resist starting functions with a blank line, don't end -functions with a blank line, and be discriminating with -your use of blank lines inside functions.

- -

The basic principle is: The more code that fits on one -screen, the easier it is to follow and understand the -control flow of the program. Of course, readability can -suffer from code being too dense as well as too spread -out, so use your judgement. But in general, minimize use -of vertical whitespace.

- -

Some rules of thumb to help when blank lines may be -useful:

- -
    -
  • Blank lines at the beginning or end of a function - very rarely help readability.
  • - -
  • Blank lines inside a chain of if-else blocks may - well help readability.
  • -
- -
- -

Exceptions to the Rules

- -

The coding conventions described above are mandatory. -However, like all good rules, these sometimes have exceptions, -which we discuss here.

- - - -
-

Existing Non-conformant Code

- -
-

You may diverge from the rules when dealing with code that -does not conform to this style guide.

-
- -
- -

If you find yourself modifying code that was written -to specifications other than those presented by this -guide, you may have to diverge from these rules in order -to stay consistent with the local conventions in that -code. If you are in doubt about how to do this, ask the -original author or the person currently responsible for -the code. Remember that consistency includes -local consistency, too.

- -
-
- - - -

Windows Code

- -
-

Windows -programmers have developed their own set of coding -conventions, mainly derived from the conventions in Windows -headers and other Microsoft code. We want to make it easy -for anyone to understand your code, so we have a single set -of guidelines for everyone writing C++ on any platform.

-
- -
-

It is worth reiterating a few of the guidelines that -you might forget if you are used to the prevalent Windows -style:

- -
    -
  • Do not use Hungarian notation (for example, naming - an integer iNum). Use the Google naming - conventions, including the .cc extension - for source files.
  • - -
  • Windows defines many of its own synonyms for - primitive types, such as DWORD, - HANDLE, etc. It is perfectly acceptable, - and encouraged, that you use these types when calling - Windows API functions. Even so, keep as close as you - can to the underlying C++ types. For example, use - const TCHAR * instead of - LPCTSTR.
  • - -
  • When compiling with Microsoft Visual C++, set the - compiler to warning level 3 or higher, and treat all - warnings as errors.
  • - -
  • Do not use #pragma once; instead use - the standard Google include guards. The path in the - include guards should be relative to the top of your - project tree.
  • - -
  • In fact, do not use any nonstandard extensions, - like #pragma and __declspec, - unless you absolutely must. Using - __declspec(dllimport) and - __declspec(dllexport) is allowed; however, - you must use them through macros such as - DLLIMPORT and DLLEXPORT, so - that someone can easily disable the extensions if they - share the code.
  • -
- -

However, there are just a few rules that we -occasionally need to break on Windows:

- -
    -
  • Normally we forbid - the use of multiple implementation inheritance; - however, it is required when using COM and some ATL/WTL - classes. You may use multiple implementation - inheritance to implement COM or ATL/WTL classes and - interfaces.
  • - -
  • Although you should not use exceptions in your own - code, they are used extensively in the ATL and some - STLs, including the one that comes with Visual C++. - When using the ATL, you should define - _ATL_NO_EXCEPTIONS to disable exceptions. - You should investigate whether you can also disable - exceptions in your STL, but if not, it is OK to turn on - exceptions in the compiler. (Note that this is only to - get the STL to compile. You should still not write - exception handling code yourself.)
  • - -
  • The usual way of working with precompiled headers - is to include a header file at the top of each source - file, typically with a name like StdAfx.h - or precompile.h. To make your code easier - to share with other projects, avoid including this file - explicitly (except in precompile.cc), and - use the /FI compiler option to include the - file automatically.
  • - -
  • Resource headers, which are usually named - resource.h and contain only macros, do not - need to conform to these style guidelines.
  • -
- -
- - - - - -

Use common sense and BE CONSISTENT.

- -

If you are editing code, take a few minutes to look at the -code around you and determine its style. If they use spaces -around their if clauses, you should, too. If their -comments have little boxes of stars around them, make your -comments have little boxes of stars around them too.

- -

The point of having style guidelines is to have a common -vocabulary of coding so people can concentrate on what you are -saying, rather than on how you are saying it. We present global -style rules here so people know the vocabulary. But local style -is also important. If code you add to a file looks drastically -different from the existing code around it, the discontinuity -throws readers out of their rhythm when they go to read it. Try -to avoid this.

- - - -

OK, enough writing about writing code; the code itself is much -more interesting. Have fun!

- -
- -

Revision 4.45

- -
- diff --git a/lib/cpplint_4.45/include/link.png b/lib/cpplint_4.45/include/link.png deleted file mode 100644 index 75d5c7ba8dc..00000000000 Binary files a/lib/cpplint_4.45/include/link.png and /dev/null differ diff --git a/lib/cpplint_4.45/include/styleguide.css b/lib/cpplint_4.45/include/styleguide.css deleted file mode 100644 index ef62024d097..00000000000 --- a/lib/cpplint_4.45/include/styleguide.css +++ /dev/null @@ -1,261 +0,0 @@ -/* General CSS */ - -body { - background-color: #fff; - color: #333; - font-family: sans-serif; - font-size: 10pt; - margin-right: 100px; - margin-left: 100px; -} - -h1 { - text-align: center; - font-size: 18pt; -} - -h1, h2, h3, h4, h5, h6 { - color: #06c; - margin-top: 2em; - margin-bottom: 1em; - padding: 25px; - font-weight:bold; -} - -h2, -h3, -h4, -h5, -h6 { - margin-top:1.5em; - margin-bottom:.75em; -} - -h1 {font-size:200%;} -h2 {font-size:167%;} -h3 {font-size:133%;} -h4 {font-size:120%;} -h5 {font-size:110%;} - - -table { - border: 1px solid #bbb; - border-spacing: 0; - border-collapse: collapse; - margin: 0 0 1.5em; - vertical-align: middle; - width: 100% -} - -td, th { - border: 1px solid #ccc; - padding: 2px 12px; - font-size: 10pt; -} - -code, samp, var { - background-color:#FAFAFA; - white-space: nowrap -} - -pre { - padding:6px 10px; - background-color:#FAFAFA; - border:1px solid #bbb; - overflow:auto; -} - -pre.prettyprint { - padding:6px 10px !important; - border:1px solid #bbb !important; -} - -code.bad, code.badcode { - color: magenta; -} - -pre.bad, pre.badcode { - background-color:#ffe6d8; - border-top:1px inset #a03; - border-left:1px inset #a03; -} - -hr { - margin-top: 3.5em; - border-width: 1px; - color: #fff; -} - -/* TOC CSS */ - -table.columns { - border: none; -} - -td.two_columns { - -webkit-column-count: 2; - column-count: 2; -} - -.toc_category { - font-size: 10pt; - padding-top: 1em; - padding-bottom: 1em; - border-left-width: 2px; - border-right-width: 2px; - border-color: grey; -} - -.toc_stylepoint { - font-size: 10pt; - padding-top: 1em; - padding-bottom: 1em; -} - -li.toc_entry { - padding-right: 1em; - display: inline; - list-style-type: none; -} - -/* - * This space is required to trigger the linewrap on the links - * at href boundaries - */ -li.toc_entry::after { - content: " "; - } - -li.toc_entry a { - white-space: nowrap; -} - -/* Horizontal TOC */ -.toc td, .toc th { - border-width: 1px 5px; - overflow: hidden; -} - -/* Vertical TOC */ - -.toc td.two_columns { - border-width: 0px; -} - -/* Special Sections */ - -address { - text-align: right; -} - -.revision { - text-align: right; -} - -.headerbox { - margin-left: 50%; - font-size: 75%; -} - -.legend { - padding-top: 1em; - margin-left: 50%; - font-size: 10pt; -} - -.link_button { - float: left; - display: none; - background-color: #f8f8ff; - border-color: #f0f0ff; - border-style: solid; - border-width: 1px; - font-size: 75%; - margin-top: 0; - margin-left: -50px; - padding: 24px; - border-radius: 3px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; -} - -.ignoreLink { - padding: 0px; -} - -.divider{ - width:5px; - height:auto; - display:inline-block; -} - -/* Style Guide semantic CSS */ - -.summary { - margin-top: 1em; - margin-bottom: 1em; -} - -.stylebody { - margin-top: 1em; - margin-bottom: 1em; -} - -.stylepoint_section { - display: block; - margin-bottom: 1em; - font-family: sans-serif; - font-weight: bold; -} - -.stylepoint_subsection { - display: block; - margin-bottom: 1em; -} - -.stylepoint_subsubsection { - display: block; - margin-bottom: 1em; -} - -.definition:before { - content: "Definition: "; - font-weight: bold; - display: block; - margin-bottom: 1em; -} - -.pros:before { - content: "Pros: "; - font-weight: bold; - display: block; - margin-bottom: 1em; -} - -.cons:before { - content: "Cons: "; - font-weight: bold; - display: block; - margin-bottom: 1em; -} - -.decision:before { - content: "Decision: "; - font-weight: bold; - display: block; - margin-bottom: 1em; -} - -.exception:before { - content: "Exception: "; - font-weight: bold; - display: block; - margin-bottom: 1em; -} - -.note:before { - content: "Note: "; - font-weight: bold; - display: block; - margin-bottom: 1em; -} diff --git a/lib/cpplint_4.45/include/styleguide.js b/lib/cpplint_4.45/include/styleguide.js deleted file mode 100644 index accb7796806..00000000000 --- a/lib/cpplint_4.45/include/styleguide.js +++ /dev/null @@ -1,289 +0,0 @@ -TocTypeEnum = { - VERTICAL: 1, - HORIZONTAL: 2 -}; - -function CreateTOC(tocElement) { - - // Find the toc element DIV. We'll place our TOC there. - var toc = document.getElementById(tocElement); - - var tocTypeClass = toc.className; - var tocType; - - switch (tocTypeClass) { - case 'horizontal_toc': - tocType = TocTypeEnum.HORIZONTAL; - break; - case 'vertical_toc': - tocType = TocTypeEnum.VERTICAL; - break; - default: - tocType = TocTypeEnum.VERTICAL; - break; - } - - // If toc_levels is defined, set headingLevels to it. - // Otherwise, use default value of "h2,h3" - var headingLevels; - if (typeof toc_levels === 'undefined') { - headingLevels = 'h2,h3'; - } else { - - } - - // Collect all section heading elements in an array - var headings = document.querySelectorAll(headingLevels); - - // Add TOC title elements - var tocHeadingDiv = document.createElement('div'); - toc.appendChild(tocHeadingDiv); - tocHeadingDiv.className = 'toc_title'; - var tocHeading = document.createElement('h3'); - toc.appendChild(tocHeading); - tocHeading.className = 'ignoreLink'; - tocHeading.id = 'toc'; - var tocText = document.createTextNode('Table of Contents'); - tocHeading.appendChild(tocText); - - // Add table and tbody - var tocTable = document.createElement('table'); - if (tocType == TocTypeEnum.VERTICAL) { - tocTable.className = 'columns'; - } - toc.appendChild(tocTable); - - var tbody_element = document.createElement('tbody'); - tbody_element.setAttribute('valign', 'top'); - tbody_element.className = 'toc'; - tocTable.appendChild(tbody_element); - - // Get the highest level heading - var firstHeading = headings[0]; - var masterLevel = parseInt(headingLevels.charAt(1)); - - // Get the lowest heading level - var lowestLevel = parseInt(headingLevels.charAt(headingLevels - 1)); - - switch (tocType) { - case TocTypeEnum.HORIZONTAL: - CreateHorizontalTOC(headings, masterLevel, lowestLevel, tbody_element); - break; - case TocTypeEnum.VERTICAL: - CreateVerticalTOC(headings, masterLevel, lowestLevel, tbody_element); - break; - default: - } -} - -function CreateHorizontalTOC( - headings, masterLevel, lowestLevel, tbody_element) { - - // Initialize the header counter - var h = 0; - var ignoreChildren = false; - - while (h < headings.length) { - // Get current heading - var heading = headings[h]; - - // Get the current heading level - var level = parseInt(heading.tagName.charAt(1)); - - if (isNaN(level) || level < 1 || level > lowestLevel) continue; - - // If level is a masterLevel, make it a TOC parent category - if ((level == masterLevel) && (!hasClass(heading, 'ignoreLink'))) { - toc_current_row = AddTOCMaster(tbody_element, heading); - ignoreChildren = false; - } - - if ((level == masterLevel) && (hasClass(heading, 'ignoreLink'))) { - ignoreChildren = true; - } - - if ((level != masterLevel) && (!ignoreChildren)) { - AddTOCElements(toc_current_row, heading); - } - - // Advance the header counter - h++; - } -} - -// Adds a master Table of Content heading -function AddTOCMaster(tocTable, heading) { - - // Add the table row scaffolding - var toc_tr = document.createElement('tr'); - tocTable.appendChild(toc_tr); - toc_tr.setAttribute('valign', 'top'); - var toc_tr_td = document.createElement('td'); - toc_tr.appendChild(toc_tr_td); - var toc_category = document.createElement('div'); - toc_tr_td.appendChild(toc_category); - toc_category.className = 'toc_category'; - - // Create the link to this header - var link = document.createElement('a'); - link.href = '#' + heading.id; // Create the anchor link - link.textContent = heading.textContent; // Link text is same as heading - toc_category.appendChild(link); - - // Add the container table cell for its children - var toc_td = document.createElement('td'); - toc_tr.appendChild(toc_td); - var toc_td_div = document.createElement('div'); - toc_td_div.className = 'toc_stylepoint'; - toc_td.appendChild(toc_td_div); - - return (toc_td_div); -} - -// Adds Table of Contents element to a master heading as children -function AddTOCElements(toc_div, heading) { - - if (heading.offsetParent === null) { - // The element is currently hidden, so don't create a TOC entry - } else { - // Create the list item element - var toc_list_element = document.createElement('li'); - toc_list_element.className = 'toc_entry'; - toc_div.appendChild(toc_list_element); - - // Create the link to this header - var link = document.createElement('a'); - link.href = '#' + heading.id; // Create the anchor link - link.textContent = heading.textContent; // Link text is same as heading - toc_list_element.appendChild(link); - } -} - -function CreateVerticalTOC(headings, masterLevel, lowestLevel, tbody_element) { - - // Create the Column scaffolding - var toc_tr = document.createElement('tr'); - tbody_element.appendChild(toc_tr); - var toc_tr_td = document.createElement('td'); - toc_tr_td.className = 'two_columns'; - toc_tr.appendChild(toc_tr_td); - - - // Initialize the header counter and the current row - var h = 0; - var toc_current_col = null; - var ignoreChildren = false; - - while (h < headings.length) { - // Get current heading - var heading = headings[h]; - - // Get the current heading level - var level = parseInt(heading.tagName.charAt(1)); - - if (isNaN(level) || level < 1 || level > lowestLevel) continue; - - // If level is a masterLevel, make it a TOC parent category - if ((level == masterLevel) && (!hasClass(heading, 'ignoreLink'))) { - if (heading.offsetParent === null) { - // The element is currently hidden, so don't create a TOC entry - } else { - var td_dl = document.createElement('dl'); - toc_tr_td.appendChild(td_dl); - var td_dt = document.createElement('dt'); - td_dl.appendChild(td_dt); - toc_current_col = td_dl; - - // Create the link to this header - var link = document.createElement('a'); - link.href = '#' + heading.id; // Create the anchor link - link.textContent = heading.textContent; // Link text is same as heading - td_dt.appendChild(link); - ignoreChildren = false; - } - } - - // If level is a masterLevel but it's specified to ignore links, skip it - // and its children. - if ((level == masterLevel) && (hasClass(heading, 'ignoreLink'))) { - ignoreChildren = true; - } - - if ((level != masterLevel) && (!ignoreChildren)) { - if (heading.offsetParent === null) { - // The element is currently hidden, so don't create a TOC entry - } else { - var td_dd = document.createElement('dd'); - toc_current_col.appendChild(td_dd); - // Create the link to this header - var link = document.createElement('a'); - link.href = '#' + heading.id; // Create the anchor link - link.textContent = heading.textContent; // Link text is same as heading - td_dd.appendChild(link); - } - } - - // Advance the header counter - h++; - } -} - -/* - * Utility function for finding elements with a given - * class. - */ -function hasClass(element, cls) { - return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1; -} - -/* - * Linkify all h2 through h4 headers, except for those marked - * "ignoreLink" - */ - -// Add the link image to the element. -function LinkifyHeader(header, fileName, sizePixels) { - var link = document.createElement('a'); - link.href = '#' + header.id; - link.alt = 'link to ' + header.id; - link.innerHTML = - ''; - header.appendChild(link); -} - -// Find all elements of the given tag and linkify if -// they don't have 'ignoreLink' in their class. -function LinkifyHeadersForTag(tagName) { - var headers = document.getElementsByTagName(tagName); - var header; - for (var j = 0; j != headers.length; j++) { - header = headers[j]; - if (!hasClass(header, 'ignoreLink') && ('id' in header)) { - if (header.id != '') { - LinkifyHeader(header, 'link.png', 21); - header.style.left = '-46px'; - header.style.position = 'relative'; - } - } - } -} - -// Linkify all h2, h3, and h4s. h1s are titles. -function LinkifyHeaders() { - LinkifyHeadersForTag('h2'); - LinkifyHeadersForTag('h3'); - LinkifyHeadersForTag('h4'); -} - -/* - * Initialize the style guide by showing all internal - * elements and then linkifying the headers. - */ - -function initStyleGuide() { - LinkifyHeaders(); - CreateTOC('tocDiv'); -} diff --git a/make/cpplint b/make/cpplint index 44fca5344f1..6c890db96d8 100644 --- a/make/cpplint +++ b/make/cpplint @@ -1,13 +1,5 @@ -PYTHON2 ?= python -# Check version because new distros have python to default to Python3 -PYTHON_VERSION := $(shell $(PYTHON2) -c "print(__import__('sys').version.split(' ' )[0].split('.')[0])") -ifeq ($(PYTHON_VERSION),) - $(warning Python2 required by cpplint, but PYTHON2=$(PYTHON2) not found. See 'make help') -endif -ifeq ($(PYTHON_VERSION),3) - $(warning Python2 required by cpplint, but PYTHON2=$(PYTHON2) is Python3. See 'make help') -endif +PYTHON ?= python .PHONY: cpplint cpplint: - @$(PYTHON2) $(CPPLINT)/cpplint.py --output=vs7 --counting=detailed --root=stan --extension=hpp,cpp --filter=-runtime/indentation_namespace,-build/c++11,-readability/namespace,-legal/copyright,-whitespace/indent,-runtime/reference $(shell (find test/unit -name '*.hpp' -o -name '*.cpp') && (find stan -name '*.hpp' -o -name '*.cpp')) + @$(PYTHON) $(CPPLINT)/cpplint.py --output=vs7 --counting=detailed --root=stan --extension=hpp,cpp --filter=-runtime/indentation_namespace,-build/c++11,-readability/namespace,-legal/copyright,-whitespace/indent,-runtime/reference,-build/header_guard,-build/include_order,-build/include_what_you_use,-runtime/string,-build/namespaces $(shell (find test/unit -name '*.hpp' -o -name '*.cpp') && (find stan -name '*.hpp' -o -name '*.cpp')) diff --git a/make/libraries b/make/libraries index d9adfd11667..9e72a85aa33 100644 --- a/make/libraries +++ b/make/libraries @@ -8,7 +8,7 @@ OPENCL ?= $(MATH)lib/opencl_2.2.0 TBB ?= $(MATH)lib/tbb_2019_U8 SUNDIALS ?= $(MATH)lib/sundials_5.2.0 GTEST ?= $(MATH)lib/gtest_1.8.1 -CPPLINT ?= $(MATH)lib/cpplint_4.45 +CPPLINT ?= $(MATH)lib/cpplint_1.4.5 ################################################################################ # SUNDIALS build rules